@fest-lib/image 0.1.15 → 0.1.17

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.
Files changed (2) hide show
  1. package/README.md +42 -11
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,34 +1,65 @@
1
- # Image.TS
1
+ <p align="center">
2
+ <strong>@fest-lib/image</strong><br>
3
+ Orientation-aware wallpaper canvas + K-Means seeds for Veela (<code>--color-primary</code> / secondary / tertiary).
4
+ </p>
2
5
 
3
- `@fest-lib/image` — orientation-aware wallpaper / canvas paint plus K-Means theme extraction for Veela tokens (`--color-primary` / secondary / tertiary).
6
+ <p align="center">
7
+ <a href="https://www.npmjs.com/package/@fest-lib/image"><img src="https://img.shields.io/npm/v/@fest-lib/image?style=flat-square" alt="npm"></a>
8
+ <a href="LICENSE"><img src="https://img.shields.io/npm/l/@fest-lib/image?style=flat-square" alt="MIT"></a>
9
+ <a href="https://github.com/fest-live/image.ts"><img src="https://img.shields.io/github/stars/fest-live/image.ts?style=flat-square" alt="stars"></a>
10
+ </p>
4
11
 
5
- Caches the last wallpaper URL and seed colors so a reload can skip re-clustering.
12
+ Caches the last wallpaper URL and seed colors so a reload can skip re-clustering. Paint target: `[data-app-layer="canvas"] canvas[is="ui-canvas"]`.
13
+
14
+ ```text
15
+ core · dom · object · lure
16
+ └── fest/image ← you are here
17
+ └── shell wallpaper · Material You seed
18
+ ```
6
19
 
7
20
  ## Install
8
21
 
9
22
  ```bash
10
- npm install @fest-lib/image
23
+ npm install @fest-lib/core @fest-lib/dom @fest-lib/object @fest-lib/lure @fest-lib/image
11
24
  ```
12
25
 
26
+ Peers: `core`, `dom`, `object`, `lure`. Also uses `culori`.
27
+
13
28
  ```ts
14
29
  import {
15
- applyThemeFromWallpaper,
16
- setAppWallpaper,
17
- syncAppWallpaperOrient
30
+ setAppWallpaper,
31
+ setAppWallpaperFromBlob,
32
+ applyThemeFromWallpaper,
33
+ syncAppWallpaperOrient
18
34
  } from "@fest-lib/image";
19
35
 
20
- await setAppWallpaper(url);
21
- await applyThemeFromWallpaper(url);
36
+ setAppWallpaper("/wallpapers/desk.jpg");
37
+ await applyThemeFromWallpaper("/wallpapers/desk.jpg");
22
38
  syncAppWallpaperOrient();
39
+
40
+ await setAppWallpaperFromBlob(file); // Blob | File
23
41
  ```
24
42
 
43
+ `setAppWallpaper(url)` is sync at the call site (persist + theme run in the background). `applyThemeFromWallpaper(url, { force: true })` re-clusters even if the URL matches the cache.
44
+
25
45
  ## Layout
26
46
 
27
47
  | Path | Role |
28
48
  | --- | --- |
29
49
  | `src/engine/KMean.ts` | dominant colors |
30
50
  | `src/engine/WallpaperTheme.ts` | seeds → theme hosts |
31
- | `src/canvas/Canvas.ts` | cover/orient paint |
51
+ | `src/canvas/Canvas.ts` | cover / orient paint |
32
52
  | `src/canvas/Canvas-2.ts` | app wallpaper layer + IDB |
33
53
 
34
- Peers: `@fest-lib/core`, `dom`, `object`, `lure`. Build: `npm run build`. Publish: `npm run publish`.
54
+ Do not rewrite K-Means or the Canvas-2 paint path unless that is the task — they are the SoT for shell wallpaper.
55
+
56
+ ## Workspace
57
+
58
+ ```bash
59
+ cd modules/projects/image.ts
60
+ npm run dev
61
+ npm run build
62
+ npm run publish
63
+ ```
64
+
65
+ License: [MIT](LICENSE).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fest-lib/image",
3
3
  "description": "fest-lib image: orient-aware wallpaper canvas and K-Means theme seeds",
4
- "version": "0.1.15",
4
+ "version": "0.1.17",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "sideEffects": true,
@@ -67,7 +67,7 @@
67
67
  "docs:md": "typedoc --options ./typedoc.md.json",
68
68
  "docs:md:clean": "rm -rf ./docs-md && typedoc --options ./typedoc.md.json",
69
69
  "release": "PUPPETEER_SKIP_DOWNLOAD=1 npm run build:publish && npm publish --access public --ignore-scripts",
70
- "publish": "npm run release"
70
+ "publish": "node ../scripts/bump-patch-version.mjs && npm run release"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@types/node": ">=22.8.1",