pb-sxp-ui 1.1.2 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/dist/index.cjs +2260 -861
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +356 -175
  4. package/dist/index.js +2260 -861
  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 +2260 -861
  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/Pagebuilder/type.d.ts +1 -0
  15. package/es/core/components/SxpPageRender/FingerSwipeTip/index.d.ts +0 -1
  16. package/es/core/components/SxpPageRender/FingerSwipeTip/index.js +3 -3
  17. package/es/core/components/SxpPageRender/Hashtag/index.js +1 -3
  18. package/es/core/components/SxpPageRender/Modal/index.d.ts +3 -0
  19. package/es/core/components/SxpPageRender/Modal/index.js +70 -6
  20. package/es/core/components/SxpPageRender/Navbar.js +1 -1
  21. package/es/core/components/SxpPageRender/Popup/index.js +1 -1
  22. package/es/core/components/SxpPageRender/RenderCard.d.ts +1 -0
  23. package/es/core/components/SxpPageRender/RenderCard.js +16 -12
  24. package/es/core/components/SxpPageRender/VideoWidget/index.js +10 -13
  25. package/es/core/components/SxpPageRender/WaterFall/List.js +1 -1
  26. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +1 -1
  27. package/es/core/components/SxpPageRender/index.d.ts +3 -3
  28. package/es/core/components/SxpPageRender/index.js +51 -17
  29. package/es/core/components/SxpPageRender/typing.d.ts +1 -0
  30. package/es/core/context/SxpDataSourceProvider.d.ts +1 -0
  31. package/es/core/context/SxpDataSourceProvider.js +6 -3
  32. package/es/core/utils/localStore.d.ts +3 -0
  33. package/es/core/utils/localStore.js +8 -0
  34. package/es/materials/sxp/HashTag/material.js +1 -2
  35. package/es/materials/sxp/cta/AniLink/index.d.ts +14 -0
  36. package/es/materials/sxp/cta/AniLink/index.js +58 -0
  37. package/es/materials/sxp/cta/AniLink/interactionRender.d.ts +42 -0
  38. package/es/materials/sxp/cta/AniLink/interactionRender.js +50 -0
  39. package/es/materials/sxp/cta/AniLink/material.d.ts +2 -0
  40. package/es/materials/sxp/cta/AniLink/material.js +38 -0
  41. package/es/materials/sxp/cta/AniLink/settingRender.d.ts +73 -0
  42. package/es/materials/sxp/cta/AniLink/settingRender.js +103 -0
  43. package/es/materials/sxp/cta/AniLinkPopup/index.d.ts +17 -0
  44. package/es/materials/sxp/cta/AniLinkPopup/index.js +65 -0
  45. package/es/materials/sxp/cta/AniLinkPopup/interactionRender.d.ts +42 -0
  46. package/es/materials/sxp/cta/AniLinkPopup/interactionRender.js +50 -0
  47. package/es/materials/sxp/cta/AniLinkPopup/material.d.ts +2 -0
  48. package/es/materials/sxp/cta/AniLinkPopup/material.js +52 -0
  49. package/es/materials/sxp/cta/AniLinkPopup/settingRender.d.ts +176 -0
  50. package/es/materials/sxp/cta/AniLinkPopup/settingRender.js +249 -0
  51. package/es/materials/sxp/cta/index.d.ts +2 -0
  52. package/es/materials/sxp/cta/index.js +2 -0
  53. package/es/materials/sxp/index.d.ts +1 -0
  54. package/es/materials/sxp/index.js +1 -0
  55. package/es/materials/sxp/popup/AppointForm/Form.js +1 -1
  56. package/es/materials/sxp/popup/CommodityDetail/index.d.ts +5 -0
  57. package/es/materials/sxp/popup/CommodityDetail/index.js +43 -26
  58. package/es/materials/sxp/popup/CommodityDetail/interactionRender.d.ts +9 -0
  59. package/es/materials/sxp/popup/CommodityDetail/interactionRender.js +12 -0
  60. package/es/materials/sxp/popup/CommodityDetail/material.js +3 -1
  61. package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +37 -0
  62. package/es/materials/sxp/popup/CommodityDetail/settingRender.js +41 -0
  63. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +5 -0
  64. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +11 -25
  65. package/es/materials/sxp/popup/CommodityDetailDiroNew/interactionRender.d.ts +9 -0
  66. package/es/materials/sxp/popup/CommodityDetailDiroNew/interactionRender.js +12 -0
  67. package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +3 -1
  68. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +37 -0
  69. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +41 -0
  70. package/es/materials/sxp/popup/CommodityList/index.d.ts +28 -0
  71. package/es/materials/sxp/popup/CommodityList/index.js +56 -0
  72. package/es/materials/sxp/popup/CommodityList/interactionRender.d.ts +8 -0
  73. package/es/materials/sxp/popup/CommodityList/interactionRender.js +11 -0
  74. package/es/materials/sxp/popup/CommodityList/material.d.ts +2 -0
  75. package/es/materials/sxp/popup/CommodityList/material.js +51 -0
  76. package/es/materials/sxp/popup/CommodityList/settingRender.d.ts +151 -0
  77. package/es/materials/sxp/popup/CommodityList/settingRender.js +207 -0
  78. package/es/materials/sxp/popup/index.d.ts +1 -0
  79. package/es/materials/sxp/popup/index.js +1 -0
  80. package/es/materials/sxp/template/Link/index.js +2 -2
  81. package/es/materials/sxp/template/MultiCommodity/index.js +2 -2
  82. package/es/materials/sxp/template/MultiCommodityDiro/index.js +2 -2
  83. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +5 -4
  84. package/es/materials/sxp/template/components/CommodityGroup.d.ts +14 -0
  85. package/es/materials/sxp/template/components/CommodityGroup.js +31 -0
  86. package/es/materials/sxp/template/components/Img.js +1 -1
  87. package/es/materials/sxp/template/components/Scroll.d.ts +2 -1
  88. package/es/materials/sxp/template/components/Scroll.js +10 -3
  89. package/es/materials/sxp/template/components/settingRender.js +0 -5
  90. package/lib/core/Pagebuilder/type.d.ts +1 -0
  91. package/lib/core/components/SxpPageRender/FingerSwipeTip/index.d.ts +0 -1
  92. package/lib/core/components/SxpPageRender/FingerSwipeTip/index.js +3 -3
  93. package/lib/core/components/SxpPageRender/Hashtag/index.js +1 -3
  94. package/lib/core/components/SxpPageRender/Modal/index.d.ts +3 -0
  95. package/lib/core/components/SxpPageRender/Modal/index.js +70 -6
  96. package/lib/core/components/SxpPageRender/Navbar.js +1 -1
  97. package/lib/core/components/SxpPageRender/Popup/index.js +1 -1
  98. package/lib/core/components/SxpPageRender/RenderCard.d.ts +1 -0
  99. package/lib/core/components/SxpPageRender/RenderCard.js +16 -12
  100. package/lib/core/components/SxpPageRender/VideoWidget/index.js +10 -13
  101. package/lib/core/components/SxpPageRender/WaterFall/List.js +1 -1
  102. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +1 -1
  103. package/lib/core/components/SxpPageRender/index.d.ts +3 -3
  104. package/lib/core/components/SxpPageRender/index.js +50 -16
  105. package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
  106. package/lib/core/context/SxpDataSourceProvider.d.ts +1 -0
  107. package/lib/core/context/SxpDataSourceProvider.js +6 -3
  108. package/lib/core/utils/localStore.d.ts +3 -0
  109. package/lib/core/utils/localStore.js +11 -1
  110. package/lib/materials/sxp/HashTag/material.js +1 -2
  111. package/lib/materials/sxp/cta/AniLink/index.d.ts +14 -0
  112. package/lib/materials/sxp/cta/AniLink/index.js +60 -0
  113. package/lib/materials/sxp/cta/AniLink/interactionRender.d.ts +42 -0
  114. package/lib/materials/sxp/cta/AniLink/interactionRender.js +52 -0
  115. package/lib/materials/sxp/cta/AniLink/material.d.ts +2 -0
  116. package/lib/materials/sxp/cta/AniLink/material.js +42 -0
  117. package/lib/materials/sxp/cta/AniLink/settingRender.d.ts +73 -0
  118. package/lib/materials/sxp/cta/AniLink/settingRender.js +105 -0
  119. package/lib/materials/sxp/cta/AniLinkPopup/index.d.ts +17 -0
  120. package/lib/materials/sxp/cta/AniLinkPopup/index.js +67 -0
  121. package/lib/materials/sxp/cta/AniLinkPopup/interactionRender.d.ts +42 -0
  122. package/lib/materials/sxp/cta/AniLinkPopup/interactionRender.js +52 -0
  123. package/lib/materials/sxp/cta/AniLinkPopup/material.d.ts +2 -0
  124. package/lib/materials/sxp/cta/AniLinkPopup/material.js +56 -0
  125. package/lib/materials/sxp/cta/AniLinkPopup/settingRender.d.ts +176 -0
  126. package/lib/materials/sxp/cta/AniLinkPopup/settingRender.js +251 -0
  127. package/lib/materials/sxp/cta/index.d.ts +2 -0
  128. package/lib/materials/sxp/cta/index.js +5 -0
  129. package/lib/materials/sxp/index.d.ts +1 -0
  130. package/lib/materials/sxp/index.js +1 -0
  131. package/lib/materials/sxp/popup/AppointForm/Form.js +1 -1
  132. package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +5 -0
  133. package/lib/materials/sxp/popup/CommodityDetail/index.js +43 -26
  134. package/lib/materials/sxp/popup/CommodityDetail/interactionRender.d.ts +9 -0
  135. package/lib/materials/sxp/popup/CommodityDetail/interactionRender.js +14 -0
  136. package/lib/materials/sxp/popup/CommodityDetail/material.js +3 -1
  137. package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +37 -0
  138. package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +41 -0
  139. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +5 -0
  140. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +11 -25
  141. package/lib/materials/sxp/popup/CommodityDetailDiroNew/interactionRender.d.ts +9 -0
  142. package/lib/materials/sxp/popup/CommodityDetailDiroNew/interactionRender.js +14 -0
  143. package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +3 -1
  144. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +37 -0
  145. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +41 -0
  146. package/lib/materials/sxp/popup/CommodityList/index.d.ts +28 -0
  147. package/lib/materials/sxp/popup/CommodityList/index.js +58 -0
  148. package/lib/materials/sxp/popup/CommodityList/interactionRender.d.ts +8 -0
  149. package/lib/materials/sxp/popup/CommodityList/interactionRender.js +13 -0
  150. package/lib/materials/sxp/popup/CommodityList/material.d.ts +2 -0
  151. package/lib/materials/sxp/popup/CommodityList/material.js +55 -0
  152. package/lib/materials/sxp/popup/CommodityList/settingRender.d.ts +151 -0
  153. package/lib/materials/sxp/popup/CommodityList/settingRender.js +209 -0
  154. package/lib/materials/sxp/popup/index.d.ts +1 -0
  155. package/lib/materials/sxp/popup/index.js +1 -0
  156. package/lib/materials/sxp/template/Link/index.js +2 -2
  157. package/lib/materials/sxp/template/MultiCommodity/index.js +2 -2
  158. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +2 -2
  159. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +5 -4
  160. package/lib/materials/sxp/template/components/CommodityGroup.d.ts +14 -0
  161. package/lib/materials/sxp/template/components/CommodityGroup.js +34 -0
  162. package/lib/materials/sxp/template/components/Img.js +1 -1
  163. package/lib/materials/sxp/template/components/Scroll.d.ts +2 -1
  164. package/lib/materials/sxp/template/components/Scroll.js +9 -2
  165. package/lib/materials/sxp/template/components/settingRender.js +0 -5
  166. package/package.json +1 -1
@@ -17,8 +17,7 @@ const HashTag = createMaterial(HashTagComponent, {
17
17
  textStyles: {
18
18
  hashTagTitle: {
19
19
  fontSize: 16,
20
- color: '#000',
21
- textAlign: 'center'
20
+ color: '#000'
22
21
  },
23
22
  hashTagDesc: {
24
23
  fontSize: 12,
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { ICtaTempStylesType } from '../../template/components/typing';
3
+ import { RecItemType } from '../../../../core/components/SxpPageRender/typing';
4
+ export interface IAniLinkProps {
5
+ style?: Record<string, any>;
6
+ recData?: RecItemType;
7
+ ctaTempStyles?: ICtaTempStylesType;
8
+ index?: number;
9
+ event?: any;
10
+ onClick?: () => void;
11
+ isExternalLink?: boolean;
12
+ }
13
+ declare const _default: React.NamedExoticComponent<IAniLinkProps>;
14
+ export default _default;
@@ -0,0 +1,58 @@
1
+ import { __rest } from "tslib";
2
+ import { css } from '@emotion/css';
3
+ import React, { memo, useEffect, useMemo, useRef } from 'react';
4
+ import { useSxpDataSource } from '../../../../core/hooks';
5
+ import { useEventReport } from '../../../../core/hooks/useEventReport';
6
+ import { setFontForText } from '../../../../core/utils/tool';
7
+ import styles from './index.module.less';
8
+ import useOnScreen from '../../../../core/hooks/useOnScreen';
9
+ const AniLink = (_a) => {
10
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k;
11
+ var { style, recData, ctaTempStyles, index, event, onClick, isExternalLink = false } = _a, props = __rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "onClick", "isExternalLink"]);
12
+ const { ctaEvent } = useSxpDataSource();
13
+ const { jumpToWeb } = useEventReport();
14
+ const ref = useRef(null);
15
+ const isOnScreen = useOnScreen(ref);
16
+ const cta = ((_d = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.bindCta) || ((_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.bindCta) || ((_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindCta);
17
+ const product = ((_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.bindProducts) === null || _j === void 0 ? void 0 : _j[0]) || ((_k = recData === null || recData === void 0 ? void 0 : recData.video) === null || _k === void 0 ? void 0 : _k.bindProduct);
18
+ const handleTo = () => {
19
+ var _a, _b, _c;
20
+ const item = ((_b = (_a = recData === null || recData === void 0 ? void 0 : recData.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct) || (recData === null || recData === void 0 ? void 0 : recData.video);
21
+ ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
22
+ eventSubject: 'clickCta',
23
+ eventDescription: 'User clicked the CTA'
24
+ }, recData, item, index);
25
+ if (isExternalLink) {
26
+ jumpToWeb(recData, product, cta, index);
27
+ }
28
+ onClick === null || onClick === void 0 ? void 0 : onClick();
29
+ };
30
+ const title = (cta === null || cta === void 0 ? void 0 : cta.title) || '查看详情 >';
31
+ const aniStyle = useMemo(() => {
32
+ var _a, _b;
33
+ const ani = event === null || event === void 0 ? void 0 : event.animation;
34
+ if (ani) {
35
+ const { delay, duration, backgroundColor } = ani;
36
+ return {
37
+ ':after': {
38
+ animationDelay: `${(_a = delay / 1000) !== null && _a !== void 0 ? _a : 0}s`,
39
+ animationDuration: `${(_b = duration / 1000) !== null && _b !== void 0 ? _b : 0}s`,
40
+ backgroundColor: `${backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : 'transparent'}`
41
+ }
42
+ };
43
+ }
44
+ }, [event === null || event === void 0 ? void 0 : event.animation]);
45
+ useEffect(() => {
46
+ if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
47
+ ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
48
+ eventSubject: 'ctaExposure',
49
+ eventDescription: 'The cta was shown to the user'
50
+ }, recData, product, index);
51
+ }
52
+ }, [isOnScreen]);
53
+ return (React.createElement("div", Object.assign({ ref: ref, style: Object.assign(Object.assign({}, style), { display: 'flex', alignItems: 'center' }) }, props, { className: `${styles['animated-button']} ${css(aniStyle)}`, onClick: handleTo }),
54
+ React.createElement("div", { className: 'one-line-ellipsis', style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle, dangerouslySetInnerHTML: {
55
+ __html: setFontForText(title, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
56
+ } })));
57
+ };
58
+ export default memo(AniLink);
@@ -0,0 +1,42 @@
1
+ declare const _default: ({
2
+ title: string;
3
+ child: {
4
+ type: string;
5
+ name: string;
6
+ }[];
7
+ } | {
8
+ title: string;
9
+ child: ({
10
+ type: string;
11
+ name: string[];
12
+ label: string;
13
+ options?: undefined;
14
+ initialValue?: undefined;
15
+ fieldProps?: undefined;
16
+ addonAfter?: undefined;
17
+ } | {
18
+ type: string;
19
+ name: string[];
20
+ label: string;
21
+ options: {
22
+ label: string;
23
+ value: number;
24
+ }[];
25
+ initialValue: number;
26
+ fieldProps: {
27
+ style: {
28
+ width: string;
29
+ };
30
+ };
31
+ addonAfter?: undefined;
32
+ } | {
33
+ type: string;
34
+ label: string;
35
+ name: string[];
36
+ addonAfter: string;
37
+ options?: undefined;
38
+ initialValue?: undefined;
39
+ fieldProps?: undefined;
40
+ })[];
41
+ })[];
42
+ export default _default;
@@ -0,0 +1,50 @@
1
+ export default [
2
+ {
3
+ title: '点击事件',
4
+ child: [
5
+ {
6
+ type: 'link',
7
+ name: 'onClick'
8
+ }
9
+ ]
10
+ },
11
+ {
12
+ title: '动画效果',
13
+ child: [
14
+ {
15
+ type: 'Color',
16
+ name: ['animation', 'backgroundColor'],
17
+ label: '动画颜色'
18
+ },
19
+ {
20
+ type: 'Select',
21
+ name: ['animation', 'name'],
22
+ label: '动画',
23
+ options: [
24
+ {
25
+ label: '由左向右/中间扩散',
26
+ value: 1
27
+ }
28
+ ],
29
+ initialValue: 1,
30
+ fieldProps: {
31
+ style: {
32
+ width: '100%'
33
+ }
34
+ }
35
+ },
36
+ {
37
+ type: 'Number',
38
+ label: '动画启动时间',
39
+ name: ['animation', 'delay'],
40
+ addonAfter: 'ms'
41
+ },
42
+ {
43
+ type: 'Number',
44
+ label: '动画持续时间',
45
+ name: ['animation', 'duration'],
46
+ addonAfter: 'ms'
47
+ }
48
+ ]
49
+ }
50
+ ];
@@ -0,0 +1,2 @@
1
+ declare const AniLink: import("../../../../core/create").MaterialComponet<import(".").IAniLinkProps>;
2
+ export { AniLink };
@@ -0,0 +1,38 @@
1
+ import settingRender from './settingRender';
2
+ import AniLinkComponent from '.';
3
+ import { createMaterial } from '../../../../core/create';
4
+ import interactionRender from './interactionRender';
5
+ const AniLink = createMaterial(AniLinkComponent, {
6
+ displayName: '纯色动效CTA',
7
+ icon: '',
8
+ category: 'cta',
9
+ type: 'AniLink',
10
+ related: {
11
+ settingRender: settingRender,
12
+ bindableProps: [],
13
+ interactionRender
14
+ },
15
+ defaulSetting: {
16
+ props: {
17
+ ctaTempStyles: {
18
+ ctaTitle: {
19
+ fontSize: 15,
20
+ color: '#fff',
21
+ textAlign: 'left'
22
+ }
23
+ }
24
+ },
25
+ style: {
26
+ width: 236,
27
+ height: 44,
28
+ borderRadius: 3,
29
+ backgroundColor: 'rgba(0,0,0,.3)',
30
+ paddingLeft: 7,
31
+ paddingRight: 7
32
+ }
33
+ },
34
+ w: 100,
35
+ h: 40,
36
+ sort: 1
37
+ });
38
+ export { AniLink };
@@ -0,0 +1,73 @@
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
+ direction?: 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
+ direction?: undefined;
29
+ } | {
30
+ type: string;
31
+ label: string;
32
+ name: string[];
33
+ child?: undefined;
34
+ direction?: undefined;
35
+ } | {
36
+ type: string;
37
+ name: string[];
38
+ label: string;
39
+ direction: string;
40
+ child?: undefined;
41
+ })[];
42
+ } | {
43
+ title: string;
44
+ child: ({
45
+ type: string;
46
+ label: string;
47
+ child: {
48
+ type: string;
49
+ name: string[];
50
+ bottomText: string;
51
+ }[];
52
+ name?: undefined;
53
+ } | {
54
+ type: string;
55
+ label: string;
56
+ child: ({
57
+ type: string;
58
+ name: string[];
59
+ addonAfter?: undefined;
60
+ } | {
61
+ type: string;
62
+ addonAfter: string;
63
+ name: string[];
64
+ })[];
65
+ name?: undefined;
66
+ } | {
67
+ label: string;
68
+ type: string;
69
+ name: string[];
70
+ child?: undefined;
71
+ })[];
72
+ })[];
73
+ export default _default;
@@ -0,0 +1,103 @@
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
+ type: 'TextMargin',
45
+ name: ['style'],
46
+ label: '上下边距',
47
+ direction: 'vertical'
48
+ },
49
+ {
50
+ type: 'TextPadding',
51
+ name: ['style'],
52
+ label: '内边距',
53
+ direction: 'horizontal'
54
+ }
55
+ ]
56
+ },
57
+ {
58
+ title: 'CTA标题',
59
+ child: [
60
+ {
61
+ type: 'Group',
62
+ label: '字体',
63
+ child: [
64
+ {
65
+ type: 'Select',
66
+ name: ['props', 'ctaTempStyles', 'ctaTitle', 'fontFamily-cn'],
67
+ bottomText: '中文字体'
68
+ },
69
+ {
70
+ type: 'Select',
71
+ name: ['props', 'ctaTempStyles', 'ctaTitle', 'fontFamily-en'],
72
+ bottomText: '英文/其他字体'
73
+ }
74
+ ]
75
+ },
76
+ {
77
+ type: 'Group',
78
+ label: '',
79
+ child: [
80
+ {
81
+ type: 'Color',
82
+ name: ['props', 'ctaTempStyles', 'ctaTitle', 'color']
83
+ },
84
+ {
85
+ type: 'Number',
86
+ addonAfter: 'px',
87
+ name: ['props', 'ctaTempStyles', 'ctaTitle', 'fontSize']
88
+ }
89
+ ]
90
+ },
91
+ {
92
+ label: '样式',
93
+ type: 'TextStyle',
94
+ name: ['props', 'ctaTempStyles', 'ctaTitle']
95
+ },
96
+ {
97
+ label: '对齐',
98
+ type: 'TextAlign',
99
+ name: ['props', 'ctaTempStyles', 'ctaTitle']
100
+ }
101
+ ]
102
+ }
103
+ ];
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { ICtaTempStylesType } from '../../template/components/typing';
3
+ import { RecItemType } from '../../../../core/components/SxpPageRender/typing';
4
+ export interface IAniLinkPopupProps {
5
+ style?: Record<string, any>;
6
+ recData?: RecItemType;
7
+ ctaTempStyles?: ICtaTempStylesType;
8
+ index?: number;
9
+ event?: any;
10
+ translateY?: number;
11
+ bottom_image?: string;
12
+ isTel?: boolean;
13
+ onClick?: () => void;
14
+ isExternalLink?: boolean;
15
+ }
16
+ declare const _default: React.NamedExoticComponent<IAniLinkPopupProps>;
17
+ export default _default;
@@ -0,0 +1,65 @@
1
+ import { __rest } from "tslib";
2
+ import { css } from '@emotion/css';
3
+ import React, { memo, useMemo, useState } from 'react';
4
+ import { useSxpDataSource } from '../../../../core/hooks';
5
+ import { useEventReport } from '../../../../core/hooks/useEventReport';
6
+ import Img from '../../template/components/Img';
7
+ import { setFontForText } from '../../../../core/utils/tool';
8
+ import styles from './index.module.less';
9
+ const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
10
+ const AniLinkPopup = (_a) => {
11
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
12
+ var { style, recData, ctaTempStyles, index, event, bottom_image, translateY, isTel, onClick, isExternalLink = false } = _a, props = __rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "bottom_image", "translateY", "isTel", "onClick", "isExternalLink"]);
13
+ const { sxpParameter, globalConfig, ctaEvent } = useSxpDataSource();
14
+ const { jumpToWeb } = useEventReport();
15
+ const [visible, setVisible] = useState(true);
16
+ const cta = ((_d = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.bindCta) || ((_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.bindCta) || ((_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindCta);
17
+ const product = ((_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.bindProducts) === null || _j === void 0 ? void 0 : _j[0]) || ((_k = recData === null || recData === void 0 ? void 0 : recData.video) === null || _k === void 0 ? void 0 : _k.bindProduct);
18
+ const handleTo = () => {
19
+ var _a, _b, _c;
20
+ const item = ((_b = (_a = recData === null || recData === void 0 ? void 0 : recData.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct) || (recData === null || recData === void 0 ? void 0 : recData.video);
21
+ ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
22
+ eventSubject: 'clickCta',
23
+ eventDescription: 'User clicked the CTA'
24
+ }, recData, item, index);
25
+ if (isExternalLink) {
26
+ jumpToWeb(recData, product, cta, index);
27
+ }
28
+ onClick === null || onClick === void 0 ? void 0 : onClick();
29
+ };
30
+ const title = (cta === null || cta === void 0 ? void 0 : cta.title) || '查看详情 >';
31
+ const aniStyle = useMemo(() => {
32
+ var _a, _b;
33
+ const ani = event === null || event === void 0 ? void 0 : event.animation;
34
+ if (ani) {
35
+ const { delay, duration, backgroundColor } = ani;
36
+ return {
37
+ ':after': {
38
+ animationDelay: `${(_a = delay / 1000) !== null && _a !== void 0 ? _a : 0}s`,
39
+ animationDuration: `${(_b = duration / 1000) !== null && _b !== void 0 ? _b : 0}s`,
40
+ backgroundColor: `${backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : 'transparent'}`
41
+ }
42
+ };
43
+ }
44
+ }, [event === null || event === void 0 ? void 0 : event.animation]);
45
+ const src = (_q = (_p = (_o = (_l = product === null || product === void 0 ? void 0 : product.cover) !== null && _l !== void 0 ? _l : (_m = product === null || product === void 0 ? void 0 : product.homePage) === null || _m === void 0 ? void 0 : _m[0]) !== null && _o !== void 0 ? _o : cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _p !== void 0 ? _p : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _q !== void 0 ? _q : bottom_image;
46
+ const onClose = (event) => {
47
+ event.stopPropagation();
48
+ setVisible(false);
49
+ };
50
+ return (React.createElement(React.Fragment, null, isTel ? (React.createElement("div", { style: {
51
+ height: '40px',
52
+ lineHeight: '40px',
53
+ paddingLeft: '6px'
54
+ } }, "Cta Title")) : (React.createElement("div", Object.assign({ style: Object.assign(Object.assign({}, style), { position: 'fixed', right: 0, bottom: 0, zIndex: 1000, display: visible ? 'block' : 'none' }) }, props, { className: `${styles['animated-button']} ${css(aniStyle)}`, onClick: handleTo }),
55
+ React.createElement("div", { onClick: onClose, className: styles['modal-icon-wrapper'], style: { padding: (_r = style === null || style === void 0 ? void 0 : style['padding']) !== null && _r !== void 0 ? _r : 0 } },
56
+ React.createElement("img", { src: (_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _s !== void 0 ? _s : closeIcon, alt: 'close', className: styles['modal-icon-wrapper-img'] })),
57
+ React.createElement(Img, { 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 }),
58
+ React.createElement("div", { hidden: !!recData && !(product === null || product === void 0 ? void 0 : product.title), className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
59
+ __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)
60
+ } }),
61
+ React.createElement("div", { className: '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: {
62
+ __html: setFontForText(title, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
63
+ } })))));
64
+ };
65
+ export default memo(AniLinkPopup);
@@ -0,0 +1,42 @@
1
+ declare const _default: ({
2
+ title: string;
3
+ child: {
4
+ type: string;
5
+ name: string;
6
+ }[];
7
+ } | {
8
+ title: string;
9
+ child: ({
10
+ type: string;
11
+ name: string[];
12
+ label: string;
13
+ options?: undefined;
14
+ initialValue?: undefined;
15
+ fieldProps?: undefined;
16
+ addonAfter?: undefined;
17
+ } | {
18
+ type: string;
19
+ name: string[];
20
+ label: string;
21
+ options: {
22
+ label: string;
23
+ value: number;
24
+ }[];
25
+ initialValue: number;
26
+ fieldProps: {
27
+ style: {
28
+ width: string;
29
+ };
30
+ };
31
+ addonAfter?: undefined;
32
+ } | {
33
+ type: string;
34
+ label: string;
35
+ name: string[];
36
+ addonAfter: string;
37
+ options?: undefined;
38
+ initialValue?: undefined;
39
+ fieldProps?: undefined;
40
+ })[];
41
+ })[];
42
+ export default _default;
@@ -0,0 +1,50 @@
1
+ export default [
2
+ {
3
+ title: '点击事件',
4
+ child: [
5
+ {
6
+ type: 'link',
7
+ name: 'onClick'
8
+ }
9
+ ]
10
+ },
11
+ {
12
+ title: '动画效果',
13
+ child: [
14
+ {
15
+ type: 'Color',
16
+ name: ['animation', 'backgroundColor'],
17
+ label: '动画颜色'
18
+ },
19
+ {
20
+ type: 'Select',
21
+ name: ['animation', 'name'],
22
+ label: '动画',
23
+ options: [
24
+ {
25
+ label: '由左向右/中间扩散',
26
+ value: 1
27
+ }
28
+ ],
29
+ initialValue: 1,
30
+ fieldProps: {
31
+ style: {
32
+ width: '100%'
33
+ }
34
+ }
35
+ },
36
+ {
37
+ type: 'Number',
38
+ label: '动画启动时间',
39
+ name: ['animation', 'delay'],
40
+ addonAfter: 'ms'
41
+ },
42
+ {
43
+ type: 'Number',
44
+ label: '动画持续时间',
45
+ name: ['animation', 'duration'],
46
+ addonAfter: 'ms'
47
+ }
48
+ ]
49
+ }
50
+ ];
@@ -0,0 +1,2 @@
1
+ declare const AniLinkPopup: import("../../../../core/create").MaterialComponet<import(".").IAniLinkPopupProps>;
2
+ export { AniLinkPopup };
@@ -0,0 +1,52 @@
1
+ import settingRender from './settingRender';
2
+ import AniLinkPopupComponent from '.';
3
+ import { createMaterial } from '../../../../core/create';
4
+ import interactionRender from './interactionRender';
5
+ const AniLinkPopup = createMaterial(AniLinkPopupComponent, {
6
+ displayName: '竖版弹窗CTA',
7
+ icon: '',
8
+ category: 'cta',
9
+ type: 'AniLinkPopup',
10
+ related: {
11
+ settingRender: settingRender,
12
+ bindableProps: [],
13
+ interactionRender
14
+ },
15
+ defaulSetting: {
16
+ props: {
17
+ ctaTempStyles: {
18
+ img: {
19
+ borderRadius: 3,
20
+ width: 76,
21
+ height: 76,
22
+ marginBottom: 10
23
+ },
24
+ title: {
25
+ fontSize: 12,
26
+ color: '#000',
27
+ textAlign: 'left'
28
+ },
29
+ ctaTitle: {
30
+ fontSize: 10,
31
+ color: '#fff',
32
+ textAlign: 'center',
33
+ width: 76,
34
+ height: 20,
35
+ backgroundColor: 'rgba(0,0,0,1)'
36
+ }
37
+ }
38
+ },
39
+ style: {
40
+ width: 90,
41
+ height: 160,
42
+ borderRadius: 3,
43
+ backgroundColor: 'rgba(255,255,255,1)',
44
+ padding: 7,
45
+ margin: 10
46
+ }
47
+ },
48
+ w: 100,
49
+ h: 40,
50
+ sort: 2
51
+ });
52
+ export { AniLinkPopup };