pb-sxp-ui 1.0.0 → 1.0.2-alpha.1

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 (129) hide show
  1. package/README.md +2 -2
  2. package/dist/index.cjs +938 -389
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.css +24 -18
  5. package/dist/index.js +938 -389
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.min.cjs +3 -5
  8. package/dist/index.min.cjs.map +1 -1
  9. package/dist/index.min.js +3 -5
  10. package/dist/index.min.js.map +1 -1
  11. package/dist/pb-ui.js +938 -389
  12. package/dist/pb-ui.js.map +1 -1
  13. package/dist/pb-ui.min.js +3 -5
  14. package/dist/pb-ui.min.js.map +1 -1
  15. package/es/core/components/SxpPageCore/index.d.ts +1 -0
  16. package/es/core/components/SxpPageCore/index.js +2 -2
  17. package/es/core/components/SxpPageRender/ExpandableText.d.ts +1 -0
  18. package/es/core/components/SxpPageRender/ExpandableText.js +16 -9
  19. package/es/core/components/SxpPageRender/Hashtag/index.js +1 -1
  20. package/es/core/components/SxpPageRender/Modal/index.d.ts +2 -0
  21. package/es/core/components/SxpPageRender/Modal/index.js +7 -4
  22. package/es/core/components/SxpPageRender/Nudge/index.d.ts +24 -0
  23. package/es/core/components/SxpPageRender/Nudge/index.js +13 -0
  24. package/es/core/components/SxpPageRender/PictureGroup/index.js +11 -7
  25. package/es/core/components/SxpPageRender/Popup/index.js +3 -3
  26. package/es/core/components/SxpPageRender/VideoWidget/index.js +30 -21
  27. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +4 -3
  28. package/es/core/components/SxpPageRender/index.d.ts +20 -1
  29. package/es/core/components/SxpPageRender/index.js +19 -16
  30. package/es/core/components/SxpPageRender/typing.d.ts +1 -0
  31. package/es/core/components/SxpPageRender/useIconLink.d.ts +1 -1
  32. package/es/core/components/SxpPageRender/useIconLink.js +8 -3
  33. package/es/core/context/EditorContext.d.ts +5 -0
  34. package/es/core/context/EditorContext.js +21 -3
  35. package/es/core/context/SxpDataSourceProvider.js +1 -1
  36. package/es/core/create.d.ts +1 -1
  37. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +13 -1
  38. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +20 -17
  39. package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +35 -1
  40. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +134 -0
  41. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +175 -0
  42. package/es/materials/sxp/template/Appoint/index.d.ts +2 -0
  43. package/es/materials/sxp/template/Appoint/index.js +4 -18
  44. package/es/materials/sxp/template/Appoint/material.js +22 -6
  45. package/es/materials/sxp/template/Commodity/index.d.ts +2 -0
  46. package/es/materials/sxp/template/Commodity/index.js +5 -22
  47. package/es/materials/sxp/template/Commodity/material.js +31 -6
  48. package/es/materials/sxp/template/CommodityDiro/index.d.ts +2 -0
  49. package/es/materials/sxp/template/CommodityDiro/index.js +5 -24
  50. package/es/materials/sxp/template/CommodityDiro/material.js +30 -5
  51. package/es/materials/sxp/template/CommodityDiroNew/index.d.ts +2 -0
  52. package/es/materials/sxp/template/CommodityDiroNew/index.js +5 -24
  53. package/es/materials/sxp/template/CommodityDiroNew/material.js +32 -6
  54. package/es/materials/sxp/template/Link/index.d.ts +2 -0
  55. package/es/materials/sxp/template/Link/index.js +4 -13
  56. package/es/materials/sxp/template/Link/material.js +22 -5
  57. package/es/materials/sxp/template/MultiCommodity/index.d.ts +2 -0
  58. package/es/materials/sxp/template/MultiCommodity/index.js +8 -24
  59. package/es/materials/sxp/template/MultiCommodity/material.js +30 -5
  60. package/es/materials/sxp/template/MultiCommodityDiro/index.d.ts +2 -0
  61. package/es/materials/sxp/template/MultiCommodityDiro/index.js +8 -27
  62. package/es/materials/sxp/template/MultiCommodityDiro/material.js +31 -6
  63. package/es/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +2 -0
  64. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +8 -25
  65. package/es/materials/sxp/template/MultiCommodityDiroNew/material.js +32 -6
  66. package/es/materials/sxp/template/components/EventProvider.d.ts +2 -1
  67. package/es/materials/sxp/template/components/EventProvider.js +5 -4
  68. package/es/materials/sxp/template/components/settingRender.d.ts +108 -0
  69. package/es/materials/sxp/template/components/settingRender.js +198 -0
  70. package/es/materials/sxp/template/components/typing.d.ts +6 -0
  71. package/es/materials/sxp/template/components/typing.js +1 -0
  72. package/lib/core/components/SxpPageCore/index.d.ts +1 -0
  73. package/lib/core/components/SxpPageCore/index.js +2 -2
  74. package/lib/core/components/SxpPageRender/ExpandableText.d.ts +1 -0
  75. package/lib/core/components/SxpPageRender/ExpandableText.js +16 -9
  76. package/lib/core/components/SxpPageRender/Hashtag/index.js +1 -1
  77. package/lib/core/components/SxpPageRender/Modal/index.d.ts +2 -0
  78. package/lib/core/components/SxpPageRender/Modal/index.js +7 -4
  79. package/lib/core/components/SxpPageRender/Nudge/index.d.ts +24 -0
  80. package/lib/core/components/SxpPageRender/Nudge/index.js +16 -0
  81. package/lib/core/components/SxpPageRender/PictureGroup/index.js +10 -6
  82. package/lib/core/components/SxpPageRender/Popup/index.js +3 -3
  83. package/lib/core/components/SxpPageRender/VideoWidget/index.js +30 -21
  84. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +3 -2
  85. package/lib/core/components/SxpPageRender/index.d.ts +20 -1
  86. package/lib/core/components/SxpPageRender/index.js +19 -16
  87. package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
  88. package/lib/core/components/SxpPageRender/useIconLink.d.ts +1 -1
  89. package/lib/core/components/SxpPageRender/useIconLink.js +8 -3
  90. package/lib/core/context/EditorContext.d.ts +5 -0
  91. package/lib/core/context/EditorContext.js +21 -3
  92. package/lib/core/context/SxpDataSourceProvider.js +1 -1
  93. package/lib/core/create.d.ts +1 -1
  94. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +13 -1
  95. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +20 -17
  96. package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +35 -1
  97. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +134 -0
  98. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +177 -0
  99. package/lib/materials/sxp/template/Appoint/index.d.ts +2 -0
  100. package/lib/materials/sxp/template/Appoint/index.js +4 -18
  101. package/lib/materials/sxp/template/Appoint/material.js +22 -6
  102. package/lib/materials/sxp/template/Commodity/index.d.ts +2 -0
  103. package/lib/materials/sxp/template/Commodity/index.js +5 -22
  104. package/lib/materials/sxp/template/Commodity/material.js +31 -6
  105. package/lib/materials/sxp/template/CommodityDiro/index.d.ts +2 -0
  106. package/lib/materials/sxp/template/CommodityDiro/index.js +5 -24
  107. package/lib/materials/sxp/template/CommodityDiro/material.js +30 -5
  108. package/lib/materials/sxp/template/CommodityDiroNew/index.d.ts +2 -0
  109. package/lib/materials/sxp/template/CommodityDiroNew/index.js +5 -24
  110. package/lib/materials/sxp/template/CommodityDiroNew/material.js +32 -6
  111. package/lib/materials/sxp/template/Link/index.d.ts +2 -0
  112. package/lib/materials/sxp/template/Link/index.js +4 -13
  113. package/lib/materials/sxp/template/Link/material.js +22 -5
  114. package/lib/materials/sxp/template/MultiCommodity/index.d.ts +2 -0
  115. package/lib/materials/sxp/template/MultiCommodity/index.js +7 -23
  116. package/lib/materials/sxp/template/MultiCommodity/material.js +30 -5
  117. package/lib/materials/sxp/template/MultiCommodityDiro/index.d.ts +2 -0
  118. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +7 -26
  119. package/lib/materials/sxp/template/MultiCommodityDiro/material.js +31 -6
  120. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +2 -0
  121. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +7 -24
  122. package/lib/materials/sxp/template/MultiCommodityDiroNew/material.js +32 -6
  123. package/lib/materials/sxp/template/components/EventProvider.d.ts +2 -1
  124. package/lib/materials/sxp/template/components/EventProvider.js +4 -3
  125. package/lib/materials/sxp/template/components/settingRender.d.ts +108 -0
  126. package/lib/materials/sxp/template/components/settingRender.js +200 -0
  127. package/lib/materials/sxp/template/components/typing.d.ts +6 -0
  128. package/lib/materials/sxp/template/components/typing.js +2 -0
  129. package/package.json +2 -1
@@ -6,11 +6,12 @@ import { throttle } from 'lodash';
6
6
  import Scroll from '../components/Scroll';
7
7
  import Img from '../components/Img';
8
8
  import styles from './index.module.less';
9
- import { useSxpDataSource } from '../../../../core/hooks';
9
+ import { useEditor, useSxpDataSource } from '../../../../core/hooks';
10
10
  const MultiCommodityDiroNew = (_a) => {
11
11
  var _b, _c;
12
- var { content, style, bgImg, recData, onClick, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image"]);
12
+ var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
13
13
  const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
14
+ const { popupAni } = useEditor();
14
15
  const [products, setProducts] = 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]);
15
16
  const handleClick = throttle((item) => {
16
17
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
@@ -19,19 +20,11 @@ const MultiCommodityDiroNew = (_a) => {
19
20
  }, recData, item);
20
21
  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 }) }));
21
22
  onClick === null || onClick === void 0 ? void 0 : onClick();
22
- }, 1200);
23
+ }, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
23
24
  return (React.createElement(Scroll, null, products === null || products === void 0 ? void 0 : products.map((item) => {
24
25
  var _a, _b, _c, _d, _e, _f;
25
- return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: css(Object.assign(Object.assign({}, style), { maxWidth: '260px', width: '100%', flexShrink: 0, padding: '4px', background: 'rgba(255,255,255,0.75)' })) }, props, { onClick: () => handleClick(item) }),
26
- React.createElement("div", { className: css({
27
- width: '78px',
28
- height: '78px',
29
- marginRight: '16px',
30
- borderRadius: '8px',
31
- overflow: 'hidden',
32
- flexShrink: 0,
33
- backgroundColor: '#f2f2f2'
34
- }) },
26
+ return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: css(Object.assign({ flexShrink: 0 }, style)), style: { display: 'flex' } }, props, { onClick: () => handleClick(item) }),
27
+ React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
35
28
  React.createElement(Img, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item })),
36
29
  React.createElement("div", { className: css({
37
30
  color: '#fff',
@@ -42,18 +35,8 @@ const MultiCommodityDiroNew = (_a) => {
42
35
  overflow: 'hidden',
43
36
  lineHeight: '20px'
44
37
  }) },
45
- React.createElement("div", { className: styles['tow-line-ellipsis'] }, (_d = item === null || item === void 0 ? void 0 : item.title) !== null && _d !== void 0 ? _d : 'Product Name'),
46
- React.createElement("div", { className: css({
47
- fontSize: '13px',
48
- fontWeight: 'bold',
49
- textOverflow: 'ellipsis',
50
- overflow: 'hidden',
51
- width: 'fit-content',
52
- maxWidth: '100%',
53
- whiteSpace: 'nowrap',
54
- textDecoration: 'underline',
55
- color: '#000'
56
- }) }, (_f = (_e = item === null || item === void 0 ? void 0 : item.bindCta) === null || _e === void 0 ? void 0 : _e.enTitle) !== null && _f !== void 0 ? _f : 'Shop now'))));
38
+ React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_d = item === null || item === void 0 ? void 0 : item.title) !== null && _d !== void 0 ? _d : 'Product Name'),
39
+ React.createElement("div", { className: css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_f = (_e = item === null || item === void 0 ? void 0 : item.bindCta) === null || _e === void 0 ? void 0 : _e.enTitle) !== null && _f !== void 0 ? _f : 'Shop now'))));
57
40
  })));
58
41
  };
59
42
  export default memo(MultiCommodityDiroNew);
@@ -1,3 +1,4 @@
1
+ import settingRender from '../components/settingRender';
1
2
  import interactionRender from './interactionRender';
2
3
  import MultiCommodityDiroNewComponent from '.';
3
4
  import { createMaterial } from '../../../../core/create';
@@ -8,15 +9,40 @@ const MultiCommodityDiroNew = createMaterial(MultiCommodityDiroNewComponent, {
8
9
  type: 'MultiCommodityDiroNew',
9
10
  related: {
10
11
  interactionRender,
11
- bindableProps: []
12
+ bindableProps: [],
13
+ settingRender
12
14
  },
13
15
  defaulSetting: {
14
- props: {},
16
+ props: {
17
+ ctaTempStyles: {
18
+ img: {
19
+ borderRadius: 8,
20
+ width: 78,
21
+ height: 78,
22
+ marginRight: 16
23
+ },
24
+ title: {
25
+ fontSize: 12,
26
+ color: '#000',
27
+ textAlign: 'left'
28
+ },
29
+ ctaTitle: {
30
+ textDecoration: 'underline',
31
+ fontSize: 12,
32
+ fontWeight: 'bold',
33
+ color: '#000',
34
+ textAlign: 'left',
35
+ width: 150,
36
+ height: 20
37
+ }
38
+ }
39
+ },
15
40
  style: {
16
- padding: '7px',
17
- display: 'flex',
18
- background: '#fff',
19
- borderRadius: '3px'
41
+ borderRadius: 4,
42
+ width: 260,
43
+ height: 86,
44
+ padding: 4,
45
+ backgroundColor: 'rgba(255,255,255,0.75)'
20
46
  }
21
47
  },
22
48
  w: 100,
@@ -1,10 +1,11 @@
1
- import React from 'react';
1
+ import React, { CSSProperties } from 'react';
2
2
  import { RecItemType } from '../../../../core/components/SxpPageRender/typing';
3
3
  export interface IImgProps {
4
4
  rec?: RecItemType;
5
5
  children: any;
6
6
  className?: any;
7
7
  onClick?: any;
8
+ style?: CSSProperties;
8
9
  }
9
10
  declare const _default: React.NamedExoticComponent<IImgProps>;
10
11
  export default _default;
@@ -2,11 +2,12 @@ import { __rest } from "tslib";
2
2
  import React, { memo, useEffect, useRef } from 'react';
3
3
  import { throttle } from 'lodash';
4
4
  import useOnScreen from '../../../../core/hooks/useOnScreen';
5
- import { useSxpDataSource } from '../../../../core/hooks';
5
+ import { useEditor, useSxpDataSource } from '../../../../core/hooks';
6
6
  const EventProvider = (_a) => {
7
- var { rec, children, className, onClick } = _a, props = __rest(_a, ["rec", "children", "className", "onClick"]);
7
+ var { rec, children, className, onClick, style } = _a, props = __rest(_a, ["rec", "children", "className", "onClick", "style"]);
8
8
  const ref = useRef(null);
9
9
  const isOnScreen = useOnScreen(ref);
10
+ const { popupAni } = useEditor();
10
11
  const { setPopupDetailData, ctaEvent } = useSxpDataSource();
11
12
  useEffect(() => {
12
13
  var _a, _b;
@@ -27,7 +28,7 @@ const EventProvider = (_a) => {
27
28
  }, rec, item);
28
29
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(rec);
29
30
  onClick === null || onClick === void 0 ? void 0 : onClick();
30
- }, 1200);
31
- return (React.createElement("div", { ref: ref, className: className, onClick: handleClick }, children));
31
+ }, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
32
+ return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
32
33
  };
33
34
  export default memo(EventProvider);
@@ -0,0 +1,108 @@
1
+ declare const _default: ({
2
+ title: string;
3
+ child: ({
4
+ type: string;
5
+ label: string;
6
+ child: {
7
+ type: string;
8
+ name: string[];
9
+ addonAfter: string;
10
+ }[];
11
+ name?: undefined;
12
+ addonAfter?: undefined;
13
+ } | {
14
+ type: string;
15
+ label: string;
16
+ child: ({
17
+ type: string;
18
+ name: string[];
19
+ max: number;
20
+ addonAfter?: undefined;
21
+ } | {
22
+ type: string;
23
+ name: string[];
24
+ addonAfter: string;
25
+ max: number;
26
+ })[];
27
+ name?: undefined;
28
+ addonAfter?: undefined;
29
+ } | {
30
+ type: string;
31
+ label: string;
32
+ name: string[];
33
+ child?: undefined;
34
+ addonAfter?: undefined;
35
+ } | {
36
+ label: string;
37
+ type: string;
38
+ name: string[];
39
+ addonAfter: string;
40
+ child?: undefined;
41
+ })[];
42
+ type?: undefined;
43
+ } | {
44
+ title: string;
45
+ type: string;
46
+ child: ({
47
+ type: string;
48
+ label: string;
49
+ child: ({
50
+ type: string;
51
+ name: string[];
52
+ options?: undefined;
53
+ addonAfter?: undefined;
54
+ } | {
55
+ type: string;
56
+ options: {
57
+ label: string;
58
+ value: string;
59
+ }[];
60
+ name: string[];
61
+ addonAfter?: undefined;
62
+ } | {
63
+ type: string;
64
+ addonAfter: string;
65
+ name: string[];
66
+ options?: undefined;
67
+ })[];
68
+ name?: undefined;
69
+ } | {
70
+ label: string;
71
+ type: string;
72
+ name: string[];
73
+ child?: undefined;
74
+ })[];
75
+ } | {
76
+ title: string;
77
+ child: ({
78
+ type: string;
79
+ label: string;
80
+ name: string[];
81
+ child?: undefined;
82
+ } | {
83
+ type: string;
84
+ label: string;
85
+ child: ({
86
+ type: string;
87
+ name: string[];
88
+ options?: undefined;
89
+ addonAfter?: undefined;
90
+ } | {
91
+ type: string;
92
+ options: {
93
+ label: string;
94
+ value: string;
95
+ }[];
96
+ name: string[];
97
+ addonAfter?: undefined;
98
+ } | {
99
+ type: string;
100
+ addonAfter: string;
101
+ name: string[];
102
+ options?: undefined;
103
+ })[];
104
+ name?: undefined;
105
+ })[];
106
+ type?: undefined;
107
+ })[];
108
+ export default _default;
@@ -0,0 +1,198 @@
1
+ export default [
2
+ {
3
+ title: '主题样式',
4
+ child: [
5
+ {
6
+ type: 'Group',
7
+ label: '尺寸',
8
+ child: [
9
+ {
10
+ type: 'Number',
11
+ name: ['style', 'width'],
12
+ addonAfter: 'W'
13
+ },
14
+ {
15
+ type: 'Number',
16
+ name: ['style', 'height'],
17
+ addonAfter: 'H'
18
+ }
19
+ ]
20
+ },
21
+ {
22
+ type: 'Group',
23
+ label: '圆角',
24
+ child: [
25
+ {
26
+ type: 'Slider',
27
+ name: ['style', 'borderRadius'],
28
+ max: 100
29
+ },
30
+ {
31
+ type: 'Number',
32
+ name: ['style', 'borderRadius'],
33
+ addonAfter: 'px',
34
+ max: 100
35
+ }
36
+ ]
37
+ },
38
+ {
39
+ type: 'Color',
40
+ label: '背景色',
41
+ name: ['style', 'backgroundColor']
42
+ },
43
+ {
44
+ label: '内边距',
45
+ type: 'Number',
46
+ name: ['style', 'padding'],
47
+ addonAfter: 'px'
48
+ },
49
+ {
50
+ label: '与Post描述边距',
51
+ type: 'Number',
52
+ name: ['style', 'marginBottom'],
53
+ addonAfter: 'px'
54
+ }
55
+ ]
56
+ },
57
+ {
58
+ title: '商品图片',
59
+ child: [
60
+ {
61
+ type: 'Group',
62
+ label: '尺寸',
63
+ child: [
64
+ {
65
+ type: 'Number',
66
+ name: ['props', 'ctaTempStyles', 'img', 'width'],
67
+ addonAfter: 'W'
68
+ },
69
+ {
70
+ type: 'Number',
71
+ name: ['props', 'ctaTempStyles', 'img', 'height'],
72
+ addonAfter: 'H'
73
+ }
74
+ ]
75
+ },
76
+ {
77
+ type: 'Group',
78
+ label: '圆角',
79
+ child: [
80
+ {
81
+ type: 'Slider',
82
+ name: ['props', 'ctaTempStyles', 'img', 'borderRadius'],
83
+ max: 100
84
+ },
85
+ {
86
+ type: 'Number',
87
+ name: ['props', 'ctaTempStyles', 'img', 'borderRadius'],
88
+ addonAfter: 'px',
89
+ max: 100
90
+ }
91
+ ]
92
+ },
93
+ {
94
+ type: 'Number',
95
+ label: '与右侧边距',
96
+ addonAfter: 'px',
97
+ name: ['props', 'ctaTempStyles', 'img', 'marginRight']
98
+ }
99
+ ]
100
+ },
101
+ {
102
+ title: '商品标题文本',
103
+ type: 'commodityTitle',
104
+ child: [
105
+ {
106
+ type: 'Group',
107
+ label: '字体',
108
+ child: [
109
+ {
110
+ type: 'Color',
111
+ name: ['props', 'ctaTempStyles', 'title', 'color']
112
+ },
113
+ {
114
+ type: 'Select',
115
+ options: [{ label: '黑体', value: '黑体' }],
116
+ name: ['props', 'ctaTempStyles', 'title', 'fontFamily']
117
+ },
118
+ {
119
+ type: 'Number',
120
+ addonAfter: 'px',
121
+ name: ['props', 'ctaTempStyles', 'title', 'fontSize']
122
+ }
123
+ ]
124
+ },
125
+ {
126
+ label: '样式',
127
+ type: 'TextStyle',
128
+ name: ['props', 'ctaTempStyles', 'title']
129
+ },
130
+ {
131
+ label: '对齐',
132
+ type: 'TextAlign',
133
+ name: ['props', 'ctaTempStyles', 'title']
134
+ },
135
+ {
136
+ label: '间距',
137
+ type: 'TextSpace',
138
+ name: ['props', 'ctaTempStyles', 'title']
139
+ }
140
+ ]
141
+ },
142
+ {
143
+ title: 'CTA标题',
144
+ child: [
145
+ {
146
+ type: 'Group',
147
+ label: '尺寸',
148
+ child: [
149
+ {
150
+ type: 'Number',
151
+ name: ['props', 'ctaTempStyles', 'ctaTitle', 'width'],
152
+ addonAfter: 'W'
153
+ },
154
+ {
155
+ type: 'Number',
156
+ name: ['props', 'ctaTempStyles', 'ctaTitle', 'height'],
157
+ addonAfter: 'H'
158
+ }
159
+ ]
160
+ },
161
+ {
162
+ type: 'Color',
163
+ label: '背景色',
164
+ name: ['props', 'ctaTempStyles', 'ctaTitle', 'backgroundColor']
165
+ },
166
+ {
167
+ type: 'Group',
168
+ label: '字体',
169
+ child: [
170
+ {
171
+ type: 'Color',
172
+ name: ['props', 'ctaTempStyles', 'ctaTitle', 'color']
173
+ },
174
+ {
175
+ type: 'Select',
176
+ options: [{ label: '黑体', value: '黑体' }],
177
+ name: ['props', 'ctaTempStyles', 'ctaTitle', 'fontFamily']
178
+ },
179
+ {
180
+ type: 'Number',
181
+ addonAfter: 'px',
182
+ name: ['props', 'ctaTempStyles', 'ctaTitle', 'fontSize']
183
+ }
184
+ ]
185
+ },
186
+ {
187
+ label: '样式',
188
+ type: 'TextStyle',
189
+ name: ['props', 'ctaTempStyles', 'ctaTitle']
190
+ },
191
+ {
192
+ label: '对齐',
193
+ type: 'TextAlign',
194
+ name: ['props', 'ctaTempStyles', 'ctaTitle']
195
+ }
196
+ ]
197
+ }
198
+ ];
@@ -0,0 +1,6 @@
1
+ import { CSSProperties } from 'react';
2
+ export type ICtaTempStylesType = {
3
+ img?: CSSProperties;
4
+ title?: CSSProperties;
5
+ ctaTitle?: CSSProperties;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -6,6 +6,7 @@ export interface ISxpPageCoreProps {
6
6
  defaultSize?: number;
7
7
  hashTagSize?: number;
8
8
  loadingImage?: string;
9
+ appDomain?: string;
9
10
  }
10
11
  declare const _default: React.NamedExoticComponent<ISxpPageCoreProps>;
11
12
  export default _default;
@@ -11,7 +11,7 @@ const RESOLVER = {};
11
11
  Object.values(_materials_).forEach((v) => {
12
12
  RESOLVER[v.extend.type] = v;
13
13
  });
14
- const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage }) => {
14
+ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain }) => {
15
15
  var _a, _b, _c, _d, _e, _f;
16
16
  const utmVal = (0, react_1.useMemo)(() => {
17
17
  var _a;
@@ -19,7 +19,7 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
19
19
  return searchParams;
20
20
  }, []);
21
21
  return (react_1.default.createElement(core_1.EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
22
- react_1.default.createElement(SxpDataSourceProvider_1.default, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, render: ({ rtcList }) => {
22
+ react_1.default.createElement(SxpDataSourceProvider_1.default, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, render: ({ rtcList }) => {
23
23
  var _a;
24
24
  return (react_1.default.createElement(react_1.default.Fragment, null,
25
25
  react_1.default.createElement(SxpPageRender_1.default, Object.assign({}, (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { data: rtcList, resolver: RESOLVER })),
@@ -7,6 +7,7 @@ interface IExpandableTextProps {
7
7
  onClick?: () => void;
8
8
  foldText?: string;
9
9
  unfoldText?: string;
10
+ isPost?: boolean;
10
11
  }
11
12
  declare const _default: React.NamedExoticComponent<IExpandableTextProps>;
12
13
  export default _default;
@@ -18,7 +18,7 @@ const limitTextLastWholeWord = (originalText = '', limit) => {
18
18
  const _words = newWords.length > 1 && newWords.length < words.length ? newWords.slice(0, newWords.length - 1) : newWords;
19
19
  return _words.join(' ') + ' ';
20
20
  };
21
- const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldText, unfoldText }) => {
21
+ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldText, unfoldText, isPost }) => {
22
22
  const [isShowMore, setIsShowMore] = (0, react_1.useState)(true);
23
23
  const [isShow, setIsShow] = (0, react_1.useState)(false);
24
24
  const lineClamp = Number((style === null || style === void 0 ? void 0 : style.lineClamp) || 2);
@@ -30,19 +30,26 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
30
30
  return !isShowMore && text.length > maxStr ? limitTextLastWholeWord(text, maxStr) + '...' : text;
31
31
  }, [text, maxStr, isShowMore]);
32
32
  (0, react_1.useEffect)(() => {
33
- if (multiRow.current) {
33
+ if (multiRow.current && isPost) {
34
34
  setIsShowMore(true);
35
35
  setTimeout(() => {
36
+ var _a;
36
37
  setIsShow(false);
37
- const height = parseInt(getComputedStyle(multiRow.current).height);
38
- const lineHeight = parseInt(getComputedStyle(multiRow === null || multiRow === void 0 ? void 0 : multiRow.current).lineHeight);
39
- if (text && height > lineHeight * lineClamp) {
40
- setIsShowMore(false);
41
- setIsShow(true);
38
+ try {
39
+ const cs = (_a = window === null || window === void 0 ? void 0 : window.getComputedStyle) === null || _a === void 0 ? void 0 : _a.call(window, multiRow.current);
40
+ const height = parseFloat(cs === null || cs === void 0 ? void 0 : cs.height);
41
+ const lh = parseFloat(cs === null || cs === void 0 ? void 0 : cs.lineHeight);
42
+ const fs = parseFloat(cs === null || cs === void 0 ? void 0 : cs.fontSize) + 4;
43
+ const lineHeight = isNaN(lh) ? fs : lh;
44
+ if (text && height > lineHeight * lineClamp) {
45
+ setIsShowMore(false);
46
+ setIsShow(true);
47
+ }
42
48
  }
49
+ catch (_b) { }
43
50
  }, 100);
44
51
  }
45
- }, [multiRow, text, lineClamp, style]);
52
+ }, [multiRow, text, lineClamp, style, isPost]);
46
53
  return (react_1.default.createElement("div", { className: className, style: Object.assign({}, style) },
47
54
  react_1.default.createElement("div", { ref: multiRow, style: {
48
55
  overflow: 'hidden',
@@ -51,7 +58,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
51
58
  display: '-webkit-box',
52
59
  WebkitBoxOrient: 'vertical',
53
60
  wordBreak: 'break-word'
54
- } }, text),
61
+ }, dangerouslySetInnerHTML: { __html: text ? text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>') : react_1.default.createElement(react_1.default.Fragment, null) } }),
55
62
  isShow && text && (react_1.default.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick }, isShowMore ? unfoldText || 'show less' : foldText || 'show more'))));
56
63
  };
57
64
  exports.default = (0, react_1.memo)(ExpandableText);
@@ -7,7 +7,7 @@ const hooks_1 = require("../../../../core/hooks");
7
7
  const Scroll_1 = tslib_1.__importDefault(require("../../../../materials/sxp/template/components/Scroll"));
8
8
  const Hashtag = ({ tags, itemId, itemType, index, rec }) => {
9
9
  const [isShowMore, setIsShowMore] = (0, react_1.useState)(false);
10
- const { setWaterFallData, setOpenHashtag, setCacheRtcList, setCacheActiveIndex, waterFallData, setIsFromHashtag } = (0, hooks_1.useSxpDataSource)();
10
+ const { setWaterFallData, setOpenHashtag, setCacheActiveIndex, waterFallData, setIsFromHashtag } = (0, hooks_1.useSxpDataSource)();
11
11
  const handleClickTag = (data) => {
12
12
  if (!waterFallData) {
13
13
  setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(index);
@@ -1,8 +1,10 @@
1
1
  import React, { CSSProperties } from 'react';
2
+ import { IPopupAniType } from '../../../../core/context/EditorContext';
2
3
  interface IModalProps {
3
4
  visible?: boolean;
4
5
  padding?: number | string;
5
6
  modalStyle?: CSSProperties;
7
+ popupAniData?: IPopupAniType;
6
8
  onClose?: () => void;
7
9
  }
8
10
  declare const _default: React.NamedExoticComponent<React.PropsWithChildren<IModalProps>>;
@@ -4,8 +4,11 @@ const tslib_1 = require("tslib");
4
4
  const lodash_1 = require("lodash");
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
6
  const ReactDOM = tslib_1.__importStar(require("react-dom"));
7
+ const hooks_1 = require("../../../../core/hooks");
7
8
  const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
8
- const Modal = ({ visible, onClose, children, modalStyle, padding }) => {
9
+ const Modal = ({ visible, onClose, children, modalStyle, padding, popupAniData }) => {
10
+ const { popupAni } = (0, hooks_1.useEditor)();
11
+ const cssAni = popupAniData !== null && popupAniData !== void 0 ? popupAniData : popupAni;
9
12
  const [isShow, setIsShow] = (0, react_1.useState)(false);
10
13
  const modalEleRef = (0, react_1.useRef)(null);
11
14
  (0, react_1.useEffect)(() => {
@@ -27,16 +30,16 @@ const Modal = ({ visible, onClose, children, modalStyle, padding }) => {
27
30
  else {
28
31
  setTimeout(() => {
29
32
  setIsShow(false);
30
- }, 1200);
33
+ }, cssAni === null || cssAni === void 0 ? void 0 : cssAni.duration);
31
34
  }
32
- }, [visible]);
35
+ }, [visible, cssAni]);
33
36
  if (!modalEleRef.current)
34
37
  return null;
35
38
  const handleClose = (0, lodash_1.debounce)(() => {
36
39
  onClose === null || onClose === void 0 ? void 0 : onClose();
37
40
  }, 300);
38
41
  return ReactDOM.createPortal(react_1.default.createElement("div", { className: 'modal-bg', style: Object.assign({ display: isShow ? 'flex' : 'none', backgroundColor: visible ? 'rgba(0, 0, 0, 0.7)' : 'rgba(0, 0, 0, 0)' }, modalStyle), onClick: handleClose },
39
- react_1.default.createElement("div", { className: `modal-container ${visible ? 'modal-popIn' : 'modal-popOut'}`, style: { padding }, onClick: (e) => {
42
+ react_1.default.createElement("div", { className: `modal-container ${visible ? 'modal-popIn' : 'modal-popOut'}`, style: { padding, animationDuration: (cssAni === null || cssAni === void 0 ? void 0 : cssAni.duration) / 1000 + 's' }, onClick: (e) => {
40
43
  e.stopPropagation();
41
44
  e.preventDefault();
42
45
  } },
@@ -0,0 +1,24 @@
1
+ import { FC } from 'react';
2
+ interface IProps {
3
+ nudge?: {
4
+ isOpen: boolean;
5
+ icon?: string;
6
+ backgroundColor: string;
7
+ content?: string;
8
+ marginBottom: number;
9
+ borderRadius: number;
10
+ size: {
11
+ height: number;
12
+ width: number;
13
+ };
14
+ textStyle: {
15
+ color: string;
16
+ fontFamily: string;
17
+ fontSize: number;
18
+ fontStyle: string;
19
+ textAlign: string;
20
+ };
21
+ };
22
+ }
23
+ declare const Nudge: FC<IProps>;
24
+ export default Nudge;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const react_1 = tslib_1.__importDefault(require("react"));
5
+ const Nudge = ({ nudge }) => {
6
+ return (react_1.default.createElement("div", { hidden: !(nudge === null || nudge === void 0 ? void 0 : nudge.isOpen), className: 'clc-sxp-bottom-nudge', style: {
7
+ marginBottom: nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom,
8
+ width: nudge === null || nudge === void 0 ? void 0 : nudge.size.width,
9
+ height: nudge === null || nudge === void 0 ? void 0 : nudge.size.height,
10
+ backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
11
+ borderRadius: nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius
12
+ } },
13
+ (nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? react_1.default.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover' } }) : null,
14
+ react_1.default.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, nudge === null || nudge === void 0 ? void 0 : nudge.content)));
15
+ };
16
+ exports.default = Nudge;