morphicons 1.7.0 → 2.0.0
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/README.md +61 -428
- package/dist/MorphIcon.astro +4 -2
- package/dist/MorphIcon.svelte +19 -8
- package/dist/adapters.d.ts +12 -11
- package/dist/adapters.js +223 -23
- package/dist/{controller-CXZuwJ_M.js → controller--7SSBggk.js} +45 -11
- package/dist/{controller-Dkruvf3Y.d.ts → controller-DKm8s2ni.d.ts} +15 -6
- package/dist/dom.d.ts +2 -2
- package/dist/dom.js +292 -31
- package/dist/element.d.ts +7 -6
- package/dist/element.js +18 -5
- package/dist/index-DDNCPQ4Z.d.ts +55 -0
- package/dist/{index-DXp5b6BU.d.ts → index-DpvKR75N.d.ts} +26 -3
- package/dist/index.d.ts +12 -47
- package/dist/index.js +2 -1
- package/dist/plan-DhaDhEVq.d.ts +76 -0
- package/dist/react-native.d.ts +7 -6
- package/dist/react-native.js +65 -11
- package/dist/react.d.ts +7 -6
- package/dist/react.js +32 -7
- package/dist/region-BjECuWZR.js +60 -0
- package/dist/region.d.ts +2 -0
- package/dist/region.js +819 -0
- package/dist/{spring-CFHloqPP.js → resample-CXlaZ5ZQ.js} +56 -142
- package/dist/spring-B_P92nf6.js +95 -0
- package/dist/spring-BgZHrI2W.d.ts +33 -0
- package/dist/svelte-shared.d.ts +6 -5
- package/dist/svelte-shared.js +1 -2
- package/dist/vue.d.ts +6 -5
- package/dist/vue.js +31 -7
- package/package.json +62 -36
- package/dist/types-JAF3s76Y.d.ts +0 -60
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "morphicons",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Universal morphing for
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Universal morphing for SVG icons, stroked or filled, with spring physics and zero runtime dependencies",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Guillermo (https://guillermolg.com)",
|
|
7
7
|
"homepage": "https://www.morphicons.com",
|
|
@@ -59,6 +59,10 @@
|
|
|
59
59
|
"types": "./dist/adapters.d.ts",
|
|
60
60
|
"default": "./dist/adapters.js"
|
|
61
61
|
},
|
|
62
|
+
"./region": {
|
|
63
|
+
"types": "./dist/region.d.ts",
|
|
64
|
+
"default": "./dist/region.js"
|
|
65
|
+
},
|
|
62
66
|
"./react": {
|
|
63
67
|
"types": "./dist/react.d.ts",
|
|
64
68
|
"default": "./dist/react.js"
|
|
@@ -116,6 +120,10 @@
|
|
|
116
120
|
"test": "bun test",
|
|
117
121
|
"typecheck": "tsc --noEmit && tsc -p playground --noEmit && tsc -p tsconfig.react.json --noEmit && tsc -p tsconfig.react-native.json --noEmit && tsc -p tsconfig.vue.json --noEmit && tsc -p tsconfig.svelte.json --noEmit && tsc -p tsconfig.element.json --noEmit",
|
|
118
122
|
"play": "bun ./playground/index.html",
|
|
123
|
+
"play:regions": "bun scripts/serve-regions.ts",
|
|
124
|
+
"bench:regions": "bun bench/region.bench.ts",
|
|
125
|
+
"bench:topology": "bun bench/region-topology.ts",
|
|
126
|
+
"bench:wide": "bun bench/region-wide.ts",
|
|
119
127
|
"lint": "biome check .",
|
|
120
128
|
"format": "biome check --write .",
|
|
121
129
|
"build": "tsdown && bun scripts/build-svelte.ts && bun scripts/build-astro.ts",
|
|
@@ -134,21 +142,31 @@
|
|
|
134
142
|
"name": "core + dom (createMorph + scheduler)",
|
|
135
143
|
"path": "dist/dom.js",
|
|
136
144
|
"import": "*",
|
|
137
|
-
"limit": "
|
|
145
|
+
"limit": "9.3 KB",
|
|
146
|
+
"gzip": true,
|
|
147
|
+
"ignore": [
|
|
148
|
+
"./region.js"
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"name": "region normalizer (morphicons/region standalone; lazy chunk of every binding)",
|
|
153
|
+
"path": "dist/region.js",
|
|
154
|
+
"import": "*",
|
|
155
|
+
"limit": "11.2 KB",
|
|
138
156
|
"gzip": true
|
|
139
157
|
},
|
|
140
158
|
{
|
|
141
159
|
"name": "adapters (aggregate — grows by design, see per-export gates)",
|
|
142
160
|
"path": "dist/adapters.js",
|
|
143
161
|
"import": "*",
|
|
144
|
-
"limit": "
|
|
162
|
+
"limit": "5.7 KB",
|
|
145
163
|
"gzip": true
|
|
146
164
|
},
|
|
147
165
|
{
|
|
148
166
|
"name": "adapters › svgToIcon (per-export shakeability gate)",
|
|
149
167
|
"path": "dist/adapters.js",
|
|
150
168
|
"import": "{ svgToIcon }",
|
|
151
|
-
"limit": "
|
|
169
|
+
"limit": "4.7 KB",
|
|
152
170
|
"gzip": true
|
|
153
171
|
},
|
|
154
172
|
{
|
|
@@ -170,21 +188,16 @@
|
|
|
170
188
|
"path": "dist/react.js",
|
|
171
189
|
"import": "*",
|
|
172
190
|
"ignore": [
|
|
173
|
-
"
|
|
191
|
+
"./region.js"
|
|
174
192
|
],
|
|
175
|
-
"limit": "
|
|
193
|
+
"limit": "10.3 KB",
|
|
176
194
|
"gzip": true
|
|
177
195
|
},
|
|
178
196
|
{
|
|
179
|
-
"name": "core + dom + react-native (MorphIcon, react/rn/rnsvg external)",
|
|
197
|
+
"name": "core + dom + react-native (MorphIcon, react/rn/rnsvg external; Metro inlines the region chunk)",
|
|
180
198
|
"path": "dist/react-native.js",
|
|
181
199
|
"import": "*",
|
|
182
|
-
"
|
|
183
|
-
"react",
|
|
184
|
-
"react-native",
|
|
185
|
-
"react-native-svg"
|
|
186
|
-
],
|
|
187
|
-
"limit": "9 KB",
|
|
200
|
+
"limit": "16 KB",
|
|
188
201
|
"gzip": true
|
|
189
202
|
},
|
|
190
203
|
{
|
|
@@ -192,9 +205,9 @@
|
|
|
192
205
|
"path": "dist/vue.js",
|
|
193
206
|
"import": "*",
|
|
194
207
|
"ignore": [
|
|
195
|
-
"
|
|
208
|
+
"./region.js"
|
|
196
209
|
],
|
|
197
|
-
"limit": "
|
|
210
|
+
"limit": "10.3 KB",
|
|
198
211
|
"gzip": true
|
|
199
212
|
},
|
|
200
213
|
{
|
|
@@ -202,9 +215,9 @@
|
|
|
202
215
|
"path": "dist/svelte-shared.js",
|
|
203
216
|
"import": "*",
|
|
204
217
|
"ignore": [
|
|
205
|
-
"
|
|
218
|
+
"./region.js"
|
|
206
219
|
],
|
|
207
|
-
"limit": "
|
|
220
|
+
"limit": "9.9 KB",
|
|
208
221
|
"gzip": true
|
|
209
222
|
},
|
|
210
223
|
{
|
|
@@ -220,8 +233,11 @@
|
|
|
220
233
|
"name": "core + dom + element (<morph-icon> custom element)",
|
|
221
234
|
"path": "dist/element.js",
|
|
222
235
|
"import": "*",
|
|
223
|
-
"limit": "
|
|
224
|
-
"gzip": true
|
|
236
|
+
"limit": "11.2 KB",
|
|
237
|
+
"gzip": true,
|
|
238
|
+
"ignore": [
|
|
239
|
+
"./region.js"
|
|
240
|
+
]
|
|
225
241
|
},
|
|
226
242
|
{
|
|
227
243
|
"name": "astro shell (ships as source, consumer-compiled)",
|
|
@@ -234,24 +250,34 @@
|
|
|
234
250
|
}
|
|
235
251
|
],
|
|
236
252
|
"devDependencies": {
|
|
237
|
-
"@biomejs/biome": "^2.5.
|
|
238
|
-
"@happy-dom/global-registrator": "^20.
|
|
239
|
-
"@
|
|
240
|
-
"@
|
|
241
|
-
"@
|
|
242
|
-
"@
|
|
243
|
-
"@
|
|
253
|
+
"@biomejs/biome": "^2.5.15",
|
|
254
|
+
"@happy-dom/global-registrator": "^20.14.6",
|
|
255
|
+
"@iconify-json/bi": "^1.2.7",
|
|
256
|
+
"@iconify-json/heroicons": "^1.2.3",
|
|
257
|
+
"@iconify-json/iconoir": "^1.2.12",
|
|
258
|
+
"@iconify-json/lucide": "^1.2.144",
|
|
259
|
+
"@iconify-json/material-symbols": "^1.2.95",
|
|
260
|
+
"@iconify-json/mdi": "^1.2.3",
|
|
261
|
+
"@iconify-json/mingcute": "^1.2.8",
|
|
262
|
+
"@iconify-json/ph": "^1.2.2",
|
|
263
|
+
"@iconify-json/ri": "^1.2.10",
|
|
264
|
+
"@iconify-json/tabler": "^1.2.42",
|
|
265
|
+
"@size-limit/preset-small-lib": "^13.1.1",
|
|
266
|
+
"@tabler/icons": "^3.49.0",
|
|
267
|
+
"@types/bun": "^1.4.3",
|
|
268
|
+
"@types/react": "^19.3.0",
|
|
269
|
+
"@types/react-dom": "^19.3.0",
|
|
244
270
|
"feather-icons": "^4.29.2",
|
|
245
|
-
"happy-dom": "^20.
|
|
246
|
-
"lucide": "^1.
|
|
247
|
-
"react": "^19.
|
|
248
|
-
"react-dom": "^19.
|
|
249
|
-
"react-native": "^0.
|
|
271
|
+
"happy-dom": "^20.14.6",
|
|
272
|
+
"lucide": "^1.57.0",
|
|
273
|
+
"react": "^19.3.1",
|
|
274
|
+
"react-dom": "^19.3.1",
|
|
275
|
+
"react-native": "^0.87.1",
|
|
250
276
|
"react-native-svg": "^15.15.5",
|
|
251
|
-
"size-limit": "^13.
|
|
252
|
-
"svelte": "^5.
|
|
253
|
-
"tsdown": "^0.
|
|
277
|
+
"size-limit": "^13.1.1",
|
|
278
|
+
"svelte": "^5.57.2",
|
|
279
|
+
"tsdown": "^0.23.1",
|
|
254
280
|
"typescript": "^7.0.2",
|
|
255
|
-
"vue": "^3.5.
|
|
281
|
+
"vue": "^3.5.44"
|
|
256
282
|
}
|
|
257
283
|
}
|
package/dist/types-JAF3s76Y.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
//#region src/core/spring.d.ts
|
|
2
|
-
declare class Spring {
|
|
3
|
-
x: number;
|
|
4
|
-
v: number;
|
|
5
|
-
k: number;
|
|
6
|
-
c: number;
|
|
7
|
-
config(k: number, c: number): void;
|
|
8
|
-
/** Starts (or restarts mid-flight) preserving velocity. */
|
|
9
|
-
start(): void;
|
|
10
|
-
/** Advances dt seconds. Returns true on settle (|1−x| < 0.001 ∧ |v| < 0.02). */
|
|
11
|
-
step(dt: number): boolean;
|
|
12
|
-
}
|
|
13
|
-
/** Spring presets (ζ = c/(2√k)) with the API's public names. */
|
|
14
|
-
declare const SPRING_PRESETS: {
|
|
15
|
-
/** ζ = 1.00 — critically damped, no overshoot. */
|
|
16
|
-
readonly smooth: {
|
|
17
|
-
readonly k: 170;
|
|
18
|
-
readonly c: 26;
|
|
19
|
-
};
|
|
20
|
-
/** ζ = 0.73 — fast, subtle overshoot. */
|
|
21
|
-
readonly snappy: {
|
|
22
|
-
readonly k: 420;
|
|
23
|
-
readonly c: 30;
|
|
24
|
-
};
|
|
25
|
-
/** ζ = 0.40 — playful. */
|
|
26
|
-
readonly bouncy: {
|
|
27
|
-
readonly k: 300;
|
|
28
|
-
readonly c: 14;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
type SpringPreset = keyof typeof SPRING_PRESETS;
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/core/types.d.ts
|
|
34
|
-
/** Attributes of an icon node (values as Lucide exports them: string or
|
|
35
|
-
* number). `undefined` is allowed on purpose — lucide's SVGProps includes it
|
|
36
|
-
* and the runtime treats an undefined attr as absent (fallback). */
|
|
37
|
-
type IconNodeAttrs = Record<string, string | number | undefined>;
|
|
38
|
-
/** Lucide-style icon data: a `[tag, attrs]` list. Structurally typed —
|
|
39
|
-
* Lucide is neither a dependency nor a peer; Feather/Tabler/custom paths
|
|
40
|
-
* work just the same. */
|
|
41
|
-
type IconNode = ReadonlyArray<readonly [string, IconNodeAttrs]>;
|
|
42
|
-
/** Input accepted by the core: an IconNode or a raw `d` attribute.
|
|
43
|
-
* (SVGElement is resolved in the dom layer — the core never touches DOM.) */
|
|
44
|
-
type IconInput = IconNode | string;
|
|
45
|
-
/** Normalized subpath: a chain of cubics packed as points
|
|
46
|
-
* [p0, c1, c2, p1, c1', c2', p2, …] → Float64Array of length 2·(3m+1),
|
|
47
|
-
* with m = number of segments. Consecutive segments share an endpoint. */
|
|
48
|
-
interface CubicPath {
|
|
49
|
-
pts: Float64Array;
|
|
50
|
-
closed: boolean;
|
|
51
|
-
}
|
|
52
|
-
/** Subpath sampled at N points by arc length + its topology. It is the
|
|
53
|
-
* currency between resample and plan; an intermediate shape (interruption)
|
|
54
|
-
* is also a list of Sampled. */
|
|
55
|
-
interface Sampled {
|
|
56
|
-
pts: Float64Array;
|
|
57
|
-
closed: boolean;
|
|
58
|
-
}
|
|
59
|
-
//#endregion
|
|
60
|
-
export { Sampled as a, SpringPreset as c, IconNodeAttrs as i, IconInput as n, SPRING_PRESETS as o, IconNode as r, Spring as s, CubicPath as t };
|