pb-sxp-ui 1.4.4 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/index.cjs +163 -125
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +163 -125
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.cjs +3 -3
  6. package/dist/index.min.cjs.map +1 -1
  7. package/dist/index.min.js +3 -3
  8. package/dist/index.min.js.map +1 -1
  9. package/dist/pb-ui.js +163 -125
  10. package/dist/pb-ui.js.map +1 -1
  11. package/dist/pb-ui.min.js +3 -3
  12. package/dist/pb-ui.min.js.map +1 -1
  13. package/es/core/components/SxpPageRender/WaterFall/List.js +7 -15
  14. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +7 -15
  15. package/es/core/components/SxpPageRender/index.d.ts +6 -0
  16. package/es/core/components/SxpPageRender/index.js +2 -0
  17. package/es/core/context/SxpDataSourceProvider.js +2 -0
  18. package/es/core/utils/materials.d.ts +7 -0
  19. package/es/core/utils/materials.js +47 -0
  20. package/es/materials/sxp/HashTag/settingRender.d.ts +5 -0
  21. package/es/materials/sxp/HashTag/settingRender.js +2 -1
  22. package/es/materials/sxp/cta/AniLink/interactionRender.d.ts +1 -0
  23. package/es/materials/sxp/cta/AniLink/interactionRender.js +2 -1
  24. package/es/materials/sxp/cta/AniLinkPopup/interactionRender.d.ts +1 -0
  25. package/es/materials/sxp/cta/AniLinkPopup/interactionRender.js +2 -1
  26. package/es/materials/sxp/popup/CommodityDetail/index.js +7 -15
  27. package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +7 -0
  28. package/es/materials/sxp/popup/CommodityDetail/settingRender.js +2 -1
  29. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +7 -15
  30. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +6 -0
  31. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +2 -1
  32. package/es/materials/sxp/popup/CommodityList/index.js +9 -15
  33. package/es/materials/sxp/popup/CommodityList/settingRender.d.ts +5 -0
  34. package/es/materials/sxp/popup/CommodityList/settingRender.js +2 -1
  35. package/es/materials/sxp/template/Appoint/interactionRender.d.ts +1 -0
  36. package/es/materials/sxp/template/Appoint/interactionRender.js +2 -1
  37. package/es/materials/sxp/template/Commodity/interactionRender.d.ts +1 -0
  38. package/es/materials/sxp/template/Commodity/interactionRender.js +2 -1
  39. package/es/materials/sxp/template/CommodityDiro/interactionRender.d.ts +1 -0
  40. package/es/materials/sxp/template/CommodityDiro/interactionRender.js +2 -1
  41. package/es/materials/sxp/template/CommodityDiroNew/interactionRender.d.ts +1 -0
  42. package/es/materials/sxp/template/CommodityDiroNew/interactionRender.js +2 -1
  43. package/es/materials/sxp/template/Link/interactionRender.d.ts +1 -0
  44. package/es/materials/sxp/template/Link/interactionRender.js +2 -1
  45. package/es/materials/sxp/template/Link/material.js +1 -1
  46. package/es/materials/sxp/template/MultiCommodity/interactionRender.d.ts +1 -0
  47. package/es/materials/sxp/template/MultiCommodity/interactionRender.js +2 -1
  48. package/es/materials/sxp/template/MultiCommodityDiro/interactionRender.d.ts +1 -0
  49. package/es/materials/sxp/template/MultiCommodityDiro/interactionRender.js +2 -1
  50. package/es/materials/sxp/template/MultiCommodityDiroNew/interactionRender.d.ts +1 -0
  51. package/es/materials/sxp/template/MultiCommodityDiroNew/interactionRender.js +2 -1
  52. package/lib/core/components/SxpPageRender/WaterFall/List.js +7 -15
  53. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +7 -15
  54. package/lib/core/components/SxpPageRender/index.d.ts +6 -0
  55. package/lib/core/components/SxpPageRender/index.js +2 -0
  56. package/lib/core/context/SxpDataSourceProvider.js +2 -0
  57. package/lib/core/utils/materials.d.ts +7 -0
  58. package/lib/core/utils/materials.js +49 -1
  59. package/lib/materials/sxp/HashTag/settingRender.d.ts +5 -0
  60. package/lib/materials/sxp/HashTag/settingRender.js +2 -1
  61. package/lib/materials/sxp/cta/AniLink/interactionRender.d.ts +1 -0
  62. package/lib/materials/sxp/cta/AniLink/interactionRender.js +2 -1
  63. package/lib/materials/sxp/cta/AniLinkPopup/interactionRender.d.ts +1 -0
  64. package/lib/materials/sxp/cta/AniLinkPopup/interactionRender.js +2 -1
  65. package/lib/materials/sxp/popup/CommodityDetail/index.js +7 -15
  66. package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +7 -0
  67. package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +2 -1
  68. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +7 -15
  69. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +6 -0
  70. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +2 -1
  71. package/lib/materials/sxp/popup/CommodityList/index.js +9 -15
  72. package/lib/materials/sxp/popup/CommodityList/settingRender.d.ts +5 -0
  73. package/lib/materials/sxp/popup/CommodityList/settingRender.js +2 -1
  74. package/lib/materials/sxp/template/Appoint/interactionRender.d.ts +1 -0
  75. package/lib/materials/sxp/template/Appoint/interactionRender.js +2 -1
  76. package/lib/materials/sxp/template/Commodity/interactionRender.d.ts +1 -0
  77. package/lib/materials/sxp/template/Commodity/interactionRender.js +2 -1
  78. package/lib/materials/sxp/template/CommodityDiro/interactionRender.d.ts +1 -0
  79. package/lib/materials/sxp/template/CommodityDiro/interactionRender.js +2 -1
  80. package/lib/materials/sxp/template/CommodityDiroNew/interactionRender.d.ts +1 -0
  81. package/lib/materials/sxp/template/CommodityDiroNew/interactionRender.js +2 -1
  82. package/lib/materials/sxp/template/Link/interactionRender.d.ts +1 -0
  83. package/lib/materials/sxp/template/Link/interactionRender.js +2 -1
  84. package/lib/materials/sxp/template/Link/material.js +1 -1
  85. package/lib/materials/sxp/template/MultiCommodity/interactionRender.d.ts +1 -0
  86. package/lib/materials/sxp/template/MultiCommodity/interactionRender.js +2 -1
  87. package/lib/materials/sxp/template/MultiCommodityDiro/interactionRender.d.ts +1 -0
  88. package/lib/materials/sxp/template/MultiCommodityDiro/interactionRender.js +2 -1
  89. package/lib/materials/sxp/template/MultiCommodityDiroNew/interactionRender.d.ts +1 -0
  90. package/lib/materials/sxp/template/MultiCommodityDiroNew/interactionRender.js +2 -1
  91. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -725,6 +725,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
725
725
  }
726
726
  setLoading(false);
727
727
  list = list.concat((_w = (_v = (_u = (_t = result === null || result === void 0 ? void 0 : result.data) === null || _t === void 0 ? void 0 : _t.recList) === null || _u === void 0 ? void 0 : _u.filter) === null || _v === void 0 ? void 0 : _v.call(_u, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _w !== void 0 ? _w : []);
728
+ setRtcList(getFilterRecList(Object.assign(Object.assign({}, result.data), { recList: list })));
729
+ setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result.data), { recList: list })));
728
730
  const isNotNullList = (_y = (_x = result === null || result === void 0 ? void 0 : result.data) === null || _x === void 0 ? void 0 : _x.recList) === null || _y === void 0 ? void 0 : _y.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
729
731
  if (isNotNullList) {
730
732
  pageNum = pageNum + 1;
@@ -1901,7 +1903,8 @@ var settingRender$9 = [
1901
1903
  label: '价格千分符展示',
1902
1904
  type: 'Switch',
1903
1905
  name: ['enableFormattedPrice'],
1904
- initialValue: true
1906
+ initialValue: true,
1907
+ belong: 'price'
1905
1908
  }
1906
1909
  ]
1907
1910
  }
@@ -9176,10 +9179,89 @@ const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailDat
9176
9179
  };
9177
9180
  var CommodityGroup$1 = memo(CommodityGroup);
9178
9181
 
9182
+ /*
9183
+ * @Author: binruan@chatlabs.com
9184
+ * @Date: 2024-03-20 14:56:16
9185
+ * @LastEditors: binruan@chatlabs.com
9186
+ * @LastEditTime: 2024-09-12 15:50:11
9187
+ * @FilePath: \pb-sxp-ui\src\core\utils\materials.ts
9188
+ *
9189
+ */
9190
+ /*
9191
+ * @Author: binruan@chatlabs.com
9192
+ * @Date: 2023-08-03 16:37:37
9193
+ * @LastEditors: binruan@chatlabs.com
9194
+ * @LastEditTime: 2023-08-04 11:02:50
9195
+ * @FilePath: \page-builder-admin\src\libs\core\utils\materials.ts
9196
+ *
9197
+ */
9198
+ const getMediaValueByMode = (obj) => {
9199
+ var _a;
9200
+ if (!obj || typeof obj !== 'object') {
9201
+ return null;
9202
+ }
9203
+ const { mode, link, file, src } = obj;
9204
+ switch (mode) {
9205
+ case 2:
9206
+ return link || null;
9207
+ case 3:
9208
+ return src || null;
9209
+ default:
9210
+ return file && file.length > 0 ? (_a = file[0]) === null || _a === void 0 ? void 0 : _a.url : null;
9211
+ }
9212
+ };
9213
+ const getPriceText = ({ product, enableFormattedPrice, globalConfig }) => {
9214
+ var _a, _b, _c, _d, _e;
9215
+ let price = (product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price) ? product === null || product === void 0 ? void 0 : product.price : 7000;
9216
+ let text = '';
9217
+ let priceSymbol = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.priceSymbol;
9218
+ let currency = (product === null || product === void 0 ? void 0 : product.currency) ? (_c = (_b = (_a = product === null || product === void 0 ? void 0 : product.currency) === null || _a === void 0 ? void 0 : _a.split('-')[1]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== null && _c !== void 0 ? _c : '' : '$';
9219
+ const isToLocStr = enableFormattedPrice === undefined || enableFormattedPrice || (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.millesimalSymbol) !== 'none';
9220
+ let decPic = price.toString();
9221
+ if (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.showTwoDecimalPoint) {
9222
+ decPic = price === null || price === void 0 ? void 0 : price.toFixed(2);
9223
+ }
9224
+ let decInd = (_d = decPic === null || decPic === void 0 ? void 0 : decPic.indexOf('.')) !== null && _d !== void 0 ? _d : -1;
9225
+ if (isToLocStr) {
9226
+ text =
9227
+ (_e = price === null || price === void 0 ? void 0 : price.toLocaleString('zh', {
9228
+ minimumFractionDigits: (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.showTwoDecimalPoint) ? 2 : 0
9229
+ })) !== null && _e !== void 0 ? _e : '';
9230
+ let startIndex = 0;
9231
+ let endIndex = decInd !== null && decInd !== void 0 ? decInd : text === null || text === void 0 ? void 0 : text.length;
9232
+ if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.millesimalSymbol) === '.') {
9233
+ text = text === null || text === void 0 ? void 0 : text.replace(/,/g, function (match, index) {
9234
+ if (index >= startIndex && index < endIndex) {
9235
+ return '.';
9236
+ }
9237
+ else {
9238
+ return match;
9239
+ }
9240
+ });
9241
+ }
9242
+ else if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.millesimalSymbol) === ' ') {
9243
+ text = text === null || text === void 0 ? void 0 : text.replace(',', ' ');
9244
+ }
9245
+ }
9246
+ else {
9247
+ text = `${(priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.showTwoDecimalPoint) ? price === null || price === void 0 ? void 0 : price.toFixed(2) : price}`;
9248
+ }
9249
+ if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.decimalPoint) === ',' && decInd > 0 && decInd + 1 < (text === null || text === void 0 ? void 0 : text.length)) {
9250
+ text = text.slice(0, decInd + 1) + ',' + text.slice(decInd + 2);
9251
+ }
9252
+ if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) && (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) !== 'none') {
9253
+ text = (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) === 'left' ? currency + text : text + currency;
9254
+ }
9255
+ else if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) !== 'none') {
9256
+ text = currency + text;
9257
+ }
9258
+ return text;
9259
+ };
9260
+
9179
9261
  const CommodityDetail$1 = (_a) => {
9180
9262
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
9181
9263
  var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor"]);
9182
- const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef } = useSxpDataSource();
9264
+ const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
9183
9265
  const { jumpToWeb, productView } = useEventReport();
9184
9266
  const curTimeRef = useRef(null);
9185
9267
  const [showModal, setShowModal] = useState(false);
@@ -9224,20 +9306,11 @@ const CommodityDetail$1 = (_a) => {
9224
9306
  window.removeEventListener('pageshow', initTime);
9225
9307
  };
9226
9308
  }, []);
9227
- const priceText = useMemo(() => {
9228
- var _a, _b, _c, _d, _e, _f, _g;
9229
- const isToLocStr = ((_a = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice) === undefined || ((_b = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _b === void 0 ? void 0 : _b.enableFormattedPrice);
9230
- if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
9231
- return `${(_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.currency) === null || _c === void 0 ? void 0 : _c.split('-')[1]) === null || _d === void 0 ? void 0 : _d.toUpperCase()) !== null && _e !== void 0 ? _e : ''}${isToLocStr
9232
- ? (_g = (_f = product === null || product === void 0 ? void 0 : product.price) === null || _f === void 0 ? void 0 : _f.toLocaleString('zh', {
9233
- minimumFractionDigits: 0
9234
- })) !== null && _g !== void 0 ? _g : ''
9235
- : product === null || product === void 0 ? void 0 : product.price}`;
9236
- }
9237
- else {
9238
- return '$7,000';
9239
- }
9240
- }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency, (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice]);
9309
+ const priceText = getPriceText({
9310
+ product: product,
9311
+ enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
9312
+ globalConfig
9313
+ });
9241
9314
  const width = (isPreview ? 375 : (_u = style === null || style === void 0 ? void 0 : style.width) !== null && _u !== void 0 ? _u : window.innerWidth) - ((_v = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _v !== void 0 ? _v : 0) * 2;
9242
9315
  const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
9243
9316
  const renderContent = ({ isPost }) => {
@@ -9617,38 +9690,6 @@ var settingRender$8 = [
9617
9690
 
9618
9691
  var img$3 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAABHBJREFUeF7lmzuoFkcYhp/TihdIl0JBESubSCCCih4NXgJeUphCjyKmEEVtLRSjooWtShILRRJtgpCoeLzgLUZBQbTwAoooqLWoCWIXeZdd3bP++8/st7OX33+ac2Dn8r3Pvzv7zcy7A9RT5gDjgQnx3/T/iuA58Cz+m/7/StXhDVQ0gATOBhYCi4GxxnHeAKeAs8DfMSBjV52bhQTwBbApFj4YNMqPnV0GrgL7gJchxggFQMI3A5NDBOXRx+MYwn6Pul2rlAWwMv7VvykbiLH9TUAQjhnbYwUwA9gKLLIOHLjdGWAPcL1ovxYAG4G9wKiig1Vc/y2wBThQZJyiAA4Ba4sM0EDdw8CPvuMWAXAb+Mq344br3QGm+cTgC+B/n85aWMepz1kBOBknMy3U5wxJSdSSbrVcAPR+V9LRy0X5SW6+0A3AMuDPXlaeiv174K9OWvIAfA1cAMZ9JgBeA98Ct7J68gAMtyjJCfUbKFn6zgeA0tujoUZtWT9D2bS50x1wA2gqt6+al9YO09ODZAF8DrO+C+KIt0IagNbzIlTXktYVaKfr9+PNkSklchMtpXWHR/sJaQA7gJ8sUdXURuJ/AB7E4/0BLDeOvROQ3hEA/gFmGjusullWfDKeFcI1YFYawETgSdUqjP3niS8LYRLwNHkE1gM/GwOssplLfBkIG4BfEgBKE5dWqcTQt694da1td22YFikngGUJgH+B0UVaV1y3iHiFYpnA/wPGCICFXpX66xCfxD8oAKuA3wIpegToHW0tdYpXjKsFQLu7u60Rx+3exSCPG29HdVO3eI25TQB+BdaVAKCMSneRVpBJKfpMNiFesR4UgNOdlomeQF4AWj3quCpbfCE0JV7xDgvAXWCqp+B0tYfACkC7xXnFBaFJ8Yr5ngC8Mu78KHnS4+MqeRCaFq+4X5cB8MnmQoE7oQ3iPwCwPgJWEdZ2rjvNcj16BMpMghYxWsElS1pX0K45xNXedT2aBMu+BotCcAVlfZX69puuF70GQyRCoSFU/csnEKJEKFQqHApCXeIFIUqFQy6GykKoU7wARIuh6HVQwsmVffasEOoWLwfauASADkKU0oYqRSHULV465SsaSgAoqfk9lPq4H18ITYhXiJr7jiYAZGyUUzN0cUFoSrx0yrX6PH0ucEmTQmgCXdb5TYrX/uFcaa3rYCR7JzQpXro1vg5HRgCo+mhMEOT3/RKQYaGpkns0poD6+nA0+UX6+nhcEPreICEIfW2REQCZoc+30A9snTjlI57fyUzdzSYnU3RpP7414sDtNLl3NFG7jJK9YI52sepqnnYBUOe9ZJLOwnCapn0AqNO+NksnVHvJNO00SSeifO+ApH4vZIpdzdHZZ6QoALWXifqI8TTJNWGVua5drTV5pui8ji0A1JfM1Lta5CeWD3h7JzO0i6gVQNJv3342lwXbtx9OpkFoP0ET0LwKDZcyOF5s46ez2TtCxkt9OL0gBmJ1oMnJJcHnYo/wU9czXfR62TnAd7zWfj7/HrAAAKDnDZ8VAAAAAElFTkSuQmCC";
9619
9692
 
9620
- /*
9621
- * @Author: binruan@chatlabs.com
9622
- * @Date: 2024-03-20 14:56:16
9623
- * @LastEditors: binruan@chatlabs.com
9624
- * @LastEditTime: 2024-03-20 14:56:22
9625
- * @FilePath: \pb-sxp-ui\src\core\utils\materials.ts
9626
- *
9627
- */
9628
- /*
9629
- * @Author: binruan@chatlabs.com
9630
- * @Date: 2023-08-03 16:37:37
9631
- * @LastEditors: binruan@chatlabs.com
9632
- * @LastEditTime: 2023-08-04 11:02:50
9633
- * @FilePath: \page-builder-admin\src\libs\core\utils\materials.ts
9634
- *
9635
- */
9636
- const getMediaValueByMode = (obj) => {
9637
- var _a;
9638
- if (!obj || typeof obj !== 'object') {
9639
- return null;
9640
- }
9641
- const { mode, link, file, src } = obj;
9642
- switch (mode) {
9643
- case 2:
9644
- return link || null;
9645
- case 3:
9646
- return src || null;
9647
- default:
9648
- return file && file.length > 0 ? (_a = file[0]) === null || _a === void 0 ? void 0 : _a.url : null;
9649
- }
9650
- };
9651
-
9652
9693
  const Prompt$1 = (_a) => {
9653
9694
  var { content, btnText, style, icon, isPopup, isExternalLink, onClose, onClick, submitButtonStyle, contentStyle } = _a, props = __rest(_a, ["content", "btnText", "style", "icon", "isPopup", "isExternalLink", "onClose", "onClick", "submitButtonStyle", "contentStyle"]);
9654
9695
  const { popupDetailData } = useSxpDataSource();
@@ -9913,7 +9954,8 @@ var settingRender$7 = [
9913
9954
  label: '价格千分符展示',
9914
9955
  type: 'Switch',
9915
9956
  name: ['enableFormattedPrice'],
9916
- initialValue: true
9957
+ initialValue: true,
9958
+ belong: 'price'
9917
9959
  }
9918
9960
  ]
9919
9961
  }
@@ -10062,7 +10104,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
10062
10104
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
10063
10105
  var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor"]);
10064
10106
  useState(true);
10065
- const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef } = useSxpDataSource();
10107
+ const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
10066
10108
  const { jumpToWeb, productView } = useEventReport();
10067
10109
  useState(false);
10068
10110
  useState(false);
@@ -10110,20 +10152,11 @@ const CommodityDetailDiroNew$1 = (_a) => {
10110
10152
  window.removeEventListener('pageshow', initTime);
10111
10153
  };
10112
10154
  }, []);
10113
- const priceText = useMemo(() => {
10114
- var _a, _b, _c, _d, _e, _f, _g;
10115
- const isToLocStr = ((_a = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice) === undefined || ((_b = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _b === void 0 ? void 0 : _b.enableFormattedPrice);
10116
- if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
10117
- return `${(_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.currency) === null || _c === void 0 ? void 0 : _c.split('-')[1]) === null || _d === void 0 ? void 0 : _d.toUpperCase()) !== null && _e !== void 0 ? _e : ''}${isToLocStr
10118
- ? (_g = (_f = product === null || product === void 0 ? void 0 : product.price) === null || _f === void 0 ? void 0 : _f.toLocaleString('zh', {
10119
- minimumFractionDigits: 0
10120
- })) !== null && _g !== void 0 ? _g : ''
10121
- : product === null || product === void 0 ? void 0 : product.price}`;
10122
- }
10123
- else {
10124
- return '£102,300.00';
10125
- }
10126
- }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency, (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice]);
10155
+ const priceText = getPriceText({
10156
+ product,
10157
+ enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
10158
+ globalConfig
10159
+ });
10127
10160
  const width = (isPreview ? 375 : (_u = style === null || style === void 0 ? void 0 : style.width) !== null && _u !== void 0 ? _u : window.innerWidth) - ((_v = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _v !== void 0 ? _v : 0) * 2;
10128
10161
  const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
10129
10162
  // useEffect(() => {
@@ -10555,7 +10588,8 @@ var settingRender$6 = [
10555
10588
  label: '价格千分符展示',
10556
10589
  type: 'Switch',
10557
10590
  name: ['enableFormattedPrice'],
10558
- initialValue: true
10591
+ initialValue: true,
10592
+ belong: 'price'
10559
10593
  }
10560
10594
  ]
10561
10595
  }
@@ -10710,27 +10744,20 @@ var Img$1 = memo(Img);
10710
10744
  const CommodityList$1 = (_a) => {
10711
10745
  var _b, _c, _d;
10712
10746
  var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, translateY = 0, commodityPicture, isExternalLink, onClick } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "translateY", "commodityPicture", "isExternalLink", "onClick"]);
10713
- const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent } = useSxpDataSource();
10747
+ const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent, globalConfig } = useSxpDataSource();
10714
10748
  const { jumpToWeb } = useEventReport();
10715
10749
  const { popup } = useEditor();
10716
10750
  const recData = isPost ? rec : popupDetailData;
10717
10751
  const product = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [null, null, null, null];
10718
10752
  const index = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
10719
10753
  const priceText = useCallback((product) => {
10720
- var _a, _b, _c, _d, _e, _f, _g;
10721
- const isToLocStr = ((_a = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice) === undefined || ((_b = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _b === void 0 ? void 0 : _b.enableFormattedPrice);
10722
- if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
10723
- return `${(_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.currency) === null || _c === void 0 ? void 0 : _c.split('-')[1]) === null || _d === void 0 ? void 0 : _d.toUpperCase()) !== null && _e !== void 0 ? _e : ''}${isToLocStr
10724
- ? (_g = (_f = product === null || product === void 0 ? void 0 : product.price) === null || _f === void 0 ? void 0 : _f.toLocaleString('zh', {
10725
- minimumFractionDigits: 0
10726
- })) !== null && _g !== void 0 ? _g : ''
10727
- : product === null || product === void 0 ? void 0 : product.price}`;
10728
- }
10729
- else {
10730
- const p = 7000;
10731
- return `$${isToLocStr ? p.toLocaleString() : p}`;
10732
- }
10733
- }, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice]);
10754
+ var _a;
10755
+ return getPriceText({
10756
+ product,
10757
+ enableFormattedPrice: (_a = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
10758
+ globalConfig
10759
+ });
10760
+ }, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
10734
10761
  const handleClick = throttle((item, multiCheckIndex) => {
10735
10762
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
10736
10763
  eventSubject: 'clickCta',
@@ -11187,7 +11214,8 @@ var interactionRender$9 = [
11187
11214
  child: [
11188
11215
  {
11189
11216
  type: 'link',
11190
- name: 'onClick'
11217
+ name: 'onClick',
11218
+ hiddenUrl: true
11191
11219
  }
11192
11220
  ]
11193
11221
  }
@@ -11312,7 +11340,8 @@ var interactionRender$8 = [
11312
11340
  child: [
11313
11341
  {
11314
11342
  type: 'link',
11315
- name: 'onClick'
11343
+ name: 'onClick',
11344
+ hiddenUrl: true
11316
11345
  }
11317
11346
  ]
11318
11347
  }
@@ -11530,7 +11559,7 @@ var LinkComponent = memo(Link$1);
11530
11559
  * @Author: binruan@chatlabs.com
11531
11560
  * @Date: 2024-08-09 16:59:38
11532
11561
  * @LastEditors: binruan@chatlabs.com
11533
- * @LastEditTime: 2024-08-09 16:59:44
11562
+ * @LastEditTime: 2024-09-09 13:59:50
11534
11563
  * @FilePath: \pb-sxp-ui\src\materials\sxp\template\Link\interactionRender.tsx
11535
11564
  *
11536
11565
  */
@@ -11540,7 +11569,8 @@ var interactionRender$7 = [
11540
11569
  child: [
11541
11570
  {
11542
11571
  type: 'link',
11543
- name: 'onClick'
11572
+ name: 'onClick',
11573
+ hiddenUrl: true
11544
11574
  }
11545
11575
  ]
11546
11576
  }
@@ -11548,7 +11578,7 @@ var interactionRender$7 = [
11548
11578
 
11549
11579
  var _a;
11550
11580
  const Link = createMaterial(LinkComponent, {
11551
- displayName: '跳转指引',
11581
+ displayName: '普通CTA',
11552
11582
  icon: '',
11553
11583
  category: 'template',
11554
11584
  type: 'Link',
@@ -11607,7 +11637,8 @@ var interactionRender$6 = [
11607
11637
  child: [
11608
11638
  {
11609
11639
  type: 'link',
11610
- name: 'onClick'
11640
+ name: 'onClick',
11641
+ hiddenUrl: true
11611
11642
  }
11612
11643
  ]
11613
11644
  }
@@ -11702,7 +11733,8 @@ var interactionRender$5 = [
11702
11733
  child: [
11703
11734
  {
11704
11735
  type: 'link',
11705
- name: 'onClick'
11736
+ name: 'onClick',
11737
+ hiddenUrl: true
11706
11738
  }
11707
11739
  ]
11708
11740
  }
@@ -11798,7 +11830,8 @@ var interactionRender$4 = [
11798
11830
  child: [
11799
11831
  {
11800
11832
  type: 'link',
11801
- name: 'onClick'
11833
+ name: 'onClick',
11834
+ hiddenUrl: true
11802
11835
  }
11803
11836
  ]
11804
11837
  }
@@ -11913,7 +11946,8 @@ var interactionRender$3 = [
11913
11946
  child: [
11914
11947
  {
11915
11948
  type: 'link',
11916
- name: 'onClick'
11949
+ name: 'onClick',
11950
+ hiddenUrl: true
11917
11951
  }
11918
11952
  ]
11919
11953
  }
@@ -12023,13 +12057,22 @@ const MultiCommodity = createMaterial(MultiCommodityComponent, {
12023
12057
  sort: 3
12024
12058
  });
12025
12059
 
12060
+ /*
12061
+ * @Author: binruan@chatlabs.com
12062
+ * @Date: 2024-03-20 10:27:32
12063
+ * @LastEditors: binruan@chatlabs.com
12064
+ * @LastEditTime: 2024-09-09 13:56:10
12065
+ * @FilePath: \pb-sxp-ui\src\materials\sxp\template\MultiCommodityDiroNew\interactionRender.tsx
12066
+ *
12067
+ */
12026
12068
  var interactionRender$2 = [
12027
12069
  {
12028
12070
  title: '点击事件',
12029
12071
  child: [
12030
12072
  {
12031
12073
  type: 'link',
12032
- name: 'onClick'
12074
+ name: 'onClick',
12075
+ hiddenUrl: true
12033
12076
  }
12034
12077
  ]
12035
12078
  }
@@ -12259,7 +12302,8 @@ var settingRender$3 = [
12259
12302
  label: '价格千分符展示',
12260
12303
  type: 'Switch',
12261
12304
  name: ['enableFormattedPrice'],
12262
- initialValue: true
12305
+ initialValue: true,
12306
+ belong: 'price'
12263
12307
  }
12264
12308
  ]
12265
12309
  }
@@ -13682,7 +13726,7 @@ var previewData = {
13682
13726
  const WaterfallFlowItem$1 = (props) => {
13683
13727
  var _a;
13684
13728
  const { rec, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, space } = props;
13685
- const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = useSxpDataSource();
13729
+ const { swiperRef, setRtcList, setOpenHashtag, sxpParameter, globalConfig } = useSxpDataSource();
13686
13730
  const [showVideo, setShowVideo] = useState(false);
13687
13731
  useState(false);
13688
13732
  useState({
@@ -13733,20 +13777,11 @@ const WaterfallFlowItem$1 = (props) => {
13733
13777
  return false;
13734
13778
  }
13735
13779
  }, [top, showBorder]);
13736
- const priceText = useMemo(() => {
13737
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
13738
- const isToLocStr = ((_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice) === undefined || ((_b = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _b === void 0 ? void 0 : _b.enableFormattedPrice);
13739
- if (((_c = rec === null || rec === void 0 ? void 0 : rec.product) === null || _c === void 0 ? void 0 : _c.currency) && ((_d = rec === null || rec === void 0 ? void 0 : rec.product) === null || _d === void 0 ? void 0 : _d.price)) {
13740
- return `${(_h = (_g = (_f = (_e = rec === null || rec === void 0 ? void 0 : rec.product) === null || _e === void 0 ? void 0 : _e.currency) === null || _f === void 0 ? void 0 : _f.split('-')[1]) === null || _g === void 0 ? void 0 : _g.toUpperCase()) !== null && _h !== void 0 ? _h : ''}${isToLocStr
13741
- ? (_l = (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.product) === null || _j === void 0 ? void 0 : _j.price) === null || _k === void 0 ? void 0 : _k.toLocaleString('zh', {
13742
- minimumFractionDigits: 0
13743
- })) !== null && _l !== void 0 ? _l : ''
13744
- : (_m = rec === null || rec === void 0 ? void 0 : rec.product) === null || _m === void 0 ? void 0 : _m.price}`;
13745
- }
13746
- else {
13747
- return null;
13748
- }
13749
- }, [rec, (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice]);
13780
+ const priceText = getPriceText({
13781
+ product: rec === null || rec === void 0 ? void 0 : rec.product,
13782
+ enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
13783
+ globalConfig
13784
+ });
13750
13785
  useEffect(() => {
13751
13786
  if (imgDom.current === null || src === '') {
13752
13787
  return;
@@ -14032,7 +14067,7 @@ var img$2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeA
14032
14067
  const WaterfallFlowItem = (props) => {
14033
14068
  var _a;
14034
14069
  const { rec, index, list, reportTagsView, textStyles, space } = props;
14035
- const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = useSxpDataSource();
14070
+ const { swiperRef, setRtcList, setOpenHashtag, sxpParameter, globalConfig } = useSxpDataSource();
14036
14071
  const [showVideo, setShowVideo] = useState(false);
14037
14072
  const imgDom = useRef(null);
14038
14073
  const ref = useRef(null);
@@ -14058,20 +14093,11 @@ const WaterfallFlowItem = (props) => {
14058
14093
  var _a, _b;
14059
14094
  return ((_a = rec === null || rec === void 0 ? void 0 : rec.product) === null || _a === void 0 ? void 0 : _a.title) || ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.title) || null;
14060
14095
  }, [rec]);
14061
- const priceText = useMemo(() => {
14062
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
14063
- const isToLocStr = ((_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice) === undefined || ((_b = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _b === void 0 ? void 0 : _b.enableFormattedPrice);
14064
- if (((_c = rec === null || rec === void 0 ? void 0 : rec.product) === null || _c === void 0 ? void 0 : _c.currency) && ((_d = rec === null || rec === void 0 ? void 0 : rec.product) === null || _d === void 0 ? void 0 : _d.price)) {
14065
- return `${(_h = (_g = (_f = (_e = rec === null || rec === void 0 ? void 0 : rec.product) === null || _e === void 0 ? void 0 : _e.currency) === null || _f === void 0 ? void 0 : _f.split('-')[1]) === null || _g === void 0 ? void 0 : _g.toUpperCase()) !== null && _h !== void 0 ? _h : ''}${isToLocStr
14066
- ? (_l = (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.product) === null || _j === void 0 ? void 0 : _j.price) === null || _k === void 0 ? void 0 : _k.toLocaleString('zh', {
14067
- minimumFractionDigits: 0
14068
- })) !== null && _l !== void 0 ? _l : ''
14069
- : (_m = rec === null || rec === void 0 ? void 0 : rec.product) === null || _m === void 0 ? void 0 : _m.price}`;
14070
- }
14071
- else {
14072
- return null;
14073
- }
14074
- }, [rec, (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice]);
14096
+ const priceText = getPriceText({
14097
+ product: rec === null || rec === void 0 ? void 0 : rec.product,
14098
+ enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
14099
+ globalConfig
14100
+ });
14075
14101
  // useEffect(() => {
14076
14102
  // if (imgDom.current === null || src === '') {
14077
14103
  // return;
@@ -14719,7 +14745,7 @@ var AniLinkComponent = memo(AniLink$1);
14719
14745
  * @Author: binruan@chatlabs.com
14720
14746
  * @Date: 2024-07-05 14:08:41
14721
14747
  * @LastEditors: binruan@chatlabs.com
14722
- * @LastEditTime: 2024-08-02 16:22:39
14748
+ * @LastEditTime: 2024-09-09 14:05:04
14723
14749
  * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\interactionRender.tsx
14724
14750
  *
14725
14751
  */
@@ -14729,7 +14755,8 @@ var interactionRender$1 = [
14729
14755
  child: [
14730
14756
  {
14731
14757
  type: 'link',
14732
- name: 'onClick'
14758
+ name: 'onClick',
14759
+ hiddenUrl: true
14733
14760
  }
14734
14761
  ]
14735
14762
  },
@@ -15153,13 +15180,22 @@ const AniLinkPopup$1 = (_a) => {
15153
15180
  };
15154
15181
  var AniLinkPopupComponent = memo(AniLinkPopup$1);
15155
15182
 
15183
+ /*
15184
+ * @Author: binruan@chatlabs.com
15185
+ * @Date: 2024-07-24 14:58:40
15186
+ * @LastEditors: binruan@chatlabs.com
15187
+ * @LastEditTime: 2024-09-09 13:54:35
15188
+ * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLinkPopup\interactionRender.tsx
15189
+ *
15190
+ */
15156
15191
  var interactionRender = [
15157
15192
  {
15158
15193
  title: '点击事件',
15159
15194
  child: [
15160
15195
  {
15161
15196
  type: 'link',
15162
- name: 'onClick'
15197
+ name: 'onClick',
15198
+ hiddenUrl: true
15163
15199
  }
15164
15200
  ]
15165
15201
  },
@@ -16144,7 +16180,7 @@ var Tagbar$1 = memo(Tagbar);
16144
16180
  * @Author: binruan@chatlabs.com
16145
16181
  * @Date: 2024-01-15 19:03:09
16146
16182
  * @LastEditors: binruan@chatlabs.com
16147
- * @LastEditTime: 2024-08-30 11:42:11
16183
+ * @LastEditTime: 2024-09-11 15:36:28
16148
16184
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
16149
16185
  *
16150
16186
  */
@@ -16321,6 +16357,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16321
16357
  return null;
16322
16358
  }
16323
16359
  });
16360
+ if (!(list === null || list === void 0 ? void 0 : list.length))
16361
+ return [];
16324
16362
  return !waterFallData && !isNoMoreData ? list.concat([{ loading: true }]) : list;
16325
16363
  }, [data, activeIndex, waterFallData, isEditor, isNoMoreData]);
16326
16364
  const renderLogo = useMemo(() => {