@usenavii/core 0.4.0 → 0.6.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,191 @@
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.23.1] - 2026-05-26
10
+
11
+ ### Fixed (release)
12
+ - `@usenavii/react` workspace dep on `@usenavii/core` updated to `^0.6.0` — v0.23.0 release workflow failed pnpm install with `ERR_PNPM_NO_MATCHING_VERSION_INSIDE_WORKSPACE` because the workspace spec was stuck at `^0.5.0`. v0.23.1 reships the v0.23.0 feature set (mood overlay + runtime palette injection) with the dep bump.
13
+
14
+ ## [0.23.0] - 2026-05-26 (yanked — release pipeline failed)
15
+
16
+ ### Added (`@usenavii/core` 0.6.0, `@usenavii/react` 0.6.0)
17
+ - **`AvatarOptions.mood`** — new `MoodId = 'neutral' | 'happy' | 'serious' | 'sleepy' | 'wink'`. Overrides seed-derived eyes + mouth with a curated pair: `happy` → wide + smile, `serious` → squint + flat, `sleepy` → sleepy + dot, `wink` → wink + smirk. Same seed + same mood = byte-identical render. Different mood on the same seed shares body / palette / topper. Bypasses pack pick constraints by design (the mood IS the override). `neutral` (or undefined) preserves prior behavior.
18
+ - **Runtime palette injection in `build()`** — `options.palette` (Palette object) now wins over `spec.palette` (id). Lets callers pass a brand or runtime-built palette without registering it in `PALETTES`. Fall-through: `options.palette` → `spec.palette` id → `PALETTES[0]`.
19
+ - **React `<Navii>`** forwards new `mood` and `palette` props through to the engine; `MoodId` re-exported from the React package.
20
+
21
+ ### Added (API host)
22
+ - `GET /avatar/:seed?mood=happy|serious|sleepy|wink|neutral` — server-side mood overlay. PNG cache key extended with `m=` so moods don't collide.
23
+
24
+
25
+
26
+ ### Added (API host)
27
+ - Elorm UI logo (inline SVG, `currentColor`) in the landing "built with navii" wall, sized via new `.logo svg.lg` rule.
28
+
29
+ ## [0.22.4] - 2026-05-26
30
+
31
+ ### Fixed (Figma plugin)
32
+ - **Missing `permissions: ["teamlibrary"]`** in `manifest.json`. Without it, `figma.teamLibrary.getAvailableLibraryVariableCollectionsAsync()` throws and Brand mode silently returns an empty palette list for every Pro user. Added.
33
+ - **`innerHTML` interpolation** of `pack.name` and `pack.emoji` replaced with `createElement` + `textContent` (ui.ts, active-packs chip + pack-card title). XSS surface closed even though current pack data is static.
34
+ - **`doInsertBuild` new-node path** now wrapped in try/catch — uncaught throw from `figma.createNodeFromSvg` would otherwise kill the plugin's main thread.
35
+
36
+ ### Removed (Figma plugin)
37
+ - **Cmd+Shift+P dev-bypass shortcut** that unlocked Pro features for free. Violated Figma's review policy (hidden functionality circumventing fees). Deleted entirely; only the Cmd+Enter primary-action shortcut remains.
38
+
39
+ ### Changed (Figma plugin)
40
+ - **License key no longer crosses the iframe boundary.** Main thread sends a sanitized `publicLicenseView()` over `figma.ui.postMessage`. The raw key stays in the main thread (needed for re-verify) + `figma.clientStorage` only. UI never sees or stores the key string.
41
+
42
+ ### Fixed (build pipeline)
43
+ - **`scripts/build.mjs`** stopped escaping `<script` (without `/`). Per HTML5 only `</script` ends a script block; the extra replace could corrupt minified regex/string literals containing the substring. Only `</script` is escaped now.
44
+
45
+ ## [0.22.3] - 2026-05-26
46
+
47
+ ### Fixed (API host)
48
+ - `/license/verify` blocked by CORS when called from the Figma plugin iframe (`Origin: null` preflight). Added permissive CORS middleware (route only accepts a license key — no cookies/auth — so wide-open CORS is safe) plus an `OPTIONS` preflight handler. Plugin verify flow now reaches the API end-to-end.
49
+
50
+ ## [0.22.2] - 2026-05-26
51
+
52
+ ### Added (API host)
53
+ - `GET /thanks` — post-purchase confirmation page Polar redirects buyers to after successful checkout. Confirms payment, points them to their email for the license key, and links to the Polar customer portal via the one-time `customer_session_token` query param.
54
+
55
+ ### Fixed (API host)
56
+ - Buyers hit a 404 at `https://navii.dev/thanks` after paying because no route existed yet.
57
+
58
+ ## [0.22.1] - 2026-05-26
59
+
60
+ ### Changed (API host)
61
+ - Support email switched from `tsormed@gmail.com` to `support@navii.dev` (ImprovMX free-tier forward → tsormed@gmail.com).
62
+
63
+ ## [0.22.0] - 2026-05-26
64
+
65
+ ### Added (`@usenavii/core` 0.5.0)
66
+ - **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.
67
+ - **New body shapes** (pack-only, base seeds unchanged): `squircle` (full-bleed corporate tile), `pumpkin`, `ghost`, `skullHead`.
68
+ - **New mouth styles** (pack-only): `jagged` (carved-pumpkin grin), `fangs` (vampire teeth).
69
+ - **New toppers**: `witchHat`, `pumpkinStem`, `ghostSheet`, `bob`, `bun`, `ponytail`.
70
+ - **New accessory**: `earring` (palette-themed stud + drop pair).
71
+ - **New outfit**: `tie` (corporate necktie — knot + tapered blade).
72
+ - **`Pack.glow`** flag emits an outer-glow SVG filter behind the body (Gaussian blur tinted by palette). Used by Neon.
73
+ - **`AvatarSpec.flat` / `bgColor` / `featureStroke` / `glow`** — render directives the engine reads to alter body/face rendering per enabled pack.
74
+ - **`featureStroke` multiplier** scales stroke widths on eyes, mouth, glasses uniformly. Office bumps to 1.35, Neon 1.5, Mono down to 1.15 (delicate).
75
+ - **New `office-bright` pack** — vivid sibling of Office for marketing/design teams.
76
+
77
+ ### Changed (`@usenavii/core` 0.5.0)
78
+ - 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.
79
+ - Office, Halloween, Pastel, Neon, Mono, Earth packs reauthored with theme-cohesive picks, style hints, and exclusive palette pools.
80
+ - Office uses full-bleed squircle + white plate + necktie outfits + bolder strokes for ID-badge look.
81
+ - Halloween uses pumpkin/ghost/skullHead bodies + jagged/fangs mouths + witchHat/stem/sheet toppers + dark night plate.
82
+ - Neon emits an outer glow halo via SVG filter behind the body.
83
+ - Mono switched to full-bleed squircle (was contained orb) for editorial tile look.
84
+
85
+ ### Added (API host)
86
+ - **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.
87
+ - **`GET /checkout`** — redirects to Polar checkout w/ configured product preselected. Powered by `@polar-sh/hono`.
88
+ - **`GET /portal`** — Polar customer portal proxy (license re-fetch, refund request).
89
+ - **`POST /polar/webhooks`** — signature-verified webhook receiver, logs events.
90
+ - New env vars: `POLAR_ORGANIZATION_ID`, `POLAR_PRODUCT_ID`, `POLAR_BENEFIT_ID`, `POLAR_ACCESS_TOKEN`, `POLAR_SUCCESS_URL`, `POLAR_WEBHOOK_SECRET`, `POLAR_SERVER`.
91
+ - Compose file wires all Polar vars from `/opt/navii/.env`.
92
+ - 8 new license unit tests w/ fetch mock covering granted/revoked/expired/wrong-product/upstream-error paths.
93
+
94
+ ### Changed (API host)
95
+ - Privacy page swapped Gumroad references for Polar.sh.
96
+ - `AppOptions` renamed `gumroadProductPermalink` → `polarOrganizationId` + related Polar fields.
97
+
98
+ ### Added (Figma plugin)
99
+ - **Style hint pill row** in Packs panel — Auto / Masc / Femme / Neutral toggle. Persisted via `navii.style` localStorage. Disabled when no pack active.
100
+ - Plugin checkout URL now points at `${API_BASE}/checkout` (instead of hardcoded Gumroad link), letting us swap payment providers without re-publishing.
101
+
102
+ ### Fixed (Figma plugin)
103
+ - 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`.
104
+
105
+ ## [0.21.2] - 2026-05-26
106
+
107
+ ### Changed (API host)
108
+ - Golly logo now links to `https://gollyexpress.com/` and is labeled "Golly Express".
109
+
110
+ ## [0.21.1] - 2026-05-26
111
+
112
+ ### Added (API host)
113
+ - Golly and Fleetlinq logos in the landing "built with navii" wall.
114
+ - Client-side Fisher-Yates shuffle of logos on every page load, so positions vary while the response itself stays cacheable.
115
+
116
+ ### Changed (API host)
117
+ - On viewports ≤540px the two logo rows collapse into a single wrapping row via `display: contents`. Desktop unchanged.
118
+
119
+ ## [0.21.0] - 2026-05-26
120
+
121
+ ### Added (API host)
122
+ - Landing "built with navii" logo wall section above the playground, in two centered rows.
123
+ - `GET /logos/:file` route serving PNG/SVG/JPG/WEBP assets from `packages/api/public/logos` with a filename whitelist and path-traversal guard.
124
+ - Dockerfile copies `packages/api/public` into the runtime image so the route works in production.
125
+
126
+ ## [0.20.1] - 2026-05-25
127
+
128
+ ### Fixed
129
+ - `@usenavii/core`: `StylePartSubset` now includes `eyes` and `mouth` so pastel pack `styleHints` typecheck. No runtime change — pack already used these fields.
130
+ - `@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.
131
+
132
+ ## [0.20.0] - 2026-05-25
133
+
134
+ Deployment-only release. No changes to `@usenavii/core` or `@usenavii/react` (both remain at 0.4.0).
135
+
136
+ ### Added (API host)
137
+ - `/privacy` — public privacy policy page covering avatar requests, license verification, and analytics.
138
+ - `/support` — public support page with contact email, GitHub issues link, and console-capture instructions.
139
+ - Both pages linked from landing + docs footers and listed in `/sitemap.xml`.
140
+
141
+ ### Added (Figma plugin)
142
+ - `networkAccess.reasoning` in `manifest.json` explaining why `api.navii.dev` and `navii.dev` are allowlisted.
143
+ - Offline pre-flight on insert, fill-random, and license-verify — surfaces a clear notification instead of failing silently when `navigator.onLine` is `false`.
144
+ - `notify` message type so the UI iframe can push toasts through `figma.notify`.
145
+
146
+ ## [0.4.0] - 2026-05-23
147
+
148
+ ### Added
149
+ - `Navii.random()` — pick a random seed and return its avatar, so callers don't need to bring their own RNG.
150
+
151
+ ## [0.3.0] - 2026-05-22
152
+
153
+ ### Added
154
+ - Outfit slot, builder-only and opt-in: `collar`, `scarf`, `bowtie`, `sunflower`, `necklace`.
155
+
156
+ ## [0.2.1] - 2026-05-22
157
+
158
+ ### Changed
159
+ - Each package now ships its own README to npm (`@usenavii/core` and `@usenavii/react` show distinct landing pages on npmjs.com).
160
+
161
+ ## [0.2.0] - 2026-05-22
162
+
163
+ ### Added
164
+ - `Navii.build(parts)` — compose an avatar from explicit part choices, no seed required.
165
+ - `Navii.seed(...)` — public seed-to-parts derivation surface.
166
+ - Snapshot test coverage for `build` and `seed`.
167
+
168
+ ## [0.1.0] - 2026-05-22
169
+
170
+ ### Added
171
+ - Initial public release of `@usenavii/core` and `@usenavii/react`.
172
+ - Deterministic avatar engine: `Navii(seed)` returns a stable SVG string for any seed.
173
+ - React binding: `<Navii seed="..." />`.
174
+ - Dual ESM/CJS build via tsup. TypeScript types included.
175
+
176
+ [Unreleased]: https://github.com/uxderrick/navii/compare/v0.22.4...HEAD
177
+ [0.22.4]: https://github.com/uxderrick/navii/compare/v0.22.3...v0.22.4
178
+ [0.22.3]: https://github.com/uxderrick/navii/compare/v0.22.2...v0.22.3
179
+ [0.22.2]: https://github.com/uxderrick/navii/compare/v0.22.1...v0.22.2
180
+ [0.22.1]: https://github.com/uxderrick/navii/compare/v0.22.0...v0.22.1
181
+ [0.22.0]: https://github.com/uxderrick/navii/compare/v0.21.2...v0.22.0
182
+ [0.21.2]: https://github.com/uxderrick/navii/compare/v0.21.1...v0.21.2
183
+ [0.21.1]: https://github.com/uxderrick/navii/compare/v0.21.0...v0.21.1
184
+ [0.21.0]: https://github.com/uxderrick/navii/compare/v0.20.1...v0.21.0
185
+ [0.20.1]: https://github.com/uxderrick/navii/compare/v0.20.0...v0.20.1
186
+ [0.20.0]: https://github.com/uxderrick/navii/compare/v0.19.0...v0.20.0
187
+ [0.4.0]: https://github.com/uxderrick/navii/compare/v0.3.0...v0.4.0
188
+ [0.3.0]: https://github.com/uxderrick/navii/compare/v0.2.1...v0.3.0
189
+ [0.2.1]: https://github.com/uxderrick/navii/compare/v0.2.0...v0.2.1
190
+ [0.2.0]: https://github.com/uxderrick/navii/compare/v0.1.0...v0.2.0
191
+ [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