@parallelworks/ui 0.19.1 → 0.20.0

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/README.md CHANGED
@@ -11,7 +11,7 @@ so an application ships only what it imports:
11
11
  | `./list` | list pages, tables, row menus and list controls |
12
12
  | `./form` | `DynamicForm` and its field registry |
13
13
  | `./graph` | job dependency graph and tree view |
14
- | `./editor` | Monaco editor (`monaco-editor` and `monaco-yaml` are optional peers) |
14
+ | `./editor` | Monaco editor (`monaco-editor` is an optional peer); YAML validation, completion and hover run in a bundled worker |
15
15
  | `./logviewer` | log viewer with ANSI color and search |
16
16
  | `./file-explorer` | object storage explorer over a host-supplied provider |
17
17
  | `./ai`, `./ai/openai`, `./ai/mock` | chat interface and adapters |
@@ -1,3 +1,4 @@
1
+ import { safeUrl } from "../../safeUrl.js";
1
2
  import { DownloadFileIcon, FileIcon, TrashIcon } from "../../icons.js";
2
3
  import { useChatConfig } from "../core/config.js";
3
4
  import { useChat } from "../core/ChatProvider.js";
@@ -10,8 +11,10 @@ import { DateTime } from "luxon";
10
11
  import useSWRInfinite from "swr/infinite";
11
12
  //#region src/ai/components/AttachmentManager.tsx
12
13
  function triggerDownload(url, filename) {
14
+ const href = safeUrl(url);
15
+ if (!href) return;
13
16
  const a = document.createElement("a");
14
- a.href = url;
17
+ a.href = href;
15
18
  a.download = filename;
16
19
  document.body.appendChild(a);
17
20
  a.click();
@@ -1,3 +1,4 @@
1
+ import { safeUrl } from "../../safeUrl.js";
1
2
  import { CheckIcon, ChevronRightIcon, CopyIcon, DownloadFileIcon, EditIcon, ErrorIcon, FileIcon, RefreshIcon, RetryIcon } from "../../icons.js";
2
3
  import { durationToAbsHumanDuration } from "../../duration.js";
3
4
  import { useChatConfig } from "../core/config.js";
@@ -23,8 +24,10 @@ function parseTimestamp(iso) {
23
24
  return dt.isValid ? dt : null;
24
25
  }
25
26
  function triggerDownload(url, filename) {
27
+ const href = safeUrl(url);
28
+ if (!href) return;
26
29
  const a = document.createElement("a");
27
- a.href = url;
30
+ a.href = href;
28
31
  a.download = filename;
29
32
  document.body.appendChild(a);
30
33
  a.click();
@@ -1,3 +1,4 @@
1
+ import { safeUrl } from "../../safeUrl.js";
1
2
  import { defaultChatStrings } from "../strings.js";
2
3
  import { createContext, useContext } from "react";
3
4
  import { jsx } from "react/jsx-runtime";
@@ -11,7 +12,7 @@ function hrefFor(target) {
11
12
  }
12
13
  function DefaultLink({ target, className, title, onClick, children }) {
13
14
  return /* @__PURE__ */ jsx("a", {
14
- href: hrefFor(target),
15
+ href: safeUrl(hrefFor(target)),
15
16
  className,
16
17
  title,
17
18
  onClick,