pb-sxp-ui 1.0.56 → 1.0.57
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/LICENSE +21 -21
- package/README.md +111 -111
- package/dist/index.cjs +103 -94
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +103 -94
- 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 +103 -94
- 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/Popup/index.js +5 -4
- package/es/materials/sxp/popup/AppointForm/index.d.ts +1 -0
- package/es/materials/sxp/popup/AppointForm/index.js +12 -3
- package/es/materials/sxp/popup/CommodityDetail/index.js +5 -5
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
- package/lib/core/components/SxpPageRender/Popup/index.js +5 -4
- package/lib/materials/sxp/popup/AppointForm/index.d.ts +1 -0
- package/lib/materials/sxp/popup/AppointForm/index.js +12 -3
- package/lib/materials/sxp/popup/CommodityDetail/index.js +5 -5
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
- package/package.json +115 -115
package/LICENSE
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2023 ChatLabs
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2023 ChatLabs
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
@@ -1,111 +1,111 @@
|
|
1
|
-
<!--
|
2
|
-
* @Author : haocanweng@chatlabs.cn
|
3
|
-
* @Date : 2023-08-23 18:25:31
|
4
|
-
* @LastEditors: binruan@chatlabs.com
|
5
|
-
* @LastEditTime: 2024-03-20 16:26:29
|
6
|
-
* @FilePath: \pb-sxp-ui\README.md
|
7
|
-
-->
|
8
|
-
<h1 align="center">Page Builder SXP UI</h1>
|
9
|
-
|
10
|
-
<div align="center">
|
11
|
-
React enterprise-class UI components
|
12
|
-
</div>
|
13
|
-
|
14
|
-
## 📦 安装
|
15
|
-
|
16
|
-
```bash
|
17
|
-
npm install pb-sxp-ui
|
18
|
-
# or
|
19
|
-
yarn add pb-sxp-ui
|
20
|
-
```
|
21
|
-
|
22
|
-
## 🔨 使用
|
23
|
-
以 Next.js 框架为例子:
|
24
|
-
|
25
|
-
```jsx
|
26
|
-
import { GetServerSideProps } from 'next';
|
27
|
-
import React, { FC } from 'react'
|
28
|
-
import Pagebuilder, { PageView } from 'pb-sxp-ui';
|
29
|
-
|
30
|
-
// 初始化 PageBuilder 配置
|
31
|
-
Pagebuilder.init({
|
32
|
-
tenantId: 'xxxxxxxxxx',
|
33
|
-
appId: 'xxxxxxxxx',
|
34
|
-
env: 'live' // 可选参数,默认是 live 环境
|
35
|
-
});
|
36
|
-
|
37
|
-
|
38
|
-
interface IProps {
|
39
|
-
path: string;
|
40
|
-
data: any
|
41
|
-
}
|
42
|
-
|
43
|
-
const ContentPage: FC<IProps> = ({ data ,path}) => {
|
44
|
-
return (
|
45
|
-
<PageView data={data?.data} isSsr path={path}/>
|
46
|
-
)
|
47
|
-
}
|
48
|
-
|
49
|
-
export const getServerSideProps: GetServerSideProps<IProps> = async (
|
50
|
-
context
|
51
|
-
) => {
|
52
|
-
// 接收传来的路径
|
53
|
-
const path = context.query.path as string;
|
54
|
-
// 获取页面数据
|
55
|
-
const result = await Pagebuilder.getDetail(path)
|
56
|
-
return {
|
57
|
-
props: {
|
58
|
-
path,
|
59
|
-
data: result.data
|
60
|
-
},
|
61
|
-
};
|
62
|
-
};
|
63
|
-
|
64
|
-
export default ContentPage;
|
65
|
-
|
66
|
-
```
|
67
|
-
|
68
|
-
## ⌨️ 本地调试
|
69
|
-
|
70
|
-
### 运行开发环境
|
71
|
-
|
72
|
-
```bash
|
73
|
-
$ npm install
|
74
|
-
$ npm run start
|
75
|
-
```
|
76
|
-
|
77
|
-
### 生成本地开发全局链接
|
78
|
-
|
79
|
-
```bash
|
80
|
-
npm link
|
81
|
-
# or
|
82
|
-
yarn link
|
83
|
-
```
|
84
|
-
|
85
|
-
### 在使用该包的项目中安装调试
|
86
|
-
|
87
|
-
```bash
|
88
|
-
npm link pb-sxp-ui
|
89
|
-
# or
|
90
|
-
yarn link pb-sxp-ui
|
91
|
-
```
|
92
|
-
|
93
|
-
## 👾 发布
|
94
|
-
|
95
|
-
### 打包线上安装包
|
96
|
-
|
97
|
-
```bash
|
98
|
-
npm run package
|
99
|
-
# or
|
100
|
-
yarn package
|
101
|
-
```
|
102
|
-
|
103
|
-
### 发布 npm
|
104
|
-
|
105
|
-
```bash
|
106
|
-
$ npm version patch|minor|major
|
107
|
-
$ npm publish
|
108
|
-
|
109
|
-
# 自动化发布包
|
110
|
-
$ npm run pub patch|minor|major|xx.xx.xx
|
111
|
-
```
|
1
|
+
<!--
|
2
|
+
* @Author : haocanweng@chatlabs.cn
|
3
|
+
* @Date : 2023-08-23 18:25:31
|
4
|
+
* @LastEditors: binruan@chatlabs.com
|
5
|
+
* @LastEditTime: 2024-03-20 16:26:29
|
6
|
+
* @FilePath: \pb-sxp-ui\README.md
|
7
|
+
-->
|
8
|
+
<h1 align="center">Page Builder SXP UI</h1>
|
9
|
+
|
10
|
+
<div align="center">
|
11
|
+
React enterprise-class UI components
|
12
|
+
</div>
|
13
|
+
|
14
|
+
## 📦 安装
|
15
|
+
|
16
|
+
```bash
|
17
|
+
npm install pb-sxp-ui
|
18
|
+
# or
|
19
|
+
yarn add pb-sxp-ui
|
20
|
+
```
|
21
|
+
|
22
|
+
## 🔨 使用
|
23
|
+
以 Next.js 框架为例子:
|
24
|
+
|
25
|
+
```jsx
|
26
|
+
import { GetServerSideProps } from 'next';
|
27
|
+
import React, { FC } from 'react'
|
28
|
+
import Pagebuilder, { PageView } from 'pb-sxp-ui';
|
29
|
+
|
30
|
+
// 初始化 PageBuilder 配置
|
31
|
+
Pagebuilder.init({
|
32
|
+
tenantId: 'xxxxxxxxxx',
|
33
|
+
appId: 'xxxxxxxxx',
|
34
|
+
env: 'live' // 可选参数,默认是 live 环境
|
35
|
+
});
|
36
|
+
|
37
|
+
|
38
|
+
interface IProps {
|
39
|
+
path: string;
|
40
|
+
data: any
|
41
|
+
}
|
42
|
+
|
43
|
+
const ContentPage: FC<IProps> = ({ data ,path}) => {
|
44
|
+
return (
|
45
|
+
<PageView data={data?.data} isSsr path={path}/>
|
46
|
+
)
|
47
|
+
}
|
48
|
+
|
49
|
+
export const getServerSideProps: GetServerSideProps<IProps> = async (
|
50
|
+
context
|
51
|
+
) => {
|
52
|
+
// 接收传来的路径
|
53
|
+
const path = context.query.path as string;
|
54
|
+
// 获取页面数据
|
55
|
+
const result = await Pagebuilder.getDetail(path)
|
56
|
+
return {
|
57
|
+
props: {
|
58
|
+
path,
|
59
|
+
data: result.data
|
60
|
+
},
|
61
|
+
};
|
62
|
+
};
|
63
|
+
|
64
|
+
export default ContentPage;
|
65
|
+
|
66
|
+
```
|
67
|
+
|
68
|
+
## ⌨️ 本地调试
|
69
|
+
|
70
|
+
### 运行开发环境
|
71
|
+
|
72
|
+
```bash
|
73
|
+
$ npm install
|
74
|
+
$ npm run start
|
75
|
+
```
|
76
|
+
|
77
|
+
### 生成本地开发全局链接
|
78
|
+
|
79
|
+
```bash
|
80
|
+
npm link
|
81
|
+
# or
|
82
|
+
yarn link
|
83
|
+
```
|
84
|
+
|
85
|
+
### 在使用该包的项目中安装调试
|
86
|
+
|
87
|
+
```bash
|
88
|
+
npm link pb-sxp-ui
|
89
|
+
# or
|
90
|
+
yarn link pb-sxp-ui
|
91
|
+
```
|
92
|
+
|
93
|
+
## 👾 发布
|
94
|
+
|
95
|
+
### 打包线上安装包
|
96
|
+
|
97
|
+
```bash
|
98
|
+
npm run package
|
99
|
+
# or
|
100
|
+
yarn package
|
101
|
+
```
|
102
|
+
|
103
|
+
### 发布 npm
|
104
|
+
|
105
|
+
```bash
|
106
|
+
$ npm version patch|minor|major
|
107
|
+
$ npm publish
|
108
|
+
|
109
|
+
# 自动化发布包
|
110
|
+
$ npm run pub patch|minor|major|xx.xx.xx
|
111
|
+
```
|
package/dist/index.cjs
CHANGED
@@ -1048,9 +1048,90 @@ var settingRender$5 = [
|
|
1048
1048
|
}
|
1049
1049
|
];
|
1050
1050
|
|
1051
|
+
/*
|
1052
|
+
* @Author: binruan@chatlabs.com
|
1053
|
+
* @Date: 2024-03-12 10:59:06
|
1054
|
+
* @LastEditors: binruan@chatlabs.com
|
1055
|
+
* @LastEditTime: 2024-04-15 09:47:08
|
1056
|
+
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1057
|
+
*
|
1058
|
+
*/
|
1059
|
+
function useEventReport() {
|
1060
|
+
const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = useSxpDataSource();
|
1061
|
+
const jumpToWeb = React.useCallback((data, product, cta, position) => {
|
1062
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
1063
|
+
let fromKName = '';
|
1064
|
+
if (popupDetailData && (((_b = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
1065
|
+
fromKName = 'pdpPage';
|
1066
|
+
}
|
1067
|
+
else if (isFromHashtag) {
|
1068
|
+
fromKName = 'hashTagPage';
|
1069
|
+
}
|
1070
|
+
else if ((_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.url) {
|
1071
|
+
fromKName = 'videoPage';
|
1072
|
+
}
|
1073
|
+
else if (((_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.imgUrls) && ((_g = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.imgUrls) === null || _g === void 0 ? void 0 : _g.length)) {
|
1074
|
+
fromKName = 'imagePage';
|
1075
|
+
}
|
1076
|
+
else if (data === null || data === void 0 ? void 0 : data.product) {
|
1077
|
+
fromKName = 'productPage';
|
1078
|
+
}
|
1079
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1080
|
+
eventInfo: {
|
1081
|
+
eventSubject: 'jumpToWeb',
|
1082
|
+
eventDescription: 'User jumped to website',
|
1083
|
+
productId: (_h = product === null || product === void 0 ? void 0 : product.itemId) !== null && _h !== void 0 ? _h : '',
|
1084
|
+
productName: (_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : '',
|
1085
|
+
price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0',
|
1086
|
+
productCollection: (_k = product === null || product === void 0 ? void 0 : product.collection) !== null && _k !== void 0 ? _k : '',
|
1087
|
+
fromKName,
|
1088
|
+
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
1089
|
+
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
1090
|
+
position: position + '',
|
1091
|
+
contentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
|
1092
|
+
ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
|
1093
|
+
traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
|
1094
|
+
}
|
1095
|
+
});
|
1096
|
+
}, [bffEventReport, popupDetailData, isFromHashtag]);
|
1097
|
+
const productView = React.useCallback((data, product, cta, viewTime, position) => {
|
1098
|
+
var _a, _b, _c, _d;
|
1099
|
+
let fromKName = '';
|
1100
|
+
if (popupDetailData && (((_b = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
1101
|
+
fromKName = 'pdpPage';
|
1102
|
+
}
|
1103
|
+
else if (data === null || data === void 0 ? void 0 : data.product) {
|
1104
|
+
fromKName = 'productPage';
|
1105
|
+
}
|
1106
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1107
|
+
eventInfo: {
|
1108
|
+
productId: product === null || product === void 0 ? void 0 : product.itemId,
|
1109
|
+
productName: product === null || product === void 0 ? void 0 : product.title,
|
1110
|
+
price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0',
|
1111
|
+
productCollection: product === null || product === void 0 ? void 0 : product.collection,
|
1112
|
+
fromKName,
|
1113
|
+
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
1114
|
+
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
1115
|
+
position: position + '',
|
1116
|
+
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
1117
|
+
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
1118
|
+
traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
|
1119
|
+
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
1120
|
+
eventSubject: 'productView',
|
1121
|
+
eventDescription: 'User browsed the product'
|
1122
|
+
}
|
1123
|
+
});
|
1124
|
+
}, [bffEventReport, popupDetailData]);
|
1125
|
+
return {
|
1126
|
+
jumpToWeb,
|
1127
|
+
productView
|
1128
|
+
};
|
1129
|
+
}
|
1130
|
+
|
1051
1131
|
const AppointForm$1 = (_a) => {
|
1052
|
-
var { columns, style, title, textStyle, submitBgColor, submitColor, submitText, layoutType, onClick, onClose } = _a, props = __rest(_a, ["columns", "style", "title", "textStyle", "submitBgColor", "submitColor", "submitText", "layoutType", "onClick", "onClose"]);
|
1053
|
-
const { submitForm } = useSxpDataSource();
|
1132
|
+
var { columns, style, title, textStyle, submitBgColor, submitColor, submitText, layoutType, isExternalLink, onClick, onClose } = _a, props = __rest(_a, ["columns", "style", "title", "textStyle", "submitBgColor", "submitColor", "submitText", "layoutType", "isExternalLink", "onClick", "onClose"]);
|
1133
|
+
const { submitForm, popupDetailData } = useSxpDataSource();
|
1134
|
+
const { jumpToWeb } = useEventReport();
|
1054
1135
|
const formRef = React.useRef();
|
1055
1136
|
const [loading, setLoading] = React.useState(false);
|
1056
1137
|
const defaultColumns = React.useMemo(() => [
|
@@ -1089,7 +1170,7 @@ const AppointForm$1 = (_a) => {
|
|
1089
1170
|
}
|
1090
1171
|
}, [layoutType, columns, defaultColumns]);
|
1091
1172
|
const handleSubmit = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
1092
|
-
var _b, _c, _d;
|
1173
|
+
var _b, _c, _d, _e, _f, _g;
|
1093
1174
|
const vals = yield ((_b = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _b === void 0 ? void 0 : _b.getFieldsValue());
|
1094
1175
|
if (!vals)
|
1095
1176
|
return;
|
@@ -1106,6 +1187,13 @@ const AppointForm$1 = (_a) => {
|
|
1106
1187
|
const res = (yield (submitForm === null || submitForm === void 0 ? void 0 : submitForm({ attributes: arr })));
|
1107
1188
|
setLoading(false);
|
1108
1189
|
if (res) {
|
1190
|
+
if (isExternalLink) {
|
1191
|
+
const data = popupDetailData;
|
1192
|
+
const product = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProduct;
|
1193
|
+
const cta = (_g = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct) === null || _g === void 0 ? void 0 : _g.bindCta;
|
1194
|
+
const position = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
1195
|
+
jumpToWeb(data, product, cta, position);
|
1196
|
+
}
|
1109
1197
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
1110
1198
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
1111
1199
|
}
|
@@ -8157,86 +8245,6 @@ const SwiperSlide = /*#__PURE__*/React.forwardRef(function (_temp, externalRef)
|
|
8157
8245
|
});
|
8158
8246
|
SwiperSlide.displayName = 'SwiperSlide';
|
8159
8247
|
|
8160
|
-
/*
|
8161
|
-
* @Author: binruan@chatlabs.com
|
8162
|
-
* @Date: 2024-03-12 10:59:06
|
8163
|
-
* @LastEditors: binruan@chatlabs.com
|
8164
|
-
* @LastEditTime: 2024-04-15 09:47:08
|
8165
|
-
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
8166
|
-
*
|
8167
|
-
*/
|
8168
|
-
function useEventReport() {
|
8169
|
-
const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = useSxpDataSource();
|
8170
|
-
const jumpToWeb = React.useCallback((data, product, cta, position) => {
|
8171
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
8172
|
-
let fromKName = '';
|
8173
|
-
if (popupDetailData && (((_b = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
8174
|
-
fromKName = 'pdpPage';
|
8175
|
-
}
|
8176
|
-
else if (isFromHashtag) {
|
8177
|
-
fromKName = 'hashTagPage';
|
8178
|
-
}
|
8179
|
-
else if ((_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.url) {
|
8180
|
-
fromKName = 'videoPage';
|
8181
|
-
}
|
8182
|
-
else if (((_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.imgUrls) && ((_g = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.imgUrls) === null || _g === void 0 ? void 0 : _g.length)) {
|
8183
|
-
fromKName = 'imagePage';
|
8184
|
-
}
|
8185
|
-
else if (data === null || data === void 0 ? void 0 : data.product) {
|
8186
|
-
fromKName = 'productPage';
|
8187
|
-
}
|
8188
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
8189
|
-
eventInfo: {
|
8190
|
-
eventSubject: 'jumpToWeb',
|
8191
|
-
eventDescription: 'User jumped to website',
|
8192
|
-
productId: (_h = product === null || product === void 0 ? void 0 : product.itemId) !== null && _h !== void 0 ? _h : '',
|
8193
|
-
productName: (_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : '',
|
8194
|
-
price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0',
|
8195
|
-
productCollection: (_k = product === null || product === void 0 ? void 0 : product.collection) !== null && _k !== void 0 ? _k : '',
|
8196
|
-
fromKName,
|
8197
|
-
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
8198
|
-
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
8199
|
-
position: position + '',
|
8200
|
-
contentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
|
8201
|
-
ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
|
8202
|
-
traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
|
8203
|
-
}
|
8204
|
-
});
|
8205
|
-
}, [bffEventReport, popupDetailData, isFromHashtag]);
|
8206
|
-
const productView = React.useCallback((data, product, cta, viewTime, position) => {
|
8207
|
-
var _a, _b, _c, _d;
|
8208
|
-
let fromKName = '';
|
8209
|
-
if (popupDetailData && (((_b = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
8210
|
-
fromKName = 'pdpPage';
|
8211
|
-
}
|
8212
|
-
else if (data === null || data === void 0 ? void 0 : data.product) {
|
8213
|
-
fromKName = 'productPage';
|
8214
|
-
}
|
8215
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
8216
|
-
eventInfo: {
|
8217
|
-
productId: product === null || product === void 0 ? void 0 : product.itemId,
|
8218
|
-
productName: product === null || product === void 0 ? void 0 : product.title,
|
8219
|
-
price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0',
|
8220
|
-
productCollection: product === null || product === void 0 ? void 0 : product.collection,
|
8221
|
-
fromKName,
|
8222
|
-
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
8223
|
-
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
8224
|
-
position: position + '',
|
8225
|
-
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
8226
|
-
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
8227
|
-
traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
|
8228
|
-
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
8229
|
-
eventSubject: 'productView',
|
8230
|
-
eventDescription: 'User browsed the product'
|
8231
|
-
}
|
8232
|
-
});
|
8233
|
-
}, [bffEventReport, popupDetailData]);
|
8234
|
-
return {
|
8235
|
-
jumpToWeb,
|
8236
|
-
productView
|
8237
|
-
};
|
8238
|
-
}
|
8239
|
-
|
8240
8248
|
/*
|
8241
8249
|
* @Author: binruan@chatlabs.com
|
8242
8250
|
* @Date: 2023-11-02 18:34:34
|
@@ -8399,7 +8407,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8399
8407
|
const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
8400
8408
|
const handleLink = () => {
|
8401
8409
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
8402
|
-
jumpToWeb(
|
8410
|
+
jumpToWeb(data, product, cta, position);
|
8403
8411
|
if (!isPost) {
|
8404
8412
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
8405
8413
|
}
|
@@ -8442,10 +8450,10 @@ const CommodityDetail$1 = (_a) => {
|
|
8442
8450
|
React.createElement("div", { className: 'pb-commondity-content-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!product && !(product === null || product === void 0 ? void 0 : product.title) }, (_b = product === null || product === void 0 ? void 0 : product.title) !== null && _b !== void 0 ? _b : 'Pendant in Yellow Gold with Diamonds, Medium'),
|
8443
8451
|
React.createElement("div", { className: 'pb-commondity-content-price', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price) }, priceText),
|
8444
8452
|
React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
8445
|
-
React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
8446
|
-
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
8447
|
-
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
8448
|
-
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
8453
|
+
React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
8454
|
+
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
8455
|
+
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
8456
|
+
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
8449
8457
|
18-karat gold, this necklace is embellished with hand-set diamonds.`, maxStr: 79, className: 'pb-commondity-content-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info }))));
|
8450
8458
|
};
|
8451
8459
|
const renderBtn = () => {
|
@@ -8903,7 +8911,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
8903
8911
|
const productInfoText = ({ isPost }) => {
|
8904
8912
|
return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
8905
8913
|
React.createElement(ExpandableText$1, { isPost: isPost, onClick: () => setShowModal(true), className: 'pb-commondityDiroNew-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (product === null || product === void 0 ? void 0 : product.info) ||
|
8906
|
-
`Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
|
8914
|
+
`Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
|
8907
8915
|
Made in Italy` })));
|
8908
8916
|
};
|
8909
8917
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
@@ -13572,7 +13580,7 @@ var index$1 = React.memo(DiyPortalPreview);
|
|
13572
13580
|
* @Author: binruan@chatlabs.com
|
13573
13581
|
* @Date: 2023-10-31 10:56:01
|
13574
13582
|
* @LastEditors: binruan@chatlabs.com
|
13575
|
-
* @LastEditTime: 2024-05-
|
13583
|
+
* @LastEditTime: 2024-05-13 15:19:20
|
13576
13584
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
13577
13585
|
*
|
13578
13586
|
*/
|
@@ -13618,18 +13626,19 @@ const Popup = () => {
|
|
13618
13626
|
const renderPopupDetail = React.useMemo(() => {
|
13619
13627
|
var _a, _b, _c;
|
13620
13628
|
return (_c = (_b = (_a = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _a === void 0 ? void 0 : _a.globalConfig) === null || _b === void 0 ? void 0 : _b.popupList) === null || _c === void 0 ? void 0 : _c.map((value, index) => {
|
13621
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
13629
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
13622
13630
|
if ((value === null || value === void 0 ? void 0 : value.id) === (popup === null || popup === void 0 ? void 0 : popup.id)) {
|
13623
13631
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
13624
13632
|
const Component = withBindDataSource(t);
|
13625
|
-
const
|
13626
|
-
|
13633
|
+
const isExternalLink = ((_d = (_c = (_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.event) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.linkType) === 'externalLink';
|
13634
|
+
const defaulSetting = (_e = t === null || t === void 0 ? void 0 : t.extend) === null || _e === void 0 ? void 0 : _e.defaulSetting;
|
13635
|
+
return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.style), { width: '100%', height: '80vh', overflow: 'auto' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.textStyle), bindDatas: (_j = (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.bindDatas) !== null && _j !== void 0 ? _j : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_k = value === null || value === void 0 ? void 0 : value.item) === null || _k === void 0 ? void 0 : _k.props, { event: ((_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, onClose: handleClose })));
|
13627
13636
|
}
|
13628
13637
|
else {
|
13629
13638
|
return React.createElement(React.Fragment, null);
|
13630
13639
|
}
|
13631
13640
|
});
|
13632
|
-
}, [schema, popup, resolver]);
|
13641
|
+
}, [schema, popup, resolver, handleClose]);
|
13633
13642
|
return (React.createElement(Modal$1, { popup: visible, onClose: handleClose, padding: 0, modalStyle: { position: 'fixed' } }, renderPopupDetail));
|
13634
13643
|
};
|
13635
13644
|
|