@octanejs/phosphor-icons 0.0.1 → 0.0.3
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/package.json +3 -3
- package/src/IconBase.ts +14 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/phosphor-icons",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"octane": "0.1.
|
|
43
|
+
"octane": "0.1.23"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@phosphor-icons/core": "2.1.1",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"react": "^19.2.7",
|
|
51
51
|
"react-dom": "^19.2.7",
|
|
52
52
|
"vitest": "^4.1.10",
|
|
53
|
-
"octane": "0.1.
|
|
53
|
+
"octane": "0.1.23"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"generate": "node scripts/generate.mjs",
|
package/src/IconBase.ts
CHANGED
|
@@ -27,11 +27,22 @@ export function IconBase(props: IconBaseProps) {
|
|
|
27
27
|
...contextRest,
|
|
28
28
|
...rest,
|
|
29
29
|
ref,
|
|
30
|
+
// Everything below shares ONE array child, so each entry needs a key or
|
|
31
|
+
// octane reconciles it by position and warns. Upstream never hits this:
|
|
32
|
+
// its `weights` map holds a single ReactElement per weight, while this
|
|
33
|
+
// port stores `[tag, attributes]` tuples so the generated icons stay
|
|
34
|
+
// tree-shakeable — which makes the keys this package's job.
|
|
35
|
+
//
|
|
36
|
+
// The primitives of a weight are a fixed, never-reordered sequence, so the
|
|
37
|
+
// index is their stable identity. Pairing it with the tag means switching
|
|
38
|
+
// weight reuses a node when the element type matches at that position and
|
|
39
|
+
// replaces it when it does not, instead of patching a <path> into a
|
|
40
|
+
// <circle>.
|
|
30
41
|
children: [
|
|
31
|
-
...(alt ? [createElement('title', { children: alt })] : []),
|
|
42
|
+
...(alt ? [createElement('title', { key: 'title', children: alt })] : []),
|
|
32
43
|
...(Array.isArray(children) ? children : children == null ? [] : [children]),
|
|
33
|
-
...weights[weight ?? contextWeight].map(([tag, attributes]) =>
|
|
34
|
-
createElement(tag, attributes),
|
|
44
|
+
...weights[weight ?? contextWeight].map(([tag, attributes], index) =>
|
|
45
|
+
createElement(tag, { key: `${tag}-${index}`, ...attributes }),
|
|
35
46
|
),
|
|
36
47
|
],
|
|
37
48
|
});
|