pb-sxp-ui 1.20.14 → 1.20.16

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 (46) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +111 -111
  3. package/dist/index.cjs +959 -212
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.css +73 -72
  6. package/dist/index.js +959 -213
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.min.cjs +7 -7
  9. package/dist/index.min.cjs.map +1 -1
  10. package/dist/index.min.js +7 -7
  11. package/dist/index.min.js.map +1 -1
  12. package/dist/pb-ui.js +959 -212
  13. package/dist/pb-ui.js.map +1 -1
  14. package/dist/pb-ui.min.js +7 -7
  15. package/dist/pb-ui.min.js.map +1 -1
  16. package/es/core/components/DiyStoryPreview/index.js +10 -4
  17. package/es/core/components/StructurePage/index.d.ts +89 -0
  18. package/es/core/components/StructurePage/index.js +716 -0
  19. package/es/core/components/SxpPageRender/fakeData.js +1 -1
  20. package/es/core/components/SxpPageRender/index.js +10 -4
  21. package/es/core/context/SxpDataSourceProvider.js +4 -1
  22. package/es/core/hooks/useVisibleHeight.js +7 -7
  23. package/es/core/index.d.ts +2 -0
  24. package/es/core/index.js +1 -0
  25. package/es/core/utils/materials.d.ts +1 -1
  26. package/es/index.d.ts +1 -0
  27. package/es/index.js +1 -0
  28. package/es/materials/sxp/MultiPosts/index.js +4 -4
  29. package/es/materials/sxp/popup/CommodityDetail/index.js +4 -4
  30. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
  31. package/lib/core/components/DiyStoryPreview/index.js +10 -4
  32. package/lib/core/components/StructurePage/index.d.ts +89 -0
  33. package/lib/core/components/StructurePage/index.js +718 -0
  34. package/lib/core/components/SxpPageRender/fakeData.js +1 -1
  35. package/lib/core/components/SxpPageRender/index.js +10 -4
  36. package/lib/core/context/SxpDataSourceProvider.js +4 -1
  37. package/lib/core/hooks/useVisibleHeight.js +7 -7
  38. package/lib/core/index.d.ts +2 -0
  39. package/lib/core/index.js +6 -1
  40. package/lib/core/utils/materials.d.ts +1 -1
  41. package/lib/index.d.ts +1 -0
  42. package/lib/index.js +3 -1
  43. package/lib/materials/sxp/MultiPosts/index.js +4 -4
  44. package/lib/materials/sxp/popup/CommodityDetail/index.js +4 -4
  45. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
  46. package/package.json +111 -111
@@ -207,10 +207,16 @@ const DiyStoryPreview = forwardRef(({ data = [], globalConfig, tipText, nudge, t
207
207
  }, [handleSessionExpire, disabledListener]);
208
208
  return (React.createElement("div", { id: 'sxp-render', style: { height: containerHeight, position: 'relative', pointerEvents } },
209
209
  React.createElement(Swiper, { ref: swiperRef, allowTouchMove: pointerEvents !== 'none', onSlideChange: () => {
210
- swiperRef.current.swiper.allowTouchMove = false;
211
- setTimeout(() => {
212
- swiperRef.current.swiper.allowTouchMove = true;
213
- }, 500);
210
+ var _a;
211
+ if ((_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) {
212
+ swiperRef.current.swiper.allowTouchMove = false;
213
+ setTimeout(() => {
214
+ var _a;
215
+ if ((_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) {
216
+ swiperRef.current.swiper.allowTouchMove = true;
217
+ }
218
+ }, 500);
219
+ }
214
220
  }, onActiveIndexChange: (swiper) => {
215
221
  setCurIndex(swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex);
216
222
  onActiveChange === null || onActiveChange === void 0 ? void 0 : onActiveChange(swiper.activeIndex);
@@ -0,0 +1,89 @@
1
+ import { FC, CSSProperties } from 'react';
2
+ export interface IPostData {
3
+ traceInfo: string;
4
+ itemId: string;
5
+ tags?: string[] | null;
6
+ cover?: string | null;
7
+ url?: string | null;
8
+ title?: string | null;
9
+ imgUrls?: string[] | null;
10
+ text?: string;
11
+ bindCta?: {
12
+ title: string;
13
+ link?: string | null;
14
+ } | null;
15
+ bindProduct?: any;
16
+ bindProducts?: any[];
17
+ scene?: {
18
+ cta?: string;
19
+ position?: number;
20
+ type?: string;
21
+ };
22
+ }
23
+ export interface IProductData {
24
+ traceInfo: string;
25
+ itemId: string;
26
+ title: string;
27
+ cover: string;
28
+ homePage: string[];
29
+ price: number;
30
+ currency: string;
31
+ link?: string | null;
32
+ info?: string;
33
+ description?: string | null;
34
+ text?: string | null;
35
+ landingImageUrl?: string;
36
+ position?: string | null;
37
+ bindCta?: {
38
+ title: string;
39
+ link?: string | null;
40
+ } | null;
41
+ }
42
+ export interface IMultiCtaData {
43
+ heroSection?: IPostData;
44
+ carouselSection?: IPostData[];
45
+ highlightRevealSection?: IProductData;
46
+ productGridSection?: IProductData[];
47
+ footerSection?: IProductData;
48
+ }
49
+ export interface IApiResponse {
50
+ code: string;
51
+ message: string;
52
+ data: {
53
+ recList?: Array<{
54
+ position: number;
55
+ video: any;
56
+ product: any;
57
+ multiCta: IMultiCtaData;
58
+ isCollected: boolean;
59
+ }>;
60
+ channel?: string;
61
+ productUserId?: string;
62
+ multiCta?: IMultiCtaData;
63
+ position?: number;
64
+ };
65
+ }
66
+ export interface IStructurePageProps {
67
+ containerStyle?: CSSProperties;
68
+ containerHeight?: number;
69
+ containerWidth?: number;
70
+ className?: string;
71
+ apiUrl?: string;
72
+ requestBody?: {
73
+ maxSize?: number;
74
+ defaultSize?: number;
75
+ type?: string;
76
+ channel?: string;
77
+ productUserId?: string;
78
+ [key: string]: any;
79
+ };
80
+ editorMode?: boolean;
81
+ multiCTAConfig?: Record<string, any>;
82
+ videoPlayIcon?: string;
83
+ isCmsMode?: boolean;
84
+ storyId?: string;
85
+ customHeaders?: Record<string, string>;
86
+ [key: string]: any;
87
+ }
88
+ declare const StructurePage: FC<IStructurePageProps>;
89
+ export default StructurePage;