@ai-matrx/vault 0.1.41 → 0.1.43

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,10 +1,15 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.41
3
+ ## 0.1.43
4
4
 
5
5
  UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
6
6
  Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/vault/src`.
7
7
 
8
+ ## 0.1.41
9
+
10
+ Automatic changed-only republish (docs/metadata drift since the last published version; verified: `git diff 7448cb2ff1 f1984cb2e2 -- apps/shared/vault/src`
11
+ has no shipped-source changes outside tests, fixtures and docs). No consumer action required.
12
+
8
13
  ## 0.1.40
9
14
 
10
15
  Automatic changed-only republish (docs/metadata drift since the last published version; verified: `git diff dcbf369af4 7448cb2ff1 -- apps/shared/vault/src`
package/dist/index.cjs CHANGED
@@ -1928,6 +1928,7 @@ function useCanScan() {
1928
1928
  }, []);
1929
1929
  return ok;
1930
1930
  }
1931
+ var SETUP_KEY_PLACEHOLDER = "Setup key or otpauth link";
1931
1932
  var CAMERA_NOTES = {
1932
1933
  blocked: "Camera blocked. Paste the key or choose a QR image.",
1933
1934
  missing: "No camera. Paste the key or choose a QR image.",
@@ -1988,7 +1989,7 @@ function QrScanInline({ onResult, onClose }) {
1988
1989
  if (error) {
1989
1990
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { className: "flex items-center gap-2 px-1 pt-1 text-xs text-muted-foreground", role: "status", "data-camera-note": "", children: [
1990
1991
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CameraGlyph, { className: "size-3.5 shrink-0", "aria-hidden": true }),
1991
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "min-w-0 flex-1 truncate", children: error }),
1992
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "min-w-0 flex-1 break-words", children: error }),
1992
1993
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_controls6.Button, { variant: "quiet", onClick: onClose, children: "Dismiss" })
1993
1994
  ] });
1994
1995
  }
@@ -2003,7 +2004,7 @@ function QrScanInline({ onResult, onClose }) {
2003
2004
  ] })
2004
2005
  ] });
2005
2006
  }
2006
- function OtpSetupRow({ value, onChange, label = "Authenticator", placeholder = "Paste setup key or otpauth link", disabled = false, autoFocus = false, onImage, onRecognized, status, autoStartCamera = false }) {
2007
+ function OtpSetupRow({ value, onChange, label = "Authenticator", placeholder = SETUP_KEY_PLACEHOLDER, disabled = false, autoFocus = false, onImage, onRecognized, status, autoStartCamera = false }) {
2007
2008
  const file = (0, import_react10.useRef)(null);
2008
2009
  const canScan = useCanScan();
2009
2010
  const [scanning, setScanning] = (0, import_react10.useState)(false);
@@ -2263,7 +2264,7 @@ function TotpEditRow({ value, onChange, hasExisting, item, port, onEnrolled, onR
2263
2264
  setStatus(null);
2264
2265
  onChange(v);
2265
2266
  },
2266
- placeholder: hasExisting ? "Paste a new key to replace" : "Paste setup key or otpauth link",
2267
+ placeholder: hasExisting ? "Paste a new key to replace" : SETUP_KEY_PLACEHOLDER,
2267
2268
  status,
2268
2269
  ...uploadImage ? { onImage: (f) => void uploadImage(f) } : {},
2269
2270
  ...onRecognized ? { onRecognized } : {}
@@ -3242,7 +3243,6 @@ function positiveKnob(resolved, key) {
3242
3243
  }
3243
3244
 
3244
3245
  // src/organizations.ts
3245
- var import_record_id_format = require("@ai-matrx/design-system/record-id-format");
3246
3246
  function orderOrganizations(orgs, items, recentItemIds) {
3247
3247
  const counts = /* @__PURE__ */ new Map();
3248
3248
  for (const i of items) if (i.owner.organizationId) counts.set(i.owner.organizationId, (counts.get(i.owner.organizationId) ?? 0) + 1);
@@ -3256,9 +3256,22 @@ function orderOrganizations(orgs, items, recentItemIds) {
3256
3256
  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));
3257
3257
  }
3258
3258
  function organizationHints(orgs) {
3259
- const seen = /* @__PURE__ */ new Map();
3260
- for (const o of orgs) seen.set(o.name.trim().toLowerCase(), (seen.get(o.name.trim().toLowerCase()) ?? 0) + 1);
3261
- return new Map(orgs.filter((o) => (seen.get(o.name.trim().toLowerCase()) ?? 0) > 1).map((o) => [o.id, (0, import_record_id_format.shortUuid)(o.id)]));
3259
+ const groups = /* @__PURE__ */ new Map();
3260
+ for (const o of orgs) {
3261
+ const key = o.name.trim().toLowerCase();
3262
+ groups.set(key, [...groups.get(key) ?? [], o]);
3263
+ }
3264
+ const hints = /* @__PURE__ */ new Map();
3265
+ for (const group of groups.values()) {
3266
+ if (group.length < 2) continue;
3267
+ const longest = Math.max(...group.map((o) => o.id.length));
3268
+ const fragment = (o, n2) => o.id.slice(0, n2);
3269
+ let n = 8;
3270
+ while (n < longest && new Set(group.map((o) => fragment(o, n))).size < group.length) n += 1;
3271
+ const useSuffix = new Set(group.map((o) => fragment(o, n))).size < group.length;
3272
+ for (const o of group) hints.set(o.id, useSuffix ? o.id.slice(-8) : fragment(o, n));
3273
+ }
3274
+ return hints;
3262
3275
  }
3263
3276
 
3264
3277
  // src/shown-until-move.ts