pb-sxp-ui 1.0.64 → 1.0.65
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 +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -8
- 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 +8 -8
- 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/SxpPageCore/index.js +2 -2
- package/es/core/components/SxpPageRender/index.js +1 -1
- package/es/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/es/core/context/SxpDataSourceProvider.js +3 -3
- package/lib/core/components/SxpPageCore/index.js +2 -2
- package/lib/core/components/SxpPageRender/index.js +1 -1
- package/lib/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/lib/core/context/SxpDataSourceProvider.js +3 -3
- package/package.json +1 -1
@@ -9,14 +9,14 @@ Object.values(_materials_).forEach((v) => {
|
|
9
9
|
RESOLVER[v.extend.type] = v;
|
10
10
|
});
|
11
11
|
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, licenseUrl, enabledMetaConversionApi }) => {
|
12
|
-
var _a, _b, _c, _d, _e, _f;
|
12
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
13
13
|
const utmVal = useMemo(() => {
|
14
14
|
var _a;
|
15
15
|
const searchParams = (location === null || location === void 0 ? void 0 : location.search) ? (_a = location === null || location === void 0 ? void 0 : location.search) === null || _a === void 0 ? void 0 : _a.replace('?', '') : '';
|
16
16
|
return searchParams;
|
17
17
|
}, []);
|
18
18
|
return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
|
19
|
-
React.createElement(SxpDataSourceProvider, { 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, enabledMetaConversionApi: enabledMetaConversionApi, render: ({ rtcList, tagList }) => {
|
19
|
+
React.createElement(SxpDataSourceProvider, { 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, enabledMetaConversionApi: enabledMetaConversionApi, isShowTag: (_j = (_h = (_g = data === null || data === void 0 ? void 0 : data.data) === null || _g === void 0 ? void 0 : _g.sxpPageConf) === null || _h === void 0 ? void 0 : _h.globalConfig) === null || _j === void 0 ? void 0 : _j.isShowTag, render: ({ rtcList, tagList }) => {
|
20
20
|
var _a;
|
21
21
|
return (React.createElement(React.Fragment, null,
|
22
22
|
React.createElement(SxpPageRender, Object.assign({}, (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER, licenseUrl: licenseUrl })),
|
@@ -76,7 +76,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
76
76
|
};
|
77
77
|
const firstRef = useRef();
|
78
78
|
useEffect(() => {
|
79
|
-
if (!firstRef.current && !videoRef) {
|
79
|
+
if (!firstRef.current && !videoRef && (playerRef === null || playerRef === void 0 ? void 0 : playerRef.current)) {
|
80
80
|
firstRef.current = true;
|
81
81
|
const player = TCPlayer('player-container-id', {
|
82
82
|
licenseUrl,
|
@@ -102,6 +102,7 @@ export interface SxpDataSourceProviderProps {
|
|
102
102
|
loadingImage?: string;
|
103
103
|
isOpenHashTag?: boolean;
|
104
104
|
enabledMetaConversionApi?: boolean;
|
105
|
+
isShowTag?: boolean;
|
105
106
|
}
|
106
107
|
declare const _default: React.NamedExoticComponent<SxpDataSourceProviderProps>;
|
107
108
|
export default _default;
|
@@ -14,7 +14,7 @@ var DataSourceType;
|
|
14
14
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
15
15
|
})(DataSourceType || (DataSourceType = {}));
|
16
16
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
17
|
-
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false }) => {
|
17
|
+
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, isShowTag = true }) => {
|
18
18
|
const [rtcList, setRtcList] = useState([]);
|
19
19
|
const [tagList, setTagList] = useState([]);
|
20
20
|
const [loading, setLoading] = useState(false);
|
@@ -156,7 +156,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
156
156
|
}), [bffFetch]);
|
157
157
|
const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
158
158
|
var _h, _j, _k, _l, _m;
|
159
|
-
if (!utmVal)
|
159
|
+
if (!utmVal || !isShowTag)
|
160
160
|
return;
|
161
161
|
try {
|
162
162
|
const val = (_k = (_j = (_h = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _h === void 0 ? void 0 : _h.filter((val) => {
|
@@ -169,7 +169,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
169
169
|
catch (e) {
|
170
170
|
console.log('e', e);
|
171
171
|
}
|
172
|
-
}), [bffFetch, utmVal]);
|
172
|
+
}), [bffFetch, utmVal, isShowTag]);
|
173
173
|
const ctaEvent = useCallback((eventInfo, rec, product, position) => {
|
174
174
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
175
175
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
@@ -12,14 +12,14 @@ Object.values(_materials_).forEach((v) => {
|
|
12
12
|
RESOLVER[v.extend.type] = v;
|
13
13
|
});
|
14
14
|
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, licenseUrl, enabledMetaConversionApi }) => {
|
15
|
-
var _a, _b, _c, _d, _e, _f;
|
15
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
16
16
|
const utmVal = (0, react_1.useMemo)(() => {
|
17
17
|
var _a;
|
18
18
|
const searchParams = (location === null || location === void 0 ? void 0 : location.search) ? (_a = location === null || location === void 0 ? void 0 : location.search) === null || _a === void 0 ? void 0 : _a.replace('?', '') : '';
|
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, appDomain: appDomain, enabledMetaConversionApi: enabledMetaConversionApi, render: ({ rtcList, tagList }) => {
|
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, enabledMetaConversionApi: enabledMetaConversionApi, isShowTag: (_j = (_h = (_g = data === null || data === void 0 ? void 0 : data.data) === null || _g === void 0 ? void 0 : _g.sxpPageConf) === null || _h === void 0 ? void 0 : _h.globalConfig) === null || _j === void 0 ? void 0 : _j.isShowTag, render: ({ rtcList, tagList }) => {
|
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, { tagList: tagList, data: rtcList, resolver: RESOLVER, licenseUrl: licenseUrl })),
|
@@ -79,7 +79,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
79
79
|
};
|
80
80
|
const firstRef = (0, react_1.useRef)();
|
81
81
|
(0, react_1.useEffect)(() => {
|
82
|
-
if (!firstRef.current && !videoRef) {
|
82
|
+
if (!firstRef.current && !videoRef && (playerRef === null || playerRef === void 0 ? void 0 : playerRef.current)) {
|
83
83
|
firstRef.current = true;
|
84
84
|
const player = TCPlayer('player-container-id', {
|
85
85
|
licenseUrl,
|
@@ -102,6 +102,7 @@ export interface SxpDataSourceProviderProps {
|
|
102
102
|
loadingImage?: string;
|
103
103
|
isOpenHashTag?: boolean;
|
104
104
|
enabledMetaConversionApi?: boolean;
|
105
|
+
isShowTag?: boolean;
|
105
106
|
}
|
106
107
|
declare const _default: React.NamedExoticComponent<SxpDataSourceProviderProps>;
|
107
108
|
export default _default;
|
@@ -17,7 +17,7 @@ var DataSourceType;
|
|
17
17
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
18
18
|
})(DataSourceType || (DataSourceType = {}));
|
19
19
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
20
|
-
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false }) => {
|
20
|
+
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, isShowTag = true }) => {
|
21
21
|
const [rtcList, setRtcList] = (0, react_1.useState)([]);
|
22
22
|
const [tagList, setTagList] = (0, react_1.useState)([]);
|
23
23
|
const [loading, setLoading] = (0, react_1.useState)(false);
|
@@ -159,7 +159,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
159
159
|
}), [bffFetch]);
|
160
160
|
const bffGetTagList = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
161
161
|
var _h, _j, _k, _l, _m;
|
162
|
-
if (!utmVal)
|
162
|
+
if (!utmVal || !isShowTag)
|
163
163
|
return;
|
164
164
|
try {
|
165
165
|
const val = (_k = (_j = (_h = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _h === void 0 ? void 0 : _h.filter((val) => {
|
@@ -172,7 +172,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
172
172
|
catch (e) {
|
173
173
|
console.log('e', e);
|
174
174
|
}
|
175
|
-
}), [bffFetch, utmVal]);
|
175
|
+
}), [bffFetch, utmVal, isShowTag]);
|
176
176
|
const ctaEvent = (0, react_1.useCallback)((eventInfo, rec, product, position) => {
|
177
177
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
178
178
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|