@ai-matrx/office 0.8.61 → 0.8.63

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/pdf.js CHANGED
@@ -159,6 +159,8 @@ function LayersList({ host }) {
159
159
  import { useEffect as useEffect2, useMemo, useRef, useState as useState2 } from "react";
160
160
  import { Button, Field, SegmentedControl as SegmentedControl2, Select, Textarea } from "@ai-matrx/design-system/controls";
161
161
  import { PageRangeInput, formatPageRanges, parsePageRanges } from "@ai-matrx/design-system/controls";
162
+ import { copyText } from "@ai-matrx/kit/clipboard";
163
+ import { toDelimited } from "@ai-matrx/kit/delimited";
162
164
  import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
163
165
  function Row({ label, children }) {
164
166
  return /* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-1", children: [
@@ -182,13 +184,14 @@ function RunButton({ busy, online, disabled, children, onClick }) {
182
184
  function Result({ result, host, error }) {
183
185
  const [copied, setCopied] = useState2(false);
184
186
  const csv = useMemo(
185
- () => result?.kind === "tables" ? result.tables.map((t) => t.rows.map((r) => r.map((c) => `"${c.replace(/"/g, '""')}"`).join(",")).join("\n")).join("\n\n") : "",
187
+ () => result?.kind === "tables" ? result.tables.map((t) => toDelimited(t.rows, { format: "csv" })).join("\n\n") : "",
186
188
  [result]
187
189
  );
188
190
  const copy = async (text) => {
189
- await navigator.clipboard.writeText(text);
190
- setCopied(true);
191
- setTimeout(() => setCopied(false), 1500);
191
+ if (await copyText(text)) {
192
+ setCopied(true);
193
+ setTimeout(() => setCopied(false), 1500);
194
+ }
192
195
  };
193
196
  return /* @__PURE__ */ jsxs2("div", { className: "flex min-h-[3rem] flex-col gap-2", "aria-live": "polite", children: [
194
197
  error ? /* @__PURE__ */ jsx2("p", { role: "alert", className: "rounded-md border border-destructive bg-destructive/10 p-2 text-xs text-destructive", children: error }) : null,
@@ -1593,7 +1596,7 @@ function PdfWorkspace({ host, className }) {
1593
1596
  ] }) : null
1594
1597
  ] }) : null,
1595
1598
  compact && sheet ? /* @__PURE__ */ jsxs4(Fragment4, { children: [
1596
- /* @__PURE__ */ jsx4(Tile2, { type: "button", layout: "stack", variant: "quiet", title: /* @__PURE__ */ jsx4("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) }),
1599
+ /* @__PURE__ */ jsx4("button", { type: "button", "aria-label": "Close", className: "absolute inset-0 z-30 bg-background/60", onClick: () => setSheet(null) }),
1597
1600
  /* @__PURE__ */ jsx4("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__ */ jsx4("div", { className: "h-[60vh] min-h-0", children: leftPanel }) : /* @__PURE__ */ jsxs4("div", { className: "flex min-h-0 flex-col overflow-y-auto", children: [
1598
1601
  /* @__PURE__ */ jsx4("ul", { className: "p-2", role: "menu", "aria-label": "Tools", children: /* @__PURE__ */ jsx4(ToolRows, { tool: activeToolKey, hostTools, canMarkup, onPick: chooseTool }) }),
1599
1602
  /* @__PURE__ */ jsx4("div", { className: "border-t border-border", children: rightPanel })