@ai-matrx/vault 0.1.7 → 0.1.9

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/dist/index.d.cts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as react from 'react';
2
+ import { Look } from '@ai-matrx/design-system';
2
3
  import { KnobClient } from '@ai-matrx/data/knobs';
3
4
  import * as account from '@ai-matrx/api/account';
4
5
  import { Api } from '@ai-matrx/api';
@@ -1192,6 +1193,12 @@ interface VaultAppProps {
1192
1193
  onLocationChange?: (next: VaultLocation, how: "push" | "replace") => void;
1193
1194
  /** The host's own toasts; without it the vault shows its own short notices. */
1194
1195
  notify?: Notify;
1196
+ /**
1197
+ * The skin, never the screens: `"web"` (default) is the website's and the extension's look;
1198
+ * `"desktop"` draws the same workspace in the desktop standard (Matrx Desktop: the system font,
1199
+ * Apple's text styles, AppKit controls and grouped boxes, sheets for panels, light and dark).
1200
+ */
1201
+ look?: Look;
1195
1202
  }
1196
1203
  /** THE VAULT WORKSPACE: one component for the web app, the extension side panel and the desktop app. */
1197
1204
  declare function VaultApp(props: VaultAppProps): react.JSX.Element;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as react from 'react';
2
+ import { Look } from '@ai-matrx/design-system';
2
3
  import { KnobClient } from '@ai-matrx/data/knobs';
3
4
  import * as account from '@ai-matrx/api/account';
4
5
  import { Api } from '@ai-matrx/api';
@@ -1192,6 +1193,12 @@ interface VaultAppProps {
1192
1193
  onLocationChange?: (next: VaultLocation, how: "push" | "replace") => void;
1193
1194
  /** The host's own toasts; without it the vault shows its own short notices. */
1194
1195
  notify?: Notify;
1196
+ /**
1197
+ * The skin, never the screens: `"web"` (default) is the website's and the extension's look;
1198
+ * `"desktop"` draws the same workspace in the desktop standard (Matrx Desktop: the system font,
1199
+ * Apple's text styles, AppKit controls and grouped boxes, sheets for panels, light and dark).
1200
+ */
1201
+ look?: Look;
1195
1202
  }
1196
1203
  /** THE VAULT WORKSPACE: one component for the web app, the extension side panel and the desktop app. */
1197
1204
  declare function VaultApp(props: VaultAppProps): react.JSX.Element;
package/dist/index.js CHANGED
@@ -102,7 +102,7 @@ var init_keepass_xml_worker_client = __esm({
102
102
 
103
103
  // src/VaultApp.tsx
104
104
  import { useCallback as useCallback5, useEffect as useEffect23, useMemo as useMemo6, useRef as useRef19, useState as useState40 } from "react";
105
- import { DropdownMenu as DropdownMenu6, DropdownMenuContent as DropdownMenuContent6, DropdownMenuItem as DropdownMenuItem5, DropdownMenuTrigger as DropdownMenuTrigger6 } from "@ai-matrx/design-system";
105
+ import { DropdownMenu as DropdownMenu6, DropdownMenuContent as DropdownMenuContent6, DropdownMenuItem as DropdownMenuItem5, DropdownMenuTrigger as DropdownMenuTrigger6, LookScope } from "@ai-matrx/design-system";
106
106
  import { Button as Button33, SearchField as SearchField4, Select as Select11 } from "@ai-matrx/design-system/controls";
107
107
  import { confirm as confirm13 } from "@ai-matrx/kit/confirm-opener";
108
108
 
@@ -560,7 +560,7 @@ function useElementWidth(ref) {
560
560
  // src/ui.tsx
561
561
  import { createContext as createContext4, useContext as useContext4, useEffect as useEffect4, useState as useState4 } from "react";
562
562
  import { Dialog as Dialog2, DialogContent as DialogContent2, DialogFooter, DialogHeader as DialogHeader2, DialogTitle as DialogTitle2 } from "@ai-matrx/design-system";
563
- import { cn as cn2 } from "@ai-matrx/design-system";
563
+ import { cn as cn2, useLook } from "@ai-matrx/design-system";
564
564
  import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
565
565
  var InPanel = createContext4(false);
566
566
  var Room = createContext4(null);
@@ -581,12 +581,13 @@ function useRoomOf(ref) {
581
581
  var RoomProvider = Room.Provider;
582
582
  function Section({ title, actions, children, className }) {
583
583
  const flat = useContext4(InPanel);
584
+ const desktop = useLook() === "desktop";
584
585
  return /* @__PURE__ */ jsxs4("section", { className: cn2("flex flex-col gap-1.5", className), children: [
585
586
  title || actions ? /* @__PURE__ */ jsxs4("div", { className: "flex min-h-7 items-center justify-between gap-2 px-1", children: [
586
- title ? /* @__PURE__ */ jsx4("h3", { className: "text-xs font-medium text-muted-foreground", children: title }) : /* @__PURE__ */ jsx4("span", {}),
587
+ title ? /* @__PURE__ */ jsx4("h3", { className: desktop ? "text-sm font-semibold text-foreground" : "text-xs font-medium text-muted-foreground", children: title }) : /* @__PURE__ */ jsx4("span", {}),
587
588
  actions ? /* @__PURE__ */ jsx4("div", { className: "flex items-center gap-1", children: actions }) : null
588
589
  ] }) : null,
589
- /* @__PURE__ */ jsx4("div", { className: flat ? "-mx-3 flex flex-col sm:-mx-4" : "flex flex-col rounded-xl border border-border bg-card py-1", children })
590
+ /* @__PURE__ */ jsx4("div", { className: flat ? "-mx-3 flex flex-col sm:-mx-4" : desktop ? "flex flex-col divide-y divide-border rounded-xl bg-card" : "flex flex-col rounded-xl border border-border bg-card py-1", children })
590
591
  ] });
591
592
  }
592
593
  var ROW_GRID = {
@@ -5201,7 +5202,7 @@ var message = (e, fallback) => {
5201
5202
  const m = e instanceof Error && e.message ? e.message : fallback;
5202
5203
  return copyRefusal(m) ?? m;
5203
5204
  };
5204
- function useAction() {
5205
+ function useConfirmedChange() {
5205
5206
  const confirmed = useConfirmed();
5206
5207
  const [busy, setBusy] = useState23(null);
5207
5208
  const [error, setError] = useState23(null);
@@ -5245,7 +5246,7 @@ import { Button as Button19, Field as Field8, Select as Select7 } from "@ai-matr
5245
5246
  import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
5246
5247
  var NONE = "__none__";
5247
5248
  function MovePanel({ item, port, organizations, onClose, onChanged }) {
5248
- const { busy, error, notice, run, setNotice } = useAction();
5249
+ const { busy, error, notice, run, setNotice } = useConfirmedChange();
5249
5250
  const moves = moveDestinations(item, organizations);
5250
5251
  const copies = copyDestinations(organizations, item);
5251
5252
  const [moveTo, setMoveTo] = useState24("");
@@ -5351,7 +5352,7 @@ function useGrants(port, item) {
5351
5352
  }
5352
5353
  function SharePanel({ item, port, organizations, onClose, onChanged }) {
5353
5354
  const { grants, setGrants, loadError, reload } = useGrants(port, item);
5354
- const { busy, error, notice, run } = useAction();
5355
+ const { busy, error, notice, run } = useConfirmedChange();
5355
5356
  const [email, setEmail] = useState25("");
5356
5357
  const [level, setLevel] = useState25("use");
5357
5358
  const [more, setMore] = useState25(false);
@@ -5474,7 +5475,7 @@ function SharePanel({ item, port, organizations, onClose, onChanged }) {
5474
5475
  );
5475
5476
  }
5476
5477
  function IntoOrganization({ item, port, organizations, grants, onShared }) {
5477
- const { busy, error, notice, run } = useAction();
5478
+ const { busy, error, notice, run } = useConfirmedChange();
5478
5479
  const open = organizations.filter((o) => !grants.some((g) => g.organizationId === o.id));
5479
5480
  const [target, setTarget] = useState25("");
5480
5481
  const [level, setLevel] = useState25("use");
@@ -5514,7 +5515,7 @@ var CHOICES = [
5514
5515
  function MemberAccess({ port, organizationId, organizationName }) {
5515
5516
  const [list, setList] = useState25(null);
5516
5517
  const [loadError, setLoadError] = useState25(null);
5517
- const { busy, error, run } = useAction();
5518
+ const { busy, error, run } = useConfirmedChange();
5518
5519
  useEffect15(() => {
5519
5520
  let live = true;
5520
5521
  port.sharing.memberAccess(organizationId).then(
@@ -6397,7 +6398,7 @@ function sortSent(rows) {
6397
6398
  import { jsx as jsx31, jsxs as jsxs29 } from "react/jsx-runtime";
6398
6399
  function SecureLinkPanel({ item, port, onClose }) {
6399
6400
  const sharing = port.sharing;
6400
- const { busy, error, notice, run, setNotice } = useAction();
6401
+ const { busy, error, notice, run, setNotice } = useConfirmedChange();
6401
6402
  const [remedy, setRemedy] = useState31(null);
6402
6403
  const [options, setOptions] = useState31(null);
6403
6404
  const [optionsError, setOptionsError] = useState31(null);
@@ -7550,7 +7551,7 @@ function MatchRow({ itemId, item, tag, family, port, busy, running, onOpen, onFi
7550
7551
 
7551
7552
  // src/Sidebar.tsx
7552
7553
  import { useState as useState39 } from "react";
7553
- import { cn as cn15 } from "@ai-matrx/design-system";
7554
+ import { cn as cn15, useLook as useLook2 } from "@ai-matrx/design-system";
7554
7555
  import { Select as Select10 } from "@ai-matrx/design-system/controls";
7555
7556
  import { jsx as jsx38, jsxs as jsxs36 } from "react/jsx-runtime";
7556
7557
  function vaultChoices(items, organizations, current) {
@@ -7610,13 +7611,14 @@ function viewOptions(views, allCount, deletedCount, hasFavorites, hasRecents, ha
7610
7611
  ];
7611
7612
  }
7612
7613
  function Entry({ on, glyph: Icon, label, count: count2, onClick }) {
7614
+ const desktop = useLook2() === "desktop";
7613
7615
  return /* @__PURE__ */ jsxs36(
7614
7616
  "button",
7615
7617
  {
7616
7618
  type: "button",
7617
7619
  "aria-current": on ? "page" : void 0,
7618
7620
  onClick,
7619
- className: cn15("flex h-8 w-full items-center gap-2.5 rounded-lg px-2.5 text-left text-sm", on ? "bg-sidebar-accent font-medium text-sidebar-accent-foreground" : "text-sidebar-foreground hover:bg-sidebar-accent"),
7621
+ className: cn15("flex h-8 w-full items-center gap-2.5 rounded-lg px-2.5 text-left text-sm", on ? desktop ? "bg-sidebar-accent text-primary" : "bg-sidebar-accent font-medium text-sidebar-accent-foreground" : "text-sidebar-foreground hover:bg-sidebar-accent"),
7620
7622
  children: [
7621
7623
  /* @__PURE__ */ jsx38(Icon, { className: "size-4 shrink-0" }),
7622
7624
  /* @__PURE__ */ jsx38("span", { className: "min-w-0 flex-1 truncate", children: label }),
@@ -7713,7 +7715,7 @@ function VaultApp(props) {
7713
7715
  const lock = props.host?.lock;
7714
7716
  const locked = useLocked(lock);
7715
7717
  const port = useMemo6(() => lock ? guardPort(props.port, () => lock.locked()) : props.port, [props.port, lock]);
7716
- return /* @__PURE__ */ jsx39("div", { className: "relative h-full min-h-0 w-full", children: /* @__PURE__ */ jsx39(NoticeProvider, { notify: props.notify, children: lock && locked ? /* @__PURE__ */ jsx39(LockedScreen, { lock }) : /* @__PURE__ */ jsx39(ClipboardProvider, { clipboard: props.host?.clipboard, children: /* @__PURE__ */ jsx39(RevealSecondsProvider, { seconds: props.host?.revealSeconds, children: /* @__PURE__ */ jsx39(IdentityGate, { identity: props.host?.identity, children: /* @__PURE__ */ jsx39(GeneratorLimitsProvider, { resolve: generatorLimitsFrom(props.host?.knobs), children: /* @__PURE__ */ jsx39(Workspace, { ...props, port }) }) }) }) }) }) });
7718
+ return /* @__PURE__ */ jsx39(LookScope, { look: props.look ?? "web", className: "h-full min-h-0 w-full", children: /* @__PURE__ */ jsx39("div", { className: "relative h-full min-h-0 w-full", children: /* @__PURE__ */ jsx39(NoticeProvider, { notify: props.notify, children: lock && locked ? /* @__PURE__ */ jsx39(LockedScreen, { lock }) : /* @__PURE__ */ jsx39(ClipboardProvider, { clipboard: props.host?.clipboard, children: /* @__PURE__ */ jsx39(RevealSecondsProvider, { seconds: props.host?.revealSeconds, children: /* @__PURE__ */ jsx39(IdentityGate, { identity: props.host?.identity, children: /* @__PURE__ */ jsx39(GeneratorLimitsProvider, { resolve: generatorLimitsFrom(props.host?.knobs), children: /* @__PURE__ */ jsx39(Workspace, { ...props, port }) }) }) }) }) }) }) });
7717
7719
  }
7718
7720
  function LockedScreen({ lock }) {
7719
7721
  const [busy, setBusy] = useState40(false);