luna-plus 0.0.6 → 0.0.7

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.
@@ -22,16 +22,12 @@
22
22
 
23
23
  const classes = $derived(cls ? `lm-icon ${cls}` : "lm-icon");
24
24
 
25
- // lucide 图标格式为 [tagName, svgAttrs, children]
26
- // children 是子元素数组: [[tag, attrs], [tag, attrs], ...]
25
+ // lucide 0.563.0+ 图标格式为 [[tag, attrs], [tag, attrs], ...]
27
26
  type IconTuple = [string, Record<string, any>];
28
27
  const normalized = $derived.by(() => {
29
28
  if (!icon || !Array.isArray(icon)) return [] as ReadonlyArray<IconTuple>;
30
- // lucide 格式: [tagName, svgAttrs, children]
31
- // 第三个元素 (index 2) 才是子元素数组
32
- const children = icon[2];
33
- if (!children || !Array.isArray(children)) return [] as ReadonlyArray<IconTuple>;
34
- const tuples = children.map(([tag, nodeAttrs]: any) => [
29
+ // 新格式: 直接是子元素数组 [[tag, attrs], [tag, attrs], ...]
30
+ const tuples = icon.map(([tag, nodeAttrs]: any) => [
35
31
  tag as string,
36
32
  Object.freeze({ ...nodeAttrs }),
37
33
  ]) as IconTuple[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "luna-plus",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "A modern Svelte 5 component library with 60+ components",
5
5
  "type": "module",
6
6
  "svelte": "./dist/index.js",