@nivaro/react 0.2.54 → 0.2.56

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.
Files changed (151) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +99 -98
  3. package/dist/index.d.ts +367 -2
  4. package/dist/index.js +645 -616
  5. package/dist/layout-editor.d.ts +4 -0
  6. package/dist/shared/components/BackgroundRunOffer.js +117 -0
  7. package/dist/shared/components/BroadcastView.js +214 -213
  8. package/dist/shared/components/CollectionBrowserView.js +2592 -2695
  9. package/dist/shared/components/ItemEditForm.js +4066 -3832
  10. package/dist/shared/components/JobsTray.js +100 -55
  11. package/dist/shared/components/MyWorkView.js +91 -89
  12. package/dist/shared/components/NotificationBell.js +80 -79
  13. package/dist/shared/components/ProfileView.js +568 -520
  14. package/dist/shared/components/RecordCompare.js +254 -0
  15. package/dist/shared/components/RecordReadView.js +599 -552
  16. package/dist/shared/components/ReportView.js +578 -543
  17. package/dist/shared/components/RowPresence.js +91 -0
  18. package/dist/shared/components/WidgetSlot.js +474 -458
  19. package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
  20. package/dist/shared/components/ai/AskPanel.js +139 -119
  21. package/dist/shared/components/ai/FirstWeekCard.js +126 -0
  22. package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
  23. package/dist/shared/components/bulk/bulk-field-options.js +45 -0
  24. package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
  25. package/dist/shared/components/chat/ChannelArchive.js +326 -0
  26. package/dist/shared/components/chat/ChannelExtras.js +141 -121
  27. package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
  28. package/dist/shared/components/chat/ChatPanel.js +1695 -1733
  29. package/dist/shared/components/chat/Composer.js +357 -303
  30. package/dist/shared/components/chat/MessageActions.js +92 -0
  31. package/dist/shared/components/chat/MessageFormat.js +290 -264
  32. package/dist/shared/components/chat/OutboxBubbles.js +146 -0
  33. package/dist/shared/components/chat/RequestIdCard.js +135 -0
  34. package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
  35. package/dist/shared/components/chat/RoomParts.js +213 -274
  36. package/dist/shared/components/chat/ScreenClip.js +184 -0
  37. package/dist/shared/components/chat/chat-core.js +402 -483
  38. package/dist/shared/components/chat/chat-drafts.js +59 -0
  39. package/dist/shared/components/chat/chat-emoji.js +348 -0
  40. package/dist/shared/components/chat/chat-local-time.js +41 -0
  41. package/dist/shared/components/chat/chat-outbox.js +303 -0
  42. package/dist/shared/components/chat/chat-window.js +163 -0
  43. package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
  44. package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
  45. package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
  46. package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
  47. package/dist/shared/components/help-videos/api.js +76 -73
  48. package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
  49. package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
  50. package/dist/shared/components/item-edit/FieldAffordances.js +2 -2
  51. package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
  52. package/dist/shared/components/item-edit/FieldRow.js +292 -279
  53. package/dist/shared/components/item-edit/GroupSection.js +698 -574
  54. package/dist/shared/components/item-edit/InlineTableField.js +3 -1
  55. package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
  56. package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
  57. package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
  58. package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
  59. package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
  60. package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
  61. package/dist/shared/components/item-edit/lazy-sections.js +36 -0
  62. package/dist/shared/components/item-edit/lock-why.js +39 -32
  63. package/dist/shared/components/item-edit/picker-miss.js +26 -0
  64. package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
  65. package/dist/shared/components/item-edit/useFormUsageBeacon.js +51 -45
  66. package/dist/shared/components/layout-editor/AddPanel.js +134 -117
  67. package/dist/shared/components/layout-editor/ChangeNote.js +25 -24
  68. package/dist/shared/components/layout-editor/CollabParts.js +80 -75
  69. package/dist/shared/components/layout-editor/DesignNode.js +126 -120
  70. package/dist/shared/components/layout-editor/EditorCanvas.js +30 -27
  71. package/dist/shared/components/layout-editor/EditorTopBar.js +203 -192
  72. package/dist/shared/components/layout-editor/HistoryPanel.js +120 -104
  73. package/dist/shared/components/layout-editor/LayoutEditor.js +768 -671
  74. package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
  75. package/dist/shared/components/layout-editor/StagedChip.js +22 -0
  76. package/dist/shared/components/layout-editor/StructureMenu.js +237 -186
  77. package/dist/shared/components/layout-editor/collab/FormFollowShare.js +149 -103
  78. package/dist/shared/components/layout-editor/collab/collab-api.js +29 -26
  79. package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +81 -80
  80. package/dist/shared/components/layout-editor/dnd/node.js +69 -57
  81. package/dist/shared/components/layout-editor/draft-recovery.js +113 -43
  82. package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
  83. package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
  84. package/dist/shared/components/layout-editor/entry/presets.js +71 -0
  85. package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
  86. package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
  87. package/dist/shared/components/layout-editor/grid-guides.js +142 -0
  88. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
  89. package/dist/shared/components/layout-editor/inspector/BulkInspector.js +61 -57
  90. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +247 -151
  91. package/dist/shared/components/layout-editor/inspector/Inspector.js +176 -155
  92. package/dist/shared/components/layout-editor/inspector/LookTab.js +167 -116
  93. package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
  94. package/dist/shared/components/layout-editor/inspector/PickerTab.js +84 -82
  95. package/dist/shared/components/layout-editor/inspector/RulesTab.js +66 -62
  96. package/dist/shared/components/layout-editor/inspector/kit.js +69 -68
  97. package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
  98. package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
  99. package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
  100. package/dist/shared/components/layout-editor/overview/describe-conditions.js +6 -0
  101. package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
  102. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  103. package/dist/shared/components/layout-editor/restore-piece.js +192 -0
  104. package/dist/shared/components/layout-editor/section-structure.js +241 -0
  105. package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
  106. package/dist/shared/components/layout-editor/settings/FormSettings.js +41 -39
  107. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
  108. package/dist/shared/components/layout-editor/settings/ToolsSection.js +147 -111
  109. package/dist/shared/components/layout-editor/settings/WhoSection.js +29 -26
  110. package/dist/shared/components/layout-editor/settings/settings-registry.js +114 -17
  111. package/dist/shared/components/layout-editor/staged-api.js +64 -0
  112. package/dist/shared/components/layout-editor/structure-ops.js +81 -77
  113. package/dist/shared/components/layout-editor/testing/TestingPanels.js +65 -60
  114. package/dist/shared/components/layout-editor/testing/testing-model.js +198 -185
  115. package/dist/shared/components/layout-editor/toolbar-kit.js +11 -11
  116. package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
  117. package/dist/shared/components/layout-editor/usage/UsagePanel.js +144 -70
  118. package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
  119. package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
  120. package/dist/shared/components/layout-editor/useLayoutDraft.js +25 -24
  121. package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
  122. package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
  123. package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
  124. package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
  125. package/dist/shared/components/profile/AgentsPanel.js +479 -0
  126. package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
  127. package/dist/shared/components/support/SupportAnalytics.js +171 -0
  128. package/dist/shared/components/support/SupportView.js +75 -73
  129. package/dist/shared/lib/background-runs.js +150 -0
  130. package/dist/shared/lib/delivery-ack.js +9 -0
  131. package/dist/shared/lib/entry-badge-style.js +13 -0
  132. package/dist/shared/lib/entry-config.js +71 -0
  133. package/dist/shared/lib/form-sections.js +64 -0
  134. package/dist/shared/lib/form-structure.js +99 -0
  135. package/dist/shared/lib/form-usage-beacon.js +101 -52
  136. package/dist/shared/lib/jobs-tray.js +25 -23
  137. package/dist/shared/lib/keyset-pager.js +37 -0
  138. package/dist/shared/lib/layout-ops.js +84 -82
  139. package/dist/shared/lib/layout-resolve.js +113 -0
  140. package/dist/shared/lib/placement-behaviour.js +144 -0
  141. package/dist/shared/lib/prefetch.js +149 -0
  142. package/dist/shared/lib/presence-hooks.js +199 -0
  143. package/dist/shared/lib/record-outbox.js +82 -81
  144. package/dist/shared/lib/replay-socket.js +93 -0
  145. package/dist/shared/lib/request-gate.js +51 -50
  146. package/dist/shared/lib/room-gaps.js +96 -0
  147. package/dist/shared/lib/search-log.js +27 -0
  148. package/dist/shared/lib/socket-realtime.js +101 -80
  149. package/dist/shared/lib/stale-chunk.js +60 -0
  150. package/dist/shared/lib/worker-socket.js +200 -0
  151. package/package.json +1 -1
@@ -1,30 +1,31 @@
1
- import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
- import { useQuery as f } from "@tanstack/react-query";
3
- import { Loader2 as h, Check as p, ChevronDown as x, ChevronUp as v, AlertCircle as b, Timer as g, Download as y, X as w } from "lucide-react";
4
- import { useState as k, useEffect as N } from "react";
5
- import { createPortal as C } from "react-dom";
6
- import { useOptionalNivaroClient as $, useNavigation as q } from "../context.js";
7
- import { get as J } from "../lib/commands.js";
8
- import { useTrayJobs as D, seedJobs as _, dismissFinishedJobs as F, dismissJob as T, applyJobUpdate as E } from "../lib/jobs-tray.js";
9
- import { useLiveEvent as M } from "../lib/live.js";
10
- import { cn as O } from "../lib/utils.js";
11
- import { queueStanding as L } from "./imports/run-parts.js";
12
- function G() {
13
- const e = $(), u = q(), s = D(), [r, o] = k(!0);
14
- M("job:progress", (a) => E(a), { includeOwn: !0 });
15
- const d = s.some((a) => a.status === "running" || a.status === "queued"), { data: l } = f({
1
+ import { jsxs as o, jsx as t } from "react/jsx-runtime";
2
+ import { useQuery as b } from "@tanstack/react-query";
3
+ import { Loader2 as x, Check as f, ChevronDown as g, ChevronUp as y, AlertCircle as N, Timer as w, Download as C, X as _ } from "lucide-react";
4
+ import { useState as v, useEffect as $ } from "react";
5
+ import { createPortal as q } from "react-dom";
6
+ import { useOptionalNivaroClient as J, useNavigation as D } from "../context.js";
7
+ import { clock as F } from "../lib/background-runs.js";
8
+ import { get as T, post as E } from "../lib/commands.js";
9
+ import { useTrayJobs as M, seedJobs as O, dismissFinishedJobs as U, dismissJob as L, applyJobUpdate as R } from "../lib/jobs-tray.js";
10
+ import { useLiveEvent as S } from "../lib/live.js";
11
+ import { cn as z } from "../lib/utils.js";
12
+ import { queueStanding as A } from "./imports/run-parts.js";
13
+ function ee() {
14
+ const e = J(), d = D(), s = M(), [l, c] = v(!0);
15
+ S("job:progress", (a) => R(a), { includeOwn: !0 });
16
+ const m = s.some((a) => a.status === "running" || a.status === "queued"), { data: i } = b({
16
17
  queryKey: ["jobs-tray-seed"],
17
18
  enabled: !!e,
18
19
  staleTime: 0,
19
- refetchInterval: d ? 2e4 : !1,
20
- queryFn: () => e.request(J("/my-jobs")).then((a) => a.data ?? []).catch(() => [])
20
+ refetchInterval: m ? 2e4 : !1,
21
+ queryFn: () => e.request(T("/my-jobs")).then((a) => a.data ?? []).catch(() => [])
21
22
  });
22
- if (N(() => {
23
- l && _(l);
24
- }, [l]), s.length === 0 || typeof document > "u") return null;
25
- const n = s.filter((a) => a.status === "running" || a.status === "queued").length, i = s.length - n, m = (a) => u.navigate ? u.navigate(a) : window.location.assign(a);
26
- return C(
27
- /* @__PURE__ */ c(
23
+ if ($(() => {
24
+ i && O(i);
25
+ }, [i]), s.length === 0 || typeof document > "u") return null;
26
+ const r = s.filter((a) => a.status === "running" || a.status === "queued").length, n = s.length - r, u = (a) => d.navigate ? d.navigate(a) : window.location.assign(a);
27
+ return q(
28
+ /* @__PURE__ */ o(
28
29
  "div",
29
30
  {
30
31
  "data-jobs-tray": s.length,
@@ -32,23 +33,23 @@ function G() {
32
33
  "data-nvr-recording-hide": !0,
33
34
  className: "fixed bottom-4 left-1/2 z-[110] w-[min(420px,calc(100vw-2rem))] -translate-x-1/2 overflow-hidden rounded-xl border border-slate-200 bg-white text-slate-700 shadow-xl dark:border-[#334155] dark:bg-[#1e293b] dark:text-slate-200",
34
35
  children: [
35
- /* @__PURE__ */ c("div", { className: "flex items-center gap-2 px-3 py-2", children: [
36
- n > 0 ? /* @__PURE__ */ t(h, { className: "h-3.5 w-3.5 shrink-0 animate-spin text-nvr-cyan" }) : /* @__PURE__ */ t(p, { className: "h-3.5 w-3.5 shrink-0 text-emerald-600 dark:text-emerald-400" }),
36
+ /* @__PURE__ */ o("div", { className: "flex items-center gap-2 px-3 py-2", children: [
37
+ r > 0 ? /* @__PURE__ */ t(x, { className: "h-3.5 w-3.5 shrink-0 animate-spin text-nvr-cyan" }) : /* @__PURE__ */ t(f, { className: "h-3.5 w-3.5 shrink-0 text-emerald-600 dark:text-emerald-400" }),
37
38
  /* @__PURE__ */ t(
38
39
  "button",
39
40
  {
40
41
  type: "button",
41
- onClick: () => o((a) => !a),
42
+ onClick: () => c((a) => !a),
42
43
  className: "min-w-0 flex-1 text-left text-[12.5px] font-medium",
43
- "aria-expanded": r,
44
- children: n > 0 ? `${n} job${n === 1 ? "" : "s"} running` : `${i} job${i === 1 ? "" : "s"} finished`
44
+ "aria-expanded": l,
45
+ children: r > 0 ? `${r} job${r === 1 ? "" : "s"} running` : `${n} job${n === 1 ? "" : "s"} finished`
45
46
  }
46
47
  ),
47
- i > 0 && /* @__PURE__ */ t(
48
+ n > 0 && /* @__PURE__ */ t(
48
49
  "button",
49
50
  {
50
51
  type: "button",
51
- onClick: F,
52
+ onClick: U,
52
53
  "data-jobs-tray-clear": !0,
53
54
  className: "text-[11px] text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-100",
54
55
  children: "Clear finished"
@@ -58,60 +59,76 @@ function G() {
58
59
  "button",
59
60
  {
60
61
  type: "button",
61
- onClick: () => o((a) => !a),
62
- "aria-label": r ? "Collapse" : "Expand",
62
+ onClick: () => c((a) => !a),
63
+ "aria-label": l ? "Collapse" : "Expand",
63
64
  className: "flex h-6 w-6 items-center justify-center rounded hover:bg-black/5 dark:hover:bg-white/10",
64
- children: r ? /* @__PURE__ */ t(x, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(v, { className: "h-3.5 w-3.5" })
65
+ children: l ? /* @__PURE__ */ t(g, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(y, { className: "h-3.5 w-3.5" })
65
66
  }
66
67
  )
67
68
  ] }),
68
- r && /* @__PURE__ */ t("ul", { className: "max-h-[40vh] divide-y divide-slate-100 overflow-y-auto border-t border-slate-100 dark:divide-[#334155] dark:border-[#334155]", children: s.map((a) => /* @__PURE__ */ t(S, { job: a, onOpen: m }, a.key)) })
69
+ l && /* @__PURE__ */ t("ul", { className: "max-h-[40vh] divide-y divide-slate-100 overflow-y-auto border-t border-slate-100 dark:divide-[#334155] dark:border-[#334155]", children: s.map((a) => /* @__PURE__ */ t(
70
+ B,
71
+ {
72
+ job: a,
73
+ onOpen: u,
74
+ onCancel: e && a.cancel_path ? (h) => e.request(E(h)).then(() => {
75
+ }) : void 0
76
+ },
77
+ a.key
78
+ )) })
69
79
  ]
70
80
  }
71
81
  ),
72
82
  document.body
73
83
  );
74
84
  }
75
- function S({ job: e, onOpen: u }) {
76
- const s = e.status === "completed", r = e.status === "error", o = e.status === "queued", d = e.progress ?? {}, l = Number(d.total), n = Number(d.done), i = Number.isFinite(l) && l > 0 && Number.isFinite(n) ? Math.max(0, Math.min(100, Math.round(n / l * 100))) : null, m = typeof d.phase == "string" ? d.phase : null, a = o ? L(
85
+ function B({
86
+ job: e,
87
+ onOpen: d,
88
+ onCancel: s
89
+ }) {
90
+ const [l, c] = v("idle"), m = e.status === "completed", i = e.status === "error", r = e.status === "queued", n = e.progress ?? {}, u = Number(n.total), a = Number(n.done), h = Number.isFinite(u) && u > 0 && Number.isFinite(a) ? Math.max(0, Math.min(100, Math.round(a / u * 100))) : null, k = typeof n.phase == "string" ? n.phase : null, p = r ? A(
77
91
  e.position != null ? { position: e.position, eta_seconds: e.eta_seconds ?? null } : void 0
78
- ) : r ? e.error : s ? e.outcome : [m, i != null ? `${n} of ${l}` : null].filter(Boolean).join(" · ") || null;
79
- return /* @__PURE__ */ c(
92
+ ) : i ? e.error : m ? e.outcome : e.kind === "background-run" ? (
93
+ // #2759 — a slow read the server is finishing: say how long it usually takes.
94
+ Number(n.expected_ms) >= 1e3 ? `Usually takes about ${F(Number(n.expected_ms))}` : "Running on the server"
95
+ ) : [k, h != null ? `${a} of ${u}` : null].filter(Boolean).join(" · ") || null;
96
+ return /* @__PURE__ */ o(
80
97
  "li",
81
98
  {
82
99
  "data-job": e.key,
83
100
  "data-job-status": e.status,
84
101
  className: "flex items-start gap-2.5 px-3 py-2",
85
102
  children: [
86
- /* @__PURE__ */ t("span", { className: "mt-0.5 shrink-0", children: r ? /* @__PURE__ */ t(b, { className: "h-3.5 w-3.5 text-rose-500" }) : s ? /* @__PURE__ */ t(p, { className: "h-3.5 w-3.5 text-emerald-600 dark:text-emerald-400" }) : o ? /* @__PURE__ */ t(g, { className: "h-3.5 w-3.5 text-slate-400" }) : /* @__PURE__ */ t(h, { className: "h-3.5 w-3.5 animate-spin text-nvr-cyan" }) }),
87
- /* @__PURE__ */ c("div", { className: "min-w-0 flex-1", children: [
103
+ /* @__PURE__ */ t("span", { className: "mt-0.5 shrink-0", children: i ? /* @__PURE__ */ t(N, { className: "h-3.5 w-3.5 text-rose-500" }) : m ? /* @__PURE__ */ t(f, { className: "h-3.5 w-3.5 text-emerald-600 dark:text-emerald-400" }) : r ? /* @__PURE__ */ t(w, { className: "h-3.5 w-3.5 text-slate-400" }) : /* @__PURE__ */ t(x, { className: "h-3.5 w-3.5 animate-spin text-nvr-cyan" }) }),
104
+ /* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
88
105
  /* @__PURE__ */ t("p", { className: "truncate text-[12.5px] font-medium", children: e.label }),
89
- a && /* @__PURE__ */ t(
106
+ p && /* @__PURE__ */ t(
90
107
  "p",
91
108
  {
92
- className: O(
109
+ className: z(
93
110
  "line-clamp-2 text-[11px]",
94
- r ? "text-rose-600 dark:text-rose-300" : "text-slate-500 dark:text-slate-400"
111
+ i ? "text-rose-600 dark:text-rose-300" : "text-slate-500 dark:text-slate-400"
95
112
  ),
96
- children: a
113
+ children: p
97
114
  }
98
115
  ),
99
- e.status === "running" && i != null && /* @__PURE__ */ t("div", { className: "mt-1 h-1 overflow-hidden rounded-full bg-slate-100 dark:bg-[#334155]", children: /* @__PURE__ */ t(
116
+ e.status === "running" && h != null && /* @__PURE__ */ t("div", { className: "mt-1 h-1 overflow-hidden rounded-full bg-slate-100 dark:bg-[#334155]", children: /* @__PURE__ */ t(
100
117
  "div",
101
118
  {
102
119
  className: "h-full rounded-full bg-nvr-cyan transition-all",
103
- style: { width: `${i}%` }
120
+ style: { width: `${h}%` }
104
121
  }
105
122
  ) }),
106
- (e.file_id || e.href) && (e.status === "completed" || e.status === "error") && /* @__PURE__ */ c("div", { className: "mt-1 flex items-center gap-2", children: [
107
- e.file_id && s && /* @__PURE__ */ c(
123
+ (e.file_id || e.href) && (e.status === "completed" || e.status === "error") && /* @__PURE__ */ o("div", { className: "mt-1 flex items-center gap-2", children: [
124
+ e.file_id && m && /* @__PURE__ */ o(
108
125
  "a",
109
126
  {
110
127
  href: `/api/files/${e.file_id}?download=1`,
111
128
  "data-job-download": !0,
112
129
  className: "inline-flex items-center gap-1 rounded-full border border-nvr-cyan/50 bg-nvr-cyan/10 px-2 py-0.5 text-[11px] font-medium text-[#0e7490] hover:bg-nvr-cyan/20 dark:text-[#67e8f9]",
113
130
  children: [
114
- /* @__PURE__ */ t(y, { className: "h-3 w-3" }),
131
+ /* @__PURE__ */ t(C, { className: "h-3 w-3" }),
115
132
  "Download"
116
133
  ]
117
134
  }
@@ -120,17 +137,45 @@ function S({ job: e, onOpen: u }) {
120
137
  "button",
121
138
  {
122
139
  type: "button",
123
- onClick: () => u(e.href),
140
+ onClick: () => d(e.href),
124
141
  className: "text-[11px] text-slate-500 underline-offset-2 hover:underline dark:text-slate-400",
125
142
  children: "Details"
126
143
  }
127
144
  )
128
145
  ] }),
129
- o && e.href && /* @__PURE__ */ t(
146
+ e.status === "running" && e.cancel_path && s && /* @__PURE__ */ o("div", { className: "mt-1 flex items-center gap-2", children: [
147
+ e.href && /* @__PURE__ */ t(
148
+ "button",
149
+ {
150
+ type: "button",
151
+ onClick: () => d(e.href),
152
+ className: "text-[11px] text-slate-500 underline-offset-2 hover:underline dark:text-slate-400",
153
+ children: "Open"
154
+ }
155
+ ),
156
+ /* @__PURE__ */ t(
157
+ "button",
158
+ {
159
+ type: "button",
160
+ "data-job-cancel": !0,
161
+ disabled: l === "asking",
162
+ onClick: () => {
163
+ c("asking"), s(e.cancel_path).then(
164
+ () => c("idle"),
165
+ () => c("failed")
166
+ );
167
+ },
168
+ className: "text-[11px] text-slate-500 underline-offset-2 hover:text-rose-600 hover:underline disabled:opacity-50 dark:text-slate-400 dark:hover:text-rose-300",
169
+ children: l === "asking" ? "Cancelling…" : "Cancel"
170
+ }
171
+ ),
172
+ l === "failed" && /* @__PURE__ */ t("span", { className: "text-[11px] text-rose-600 dark:text-rose-300", children: "Could not cancel" })
173
+ ] }),
174
+ r && e.href && /* @__PURE__ */ t(
130
175
  "button",
131
176
  {
132
177
  type: "button",
133
- onClick: () => u(e.href),
178
+ onClick: () => d(e.href),
134
179
  className: "mt-0.5 text-[11px] text-slate-500 underline-offset-2 hover:underline dark:text-slate-400",
135
180
  children: "Details"
136
181
  }
@@ -140,11 +185,11 @@ function S({ job: e, onOpen: u }) {
140
185
  "button",
141
186
  {
142
187
  type: "button",
143
- onClick: () => T(e.key),
188
+ onClick: () => L(e.key),
144
189
  "aria-label": "Dismiss",
145
190
  "data-job-dismiss": !0,
146
191
  className: "flex h-6 w-6 shrink-0 items-center justify-center rounded hover:bg-black/5 dark:hover:bg-white/10",
147
- children: /* @__PURE__ */ t(w, { className: "h-3 w-3" })
192
+ children: /* @__PURE__ */ t(_, { className: "h-3 w-3" })
148
193
  }
149
194
  )
150
195
  ]
@@ -152,5 +197,5 @@ function S({ job: e, onOpen: u }) {
152
197
  );
153
198
  }
154
199
  export {
155
- G as JobsTray
200
+ ee as JobsTray
156
201
  };