km-card-layout-core 0.1.21 → 0.1.22

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.
@@ -10,6 +10,6 @@ function buildRenderData(layout, items, config) {
10
10
  renderLayout = (0, changeBackground_1.setElementVisible)(renderLayout, 'image', config.showAvatar);
11
11
  renderLayout = (0, changeBackground_1.setElementVisible)(renderLayout, 'logo', config.showLogo);
12
12
  // 设置背景
13
- renderLayout = renderLayout.map((la, index) => (0, changeBackground_1.backgroundChange)(config.currentBg[index], la));
13
+ renderLayout = renderLayout.map((la, index) => config.currentBg[index] ? (0, changeBackground_1.backgroundChange)(config.currentBg[index], la) : la);
14
14
  return renderLayout;
15
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "km-card-layout-core",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "Shared render helpers for CardMaster layout JSON (binding resolution, layout normalization).",
5
5
  "main": "dist/index.js",
6
6
  "types": "types.d.ts",
package/render/tool.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { CardLayoutSchema, TemplateItem } from "../interface";
2
- import { backgroundChange, setElementVisible } from "../ops/changeBackground";
3
- import { Config } from "../types";
4
- import { applyItemCollectBindings } from "../utils";
1
+ import { CardLayoutSchema, TemplateItem } from '../interface';
2
+ import { backgroundChange, setElementVisible } from '../ops/changeBackground';
3
+ import { Config } from '../types';
4
+ import { applyItemCollectBindings } from '../utils';
5
5
 
6
6
  export function buildRenderData(
7
7
  layout: CardLayoutSchema[],
@@ -15,7 +15,7 @@ export function buildRenderData(
15
15
  renderLayout = setElementVisible(renderLayout, 'logo', config.showLogo);
16
16
  // 设置背景
17
17
  renderLayout = renderLayout.map((la, index) =>
18
- backgroundChange(config.currentBg[index], la)
18
+ config.currentBg[index] ? backgroundChange(config.currentBg[index], la) : la
19
19
  );
20
20
  return renderLayout;
21
- }
21
+ }