@mvriu5/payload-ai 0.5.9 → 0.5.10

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 (69) hide show
  1. package/README.md +62 -6
  2. package/dist/ai/{proposals.d.ts → proposalSigning.d.ts} +1 -1
  3. package/dist/ai/{proposals.js → proposalSigning.js} +6 -11
  4. package/dist/ai/providerOptions.d.ts +17 -1
  5. package/dist/ai/providerOptions.js +35 -7
  6. package/dist/ai/providerRuntime.d.ts +2 -2
  7. package/dist/ai/providerRuntime.js +50 -16
  8. package/dist/ai/sensitiveData.js +2 -6
  9. package/dist/components/AIInput.d.ts +2 -1
  10. package/dist/components/AIInput.js +210 -39
  11. package/dist/components/AIInput.module.css +15 -1
  12. package/dist/components/APIKeyField.d.ts +3 -0
  13. package/dist/components/{AIApiKeyField.js → APIKeyField.js} +3 -4
  14. package/dist/components/ActionToast.d.ts +30 -0
  15. package/dist/components/{AIActionProposalList.js → ActionToast.js} +10 -8
  16. package/dist/components/AuditLogList.d.ts +32 -0
  17. package/dist/components/{RecentChangesList.js → AuditLogList.js} +13 -12
  18. package/dist/components/{RecentChangesList.module.css → AuditLogList.module.css} +18 -1
  19. package/dist/components/DiffDialog.d.ts +10 -3
  20. package/dist/components/DiffDialog.js +164 -78
  21. package/dist/components/DiffDialog.module.css +86 -2
  22. package/dist/components/Icons.d.ts +5 -0
  23. package/dist/components/Icons.js +109 -3
  24. package/dist/components/MentionPopover.d.ts +19 -0
  25. package/dist/components/{CollectionMentionPopover.js → MentionPopover.js} +11 -4
  26. package/dist/components/{CollectionMentionPopover.module.css → MentionPopover.module.css} +0 -2
  27. package/dist/components/hooks/useAISettings.d.ts +6 -4
  28. package/dist/components/hooks/useAISettings.js +18 -3
  29. package/dist/components/hooks/useDocumentMentionSuggestions.d.ts +3 -3
  30. package/dist/components/hooks/useDocumentMentionSuggestions.js +2 -2
  31. package/dist/exports/client.d.ts +4 -2
  32. package/dist/exports/client.js +4 -2
  33. package/dist/handlers/applyActionHandler.d.ts +8 -0
  34. package/dist/handlers/applyActionHandler.js +563 -0
  35. package/dist/handlers/auditLogHandler.d.ts +6 -0
  36. package/dist/{endpoints/aiRecentChangesEndpointHandler.js → handlers/auditLogHandler.js} +12 -8
  37. package/dist/handlers/chatHandler.d.ts +42 -0
  38. package/dist/handlers/chatHandler.js +634 -0
  39. package/dist/handlers/mentionSuggestionHandler.d.ts +7 -0
  40. package/dist/handlers/mentionSuggestionHandler.js +97 -0
  41. package/dist/handlers/proposalDiffHandler.d.ts +7 -0
  42. package/dist/handlers/proposalDiffHandler.js +208 -0
  43. package/dist/index.d.ts +6 -6
  44. package/dist/index.js +50 -18
  45. package/dist/payload/collectionPermissions.d.ts +14 -13
  46. package/dist/payload/collectionPermissions.js +3 -2
  47. package/dist/payload/normalizeData.d.ts +8 -0
  48. package/dist/payload/normalizeData.js +25 -3
  49. package/dist/payload/schemaContext.d.ts +43 -16
  50. package/dist/payload/schemaContext.js +139 -18
  51. package/dist/payload/shared.d.ts +33 -0
  52. package/dist/payload/shared.js +114 -0
  53. package/package.json +7 -2
  54. package/dist/components/AIActionProposalList.d.ts +0 -26
  55. package/dist/components/AIApiKeyField.d.ts +0 -2
  56. package/dist/components/CollectionMentionPopover.d.ts +0 -16
  57. package/dist/components/RecentChangesList.d.ts +0 -18
  58. package/dist/components/hooks/utils.d.ts +0 -1
  59. package/dist/components/hooks/utils.js +0 -3
  60. package/dist/endpoints/aiApplyActionEndpointHandler.d.ts +0 -8
  61. package/dist/endpoints/aiApplyActionEndpointHandler.js +0 -365
  62. package/dist/endpoints/aiChatEndpointHandler.d.ts +0 -35
  63. package/dist/endpoints/aiChatEndpointHandler.js +0 -382
  64. package/dist/endpoints/aiMentionSuggestionsEndpointHandler.d.ts +0 -7
  65. package/dist/endpoints/aiMentionSuggestionsEndpointHandler.js +0 -63
  66. package/dist/endpoints/aiProposalDiffEndpointHandler.d.ts +0 -7
  67. package/dist/endpoints/aiProposalDiffEndpointHandler.js +0 -138
  68. package/dist/endpoints/aiRecentChangesEndpointHandler.d.ts +0 -6
  69. /package/dist/components/{AIActionProposalList.module.css → ActionToast.module.css} +0 -0
@@ -1,8 +1,7 @@
1
1
  import { useState } from "react";
2
- import { DiffDialog } from "./DiffDialog.js";
3
- import { FileDiff } from "./Icons.js";
4
- import styles from "./RecentChangesList.module.css";
5
2
  import { ExternalLinkIcon } from "@payloadcms/ui";
3
+ import { DiffDialog } from "./DiffDialog.js";
4
+ import styles from "./AuditLogList.module.css";
6
5
  const getChangeProposal = (change)=>({
7
6
  action: change.action || "update",
8
7
  collection: change.collection || undefined,
@@ -10,7 +9,7 @@ const getChangeProposal = (change)=>({
10
9
  label: change.title,
11
10
  slug: change.slug || undefined
12
11
  });
13
- export const RecentChangesList = ({ changes })=>{
12
+ export const RecentChangesList = ({ allChangesURL, changes })=>{
14
13
  const [activeDiff, setActiveDiff] = useState(null);
15
14
  return /*#__PURE__*/ React.createElement("aside", {
16
15
  className: styles.recentChanges
@@ -18,7 +17,10 @@ export const RecentChangesList = ({ changes })=>{
18
17
  className: styles.header
19
18
  }, /*#__PURE__*/ React.createElement("h3", {
20
19
  className: styles.title
21
- }, "Recent changes")), /*#__PURE__*/ React.createElement("div", {
20
+ }, "Recent changes"), allChangesURL && /*#__PURE__*/ React.createElement("a", {
21
+ className: styles.headerGhostButton,
22
+ href: allChangesURL
23
+ }, "View all")), /*#__PURE__*/ React.createElement("div", {
22
24
  className: styles.list
23
25
  }, changes.length === 0 ? /*#__PURE__*/ React.createElement("div", {
24
26
  className: styles.empty
@@ -29,12 +31,12 @@ export const RecentChangesList = ({ changes })=>{
29
31
  className: styles.titleRow
30
32
  }, /*#__PURE__*/ React.createElement("div", {
31
33
  className: styles.itemTitle
32
- }, change.title), change.url ? /*#__PURE__*/ React.createElement("a", {
34
+ }, change.title), change.url && /*#__PURE__*/ React.createElement("a", {
33
35
  className: styles.ghostButton,
34
36
  href: change.url,
35
37
  rel: "noreferrer noopener",
36
38
  target: "_blank"
37
- }, /*#__PURE__*/ React.createElement(ExternalLinkIcon, null)) : null), /*#__PURE__*/ React.createElement("div", {
39
+ }, /*#__PURE__*/ React.createElement(ExternalLinkIcon, null))), /*#__PURE__*/ React.createElement("div", {
38
40
  className: styles.stats
39
41
  }, /*#__PURE__*/ React.createElement("code", {
40
42
  className: styles.additions
@@ -47,6 +49,7 @@ export const RecentChangesList = ({ changes })=>{
47
49
  return;
48
50
  }
49
51
  setActiveDiff({
52
+ change,
50
53
  diff: {
51
54
  after: change.after,
52
55
  before: change.before
@@ -55,12 +58,10 @@ export const RecentChangesList = ({ changes })=>{
55
58
  });
56
59
  },
57
60
  type: "button"
58
- }, /*#__PURE__*/ React.createElement(FileDiff, {
59
- height: 16,
60
- width: 16
61
- }), "Review")))), activeDiff ? /*#__PURE__*/ React.createElement(DiffDialog, {
61
+ }, "Review")))), activeDiff && activeDiff.change && /*#__PURE__*/ React.createElement(DiffDialog, {
62
+ change: activeDiff.change,
62
63
  diff: activeDiff.diff,
63
64
  onClose: ()=>setActiveDiff(null),
64
65
  proposal: activeDiff.proposal
65
- }) : null);
66
+ }));
66
67
  };
@@ -8,10 +8,27 @@
8
8
  }
9
9
 
10
10
  .header {
11
+ align-items: center;
12
+ display: flex;
11
13
  flex: 0 0 auto;
14
+ gap: 10px;
15
+ justify-content: space-between;
12
16
  margin-bottom: 10px;
13
17
  }
14
18
 
19
+ .headerGhostButton {
20
+ color: var(--theme-elevation-500);
21
+ flex: 0 0 auto;
22
+ font-size: 12px;
23
+ line-height: 24px;
24
+ min-height: 24px;
25
+ text-decoration: none;
26
+ }
27
+
28
+ .headerGhostButton:hover {
29
+ text-decoration: underline;
30
+ }
31
+
15
32
  .title {
16
33
  font-size: 14px;
17
34
  line-height: 1.3;
@@ -42,7 +59,7 @@
42
59
  display: grid;
43
60
  gap: 8px;
44
61
  grid-template-columns: minmax(0, 1fr) auto auto;
45
- padding: 10px;
62
+ padding: 4px 4px 4px 8px;
46
63
  }
47
64
 
48
65
  .titleRow {
@@ -1,12 +1,19 @@
1
- import type { AIActionProposal } from "./AIActionProposalList.js";
1
+ import type { ActionProposal } from "./ActionToast.js";
2
+ import type { AppliedChange } from "./AuditLogList.js";
2
3
  export type ProposalDiff = {
3
4
  after: unknown;
4
5
  before: unknown;
5
6
  };
6
7
  type DiffDialogProps = {
8
+ change?: AppliedChange;
7
9
  diff: ProposalDiff;
8
10
  onClose: () => void;
9
- proposal: AIActionProposal;
11
+ proposal: ActionProposal;
12
+ tokenUsage?: {
13
+ inputTokens?: number;
14
+ outputTokens?: number;
15
+ totalTokens?: number;
16
+ };
10
17
  };
11
- export declare const DiffDialog: ({ diff, onClose, proposal }: DiffDialogProps) => import("react").JSX.Element;
18
+ export declare const DiffDialog: ({ change, diff, onClose, proposal, tokenUsage }: DiffDialogProps) => import("react").JSX.Element;
12
19
  export {};
@@ -1,19 +1,25 @@
1
1
  import { XIcon } from "@payloadcms/ui/icons/X";
2
- import { useState } from "react";
2
+ import { useEffect, useState } from "react";
3
+ import { getJSONLineKey } from "../payload/shared.js";
3
4
  import styles from "./DiffDialog.module.css";
4
5
  const formatDiffValue = (value)=>{
5
6
  return JSON.stringify(value, null, 2);
6
7
  };
8
+ const formatDateTime = (value)=>{
9
+ if (!value) return null;
10
+ const date = new Date(value);
11
+ if (Number.isNaN(date.getTime())) return value;
12
+ return new Intl.DateTimeFormat(undefined, {
13
+ dateStyle: "medium",
14
+ timeStyle: "short"
15
+ }).format(date);
16
+ };
7
17
  const createLine = ({ changed, path, placeholder = false, text = "" })=>({
8
18
  changed,
9
19
  path,
10
20
  placeholder,
11
21
  text
12
22
  });
13
- const getJSONLineKey = (line)=>{
14
- const match = /^(\s*)"([^"]+)":/.exec(line);
15
- return match ? `${match[1]}${match[2]}` : null;
16
- };
17
23
  const shouldPairChangedLines = (beforeLine, afterLine)=>{
18
24
  const beforeKey = getJSONLineKey(beforeLine);
19
25
  const afterKey = getJSONLineKey(afterLine);
@@ -39,7 +45,7 @@ const getRowPath = (row)=>{
39
45
  const isChangedRow = (row)=>{
40
46
  return row.before.changed || row.after.changed;
41
47
  };
42
- const buildDisplayRows = (rows, expandedGroups)=>{
48
+ const buildDisplayRows = (rows, expandedGroups, groupPrefix = "")=>{
43
49
  const displayRows = [];
44
50
  const contextRows = 2;
45
51
  let index = 0;
@@ -70,7 +76,8 @@ const buildDisplayRows = (rows, expandedGroups)=>{
70
76
  }
71
77
  continue;
72
78
  }
73
- const isExpanded = expandedGroups.has(groupID);
79
+ const scopedGroupID = groupPrefix ? `${groupPrefix}:${groupID}` : groupID;
80
+ const isExpanded = expandedGroups.has(scopedGroupID);
74
81
  for(let rowIndex = start; rowIndex < start + contextRows; rowIndex += 1){
75
82
  displayRows.push({
76
83
  index: rowIndex,
@@ -213,18 +220,56 @@ const getDiffRows = (before, after)=>{
213
220
  }
214
221
  return rows;
215
222
  };
216
- export const DiffDialog = ({ diff, onClose, proposal })=>{
223
+ const isLocaleDiffMap = (value)=>{
224
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
225
+ return Object.values(value).every((entry)=>entry && typeof entry === "object" && !Array.isArray(entry));
226
+ };
227
+ const getDiffSections = (diff)=>{
228
+ if (isLocaleDiffMap(diff.before) && isLocaleDiffMap(diff.after)) {
229
+ const beforeByLocale = diff.before;
230
+ const afterByLocale = diff.after;
231
+ const localeKeys = Array.from(new Set([
232
+ ...Object.keys(beforeByLocale),
233
+ ...Object.keys(afterByLocale)
234
+ ]));
235
+ return localeKeys.map((locale)=>({
236
+ afterValue: formatDiffValue(afterByLocale[locale] ?? {}),
237
+ beforeValue: formatDiffValue(beforeByLocale[locale] ?? {}),
238
+ id: locale,
239
+ label: `Locale: ${locale}`
240
+ }));
241
+ }
242
+ return [
243
+ {
244
+ afterValue: formatDiffValue(diff.after),
245
+ beforeValue: formatDiffValue(diff.before),
246
+ id: "default"
247
+ }
248
+ ];
249
+ };
250
+ const formatTokenUsage = (value)=>{
251
+ return typeof value === "number" && Number.isFinite(value) && value > 0 ? value.toLocaleString() : null;
252
+ };
253
+ export const DiffDialog = ({ change, diff, onClose, proposal, tokenUsage })=>{
217
254
  const [scrollLeft, setScrollLeft] = useState(0);
218
255
  const [expandedGroups, setExpandedGroups] = useState(()=>new Set());
219
- const beforeValue = formatDiffValue(diff.before);
220
- const afterValue = formatDiffValue(diff.after);
221
- const diffRows = getDiffRows(beforeValue, afterValue);
222
- const displayRows = buildDisplayRows(diffRows, expandedGroups);
223
- const longestLineLength = Math.max(...beforeValue.split("\n").map((line)=>line.length), ...afterValue.split("\n").map((line)=>line.length), 80);
224
- const diffShellStyle = {
225
- "--diff-line-offset": `-${scrollLeft}px`,
226
- "--diff-line-width": `${longestLineLength + 8}ch`
227
- };
256
+ const diffSections = getDiffSections(diff);
257
+ const totalTokens = formatTokenUsage(change?.totalTokens) || formatTokenUsage(tokenUsage?.totalTokens);
258
+ const inputTokens = formatTokenUsage(change?.inputTokens) || formatTokenUsage(tokenUsage?.inputTokens);
259
+ const outputTokens = formatTokenUsage(change?.outputTokens) || formatTokenUsage(tokenUsage?.outputTokens);
260
+ useEffect(()=>{
261
+ const handleKeyDown = (event)=>{
262
+ if (event.key === "Escape") {
263
+ onClose();
264
+ }
265
+ };
266
+ window.addEventListener("keydown", handleKeyDown);
267
+ return ()=>{
268
+ window.removeEventListener("keydown", handleKeyDown);
269
+ };
270
+ }, [
271
+ onClose
272
+ ]);
228
273
  return /*#__PURE__*/ React.createElement("div", {
229
274
  "aria-modal": "true",
230
275
  className: styles.dialogOverlay,
@@ -243,68 +288,109 @@ export const DiffDialog = ({ diff, onClose, proposal })=>{
243
288
  onClick: onClose,
244
289
  type: "button"
245
290
  }, /*#__PURE__*/ React.createElement(XIcon, null))), /*#__PURE__*/ React.createElement("div", {
246
- className: styles.diffShell,
247
- style: diffShellStyle
248
- }, /*#__PURE__*/ React.createElement("div", {
249
- className: styles.diffScroll
291
+ className: styles.dialogContent
292
+ }, change ? /*#__PURE__*/ React.createElement("div", {
293
+ className: styles.detailSection
250
294
  }, /*#__PURE__*/ React.createElement("div", {
251
- className: styles.diffHeaderGrid
295
+ className: styles.detailGrid
296
+ }, /*#__PURE__*/ React.createElement("span", {
297
+ className: styles.detailLabel
298
+ }, "User"), /*#__PURE__*/ React.createElement("span", {
299
+ className: styles.detailValue
300
+ }, change.userLabel || change.userID || "Unknown"), /*#__PURE__*/ React.createElement("span", {
301
+ className: styles.detailLabel
302
+ }, "Date"), /*#__PURE__*/ React.createElement("span", {
303
+ className: styles.detailValue
304
+ }, formatDateTime(change.createdAt) || "Unknown"), totalTokens && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("span", {
305
+ className: styles.detailLabel
306
+ }, "Tokens"), /*#__PURE__*/ React.createElement("span", {
307
+ className: styles.detailValue
308
+ }, totalTokens, inputTokens && outputTokens ? ` (${inputTokens} in / ${outputTokens} out)` : "")))) : totalTokens && /*#__PURE__*/ React.createElement("div", {
309
+ className: styles.detailSection
252
310
  }, /*#__PURE__*/ React.createElement("div", {
253
- className: styles.diffPaneHeader
254
- }, "Current"), /*#__PURE__*/ React.createElement("div", {
255
- className: styles.diffPaneHeader
256
- }, "Proposed")), /*#__PURE__*/ React.createElement("div", {
257
- className: styles.diffRows
258
- }, displayRows.map((displayRow)=>{
259
- if (displayRow.type === "collapsed") {
260
- return /*#__PURE__*/ React.createElement("button", {
261
- className: styles.diffCollapsedRow,
262
- key: `collapsed-${displayRow.id}`,
263
- onClick: ()=>{
264
- setExpandedGroups((current)=>{
265
- const next = new Set(current);
266
- if (displayRow.expanded) {
267
- next.delete(displayRow.id);
268
- } else {
269
- next.add(displayRow.id);
270
- }
271
- return next;
272
- });
273
- },
274
- type: "button"
275
- }, displayRow.expanded ? "Hide" : "Show", " ", displayRow.count, " unchanged lines", displayRow.path ? /*#__PURE__*/ React.createElement("span", {
276
- className: styles.diffCollapsedPath
277
- }, displayRow.path) : null);
278
- }
279
- const row = displayRow.row;
311
+ className: styles.detailGrid
312
+ }, /*#__PURE__*/ React.createElement("span", {
313
+ className: styles.detailLabel
314
+ }, "Tokens"), /*#__PURE__*/ React.createElement("span", {
315
+ className: styles.detailValue
316
+ }, totalTokens, inputTokens && outputTokens ? ` (${inputTokens} in / ${outputTokens} out)` : ""))), diffSections.map((section)=>{
317
+ const diffRows = getDiffRows(section.beforeValue, section.afterValue);
318
+ const displayRows = buildDisplayRows(diffRows, expandedGroups, section.id);
319
+ const longestLineLength = Math.max(...section.beforeValue.split("\n").map((line)=>line.length), ...section.afterValue.split("\n").map((line)=>line.length), 80);
320
+ const diffShellStyle = {
321
+ "--diff-line-offset": `-${scrollLeft}px`,
322
+ "--diff-line-width": `${longestLineLength + 8}ch`
323
+ };
280
324
  return /*#__PURE__*/ React.createElement("div", {
281
- className: styles.diffRow,
282
- key: `row-${displayRow.index}`
283
- }, /*#__PURE__*/ React.createElement("span", {
284
- className: [
285
- styles.diffLine,
286
- row.before.changed ? styles.diffLineRemoved : "",
287
- row.before.placeholder ? styles.diffLinePlaceholder : ""
288
- ].filter(Boolean).join(" ")
289
- }, row.before.changed && row.before.path ? /*#__PURE__*/ React.createElement("span", {
290
- className: styles.diffPathBadge
291
- }, row.before.path) : null, /*#__PURE__*/ React.createElement("span", {
292
- className: styles.diffLineContent
293
- }, row.before.text || " ")), /*#__PURE__*/ React.createElement("span", {
294
- className: [
295
- styles.diffLine,
296
- row.after.changed ? styles.diffLineAdded : "",
297
- row.after.placeholder ? styles.diffLinePlaceholder : ""
298
- ].filter(Boolean).join(" ")
299
- }, row.after.changed && row.after.path ? /*#__PURE__*/ React.createElement("span", {
300
- className: styles.diffPathBadge
301
- }, row.after.path) : null, /*#__PURE__*/ React.createElement("span", {
302
- className: styles.diffLineContent
303
- }, row.after.text || " ")));
304
- }))), /*#__PURE__*/ React.createElement("div", {
305
- className: styles.horizontalScroll,
306
- onScroll: (event)=>setScrollLeft(event.currentTarget.scrollLeft)
307
- }, /*#__PURE__*/ React.createElement("div", {
308
- className: styles.horizontalScrollSpacer
309
- })))));
325
+ className: styles.diffSection,
326
+ key: section.id
327
+ }, section.label ? /*#__PURE__*/ React.createElement("div", {
328
+ className: styles.diffSectionLabel
329
+ }, section.label) : null, /*#__PURE__*/ React.createElement("div", {
330
+ className: styles.diffShell,
331
+ style: diffShellStyle
332
+ }, /*#__PURE__*/ React.createElement("div", {
333
+ className: styles.diffScroll
334
+ }, /*#__PURE__*/ React.createElement("div", {
335
+ className: styles.diffHeaderGrid
336
+ }, /*#__PURE__*/ React.createElement("div", {
337
+ className: styles.diffPaneHeader
338
+ }, "Current"), /*#__PURE__*/ React.createElement("div", {
339
+ className: styles.diffPaneHeader
340
+ }, "Proposed")), /*#__PURE__*/ React.createElement("div", {
341
+ className: styles.diffRows
342
+ }, displayRows.map((displayRow)=>{
343
+ if (displayRow.type === "collapsed") {
344
+ return /*#__PURE__*/ React.createElement("button", {
345
+ className: styles.diffCollapsedRow,
346
+ key: `${section.id}-collapsed-${displayRow.id}`,
347
+ onClick: ()=>{
348
+ setExpandedGroups((current)=>{
349
+ const next = new Set(current);
350
+ const groupID = `${section.id}:${displayRow.id}`;
351
+ if (displayRow.expanded) {
352
+ next.delete(groupID);
353
+ } else {
354
+ next.add(groupID);
355
+ }
356
+ return next;
357
+ });
358
+ },
359
+ type: "button"
360
+ }, displayRow.expanded ? "Hide" : "Show", " ", displayRow.count, " unchanged lines", displayRow.path && /*#__PURE__*/ React.createElement("span", {
361
+ className: styles.diffCollapsedPath
362
+ }, displayRow.path));
363
+ }
364
+ const row = displayRow.row;
365
+ return /*#__PURE__*/ React.createElement("div", {
366
+ className: styles.diffRow,
367
+ key: `${section.id}-row-${displayRow.index}`
368
+ }, /*#__PURE__*/ React.createElement("span", {
369
+ className: [
370
+ styles.diffLine,
371
+ row.before.changed && styles.diffLineRemoved,
372
+ row.before.placeholder && styles.diffLinePlaceholder
373
+ ].filter(Boolean).join(" ")
374
+ }, row.before.changed && row.before.path && /*#__PURE__*/ React.createElement("span", {
375
+ className: styles.diffPathBadge
376
+ }, row.before.path), /*#__PURE__*/ React.createElement("span", {
377
+ className: styles.diffLineContent
378
+ }, row.before.text || " ")), /*#__PURE__*/ React.createElement("span", {
379
+ className: [
380
+ styles.diffLine,
381
+ row.after.changed && styles.diffLineAdded,
382
+ row.after.placeholder && styles.diffLinePlaceholder
383
+ ].filter(Boolean).join(" ")
384
+ }, row.after.changed && row.after.path && /*#__PURE__*/ React.createElement("span", {
385
+ className: styles.diffPathBadge
386
+ }, row.after.path), /*#__PURE__*/ React.createElement("span", {
387
+ className: styles.diffLineContent
388
+ }, row.after.text || " ")));
389
+ }))), /*#__PURE__*/ React.createElement("div", {
390
+ className: styles.horizontalScroll,
391
+ onScroll: (event)=>setScrollLeft(event.currentTarget.scrollLeft)
392
+ }, /*#__PURE__*/ React.createElement("div", {
393
+ className: styles.horizontalScrollSpacer
394
+ }))));
395
+ }))));
310
396
  };
@@ -4,6 +4,7 @@
4
4
  display: flex;
5
5
  inset: 0;
6
6
  justify-content: center;
7
+ overflow: auto;
7
8
  padding: 24px;
8
9
  position: fixed;
9
10
  z-index: 1100;
@@ -19,10 +20,21 @@
19
20
  gap: 16px;
20
21
  max-height: min(760px, calc(100vh - 48px));
21
22
  max-width: min(1120px, calc(100vw - 48px));
23
+ min-height: 0;
24
+ overflow: hidden;
22
25
  padding: 16px;
23
26
  width: 100%;
24
27
  }
25
28
 
29
+ .dialogContent {
30
+ display: flex;
31
+ flex: 1 1 auto;
32
+ flex-direction: column;
33
+ gap: 16px;
34
+ min-height: 0;
35
+ overflow: auto;
36
+ }
37
+
26
38
  .dialogHeader {
27
39
  align-items: flex-start;
28
40
  display: flex;
@@ -44,6 +56,58 @@
44
56
  margin-top: 2px;
45
57
  }
46
58
 
59
+ .detailSection {
60
+ display: flex;
61
+ flex: 0 0 auto;
62
+ flex-direction: column;
63
+ gap: 10px;
64
+ }
65
+
66
+ .detailGrid {
67
+ column-gap: 12px;
68
+ display: grid;
69
+ grid-template-columns: max-content minmax(0, 1fr);
70
+ row-gap: 4px;
71
+ }
72
+
73
+ .detailLabel {
74
+ color: var(--theme-elevation-600);
75
+ font-size: 11px;
76
+ line-height: 1.2;
77
+ }
78
+
79
+ .detailValue {
80
+ color: var(--theme-text);
81
+ font-size: 12px;
82
+ line-height: 1.4;
83
+ min-width: 0;
84
+ overflow: hidden;
85
+ text-overflow: ellipsis;
86
+ white-space: nowrap;
87
+ }
88
+
89
+ .detailTextBlock {
90
+ display: flex;
91
+ flex-direction: column;
92
+ gap: 4px;
93
+ }
94
+
95
+ .detailText {
96
+ background: var(--theme-elevation-50);
97
+ border: 1px solid var(--theme-elevation-100);
98
+ border-radius: 4px;
99
+ color: var(--theme-text);
100
+ font-family: inherit;
101
+ font-size: 12px;
102
+ line-height: 1.5;
103
+ margin: 0;
104
+ max-height: 140px;
105
+ overflow: auto;
106
+ padding: 8px 10px;
107
+ white-space: pre-wrap;
108
+ word-break: break-word;
109
+ }
110
+
47
111
  .closeButton {
48
112
  align-items: center;
49
113
  background: transparent;
@@ -72,12 +136,28 @@
72
136
  border: 1px solid var(--theme-elevation-150);
73
137
  border-radius: 0;
74
138
  display: flex;
139
+ flex: 1 1 auto;
75
140
  flex-direction: column;
76
141
  min-height: 0;
77
142
  min-width: 0;
78
143
  overflow: hidden;
79
144
  }
80
145
 
146
+ .diffSection {
147
+ display: flex;
148
+ flex: 0 0 calc(100% - 1px);
149
+ flex-direction: column;
150
+ gap: 6px;
151
+ min-height: calc(100% - 1px);
152
+ }
153
+
154
+ .diffSectionLabel {
155
+ color: var(--theme-elevation-700);
156
+ font-size: 12px;
157
+ font-weight: 600;
158
+ line-height: 1.3;
159
+ }
160
+
81
161
  .diffHeaderGrid {
82
162
  display: grid;
83
163
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
@@ -109,7 +189,7 @@
109
189
  flex: 1 1 auto;
110
190
  font-size: 12px;
111
191
  line-height: 1.5;
112
- min-height: 260px;
192
+ min-height: 0;
113
193
  overflow-x: hidden;
114
194
  overflow-y: auto;
115
195
  }
@@ -238,12 +318,16 @@
238
318
  flex-direction: column;
239
319
  }
240
320
 
321
+ .detailGrid {
322
+ grid-template-columns: minmax(0, 1fr);
323
+ }
324
+
241
325
  .closeButton {
242
326
  align-self: flex-end;
243
327
  }
244
328
 
245
329
  .diffScroll {
246
- min-height: 180px;
330
+ min-height: 0;
247
331
  }
248
332
 
249
333
  }
@@ -3,7 +3,12 @@ export declare function MistralAiIcon(props: SVGProps<SVGSVGElement>): import("r
3
3
  export declare function OpenaiIcon(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
4
4
  export declare function ClaudeIcon(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
5
5
  export declare function GoogleGeminiIcon(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
6
+ export declare function OpenrouterIcon(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
6
7
  export declare function FileDiff(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
7
8
  export declare function Send(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
8
9
  export declare function Apply(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
9
10
  export declare function Reject(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
11
+ export declare function Collection(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
12
+ export declare function Document(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
13
+ export declare function Global(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
14
+ export declare function Block(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;