@antglobal/copilot-cards-web 1.0.1 → 1.0.2

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.
Files changed (2) hide show
  1. package/dist/index.js +10 -9
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -4402,19 +4402,20 @@ class CardSteps extends BaseElement {
4402
4402
  renderIcon(item, status, size) {
4403
4403
  const icon = item.icon;
4404
4404
  const svgSize = Math.round(size * 0.6);
4405
- // Custom image icon
4406
- if (icon?.src) {
4407
- return `<img src="${icon.src}" width="${size}" height="${size}" alt="" />`;
4408
- }
4409
- // Custom emoji/text icon
4410
- if (icon?.name) {
4405
+ // Custom image, built-in SVG, or emoji/text icon
4406
+ if (icon?.src || icon?.name) {
4411
4407
  const bg = icon.bgColor ?? 'transparent';
4412
- const color = icon.color ?? 'currentColor';
4408
+ const content = renderIconContent({
4409
+ src: icon.src,
4410
+ name: icon.name,
4411
+ size,
4412
+ color: icon.color ?? 'currentColor',
4413
+ });
4413
4414
  return `
4414
4415
  <span class="icon-emoji"
4415
- style="background:${bg}; color:${color}; width:${size}px; height:${size}px;
4416
+ style="background:${bg}; width:${size}px; height:${size}px;
4416
4417
  border-radius:50%; display:inline-flex; align-items:center; justify-content:center; box-sizing:border-box;">
4417
- ${icon.name}
4418
+ ${content}
4418
4419
  </span>`;
4419
4420
  }
4420
4421
  // Status default icon
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antglobal/copilot-cards-web",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Web Component renderer for copilot bot card SDK — PC + Mobile + WebView unified rendering via Custom Elements",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -28,7 +28,7 @@
28
28
  ],
29
29
  "license": "MIT",
30
30
  "dependencies": {
31
- "@antglobal/copilot-cards-core": "^1.0.1",
31
+ "@antglobal/copilot-cards-core": "^1.0.2",
32
32
  "echarts": "^5.6.0",
33
33
  "marked": "^18.0.5",
34
34
  "tslib": "^2.8.1",