@ai-matrx/office 0.8.59 → 0.8.61

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.
@@ -15,7 +15,7 @@ import {
15
15
  paragraphBorderParams,
16
16
  readDocumentLanguage,
17
17
  rulerGeometry
18
- } from "./chunk-DY5TGHBI.js";
18
+ } from "./chunk-JVEJ5XLX.js";
19
19
  import "./chunk-Y24EYKSD.js";
20
20
 
21
21
  // src/docs/doc-edit-ops.ts
package/dist/docs.cjs CHANGED
@@ -19,7 +19,7 @@
19
19
  var _chunkXJBJKOUHcjs = require('./chunk-XJBJKOUH.cjs');
20
20
 
21
21
 
22
- var _chunkNSU6EVJKcjs = require('./chunk-NSU6EVJK.cjs');
22
+ var _chunk6TUFBQLHcjs = require('./chunk-6TUFBQLH.cjs');
23
23
  require('./chunk-XAIKXHHJ.cjs');
24
24
 
25
25
  // src/docs/document-model.ts
@@ -959,7 +959,7 @@ function planBodyEdit(current, next) {
959
959
  };
960
960
  }
961
961
  function insertSpan(port, _current, edit) {
962
- if (port.insertMarkdown && _chunkNSU6EVJKcjs.looksLikeMarkdown.call(void 0, edit.insert)) {
962
+ if (port.insertMarkdown && _chunk6TUFBQLHcjs.looksLikeMarkdown.call(void 0, edit.insert)) {
963
963
  const stream = port.getDataStream();
964
964
  let at = edit.start;
965
965
  if (at > 0 && stream[at - 1] !== PARAGRAPH) {
package/dist/docs.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-5SHIHC4S.js";
20
20
  import {
21
21
  looksLikeMarkdown
22
- } from "./chunk-DY5TGHBI.js";
22
+ } from "./chunk-JVEJ5XLX.js";
23
23
  import "./chunk-Y24EYKSD.js";
24
24
 
25
25
  // src/docs/document-model.ts
package/dist/pdf.cjs CHANGED
@@ -258,12 +258,14 @@ function Result({ result, host, error }) {
258
258
  ] }) : null,
259
259
  result?.kind === "text" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
260
260
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
261
- "textarea",
261
+ import_controls2.Textarea,
262
262
  {
263
263
  readOnly: true,
264
264
  value: result.text,
265
265
  "aria-label": "Extracted text",
266
- className: "h-48 w-full resize-none rounded-md border border-border bg-background p-2 text-xs text-foreground"
266
+ minHeight: 192,
267
+ maxHeight: 192,
268
+ className: "w-full resize-none"
267
269
  }
268
270
  ),
269
271
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_controls2.Button, { variant: "outline", onClick: () => void copy(result.text), children: copied ? "Copied" : "Copy text" })
@@ -729,22 +731,19 @@ function MarkupPanel({ host, engine, snapshot, active, onPick, blocked, busy, on
729
731
  const Icon = MARKUP_ICONS[t.id];
730
732
  const on = t.id === active;
731
733
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("li", { children: [
732
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
733
- "button",
734
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
735
+ import_controls4.Tile,
734
736
  {
735
737
  type: "button",
736
- "aria-pressed": t.status === "ready" ? on : void 0,
738
+ dense: true,
739
+ variant: "quiet",
740
+ title: t.label,
741
+ icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon, {}),
742
+ end: t.status === "soon" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "shrink-0 whitespace-nowrap text-muted-foreground", children: "Soon" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("kbd", { className: "text-muted-foreground", children: t.key?.toUpperCase() }),
743
+ ...t.status === "ready" ? { selected: on } : {},
737
744
  disabled: t.status === "ready" && (!engine || Boolean(blocked)),
738
745
  onClick: () => t.status === "soon" ? onSoon(markupComingSoonId(t.id)) : onPick(t.id),
739
- className: (0, import_cn.cn)(
740
- "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:text-disabled-foreground",
741
- on && "bg-accent"
742
- ),
743
- children: [
744
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon, { className: "size-4 shrink-0" }),
745
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "min-w-0 flex-1 truncate", children: t.label }),
746
- t.status === "soon" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "shrink-0 whitespace-nowrap text-muted-foreground", children: "Soon" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("kbd", { className: "text-muted-foreground", children: t.key?.toUpperCase() })
747
- ]
746
+ className: "w-full"
748
747
  }
749
748
  ),
750
749
  t.status === "soon" && t.reason ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "pl-8 pr-2 text-xs text-muted-foreground", children: t.reason }) : null
@@ -782,19 +781,22 @@ function MarkupPanel({ host, engine, snapshot, active, onPick, blocked, busy, on
782
781
  ] })
783
782
  ] }),
784
783
  host.existingAnnotations ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Section, { label: "In this file", children: [
785
- existing === null ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "text-xs text-muted-foreground", children: "Reading\u2026" }) : existing.filter((a) => a.subtype !== "Link" && a.subtype !== "Widget").length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "text-xs text-muted-foreground", children: "No comments or markup yet" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ul", { className: "flex flex-col", "aria-label": "Annotations in this file", children: existing.filter((a) => a.subtype !== "Link" && a.subtype !== "Widget").map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("button", { type: "button", onClick: () => goToPage(a.page), className: "flex w-full items-start gap-2 rounded-md px-2 py-1 text-left text-xs hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: [
786
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "w-8 shrink-0 tabular-nums text-muted-foreground", children: [
787
- "p. ",
788
- a.page
789
- ] }),
790
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "min-w-0 flex-1", children: [
791
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "block", children: [
792
- a.subtype,
793
- a.author ? ` \xB7 ${a.author}` : ""
784
+ existing === null ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "text-xs text-muted-foreground", children: "Reading\u2026" }) : existing.filter((a) => a.subtype !== "Link" && a.subtype !== "Widget").length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "text-xs text-muted-foreground", children: "No comments or markup yet" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ul", { className: "flex flex-col", "aria-label": "Annotations in this file", children: existing.filter((a) => a.subtype !== "Link" && a.subtype !== "Widget").map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
785
+ import_controls4.Tile,
786
+ {
787
+ type: "button",
788
+ dense: true,
789
+ variant: "quiet",
790
+ title: `${a.subtype}${a.author ? ` \xB7 ${a.author}` : ""}`,
791
+ line: a.contents,
792
+ icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "w-8 shrink-0 tabular-nums text-muted-foreground", children: [
793
+ "p. ",
794
+ a.page
794
795
  ] }),
795
- a.contents ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "block truncate text-muted-foreground", children: a.contents }) : null
796
- ] })
797
- ] }) }, `${a.page}-${i}`)) }),
796
+ className: "w-full",
797
+ onClick: () => goToPage(a.page)
798
+ }
799
+ ) }, `${a.page}-${i}`)) }),
798
800
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "text-xs text-muted-foreground", children: "Markup already saved shows on the page; changing it in place is coming." })
799
801
  ] }) : null,
800
802
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Section, { label: "Coming soon", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ul", { className: "flex flex-col", "aria-label": "Markup coming soon", children: soon.map(row) }) })
@@ -894,35 +896,35 @@ function useWidth(ref) {
894
896
  }
895
897
  function ToolRows({ tool, hostTools, onPick, canMarkup = false }) {
896
898
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
897
- hostTools.map((t) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { role: "none", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
898
- "button",
899
+ hostTools.map((t) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { role: "none", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
900
+ import_controls5.Tile,
899
901
  {
900
902
  type: "button",
903
+ dense: true,
904
+ variant: "quiet",
901
905
  role: "menuitem",
902
906
  "aria-current": tool === `host:${t.id}` ? "true" : void 0,
903
- className: (0, import_cn2.cn)("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", tool === `host:${t.id}` && "bg-accent"),
904
- onClick: () => onPick(`host:${t.id}`),
905
- children: [
906
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(t.icon, { className: "size-4 shrink-0" }),
907
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "flex-1 whitespace-nowrap", children: t.label })
908
- ]
907
+ title: t.label,
908
+ icon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(t.icon, {}),
909
+ className: "w-full",
910
+ onClick: () => onPick(`host:${t.id}`)
909
911
  }
910
912
  ) }, `host:${t.id}`)),
911
913
  PDF_TOOLS.filter((t) => t.id !== "browse" && (t.id !== "markup" || canMarkup)).map((t) => {
912
914
  const Icon = PDF_TOOL_ICONS[t.id];
913
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { role: "none", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
914
- "button",
915
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { role: "none", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
916
+ import_controls5.Tile,
915
917
  {
916
918
  type: "button",
919
+ dense: true,
920
+ variant: "quiet",
917
921
  role: "menuitem",
918
922
  "aria-current": t.id === tool ? "true" : void 0,
919
- className: (0, import_cn2.cn)("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", t.id === tool && "bg-accent"),
920
- onClick: () => onPick(t.id),
921
- children: [
922
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { className: "size-4 shrink-0" }),
923
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "flex-1 whitespace-nowrap", children: t.label }),
924
- t.status === "soon" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-muted-foreground", children: "Coming soon" }) : null
925
- ]
923
+ title: t.label,
924
+ icon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, {}),
925
+ end: t.status === "soon" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-muted-foreground", children: "Coming soon" }) : void 0,
926
+ className: "w-full",
927
+ onClick: () => onPick(t.id)
926
928
  }
927
929
  ) }, t.id);
928
930
  })
@@ -1375,10 +1377,11 @@ function PdfWorkspace({ host, className }) {
1375
1377
  width: "lg"
1376
1378
  }
1377
1379
  ) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1378
- "button",
1380
+ import_controls5.Button,
1379
1381
  {
1380
1382
  type: "button",
1381
- className: "min-w-0 max-w-[16rem] truncate rounded-md px-2 text-sm font-medium text-foreground hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1383
+ variant: "quiet",
1384
+ className: "min-w-0 max-w-[16rem]",
1382
1385
  title: host.rename ? "Rename" : host.file.name,
1383
1386
  onClick: () => host.rename && (setNameDraft(host.file.name), setEditingName(true)),
1384
1387
  children: host.file.name
@@ -1499,21 +1502,21 @@ function PdfWorkspace({ host, className }) {
1499
1502
  }
1500
1503
  }
1501
1504
  ),
1502
- pop === "tool-search" && toolHits.length ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { role: "listbox", className: "absolute left-0 right-0 top-9 z-30 rounded-lg border border-border bg-popover p-1 shadow-lg", children: toolHits.map((t) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { role: "option", "aria-selected": false, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
1503
- "button",
1505
+ pop === "tool-search" && toolHits.length ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { role: "listbox", className: "absolute left-0 right-0 top-9 z-30 rounded-lg border border-border bg-popover p-1 shadow-lg", children: toolHits.map((t) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { role: "option", "aria-selected": false, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1506
+ import_controls5.Tile,
1504
1507
  {
1505
1508
  type: "button",
1506
- className: "flex w-full items-center justify-between rounded-md px-2 py-1 text-left text-xs hover:bg-accent",
1509
+ dense: true,
1510
+ variant: "quiet",
1511
+ title: t.label,
1512
+ end: t.status === "soon" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-muted-foreground", children: "Coming soon" }) : void 0,
1513
+ className: "w-full",
1507
1514
  onMouseDown: (e) => e.preventDefault(),
1508
1515
  onClick: () => {
1509
1516
  chooseTool(t.id);
1510
1517
  setToolQuery("");
1511
1518
  setPop(null);
1512
- },
1513
- children: [
1514
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: t.label }),
1515
- t.status === "soon" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-muted-foreground", children: "Coming soon" }) : null
1516
- ]
1519
+ }
1517
1520
  }
1518
1521
  ) }, t.id)) }) : null
1519
1522
  ] }) : null,
@@ -1618,7 +1621,7 @@ function PdfWorkspace({ host, className }) {
1618
1621
  ] }) : null
1619
1622
  ] }) : null,
1620
1623
  compact && sheet ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1621
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", "aria-label": "Close", className: "absolute inset-0 z-30 bg-background/60", onClick: () => setSheet(null) }),
1624
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_controls5.Tile, { type: "button", layout: "stack", variant: "quiet", title: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "sr-only", children: "Close" }), "aria-label": "Close", className: "absolute inset-0 z-30 h-full w-full bg-background/60", onClick: () => setSheet(null) }),
1622
1625
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "absolute inset-x-0 bottom-0 z-40 flex max-h-[75%] flex-col rounded-t-xl border-t border-border bg-background", role: "dialog", "aria-label": sheet === "pages" ? "Pages" : "Tools", children: sheet === "pages" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "h-[60vh] min-h-0", children: leftPanel }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex min-h-0 flex-col overflow-y-auto", children: [
1623
1626
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { className: "p-2", role: "menu", "aria-label": "Tools", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ToolRows, { tool: activeToolKey, hostTools, canMarkup, onPick: chooseTool }) }),
1624
1627
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "border-t border-border", children: rightPanel })