pb-sxp-ui 1.0.42 → 1.0.43

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 (60) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +111 -111
  3. package/dist/index.cjs +237 -600
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.css +4 -54
  6. package/dist/index.js +237 -599
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.min.cjs +3 -4
  9. package/dist/index.min.cjs.map +1 -1
  10. package/dist/index.min.js +3 -4
  11. package/dist/index.min.js.map +1 -1
  12. package/dist/pb-ui.js +241 -603
  13. package/dist/pb-ui.js.map +1 -1
  14. package/dist/pb-ui.min.js +3 -4
  15. package/dist/pb-ui.min.js.map +1 -1
  16. package/es/core/components/SxpPageCore/index.js +2 -2
  17. package/es/core/components/SxpPageRender/Nudge/index.js +5 -6
  18. package/es/core/components/SxpPageRender/VideoWidget/index.d.ts +1 -0
  19. package/es/core/components/SxpPageRender/VideoWidget/index.js +119 -88
  20. package/es/core/components/SxpPageRender/WaterFall/index.js +1 -1
  21. package/es/core/components/SxpPageRender/index.d.ts +0 -2
  22. package/es/core/components/SxpPageRender/index.js +63 -25
  23. package/es/core/context/SxpDataSourceProvider.d.ts +2 -3
  24. package/es/core/context/SxpDataSourceProvider.js +7 -28
  25. package/es/core/hooks/useEventReport.js +4 -4
  26. package/es/index.d.ts +0 -1
  27. package/es/index.js +0 -1
  28. package/es/materials/sxp/popup/CommodityDetail/index.js +10 -10
  29. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +10 -10
  30. package/lib/core/components/SxpPageCore/index.js +2 -2
  31. package/lib/core/components/SxpPageRender/Nudge/index.js +5 -6
  32. package/lib/core/components/SxpPageRender/VideoWidget/index.d.ts +1 -0
  33. package/lib/core/components/SxpPageRender/VideoWidget/index.js +119 -88
  34. package/lib/core/components/SxpPageRender/WaterFall/index.js +1 -1
  35. package/lib/core/components/SxpPageRender/index.d.ts +0 -2
  36. package/lib/core/components/SxpPageRender/index.js +63 -25
  37. package/lib/core/context/SxpDataSourceProvider.d.ts +2 -3
  38. package/lib/core/context/SxpDataSourceProvider.js +7 -28
  39. package/lib/core/hooks/useEventReport.js +4 -4
  40. package/lib/index.d.ts +0 -1
  41. package/lib/index.js +1 -3
  42. package/lib/materials/sxp/popup/CommodityDetail/index.js +10 -10
  43. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +10 -10
  44. package/package.json +114 -115
  45. package/es/core/components/DiyPortalPreview/PictureGroup.d.ts +0 -13
  46. package/es/core/components/DiyPortalPreview/PictureGroup.js +0 -11
  47. package/es/core/components/DiyPortalPreview/VideoWidget.d.ts +0 -15
  48. package/es/core/components/DiyPortalPreview/VideoWidget.js +0 -236
  49. package/es/core/components/DiyPortalPreview/index.d.ts +0 -6
  50. package/es/core/components/DiyPortalPreview/index.js +0 -127
  51. package/es/core/components/SxpPageRender/Tagbar.d.ts +0 -7
  52. package/es/core/components/SxpPageRender/Tagbar.js +0 -37
  53. package/lib/core/components/DiyPortalPreview/PictureGroup.d.ts +0 -13
  54. package/lib/core/components/DiyPortalPreview/PictureGroup.js +0 -14
  55. package/lib/core/components/DiyPortalPreview/VideoWidget.d.ts +0 -15
  56. package/lib/core/components/DiyPortalPreview/VideoWidget.js +0 -239
  57. package/lib/core/components/DiyPortalPreview/index.d.ts +0 -6
  58. package/lib/core/components/DiyPortalPreview/index.js +0 -130
  59. package/lib/core/components/SxpPageRender/Tagbar.d.ts +0 -7
  60. package/lib/core/components/SxpPageRender/Tagbar.js +0 -40
@@ -8,8 +8,7 @@ const sessionStore_1 = require("../utils/sessionStore");
8
8
  const localStore_1 = require("../utils/localStore");
9
9
  const useIconLink_1 = require("../components/SxpPageRender/useIconLink");
10
10
  exports.SxpDataSourceContext = (0, react_1.createContext)({
11
- rtcList: [],
12
- tagList: []
11
+ rtcList: []
13
12
  });
14
13
  var DataSourceType;
15
14
  (function (DataSourceType) {
@@ -18,7 +17,6 @@ var DataSourceType;
18
17
  const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
19
18
  const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false }) => {
20
19
  const [rtcList, setRtcList] = (0, react_1.useState)([]);
21
- const [tagList, setTagList] = (0, react_1.useState)([]);
22
20
  const [loading, setLoading] = (0, react_1.useState)(false);
23
21
  const [curReqInfo, setCurReqInfo] = (0, react_1.useState)({ rtc: '', requestId: '' });
24
22
  const swiperRef = (0, react_1.useRef)(null);
@@ -29,6 +27,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
29
27
  const [cacheRtcList, setCacheRtcList] = (0, react_1.useState)([]);
30
28
  const [cacheActiveIndex, setCacheActiveIndex] = (0, react_1.useState)(0);
31
29
  const [isFromHashtag, setIsFromHashtag] = (0, react_1.useState)(false);
30
+ const [videoRef, setVideoRef] = (0, react_1.useState)(null);
32
31
  (0, react_1.useEffect)(() => {
33
32
  setOpenHashtag(isOpenHashTag);
34
33
  }, [isOpenHashTag]);
@@ -131,18 +130,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
131
130
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/customform', { method: 'POST', body }));
132
131
  return res === null || res === void 0 ? void 0 : res.success;
133
132
  }), [bffFetch]);
134
- const bffGetTagList = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
135
- var _g, _h;
136
- if (!utmVal)
137
- return;
138
- try {
139
- const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: utmVal } }));
140
- setTagList((_h = (_g = result === null || result === void 0 ? void 0 : result.data) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []);
141
- }
142
- catch (e) {
143
- console.log('e', e);
144
- }
145
- }), [bffFetch, utmVal]);
146
133
  const ctaEvent = (0, react_1.useCallback)((eventInfo, rec, product, position) => {
147
134
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
148
135
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
@@ -158,12 +145,11 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
158
145
  fromKName = 'imagePage';
159
146
  }
160
147
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
161
- eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : '', fromKName })
148
+ eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', relatedContentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', relatedProductId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : '', fromKName })
162
149
  });
163
150
  }, [bffEventReport, isFromHashtag]);
164
151
  (0, react_1.useEffect)(() => {
165
152
  setLoading(true);
166
- bffGetTagList();
167
153
  getRecommendVideos()
168
154
  .then((data) => {
169
155
  var _a, _b;
@@ -179,7 +165,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
179
165
  if (!isInit.current)
180
166
  return;
181
167
  setLoading(true);
182
- bffGetTagList();
183
168
  getRecommendVideos()
184
169
  .then((data) => {
185
170
  var _a, _b;
@@ -189,7 +174,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
189
174
  .finally(() => {
190
175
  setLoading(false);
191
176
  });
192
- }, [getRecommendVideos, bffGetTagList]);
177
+ }, [getRecommendVideos]);
193
178
  const defaultLoadingImage = (0, useIconLink_1.useIconLink)('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
194
179
  return (react_1.default.createElement(exports.SxpDataSourceContext.Provider, { value: {
195
180
  rtcList,
@@ -222,14 +207,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
222
207
  hashTagSize,
223
208
  loadingImage: loadingImage !== null && loadingImage !== void 0 ? loadingImage : defaultLoadingImage,
224
209
  isOpenHashTag,
225
- tagList,
226
- setLoading
227
- } }, render({
228
- rtcList,
229
- mutateLike: bffMutateLike,
230
- mutateUnlike: bffMutateUnlike,
231
- submitForm: bffSubmitForm,
232
- tagList
233
- })));
210
+ videoRef,
211
+ setVideoRef
212
+ } }, render({ rtcList, mutateLike: bffMutateLike, mutateUnlike: bffMutateUnlike, submitForm: bffSubmitForm })));
234
213
  };
235
214
  exports.default = (0, react_1.memo)(SxpDataSourceProvider);
@@ -35,8 +35,8 @@ function useEventReport() {
35
35
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
36
36
  contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
37
37
  position: position + '',
38
- contentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
39
- ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
38
+ relatedContentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
39
+ relatedCtatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
40
40
  traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
41
41
  }
42
42
  });
@@ -60,8 +60,8 @@ function useEventReport() {
60
60
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
61
61
  contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
62
62
  position: position + '',
63
- contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
64
- ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
63
+ relatedContentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
64
+ relatedCtatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
65
65
  traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
66
66
  timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
67
67
  eventSubject: 'productView',
package/lib/index.d.ts CHANGED
@@ -2,7 +2,6 @@ import { Pagebuilder } from './core/Pagebuilder';
2
2
  export * as core from './core';
3
3
  export * as materials from './materials';
4
4
  export { default as SxpPageRender } from './core/components/SxpPageRender';
5
- export { default as DiyPortalPreview } from './core/components/DiyPortalPreview';
6
5
  export { default as Modal } from './core/components/SxpPageRender/Modal';
7
6
  export { default as SxpDataSourceProvider } from './core/context/SxpDataSourceProvider';
8
7
  export { default as SxpPageCore } from './core/components/SxpPageCore';
package/lib/index.js CHANGED
@@ -1,14 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultSetting = exports.useEditorDataProvider = exports.EditorDataProvider = exports.SxpPageCore = exports.SxpDataSourceProvider = exports.Modal = exports.DiyPortalPreview = exports.SxpPageRender = exports.materials = exports.core = void 0;
3
+ exports.defaultSetting = exports.useEditorDataProvider = exports.EditorDataProvider = exports.SxpPageCore = exports.SxpDataSourceProvider = exports.Modal = exports.SxpPageRender = exports.materials = exports.core = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const Pagebuilder_1 = require("./core/Pagebuilder");
6
6
  exports.core = tslib_1.__importStar(require("./core"));
7
7
  exports.materials = tslib_1.__importStar(require("./materials"));
8
8
  var SxpPageRender_1 = require("./core/components/SxpPageRender");
9
9
  Object.defineProperty(exports, "SxpPageRender", { enumerable: true, get: function () { return tslib_1.__importDefault(SxpPageRender_1).default; } });
10
- var DiyPortalPreview_1 = require("./core/components/DiyPortalPreview");
11
- Object.defineProperty(exports, "DiyPortalPreview", { enumerable: true, get: function () { return tslib_1.__importDefault(DiyPortalPreview_1).default; } });
12
10
  var Modal_1 = require("./core/components/SxpPageRender/Modal");
13
11
  Object.defineProperty(exports, "Modal", { enumerable: true, get: function () { return tslib_1.__importDefault(Modal_1).default; } });
14
12
  var SxpDataSourceProvider_1 = require("./core/context/SxpDataSourceProvider");
@@ -12,7 +12,7 @@ const Modal_1 = tslib_1.__importDefault(require("../../../../core/components/Sxp
12
12
  const ExpandableText_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/ExpandableText"));
13
13
  const FormatImage_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/FormatImage"));
14
14
  const CommodityDetail = (_a) => {
15
- var _b, _c, _d, _e, _f, _g, _h, _j, _k;
15
+ var _b, _c, _d, _e, _f, _g, _h, _j;
16
16
  var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index"]);
17
17
  const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
18
18
  const { popupDetailData, bffEventReport, isPreview, waterFallData } = (0, hooks_1.useSxpDataSource)();
@@ -53,7 +53,7 @@ const CommodityDetail = (_a) => {
53
53
  return '$7,000';
54
54
  }
55
55
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
56
- const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
56
+ const width = isPreview ? 375 : window.innerWidth;
57
57
  const renderContent = ({ isPost }) => {
58
58
  var _a, _b, _c;
59
59
  return (react_1.default.createElement("div", null,
@@ -61,10 +61,10 @@ const CommodityDetail = (_a) => {
61
61
  react_1.default.createElement("div", { className: 'pb-commondity-content-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!product && !(product === null || product === void 0 ? void 0 : product.title) }, (_b = product === null || product === void 0 ? void 0 : product.title) !== null && _b !== void 0 ? _b : 'Pendant in Yellow Gold with Diamonds, Medium'),
62
62
  react_1.default.createElement("div", { className: 'pb-commondity-content-price', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price) }, priceText),
63
63
  react_1.default.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
64
- 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, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
65
- bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
66
- collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
67
- necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
64
+ 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, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
65
+ bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
66
+ collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
67
+ necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
68
68
  18-karat gold, this necklace is embellished with hand-set diamonds.`, maxStr: 79, className: 'pb-commondity-content-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info }))));
69
69
  };
70
70
  const renderBtn = () => {
@@ -73,7 +73,7 @@ const CommodityDetail = (_a) => {
73
73
  };
74
74
  return (react_1.default.createElement("div", { className: 'pb-commondity' },
75
75
  react_1.default.createElement("div", Object.assign({ className: (0, css_1.css)(Object.assign({}, style)) }, props),
76
- product && ((_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.length) > 0 && (react_1.default.createElement(react_2.Swiper, { height: width, modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
76
+ product && ((_f = product === null || product === void 0 ? void 0 : product.homePage) === null || _f === void 0 ? void 0 : _f.length) > 0 && (react_1.default.createElement(react_2.Swiper, { height: width, modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
77
77
  clickable: true,
78
78
  bulletActiveClass: 'swipe-item-active-bullet',
79
79
  clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
@@ -81,7 +81,7 @@ const CommodityDetail = (_a) => {
81
81
  : 'commondityDetail-swiper-clickable-center'
82
82
  }, loop: true, autoplay: {
83
83
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
84
- } }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
84
+ } }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
85
85
  return (react_1.default.createElement(react_2.SwiperSlide, { key: src },
86
86
  react_1.default.createElement("div", { style: {
87
87
  overflow: 'hidden',
@@ -90,7 +90,7 @@ const CommodityDetail = (_a) => {
90
90
  } },
91
91
  react_1.default.createElement(FormatImage_1.default, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
92
92
  }))),
93
- !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (react_1.default.createElement("div", { className: (0, css_1.css)({
93
+ !((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (react_1.default.createElement("div", { className: (0, css_1.css)({
94
94
  position: 'relative',
95
95
  height: 0,
96
96
  width: '100%',
@@ -103,7 +103,7 @@ const CommodityDetail = (_a) => {
103
103
  top: 0,
104
104
  objectFit: 'cover',
105
105
  width: '100%'
106
- }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
106
+ }), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
107
107
  react_1.default.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
108
108
  renderBtn(),
109
109
  react_1.default.createElement(Modal_1.default, { visible: showModal, onClose: () => setShowModal(false) },
@@ -12,7 +12,7 @@ const ExpandableText_1 = tslib_1.__importDefault(require("../../../../core/compo
12
12
  const useEventReport_1 = require("../../../../core/hooks/useEventReport");
13
13
  const FormatImage_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/FormatImage"));
14
14
  const CommodityDetailDiroNew = (_a) => {
15
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
15
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
16
16
  var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index"]);
17
17
  const [spread, setSpread] = (0, react_1.useState)(true);
18
18
  const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
@@ -60,7 +60,7 @@ const CommodityDetailDiroNew = (_a) => {
60
60
  return '£102,300.00';
61
61
  }
62
62
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
63
- const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
63
+ const width = isPreview ? 375 : window.innerWidth;
64
64
  const handleClickCollapse = () => {
65
65
  setSpread(!spread);
66
66
  };
@@ -86,12 +86,12 @@ const CommodityDetailDiroNew = (_a) => {
86
86
  const productInfoText = ({ isPost }) => {
87
87
  return (react_1.default.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
88
88
  react_1.default.createElement(ExpandableText_1.default, { isPost: isPost, onClick: () => setShowModal(true), className: 'pb-commondityDiroNew-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (product === null || product === void 0 ? void 0 : product.info) ||
89
- `Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
89
+ `Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
90
90
  Made in Italy` })));
91
91
  };
92
92
  return (react_1.default.createElement("div", { className: 'pb-commondityDiroNew' },
93
93
  react_1.default.createElement("div", Object.assign({ ref: scrollRef, className: (0, css_1.css)(Object.assign({}, style)) }, props),
94
- product && ((_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.length) > 0 && (react_1.default.createElement(react_2.Swiper, { height: width, modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
94
+ product && ((_f = product === null || product === void 0 ? void 0 : product.homePage) === null || _f === void 0 ? void 0 : _f.length) > 0 && (react_1.default.createElement(react_2.Swiper, { height: width, modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
95
95
  clickable: true,
96
96
  bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
97
97
  clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
@@ -99,7 +99,7 @@ Made in Italy` })));
99
99
  : 'commondityDiroNew-swiper-clickable-center'
100
100
  }, loop: true, autoplay: {
101
101
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
102
- } }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
102
+ } }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
103
103
  return (react_1.default.createElement(react_2.SwiperSlide, { key: src },
104
104
  react_1.default.createElement("div", { style: {
105
105
  overflow: 'hidden',
@@ -108,7 +108,7 @@ Made in Italy` })));
108
108
  } },
109
109
  react_1.default.createElement(FormatImage_1.default, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
110
110
  }))),
111
- !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (react_1.default.createElement("div", { className: (0, css_1.css)({
111
+ !((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (react_1.default.createElement("div", { className: (0, css_1.css)({
112
112
  position: 'relative',
113
113
  height: 0,
114
114
  width: '100%',
@@ -121,16 +121,16 @@ Made in Italy` })));
121
121
  top: 0,
122
122
  objectFit: 'cover',
123
123
  width: '100%'
124
- }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
124
+ }), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
125
125
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content' },
126
126
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
127
127
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
128
- react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (_l = product === null || product === void 0 ? void 0 : product.title) !== null && _l !== void 0 ? _l : 'Large Dior Toujours Bag'),
128
+ react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (_k = product === null || product === void 0 ? void 0 : product.title) !== null && _k !== void 0 ? _k : 'Large Dior Toujours Bag'),
129
129
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection }, (product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage Calfskin')),
130
130
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
131
131
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price }, priceText),
132
- react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo }, (_m = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _m !== void 0 ? _m : '税费'))),
133
- (!product || (product === null || product === void 0 ? void 0 : product.link)) && (react_1.default.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (_o = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _o !== void 0 ? _o : 'Shop now')),
132
+ react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo }, (_l = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _l !== void 0 ? _l : '税费'))),
133
+ (!product || (product === null || product === void 0 ? void 0 : product.link)) && (react_1.default.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (_m = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _m !== void 0 ? _m : 'Shop now')),
134
134
  productInfoText({ isPost }))),
135
135
  react_1.default.createElement(Modal_1.default, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
136
136
  };
package/package.json CHANGED
@@ -1,115 +1,114 @@
1
- {
2
- "name": "pb-sxp-ui",
3
- "version": "1.0.42",
4
- "description": "React enterprise-class UI components",
5
- "main": "dist/index.cjs",
6
- "module": "dist/index.js",
7
- "unpkg": "dist/pb-ui.min.js",
8
- "typings": "es/index.d.ts",
9
- "type": "module",
10
- "scripts": {
11
- "prebuild": "rimraf lib && rimraf es && rimraf dist",
12
- "build": "tsc --build tsconfig.es.json && tsc --build tsconfig.cjs.json",
13
- "postbuild": "tsc-alias -p tsconfig.es.json && tsc-alias -p tsconfig.cjs.json",
14
- "package": "npm run build && cross-env NODE_ENV=production rollup -c --configPlugin typescript",
15
- "start": "npm run build && cross-env NODE_ENV=development rollup -w -c",
16
- "lint": "eslint .",
17
- "lint:fix": "eslint --fix .",
18
- "dev": "rollup -w -c",
19
- "dev:package": "npm run build && rollup -w -c",
20
- "pub": "zx ./scripts/publish.mjs"
21
- },
22
- "files": [
23
- "dist",
24
- "lib",
25
- "es",
26
- "package.json",
27
- "README.md"
28
- ],
29
- "keywords": [
30
- "antd",
31
- "react",
32
- "react-component",
33
- "ui",
34
- "component",
35
- "components"
36
- ],
37
- "author": "frontend@chatlabs.cn",
38
- "license": "MIT",
39
- "dependencies": {
40
- "@ant-design/pro-components": "^2.6.35",
41
- "@emotion/css": "^11.11.2",
42
- "antd": "^5.15.3",
43
- "eslint": "^8.48.0",
44
- "eventemitter3": "^5.0.1",
45
- "hls.js": "^1.5.8",
46
- "less": "^4.2.0",
47
- "lodash": "^4.17.21",
48
- "pako": "^2.1.0",
49
- "qs": "^6.11.2",
50
- "swiper": "^11.0.3",
51
- "uuid": "^9.0.1"
52
- },
53
- "devDependencies": {
54
- "@babel/core": "^7.22.11",
55
- "@babel/plugin-transform-runtime": "^7.22.10",
56
- "@babel/preset-env": "^7.22.10",
57
- "@rollup/plugin-alias": "^5.0.0",
58
- "@rollup/plugin-babel": "^6.0.3",
59
- "@rollup/plugin-commonjs": "^25.0.4",
60
- "@rollup/plugin-eslint": "^9.0.4",
61
- "@rollup/plugin-image": "^3.0.2",
62
- "@rollup/plugin-json": "^6.0.0",
63
- "@rollup/plugin-node-resolve": "^15.2.0",
64
- "@rollup/plugin-typescript": "^11.1.2",
65
- "@rollup/plugin-url": "^8.0.1",
66
- "@svgr/rollup": "^8.1.0",
67
- "@types/crypto-js": "^4.1.3",
68
- "@types/lodash": "^4.14.198",
69
- "@types/node": "^20.5.3",
70
- "@types/pako": "^2.0.3",
71
- "@types/qs": "^6.9.8",
72
- "@types/react": "^18.2.21",
73
- "@types/react-dom": "^18.2.14",
74
- "@types/uuid": "^9.0.7",
75
- "@typescript-eslint/eslint-plugin": "^6.6.0",
76
- "@typescript-eslint/parser": "^6.6.0",
77
- "autoprefixer": "^10.4.15",
78
- "cross-env": "^7.0.3",
79
- "cssnano": "^6.0.1",
80
- "esbuild": "^0.19.2",
81
- "eslint-config-standard": "^17.1.0",
82
- "eslint-config-standard-react": "^13.0.0",
83
- "eslint-plugin-import": "^2.28.1",
84
- "eslint-plugin-n": "^16.0.2",
85
- "eslint-plugin-promise": "^6.1.1",
86
- "eslint-plugin-react": "^7.33.2",
87
- "eslint-plugin-react-hooks": "^4.6.0",
88
- "eslint-plugin-unused-imports": "^3.0.0",
89
- "postcss": "^8.4.28",
90
- "querystring": "^0.2.1",
91
- "react": "^18.2.0",
92
- "react-dom": "^18.2.0",
93
- "rimraf": "^5.0.1",
94
- "rollup": "^3.28.1",
95
- "rollup-plugin-esbuild": "^5.0.0",
96
- "rollup-plugin-postcss": "^4.0.2",
97
- "rollup-plugin-terser": "^7.0.2",
98
- "tsc-alias": "^1.8.7",
99
- "tslib": "^2.6.2",
100
- "typescript": "^5.1.6",
101
- "zx": "^7.2.3"
102
- },
103
- "peerDependencies": {
104
- "react": ">=16.9.0",
105
- "react-dom": ">=16.9.0"
106
- },
107
- "browserslist": [
108
- "defaults",
109
- "not ie < 8",
110
- "last 2 versions",
111
- "> 1%",
112
- "iOS 7",
113
- "last 3 iOS versions"
114
- ]
115
- }
1
+ {
2
+ "name": "pb-sxp-ui",
3
+ "version": "1.0.43",
4
+ "description": "React enterprise-class UI components",
5
+ "main": "dist/index.cjs",
6
+ "module": "dist/index.js",
7
+ "unpkg": "dist/pb-ui.min.js",
8
+ "typings": "es/index.d.ts",
9
+ "type": "module",
10
+ "scripts": {
11
+ "prebuild": "rimraf lib && rimraf es && rimraf dist",
12
+ "build": "tsc --build tsconfig.es.json && tsc --build tsconfig.cjs.json",
13
+ "postbuild": "tsc-alias -p tsconfig.es.json && tsc-alias -p tsconfig.cjs.json",
14
+ "package": "npm run build && cross-env NODE_ENV=production rollup -c --configPlugin typescript",
15
+ "start": "npm run build && cross-env NODE_ENV=development rollup -w -c",
16
+ "lint": "eslint .",
17
+ "lint:fix": "eslint --fix .",
18
+ "dev": "rollup -w -c",
19
+ "dev:package": "npm run build && rollup -w -c",
20
+ "pub": "zx ./scripts/publish.mjs"
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "lib",
25
+ "es",
26
+ "package.json",
27
+ "README.md"
28
+ ],
29
+ "keywords": [
30
+ "antd",
31
+ "react",
32
+ "react-component",
33
+ "ui",
34
+ "component",
35
+ "components"
36
+ ],
37
+ "author": "frontend@chatlabs.cn",
38
+ "license": "MIT",
39
+ "dependencies": {
40
+ "@ant-design/pro-components": "^2.6.35",
41
+ "@emotion/css": "^11.11.2",
42
+ "antd": "^5.15.3",
43
+ "eslint": "^8.48.0",
44
+ "eventemitter3": "^5.0.1",
45
+ "less": "^4.2.0",
46
+ "lodash": "^4.17.21",
47
+ "pako": "^2.1.0",
48
+ "qs": "^6.11.2",
49
+ "swiper": "^11.0.3",
50
+ "uuid": "^9.0.1"
51
+ },
52
+ "devDependencies": {
53
+ "@babel/core": "^7.22.11",
54
+ "@babel/plugin-transform-runtime": "^7.22.10",
55
+ "@babel/preset-env": "^7.22.10",
56
+ "@rollup/plugin-alias": "^5.0.0",
57
+ "@rollup/plugin-babel": "^6.0.3",
58
+ "@rollup/plugin-commonjs": "^25.0.4",
59
+ "@rollup/plugin-eslint": "^9.0.4",
60
+ "@rollup/plugin-image": "^3.0.2",
61
+ "@rollup/plugin-json": "^6.0.0",
62
+ "@rollup/plugin-node-resolve": "^15.2.0",
63
+ "@rollup/plugin-typescript": "^11.1.2",
64
+ "@rollup/plugin-url": "^8.0.1",
65
+ "@svgr/rollup": "^8.1.0",
66
+ "@types/crypto-js": "^4.1.3",
67
+ "@types/lodash": "^4.14.198",
68
+ "@types/node": "^20.5.3",
69
+ "@types/pako": "^2.0.3",
70
+ "@types/qs": "^6.9.8",
71
+ "@types/react": "^18.2.21",
72
+ "@types/react-dom": "^18.2.14",
73
+ "@types/uuid": "^9.0.7",
74
+ "@typescript-eslint/eslint-plugin": "^6.6.0",
75
+ "@typescript-eslint/parser": "^6.6.0",
76
+ "autoprefixer": "^10.4.15",
77
+ "cross-env": "^7.0.3",
78
+ "cssnano": "^6.0.1",
79
+ "esbuild": "^0.19.2",
80
+ "eslint-config-standard": "^17.1.0",
81
+ "eslint-config-standard-react": "^13.0.0",
82
+ "eslint-plugin-import": "^2.28.1",
83
+ "eslint-plugin-n": "^16.0.2",
84
+ "eslint-plugin-promise": "^6.1.1",
85
+ "eslint-plugin-react": "^7.33.2",
86
+ "eslint-plugin-react-hooks": "^4.6.0",
87
+ "eslint-plugin-unused-imports": "^3.0.0",
88
+ "postcss": "^8.4.28",
89
+ "querystring": "^0.2.1",
90
+ "react": "^18.2.0",
91
+ "react-dom": "^18.2.0",
92
+ "rimraf": "^5.0.1",
93
+ "rollup": "^3.28.1",
94
+ "rollup-plugin-esbuild": "^5.0.0",
95
+ "rollup-plugin-postcss": "^4.0.2",
96
+ "rollup-plugin-terser": "^7.0.2",
97
+ "tsc-alias": "^1.8.7",
98
+ "tslib": "^2.6.2",
99
+ "typescript": "^5.1.6",
100
+ "zx": "^7.2.3"
101
+ },
102
+ "peerDependencies": {
103
+ "react": ">=16.9.0",
104
+ "react-dom": ">=16.9.0"
105
+ },
106
+ "browserslist": [
107
+ "defaults",
108
+ "not ie < 8",
109
+ "last 2 versions",
110
+ "> 1%",
111
+ "iOS 7",
112
+ "last 3 iOS versions"
113
+ ]
114
+ }
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import { RecItemType } from '../SxpPageRender/typing';
3
- import { postConfigType } from '../SxpPageRender';
4
- interface IPictureGroupProps {
5
- imgUrls?: string[];
6
- width: number;
7
- height: number;
8
- rec: RecItemType;
9
- index: number;
10
- imgUrlsPostConfig?: postConfigType;
11
- }
12
- declare const _default: React.NamedExoticComponent<IPictureGroupProps>;
13
- export default _default;
@@ -1,11 +0,0 @@
1
- import React, { memo } from 'react';
2
- import { Autoplay, Pagination } from 'swiper/modules';
3
- import { Swiper, SwiperSlide } from 'swiper/react';
4
- import Picture from '../SxpPageRender/PictureGroup/Picture';
5
- const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
6
- return (React.createElement(Swiper, { defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: { clickable: true, bulletActiveClass: 'swipe-item-active-bullet' }, height: height, style: { width }, loop: true, autoplay: false }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url) => {
7
- return (React.createElement(SwiperSlide, { key: url },
8
- React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
9
- })));
10
- };
11
- export default memo(PictureGroup);
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { RecItemType } from '../SxpPageRender/typing';
3
- import { postConfigType } from '../SxpPageRender';
4
- interface IVideoWidgetProps {
5
- rec: RecItemType;
6
- index: number;
7
- height: number;
8
- width: number;
9
- data: RecItemType[];
10
- muted: boolean;
11
- activeIndex?: number;
12
- videoPostConfig?: postConfigType;
13
- }
14
- declare const _default: React.NamedExoticComponent<IVideoWidgetProps>;
15
- export default _default;