pb-sxp-ui 1.20.15 → 1.20.17
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 +30 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +30 -11
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +5 -5
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +5 -5
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +30 -11
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +5 -5
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/StructurePage/index.js +25 -9
- package/lib/core/components/StructurePage/index.js +25 -9
- package/package.json +1 -1
|
@@ -5,15 +5,26 @@ import FormatImage from '../SxpPageRender/FormatImage';
|
|
|
5
5
|
const RESOLVER = {};
|
|
6
6
|
try {
|
|
7
7
|
const materialsModule = require('../../materials/sxp');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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');
|
|
12
20
|
}
|
|
13
|
-
}
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
console.warn('[StructurePage] Materials module is not a valid object:', materialsModule);
|
|
24
|
+
}
|
|
14
25
|
}
|
|
15
26
|
catch (error) {
|
|
16
|
-
console.
|
|
27
|
+
console.error('[StructurePage] Failed to load materials for StructurePage:', error);
|
|
17
28
|
}
|
|
18
29
|
const baseStyles = {
|
|
19
30
|
container: {
|
|
@@ -444,9 +455,14 @@ const StructurePage = (_a) => {
|
|
|
444
455
|
if (editorMode && templateType && RESOLVER[templateType]) {
|
|
445
456
|
const TemplateComponent = RESOLVER[templateType];
|
|
446
457
|
const templateExtend = TemplateComponent === null || TemplateComponent === void 0 ? void 0 : TemplateComponent.extend;
|
|
447
|
-
if (templateExtend) {
|
|
448
|
-
|
|
449
|
-
|
|
458
|
+
if (templateExtend && typeof TemplateComponent === 'function') {
|
|
459
|
+
try {
|
|
460
|
+
const templateProps = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (_a = templateExtend.defaulSetting) === null || _a === void 0 ? void 0 : _a.props), { style: Object.assign(Object.assign(Object.assign({}, (_b = templateExtend.defaulSetting) === null || _b === void 0 ? void 0 : _b.style), mergeStyles(fallbackStyle || {}, buttonKey)), { marginBottom: 0, width: '100%' }), textStyle: (_c = templateExtend.defaulSetting) === null || _c === void 0 ? void 0 : _c.textStyle }), (productData && { bindProduct: productData })), { isTel: true }), rest);
|
|
461
|
+
return React.createElement(TemplateComponent, templateProps);
|
|
462
|
+
}
|
|
463
|
+
catch (error) {
|
|
464
|
+
console.error(`[StructurePage] Failed to render template component ${templateType}:`, error);
|
|
465
|
+
}
|
|
450
466
|
}
|
|
451
467
|
}
|
|
452
468
|
return (React.createElement("button", { style: mergeStyles(fallbackStyle || baseStyles.heroButton, buttonKey), onClick: () => handleCtaClick(ctaData === null || ctaData === void 0 ? void 0 : ctaData.link, interaction, productData, ctaData) }, ctaData.title));
|
|
@@ -7,15 +7,26 @@ const FormatImage_1 = tslib_1.__importDefault(require("../SxpPageRender/FormatIm
|
|
|
7
7
|
const RESOLVER = {};
|
|
8
8
|
try {
|
|
9
9
|
const materialsModule = require('../../materials/sxp');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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');
|
|
14
22
|
}
|
|
15
|
-
}
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
console.warn('[StructurePage] Materials module is not a valid object:', materialsModule);
|
|
26
|
+
}
|
|
16
27
|
}
|
|
17
28
|
catch (error) {
|
|
18
|
-
console.
|
|
29
|
+
console.error('[StructurePage] Failed to load materials for StructurePage:', error);
|
|
19
30
|
}
|
|
20
31
|
const baseStyles = {
|
|
21
32
|
container: {
|
|
@@ -446,9 +457,14 @@ const StructurePage = (_a) => {
|
|
|
446
457
|
if (editorMode && templateType && RESOLVER[templateType]) {
|
|
447
458
|
const TemplateComponent = RESOLVER[templateType];
|
|
448
459
|
const templateExtend = TemplateComponent === null || TemplateComponent === void 0 ? void 0 : TemplateComponent.extend;
|
|
449
|
-
if (templateExtend) {
|
|
450
|
-
|
|
451
|
-
|
|
460
|
+
if (templateExtend && typeof TemplateComponent === 'function') {
|
|
461
|
+
try {
|
|
462
|
+
const templateProps = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (_a = templateExtend.defaulSetting) === null || _a === void 0 ? void 0 : _a.props), { style: Object.assign(Object.assign(Object.assign({}, (_b = templateExtend.defaulSetting) === null || _b === void 0 ? void 0 : _b.style), mergeStyles(fallbackStyle || {}, buttonKey)), { marginBottom: 0, width: '100%' }), textStyle: (_c = templateExtend.defaulSetting) === null || _c === void 0 ? void 0 : _c.textStyle }), (productData && { bindProduct: productData })), { isTel: true }), rest);
|
|
463
|
+
return react_1.default.createElement(TemplateComponent, templateProps);
|
|
464
|
+
}
|
|
465
|
+
catch (error) {
|
|
466
|
+
console.error(`[StructurePage] Failed to render template component ${templateType}:`, error);
|
|
467
|
+
}
|
|
452
468
|
}
|
|
453
469
|
}
|
|
454
470
|
return (react_1.default.createElement("button", { style: mergeStyles(fallbackStyle || baseStyles.heroButton, buttonKey), onClick: () => handleCtaClick(ctaData === null || ctaData === void 0 ? void 0 : ctaData.link, interaction, productData, ctaData) }, ctaData.title));
|