@mvriu5/payload-ai 0.5.9 → 1.1.1

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 (73) 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 +363 -135
  11. package/dist/components/AIInput.module.css +15 -1
  12. package/dist/components/APIKeyField.d.ts +3 -0
  13. package/dist/components/APIKeyField.js +63 -0
  14. package/dist/components/ActionToast.d.ts +30 -0
  15. package/dist/components/ActionToast.js +263 -0
  16. package/dist/components/AuditLogList.d.ts +32 -0
  17. package/dist/components/AuditLogList.js +104 -0
  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 +284 -97
  21. package/dist/components/DiffDialog.module.css +86 -2
  22. package/dist/components/Icons.d.ts +5 -0
  23. package/dist/components/Icons.js +436 -214
  24. package/dist/components/MentionPopover.d.ts +19 -0
  25. package/dist/components/MentionPopover.js +95 -0
  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 +721 -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 +52 -20
  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 +45 -9
  54. package/dist/components/AIActionProposalList.d.ts +0 -26
  55. package/dist/components/AIActionProposalList.js +0 -162
  56. package/dist/components/AIApiKeyField.d.ts +0 -2
  57. package/dist/components/AIApiKeyField.js +0 -47
  58. package/dist/components/CollectionMentionPopover.d.ts +0 -16
  59. package/dist/components/CollectionMentionPopover.js +0 -77
  60. package/dist/components/RecentChangesList.d.ts +0 -18
  61. package/dist/components/RecentChangesList.js +0 -66
  62. package/dist/components/hooks/utils.d.ts +0 -1
  63. package/dist/components/hooks/utils.js +0 -3
  64. package/dist/endpoints/aiApplyActionEndpointHandler.d.ts +0 -8
  65. package/dist/endpoints/aiApplyActionEndpointHandler.js +0 -365
  66. package/dist/endpoints/aiChatEndpointHandler.d.ts +0 -35
  67. package/dist/endpoints/aiChatEndpointHandler.js +0 -382
  68. package/dist/endpoints/aiMentionSuggestionsEndpointHandler.d.ts +0 -7
  69. package/dist/endpoints/aiMentionSuggestionsEndpointHandler.js +0 -63
  70. package/dist/endpoints/aiProposalDiffEndpointHandler.d.ts +0 -7
  71. package/dist/endpoints/aiProposalDiffEndpointHandler.js +0 -138
  72. package/dist/endpoints/aiRecentChangesEndpointHandler.d.ts +0 -6
  73. /package/dist/components/{AIActionProposalList.module.css → ActionToast.module.css} +0 -0
@@ -1,19 +1,26 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
2
  import { XIcon } from "@payloadcms/ui/icons/X";
2
- import { useState } from "react";
3
+ import { useEffect, useState } from "react";
4
+ import { getJSONLineKey } from "../payload/shared.js";
3
5
  import styles from "./DiffDialog.module.css";
4
6
  const formatDiffValue = (value)=>{
5
7
  return JSON.stringify(value, null, 2);
6
8
  };
9
+ const formatDateTime = (value)=>{
10
+ if (!value) return null;
11
+ const date = new Date(value);
12
+ if (Number.isNaN(date.getTime())) return value;
13
+ return new Intl.DateTimeFormat(undefined, {
14
+ dateStyle: "medium",
15
+ timeStyle: "short"
16
+ }).format(date);
17
+ };
7
18
  const createLine = ({ changed, path, placeholder = false, text = "" })=>({
8
19
  changed,
9
20
  path,
10
21
  placeholder,
11
22
  text
12
23
  });
13
- const getJSONLineKey = (line)=>{
14
- const match = /^(\s*)"([^"]+)":/.exec(line);
15
- return match ? `${match[1]}${match[2]}` : null;
16
- };
17
24
  const shouldPairChangedLines = (beforeLine, afterLine)=>{
18
25
  const beforeKey = getJSONLineKey(beforeLine);
19
26
  const afterKey = getJSONLineKey(afterLine);
@@ -39,7 +46,7 @@ const getRowPath = (row)=>{
39
46
  const isChangedRow = (row)=>{
40
47
  return row.before.changed || row.after.changed;
41
48
  };
42
- const buildDisplayRows = (rows, expandedGroups)=>{
49
+ const buildDisplayRows = (rows, expandedGroups, groupPrefix = "")=>{
43
50
  const displayRows = [];
44
51
  const contextRows = 2;
45
52
  let index = 0;
@@ -70,7 +77,8 @@ const buildDisplayRows = (rows, expandedGroups)=>{
70
77
  }
71
78
  continue;
72
79
  }
73
- const isExpanded = expandedGroups.has(groupID);
80
+ const scopedGroupID = groupPrefix ? `${groupPrefix}:${groupID}` : groupID;
81
+ const isExpanded = expandedGroups.has(scopedGroupID);
74
82
  for(let rowIndex = start; rowIndex < start + contextRows; rowIndex += 1){
75
83
  displayRows.push({
76
84
  index: rowIndex,
@@ -213,98 +221,277 @@ const getDiffRows = (before, after)=>{
213
221
  }
214
222
  return rows;
215
223
  };
216
- export const DiffDialog = ({ diff, onClose, proposal })=>{
224
+ const isLocaleDiffMap = (value)=>{
225
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
226
+ return Object.values(value).every((entry)=>entry && typeof entry === "object" && !Array.isArray(entry));
227
+ };
228
+ const getDiffSections = (diff)=>{
229
+ if (isLocaleDiffMap(diff.before) && isLocaleDiffMap(diff.after)) {
230
+ const beforeByLocale = diff.before;
231
+ const afterByLocale = diff.after;
232
+ const localeKeys = Array.from(new Set([
233
+ ...Object.keys(beforeByLocale),
234
+ ...Object.keys(afterByLocale)
235
+ ]));
236
+ return localeKeys.map((locale)=>({
237
+ afterValue: formatDiffValue(afterByLocale[locale] ?? {}),
238
+ beforeValue: formatDiffValue(beforeByLocale[locale] ?? {}),
239
+ id: locale,
240
+ label: `Locale: ${locale}`
241
+ }));
242
+ }
243
+ return [
244
+ {
245
+ afterValue: formatDiffValue(diff.after),
246
+ beforeValue: formatDiffValue(diff.before),
247
+ id: "default"
248
+ }
249
+ ];
250
+ };
251
+ const formatTokenUsage = (value)=>{
252
+ return typeof value === "number" && Number.isFinite(value) && value > 0 ? value.toLocaleString() : null;
253
+ };
254
+ export const DiffDialog = ({ change, diff, onClose, proposal, tokenUsage })=>{
217
255
  const [scrollLeft, setScrollLeft] = useState(0);
218
256
  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
- };
228
- return /*#__PURE__*/ React.createElement("div", {
257
+ const diffSections = getDiffSections(diff);
258
+ const totalTokens = formatTokenUsage(change?.totalTokens) || formatTokenUsage(tokenUsage?.totalTokens);
259
+ const inputTokens = formatTokenUsage(change?.inputTokens) || formatTokenUsage(tokenUsage?.inputTokens);
260
+ const outputTokens = formatTokenUsage(change?.outputTokens) || formatTokenUsage(tokenUsage?.outputTokens);
261
+ useEffect(()=>{
262
+ const handleKeyDown = (event)=>{
263
+ if (event.key === "Escape") {
264
+ onClose();
265
+ }
266
+ };
267
+ window.addEventListener("keydown", handleKeyDown);
268
+ return ()=>{
269
+ window.removeEventListener("keydown", handleKeyDown);
270
+ };
271
+ }, [
272
+ onClose
273
+ ]);
274
+ return /*#__PURE__*/ _jsx("div", {
229
275
  "aria-modal": "true",
230
276
  className: styles.dialogOverlay,
231
- role: "dialog"
232
- }, /*#__PURE__*/ React.createElement("div", {
233
- className: styles.dialog
234
- }, /*#__PURE__*/ React.createElement("div", {
235
- className: styles.dialogHeader
236
- }, /*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement("div", {
237
- className: styles.dialogTitle
238
- }, proposal.label), /*#__PURE__*/ React.createElement("div", {
239
- className: styles.meta
240
- }, proposal.action, " in ", proposal.collection || proposal.slug, proposal.id ? ` #${proposal.id}` : "")), /*#__PURE__*/ React.createElement("button", {
241
- "aria-label": "Close",
242
- className: styles.closeButton,
243
- onClick: onClose,
244
- type: "button"
245
- }, /*#__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
250
- }, /*#__PURE__*/ React.createElement("div", {
251
- className: styles.diffHeaderGrid
252
- }, /*#__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;
280
- 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
- })))));
277
+ role: "dialog",
278
+ children: /*#__PURE__*/ _jsxs("div", {
279
+ className: styles.dialog,
280
+ children: [
281
+ /*#__PURE__*/ _jsxs("div", {
282
+ className: styles.dialogHeader,
283
+ children: [
284
+ /*#__PURE__*/ _jsxs("div", {
285
+ children: [
286
+ /*#__PURE__*/ _jsx("div", {
287
+ className: styles.dialogTitle,
288
+ children: proposal.label
289
+ }),
290
+ /*#__PURE__*/ _jsxs("div", {
291
+ className: styles.meta,
292
+ children: [
293
+ proposal.action,
294
+ " in ",
295
+ proposal.collection || proposal.slug,
296
+ proposal.id ? ` #${proposal.id}` : ""
297
+ ]
298
+ })
299
+ ]
300
+ }),
301
+ /*#__PURE__*/ _jsx("button", {
302
+ "aria-label": "Close",
303
+ className: styles.closeButton,
304
+ onClick: onClose,
305
+ type: "button",
306
+ children: /*#__PURE__*/ _jsx(XIcon, {})
307
+ })
308
+ ]
309
+ }),
310
+ /*#__PURE__*/ _jsxs("div", {
311
+ className: styles.dialogContent,
312
+ children: [
313
+ change ? /*#__PURE__*/ _jsx("div", {
314
+ className: styles.detailSection,
315
+ children: /*#__PURE__*/ _jsxs("div", {
316
+ className: styles.detailGrid,
317
+ children: [
318
+ /*#__PURE__*/ _jsx("span", {
319
+ className: styles.detailLabel,
320
+ children: "User"
321
+ }),
322
+ /*#__PURE__*/ _jsx("span", {
323
+ className: styles.detailValue,
324
+ children: change.userLabel || change.userID || "Unknown"
325
+ }),
326
+ /*#__PURE__*/ _jsx("span", {
327
+ className: styles.detailLabel,
328
+ children: "Date"
329
+ }),
330
+ /*#__PURE__*/ _jsx("span", {
331
+ className: styles.detailValue,
332
+ children: formatDateTime(change.createdAt) || "Unknown"
333
+ }),
334
+ totalTokens && /*#__PURE__*/ _jsxs(_Fragment, {
335
+ children: [
336
+ /*#__PURE__*/ _jsx("span", {
337
+ className: styles.detailLabel,
338
+ children: "Tokens"
339
+ }),
340
+ /*#__PURE__*/ _jsxs("span", {
341
+ className: styles.detailValue,
342
+ children: [
343
+ totalTokens,
344
+ inputTokens && outputTokens ? ` (${inputTokens} in / ${outputTokens} out)` : ""
345
+ ]
346
+ })
347
+ ]
348
+ })
349
+ ]
350
+ })
351
+ }) : totalTokens && /*#__PURE__*/ _jsx("div", {
352
+ className: styles.detailSection,
353
+ children: /*#__PURE__*/ _jsxs("div", {
354
+ className: styles.detailGrid,
355
+ children: [
356
+ /*#__PURE__*/ _jsx("span", {
357
+ className: styles.detailLabel,
358
+ children: "Tokens"
359
+ }),
360
+ /*#__PURE__*/ _jsxs("span", {
361
+ className: styles.detailValue,
362
+ children: [
363
+ totalTokens,
364
+ inputTokens && outputTokens ? ` (${inputTokens} in / ${outputTokens} out)` : ""
365
+ ]
366
+ })
367
+ ]
368
+ })
369
+ }),
370
+ diffSections.map((section)=>{
371
+ const diffRows = getDiffRows(section.beforeValue, section.afterValue);
372
+ const displayRows = buildDisplayRows(diffRows, expandedGroups, section.id);
373
+ const longestLineLength = Math.max(...section.beforeValue.split("\n").map((line)=>line.length), ...section.afterValue.split("\n").map((line)=>line.length), 80);
374
+ const diffShellStyle = {
375
+ "--diff-line-offset": `-${scrollLeft}px`,
376
+ "--diff-line-width": `${longestLineLength + 8}ch`
377
+ };
378
+ return /*#__PURE__*/ _jsxs("div", {
379
+ className: styles.diffSection,
380
+ children: [
381
+ section.label ? /*#__PURE__*/ _jsx("div", {
382
+ className: styles.diffSectionLabel,
383
+ children: section.label
384
+ }) : null,
385
+ /*#__PURE__*/ _jsxs("div", {
386
+ className: styles.diffShell,
387
+ style: diffShellStyle,
388
+ children: [
389
+ /*#__PURE__*/ _jsxs("div", {
390
+ className: styles.diffScroll,
391
+ children: [
392
+ /*#__PURE__*/ _jsxs("div", {
393
+ className: styles.diffHeaderGrid,
394
+ children: [
395
+ /*#__PURE__*/ _jsx("div", {
396
+ className: styles.diffPaneHeader,
397
+ children: "Current"
398
+ }),
399
+ /*#__PURE__*/ _jsx("div", {
400
+ className: styles.diffPaneHeader,
401
+ children: "Proposed"
402
+ })
403
+ ]
404
+ }),
405
+ /*#__PURE__*/ _jsx("div", {
406
+ className: styles.diffRows,
407
+ children: displayRows.map((displayRow)=>{
408
+ if (displayRow.type === "collapsed") {
409
+ return /*#__PURE__*/ _jsxs("button", {
410
+ className: styles.diffCollapsedRow,
411
+ onClick: ()=>{
412
+ setExpandedGroups((current)=>{
413
+ const next = new Set(current);
414
+ const groupID = `${section.id}:${displayRow.id}`;
415
+ if (displayRow.expanded) {
416
+ next.delete(groupID);
417
+ } else {
418
+ next.add(groupID);
419
+ }
420
+ return next;
421
+ });
422
+ },
423
+ type: "button",
424
+ children: [
425
+ displayRow.expanded ? "Hide" : "Show",
426
+ " ",
427
+ displayRow.count,
428
+ " unchanged lines",
429
+ displayRow.path && /*#__PURE__*/ _jsx("span", {
430
+ className: styles.diffCollapsedPath,
431
+ children: displayRow.path
432
+ })
433
+ ]
434
+ }, `${section.id}-collapsed-${displayRow.id}`);
435
+ }
436
+ const row = displayRow.row;
437
+ return /*#__PURE__*/ _jsxs("div", {
438
+ className: styles.diffRow,
439
+ children: [
440
+ /*#__PURE__*/ _jsxs("span", {
441
+ className: [
442
+ styles.diffLine,
443
+ row.before.changed && styles.diffLineRemoved,
444
+ row.before.placeholder && styles.diffLinePlaceholder
445
+ ].filter(Boolean).join(" "),
446
+ children: [
447
+ row.before.changed && row.before.path && /*#__PURE__*/ _jsx("span", {
448
+ className: styles.diffPathBadge,
449
+ children: row.before.path
450
+ }),
451
+ /*#__PURE__*/ _jsx("span", {
452
+ className: styles.diffLineContent,
453
+ children: row.before.text || " "
454
+ })
455
+ ]
456
+ }),
457
+ /*#__PURE__*/ _jsxs("span", {
458
+ className: [
459
+ styles.diffLine,
460
+ row.after.changed && styles.diffLineAdded,
461
+ row.after.placeholder && styles.diffLinePlaceholder
462
+ ].filter(Boolean).join(" "),
463
+ children: [
464
+ row.after.changed && row.after.path && /*#__PURE__*/ _jsx("span", {
465
+ className: styles.diffPathBadge,
466
+ children: row.after.path
467
+ }),
468
+ /*#__PURE__*/ _jsx("span", {
469
+ className: styles.diffLineContent,
470
+ children: row.after.text || " "
471
+ })
472
+ ]
473
+ })
474
+ ]
475
+ }, `${section.id}-row-${displayRow.index}`);
476
+ })
477
+ })
478
+ ]
479
+ }),
480
+ /*#__PURE__*/ _jsx("div", {
481
+ className: styles.horizontalScroll,
482
+ onScroll: (event)=>setScrollLeft(event.currentTarget.scrollLeft),
483
+ children: /*#__PURE__*/ _jsx("div", {
484
+ className: styles.horizontalScrollSpacer
485
+ })
486
+ })
487
+ ]
488
+ })
489
+ ]
490
+ }, section.id);
491
+ })
492
+ ]
493
+ })
494
+ ]
495
+ })
496
+ });
310
497
  };
@@ -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;