@ai-matrx/vault 0.1.46 → 0.1.48

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
@@ -1,7 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.48
4
+
5
+ - Authenticator camera availability now reads the canonical browser-audio device list. The existing camera-capability gate and false-on-unavailable behavior are preserved; the dependency is declared explicitly. Consumer action: none.
6
+
7
+ ## 0.1.47
8
+
9
+ - **A same-name organization hint is at most 8 id characters.** It is the id's start when that tells the group apart, else its end ("…" first), so five orgs whose ids share 32 characters no longer push the name out of the switcher and pickers. The authenticator code row's label column is 5.25rem, so "Authenticator" no longer wraps in a narrow pane. Guard: `src/organization-hints-distinct.test.ts`. Consumer action: none.
10
+
3
11
  ## 0.1.46
4
12
 
13
+ SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
14
+ so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
15
+ Diff: `git diff 98cd616344 d445d7108d -- apps/shared/vault/src`
16
+
17
+ Changed shipped source files (1):
18
+ - `apps/shared/vault/src/authenticator/TotpRows.tsx`
19
+
20
+ ## 0.1.45
21
+
5
22
  - **Narrow-container fixes from the 360px / 22.5rem playground walk** (2026-10-23): an Authenticator list row measures its OWN width, so below 26rem the code drops onto a second line under the name (the name keeps the row, the code is never squeezed) and above it everything stays on one line; the camera notes in Add authenticator wrap to a second line instead of being cut by Dismiss, and the setup-key hint is "Setup key or link" (`SETUP_KEY_PLACEHOLDER`, measured to fit the box at 360px); same-named organizations get the shortest id fragment that differs inside their group (`organizationHints`, a suffix when whole ids collide) instead of an identical first 8 characters; the item header measures its pane, not the window (the star and Share step into the "..." menu, the title wraps to two lines, the owner badge wraps below instead of clipping), and the one-time password row hides its separate copy button below 24rem so the ring never sits on it ("Copy code" is in its menu; the code itself still copies). Proof: `src/container-responsive-layout.test.tsx`, `src/narrow-setup-notes.test.tsx`, `src/organization-hints-distinct.test.ts`. Consumer action: none.
6
23
 
7
24
  ## 0.1.44
package/dist/index.cjs CHANGED
@@ -1877,6 +1877,7 @@ var import_react10 = require("react");
1877
1877
  var import_controls6 = require("@ai-matrx/design-system/controls");
1878
1878
 
1879
1879
  // src/authenticator/qr.ts
1880
+ var import_core = require("@ai-matrx/browser-audio/core");
1880
1881
  var import_qr = require("@ai-matrx/capture/qr");
1881
1882
  function canDecodeQrLocally() {
1882
1883
  if (typeof document === "undefined") return Promise.resolve(false);
@@ -1890,9 +1891,9 @@ function hasCamera() {
1890
1891
  return typeof navigator !== "undefined" && typeof navigator.mediaDevices?.getUserMedia === "function";
1891
1892
  }
1892
1893
  async function hasCameraDevice() {
1893
- if (!hasCamera() || typeof navigator.mediaDevices?.enumerateDevices !== "function") return false;
1894
+ if (!hasCamera()) return false;
1894
1895
  try {
1895
- return (await navigator.mediaDevices.enumerateDevices()).some((d) => d.kind === "videoinput");
1896
+ return (await (0, import_core.listMediaDevices)()).videoInputs.length > 0;
1896
1897
  } catch {
1897
1898
  return false;
1898
1899
  }
@@ -2231,7 +2232,7 @@ function TotpRow({ port, item, onChanged }) {
2231
2232
  VaultRow,
2232
2233
  {
2233
2234
  label: "Authenticator",
2234
- className: "@max-[24rem]/otprow:grid-cols-[4.5rem_minmax(0,1fr)_auto]",
2235
+ className: "@max-[24rem]/otprow:grid-cols-[5.25rem_minmax(0,1fr)_auto] @max-[24rem]/otprow:gap-x-1 @max-[24rem]/otprow:px-2",
2235
2236
  actions: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
2236
2237
  a.enabled ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "hidden @[24rem]/otprow:contents", "data-copy-code-button": "", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CopyCodeButton, { live, label: item.name }) }) : null,
2237
2238
  menu
@@ -3267,6 +3268,7 @@ function orderOrganizations(orgs, items, recentItemIds) {
3267
3268
  const group = (o) => recent.has(o.id) ? 0 : (counts.get(o.id) ?? 0) > 0 ? 1 : 2;
3268
3269
  return [...orgs].sort((a, b) => group(a) - group(b) || (recent.get(a.id) ?? 0) - (recent.get(b.id) ?? 0) || a.name.localeCompare(b.name, void 0, { sensitivity: "base" }) || a.id.localeCompare(b.id));
3269
3270
  }
3271
+ var HINT_LENGTH = 8;
3270
3272
  function organizationHints(orgs) {
3271
3273
  const groups = /* @__PURE__ */ new Map();
3272
3274
  for (const o of orgs) {
@@ -3276,12 +3278,11 @@ function organizationHints(orgs) {
3276
3278
  const hints = /* @__PURE__ */ new Map();
3277
3279
  for (const group of groups.values()) {
3278
3280
  if (group.length < 2) continue;
3279
- const longest = Math.max(...group.map((o) => o.id.length));
3280
- const fragment = (o, n2) => o.id.slice(0, n2);
3281
- let n = 8;
3282
- while (n < longest && new Set(group.map((o) => fragment(o, n))).size < group.length) n += 1;
3283
- const useSuffix = new Set(group.map((o) => fragment(o, n))).size < group.length;
3284
- for (const o of group) hints.set(o.id, useSuffix ? o.id.slice(-8) : fragment(o, n));
3281
+ const distinct = (pick2) => new Set(group.map(pick2)).size === group.length;
3282
+ const head = (o) => o.id.slice(0, HINT_LENGTH);
3283
+ const tail = (o) => `\u2026${o.id.slice(-HINT_LENGTH)}`;
3284
+ const pick = distinct(head) || !distinct(tail) ? head : tail;
3285
+ for (const o of group) hints.set(o.id, pick(o));
3285
3286
  }
3286
3287
  return hints;
3287
3288
  }