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
package/dist/pb-ui.js
CHANGED
|
@@ -1994,15 +1994,27 @@
|
|
|
1994
1994
|
try {
|
|
1995
1995
|
// 尝试动态导入材料库
|
|
1996
1996
|
const materialsModule = require('../../materials/sxp');
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
1997
|
+
if (materialsModule && typeof materialsModule === 'object') {
|
|
1998
|
+
Object.values(materialsModule).forEach((v) => {
|
|
1999
|
+
var _a;
|
|
2000
|
+
if ((_a = v === null || v === void 0 ? void 0 : v.extend) === null || _a === void 0 ? void 0 : _a.type) {
|
|
2001
|
+
RESOLVER$3[v.extend.type] = v;
|
|
2002
|
+
}
|
|
2003
|
+
});
|
|
2004
|
+
// 调试信息:记录成功加载的组件数量
|
|
2005
|
+
if (Object.keys(RESOLVER$3).length > 0) {
|
|
2006
|
+
console.log('[StructurePage] Successfully loaded materials:', Object.keys(RESOLVER$3));
|
|
2001
2007
|
}
|
|
2002
|
-
|
|
2008
|
+
else {
|
|
2009
|
+
console.warn('[StructurePage] Materials module loaded but no valid components found');
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
else {
|
|
2013
|
+
console.warn('[StructurePage] Materials module is not a valid object:', materialsModule);
|
|
2014
|
+
}
|
|
2003
2015
|
}
|
|
2004
2016
|
catch (error) {
|
|
2005
|
-
console.
|
|
2017
|
+
console.error('[StructurePage] Failed to load materials for StructurePage:', error);
|
|
2006
2018
|
}
|
|
2007
2019
|
// 基础样式定义
|
|
2008
2020
|
const baseStyles = {
|
|
@@ -2463,11 +2475,18 @@
|
|
|
2463
2475
|
if (editorMode && templateType && RESOLVER$3[templateType]) {
|
|
2464
2476
|
const TemplateComponent = RESOLVER$3[templateType];
|
|
2465
2477
|
const templateExtend = TemplateComponent === null || TemplateComponent === void 0 ? void 0 : TemplateComponent.extend;
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2478
|
+
// 严格检查组件是否有效
|
|
2479
|
+
if (templateExtend && typeof TemplateComponent === 'function') {
|
|
2480
|
+
try {
|
|
2481
|
+
// 准备模版组件的 props
|
|
2482
|
+
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);
|
|
2483
|
+
// 渲染模版组件
|
|
2484
|
+
return React.createElement(TemplateComponent, templateProps);
|
|
2485
|
+
}
|
|
2486
|
+
catch (error) {
|
|
2487
|
+
console.error(`[StructurePage] Failed to render template component ${templateType}:`, error);
|
|
2488
|
+
// 降级到默认按钮
|
|
2489
|
+
}
|
|
2471
2490
|
}
|
|
2472
2491
|
}
|
|
2473
2492
|
// 默认渲染按钮
|