@usenavii/core 0.5.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 CHANGED
@@ -6,6 +6,60 @@ Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versioning: [S
6
6
 
7
7
  ## [Unreleased]
8
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
+
9
63
  ## [0.22.0] - 2026-05-26
10
64
 
11
65
  ### Added (`@usenavii/core` 0.5.0)
@@ -119,7 +173,11 @@ Deployment-only release. No changes to `@usenavii/core` or `@usenavii/react` (bo
119
173
  - React binding: `<Navii seed="..." />`.
120
174
  - Dual ESM/CJS build via tsup. TypeScript types included.
121
175
 
122
- [Unreleased]: https://github.com/uxderrick/navii/compare/v0.22.0...HEAD
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
123
181
  [0.22.0]: https://github.com/uxderrick/navii/compare/v0.21.2...v0.22.0
124
182
  [0.21.2]: https://github.com/uxderrick/navii/compare/v0.21.1...v0.21.2
125
183
  [0.21.1]: https://github.com/uxderrick/navii/compare/v0.21.0...v0.21.1
package/dist/index.cjs CHANGED
@@ -1339,6 +1339,18 @@ function resolvePacks(ids) {
1339
1339
  }
1340
1340
 
1341
1341
  // src/select.ts
1342
+ var MOOD_EYES = {
1343
+ happy: "wide",
1344
+ serious: "squint",
1345
+ sleepy: "sleepy",
1346
+ wink: "wink"
1347
+ };
1348
+ var MOOD_MOUTH = {
1349
+ happy: "smile",
1350
+ serious: "flat",
1351
+ sleepy: "dot",
1352
+ wink: "smirk"
1353
+ };
1342
1354
  function applyStyleHint(pool, packs, hint, partKey) {
1343
1355
  for (const pack of packs) {
1344
1356
  const subset = pack.styleHints?.[hint]?.[partKey];
@@ -1400,10 +1412,13 @@ function selectAvatar(seed2, options = {}) {
1400
1412
  topperPool = applyStyleHint(topperPool, enabledPacks, styleHint, "topper");
1401
1413
  }
1402
1414
  const body = rng.pick(bodyPool);
1403
- const eyes = rng.pick(eyesPool);
1404
- const mouth = rng.pick(mouthPool);
1415
+ const eyesPicked = rng.pick(eyesPool);
1416
+ const mouthPicked = rng.pick(mouthPool);
1405
1417
  const antenna = rng.pick(antennaPool);
1406
1418
  const accessory = rng.pick(accessoryPool);
1419
+ const mood = options.mood;
1420
+ const eyes = mood && mood !== "neutral" ? MOOD_EYES[mood] : eyesPicked;
1421
+ const mouth = mood && mood !== "neutral" ? MOOD_MOUTH[mood] : mouthPicked;
1407
1422
  let background;
1408
1423
  if (typeof options.background === "string") {
1409
1424
  background = options.background;
@@ -1674,7 +1689,7 @@ function seed(fields) {
1674
1689
 
1675
1690
  // src/build.ts
1676
1691
  function build(spec = {}, options = {}) {
1677
- const palette = spec.palette ? PALETTE_BY_ID[spec.palette] ?? PALETTES[0] : PALETTES[0];
1692
+ const palette = options.palette ?? (spec.palette ? PALETTE_BY_ID[spec.palette] ?? PALETTES[0] : PALETTES[0]);
1678
1693
  const resolved = {
1679
1694
  seed: "__build__",
1680
1695
  palette,