@usenavii/core 0.3.0 → 0.5.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/CHANGELOG.md ADDED
@@ -0,0 +1,133 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@usenavii/core` and `@usenavii/react`.
4
+
5
+ Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versioning: [SemVer](https://semver.org). Both packages ship in lockstep.
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.22.0] - 2026-05-26
10
+
11
+ ### Added (`@usenavii/core` 0.5.0)
12
+ - **Pack overhaul** — all 7 packs given distinct visual identities via new render flags (`flat`, `bgColor`, `featureStroke`, `paletteExclusive`, `glow`). Each pack now reads as a different illustration system, not just a recoloring.
13
+ - **New body shapes** (pack-only, base seeds unchanged): `squircle` (full-bleed corporate tile), `pumpkin`, `ghost`, `skullHead`.
14
+ - **New mouth styles** (pack-only): `jagged` (carved-pumpkin grin), `fangs` (vampire teeth).
15
+ - **New toppers**: `witchHat`, `pumpkinStem`, `ghostSheet`, `bob`, `bun`, `ponytail`.
16
+ - **New accessory**: `earring` (palette-themed stud + drop pair).
17
+ - **New outfit**: `tie` (corporate necktie — knot + tapered blade).
18
+ - **`Pack.glow`** flag emits an outer-glow SVG filter behind the body (Gaussian blur tinted by palette). Used by Neon.
19
+ - **`AvatarSpec.flat` / `bgColor` / `featureStroke` / `glow`** — render directives the engine reads to alter body/face rendering per enabled pack.
20
+ - **`featureStroke` multiplier** scales stroke widths on eyes, mouth, glasses uniformly. Office bumps to 1.35, Neon 1.5, Mono down to 1.15 (delicate).
21
+ - **New `office-bright` pack** — vivid sibling of Office for marketing/design teams.
22
+
23
+ ### Changed (`@usenavii/core` 0.5.0)
24
+ - Pack picks now **authoritative** — `resolvePartPool` no longer intersects against base pool, so packs can introduce ids unknown to the base (e.g. Office's squircle). Type system enforces validity.
25
+ - Office, Halloween, Pastel, Neon, Mono, Earth packs reauthored with theme-cohesive picks, style hints, and exclusive palette pools.
26
+ - Office uses full-bleed squircle + white plate + necktie outfits + bolder strokes for ID-badge look.
27
+ - Halloween uses pumpkin/ghost/skullHead bodies + jagged/fangs mouths + witchHat/stem/sheet toppers + dark night plate.
28
+ - Neon emits an outer glow halo via SVG filter behind the body.
29
+ - Mono switched to full-bleed squircle (was contained orb) for editorial tile look.
30
+
31
+ ### Added (API host)
32
+ - **Polar.sh license verification** — `POST /license/verify` now proxies to Polar's `/v1/customer-portal/license-keys/validate` (replaces Gumroad). Validates `status === 'granted'`, expiry, and optional benefit-id match.
33
+ - **`GET /checkout`** — redirects to Polar checkout w/ configured product preselected. Powered by `@polar-sh/hono`.
34
+ - **`GET /portal`** — Polar customer portal proxy (license re-fetch, refund request).
35
+ - **`POST /polar/webhooks`** — signature-verified webhook receiver, logs events.
36
+ - New env vars: `POLAR_ORGANIZATION_ID`, `POLAR_PRODUCT_ID`, `POLAR_BENEFIT_ID`, `POLAR_ACCESS_TOKEN`, `POLAR_SUCCESS_URL`, `POLAR_WEBHOOK_SECRET`, `POLAR_SERVER`.
37
+ - Compose file wires all Polar vars from `/opt/navii/.env`.
38
+ - 8 new license unit tests w/ fetch mock covering granted/revoked/expired/wrong-product/upstream-error paths.
39
+
40
+ ### Changed (API host)
41
+ - Privacy page swapped Gumroad references for Polar.sh.
42
+ - `AppOptions` renamed `gumroadProductPermalink` → `polarOrganizationId` + related Polar fields.
43
+
44
+ ### Added (Figma plugin)
45
+ - **Style hint pill row** in Packs panel — Auto / Masc / Femme / Neutral toggle. Persisted via `navii.style` localStorage. Disabled when no pack active.
46
+ - Plugin checkout URL now points at `${API_BASE}/checkout` (instead of hardcoded Gumroad link), letting us swap payment providers without re-publishing.
47
+
48
+ ### Fixed (Figma plugin)
49
+ - Left column in Packs panel was not scrollable when content overflowed (e.g. with new Style hint section). Added `overflow-y: auto` + `min-height: 0` to `.col-left`.
50
+
51
+ ## [0.21.2] - 2026-05-26
52
+
53
+ ### Changed (API host)
54
+ - Golly logo now links to `https://gollyexpress.com/` and is labeled "Golly Express".
55
+
56
+ ## [0.21.1] - 2026-05-26
57
+
58
+ ### Added (API host)
59
+ - Golly and Fleetlinq logos in the landing "built with navii" wall.
60
+ - Client-side Fisher-Yates shuffle of logos on every page load, so positions vary while the response itself stays cacheable.
61
+
62
+ ### Changed (API host)
63
+ - On viewports ≤540px the two logo rows collapse into a single wrapping row via `display: contents`. Desktop unchanged.
64
+
65
+ ## [0.21.0] - 2026-05-26
66
+
67
+ ### Added (API host)
68
+ - Landing "built with navii" logo wall section above the playground, in two centered rows.
69
+ - `GET /logos/:file` route serving PNG/SVG/JPG/WEBP assets from `packages/api/public/logos` with a filename whitelist and path-traversal guard.
70
+ - Dockerfile copies `packages/api/public` into the runtime image so the route works in production.
71
+
72
+ ## [0.20.1] - 2026-05-25
73
+
74
+ ### Fixed
75
+ - `@usenavii/core`: `StylePartSubset` now includes `eyes` and `mouth` so pastel pack `styleHints` typecheck. No runtime change — pack already used these fields.
76
+ - `@usenavii/react`: `NaviiProps` no longer collides with React's `style: CSSProperties`. Engine-level style hint moved to `styleHint?: 'masc' | 'femme' | 'neutral'`. Inline CSS via `style` still works.
77
+
78
+ ## [0.20.0] - 2026-05-25
79
+
80
+ Deployment-only release. No changes to `@usenavii/core` or `@usenavii/react` (both remain at 0.4.0).
81
+
82
+ ### Added (API host)
83
+ - `/privacy` — public privacy policy page covering avatar requests, license verification, and analytics.
84
+ - `/support` — public support page with contact email, GitHub issues link, and console-capture instructions.
85
+ - Both pages linked from landing + docs footers and listed in `/sitemap.xml`.
86
+
87
+ ### Added (Figma plugin)
88
+ - `networkAccess.reasoning` in `manifest.json` explaining why `api.navii.dev` and `navii.dev` are allowlisted.
89
+ - Offline pre-flight on insert, fill-random, and license-verify — surfaces a clear notification instead of failing silently when `navigator.onLine` is `false`.
90
+ - `notify` message type so the UI iframe can push toasts through `figma.notify`.
91
+
92
+ ## [0.4.0] - 2026-05-23
93
+
94
+ ### Added
95
+ - `Navii.random()` — pick a random seed and return its avatar, so callers don't need to bring their own RNG.
96
+
97
+ ## [0.3.0] - 2026-05-22
98
+
99
+ ### Added
100
+ - Outfit slot, builder-only and opt-in: `collar`, `scarf`, `bowtie`, `sunflower`, `necklace`.
101
+
102
+ ## [0.2.1] - 2026-05-22
103
+
104
+ ### Changed
105
+ - Each package now ships its own README to npm (`@usenavii/core` and `@usenavii/react` show distinct landing pages on npmjs.com).
106
+
107
+ ## [0.2.0] - 2026-05-22
108
+
109
+ ### Added
110
+ - `Navii.build(parts)` — compose an avatar from explicit part choices, no seed required.
111
+ - `Navii.seed(...)` — public seed-to-parts derivation surface.
112
+ - Snapshot test coverage for `build` and `seed`.
113
+
114
+ ## [0.1.0] - 2026-05-22
115
+
116
+ ### Added
117
+ - Initial public release of `@usenavii/core` and `@usenavii/react`.
118
+ - Deterministic avatar engine: `Navii(seed)` returns a stable SVG string for any seed.
119
+ - React binding: `<Navii seed="..." />`.
120
+ - Dual ESM/CJS build via tsup. TypeScript types included.
121
+
122
+ [Unreleased]: https://github.com/uxderrick/navii/compare/v0.22.0...HEAD
123
+ [0.22.0]: https://github.com/uxderrick/navii/compare/v0.21.2...v0.22.0
124
+ [0.21.2]: https://github.com/uxderrick/navii/compare/v0.21.1...v0.21.2
125
+ [0.21.1]: https://github.com/uxderrick/navii/compare/v0.21.0...v0.21.1
126
+ [0.21.0]: https://github.com/uxderrick/navii/compare/v0.20.1...v0.21.0
127
+ [0.20.1]: https://github.com/uxderrick/navii/compare/v0.20.0...v0.20.1
128
+ [0.20.0]: https://github.com/uxderrick/navii/compare/v0.19.0...v0.20.0
129
+ [0.4.0]: https://github.com/uxderrick/navii/compare/v0.3.0...v0.4.0
130
+ [0.3.0]: https://github.com/uxderrick/navii/compare/v0.2.1...v0.3.0
131
+ [0.2.1]: https://github.com/uxderrick/navii/compare/v0.2.0...v0.2.1
132
+ [0.2.0]: https://github.com/uxderrick/navii/compare/v0.1.0...v0.2.0
133
+ [0.1.0]: https://github.com/uxderrick/navii/releases/tag/v0.1.0
package/README.md CHANGED
@@ -3,11 +3,11 @@
3
3
  **Deterministic mascot avatars from a seed.** Pure TypeScript engine. Same seed in → byte-identical SVG out, every time. No state, no uploads, no network.
4
4
 
5
5
  <p align="center">
6
- <img src="https://navii-api.uxderrick.com/group?seeds=aria,milo,nova,kai,sage,eden,luna,rio,pip,wren,zane,iris&size=72&overlap=0.32&ring=%230a0a0b&tileBg=%23ffffff" alt="Navii cast" />
6
+ <img src="https://api.navii.dev/group?seeds=aria,milo,nova,kai,sage,eden,luna,rio,pip,wren,zane,iris&size=72&overlap=0.32&ring=%230a0a0b&tileBg=%23ffffff" alt="Navii cast" />
7
7
  </p>
8
8
 
9
- - [Live demo](https://navii.uxderrick.com) — interactive playground + cast
10
- - [Docs](https://navii.uxderrick.com/docs)
9
+ - [Live demo](https://navii.dev) — interactive playground + cast
10
+ - [Docs](https://navii.dev/docs)
11
11
  - [GitHub](https://github.com/uxderrick/navii)
12
12
 
13
13
  ## Install
@@ -64,6 +64,7 @@ It picks the most unique field automatically: `id` → `email` → `name + creat
64
64
 
65
65
  ```ts
66
66
  createAvatar(seed: string, options?: AvatarOptions): string
67
+ random(options?: AvatarOptions): { svg: string; seed: string }
67
68
  selectAvatar(seed: string, options?: AvatarOptions): AvatarSpec
68
69
  renderAvatar(spec: AvatarSpec, options?: AvatarOptions): string
69
70
  renderGroup(seeds: string[], options?: GroupOptions): string
@@ -71,7 +72,7 @@ renderGroup(seeds: string[], options?: GroupOptions): string
71
72
  seed(fields: SeedFields): string // pick most-unique field
72
73
  build(spec?: BuildSpec, opts?): string // manual mix-and-match (no seed)
73
74
 
74
- Navii.{ create, render, select, group, seed, build }
75
+ Navii.{ create, random, render, select, group, seed, build }
75
76
  ```
76
77
 
77
78
  ### `AvatarOptions`
@@ -85,6 +86,22 @@ Navii.{ create, render, select, group, seed, build }
85
86
  | `title` | accessible label (sets `<title>` + `aria-label`) | none |
86
87
  | `animated` | `boolean` — idle float / blink / sway / pulse / twinkle | `false` |
87
88
 
89
+ ### `random()` — pick a seed for you
90
+
91
+ For "spin again" UX, onboarding before the user picks an avatar, dev/demo seeding. Returns the chosen seed so you can persist it:
92
+
93
+ ```ts
94
+ const { svg, seed } = Navii.random({ size: 96 });
95
+ await db.users.update(user.id, { naviiSeed: seed });
96
+ ```
97
+
98
+ Calling `random()` in a React render gives a new avatar every re-render. Stabilize with `useState`:
99
+
100
+ ```tsx
101
+ const [{ seed }] = useState(() => Navii.random());
102
+ return <Navii seed={seed} />;
103
+ ```
104
+
88
105
  ### `build()` — direct construction without a seed
89
106
 
90
107
  Use for brand mascots, logo marks, designer-curated avatars: