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.
- package/dist/Icon/Icon.svelte +3 -7
- package/package.json +1 -1
package/dist/Icon/Icon.svelte
CHANGED
|
@@ -22,16 +22,12 @@
|
|
|
22
22
|
|
|
23
23
|
const classes = $derived(cls ? `lm-icon ${cls}` : "lm-icon");
|
|
24
24
|
|
|
25
|
-
// lucide 图标格式为 [
|
|
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
|
-
//
|
|
31
|
-
|
|
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[];
|