pb-sxp-ui 1.20.24 → 1.20.26

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.
@@ -2,30 +2,14 @@ import { __rest } from "tslib";
2
2
  import React, { useEffect, useState, useRef, useMemo, useCallback } from 'react';
3
3
  import { useEditor } from '../../hooks';
4
4
  import FormatImage from '../SxpPageRender/FormatImage';
5
+ import * as _materials_ from '../../../materials/sxp';
5
6
  const RESOLVER = {};
6
- try {
7
- const materialsModule = require('../../materials/sxp');
8
- if (materialsModule && typeof materialsModule === 'object') {
9
- Object.values(materialsModule).forEach((v) => {
10
- var _a;
11
- if ((_a = v === null || v === void 0 ? void 0 : v.extend) === null || _a === void 0 ? void 0 : _a.type) {
12
- RESOLVER[v.extend.type] = v;
13
- }
14
- });
15
- if (Object.keys(RESOLVER).length > 0) {
16
- console.log('[StructurePage] Successfully loaded materials:', Object.keys(RESOLVER));
17
- }
18
- else {
19
- console.warn('[StructurePage] Materials module loaded but no valid components found');
20
- }
21
- }
22
- else {
23
- console.warn('[StructurePage] Materials module is not a valid object:', materialsModule);
7
+ Object.values(_materials_).forEach((v) => {
8
+ var _a;
9
+ if ((_a = v === null || v === void 0 ? void 0 : v.extend) === null || _a === void 0 ? void 0 : _a.type) {
10
+ RESOLVER[v.extend.type] = v;
24
11
  }
25
- }
26
- catch (error) {
27
- console.error('[StructurePage] Failed to load materials for StructurePage:', error);
28
- }
12
+ });
29
13
  const baseStyles = {
30
14
  container: {
31
15
  backgroundColor: '#000',
@@ -461,7 +461,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
461
461
  return undefined;
462
462
  }
463
463
  setLoading(false);
464
- list = list.concat((_1 = (_0 = (_z = (_y = result === null || result === void 0 ? void 0 : result.data) === null || _y === void 0 ? void 0 : _y.recList) === null || _z === void 0 ? void 0 : _z.filter) === null || _0 === void 0 ? void 0 : _0.call(_z, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _1 !== void 0 ? _1 : []);
464
+ list = list.concat((_1 = (_0 = (_z = (_y = result === null || result === void 0 ? void 0 : result.data) === null || _y === void 0 ? void 0 : _y.recList) === null || _z === void 0 ? void 0 : _z.filter) === null || _0 === void 0 ? void 0 : _0.call(_z, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video) || (item === null || item === void 0 ? void 0 : item.multiCta))) !== null && _1 !== void 0 ? _1 : []);
465
465
  if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
466
466
  setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
467
467
  setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
@@ -469,7 +469,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
469
469
  setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
470
470
  }
471
471
  }
472
- const isNotNullList = (_3 = (_2 = result === null || result === void 0 ? void 0 : result.data) === null || _2 === void 0 ? void 0 : _2.recList) === null || _3 === void 0 ? void 0 : _3.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
472
+ const isNotNullList = (_3 = (_2 = result === null || result === void 0 ? void 0 : result.data) === null || _2 === void 0 ? void 0 : _2.recList) === null || _3 === void 0 ? void 0 : _3.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video) || (item === null || item === void 0 ? void 0 : item.multiCta));
473
473
  if (isNotNullList) {
474
474
  pageNum = pageNum + 1;
475
475
  yield recurveRecList(query);
@@ -495,13 +495,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
495
495
  if (!(query === null || query === void 0 ? void 0 : query.hashTag))
496
496
  setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
497
497
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
498
- const isNotNullList = (_t = (_s = result === null || result === void 0 ? void 0 : result.data) === null || _s === void 0 ? void 0 : _s.recList) === null || _t === void 0 ? void 0 : _t.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
498
+ const isNotNullList = (_t = (_s = result === null || result === void 0 ? void 0 : result.data) === null || _s === void 0 ? void 0 : _s.recList) === null || _t === void 0 ? void 0 : _t.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video) || (item === null || item === void 0 ? void 0 : item.multiCta));
499
499
  if (!isNotNullList) {
500
500
  setIsNoMoreData(true);
501
501
  }
502
502
  }
503
503
  let list = [];
504
- list = list.concat((_x = (_w = (_v = (_u = result === null || result === void 0 ? void 0 : result.data) === null || _u === void 0 ? void 0 : _u.recList) === null || _v === void 0 ? void 0 : _v.filter) === null || _w === void 0 ? void 0 : _w.call(_v, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _x !== void 0 ? _x : []);
504
+ list = list.concat((_x = (_w = (_v = (_u = result === null || result === void 0 ? void 0 : result.data) === null || _u === void 0 ? void 0 : _u.recList) === null || _v === void 0 ? void 0 : _v.filter) === null || _w === void 0 ? void 0 : _w.call(_v, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video) || (item === null || item === void 0 ? void 0 : item.multiCta))) !== null && _x !== void 0 ? _x : []);
505
505
  return Object.assign(Object.assign({}, result.data), { recList: list });
506
506
  }), [
507
507
  bffFetch,
@@ -895,11 +895,19 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
895
895
  onUpdateSchema === null || onUpdateSchema === void 0 ? void 0 : onUpdateSchema(curData === null || curData === void 0 ? void 0 : curData.data);
896
896
  if ((_j = (_h = (_g = (_f = gldata === null || gldata === void 0 ? void 0 : gldata.consent) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.item) === null || _h === void 0 ? void 0 : _h.props) === null || _j === void 0 ? void 0 : _j.privacy_necessity)
897
897
  setShowConsent(true);
898
+ else
899
+ setShowConsent(true);
898
900
  }
899
901
  else {
902
+ console.warn(`[SxpDataSourceProvider] Layout variant ${id} not found in dataList (count: ${(dataList === null || dataList === void 0 ? void 0 : dataList.length) || 0}), using default page config`);
903
+ gldata = globalConfig;
900
904
  setShowConsent(true);
901
905
  }
902
906
  }
907
+ else {
908
+ gldata = globalConfig;
909
+ setShowConsent(true);
910
+ }
903
911
  }
904
912
  else {
905
913
  setShowConsent(true);
@@ -4,30 +4,14 @@ const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
5
  const hooks_1 = require("../../hooks");
6
6
  const FormatImage_1 = tslib_1.__importDefault(require("../SxpPageRender/FormatImage"));
7
+ const _materials_ = tslib_1.__importStar(require("../../../materials/sxp"));
7
8
  const RESOLVER = {};
8
- try {
9
- const materialsModule = require('../../materials/sxp');
10
- if (materialsModule && typeof materialsModule === 'object') {
11
- Object.values(materialsModule).forEach((v) => {
12
- var _a;
13
- if ((_a = v === null || v === void 0 ? void 0 : v.extend) === null || _a === void 0 ? void 0 : _a.type) {
14
- RESOLVER[v.extend.type] = v;
15
- }
16
- });
17
- if (Object.keys(RESOLVER).length > 0) {
18
- console.log('[StructurePage] Successfully loaded materials:', Object.keys(RESOLVER));
19
- }
20
- else {
21
- console.warn('[StructurePage] Materials module loaded but no valid components found');
22
- }
23
- }
24
- else {
25
- console.warn('[StructurePage] Materials module is not a valid object:', materialsModule);
9
+ Object.values(_materials_).forEach((v) => {
10
+ var _a;
11
+ if ((_a = v === null || v === void 0 ? void 0 : v.extend) === null || _a === void 0 ? void 0 : _a.type) {
12
+ RESOLVER[v.extend.type] = v;
26
13
  }
27
- }
28
- catch (error) {
29
- console.error('[StructurePage] Failed to load materials for StructurePage:', error);
30
- }
14
+ });
31
15
  const baseStyles = {
32
16
  container: {
33
17
  backgroundColor: '#000',
@@ -464,7 +464,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
464
464
  return undefined;
465
465
  }
466
466
  setLoading(false);
467
- list = list.concat((_1 = (_0 = (_z = (_y = result === null || result === void 0 ? void 0 : result.data) === null || _y === void 0 ? void 0 : _y.recList) === null || _z === void 0 ? void 0 : _z.filter) === null || _0 === void 0 ? void 0 : _0.call(_z, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _1 !== void 0 ? _1 : []);
467
+ list = list.concat((_1 = (_0 = (_z = (_y = result === null || result === void 0 ? void 0 : result.data) === null || _y === void 0 ? void 0 : _y.recList) === null || _z === void 0 ? void 0 : _z.filter) === null || _0 === void 0 ? void 0 : _0.call(_z, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video) || (item === null || item === void 0 ? void 0 : item.multiCta))) !== null && _1 !== void 0 ? _1 : []);
468
468
  if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
469
469
  setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
470
470
  setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
@@ -472,7 +472,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
472
472
  setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
473
473
  }
474
474
  }
475
- const isNotNullList = (_3 = (_2 = result === null || result === void 0 ? void 0 : result.data) === null || _2 === void 0 ? void 0 : _2.recList) === null || _3 === void 0 ? void 0 : _3.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
475
+ const isNotNullList = (_3 = (_2 = result === null || result === void 0 ? void 0 : result.data) === null || _2 === void 0 ? void 0 : _2.recList) === null || _3 === void 0 ? void 0 : _3.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video) || (item === null || item === void 0 ? void 0 : item.multiCta));
476
476
  if (isNotNullList) {
477
477
  pageNum = pageNum + 1;
478
478
  yield recurveRecList(query);
@@ -498,13 +498,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
498
498
  if (!(query === null || query === void 0 ? void 0 : query.hashTag))
499
499
  setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
500
500
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
501
- const isNotNullList = (_t = (_s = result === null || result === void 0 ? void 0 : result.data) === null || _s === void 0 ? void 0 : _s.recList) === null || _t === void 0 ? void 0 : _t.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
501
+ const isNotNullList = (_t = (_s = result === null || result === void 0 ? void 0 : result.data) === null || _s === void 0 ? void 0 : _s.recList) === null || _t === void 0 ? void 0 : _t.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video) || (item === null || item === void 0 ? void 0 : item.multiCta));
502
502
  if (!isNotNullList) {
503
503
  setIsNoMoreData(true);
504
504
  }
505
505
  }
506
506
  let list = [];
507
- list = list.concat((_x = (_w = (_v = (_u = result === null || result === void 0 ? void 0 : result.data) === null || _u === void 0 ? void 0 : _u.recList) === null || _v === void 0 ? void 0 : _v.filter) === null || _w === void 0 ? void 0 : _w.call(_v, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _x !== void 0 ? _x : []);
507
+ list = list.concat((_x = (_w = (_v = (_u = result === null || result === void 0 ? void 0 : result.data) === null || _u === void 0 ? void 0 : _u.recList) === null || _v === void 0 ? void 0 : _v.filter) === null || _w === void 0 ? void 0 : _w.call(_v, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video) || (item === null || item === void 0 ? void 0 : item.multiCta))) !== null && _x !== void 0 ? _x : []);
508
508
  return Object.assign(Object.assign({}, result.data), { recList: list });
509
509
  }), [
510
510
  bffFetch,
@@ -898,11 +898,19 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
898
898
  onUpdateSchema === null || onUpdateSchema === void 0 ? void 0 : onUpdateSchema(curData === null || curData === void 0 ? void 0 : curData.data);
899
899
  if ((_j = (_h = (_g = (_f = gldata === null || gldata === void 0 ? void 0 : gldata.consent) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.item) === null || _h === void 0 ? void 0 : _h.props) === null || _j === void 0 ? void 0 : _j.privacy_necessity)
900
900
  setShowConsent(true);
901
+ else
902
+ setShowConsent(true);
901
903
  }
902
904
  else {
905
+ console.warn(`[SxpDataSourceProvider] Layout variant ${id} not found in dataList (count: ${(dataList === null || dataList === void 0 ? void 0 : dataList.length) || 0}), using default page config`);
906
+ gldata = globalConfig;
903
907
  setShowConsent(true);
904
908
  }
905
909
  }
910
+ else {
911
+ gldata = globalConfig;
912
+ setShowConsent(true);
913
+ }
906
914
  }
907
915
  else {
908
916
  setShowConsent(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.20.24",
3
+ "version": "1.20.26",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",