pb-sxp-ui 1.20.25 → 1.20.27

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 (42) hide show
  1. package/dist/index.cjs +2164 -2248
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +355 -291
  4. package/dist/index.js +2164 -2248
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +6 -6
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +6 -6
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +2164 -2248
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +6 -6
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/StructurePage/index.d.ts +4 -0
  15. package/es/core/components/StructurePage/index.js +14 -23
  16. package/es/core/components/SxpPageRender/Modal/index.d.ts +1 -0
  17. package/es/core/components/SxpPageRender/Modal/index.js +3 -3
  18. package/es/core/components/SxpPageRender/index.d.ts +1 -0
  19. package/es/core/components/SxpPageRender/typing.d.ts +1 -0
  20. package/es/materials/sxp/popup/AddToCart/index.d.ts +1 -27
  21. package/es/materials/sxp/popup/AddToCart/index.js +117 -173
  22. package/es/materials/sxp/popup/AddToCart/index.new.d.ts +8 -0
  23. package/es/materials/sxp/popup/AddToCart/index.new.js +174 -0
  24. package/es/materials/sxp/popup/AddToCart/index.old.d.ts +33 -0
  25. package/es/materials/sxp/popup/AddToCart/index.old.js +299 -0
  26. package/es/materials/sxp/popup/AddToCart/material.js +1 -54
  27. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +48 -53
  28. package/lib/core/components/StructurePage/index.d.ts +4 -0
  29. package/lib/core/components/StructurePage/index.js +14 -23
  30. package/lib/core/components/SxpPageRender/Modal/index.d.ts +1 -0
  31. package/lib/core/components/SxpPageRender/Modal/index.js +3 -3
  32. package/lib/core/components/SxpPageRender/index.d.ts +1 -0
  33. package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
  34. package/lib/materials/sxp/popup/AddToCart/index.d.ts +1 -27
  35. package/lib/materials/sxp/popup/AddToCart/index.js +115 -171
  36. package/lib/materials/sxp/popup/AddToCart/index.new.d.ts +8 -0
  37. package/lib/materials/sxp/popup/AddToCart/index.new.js +176 -0
  38. package/lib/materials/sxp/popup/AddToCart/index.old.d.ts +33 -0
  39. package/lib/materials/sxp/popup/AddToCart/index.old.js +301 -0
  40. package/lib/materials/sxp/popup/AddToCart/material.js +1 -54
  41. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +48 -53
  42. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
1
  import { __rest } from "tslib";
2
2
  import { css } from '@emotion/css';
3
3
  import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
4
- import CommodityGroup from '../../template/components/CommodityGroup';
5
- import { useSxpDataSource } from '../../../../core/hooks';
6
- import './index.less';
7
4
  import { Autoplay, Pagination, Navigation, A11y, Mousewheel, Keyboard } from 'swiper/modules';
8
5
  import { Swiper, SwiperSlide } from 'swiper/react';
6
+ import CommodityGroup from '../../template/components/CommodityGroup';
7
+ import AddToCartPopup from '../AddToCart';
8
+ import { useSxpDataSource, useEditor } from '../../../../core/hooks';
9
9
  import Modal from '../../../../core/components/SxpPageRender/Modal';
10
10
  import ExpandableText from '../../../../core/components/SxpPageRender/ExpandableText';
11
11
  import { useEventReport } from '../../../../core/hooks/useEventReport';
@@ -13,18 +13,17 @@ import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
13
13
  import { getScreenReader, setFontForText } from '../../../../core/utils/tool';
14
14
  import { getPriceText } from '../../../../core/utils/materials';
15
15
  import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../../core/utils/event';
16
+ import './index.less';
16
17
  const CommodityDetailDiroNew = (_a) => {
17
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
18
- var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive"]);
19
- const [spread, setSpread] = useState(true);
20
- const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig, ctaEvent } = useSxpDataSource();
21
- const { jumpToWeb, productView } = useEventReport();
22
- const [stopSlide, setStopSlide] = useState(false);
23
- const [isBottom, setIsBottom] = useState(false);
24
- const [isTop, setIsTop] = useState(true);
18
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
19
+ var { style, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, iframeBgColor, isActive = true } = _a, props = __rest(_a, ["style", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "iframeBgColor", "isActive"]);
20
+ const { sxpParameter, popupCurTimeRef, popupDetailData, setPopupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig, ctaEvent } = useSxpDataSource();
21
+ useEditor();
22
+ const { productView } = useEventReport();
25
23
  const [showModal, setShowModal] = useState(false);
26
24
  const curTimeRef = useRef(null);
27
25
  const [show3DModal, setShow3DModal] = useState(false);
26
+ const [showAddToCart, setShowAddToCart] = useState(false);
28
27
  const [checkCommodityIndex, setCheckCommodityIndex] = useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
29
28
  const swiperRef = useRef();
30
29
  const [swiperActiveIndex, setSwiperActiveIndex] = useState(0);
@@ -41,30 +40,27 @@ const CommodityDetailDiroNew = (_a) => {
41
40
  cta = p === null || p === void 0 ? void 0 : p.bindCta;
42
41
  }
43
42
  const handleLink = (e) => {
44
- if (product === null || product === void 0 ? void 0 : product.link) {
45
- jumpToWeb(e, data, product, cta, position);
46
- if (!isPost) {
47
- productView(data, product, cta, viewTime || curTimeRef.current, position);
48
- }
49
- else {
50
- ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
51
- eventSubject: 'clickCta',
52
- eventDescription: 'User clicked the CTA'
53
- }, data, product, position);
54
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
55
- eventName: 'ClickCTA',
56
- product: product ? [product] : undefined,
57
- contentType: 'product',
58
- data,
59
- position,
60
- cta_text: cta === null || cta === void 0 ? void 0 : cta.enTitle,
61
- cta_action_type: 'open_external_link',
62
- target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
63
- target_url: product.link
64
- });
65
- }
66
- window.location.href = window.getJointUtmLink(product.link);
43
+ e.preventDefault();
44
+ ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
45
+ eventSubject: 'clickCta',
46
+ eventDescription: 'User clicked the CTA'
47
+ }, data, product, position);
48
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
49
+ eventName: 'ClickCTA',
50
+ product: product ? [product] : undefined,
51
+ contentType: 'product',
52
+ data,
53
+ position,
54
+ cta_text: cta === null || cta === void 0 ? void 0 : cta.enTitle,
55
+ cta_action_type: 'open_internal_popup',
56
+ target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
57
+ target_url: product === null || product === void 0 ? void 0 : product.link
58
+ });
59
+ if (!isPost) {
60
+ productView(data, product, cta, viewTime || curTimeRef.current, position);
67
61
  }
62
+ setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, data), { video: Object.assign(Object.assign({}, data === null || data === void 0 ? void 0 : data.video), { bindProduct: product }), index: position }));
63
+ setShowAddToCart(true);
68
64
  };
69
65
  useEffect(() => {
70
66
  var _a, _b;
@@ -85,7 +81,7 @@ const CommodityDetailDiroNew = (_a) => {
85
81
  rec: recData,
86
82
  position
87
83
  });
88
- }, [isActive, bffFbReport, isPost]);
84
+ }, [isActive, bffFbReport, isPost, data, product, position]);
89
85
  useEffect(() => {
90
86
  if (!isActive || isPost)
91
87
  return;
@@ -143,9 +139,6 @@ const CommodityDetailDiroNew = (_a) => {
143
139
  });
144
140
  const width = (isPreview ? 375 : (_u = style === null || style === void 0 ? void 0 : style.width) !== null && _u !== void 0 ? _u : window.innerWidth) - ((_v = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _v !== void 0 ? _v : 0) * 2;
145
141
  const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
146
- const handleClickCollapse = () => {
147
- setSpread(!spread);
148
- };
149
142
  const productInfoText = ({ isPost }) => {
150
143
  return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
151
144
  React.createElement(ExpandableText, { isPost: isPost, onClick: () => setShowModal(true), className: 'pb-commondityDiroNew-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (product === null || product === void 0 ? void 0 : product.info) ||
@@ -166,13 +159,13 @@ Made in Italy` })));
166
159
  swiperRef.current.swiper.slideTo(0);
167
160
  swiperRef.current.swiper.autoplay.start();
168
161
  }
169
- }, []);
162
+ }, [popupCurTimeRef, checkCommodityIndexRef]);
170
163
  const renderCommodityGroup = useCallback(() => {
171
164
  var _a, _b, _c;
172
165
  if (isPost)
173
166
  return;
174
167
  return (React.createElement(CommodityGroup, { products: (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts, data: commodityGroup, defImg: (_c = (_b = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _b !== void 0 ? _b : bottom_image) !== null && _c !== void 0 ? _c : '', style: { padding: '0 19px' }, onCLick: handleClick, popupDetailData: popupDetailData, check: checkCommodityIndex }));
175
- }, [checkCommodityIndex]);
168
+ }, [checkCommodityIndex, isPost, (_w = data === null || data === void 0 ? void 0 : data.video) === null || _w === void 0 ? void 0 : _w.bindProducts, commodityGroup, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image, bottom_image, handleClick, popupDetailData]);
176
169
  const getDotsAlign = useMemo(() => {
177
170
  const dotsAlignClass = {
178
171
  left: 'commondityDetail-swiper-clickable-left',
@@ -182,24 +175,24 @@ Made in Italy` })));
182
175
  return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
183
176
  }, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
184
177
  const iframeUrl = product === null || product === void 0 ? void 0 : product.remark;
178
+ const isAlly = useMemo(() => getScreenReader(), []);
185
179
  const handleMouseEnter = useCallback(() => {
186
180
  if (swiperRef.current && swiperRef.current.swiper && isAlly) {
187
181
  swiperRef.current.swiper.autoplay.stop();
188
182
  }
189
- }, []);
183
+ }, [isAlly]);
190
184
  const handleMouseLeave = useCallback(() => {
191
185
  if (swiperRef.current && swiperRef.current.swiper && isAlly) {
192
186
  swiperRef.current.swiper.autoplay.start();
193
187
  }
194
- }, []);
188
+ }, [isAlly]);
195
189
  const handleSlideChange = useCallback((swiper) => {
196
190
  setSwiperActiveIndex(swiper.activeIndex);
197
191
  }, []);
198
- const isAlly = useMemo(() => getScreenReader(), []);
199
192
  return (React.createElement("div", { className: 'pb-commondityDiroNew' },
200
193
  React.createElement("div", Object.assign({ className: css(Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' })) }, props),
201
194
  React.createElement("div", { style: { position: 'relative' }, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
202
- 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: {
195
+ product && ((_x = product === null || product === void 0 ? void 0 : product.homePage) === null || _x === void 0 ? void 0 : _x.length) > 0 && (React.createElement(Swiper, Object.assign({ height: height, modules: [Pagination, Autoplay, ...(isAlly ? [Navigation, A11y, Mousewheel, Keyboard] : [])], pagination: {
203
196
  clickable: true,
204
197
  bulletActiveClass: 'swipe-item-active-bullet',
205
198
  clickableClass: getDotsAlign,
@@ -216,7 +209,7 @@ Made in Italy` })));
216
209
  : {}), { loop: true, ref: swiperRef, onSlideChange: handleSlideChange, autoplay: {
217
210
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
218
211
  }, className: css(Object.assign(Object.assign({ '.swiper-pagination': {
219
- bottom: (_x = swiper === null || swiper === void 0 ? void 0 : swiper.dotsMarginBottom) !== null && _x !== void 0 ? _x : 0,
212
+ bottom: (_y = swiper === null || swiper === void 0 ? void 0 : swiper.dotsMarginBottom) !== null && _y !== void 0 ? _y : 0,
220
213
  fontSize: '14px'
221
214
  } }, ((swiper === null || swiper === void 0 ? void 0 : swiper.dotsBgColor) && {
222
215
  '.swiper-pagination-bullet': {
@@ -228,7 +221,7 @@ Made in Italy` })));
228
221
  backgroundColor: `${swiper === null || swiper === void 0 ? void 0 : swiper.dotsActiveColor}!important`,
229
222
  opacity: 1
230
223
  }
231
- }))) }), (_y = product === null || product === void 0 ? void 0 : product.homePage) === null || _y === void 0 ? void 0 : _y.map((src, srcKey) => {
224
+ }))) }), (_z = product === null || product === void 0 ? void 0 : product.homePage) === null || _z === void 0 ? void 0 : _z.map((src, srcKey) => {
232
225
  var _a;
233
226
  return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
234
227
  React.createElement("div", { style: {
@@ -244,7 +237,7 @@ Made in Italy` })));
244
237
  objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
245
238
  }, src: (_a = src !== null && src !== void 0 ? src : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _a !== void 0 ? _a : bottom_image }))));
246
239
  }))),
247
- !((_z = product === null || product === void 0 ? void 0 : product.homePage) === null || _z === void 0 ? void 0 : _z.length) && (React.createElement("div", { className: css({
240
+ !((_0 = product === null || product === void 0 ? void 0 : product.homePage) === null || _0 === void 0 ? void 0 : _0.length) && (React.createElement("div", { className: css({
248
241
  height,
249
242
  width
250
243
  }) },
@@ -252,7 +245,7 @@ Made in Italy` })));
252
245
  objectFit: 'cover',
253
246
  width: '100%',
254
247
  height: '100%'
255
- }), src: (_0 = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _0 !== void 0 ? _0 : bottom_image, alt: 'pdp image' }))),
248
+ }), src: (_1 = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _1 !== void 0 ? _1 : bottom_image, alt: 'pdp image' }))),
256
249
  (iframeUrl || !product) && iframeIcon && (React.createElement("div", { style: {
257
250
  display: 'flex',
258
251
  alignItems: 'center',
@@ -269,7 +262,7 @@ Made in Italy` })));
269
262
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
270
263
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
271
264
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title), dangerouslySetInnerHTML: {
272
- __html: setFontForText((_1 = product === null || product === void 0 ? void 0 : product.title) !== null && _1 !== void 0 ? _1 : 'Large Dior Toujours BagLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
265
+ __html: setFontForText((_2 = product === null || product === void 0 ? void 0 : product.title) !== null && _2 !== void 0 ? _2 : 'Large Dior Toujours BagLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
273
266
  } }),
274
267
  React.createElement("div", { className: 'pb-commondityDiroNew-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection), dangerouslySetInnerHTML: {
275
268
  __html: setFontForText((product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage CalfskinLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
@@ -279,11 +272,11 @@ Made in Italy` })));
279
272
  __html: priceText !== null && priceText !== void 0 ? priceText : ''
280
273
  } }),
281
274
  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: {
282
- __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)
275
+ __html: setFontForText((_3 = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _3 !== void 0 ? _3 : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
283
276
  } }))),
284
- 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 },
277
+ React.createElement("a", { "aria-label": (_4 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _4 !== void 0 ? _4 : 'Shop now', role: 'button', tabIndex: 0, onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
285
278
  React.createElement("span", { dangerouslySetInnerHTML: {
286
- __html: setFontForText((_4 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _4 !== void 0 ? _4 : 'Shop now', buttonStyle)
279
+ __html: setFontForText((_5 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _5 !== void 0 ? _5 : 'Shop now', buttonStyle)
287
280
  } })),
288
281
  productInfoText({ isPost }))),
289
282
  React.createElement(Modal, { visible: showModal, onClose: () => setShowModal(false) },
@@ -295,6 +288,8 @@ Made in Italy` })));
295
288
  height: 'calc(100% - 50px)',
296
289
  marginTop: '50px',
297
290
  border: 'none'
298
- } })))));
291
+ } }))),
292
+ showAddToCart && (React.createElement(Modal, { visible: showAddToCart, padding: 0, isFullScreen: false, onClose: () => setShowAddToCart(false) },
293
+ React.createElement(AddToCartPopup, { isActive: true })))));
299
294
  };
300
295
  export default memo(CommodityDetailDiroNew);
@@ -61,6 +61,10 @@ export interface IApiResponse {
61
61
  productUserId?: string;
62
62
  multiCta?: IMultiCtaData;
63
63
  position?: number;
64
+ shopify?: {
65
+ domain: string;
66
+ storefrontAccessToken: string;
67
+ };
64
68
  };
65
69
  }
66
70
  export interface IStructurePageProps {
@@ -4,30 +4,14 @@ const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
5
  const hooks_1 = require("../../hooks");
6
6
  const FormatImage_1 = tslib_1.__importDefault(require("../SxpPageRender/FormatImage"));
7
+ const _materials_ = tslib_1.__importStar(require("../../../materials/sxp"));
7
8
  const RESOLVER = {};
8
- try {
9
- const materialsModule = require('../../materials/sxp');
10
- if (materialsModule && typeof materialsModule === 'object') {
11
- Object.values(materialsModule).forEach((v) => {
12
- var _a;
13
- if ((_a = v === null || v === void 0 ? void 0 : v.extend) === null || _a === void 0 ? void 0 : _a.type) {
14
- RESOLVER[v.extend.type] = v;
15
- }
16
- });
17
- if (Object.keys(RESOLVER).length > 0) {
18
- console.log('[StructurePage] Successfully loaded materials:', Object.keys(RESOLVER));
19
- }
20
- else {
21
- console.warn('[StructurePage] Materials module loaded but no valid components found');
22
- }
23
- }
24
- else {
25
- console.warn('[StructurePage] Materials module is not a valid object:', materialsModule);
9
+ Object.values(_materials_).forEach((v) => {
10
+ var _a;
11
+ if ((_a = v === null || v === void 0 ? void 0 : v.extend) === null || _a === void 0 ? void 0 : _a.type) {
12
+ RESOLVER[v.extend.type] = v;
26
13
  }
27
- }
28
- catch (error) {
29
- console.error('[StructurePage] Failed to load materials for StructurePage:', error);
30
- }
14
+ });
31
15
  const baseStyles = {
32
16
  container: {
33
17
  backgroundColor: '#000',
@@ -541,7 +525,7 @@ const StructurePage = (_a) => {
541
525
  return res.json();
542
526
  })
543
527
  .then((result) => {
544
- var _a, _b, _c, _d;
528
+ var _a, _b, _c, _d, _e;
545
529
  if (result.code === '0' || result.code === '00000') {
546
530
  let multiCtaData = null;
547
531
  if (isCmsMode) {
@@ -557,6 +541,13 @@ const StructurePage = (_a) => {
557
541
  console.error('[StructurePage] No multiCta data found in response:', result);
558
542
  setError(result.message || 'No multiCta data found');
559
543
  }
544
+ if ((_e = result.data) === null || _e === void 0 ? void 0 : _e.shopify) {
545
+ window.__SHOPIFY_CONFIG__ = {
546
+ domain: result.data.shopify.domain,
547
+ storefrontAccessToken: result.data.shopify.storefrontAccessToken
548
+ };
549
+ console.log('[StructurePage] Shopify config stored:', window.__SHOPIFY_CONFIG__);
550
+ }
560
551
  }
561
552
  else {
562
553
  setError(result.message || 'Failed to load data');
@@ -10,6 +10,7 @@ interface IModalProps {
10
10
  fullHeight?: number;
11
11
  isFullScreen?: boolean;
12
12
  openState?: IPopupType;
13
+ showCloseButton?: boolean;
13
14
  }
14
15
  declare const _default: React.NamedExoticComponent<React.PropsWithChildren<IModalProps>>;
15
16
  export default _default;
@@ -7,7 +7,7 @@ const ReactDOM = tslib_1.__importStar(require("react-dom"));
7
7
  const hooks_1 = require("../../../../core/hooks");
8
8
  const useVisibleHeight_1 = require("../../../../core/hooks/useVisibleHeight");
9
9
  const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
10
- const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema, fullHeight, isFullScreen = false, openState }) => {
10
+ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema, fullHeight, isFullScreen = false, openState, showCloseButton = true }) => {
11
11
  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;
12
12
  const { visibleHeight, bottomHeight } = (0, useVisibleHeight_1.useVisibleHeight)();
13
13
  const touchRef = (0, react_1.useRef)(null);
@@ -181,7 +181,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
181
181
  setScrollTop(15 - ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.scrollTop));
182
182
  }
183
183
  })), child()),
184
- react_1.default.createElement("button", { className: 'modal-icon-wrapper', role: 'button', "aria-label": 'close button', onClick: onClose, style: { top: scrollTop } },
185
- react_1.default.createElement("img", { src: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon, alt: 'close button', className: 'modal-icon' }))))))), modalEleRef.current);
184
+ showCloseButton && (react_1.default.createElement("button", { className: 'modal-icon-wrapper', role: 'button', "aria-label": 'close button', onClick: onClose, style: { top: scrollTop } },
185
+ react_1.default.createElement("img", { src: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon, alt: 'close button', className: 'modal-icon' })))))))), modalEleRef.current);
186
186
  };
187
187
  exports.default = (0, react_1.memo)(Modal);
@@ -81,6 +81,7 @@ export interface ISxpPageRenderProps {
81
81
  };
82
82
  shopifyDomain?: string;
83
83
  storefrontAccessToken?: string;
84
+ popupList?: any[];
84
85
  };
85
86
  descStyle?: CSSProperties;
86
87
  tipText?: {
@@ -46,6 +46,7 @@ export type ProductInfoType = {
46
46
  taxInfo?: string;
47
47
  cover?: string;
48
48
  remark?: string;
49
+ shopifyId?: string;
49
50
  };
50
51
  export interface IScene {
51
52
  blueprintStep: number;
@@ -1,33 +1,7 @@
1
- import { FC, CSSProperties } from 'react';
1
+ import { FC } from 'react';
2
2
  import './index.less';
3
3
  export interface IAddToCartPopupProps {
4
- style?: CSSProperties;
5
4
  isActive?: boolean;
6
- index?: number;
7
- shopifyDomain?: string;
8
- storefrontAccessToken?: string;
9
- variantStyles?: {
10
- title?: CSSProperties;
11
- price?: CSSProperties;
12
- option?: CSSProperties;
13
- selectedOption?: CSSProperties;
14
- };
15
- buttonStyle?: CSSProperties;
16
- quantityStyle?: CSSProperties;
17
- texts?: {
18
- addToCart?: string;
19
- selectOptions?: string;
20
- loading?: string;
21
- error?: string;
22
- color?: string;
23
- size?: string;
24
- material?: string;
25
- style?: string;
26
- };
27
- popupBg?: {
28
- horizontalMargin?: number;
29
- bottomMargin?: number;
30
- };
31
5
  }
32
6
  declare const AddToCartPopup: FC<IAddToCartPopupProps>;
33
7
  export default AddToCartPopup;