@ai-matrx/vault 0.1.45 → 0.1.47
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 +24 -0
- package/dist/index.cjs +7 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -16
package/dist/index.js
CHANGED
|
@@ -1750,6 +1750,7 @@ function TotpRow({ port, item, onChanged }) {
|
|
|
1750
1750
|
VaultRow,
|
|
1751
1751
|
{
|
|
1752
1752
|
label: "Authenticator",
|
|
1753
|
+
className: "@max-[24rem]/otprow:grid-cols-[5.25rem_minmax(0,1fr)_auto] @max-[24rem]/otprow:gap-x-1 @max-[24rem]/otprow:px-2",
|
|
1753
1754
|
actions: /* @__PURE__ */ jsxs7(Fragment5, { children: [
|
|
1754
1755
|
a.enabled ? /* @__PURE__ */ jsx8("span", { className: "hidden @[24rem]/otprow:contents", "data-copy-code-button": "", children: /* @__PURE__ */ jsx8(CopyCodeButton, { live, label: item.name }) }) : null,
|
|
1755
1756
|
menu
|
|
@@ -2788,6 +2789,7 @@ function orderOrganizations(orgs, items, recentItemIds) {
|
|
|
2788
2789
|
const group = (o) => recent.has(o.id) ? 0 : (counts.get(o.id) ?? 0) > 0 ? 1 : 2;
|
|
2789
2790
|
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));
|
|
2790
2791
|
}
|
|
2792
|
+
var HINT_LENGTH = 8;
|
|
2791
2793
|
function organizationHints(orgs) {
|
|
2792
2794
|
const groups = /* @__PURE__ */ new Map();
|
|
2793
2795
|
for (const o of orgs) {
|
|
@@ -2797,12 +2799,11 @@ function organizationHints(orgs) {
|
|
|
2797
2799
|
const hints = /* @__PURE__ */ new Map();
|
|
2798
2800
|
for (const group of groups.values()) {
|
|
2799
2801
|
if (group.length < 2) continue;
|
|
2800
|
-
const
|
|
2801
|
-
const
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
const
|
|
2805
|
-
for (const o of group) hints.set(o.id, useSuffix ? o.id.slice(-8) : fragment(o, n));
|
|
2802
|
+
const distinct = (pick2) => new Set(group.map(pick2)).size === group.length;
|
|
2803
|
+
const head = (o) => o.id.slice(0, HINT_LENGTH);
|
|
2804
|
+
const tail = (o) => `\u2026${o.id.slice(-HINT_LENGTH)}`;
|
|
2805
|
+
const pick = distinct(head) || !distinct(tail) ? head : tail;
|
|
2806
|
+
for (const o of group) hints.set(o.id, pick(o));
|
|
2806
2807
|
}
|
|
2807
2808
|
return hints;
|
|
2808
2809
|
}
|