pb-sxp-ui 1.0.101 → 1.0.103
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.
- package/dist/index.cjs +311 -144
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +20 -3
- package/dist/index.js +312 -144
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +311 -144
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/Nudge/index.d.ts +2 -0
- package/es/core/components/SxpPageRender/Nudge/index.js +5 -2
- package/es/core/components/SxpPageRender/PictureGroup/index.js +10 -2
- package/es/core/components/SxpPageRender/VideoWidget/VideoPlayer.d.ts +1 -0
- package/es/core/components/SxpPageRender/VideoWidget/VideoPlayer.js +22 -0
- package/es/core/components/SxpPageRender/VideoWidget/index.d.ts +0 -1
- package/es/core/components/SxpPageRender/VideoWidget/index.js +93 -85
- package/es/core/components/SxpPageRender/index.d.ts +1 -0
- package/es/core/components/SxpPageRender/index.js +3 -25
- package/es/materials/sxp/popup/AppointForm/settingRender.js +2 -2
- package/es/materials/sxp/popup/Prompt/index.d.ts +1 -0
- package/es/materials/sxp/popup/Prompt/index.js +4 -2
- package/es/materials/sxp/popup/Prompt/settingRender.d.ts +12 -0
- package/es/materials/sxp/popup/Prompt/settingRender.js +33 -4
- package/es/materials/sxp/template/Link/index.d.ts +6 -1
- package/es/materials/sxp/template/Link/index.js +9 -5
- package/es/materials/sxp/template/Link/material.js +15 -1
- package/es/materials/sxp/template/Link/settingRender.d.ts +57 -0
- package/es/materials/sxp/template/Link/settingRender.js +102 -0
- package/lib/core/components/SxpPageRender/Nudge/index.d.ts +2 -0
- package/lib/core/components/SxpPageRender/Nudge/index.js +5 -2
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +10 -2
- package/lib/core/components/SxpPageRender/VideoWidget/VideoPlayer.d.ts +1 -0
- package/lib/core/components/SxpPageRender/VideoWidget/VideoPlayer.js +26 -0
- package/lib/core/components/SxpPageRender/VideoWidget/index.d.ts +0 -1
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +93 -85
- package/lib/core/components/SxpPageRender/index.d.ts +1 -0
- package/lib/core/components/SxpPageRender/index.js +3 -25
- package/lib/materials/sxp/popup/AppointForm/settingRender.js +2 -2
- package/lib/materials/sxp/popup/Prompt/index.d.ts +1 -0
- package/lib/materials/sxp/popup/Prompt/index.js +4 -2
- package/lib/materials/sxp/popup/Prompt/settingRender.d.ts +12 -0
- package/lib/materials/sxp/popup/Prompt/settingRender.js +33 -4
- package/lib/materials/sxp/template/Link/index.d.ts +6 -1
- package/lib/materials/sxp/template/Link/index.js +9 -5
- package/lib/materials/sxp/template/Link/material.js +15 -1
- package/lib/materials/sxp/template/Link/settingRender.d.ts +57 -0
- package/lib/materials/sxp/template/Link/settingRender.js +104 -0
- package/package.json +1 -1
@@ -14,9 +14,37 @@ export default [
|
|
14
14
|
name: ['props', 'content']
|
15
15
|
},
|
16
16
|
{
|
17
|
-
type: '
|
18
|
-
label: '
|
19
|
-
|
17
|
+
type: 'Group',
|
18
|
+
label: '内容字体',
|
19
|
+
child: [
|
20
|
+
{
|
21
|
+
type: 'Select',
|
22
|
+
name: ['props', 'contentStyle', 'fontFamily-cn'],
|
23
|
+
bottomText: '中文字体'
|
24
|
+
},
|
25
|
+
{
|
26
|
+
type: 'Select',
|
27
|
+
name: ['props', 'contentStyle', 'fontFamily-en'],
|
28
|
+
bottomText: '英文/其他字体'
|
29
|
+
}
|
30
|
+
]
|
31
|
+
},
|
32
|
+
{
|
33
|
+
type: 'Group',
|
34
|
+
label: '',
|
35
|
+
child: [
|
36
|
+
{
|
37
|
+
type: 'Color',
|
38
|
+
name: ['props', 'contentStyle', 'color'],
|
39
|
+
initialValue: '#000'
|
40
|
+
},
|
41
|
+
{
|
42
|
+
type: 'Number',
|
43
|
+
name: ['props', 'contentStyle', 'fontSize'],
|
44
|
+
addonAfter: 'px',
|
45
|
+
initialValue: 14
|
46
|
+
}
|
47
|
+
]
|
20
48
|
},
|
21
49
|
{
|
22
50
|
type: 'Group',
|
@@ -62,7 +90,8 @@ export default [
|
|
62
90
|
{
|
63
91
|
label: '提交按钮颜色',
|
64
92
|
type: 'Color',
|
65
|
-
name: ['props', 'submitButtonStyle', 'backgroundColor']
|
93
|
+
name: ['props', 'submitButtonStyle', 'backgroundColor'],
|
94
|
+
initialValue: '#000'
|
66
95
|
}
|
67
96
|
]
|
68
97
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { CSSProperties } from 'react';
|
2
2
|
import { ICtaTempStylesType } from '../components/typing';
|
3
3
|
import { RecItemType } from '../../../../core/components/SxpPageRender/typing';
|
4
4
|
export interface ILinkProps {
|
@@ -9,6 +9,11 @@ export interface ILinkProps {
|
|
9
9
|
bottom_image?: string;
|
10
10
|
ctaTempStyles?: ICtaTempStylesType;
|
11
11
|
index?: number;
|
12
|
+
customTitle?: {
|
13
|
+
style?: CSSProperties;
|
14
|
+
display?: boolean;
|
15
|
+
text?: string;
|
16
|
+
};
|
12
17
|
}
|
13
18
|
declare const _default: React.NamedExoticComponent<ILinkProps>;
|
14
19
|
export default _default;
|
@@ -8,8 +8,8 @@ import { useEventReport } from '../../../../core/hooks/useEventReport';
|
|
8
8
|
import Img from '../components/Img';
|
9
9
|
import { setFontForText } from '../../../../core/utils/tool';
|
10
10
|
const Link = (_a) => {
|
11
|
-
var _b, _c, _d, _e, _f, _g, _h;
|
12
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index"]);
|
11
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
12
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index, customTitle } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index", "customTitle"]);
|
13
13
|
const { sxpParameter, bffEventReport } = useSxpDataSource();
|
14
14
|
const { jumpToWeb } = useEventReport();
|
15
15
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
@@ -29,8 +29,12 @@ const Link = (_a) => {
|
|
29
29
|
width: '100%',
|
30
30
|
overflow: 'hidden'
|
31
31
|
}) },
|
32
|
-
React.createElement("div",
|
33
|
-
|
34
|
-
|
32
|
+
React.createElement("div", null,
|
33
|
+
React.createElement("div", { className: (customTitle === null || customTitle === void 0 ? void 0 : customTitle.display) ? styles['one-line-ellipsis'] : styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle, dangerouslySetInnerHTML: {
|
34
|
+
__html: setFontForText((_h = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _h !== void 0 ? _h : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
|
35
|
+
} }),
|
36
|
+
(customTitle === null || customTitle === void 0 ? void 0 : customTitle.display) && (React.createElement("div", { style: Object.assign(Object.assign({}, customTitle === null || customTitle === void 0 ? void 0 : customTitle.style), { lineHeight: ((_j = customTitle === null || customTitle === void 0 ? void 0 : customTitle.style) === null || _j === void 0 ? void 0 : _j.height) + 'px' }), className: styles['one-line-ellipsis'], dangerouslySetInnerHTML: {
|
37
|
+
__html: setFontForText(customTitle === null || customTitle === void 0 ? void 0 : customTitle.text, customTitle === null || customTitle === void 0 ? void 0 : customTitle.style)
|
38
|
+
} }))))));
|
35
39
|
};
|
36
40
|
export default memo(Link);
|
@@ -1,4 +1,6 @@
|
|
1
|
+
var _a;
|
1
2
|
import settingRender from '../components/settingRender';
|
3
|
+
import linkSettingRender from './settingRender';
|
2
4
|
import LinkComponent from '.';
|
3
5
|
import { createMaterial } from '../../../../core/create';
|
4
6
|
const Link = createMaterial(LinkComponent, {
|
@@ -7,7 +9,7 @@ const Link = createMaterial(LinkComponent, {
|
|
7
9
|
category: 'template',
|
8
10
|
type: 'Link',
|
9
11
|
related: {
|
10
|
-
settingRender: settingRender === null || settingRender === void 0 ? void 0 : settingRender.filter((i) => i.type !== 'commodityTitle'),
|
12
|
+
settingRender: (_a = settingRender === null || settingRender === void 0 ? void 0 : settingRender.filter((i) => i.type !== 'commodityTitle')) === null || _a === void 0 ? void 0 : _a.concat(linkSettingRender),
|
11
13
|
bindableProps: []
|
12
14
|
},
|
13
15
|
defaulSetting: {
|
@@ -26,6 +28,18 @@ const Link = createMaterial(LinkComponent, {
|
|
26
28
|
width: 130,
|
27
29
|
height: 20
|
28
30
|
}
|
31
|
+
},
|
32
|
+
customTitle: {
|
33
|
+
style: {
|
34
|
+
textAlign: 'left',
|
35
|
+
textDecoration: 'underline',
|
36
|
+
fontWeight: 'bold',
|
37
|
+
width: 130,
|
38
|
+
height: 20,
|
39
|
+
fontSize: 12,
|
40
|
+
color: '#000'
|
41
|
+
},
|
42
|
+
text: '探索更多'
|
29
43
|
}
|
30
44
|
},
|
31
45
|
style: {
|
@@ -0,0 +1,57 @@
|
|
1
|
+
declare const _default: {
|
2
|
+
title: string;
|
3
|
+
child: ({
|
4
|
+
type: string;
|
5
|
+
label: string;
|
6
|
+
name: string[];
|
7
|
+
child?: undefined;
|
8
|
+
addonAfter?: undefined;
|
9
|
+
} | {
|
10
|
+
type: string;
|
11
|
+
label: string;
|
12
|
+
child: ({
|
13
|
+
type: string;
|
14
|
+
name: string[];
|
15
|
+
max: number;
|
16
|
+
addonAfter?: undefined;
|
17
|
+
} | {
|
18
|
+
type: string;
|
19
|
+
name: string[];
|
20
|
+
addonAfter: string;
|
21
|
+
max: number;
|
22
|
+
})[];
|
23
|
+
name?: undefined;
|
24
|
+
addonAfter?: undefined;
|
25
|
+
} | {
|
26
|
+
type: string;
|
27
|
+
label: string;
|
28
|
+
child: {
|
29
|
+
type: string;
|
30
|
+
name: string[];
|
31
|
+
bottomText: string;
|
32
|
+
}[];
|
33
|
+
name?: undefined;
|
34
|
+
addonAfter?: undefined;
|
35
|
+
} | {
|
36
|
+
type: string;
|
37
|
+
label: string;
|
38
|
+
child: ({
|
39
|
+
type: string;
|
40
|
+
name: string[];
|
41
|
+
addonAfter?: undefined;
|
42
|
+
} | {
|
43
|
+
type: string;
|
44
|
+
addonAfter: string;
|
45
|
+
name: string[];
|
46
|
+
})[];
|
47
|
+
name?: undefined;
|
48
|
+
addonAfter?: undefined;
|
49
|
+
} | {
|
50
|
+
label: string;
|
51
|
+
type: string;
|
52
|
+
name: string[];
|
53
|
+
addonAfter: string;
|
54
|
+
child?: undefined;
|
55
|
+
})[];
|
56
|
+
}[];
|
57
|
+
export default _default;
|
@@ -0,0 +1,102 @@
|
|
1
|
+
export default [
|
2
|
+
{
|
3
|
+
title: '自定义标题',
|
4
|
+
child: [
|
5
|
+
{
|
6
|
+
type: 'Switch',
|
7
|
+
label: '自定义标题开关',
|
8
|
+
name: ['props', 'customTitle', 'display']
|
9
|
+
},
|
10
|
+
{
|
11
|
+
type: 'Text',
|
12
|
+
label: '标题文案',
|
13
|
+
name: ['props', 'customTitle', 'text']
|
14
|
+
},
|
15
|
+
{
|
16
|
+
type: 'Group',
|
17
|
+
label: '尺寸',
|
18
|
+
child: [
|
19
|
+
{
|
20
|
+
type: 'Number',
|
21
|
+
name: ['props', 'customTitle', 'style', 'width'],
|
22
|
+
addonAfter: 'W'
|
23
|
+
},
|
24
|
+
{
|
25
|
+
type: 'Number',
|
26
|
+
name: ['props', 'customTitle', 'style', 'height'],
|
27
|
+
addonAfter: 'H'
|
28
|
+
}
|
29
|
+
]
|
30
|
+
},
|
31
|
+
{
|
32
|
+
type: 'Group',
|
33
|
+
label: '圆角',
|
34
|
+
child: [
|
35
|
+
{
|
36
|
+
type: 'Slider',
|
37
|
+
name: ['props', 'customTitle', 'style', 'borderRadius'],
|
38
|
+
max: 100
|
39
|
+
},
|
40
|
+
{
|
41
|
+
type: 'Number',
|
42
|
+
name: ['props', 'customTitle', 'style', 'borderRadius'],
|
43
|
+
addonAfter: 'px',
|
44
|
+
max: 100
|
45
|
+
}
|
46
|
+
]
|
47
|
+
},
|
48
|
+
{
|
49
|
+
type: 'Color',
|
50
|
+
label: '背景色',
|
51
|
+
name: ['props', 'customTitle', 'style', 'backgroundColor']
|
52
|
+
},
|
53
|
+
{
|
54
|
+
type: 'Group',
|
55
|
+
label: '字体',
|
56
|
+
child: [
|
57
|
+
{
|
58
|
+
type: 'Select',
|
59
|
+
name: ['props', 'customTitle', 'style', 'fontFamily-cn'],
|
60
|
+
bottomText: '中文字体'
|
61
|
+
},
|
62
|
+
{
|
63
|
+
type: 'Select',
|
64
|
+
name: ['props', 'customTitle', 'style', 'fontFamily-en'],
|
65
|
+
bottomText: '英文/其他字体'
|
66
|
+
}
|
67
|
+
]
|
68
|
+
},
|
69
|
+
{
|
70
|
+
type: 'Group',
|
71
|
+
label: '',
|
72
|
+
child: [
|
73
|
+
{
|
74
|
+
type: 'Color',
|
75
|
+
name: ['props', 'customTitle', 'style', 'color']
|
76
|
+
},
|
77
|
+
{
|
78
|
+
type: 'Number',
|
79
|
+
addonAfter: 'px',
|
80
|
+
name: ['props', 'customTitle', 'style', 'fontSize']
|
81
|
+
}
|
82
|
+
]
|
83
|
+
},
|
84
|
+
{
|
85
|
+
label: '样式',
|
86
|
+
type: 'TextStyle',
|
87
|
+
name: ['props', 'customTitle', 'style']
|
88
|
+
},
|
89
|
+
{
|
90
|
+
label: '对齐',
|
91
|
+
type: 'TextAlign',
|
92
|
+
name: ['props', 'customTitle', 'style']
|
93
|
+
},
|
94
|
+
{
|
95
|
+
label: '上边距',
|
96
|
+
type: 'Number',
|
97
|
+
name: ['props', 'customTitle', 'style', 'marginTop'],
|
98
|
+
addonAfter: 'px'
|
99
|
+
}
|
100
|
+
]
|
101
|
+
}
|
102
|
+
];
|
@@ -1,9 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const tslib_1 = require("tslib");
|
4
|
+
const tool_1 = require("../../../../core/utils/tool");
|
4
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
5
6
|
const Nudge = ({ nudge }) => {
|
6
|
-
var _a, _b, _c, _d, _e, _f
|
7
|
+
var _a, _b, _c, _d, _e, _f;
|
7
8
|
return (react_1.default.createElement(react_1.default.Fragment, null, (nudge === null || nudge === void 0 ? void 0 : nudge.isOpen) && (react_1.default.createElement("div", { className: 'clc-sxp-bottom-nudge', style: {
|
8
9
|
marginBottom: (_a = nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom) !== null && _a !== void 0 ? _a : 5,
|
9
10
|
width: (_c = (_b = nudge === null || nudge === void 0 ? void 0 : nudge.size) === null || _b === void 0 ? void 0 : _b.width) !== null && _c !== void 0 ? _c : 212,
|
@@ -12,6 +13,8 @@ const Nudge = ({ nudge }) => {
|
|
12
13
|
borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
|
13
14
|
} },
|
14
15
|
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? (react_1.default.createElement("img", { src: nudge.icon, alt: 'nudge icon', style: { height: '100%', objectFit: 'cover', flexShrink: 0 } })) : null,
|
15
|
-
react_1.default.createElement("p", { style: Object.assign(Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle), { textWrap: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', flex: 1, marginBottom: 0
|
16
|
+
react_1.default.createElement("p", { style: Object.assign(Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle), { textWrap: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', flex: 1, marginBottom: 0, marginTop: 0 }), dangerouslySetInnerHTML: {
|
17
|
+
__html: (0, tool_1.setFontForText)(nudge === null || nudge === void 0 ? void 0 : nudge.content, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle)
|
18
|
+
} })))));
|
16
19
|
};
|
17
20
|
exports.default = Nudge;
|
@@ -6,8 +6,9 @@ const modules_1 = require("swiper/modules");
|
|
6
6
|
const react_2 = require("swiper/react");
|
7
7
|
const Picture_1 = tslib_1.__importDefault(require("./Picture"));
|
8
8
|
const hooks_1 = require("../../../../core/hooks");
|
9
|
+
const css_1 = require("@emotion/css");
|
9
10
|
const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
10
|
-
var _a;
|
11
|
+
var _a, _b;
|
11
12
|
const ref = (0, react_1.useRef)();
|
12
13
|
const { isActive } = (0, react_2.useSwiperSlide)();
|
13
14
|
const { sxpParameter, openHashtag } = (0, hooks_1.useSxpDataSource)();
|
@@ -31,7 +32,14 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd
|
|
31
32
|
setIsLoad(true);
|
32
33
|
}
|
33
34
|
}, [isLoad]);
|
34
|
-
return (react_1.default.createElement(react_2.Swiper, { ref: ref, defaultValue: 0, direction: 'horizontal', modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
|
35
|
+
return (react_1.default.createElement(react_2.Swiper, { ref: ref, defaultValue: 0, direction: 'horizontal', modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
|
36
|
+
clickable: true,
|
37
|
+
bulletActiveClass: 'swipe-item-active-bullet'
|
38
|
+
}, className: (0, css_1.css)(Object.assign({}, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) && {
|
39
|
+
'.swiper-pagination': {
|
40
|
+
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0
|
41
|
+
}
|
42
|
+
}))), height: height, loop: true, autoplay: { delay: ((_b = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.delay) !== null && _b !== void 0 ? _b : 3) * 1000 } }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url, index) => {
|
35
43
|
return (react_1.default.createElement(react_2.SwiperSlide, { key: index },
|
36
44
|
react_1.default.createElement(Picture_1.default, { src: !isLoad && index > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
37
45
|
})));
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const mountVideoPlayerAtNode: ((domNode: any) => Element | null | undefined) | undefined;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.mountVideoPlayerAtNode = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
6
|
+
const react_dom_1 = tslib_1.__importDefault(require("react-dom"));
|
7
|
+
exports.mountVideoPlayerAtNode = (() => {
|
8
|
+
if (typeof document === 'undefined')
|
9
|
+
return;
|
10
|
+
const playerContainer = document.createElement('div');
|
11
|
+
const dom = react_dom_1.default.render(react_1.default.createElement("video", { id: 'player-container-id', playsInline: true, crossOrigin: 'anonymous', preload: 'auto', controls: false, muted: true, style: {
|
12
|
+
backgroundColor: 'transparent',
|
13
|
+
width: '100%',
|
14
|
+
height: '100%',
|
15
|
+
objectFit: 'cover',
|
16
|
+
pointerEvents: 'none'
|
17
|
+
} }), playerContainer);
|
18
|
+
return (domNode) => {
|
19
|
+
if (!domNode)
|
20
|
+
return;
|
21
|
+
domNode.innerHTML = '';
|
22
|
+
domNode.appendChild(dom);
|
23
|
+
const videoPlayerWrapperNode = document.querySelector(`#player-container-id`);
|
24
|
+
return videoPlayerWrapperNode;
|
25
|
+
};
|
26
|
+
})();
|