svelte-animated-icon 1.0.0 → 1.0.1
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 +17 -56
- package/package.json +6 -4
- package/dist/utils/globalstores.d.ts +0 -2
- package/dist/utils/globalstores.js +0 -13
- package/dist/utils/localpulls.d.ts +0 -8
- package/dist/utils/localpulls.js +0 -29
package/README.md
CHANGED
|
@@ -1,65 +1,26 @@
|
|
|
1
|
-
# Svelte
|
|
1
|
+
# Svelte Animated Icon
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Svelte Animated Icon is a Svelte 5 animated icon library - tree-shakeable, multi-library, and powered by the native Web Animations API. Created by Fractaldesign.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Project
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- **Github:** This repo at [Github](https://github.com/fractalmandala/svelte-animated-icon).
|
|
8
|
+
- **Built with:** SvelteKit 2, Svelte 5, the `@sveltejs/package` packaging tool, and `mdsvex` for these docs.
|
|
9
|
+
- **Animation engine:** the browser's Web Animations API. No animation library dependency.
|
|
10
|
+
- **Site:** [www.svelte-animated-icon.vercel.app/](https://svelte-animated-icon.vercel.app/).
|
|
11
|
+
- **Getting Started:** [Start Here](/docs/01-introduction).
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
[](https://www.npmjs.com/package/svelte-animated-icon)
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
# create a new project in the current directory
|
|
13
|
-
npx sv create
|
|
15
|
+
## How this site is structured
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
npx sv create my-app
|
|
17
|
-
```
|
|
17
|
+
The package and the docs site share a single SvelteKit project:
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
- `src/lib/` is the **package source** - `AnimatedIcon`, the templates, and the generated icon files.
|
|
20
|
+
- `src/routes/` is the **docs site** you're reading. The home route is an interactive explorer; everything under `/docs` is an `.md` file compiled by mdsvex.
|
|
21
|
+
- `scripts/generate.js` reads source SVGs and writes the per-icon `.svelte` files.
|
|
22
|
+
- `static/svg/` holds the raw Phosphor and Remix source SVGs.
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
# recreate this project
|
|
23
|
-
pnpm dlx sv@0.16.1 create --template library --types ts --add prettier eslint sveltekit-adapter="adapter:vercel" mdsvex --install pnpm svelte-animated-icon
|
|
24
|
-
```
|
|
24
|
+
## License
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
|
29
|
-
|
|
30
|
-
```sh
|
|
31
|
-
npm run dev
|
|
32
|
-
|
|
33
|
-
# or start the server and open the app in a new browser tab
|
|
34
|
-
npm run dev -- --open
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
|
|
38
|
-
|
|
39
|
-
## Building
|
|
40
|
-
|
|
41
|
-
To build your library:
|
|
42
|
-
|
|
43
|
-
```sh
|
|
44
|
-
npm pack
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
To create a production version of your showcase app:
|
|
48
|
-
|
|
49
|
-
```sh
|
|
50
|
-
npm run build
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
You can preview the production build with `npm run preview`.
|
|
54
|
-
|
|
55
|
-
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
|
|
56
|
-
|
|
57
|
-
## Publishing
|
|
58
|
-
|
|
59
|
-
Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
|
|
60
|
-
|
|
61
|
-
To publish your library to [npm](https://www.npmjs.com):
|
|
62
|
-
|
|
63
|
-
```sh
|
|
64
|
-
npm publish
|
|
65
|
-
```
|
|
26
|
+
The package's own source code is released under the license declared in `package.json`. The icons are MIT. See [License](/docs/05-license.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-animated-icon",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/fractalmandala/svelte-animated-icon.git"
|
|
7
|
+
},
|
|
4
8
|
"files": [
|
|
5
9
|
"dist",
|
|
6
10
|
"!dist/**/*.test.*",
|
|
@@ -43,6 +47,7 @@
|
|
|
43
47
|
},
|
|
44
48
|
"devDependencies": {
|
|
45
49
|
"@eslint/js": "^10.0.1",
|
|
50
|
+
"@formkit/auto-animate": "^0.9.0",
|
|
46
51
|
"@sveltejs/adapter-vercel": "^6.3.3",
|
|
47
52
|
"@sveltejs/kit": "^2.63.0",
|
|
48
53
|
"@sveltejs/package": "^2.5.8",
|
|
@@ -66,9 +71,6 @@
|
|
|
66
71
|
"keywords": [
|
|
67
72
|
"svelte"
|
|
68
73
|
],
|
|
69
|
-
"dependencies": {
|
|
70
|
-
"@formkit/auto-animate": "^0.9.0"
|
|
71
|
-
},
|
|
72
74
|
"scripts": {
|
|
73
75
|
"dev": "vite dev",
|
|
74
76
|
"build": "vite build && npm run prepack",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { writable } from 'svelte/store';
|
|
2
|
-
import { browser } from '$app/environment';
|
|
3
|
-
const storedDarkTheme = browser ? JSON.parse(localStorage.getItem('darkTheme') || 'false') : false;
|
|
4
|
-
export const darkTheme = writable(storedDarkTheme);
|
|
5
|
-
export function toggleTheme() {
|
|
6
|
-
if (browser) {
|
|
7
|
-
darkTheme.update((mode) => {
|
|
8
|
-
const newMode = !mode;
|
|
9
|
-
localStorage.setItem('darkTheme', JSON.stringify(newMode));
|
|
10
|
-
return newMode;
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
}
|
package/dist/utils/localpulls.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export async function allDocs(group) {
|
|
2
|
-
const posts = import.meta.glob('/src/routes/docs/*.md');
|
|
3
|
-
const allfiles = { ...posts };
|
|
4
|
-
const filed = Object.entries(allfiles);
|
|
5
|
-
const eachfiled = await Promise.all(filed.map(async ([path, resolver]) => {
|
|
6
|
-
// @ts-expect-error//why
|
|
7
|
-
const { metadata } = await resolver();
|
|
8
|
-
const pathitem = path.slice(11, -3);
|
|
9
|
-
return {
|
|
10
|
-
meta: metadata,
|
|
11
|
-
linkpath: pathitem
|
|
12
|
-
};
|
|
13
|
-
}));
|
|
14
|
-
const validPosts = eachfiled.filter((post) => post !== null);
|
|
15
|
-
const groupedPosts = validPosts
|
|
16
|
-
.filter(post => post.meta?.group?.includes(group))
|
|
17
|
-
.sort((a, b) => Number(a.meta.id) - Number(b.meta.id));
|
|
18
|
-
return groupedPosts;
|
|
19
|
-
}
|
|
20
|
-
const GROUP_ORDER = ['getting started', 'customization', 'api-reference', 'guides-and-advanced', 'others'];
|
|
21
|
-
export async function allDocsOrdered() {
|
|
22
|
-
const posts = import.meta.glob('/src/routes/docs/*.md');
|
|
23
|
-
const entries = await Promise.all(Object.entries(posts).map(async ([path, resolver]) => {
|
|
24
|
-
// @ts-expect-error untyped mdsvex metadata
|
|
25
|
-
const { metadata } = await resolver();
|
|
26
|
-
return { meta: metadata, linkpath: path.slice(11, -3) }; // "docs/introduction"
|
|
27
|
-
}));
|
|
28
|
-
return entries.sort((a, b) => Number(a.meta.id) - Number(b.meta.id));
|
|
29
|
-
}
|