pb-sxp-ui 1.9.0 → 1.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/index.cjs +1005 -241
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +72 -4
  4. package/dist/index.js +1005 -241
  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 +1005 -241
  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 +1 -1
  15. package/es/core/components/SxpPageRender/Hashtag/index.js +2 -2
  16. package/es/core/components/SxpPageRender/Modal/index.js +45 -7
  17. package/es/core/components/SxpPageRender/PictureGroup/index.js +51 -25
  18. package/es/core/components/SxpPageRender/index.js +3 -3
  19. package/es/core/hooks/useFocusTrap.d.ts +2 -0
  20. package/es/core/hooks/useFocusTrap.js +37 -0
  21. package/es/core/utils/tool.d.ts +2 -1
  22. package/es/core/utils/tool.js +12 -1
  23. package/es/index.d.ts +1 -0
  24. package/es/index.js +1 -0
  25. package/es/materials/sxp/cta/AniLinkPopup/index.js +5 -5
  26. package/es/materials/sxp/popup/CommodityDetail/index.js +38 -14
  27. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +37 -13
  28. package/es/materials/sxp/popup/CommodityList/index.js +32 -28
  29. package/es/materials/sxp/template/Appoint/index.js +1 -1
  30. package/es/materials/sxp/template/Commodity/index.js +4 -4
  31. package/es/materials/sxp/template/CommodityDiro/index.js +4 -4
  32. package/es/materials/sxp/template/CommodityDiroNew/index.js +4 -4
  33. package/es/materials/sxp/template/Link/index.js +1 -1
  34. package/es/materials/sxp/template/MultiCommodity/index.js +23 -42
  35. package/es/materials/sxp/template/MultiCommodityDiro/index.js +24 -42
  36. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +25 -44
  37. package/es/materials/sxp/template/components/EventProvider.d.ts +2 -0
  38. package/es/materials/sxp/template/components/EventProvider.js +22 -11
  39. package/es/materials/sxp/template/components/Scroll.js +1 -1
  40. package/lib/core/components/SxpPageRender/ExpandableText.js +1 -1
  41. package/lib/core/components/SxpPageRender/Hashtag/index.js +2 -2
  42. package/lib/core/components/SxpPageRender/Modal/index.js +45 -7
  43. package/lib/core/components/SxpPageRender/PictureGroup/index.js +49 -23
  44. package/lib/core/components/SxpPageRender/index.js +3 -3
  45. package/lib/core/hooks/useFocusTrap.d.ts +2 -0
  46. package/lib/core/hooks/useFocusTrap.js +39 -0
  47. package/lib/core/utils/tool.d.ts +2 -1
  48. package/lib/core/utils/tool.js +13 -1
  49. package/lib/index.d.ts +1 -0
  50. package/lib/index.js +1 -0
  51. package/lib/materials/sxp/cta/AniLinkPopup/index.js +5 -5
  52. package/lib/materials/sxp/popup/CommodityDetail/index.js +36 -12
  53. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +35 -11
  54. package/lib/materials/sxp/popup/CommodityList/index.js +32 -28
  55. package/lib/materials/sxp/template/Appoint/index.js +1 -1
  56. package/lib/materials/sxp/template/Commodity/index.js +4 -4
  57. package/lib/materials/sxp/template/CommodityDiro/index.js +4 -4
  58. package/lib/materials/sxp/template/CommodityDiroNew/index.js +4 -4
  59. package/lib/materials/sxp/template/Link/index.js +1 -1
  60. package/lib/materials/sxp/template/MultiCommodity/index.js +22 -41
  61. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +23 -41
  62. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +24 -43
  63. package/lib/materials/sxp/template/components/EventProvider.d.ts +2 -0
  64. package/lib/materials/sxp/template/components/EventProvider.js +21 -10
  65. package/lib/materials/sxp/template/components/Scroll.js +1 -1
  66. package/package.json +1 -1
package/dist/pb-ui.js CHANGED
@@ -313,6 +313,17 @@
313
313
  });
314
314
  return value !== null && value !== void 0 ? value : '';
315
315
  }
316
+ function getScreenReader() {
317
+ let userAgent = self.navigator.userAgent;
318
+ if (!userAgent)
319
+ return false;
320
+ return (/TalkBack/i.test(userAgent) ||
321
+ /Funtouch/i.test(userAgent) ||
322
+ /VoiceOver/i.test(userAgent) ||
323
+ /NVDA/i.test(userAgent) ||
324
+ /JAWS/i.test(userAgent) ||
325
+ /ChromeVox/i.test(userAgent));
326
+ }
316
327
 
317
328
  function unzip(b64Data) {
318
329
  const strData = atob(b64Data);
@@ -2594,6 +2605,119 @@
2594
2605
  return (Array.isArray(el) ? el : [el]).filter(e => !!e);
2595
2606
  }
2596
2607
 
2608
+ /* eslint-disable consistent-return */
2609
+ function Keyboard(_ref) {
2610
+ let {
2611
+ swiper,
2612
+ extendParams,
2613
+ on,
2614
+ emit
2615
+ } = _ref;
2616
+ const document = getDocument();
2617
+ const window = getWindow();
2618
+ swiper.keyboard = {
2619
+ enabled: false
2620
+ };
2621
+ extendParams({
2622
+ keyboard: {
2623
+ enabled: false,
2624
+ onlyInViewport: true,
2625
+ pageUpDown: true
2626
+ }
2627
+ });
2628
+ function handle(event) {
2629
+ if (!swiper.enabled) return;
2630
+ const {
2631
+ rtlTranslate: rtl
2632
+ } = swiper;
2633
+ let e = event;
2634
+ if (e.originalEvent) e = e.originalEvent; // jquery fix
2635
+ const kc = e.keyCode || e.charCode;
2636
+ const pageUpDown = swiper.params.keyboard.pageUpDown;
2637
+ const isPageUp = pageUpDown && kc === 33;
2638
+ const isPageDown = pageUpDown && kc === 34;
2639
+ const isArrowLeft = kc === 37;
2640
+ const isArrowRight = kc === 39;
2641
+ const isArrowUp = kc === 38;
2642
+ const isArrowDown = kc === 40;
2643
+ // Directions locks
2644
+ if (!swiper.allowSlideNext && (swiper.isHorizontal() && isArrowRight || swiper.isVertical() && isArrowDown || isPageDown)) {
2645
+ return false;
2646
+ }
2647
+ if (!swiper.allowSlidePrev && (swiper.isHorizontal() && isArrowLeft || swiper.isVertical() && isArrowUp || isPageUp)) {
2648
+ return false;
2649
+ }
2650
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
2651
+ return undefined;
2652
+ }
2653
+ if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {
2654
+ return undefined;
2655
+ }
2656
+ if (swiper.params.keyboard.onlyInViewport && (isPageUp || isPageDown || isArrowLeft || isArrowRight || isArrowUp || isArrowDown)) {
2657
+ let inView = false;
2658
+ // Check that swiper should be inside of visible area of window
2659
+ if (elementParents(swiper.el, `.${swiper.params.slideClass}, swiper-slide`).length > 0 && elementParents(swiper.el, `.${swiper.params.slideActiveClass}`).length === 0) {
2660
+ return undefined;
2661
+ }
2662
+ const el = swiper.el;
2663
+ const swiperWidth = el.clientWidth;
2664
+ const swiperHeight = el.clientHeight;
2665
+ const windowWidth = window.innerWidth;
2666
+ const windowHeight = window.innerHeight;
2667
+ const swiperOffset = elementOffset(el);
2668
+ if (rtl) swiperOffset.left -= el.scrollLeft;
2669
+ const swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiperWidth, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiperHeight], [swiperOffset.left + swiperWidth, swiperOffset.top + swiperHeight]];
2670
+ for (let i = 0; i < swiperCoord.length; i += 1) {
2671
+ const point = swiperCoord[i];
2672
+ if (point[0] >= 0 && point[0] <= windowWidth && point[1] >= 0 && point[1] <= windowHeight) {
2673
+ if (point[0] === 0 && point[1] === 0) continue; // eslint-disable-line
2674
+ inView = true;
2675
+ }
2676
+ }
2677
+ if (!inView) return undefined;
2678
+ }
2679
+ if (swiper.isHorizontal()) {
2680
+ if (isPageUp || isPageDown || isArrowLeft || isArrowRight) {
2681
+ if (e.preventDefault) e.preventDefault();else e.returnValue = false;
2682
+ }
2683
+ if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext();
2684
+ if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev();
2685
+ } else {
2686
+ if (isPageUp || isPageDown || isArrowUp || isArrowDown) {
2687
+ if (e.preventDefault) e.preventDefault();else e.returnValue = false;
2688
+ }
2689
+ if (isPageDown || isArrowDown) swiper.slideNext();
2690
+ if (isPageUp || isArrowUp) swiper.slidePrev();
2691
+ }
2692
+ emit('keyPress', kc);
2693
+ return undefined;
2694
+ }
2695
+ function enable() {
2696
+ if (swiper.keyboard.enabled) return;
2697
+ document.addEventListener('keydown', handle);
2698
+ swiper.keyboard.enabled = true;
2699
+ }
2700
+ function disable() {
2701
+ if (!swiper.keyboard.enabled) return;
2702
+ document.removeEventListener('keydown', handle);
2703
+ swiper.keyboard.enabled = false;
2704
+ }
2705
+ on('init', () => {
2706
+ if (swiper.params.keyboard.enabled) {
2707
+ enable();
2708
+ }
2709
+ });
2710
+ on('destroy', () => {
2711
+ if (swiper.keyboard.enabled) {
2712
+ disable();
2713
+ }
2714
+ });
2715
+ Object.assign(swiper.keyboard, {
2716
+ enable,
2717
+ disable
2718
+ });
2719
+ }
2720
+
2597
2721
  /* eslint-disable consistent-return */
2598
2722
  function Mousewheel(_ref) {
2599
2723
  let {
@@ -3001,6 +3125,202 @@
3001
3125
  return params;
3002
3126
  }
3003
3127
 
3128
+ function Navigation(_ref) {
3129
+ let {
3130
+ swiper,
3131
+ extendParams,
3132
+ on,
3133
+ emit
3134
+ } = _ref;
3135
+ extendParams({
3136
+ navigation: {
3137
+ nextEl: null,
3138
+ prevEl: null,
3139
+ hideOnClick: false,
3140
+ disabledClass: 'swiper-button-disabled',
3141
+ hiddenClass: 'swiper-button-hidden',
3142
+ lockClass: 'swiper-button-lock',
3143
+ navigationDisabledClass: 'swiper-navigation-disabled'
3144
+ }
3145
+ });
3146
+ swiper.navigation = {
3147
+ nextEl: null,
3148
+ prevEl: null
3149
+ };
3150
+ function getEl(el) {
3151
+ let res;
3152
+ if (el && typeof el === 'string' && swiper.isElement) {
3153
+ res = swiper.el.querySelector(el);
3154
+ if (res) return res;
3155
+ }
3156
+ if (el) {
3157
+ if (typeof el === 'string') res = [...document.querySelectorAll(el)];
3158
+ if (swiper.params.uniqueNavElements && typeof el === 'string' && res && res.length > 1 && swiper.el.querySelectorAll(el).length === 1) {
3159
+ res = swiper.el.querySelector(el);
3160
+ } else if (res && res.length === 1) {
3161
+ res = res[0];
3162
+ }
3163
+ }
3164
+ if (el && !res) return el;
3165
+ // if (Array.isArray(res) && res.length === 1) res = res[0];
3166
+ return res;
3167
+ }
3168
+ function toggleEl(el, disabled) {
3169
+ const params = swiper.params.navigation;
3170
+ el = makeElementsArray(el);
3171
+ el.forEach(subEl => {
3172
+ if (subEl) {
3173
+ subEl.classList[disabled ? 'add' : 'remove'](...params.disabledClass.split(' '));
3174
+ if (subEl.tagName === 'BUTTON') subEl.disabled = disabled;
3175
+ if (swiper.params.watchOverflow && swiper.enabled) {
3176
+ subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass);
3177
+ }
3178
+ }
3179
+ });
3180
+ }
3181
+ function update() {
3182
+ // Update Navigation Buttons
3183
+ const {
3184
+ nextEl,
3185
+ prevEl
3186
+ } = swiper.navigation;
3187
+ if (swiper.params.loop) {
3188
+ toggleEl(prevEl, false);
3189
+ toggleEl(nextEl, false);
3190
+ return;
3191
+ }
3192
+ toggleEl(prevEl, swiper.isBeginning && !swiper.params.rewind);
3193
+ toggleEl(nextEl, swiper.isEnd && !swiper.params.rewind);
3194
+ }
3195
+ function onPrevClick(e) {
3196
+ e.preventDefault();
3197
+ if (swiper.isBeginning && !swiper.params.loop && !swiper.params.rewind) return;
3198
+ swiper.slidePrev();
3199
+ emit('navigationPrev');
3200
+ }
3201
+ function onNextClick(e) {
3202
+ e.preventDefault();
3203
+ if (swiper.isEnd && !swiper.params.loop && !swiper.params.rewind) return;
3204
+ swiper.slideNext();
3205
+ emit('navigationNext');
3206
+ }
3207
+ function init() {
3208
+ const params = swiper.params.navigation;
3209
+ swiper.params.navigation = createElementIfNotDefined(swiper, swiper.originalParams.navigation, swiper.params.navigation, {
3210
+ nextEl: 'swiper-button-next',
3211
+ prevEl: 'swiper-button-prev'
3212
+ });
3213
+ if (!(params.nextEl || params.prevEl)) return;
3214
+ let nextEl = getEl(params.nextEl);
3215
+ let prevEl = getEl(params.prevEl);
3216
+ Object.assign(swiper.navigation, {
3217
+ nextEl,
3218
+ prevEl
3219
+ });
3220
+ nextEl = makeElementsArray(nextEl);
3221
+ prevEl = makeElementsArray(prevEl);
3222
+ const initButton = (el, dir) => {
3223
+ if (el) {
3224
+ el.addEventListener('click', dir === 'next' ? onNextClick : onPrevClick);
3225
+ }
3226
+ if (!swiper.enabled && el) {
3227
+ el.classList.add(...params.lockClass.split(' '));
3228
+ }
3229
+ };
3230
+ nextEl.forEach(el => initButton(el, 'next'));
3231
+ prevEl.forEach(el => initButton(el, 'prev'));
3232
+ }
3233
+ function destroy() {
3234
+ let {
3235
+ nextEl,
3236
+ prevEl
3237
+ } = swiper.navigation;
3238
+ nextEl = makeElementsArray(nextEl);
3239
+ prevEl = makeElementsArray(prevEl);
3240
+ const destroyButton = (el, dir) => {
3241
+ el.removeEventListener('click', dir === 'next' ? onNextClick : onPrevClick);
3242
+ el.classList.remove(...swiper.params.navigation.disabledClass.split(' '));
3243
+ };
3244
+ nextEl.forEach(el => destroyButton(el, 'next'));
3245
+ prevEl.forEach(el => destroyButton(el, 'prev'));
3246
+ }
3247
+ on('init', () => {
3248
+ if (swiper.params.navigation.enabled === false) {
3249
+ // eslint-disable-next-line
3250
+ disable();
3251
+ } else {
3252
+ init();
3253
+ update();
3254
+ }
3255
+ });
3256
+ on('toEdge fromEdge lock unlock', () => {
3257
+ update();
3258
+ });
3259
+ on('destroy', () => {
3260
+ destroy();
3261
+ });
3262
+ on('enable disable', () => {
3263
+ let {
3264
+ nextEl,
3265
+ prevEl
3266
+ } = swiper.navigation;
3267
+ nextEl = makeElementsArray(nextEl);
3268
+ prevEl = makeElementsArray(prevEl);
3269
+ if (swiper.enabled) {
3270
+ update();
3271
+ return;
3272
+ }
3273
+ [...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList.add(swiper.params.navigation.lockClass));
3274
+ });
3275
+ on('click', (_s, e) => {
3276
+ let {
3277
+ nextEl,
3278
+ prevEl
3279
+ } = swiper.navigation;
3280
+ nextEl = makeElementsArray(nextEl);
3281
+ prevEl = makeElementsArray(prevEl);
3282
+ const targetEl = e.target;
3283
+ let targetIsButton = prevEl.includes(targetEl) || nextEl.includes(targetEl);
3284
+ if (swiper.isElement && !targetIsButton) {
3285
+ const path = e.path || e.composedPath && e.composedPath();
3286
+ if (path) {
3287
+ targetIsButton = path.find(pathEl => nextEl.includes(pathEl) || prevEl.includes(pathEl));
3288
+ }
3289
+ }
3290
+ if (swiper.params.navigation.hideOnClick && !targetIsButton) {
3291
+ if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return;
3292
+ let isHidden;
3293
+ if (nextEl.length) {
3294
+ isHidden = nextEl[0].classList.contains(swiper.params.navigation.hiddenClass);
3295
+ } else if (prevEl.length) {
3296
+ isHidden = prevEl[0].classList.contains(swiper.params.navigation.hiddenClass);
3297
+ }
3298
+ if (isHidden === true) {
3299
+ emit('navigationShow');
3300
+ } else {
3301
+ emit('navigationHide');
3302
+ }
3303
+ [...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList.toggle(swiper.params.navigation.hiddenClass));
3304
+ }
3305
+ });
3306
+ const enable = () => {
3307
+ swiper.el.classList.remove(...swiper.params.navigation.navigationDisabledClass.split(' '));
3308
+ init();
3309
+ update();
3310
+ };
3311
+ const disable = () => {
3312
+ swiper.el.classList.add(...swiper.params.navigation.navigationDisabledClass.split(' '));
3313
+ destroy();
3314
+ };
3315
+ Object.assign(swiper.navigation, {
3316
+ enable,
3317
+ disable,
3318
+ update,
3319
+ init,
3320
+ destroy
3321
+ });
3322
+ }
3323
+
3004
3324
  function classesToSelector(classes) {
3005
3325
  if (classes === void 0) {
3006
3326
  classes = '';
@@ -3807,6 +4127,374 @@
3807
4127
  });
3808
4128
  }
3809
4129
 
4130
+ function A11y(_ref) {
4131
+ let {
4132
+ swiper,
4133
+ extendParams,
4134
+ on
4135
+ } = _ref;
4136
+ extendParams({
4137
+ a11y: {
4138
+ enabled: true,
4139
+ notificationClass: 'swiper-notification',
4140
+ prevSlideMessage: 'Previous slide',
4141
+ nextSlideMessage: 'Next slide',
4142
+ firstSlideMessage: 'This is the first slide',
4143
+ lastSlideMessage: 'This is the last slide',
4144
+ paginationBulletMessage: 'Go to slide {{index}}',
4145
+ slideLabelMessage: '{{index}} / {{slidesLength}}',
4146
+ containerMessage: null,
4147
+ containerRoleDescriptionMessage: null,
4148
+ itemRoleDescriptionMessage: null,
4149
+ slideRole: 'group',
4150
+ id: null
4151
+ }
4152
+ });
4153
+ swiper.a11y = {
4154
+ clicked: false
4155
+ };
4156
+ let liveRegion = null;
4157
+ let preventFocusHandler;
4158
+ let focusTargetSlideEl;
4159
+ let visibilityChangedTimestamp = new Date().getTime();
4160
+ function notify(message) {
4161
+ const notification = liveRegion;
4162
+ if (notification.length === 0) return;
4163
+ notification.innerHTML = '';
4164
+ notification.innerHTML = message;
4165
+ }
4166
+ function getRandomNumber(size) {
4167
+ if (size === void 0) {
4168
+ size = 16;
4169
+ }
4170
+ const randomChar = () => Math.round(16 * Math.random()).toString(16);
4171
+ return 'x'.repeat(size).replace(/x/g, randomChar);
4172
+ }
4173
+ function makeElFocusable(el) {
4174
+ el = makeElementsArray(el);
4175
+ el.forEach(subEl => {
4176
+ subEl.setAttribute('tabIndex', '0');
4177
+ });
4178
+ }
4179
+ function makeElNotFocusable(el) {
4180
+ el = makeElementsArray(el);
4181
+ el.forEach(subEl => {
4182
+ subEl.setAttribute('tabIndex', '-1');
4183
+ });
4184
+ }
4185
+ function addElRole(el, role) {
4186
+ el = makeElementsArray(el);
4187
+ el.forEach(subEl => {
4188
+ subEl.setAttribute('role', role);
4189
+ });
4190
+ }
4191
+ function addElRoleDescription(el, description) {
4192
+ el = makeElementsArray(el);
4193
+ el.forEach(subEl => {
4194
+ subEl.setAttribute('aria-roledescription', description);
4195
+ });
4196
+ }
4197
+ function addElControls(el, controls) {
4198
+ el = makeElementsArray(el);
4199
+ el.forEach(subEl => {
4200
+ subEl.setAttribute('aria-controls', controls);
4201
+ });
4202
+ }
4203
+ function addElLabel(el, label) {
4204
+ el = makeElementsArray(el);
4205
+ el.forEach(subEl => {
4206
+ subEl.setAttribute('aria-label', label);
4207
+ });
4208
+ }
4209
+ function addElId(el, id) {
4210
+ el = makeElementsArray(el);
4211
+ el.forEach(subEl => {
4212
+ subEl.setAttribute('id', id);
4213
+ });
4214
+ }
4215
+ function addElLive(el, live) {
4216
+ el = makeElementsArray(el);
4217
+ el.forEach(subEl => {
4218
+ subEl.setAttribute('aria-live', live);
4219
+ });
4220
+ }
4221
+ function disableEl(el) {
4222
+ el = makeElementsArray(el);
4223
+ el.forEach(subEl => {
4224
+ subEl.setAttribute('aria-disabled', true);
4225
+ });
4226
+ }
4227
+ function enableEl(el) {
4228
+ el = makeElementsArray(el);
4229
+ el.forEach(subEl => {
4230
+ subEl.setAttribute('aria-disabled', false);
4231
+ });
4232
+ }
4233
+ function onEnterOrSpaceKey(e) {
4234
+ if (e.keyCode !== 13 && e.keyCode !== 32) return;
4235
+ const params = swiper.params.a11y;
4236
+ const targetEl = e.target;
4237
+ if (swiper.pagination && swiper.pagination.el && (targetEl === swiper.pagination.el || swiper.pagination.el.contains(e.target))) {
4238
+ if (!e.target.matches(classesToSelector(swiper.params.pagination.bulletClass))) return;
4239
+ }
4240
+ if (swiper.navigation && swiper.navigation.prevEl && swiper.navigation.nextEl) {
4241
+ const prevEls = makeElementsArray(swiper.navigation.prevEl);
4242
+ const nextEls = makeElementsArray(swiper.navigation.nextEl);
4243
+ if (nextEls.includes(targetEl)) {
4244
+ if (!(swiper.isEnd && !swiper.params.loop)) {
4245
+ swiper.slideNext();
4246
+ }
4247
+ if (swiper.isEnd) {
4248
+ notify(params.lastSlideMessage);
4249
+ } else {
4250
+ notify(params.nextSlideMessage);
4251
+ }
4252
+ }
4253
+ if (prevEls.includes(targetEl)) {
4254
+ if (!(swiper.isBeginning && !swiper.params.loop)) {
4255
+ swiper.slidePrev();
4256
+ }
4257
+ if (swiper.isBeginning) {
4258
+ notify(params.firstSlideMessage);
4259
+ } else {
4260
+ notify(params.prevSlideMessage);
4261
+ }
4262
+ }
4263
+ }
4264
+ if (swiper.pagination && targetEl.matches(classesToSelector(swiper.params.pagination.bulletClass))) {
4265
+ targetEl.click();
4266
+ }
4267
+ }
4268
+ function updateNavigation() {
4269
+ if (swiper.params.loop || swiper.params.rewind || !swiper.navigation) return;
4270
+ const {
4271
+ nextEl,
4272
+ prevEl
4273
+ } = swiper.navigation;
4274
+ if (prevEl) {
4275
+ if (swiper.isBeginning) {
4276
+ disableEl(prevEl);
4277
+ makeElNotFocusable(prevEl);
4278
+ } else {
4279
+ enableEl(prevEl);
4280
+ makeElFocusable(prevEl);
4281
+ }
4282
+ }
4283
+ if (nextEl) {
4284
+ if (swiper.isEnd) {
4285
+ disableEl(nextEl);
4286
+ makeElNotFocusable(nextEl);
4287
+ } else {
4288
+ enableEl(nextEl);
4289
+ makeElFocusable(nextEl);
4290
+ }
4291
+ }
4292
+ }
4293
+ function hasPagination() {
4294
+ return swiper.pagination && swiper.pagination.bullets && swiper.pagination.bullets.length;
4295
+ }
4296
+ function hasClickablePagination() {
4297
+ return hasPagination() && swiper.params.pagination.clickable;
4298
+ }
4299
+ function updatePagination() {
4300
+ const params = swiper.params.a11y;
4301
+ if (!hasPagination()) return;
4302
+ swiper.pagination.bullets.forEach(bulletEl => {
4303
+ if (swiper.params.pagination.clickable) {
4304
+ makeElFocusable(bulletEl);
4305
+ if (!swiper.params.pagination.renderBullet) {
4306
+ addElRole(bulletEl, 'button');
4307
+ addElLabel(bulletEl, params.paginationBulletMessage.replace(/\{\{index\}\}/, elementIndex(bulletEl) + 1));
4308
+ }
4309
+ }
4310
+ if (bulletEl.matches(classesToSelector(swiper.params.pagination.bulletActiveClass))) {
4311
+ bulletEl.setAttribute('aria-current', 'true');
4312
+ } else {
4313
+ bulletEl.removeAttribute('aria-current');
4314
+ }
4315
+ });
4316
+ }
4317
+ const initNavEl = (el, wrapperId, message) => {
4318
+ makeElFocusable(el);
4319
+ if (el.tagName !== 'BUTTON') {
4320
+ addElRole(el, 'button');
4321
+ el.addEventListener('keydown', onEnterOrSpaceKey);
4322
+ }
4323
+ addElLabel(el, message);
4324
+ addElControls(el, wrapperId);
4325
+ };
4326
+ const handlePointerDown = e => {
4327
+ if (focusTargetSlideEl && focusTargetSlideEl !== e.target && !focusTargetSlideEl.contains(e.target)) {
4328
+ preventFocusHandler = true;
4329
+ }
4330
+ swiper.a11y.clicked = true;
4331
+ };
4332
+ const handlePointerUp = () => {
4333
+ preventFocusHandler = false;
4334
+ requestAnimationFrame(() => {
4335
+ requestAnimationFrame(() => {
4336
+ if (!swiper.destroyed) {
4337
+ swiper.a11y.clicked = false;
4338
+ }
4339
+ });
4340
+ });
4341
+ };
4342
+ const onVisibilityChange = e => {
4343
+ visibilityChangedTimestamp = new Date().getTime();
4344
+ };
4345
+ const handleFocus = e => {
4346
+ if (swiper.a11y.clicked) return;
4347
+ if (new Date().getTime() - visibilityChangedTimestamp < 100) return;
4348
+ const slideEl = e.target.closest(`.${swiper.params.slideClass}, swiper-slide`);
4349
+ if (!slideEl || !swiper.slides.includes(slideEl)) return;
4350
+ focusTargetSlideEl = slideEl;
4351
+ const isActive = swiper.slides.indexOf(slideEl) === swiper.activeIndex;
4352
+ const isVisible = swiper.params.watchSlidesProgress && swiper.visibleSlides && swiper.visibleSlides.includes(slideEl);
4353
+ if (isActive || isVisible) return;
4354
+ if (e.sourceCapabilities && e.sourceCapabilities.firesTouchEvents) return;
4355
+ if (swiper.isHorizontal()) {
4356
+ swiper.el.scrollLeft = 0;
4357
+ } else {
4358
+ swiper.el.scrollTop = 0;
4359
+ }
4360
+ requestAnimationFrame(() => {
4361
+ if (preventFocusHandler) return;
4362
+ if (swiper.params.loop) {
4363
+ swiper.slideToLoop(parseInt(slideEl.getAttribute('data-swiper-slide-index')), 0);
4364
+ } else {
4365
+ swiper.slideTo(swiper.slides.indexOf(slideEl), 0);
4366
+ }
4367
+ preventFocusHandler = false;
4368
+ });
4369
+ };
4370
+ const initSlides = () => {
4371
+ const params = swiper.params.a11y;
4372
+ if (params.itemRoleDescriptionMessage) {
4373
+ addElRoleDescription(swiper.slides, params.itemRoleDescriptionMessage);
4374
+ }
4375
+ if (params.slideRole) {
4376
+ addElRole(swiper.slides, params.slideRole);
4377
+ }
4378
+ const slidesLength = swiper.slides.length;
4379
+ if (params.slideLabelMessage) {
4380
+ swiper.slides.forEach((slideEl, index) => {
4381
+ const slideIndex = swiper.params.loop ? parseInt(slideEl.getAttribute('data-swiper-slide-index'), 10) : index;
4382
+ const ariaLabelMessage = params.slideLabelMessage.replace(/\{\{index\}\}/, slideIndex + 1).replace(/\{\{slidesLength\}\}/, slidesLength);
4383
+ addElLabel(slideEl, ariaLabelMessage);
4384
+ });
4385
+ }
4386
+ };
4387
+ const init = () => {
4388
+ const params = swiper.params.a11y;
4389
+ swiper.el.append(liveRegion);
4390
+
4391
+ // Container
4392
+ const containerEl = swiper.el;
4393
+ if (params.containerRoleDescriptionMessage) {
4394
+ addElRoleDescription(containerEl, params.containerRoleDescriptionMessage);
4395
+ }
4396
+ if (params.containerMessage) {
4397
+ addElLabel(containerEl, params.containerMessage);
4398
+ }
4399
+
4400
+ // Wrapper
4401
+ const wrapperEl = swiper.wrapperEl;
4402
+ const wrapperId = params.id || wrapperEl.getAttribute('id') || `swiper-wrapper-${getRandomNumber(16)}`;
4403
+ const live = swiper.params.autoplay && swiper.params.autoplay.enabled ? 'off' : 'polite';
4404
+ addElId(wrapperEl, wrapperId);
4405
+ addElLive(wrapperEl, live);
4406
+
4407
+ // Slide
4408
+ initSlides();
4409
+
4410
+ // Navigation
4411
+ let {
4412
+ nextEl,
4413
+ prevEl
4414
+ } = swiper.navigation ? swiper.navigation : {};
4415
+ nextEl = makeElementsArray(nextEl);
4416
+ prevEl = makeElementsArray(prevEl);
4417
+ if (nextEl) {
4418
+ nextEl.forEach(el => initNavEl(el, wrapperId, params.nextSlideMessage));
4419
+ }
4420
+ if (prevEl) {
4421
+ prevEl.forEach(el => initNavEl(el, wrapperId, params.prevSlideMessage));
4422
+ }
4423
+
4424
+ // Pagination
4425
+ if (hasClickablePagination()) {
4426
+ const paginationEl = makeElementsArray(swiper.pagination.el);
4427
+ paginationEl.forEach(el => {
4428
+ el.addEventListener('keydown', onEnterOrSpaceKey);
4429
+ });
4430
+ }
4431
+
4432
+ // Tab focus
4433
+ const document = getDocument();
4434
+ document.addEventListener('visibilitychange', onVisibilityChange);
4435
+ swiper.el.addEventListener('focus', handleFocus, true);
4436
+ swiper.el.addEventListener('focus', handleFocus, true);
4437
+ swiper.el.addEventListener('pointerdown', handlePointerDown, true);
4438
+ swiper.el.addEventListener('pointerup', handlePointerUp, true);
4439
+ };
4440
+ function destroy() {
4441
+ if (liveRegion) liveRegion.remove();
4442
+ let {
4443
+ nextEl,
4444
+ prevEl
4445
+ } = swiper.navigation ? swiper.navigation : {};
4446
+ nextEl = makeElementsArray(nextEl);
4447
+ prevEl = makeElementsArray(prevEl);
4448
+ if (nextEl) {
4449
+ nextEl.forEach(el => el.removeEventListener('keydown', onEnterOrSpaceKey));
4450
+ }
4451
+ if (prevEl) {
4452
+ prevEl.forEach(el => el.removeEventListener('keydown', onEnterOrSpaceKey));
4453
+ }
4454
+
4455
+ // Pagination
4456
+ if (hasClickablePagination()) {
4457
+ const paginationEl = makeElementsArray(swiper.pagination.el);
4458
+ paginationEl.forEach(el => {
4459
+ el.removeEventListener('keydown', onEnterOrSpaceKey);
4460
+ });
4461
+ }
4462
+ const document = getDocument();
4463
+ document.removeEventListener('visibilitychange', onVisibilityChange);
4464
+ // Tab focus
4465
+ if (swiper.el && typeof swiper.el !== 'string') {
4466
+ swiper.el.removeEventListener('focus', handleFocus, true);
4467
+ swiper.el.removeEventListener('pointerdown', handlePointerDown, true);
4468
+ swiper.el.removeEventListener('pointerup', handlePointerUp, true);
4469
+ }
4470
+ }
4471
+ on('beforeInit', () => {
4472
+ liveRegion = createElement('span', swiper.params.a11y.notificationClass);
4473
+ liveRegion.setAttribute('aria-live', 'assertive');
4474
+ liveRegion.setAttribute('aria-atomic', 'true');
4475
+ });
4476
+ on('afterInit', () => {
4477
+ if (!swiper.params.a11y.enabled) return;
4478
+ init();
4479
+ });
4480
+ on('slidesLengthChange snapGridLengthChange slidesGridLengthChange', () => {
4481
+ if (!swiper.params.a11y.enabled) return;
4482
+ initSlides();
4483
+ });
4484
+ on('fromEdge toEdge afterInit lock unlock', () => {
4485
+ if (!swiper.params.a11y.enabled) return;
4486
+ updateNavigation();
4487
+ });
4488
+ on('paginationUpdate', () => {
4489
+ if (!swiper.params.a11y.enabled) return;
4490
+ updatePagination();
4491
+ });
4492
+ on('destroy', () => {
4493
+ if (!swiper.params.a11y.enabled) return;
4494
+ destroy();
4495
+ });
4496
+ }
4497
+
3810
4498
  /* eslint no-underscore-dangle: "off" */
3811
4499
  /* eslint no-use-before-define: "off" */
3812
4500
  function Autoplay(_ref) {
@@ -8990,17 +9678,18 @@
8990
9678
  * @Author: binruan@chatlabs.com
8991
9679
  * @Date: 2023-11-02 18:34:34
8992
9680
  * @LastEditors: binruan@chatlabs.com
8993
- * @LastEditTime: 2024-11-06 17:27:45
9681
+ * @LastEditTime: 2024-11-20 18:37:10
8994
9682
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
8995
9683
  *
8996
9684
  */
8997
9685
  const closeIcon$1 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
8998
9686
  const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema, fullHeight = window.innerHeight, isFullScreen = false, openState }) => {
8999
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
9687
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
9000
9688
  const touchRef = React.useRef(null);
9001
9689
  const fTouchRef = React.useRef(null);
9002
9690
  const touchMoveRef = React.useRef(null);
9003
9691
  const ref = React.useRef(null);
9692
+ const modalRef = React.useRef(null);
9004
9693
  const MODAL_DEF_TRANS = fullHeight * 0.2;
9005
9694
  const MODAL_DEF_CON_H = isFullScreen ? fullHeight : fullHeight * 0.8;
9006
9695
  const [modalTrans, setModalTrans] = React.useState(MODAL_DEF_TRANS);
@@ -9048,6 +9737,46 @@
9048
9737
  const child = React.useCallback(() => {
9049
9738
  return children;
9050
9739
  }, [_popup, openState, globalConfig]);
9740
+ React.useEffect(() => {
9741
+ const trapFocus = (element) => {
9742
+ var focusableEls = element === null || element === void 0 ? void 0 : element.querySelectorAll('[role="button"],a, a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])');
9743
+ var firstFocusableEl = focusableEls === null || focusableEls === void 0 ? void 0 : focusableEls[0];
9744
+ var lastFocusableEl = focusableEls === null || focusableEls === void 0 ? void 0 : focusableEls[(focusableEls === null || focusableEls === void 0 ? void 0 : focusableEls.length) - 1];
9745
+ var KEYCODE_TAB = 9;
9746
+ element.addEventListener('keydown', function (e) {
9747
+ if (e.key === 'Escape' || e.key === 'Esc') {
9748
+ // 在这里执行按下 Esc 键时的操作
9749
+ handleClose();
9750
+ e.preventDefault();
9751
+ }
9752
+ var isTabPressed = e.key === 'Tab' || e.keyCode === KEYCODE_TAB;
9753
+ if (!isTabPressed) {
9754
+ return;
9755
+ }
9756
+ if (e.shiftKey) {
9757
+ /* shift + tab */
9758
+ if ((document === null || document === void 0 ? void 0 : document.activeElement) === firstFocusableEl) {
9759
+ lastFocusableEl === null || lastFocusableEl === void 0 ? void 0 : lastFocusableEl.focus();
9760
+ e.preventDefault();
9761
+ }
9762
+ }
9763
+ else {
9764
+ /* tab */
9765
+ if ((document === null || document === void 0 ? void 0 : document.activeElement) === lastFocusableEl) {
9766
+ firstFocusableEl === null || firstFocusableEl === void 0 ? void 0 : firstFocusableEl.focus();
9767
+ e.preventDefault();
9768
+ }
9769
+ }
9770
+ });
9771
+ firstFocusableEl === null || firstFocusableEl === void 0 ? void 0 : firstFocusableEl.focus();
9772
+ };
9773
+ if (modalRef === null || modalRef === void 0 ? void 0 : modalRef.current)
9774
+ trapFocus(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current);
9775
+ return () => {
9776
+ var _a;
9777
+ (_a = modalRef === null || modalRef === void 0 ? void 0 : modalRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('keydown', trapFocus);
9778
+ };
9779
+ }, [modalRef, isShow, _popup]);
9051
9780
  if (!modalEleRef.current)
9052
9781
  return null;
9053
9782
  const handleClose = lodash.debounce(() => {
@@ -9112,7 +9841,7 @@
9112
9841
  width: `calc(100% - ${((_r = (_q = (_p = (_o = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _o === void 0 ? void 0 : _o.props) === null || _p === void 0 ? void 0 : _p.popupBg) === null || _q === void 0 ? void 0 : _q.horizontalMargin) !== null && _r !== void 0 ? _r : 0) * 2}px)`,
9113
9842
  height: '100%'
9114
9843
  } },
9115
- React.createElement("div", Object.assign({ className: `modal-container ${isOpen ? 'modal-popIn' : 'modal-popOut'}`, role: 'dialog', "aria-label": (_s = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _s === void 0 ? void 0 : _s.displayName, "aria-modal": true, style: Object.assign(Object.assign({ padding, animationDuration: ((_t = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _t !== void 0 ? _t : 0) / 1000 + 's' }, (isScrollFullScreen && {
9844
+ React.createElement("div", Object.assign({ ref: modalRef, className: `modal-container ${isOpen ? 'modal-popIn' : 'modal-popOut'}`, role: 'dialog', "aria-label": (_s = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _s === void 0 ? void 0 : _s.displayName, "aria-modal": true, "aria-labelledby": 'modal-content', style: Object.assign(Object.assign({ padding, animationDuration: ((_t = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _t !== void 0 ? _t : 0) / 1000 + 's' }, (isScrollFullScreen && {
9116
9845
  transform: `translateY(${modalTrans}px)`
9117
9846
  })), { overflow: 'hidden', borderRadius: `${(_x = (_w = (_v = (_u = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _u === void 0 ? void 0 : _u.props) === null || _v === void 0 ? void 0 : _v.popupBg) === null || _w === void 0 ? void 0 : _w.borderRadius) !== null && _x !== void 0 ? _x : 0}px`, zIndex: 9 }), onClick: (e) => {
9118
9847
  e.stopPropagation();
@@ -9122,18 +9851,18 @@
9122
9851
  onTouchStart: handleTouchStart,
9123
9852
  onTouchEnd: handleTouchEnd
9124
9853
  })),
9125
- React.createElement("button", { className: 'modal-icon-wrapper', role: 'button', "aria-label": 'close button', onClick: onClose, style: { top: scrollTop } },
9126
- React.createElement("img", { src: (_y = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _y !== void 0 ? _y : closeIcon$1, alt: 'close button', className: 'modal-icon' })),
9127
- React.createElement("div", Object.assign({ ref: ref, style: {
9854
+ React.createElement("div", Object.assign({ id: 'modal-content', ref: ref, style: {
9128
9855
  height: isScrollFullScreen ? fullHeight : MODAL_DEF_CON_H,
9129
9856
  overflow: (isScrollFullScreen && modalTrans <= 0) || !isScrollFullScreen ? 'auto' : 'hidden',
9130
9857
  zIndex: 1
9131
- } }, (((_0 = (_z = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _z === void 0 ? void 0 : _z.props) === null || _0 === void 0 ? void 0 : _0.enableFixedCloseButton) && {
9858
+ } }, (((_z = (_y = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _y === void 0 ? void 0 : _y.props) === null || _z === void 0 ? void 0 : _z.enableFixedCloseButton) && {
9132
9859
  onScroll: (e) => {
9133
9860
  var _a;
9134
9861
  setScrollTop(15 - ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.scrollTop));
9135
9862
  }
9136
- })), child())))))), modalEleRef.current);
9863
+ })), child()),
9864
+ React.createElement("button", { className: 'modal-icon-wrapper', role: 'button', "aria-label": 'close button', onClick: onClose, style: { top: scrollTop } },
9865
+ React.createElement("img", { src: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon$1, alt: 'close button', className: 'modal-icon' }))))))), modalEleRef.current);
9137
9866
  };
9138
9867
  var Modal$1 = React.memo(Modal);
9139
9868
 
@@ -9141,7 +9870,7 @@
9141
9870
  * @Author: binruan@chatlabs.com
9142
9871
  * @Date: 2023-12-26 16:11:34
9143
9872
  * @LastEditors: binruan@chatlabs.com
9144
- * @LastEditTime: 2024-10-18 14:52:42
9873
+ * @LastEditTime: 2024-11-07 14:27:18
9145
9874
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ExpandableText.tsx
9146
9875
  *
9147
9876
  */
@@ -9198,7 +9927,7 @@
9198
9927
  wordBreak: 'break-word'
9199
9928
  }, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
9200
9929
  React.createElement("div", { ref: multiRowCopy, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
9201
- text && isPost && isShow && (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
9930
+ text && isPost && isShow && (React.createElement("button", { "aria-label": isShowMore ? unfoldText || 'show less' : foldText || 'show more', style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
9202
9931
  __html: setFontForText(isShowMore ? unfoldText || 'show less' : foldText || 'show more', style)
9203
9932
  } }))));
9204
9933
  };
@@ -9251,7 +9980,7 @@
9251
9980
  * @Author: binruan@chatlabs.com
9252
9981
  * @Date: 2024-03-20 10:27:32
9253
9982
  * @LastEditors: binruan@chatlabs.com
9254
- * @LastEditTime: 2024-10-17 18:02:56
9983
+ * @LastEditTime: 2024-11-19 10:29:18
9255
9984
  * @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Scroll.tsx
9256
9985
  *
9257
9986
  */
@@ -9263,7 +9992,7 @@
9263
9992
  if (enableSlideActive)
9264
9993
  (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
9265
9994
  }, [popupDetailData, enableSlideActive]);
9266
- return (React.createElement(Swiper, { ref: ref, direction: 'horizontal', slidesPerView: 'auto', freeMode: true, mousewheel: true, modules: [freeMode, Scrollbar, Mousewheel], style: Object.assign({ padding: isPadding ? '0 12px 0 20px' : 0 }, style) }, children));
9995
+ return (React.createElement(Swiper, { role: 'list', tag: 'ul', ref: ref, direction: 'horizontal', slidesPerView: 'auto', freeMode: true, mousewheel: true, modules: [freeMode, Scrollbar, Mousewheel], style: Object.assign({ padding: isPadding ? '0 12px 0 20px' : 0 }, style) }, children));
9267
9996
  };
9268
9997
  var Scroll$1 = React.memo(Scroll);
9269
9998
 
@@ -9400,7 +10129,8 @@
9400
10129
  const [showModal, setShowModal] = React.useState(false);
9401
10130
  const [show3DModal, setShow3DModal] = React.useState(false);
9402
10131
  const [checkCommodityIndex, setCheckCommodityIndex] = React.useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
9403
- const ref = React.useRef();
10132
+ const swiperRef = React.useRef();
10133
+ const [swiperActiveIndex, setSwiperActiveIndex] = React.useState(0);
9404
10134
  const data = isPost ? rec : popupDetailData;
9405
10135
  let product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_d = (_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct) !== null && _d !== void 0 ? _d : (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProducts) === null || _f === void 0 ? void 0 : _f[0];
9406
10136
  let cta = isPost
@@ -9476,7 +10206,7 @@
9476
10206
  };
9477
10207
  const renderBtn = () => {
9478
10208
  var _a, _b;
9479
- return (React.createElement(React.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (React.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 },
10209
+ return (React.createElement(React.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("a", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', role: 'button', tabIndex: 0, onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle },
9480
10210
  React.createElement("span", { dangerouslySetInnerHTML: {
9481
10211
  __html: setFontForText((_b = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _b !== void 0 ? _b : 'Purchase on Website', buttonStyle)
9482
10212
  } })))));
@@ -9491,9 +10221,9 @@
9491
10221
  popupCurTimeRef.current = new Date();
9492
10222
  setCheckCommodityIndex(index);
9493
10223
  checkCommodityIndexRef.current = index;
9494
- if (ref === null || ref === void 0 ? void 0 : ref.current) {
9495
- ref.current.swiper.slideTo(0);
9496
- ref.current.swiper.autoplay.start();
10224
+ if (swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) {
10225
+ swiperRef.current.swiper.slideTo(0);
10226
+ swiperRef.current.swiper.autoplay.start();
9497
10227
  }
9498
10228
  }, []);
9499
10229
  const renderCommodityGroup = React.useCallback(() => {
@@ -9511,17 +10241,40 @@
9511
10241
  return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
9512
10242
  }, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
9513
10243
  const iframeUrl = product === null || product === void 0 ? void 0 : product.remark;
10244
+ const handleMouseEnter = React.useCallback(() => {
10245
+ if (swiperRef.current && swiperRef.current.swiper && isAlly) {
10246
+ swiperRef.current.swiper.autoplay.stop();
10247
+ }
10248
+ }, []);
10249
+ const handleMouseLeave = React.useCallback(() => {
10250
+ if (swiperRef.current && swiperRef.current.swiper && isAlly) {
10251
+ swiperRef.current.swiper.autoplay.start();
10252
+ }
10253
+ }, []);
10254
+ const handleSlideChange = React.useCallback((swiper) => {
10255
+ setSwiperActiveIndex(swiper.activeIndex);
10256
+ }, []);
10257
+ const isAlly = React.useMemo(() => getScreenReader(), []);
9514
10258
  return (React.createElement(React.Fragment, null,
9515
10259
  React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
9516
- React.createElement("div", { style: { position: 'relative' } },
9517
- product && ((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) > 0 && (React.createElement(Swiper, { height: height, modules: [Pagination, Autoplay], pagination: {
10260
+ React.createElement("div", { style: { position: 'relative' }, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
10261
+ product && ((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) > 0 && (React.createElement(Swiper, Object.assign({ height: height, modules: [Pagination, Autoplay, ...(isAlly ? [Navigation, A11y, Mousewheel, Keyboard] : [])], pagination: {
9518
10262
  clickable: true,
9519
10263
  bulletActiveClass: 'swipe-item-active-bullet',
9520
10264
  clickableClass: getDotsAlign,
9521
10265
  bulletElement: 'button'
9522
- }, loop: true, autoplay: {
10266
+ } }, (isAlly
10267
+ ? {
10268
+ mousewheel: true,
10269
+ keyboard: true,
10270
+ navigation: true,
10271
+ a11y: {
10272
+ enabled: true
10273
+ }
10274
+ }
10275
+ : {}), { loop: true, autoplay: {
9523
10276
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
9524
- }, ref: ref, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': { bottom: (_x = swiper === null || swiper === void 0 ? void 0 : swiper.dotsMarginBottom) !== null && _x !== void 0 ? _x : 0, fontSize: '14px' } }, ((swiper === null || swiper === void 0 ? void 0 : swiper.dotsBgColor) && {
10277
+ }, ref: swiperRef, onSlideChange: handleSlideChange, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': { bottom: (_x = swiper === null || swiper === void 0 ? void 0 : swiper.dotsMarginBottom) !== null && _x !== void 0 ? _x : 0, fontSize: '14px' } }, ((swiper === null || swiper === void 0 ? void 0 : swiper.dotsBgColor) && {
9525
10278
  '.swiper-pagination-bullet': {
9526
10279
  backgroundColor: swiper === null || swiper === void 0 ? void 0 : swiper.dotsBgColor,
9527
10280
  opacity: 1
@@ -9531,10 +10284,10 @@
9531
10284
  backgroundColor: `${swiper === null || swiper === void 0 ? void 0 : swiper.dotsActiveColor}!important`,
9532
10285
  opacity: 1
9533
10286
  }
9534
- }))) },
9535
- React.createElement(React.Fragment, null, (_y = product === null || product === void 0 ? void 0 : product.homePage) === null || _y === void 0 ? void 0 : _y.map((src) => {
10287
+ }))) }),
10288
+ React.createElement(React.Fragment, null, (_y = product === null || product === void 0 ? void 0 : product.homePage) === null || _y === void 0 ? void 0 : _y.map((src, srcKey) => {
9536
10289
  var _a;
9537
- return (React.createElement(SwiperSlide, { key: src },
10290
+ return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
9538
10291
  React.createElement("div", { style: {
9539
10292
  overflow: 'hidden',
9540
10293
  width,
@@ -10287,7 +11040,8 @@
10287
11040
  const curTimeRef = React.useRef(null);
10288
11041
  const [show3DModal, setShow3DModal] = React.useState(false);
10289
11042
  const [checkCommodityIndex, setCheckCommodityIndex] = React.useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
10290
- const ref = React.useRef();
11043
+ const swiperRef = React.useRef();
11044
+ const [swiperActiveIndex, setSwiperActiveIndex] = React.useState(0);
10291
11045
  const data = isPost ? rec : popupDetailData;
10292
11046
  let product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_d = (_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct) !== null && _d !== void 0 ? _d : (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProducts) === null || _f === void 0 ? void 0 : _f[0];
10293
11047
  let cta = isPost
@@ -10407,9 +11161,9 @@ Made in Italy` })));
10407
11161
  popupCurTimeRef.current = new Date();
10408
11162
  setCheckCommodityIndex(index);
10409
11163
  checkCommodityIndexRef.current = index;
10410
- if (ref === null || ref === void 0 ? void 0 : ref.current) {
10411
- ref.current.swiper.slideTo(0);
10412
- ref.current.swiper.autoplay.start();
11164
+ if (swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) {
11165
+ swiperRef.current.swiper.slideTo(0);
11166
+ swiperRef.current.swiper.autoplay.start();
10413
11167
  }
10414
11168
  }, []);
10415
11169
  const renderCommodityGroup = React.useCallback(() => {
@@ -10427,17 +11181,40 @@ Made in Italy` })));
10427
11181
  return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
10428
11182
  }, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
10429
11183
  const iframeUrl = product === null || product === void 0 ? void 0 : product.remark;
11184
+ const handleMouseEnter = React.useCallback(() => {
11185
+ if (swiperRef.current && swiperRef.current.swiper && isAlly) {
11186
+ swiperRef.current.swiper.autoplay.stop();
11187
+ }
11188
+ }, []);
11189
+ const handleMouseLeave = React.useCallback(() => {
11190
+ if (swiperRef.current && swiperRef.current.swiper && isAlly) {
11191
+ swiperRef.current.swiper.autoplay.start();
11192
+ }
11193
+ }, []);
11194
+ const handleSlideChange = React.useCallback((swiper) => {
11195
+ setSwiperActiveIndex(swiper.activeIndex);
11196
+ }, []);
11197
+ const isAlly = React.useMemo(() => getScreenReader(), []);
10430
11198
  return (React.createElement("div", { className: 'pb-commondityDiroNew' },
10431
11199
  React.createElement("div", Object.assign({ className: css.css(Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' })) }, props),
10432
- React.createElement("div", { style: { position: 'relative' } },
10433
- product && ((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) > 0 && (React.createElement(Swiper, { height: height, modules: [Pagination, Autoplay], pagination: {
11200
+ React.createElement("div", { style: { position: 'relative' }, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
11201
+ product && ((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) > 0 && (React.createElement(Swiper, Object.assign({ height: height, modules: [Pagination, Autoplay, ...(isAlly ? [Navigation, A11y, Mousewheel, Keyboard] : [])], pagination: {
10434
11202
  clickable: true,
10435
11203
  bulletActiveClass: 'swipe-item-active-bullet',
10436
11204
  clickableClass: getDotsAlign,
10437
11205
  bulletElement: 'button'
10438
- }, loop: true, autoplay: {
11206
+ } }, (isAlly
11207
+ ? {
11208
+ mousewheel: true,
11209
+ keyboard: true,
11210
+ navigation: true,
11211
+ a11y: {
11212
+ enabled: true
11213
+ }
11214
+ }
11215
+ : {}), { loop: true, ref: swiperRef, onSlideChange: handleSlideChange, autoplay: {
10439
11216
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
10440
- }, ref: ref, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
11217
+ }, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
10441
11218
  bottom: (_x = swiper === null || swiper === void 0 ? void 0 : swiper.dotsMarginBottom) !== null && _x !== void 0 ? _x : 0,
10442
11219
  fontSize: '14px'
10443
11220
  } }, ((swiper === null || swiper === void 0 ? void 0 : swiper.dotsBgColor) && {
@@ -10450,9 +11227,9 @@ Made in Italy` })));
10450
11227
  backgroundColor: `${swiper === null || swiper === void 0 ? void 0 : swiper.dotsActiveColor}!important`,
10451
11228
  opacity: 1
10452
11229
  }
10453
- }))) }, (_y = product === null || product === void 0 ? void 0 : product.homePage) === null || _y === void 0 ? void 0 : _y.map((src) => {
11230
+ }))) }), (_y = product === null || product === void 0 ? void 0 : product.homePage) === null || _y === void 0 ? void 0 : _y.map((src, srcKey) => {
10454
11231
  var _a;
10455
- return (React.createElement(SwiperSlide, { key: src },
11232
+ return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
10456
11233
  React.createElement("div", { style: {
10457
11234
  overflow: 'hidden',
10458
11235
  width,
@@ -10503,7 +11280,7 @@ Made in Italy` })));
10503
11280
  React.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: {
10504
11281
  __html: setFontForText((_2 = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _2 !== void 0 ? _2 : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
10505
11282
  } }))),
10506
- (!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_3 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _3 !== void 0 ? _3 : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
11283
+ (!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("a", { "aria-label": (_3 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _3 !== void 0 ? _3 : 'Shop now', role: 'button', tabIndex: 0, onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
10507
11284
  React.createElement("span", { dangerouslySetInnerHTML: {
10508
11285
  __html: setFontForText((_4 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _4 !== void 0 ? _4 : 'Shop now', buttonStyle)
10509
11286
  } }))),
@@ -10981,39 +11758,43 @@ Made in Italy` })));
10981
11758
  eventName: 'PageView'
10982
11759
  });
10983
11760
  }, []);
10984
- return (React.createElement("div", { className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px', boxSizing: 'border-box' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
11761
+ return (React.createElement("ul", { role: 'list', className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px', boxSizing: 'border-box' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
10985
11762
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
10986
- return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement("div", Object.assign({ key: index }, props, { className: css.css({
10987
- display: 'flex'
10988
- }), onClick: () => handleClick(item, index) }),
10989
- React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: commodityPicture, enableEventReport: false }),
10990
- React.createElement("div", { style: {
10991
- width: `calc(100% - ${(_e = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.width) !== null && _e !== void 0 ? _e : 0}px - ${(_f = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.marginRight) !== null && _f !== void 0 ? _f : 0}px)`,
11763
+ return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement("li", { role: 'listitem', key: index, onClick: () => handleClick(item, index) },
11764
+ React.createElement("button", Object.assign({ role: 'button', "aria-label": item === null || item === void 0 ? void 0 : item.title, tabIndex: 0, className: css.css({
10992
11765
  display: 'flex',
10993
- flexDirection: 'column',
10994
- justifyContent: 'space-between'
10995
- } },
10996
- React.createElement("div", null,
10997
- React.createElement("div", { className: 'one-line-ellipsis', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.title), dangerouslySetInnerHTML: {
10998
- __html: setFontForText((_g = item === null || item === void 0 ? void 0 : item.title) !== null && _g !== void 0 ? _g : 'Pendant in Yellow Gold with Diamonds, Medium', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
10999
- } }),
11000
- React.createElement("div", { className: 'two-line-ellipsis', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection, hidden: !!item && (!(item === null || item === void 0 ? void 0 : item.collection) || (item === null || item === void 0 ? void 0 : item.collection) === ''), dangerouslySetInnerHTML: {
11001
- __html: setFontForText((_h = item === null || item === void 0 ? void 0 : item.collection) !== null && _h !== void 0 ? _h : 'Tiffany Lock', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
11002
- } })),
11003
- React.createElement("div", { className: css.css({
11766
+ alignItems: 'normal',
11767
+ width: '100%',
11768
+ textAlign: 'left'
11769
+ }) }, props),
11770
+ React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: commodityPicture, enableEventReport: false }),
11771
+ React.createElement("div", { style: {
11772
+ width: `calc(100% - ${(_e = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.width) !== null && _e !== void 0 ? _e : 0}px - ${(_f = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.marginRight) !== null && _f !== void 0 ? _f : 0}px)`,
11004
11773
  display: 'flex',
11005
- alignItems: 'flex-end',
11006
- justifyContent: 'space-between',
11007
- width: '100%',
11008
- overflow: 'hidden'
11009
- }) },
11774
+ flexDirection: 'column',
11775
+ justifyContent: 'space-between'
11776
+ } },
11010
11777
  React.createElement("div", null,
11011
- React.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.price), dangerouslySetInnerHTML: {
11012
- __html: (_j = priceText(item)) !== null && _j !== void 0 ? _j : ''
11778
+ React.createElement("div", { className: 'one-line-ellipsis', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.title), dangerouslySetInnerHTML: {
11779
+ __html: setFontForText((_g = item === null || item === void 0 ? void 0 : item.title) !== null && _g !== void 0 ? _g : 'Pendant in Yellow Gold with Diamonds, Medium', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
11780
+ } }),
11781
+ React.createElement("div", { className: 'two-line-ellipsis', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection, hidden: !!item && (!(item === null || item === void 0 ? void 0 : item.collection) || (item === null || item === void 0 ? void 0 : item.collection) === ''), dangerouslySetInnerHTML: {
11782
+ __html: setFontForText((_h = item === null || item === void 0 ? void 0 : item.collection) !== null && _h !== void 0 ? _h : 'Tiffany Lock', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
11013
11783
  } })),
11014
- React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
11015
- __html: setFontForText((_l = (_k = item === null || item === void 0 ? void 0 : item.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', buttonStyle)
11016
- } })))))));
11784
+ React.createElement("div", { className: css.css({
11785
+ display: 'flex',
11786
+ alignItems: 'flex-end',
11787
+ justifyContent: 'space-between',
11788
+ width: '100%',
11789
+ overflow: 'hidden'
11790
+ }) },
11791
+ React.createElement("div", null,
11792
+ React.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.price), dangerouslySetInnerHTML: {
11793
+ __html: (_j = priceText(item)) !== null && _j !== void 0 ? _j : ''
11794
+ } })),
11795
+ React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
11796
+ __html: setFontForText((_l = (_k = item === null || item === void 0 ? void 0 : item.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', buttonStyle)
11797
+ } }))))))));
11017
11798
  })));
11018
11799
  };
11019
11800
  var CommodityListComponent = React.memo(CommodityList$1);
@@ -11483,44 +12264,55 @@ Made in Italy` })));
11483
12264
  ];
11484
12265
 
11485
12266
  const EventProvider = (_a) => {
11486
- var { rec, children, className, onClick, style, isExternalLink = false, index, jumpLink } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index", "jumpLink"]);
12267
+ var { rec, children, className, onClick, style, isExternalLink = false, index, jumpLink, multItem, multiCheckIndex } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index", "jumpLink", "multItem", "multiCheckIndex"]);
11487
12268
  const ref = React.useRef(null);
11488
12269
  const { popup } = useEditor();
11489
12270
  const { setPopupDetailData, ctaEvent } = useSxpDataSource();
11490
12271
  const { jumpToWeb } = useEventReport();
11491
- const handleClick = lodash.throttle(() => {
11492
- var _a, _b, _c, _d, _e, _f, _g, _h;
11493
- const item = (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
12272
+ const [element, setElement] = React.useState(null);
12273
+ const handleClick = lodash.throttle((event) => {
12274
+ var _a, _b, _c, _d, _e, _f, _g;
12275
+ event.preventDefault();
12276
+ const item = (_c = (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video) !== null && _c !== void 0 ? _c : multItem;
11494
12277
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
11495
12278
  eventSubject: 'clickCta',
11496
12279
  eventDescription: 'User clicked the CTA'
11497
12280
  }, rec, item, index);
11498
- setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
12281
+ setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(multItem && multiCheckIndex
12282
+ ? Object.assign(Object.assign({}, rec), { video: Object.assign(Object.assign({}, rec === null || rec === void 0 ? void 0 : rec.video), { bindProduct: multItem }), index, multiCheckIndex }) : Object.assign(Object.assign({}, rec), { index }));
12283
+ setElement(ref === null || ref === void 0 ? void 0 : ref.current);
11499
12284
  if (isExternalLink) {
11500
- if (jumpLink || ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link)) {
11501
- const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
11502
- const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
12285
+ const link = ((_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindProduct) === null || _e === void 0 ? void 0 : _e.link) || (multItem === null || multItem === void 0 ? void 0 : multItem.link);
12286
+ if (jumpLink || link) {
12287
+ const cta = ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindCta) || (multItem === null || multItem === void 0 ? void 0 : multItem.bindCta);
12288
+ const product = ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) || multItem;
11503
12289
  jumpToWeb(rec, product, cta, index);
11504
- window.location.href = window.getJointUtmLink(jumpLink || ((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link) || '');
12290
+ window.location.href = window.getJointUtmLink(jumpLink || link || '');
11505
12291
  }
11506
12292
  }
11507
12293
  else {
11508
12294
  onClick === null || onClick === void 0 ? void 0 : onClick();
11509
12295
  }
11510
12296
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
11511
- return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
12297
+ React.useEffect(() => {
12298
+ if (element && !(popup === null || popup === void 0 ? void 0 : popup.id)) {
12299
+ element === null || element === void 0 ? void 0 : element.focus();
12300
+ setElement(null);
12301
+ }
12302
+ }, [element, popup]);
12303
+ return (React.createElement("button", { ref: ref, className: className, style: Object.assign({ display: 'flex', alignItems: 'normal' }, style), onClick: handleClick, role: 'button', "aria-label": 'CTA', tabIndex: 0 }, children));
11512
12304
  };
11513
12305
  var EventProvider$1 = React.memo(EventProvider);
11514
12306
 
11515
12307
  var styles$8 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
11516
12308
 
11517
12309
  const Commodity$1 = (_a) => {
11518
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
12310
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
11519
12311
  var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index", "isActive"]);
11520
12312
  const { sxpParameter } = useSxpDataSource();
11521
12313
  const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
11522
12314
  const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
11523
- return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
12315
+ return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, style: style, index: index }, props),
11524
12316
  React.createElement(Img$1, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
11525
12317
  React.createElement("div", { className: css.css({
11526
12318
  color: '#fff',
@@ -11533,8 +12325,8 @@ Made in Italy` })));
11533
12325
  React.createElement("div", { className: styles$8['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
11534
12326
  __html: setFontForText((_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
11535
12327
  } }),
11536
- React.createElement("div", { className: css.css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', lineHeight: ((_k = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _k === void 0 ? void 0 : _k.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
11537
- __html: setFontForText((_m = (_l = product === null || product === void 0 ? void 0 : product.bindCta) === null || _l === void 0 ? void 0 : _l.enTitle) !== null && _m !== void 0 ? _m : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
12328
+ React.createElement("button", { "aria-label": (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', className: css.css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', lineHeight: ((_m = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _m === void 0 ? void 0 : _m.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
12329
+ __html: setFontForText((_p = (_o = product === null || product === void 0 ? void 0 : product.bindCta) === null || _o === void 0 ? void 0 : _o.enTitle) !== null && _p !== void 0 ? _p : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
11538
12330
  } }))));
11539
12331
  };
11540
12332
  var CommodityComponent = React.memo(Commodity$1);
@@ -11614,7 +12406,7 @@ Made in Italy` })));
11614
12406
  const { sxpParameter } = useSxpDataSource();
11615
12407
  const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
11616
12408
  const src = (_d = (_c = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image;
11617
- return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' }, index: index }, props),
12409
+ return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, style: Object.assign({ alignItems: 'center' }, style), index: index }, props),
11618
12410
  React.createElement(Img$1, { src: src, rec: recData, item: (_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.bindProduct) !== null && _f !== void 0 ? _f : recData === null || recData === void 0 ? void 0 : recData.video, index: index, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
11619
12411
  React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
11620
12412
  __html: setFontForText((_g = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _g !== void 0 ? _g : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
@@ -11798,7 +12590,7 @@ Made in Italy` })));
11798
12590
  const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
11799
12591
  (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
11800
12592
  const src = (_e = (_d = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
11801
- return (React.createElement(EventProvider$1, Object.assign({ index: index, rec: recData, className: css.css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { jumpLink: (_f = cta === null || cta === void 0 ? void 0 : cta.link) !== null && _f !== void 0 ? _f : '' }),
12593
+ return (React.createElement(EventProvider$1, Object.assign({ index: index, rec: recData, style: Object.assign({ alignItems: 'center' }, style) }, props, { jumpLink: (_f = cta === null || cta === void 0 ? void 0 : cta.link) !== null && _f !== void 0 ? _f : '' }),
11802
12594
  React.createElement(Img$1, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
11803
12595
  React.createElement("div", { className: css.css({
11804
12596
  display: 'flex',
@@ -11908,12 +12700,12 @@ Made in Italy` })));
11908
12700
  var styles$6 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__yyHVb"};
11909
12701
 
11910
12702
  const CommodityDiro$1 = (_a) => {
11911
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
12703
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
11912
12704
  var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index", "isActive"]);
11913
12705
  const { sxpParameter } = useSxpDataSource();
11914
12706
  const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
11915
12707
  const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
11916
- return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
12708
+ return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, style: style, index: index }, props),
11917
12709
  React.createElement(Img$1, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
11918
12710
  React.createElement("div", { className: css.css({
11919
12711
  color: '#fff',
@@ -11926,8 +12718,8 @@ Made in Italy` })));
11926
12718
  React.createElement("div", { className: styles$6['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
11927
12719
  __html: setFontForText((_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
11928
12720
  } }),
11929
- React.createElement("div", { className: css.css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap', lineHeight: ((_k = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _k === void 0 ? void 0 : _k.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
11930
- __html: setFontForText((_m = (_l = product === null || product === void 0 ? void 0 : product.bindCta) === null || _l === void 0 ? void 0 : _l.enTitle) !== null && _m !== void 0 ? _m : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
12721
+ React.createElement("button", { "aria-label": (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', className: css.css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap', lineHeight: ((_m = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _m === void 0 ? void 0 : _m.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
12722
+ __html: setFontForText((_p = (_o = product === null || product === void 0 ? void 0 : product.bindCta) === null || _o === void 0 ? void 0 : _o.enTitle) !== null && _p !== void 0 ? _p : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
11931
12723
  } }))));
11932
12724
  };
11933
12725
  var CommodityDiroComponent = React.memo(CommodityDiro$1);
@@ -12004,12 +12796,12 @@ Made in Italy` })));
12004
12796
  var styles$5 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__I-yCC"};
12005
12797
 
12006
12798
  const CommodityDiroNew$1 = (_a) => {
12007
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
12799
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
12008
12800
  var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index", "isActive"]);
12009
12801
  const { sxpParameter } = useSxpDataSource();
12010
12802
  const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
12011
12803
  const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
12012
- return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
12804
+ return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, style: style, index: index }, props),
12013
12805
  React.createElement(Img$1, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
12014
12806
  React.createElement("div", { className: css.css({
12015
12807
  color: '#fff',
@@ -12022,8 +12814,8 @@ Made in Italy` })));
12022
12814
  React.createElement("div", { className: styles$5['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
12023
12815
  __html: setFontForText((_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
12024
12816
  } }),
12025
- React.createElement("div", { className: css.css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
12026
- __html: setFontForText((_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
12817
+ React.createElement("button", { "aria-label": (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', className: css.css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
12818
+ __html: setFontForText((_o = (_m = product === null || product === void 0 ? void 0 : product.bindCta) === null || _m === void 0 ? void 0 : _m.enTitle) !== null && _o !== void 0 ? _o : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
12027
12819
  } }))));
12028
12820
  };
12029
12821
  var CommodityDiroNewComponent = React.memo(CommodityDiroNew$1);
@@ -12102,45 +12894,28 @@ Made in Italy` })));
12102
12894
 
12103
12895
  const MultiCommodityDiro$1 = (_a) => {
12104
12896
  var _b, _c;
12105
- var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY", "isActive"]);
12106
- const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
12107
- const { popup } = useEditor();
12108
- const { jumpToWeb } = useEventReport();
12109
- const [products, setProducts] = React.useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
12110
- const handleClick = lodash.throttle((item, multiCheckIndex) => {
12111
- ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
12112
- eventSubject: 'clickCta',
12113
- eventDescription: 'User clicked the CTA'
12114
- }, recData, item, index);
12115
- setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index, multiCheckIndex }));
12116
- if (isExternalLink) {
12117
- if (item === null || item === void 0 ? void 0 : item.link) {
12118
- jumpToWeb(recData, item, item.bindCta, index);
12119
- window.location.href = window.getJointUtmLink(item.link);
12120
- }
12121
- }
12122
- else {
12123
- onClick === null || onClick === void 0 ? void 0 : onClick();
12124
- }
12125
- }, popup === null || popup === void 0 ? void 0 : popup.duration);
12126
- return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
12127
- var _a, _b, _c, _d, _e, _f, _g, _h;
12128
- return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
12129
- React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
12130
- React.createElement("div", { className: css.css({
12131
- color: '#000',
12132
- display: 'flex',
12133
- flexDirection: 'column',
12134
- justifyContent: 'space-between',
12135
- width: '100%',
12136
- overflow: 'hidden'
12137
- }) },
12138
- React.createElement("div", { className: styles$4['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
12139
- __html: setFontForText((_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
12140
- } }),
12141
- React.createElement("div", { className: css.css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap', lineHeight: ((_f = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _f === void 0 ? void 0 : _f.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
12142
- __html: setFontForText((_h = (_g = item === null || item === void 0 ? void 0 : item.bindCta) === null || _g === void 0 ? void 0 : _g.enTitle) !== null && _h !== void 0 ? _h : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
12143
- } }))))));
12897
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive"]);
12898
+ const { sxpParameter } = useSxpDataSource();
12899
+ const [products] = React.useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
12900
+ return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
12901
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
12902
+ return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css.css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
12903
+ React.createElement(EventProvider$1, Object.assign({ rec: recData, multiCheckIndex: itemIndex }, props),
12904
+ React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: itemIndex, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
12905
+ React.createElement("div", { className: css.css({
12906
+ color: '#000',
12907
+ display: 'flex',
12908
+ flexDirection: 'column',
12909
+ justifyContent: 'space-between',
12910
+ width: '100%',
12911
+ overflow: 'hidden'
12912
+ }) },
12913
+ React.createElement("div", { className: styles$4['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
12914
+ __html: setFontForText((_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
12915
+ } }),
12916
+ React.createElement("button", { "aria-label": (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now', className: css.css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap', lineHeight: ((_h = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _h === void 0 ? void 0 : _h.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
12917
+ __html: setFontForText((_k = (_j = item === null || item === void 0 ? void 0 : item.bindCta) === null || _j === void 0 ? void 0 : _j.enTitle) !== null && _k !== void 0 ? _k : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
12918
+ } })))))));
12144
12919
  })));
12145
12920
  };
12146
12921
  var MultiCommodityDiroComponent = React.memo(MultiCommodityDiro$1);
@@ -12218,46 +12993,28 @@ Made in Italy` })));
12218
12993
 
12219
12994
  const MultiCommodity$1 = (_a) => {
12220
12995
  var _b, _c;
12221
- var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY", "isActive"]);
12996
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive"]);
12222
12997
  const { sxpParameter } = useSxpDataSource();
12223
- const { ctaEvent, setPopupDetailData } = useSxpDataSource();
12224
- const { popup } = useEditor();
12225
- const [products, setProducts] = React.useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
12226
- const { jumpToWeb } = useEventReport();
12227
- const handleClick = lodash.throttle((item, multiCheckIndex) => {
12228
- ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
12229
- eventSubject: 'clickCta',
12230
- eventDescription: 'User clicked the CTA'
12231
- }, recData, item, index);
12232
- setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index, multiCheckIndex }));
12233
- if (isExternalLink) {
12234
- if (item === null || item === void 0 ? void 0 : item.link) {
12235
- jumpToWeb(recData, item, item.bindCta, index);
12236
- window.location.href = window.getJointUtmLink(item.link);
12237
- }
12238
- }
12239
- else {
12240
- onClick === null || onClick === void 0 ? void 0 : onClick();
12241
- }
12242
- }, popup === null || popup === void 0 ? void 0 : popup.duration);
12243
- return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
12244
- var _a, _b, _c, _d, _e, _f, _g, _h;
12245
- return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
12246
- React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
12247
- React.createElement("div", { className: css.css({
12248
- color: '#fff',
12249
- display: 'flex',
12250
- flexDirection: 'column',
12251
- justifyContent: 'space-between',
12252
- width: '100%',
12253
- overflow: 'hidden'
12254
- }) },
12255
- React.createElement("div", { className: styles$3['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
12256
- __html: setFontForText((_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
12257
- } }),
12258
- React.createElement("div", { className: css.css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', lineHeight: ((_f = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _f === void 0 ? void 0 : _f.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
12259
- __html: setFontForText((_h = (_g = item === null || item === void 0 ? void 0 : item.bindCta) === null || _g === void 0 ? void 0 : _g.enTitle) !== null && _h !== void 0 ? _h : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
12260
- } }))))));
12998
+ const [products] = React.useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
12999
+ return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
13000
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
13001
+ return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css.css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
13002
+ React.createElement(EventProvider$1, Object.assign({ rec: recData, multiCheckIndex: itemIndex }, props),
13003
+ React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: itemIndex, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
13004
+ React.createElement("div", { className: css.css({
13005
+ color: '#fff',
13006
+ display: 'flex',
13007
+ flexDirection: 'column',
13008
+ justifyContent: 'space-between',
13009
+ width: '100%',
13010
+ overflow: 'hidden'
13011
+ }) },
13012
+ React.createElement("div", { className: styles$3['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
13013
+ __html: setFontForText((_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
13014
+ } }),
13015
+ React.createElement("button", { "aria-label": (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now', className: css.css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', lineHeight: ((_h = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _h === void 0 ? void 0 : _h.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
13016
+ __html: setFontForText((_k = (_j = item === null || item === void 0 ? void 0 : item.bindCta) === null || _j === void 0 ? void 0 : _j.enTitle) !== null && _k !== void 0 ? _k : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
13017
+ } })))))));
12261
13018
  })));
12262
13019
  };
12263
13020
  var MultiCommodityComponent = React.memo(MultiCommodity$1);
@@ -12343,47 +13100,29 @@ Made in Italy` })));
12343
13100
 
12344
13101
  const MultiCommodityDiroNew$1 = (_a) => {
12345
13102
  var _b, _c;
12346
- var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY", "isActive"]);
12347
- const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
12348
- const { popup } = useEditor();
12349
- const { jumpToWeb } = useEventReport();
12350
- const [products, setProducts] = React.useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
12351
- const handleClick = lodash.throttle((item, multiCheckIndex) => {
12352
- ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
12353
- eventSubject: 'clickCta',
12354
- eventDescription: 'User clicked the CTA'
12355
- }, recData, item, index);
12356
- setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index,
12357
- multiCheckIndex }));
12358
- if (isExternalLink) {
12359
- if (item === null || item === void 0 ? void 0 : item.link) {
12360
- jumpToWeb(recData, item, item.bindCta, index);
12361
- window.location.href = window.getJointUtmLink(item.link);
12362
- }
12363
- }
12364
- else {
12365
- onClick === null || onClick === void 0 ? void 0 : onClick();
12366
- }
12367
- }, popup === null || popup === void 0 ? void 0 : popup.duration);
12368
- return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
12369
- var _a, _b, _c, _d, _e, _f, _g;
12370
- return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
12371
- React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
12372
- React.createElement("div", { className: css.css({
12373
- color: '#fff',
12374
- display: 'flex',
12375
- flexDirection: 'column',
12376
- justifyContent: 'center',
12377
- width: '100%',
12378
- overflow: 'hidden',
12379
- lineHeight: '20px'
12380
- }) },
12381
- React.createElement("div", { className: styles$2['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
12382
- __html: setFontForText((_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
12383
- } }),
12384
- React.createElement("div", { className: css.css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
12385
- __html: setFontForText((_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
12386
- } }))))));
13103
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive"]);
13104
+ const { sxpParameter } = useSxpDataSource();
13105
+ const [products] = React.useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
13106
+ return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
13107
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
13108
+ return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css.css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
13109
+ React.createElement(EventProvider$1, Object.assign({ rec: recData, multiCheckIndex: itemIndex }, props),
13110
+ React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: itemIndex, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
13111
+ React.createElement("div", { className: css.css({
13112
+ color: '#fff',
13113
+ display: 'flex',
13114
+ flexDirection: 'column',
13115
+ justifyContent: 'center',
13116
+ width: '100%',
13117
+ overflow: 'hidden',
13118
+ lineHeight: '20px'
13119
+ }) },
13120
+ React.createElement("div", { className: styles$2['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
13121
+ __html: setFontForText((_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
13122
+ } }),
13123
+ React.createElement("button", { "aria-label": (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now', className: css.css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
13124
+ __html: setFontForText((_j = (_h = item === null || item === void 0 ? void 0 : item.bindCta) === null || _h === void 0 ? void 0 : _h.enTitle) !== null && _j !== void 0 ? _j : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
13125
+ } })))))));
12387
13126
  })));
12388
13127
  };
12389
13128
  var MultiCommodityDiroNewComponent = React.memo(MultiCommodityDiroNew$1);
@@ -15396,7 +16135,7 @@ Made in Italy` })));
15396
16135
 
15397
16136
  const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
15398
16137
  const AniLinkPopup$1 = (_a) => {
15399
- 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;
16138
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
15400
16139
  var { style, recData, ctaTempStyles, index, event, bottom_image, translateY, isTel, onClick, isExternalLink = false, isActive } = _a, props = __rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "bottom_image", "translateY", "isTel", "onClick", "isExternalLink", "isActive"]);
15401
16140
  style === null || style === void 0 ? true : delete style.transform;
15402
16141
  const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
@@ -15453,12 +16192,12 @@ Made in Italy` })));
15453
16192
  paddingLeft: '6px'
15454
16193
  } }, "Cta Title")) : (React.createElement("div", Object.assign({}, props, { className: `${css.css(Object.assign(Object.assign({}, style), { '--transY': `translateY(calc(100% + ${(_r = style === null || style === void 0 ? void 0 : style.margin) !== null && _r !== void 0 ? _r : 0}px))` }))} ${styles['aniLinkPopup']} ${aniNamStyle} ${css.css(aniTimStyle)}`, onClick: handleTo }),
15455
16194
  React.createElement("div", { onClick: onClose, className: styles['modal-icon-wrapper'], style: { padding: (_s = style === null || style === void 0 ? void 0 : style['padding']) !== null && _s !== void 0 ? _s : 0 } },
15456
- React.createElement("img", { src: (_t = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _t !== void 0 ? _t : closeIcon, alt: 'close', className: styles['modal-icon-wrapper-img'] })),
15457
- React.createElement(Img$1, { src: src, rec: recData, item: (_y = (_w = (_v = (_u = recData === null || recData === void 0 ? void 0 : recData.video) === null || _u === void 0 ? void 0 : _u.bindProducts) === null || _v === void 0 ? void 0 : _v[0]) !== null && _w !== void 0 ? _w : (_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.bindProduct) !== null && _y !== void 0 ? _y : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
16195
+ React.createElement("img", { src: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon, alt: 'close', className: styles['modal-icon-wrapper-img'] })),
16196
+ React.createElement(Img$1, { src: src, rec: recData, item: (_x = (_v = (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.bindProducts) === null || _u === void 0 ? void 0 : _u[0]) !== null && _v !== void 0 ? _v : (_w = recData === null || recData === void 0 ? void 0 : recData.video) === null || _w === void 0 ? void 0 : _w.bindProduct) !== null && _x !== void 0 ? _x : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
15458
16197
  (!recData || (product === null || product === void 0 ? void 0 : product.title)) && (React.createElement("div", { className: styles['one-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
15459
- __html: setFontForText((_z = product === null || product === void 0 ? void 0 : product.title) !== null && _z !== void 0 ? _z : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
16198
+ __html: setFontForText((_y = product === null || product === void 0 ? void 0 : product.title) !== null && _y !== void 0 ? _y : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
15460
16199
  } })),
15461
- React.createElement("div", { className: styles['one-line-ellipsis'], style: Object.assign(Object.assign({}, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle), { lineHeight: ((_0 = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _0 === void 0 ? void 0 : _0.height) + 'px' }), dangerouslySetInnerHTML: {
16200
+ React.createElement("div", { className: styles['one-line-ellipsis'], style: Object.assign(Object.assign({}, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle), { lineHeight: ((_z = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _z === void 0 ? void 0 : _z.height) + 'px' }), dangerouslySetInnerHTML: {
15462
16201
  __html: setFontForText(title, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
15463
16202
  } })))));
15464
16203
  };
@@ -16470,15 +17209,16 @@ Made in Italy` })));
16470
17209
 
16471
17210
  const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
16472
17211
  var _a, _b;
16473
- const ref = React.useRef();
17212
+ const swiperRef = React.useRef();
16474
17213
  const { isActive } = useSwiperSlide();
16475
17214
  const { sxpParameter, openHashtag } = useSxpDataSource();
16476
17215
  const [isLoad, setIsLoad] = React.useState(false);
16477
17216
  const [imgInfo, setImgInfo] = React.useState();
16478
17217
  const initTime = new Date();
17218
+ const [swiperActiveIndex, setSwiperActiveIndex] = React.useState(0);
16479
17219
  React.useEffect(() => {
16480
17220
  if (isLoad && isActive) {
16481
- (ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.start();
17221
+ (swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.start();
16482
17222
  if (openHashtag) {
16483
17223
  onViewImageEndEvent(rec);
16484
17224
  }
@@ -16487,7 +17227,7 @@ Made in Italy` })));
16487
17227
  }
16488
17228
  }
16489
17229
  else {
16490
- (ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.stop();
17230
+ (swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.stop();
16491
17231
  }
16492
17232
  }, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
16493
17233
  const showFirstImageFn = React.useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
@@ -16511,27 +17251,51 @@ Made in Italy` })));
16511
17251
  SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
16512
17252
  };
16513
17253
  }, [imgInfo]);
16514
- return (React.createElement(Swiper, { ref: ref, defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
16515
- clickable: true,
16516
- bulletActiveClass: 'swipe-item-active-bullet',
16517
- bulletElement: 'button'
16518
- }, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
16519
- bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
16520
- fontSize: '14px'
16521
- } }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
16522
- '.swiper-pagination-bullet': {
16523
- backgroundColor: imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor,
16524
- opacity: 1
16525
- }
16526
- })), ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsActiveColor) && {
16527
- '.swipe-item-active-bullet': {
16528
- backgroundColor: `${imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsActiveColor}!important`,
16529
- opacity: 1
17254
+ const handleMouseEnter = React.useCallback(() => {
17255
+ if (swiperRef.current && swiperRef.current.swiper && isAlly) {
17256
+ swiperRef.current.swiper.autoplay.stop();
17257
+ }
17258
+ }, []);
17259
+ const handleMouseLeave = React.useCallback(() => {
17260
+ if (swiperRef.current && swiperRef.current.swiper && isAlly) {
17261
+ swiperRef.current.swiper.autoplay.start();
17262
+ }
17263
+ }, []);
17264
+ const handleSlideChange = React.useCallback((swiper) => {
17265
+ setSwiperActiveIndex(swiper.activeIndex);
17266
+ }, []);
17267
+ const isAlly = React.useMemo(() => getScreenReader(), []);
17268
+ return (React.createElement("div", { onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
17269
+ React.createElement(Swiper, Object.assign({ defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay, ...(isAlly ? [Navigation, A11y, Mousewheel, Keyboard] : [])], pagination: {
17270
+ clickable: true,
17271
+ bulletActiveClass: 'swipe-item-active-bullet',
17272
+ bulletElement: 'button'
17273
+ } }, (isAlly
17274
+ ? {
17275
+ mousewheel: true,
17276
+ keyboard: true,
17277
+ navigation: true,
17278
+ a11y: {
17279
+ enabled: true
17280
+ }
16530
17281
  }
16531
- }))), height: height, loop: true, autoplay: { delay: ((_b = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.delay) !== null && _b !== void 0 ? _b : 3) * 1000 } }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url, index) => {
16532
- return (React.createElement(SwiperSlide, { key: index },
16533
- React.createElement(Picture, { src: !isLoad && index > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
16534
- })));
17282
+ : {}), { loop: true, ref: swiperRef, onSlideChange: handleSlideChange, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
17283
+ bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
17284
+ fontSize: '14px'
17285
+ } }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
17286
+ '.swiper-pagination-bullet': {
17287
+ backgroundColor: imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor,
17288
+ opacity: 1
17289
+ }
17290
+ })), ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsActiveColor) && {
17291
+ '.swipe-item-active-bullet': {
17292
+ backgroundColor: `${imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsActiveColor}!important`,
17293
+ opacity: 1
17294
+ }
17295
+ }))), height: height, autoplay: { delay: ((_b = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.delay) !== null && _b !== void 0 ? _b : 3) * 1000 } }), imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url, srcKey) => {
17296
+ return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
17297
+ React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
17298
+ }))));
16535
17299
  };
16536
17300
  var PictureGroup$3 = React.memo(PictureGroup$2);
16537
17301
 
@@ -16539,7 +17303,7 @@ Made in Italy` })));
16539
17303
  * @Author: binruan@chatlabs.com
16540
17304
  * @Date: 2024-01-15 19:03:09
16541
17305
  * @LastEditors: binruan@chatlabs.com
16542
- * @LastEditTime: 2024-10-17 18:02:31
17306
+ * @LastEditTime: 2024-11-19 10:40:36
16543
17307
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Hashtag\index.tsx
16544
17308
  *
16545
17309
  */
@@ -16580,8 +17344,8 @@ Made in Italy` })));
16580
17344
  marginTop: `${(_a = hashTagStyle === null || hashTagStyle === void 0 ? void 0 : hashTagStyle.marginTop) !== null && _a !== void 0 ? _a : 16}px`,
16581
17345
  width: hashTagRightMargin
16582
17346
  } },
16583
- React.createElement(Scroll$1, null, tags === null || tags === void 0 ? void 0 : tags.map((item, index) => (React.createElement(SwiperSlide, { key: index, hidden: !isShowMore ? index >= 6 : false, className: 'clc-sxp-bottom-hashtag-item', style: hashTagStyle, onClick: () => handleClickTag(item), tag: 'button', "aria-label": item },
16584
- React.createElement("div", { dangerouslySetInnerHTML: { __html: setFontForText(`#${item}`, hashTagStyle) } })))))));
17347
+ React.createElement(Scroll$1, null, tags === null || tags === void 0 ? void 0 : tags.map((item, index) => (React.createElement(SwiperSlide, { key: index, hidden: !isShowMore ? index >= 6 : false, className: 'clc-sxp-bottom-hashtag-item', style: hashTagStyle, onClick: () => handleClickTag(item), tag: 'li', role: 'listitem' },
17348
+ React.createElement("button", { className: 'clc-sxp-bottom-hashtag-item-button', "aria-label": item, "aria-describedby": item, dangerouslySetInnerHTML: { __html: setFontForText(`#${item}`, hashTagStyle) } })))))));
16585
17349
  };
16586
17350
  var Hashtag$1 = React.memo(Hashtag);
16587
17351
 
@@ -16797,7 +17561,7 @@ Made in Italy` })));
16797
17561
  * @Author: binruan@chatlabs.com
16798
17562
  * @Date: 2024-03-20 10:27:31
16799
17563
  * @LastEditors: binruan@chatlabs.com
16800
- * @LastEditTime: 2024-11-05 18:13:15
17564
+ * @LastEditTime: 2024-11-19 09:47:45
16801
17565
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
16802
17566
  *
16803
17567
  */
@@ -17285,9 +18049,9 @@ Made in Italy` })));
17285
18049
  alignItems: 'center'
17286
18050
  } },
17287
18051
  React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement(React.Fragment, null,
18052
+ renderBottom(rec, index),
17288
18053
  renderLikeButton(rec, index, !(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
17289
18054
  renderToggleButton(!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
17290
- renderBottom(rec, index),
17291
18055
  renderContent(rec, index)))))));
17292
18056
  });
17293
18057
  }, [
@@ -17354,9 +18118,9 @@ Made in Italy` })));
17354
18118
  }
17355
18119
  }
17356
18120
  }, direction: 'vertical', height: height },
18121
+ renderView,
17357
18122
  renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
17358
- renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
17359
- renderView),
18123
+ renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
17360
18124
  React.createElement(WaterFall$1, Object.assign({}, (_w = (_v = (_u = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _u === void 0 ? void 0 : _u[0]) === null || _v === void 0 ? void 0 : _v.item) === null || _w === void 0 ? void 0 : _w.props)),
17361
18125
  React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig })));
17362
18126
  };