@pstdio/ui 0.22.0 → 0.24.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 (74) hide show
  1. package/dist/{MermaidComponent-D92GMhht.js → MermaidComponent-BTgLnpLA.js} +2 -2
  2. package/dist/{MermaidComponent-D92GMhht.js.map → MermaidComponent-BTgLnpLA.js.map} +1 -1
  3. package/dist/chat-ui.js +840 -834
  4. package/dist/chat-ui.js.map +1 -1
  5. package/dist/components/chat-ui/components/chat-input-actions.d.ts +2 -0
  6. package/dist/components/chat-ui/components/chat-input-question-prompt.d.ts +3 -0
  7. package/dist/components/chat-ui/components/chat-input.d.ts +2 -0
  8. package/dist/components/chat-ui/components/chat-panel.d.ts +2 -0
  9. package/dist/components/chat-ui/components/timeline-title.d.ts +6 -0
  10. package/dist/components/layout/index.d.ts +1 -0
  11. package/dist/components/layout/resizable-split-layout.d.ts +4 -3
  12. package/dist/components/layout/resizable-split-layout.handle.d.ts +6 -2
  13. package/dist/components/layout/resizable-split-layout.panels.d.ts +6 -2
  14. package/dist/components/layout/resizable-split-layout.root-size.d.ts +3 -0
  15. package/dist/components/list-row/list-row-root-props.d.ts +34 -0
  16. package/dist/components/primitives/index.d.ts +2 -0
  17. package/dist/components/tab-strip/window-tabs.d.ts +14 -0
  18. package/dist/components/tab-strip/window-title-bar.d.ts +6 -0
  19. package/dist/data-table.js +5 -5
  20. package/dist/{diff-editor-BnfV8cYB.js → diff-bubble-DvUPRnfB.js} +49 -48
  21. package/dist/diff-bubble-DvUPRnfB.js.map +1 -0
  22. package/dist/diff.js +549 -545
  23. package/dist/diff.js.map +1 -1
  24. package/dist/{edit-mode-data-table-DGgRuSW3.js → edit-mode-data-table-BrydKuMM.js} +4 -4
  25. package/dist/{edit-mode-data-table-DGgRuSW3.js.map → edit-mode-data-table-BrydKuMM.js.map} +1 -1
  26. package/dist/index.d.ts +2 -0
  27. package/dist/index.js +1112 -1041
  28. package/dist/index.js.map +1 -1
  29. package/dist/{kanban-renderer-toolbar-Bl8xXdwU.js → kanban-renderer-toolbar-ebqlG13w.js} +3 -3
  30. package/dist/{kanban-renderer-toolbar-Bl8xXdwU.js.map → kanban-renderer-toolbar-ebqlG13w.js.map} +1 -1
  31. package/dist/kanban-renderer.js +8 -8
  32. package/dist/kanban-renderer.js.map +1 -1
  33. package/dist/{lazy-markdown-editor-CCOchoJX.js → lazy-markdown-editor-Obb0M8xc.js} +2 -2
  34. package/dist/{lazy-markdown-editor-CCOchoJX.js.map → lazy-markdown-editor-Obb0M8xc.js.map} +1 -1
  35. package/dist/{list-row-DCgdza1i.js → list-row-CRi3Luog.js} +33 -30
  36. package/dist/list-row-CRi3Luog.js.map +1 -0
  37. package/dist/{markdown-editor-C4GCyebp.js → markdown-editor-Bj_QX4oN.js} +2 -2
  38. package/dist/{markdown-editor-C4GCyebp.js.map → markdown-editor-Bj_QX4oN.js.map} +1 -1
  39. package/dist/{markdown-CASvn1Z2.js → markdown-kuU19Oh3.js} +4 -4
  40. package/dist/{markdown-CASvn1Z2.js.map → markdown-kuU19Oh3.js.map} +1 -1
  41. package/dist/monaco-browser-l82HnffN.js +22 -0
  42. package/dist/monaco-browser-l82HnffN.js.map +1 -0
  43. package/dist/{param-editor-CkDq623X.js → param-editor-DhoxgwGd.js} +2 -2
  44. package/dist/{param-editor-CkDq623X.js.map → param-editor-DhoxgwGd.js.map} +1 -1
  45. package/dist/{param-editor-field-DRgbnL7-.js → param-editor-field-DurcyLuw.js} +45 -44
  46. package/dist/param-editor-field-DurcyLuw.js.map +1 -0
  47. package/dist/{rich-message-DARuDVOX.js → rich-message-dNYvLDd4.js} +2 -2
  48. package/dist/{rich-message-DARuDVOX.js.map → rich-message-dNYvLDd4.js.map} +1 -1
  49. package/dist/rich-text.js +5 -5
  50. package/dist/theme/primitives/colors.d.ts +34 -0
  51. package/dist/theme/primitives/sizes.d.ts +27 -0
  52. package/dist/theme/recipes/button.d.ts +5 -3
  53. package/dist/theme/recipes/landing-story.d.ts +10 -0
  54. package/dist/theme/recipes/landing-tool-demo.d.ts +1 -0
  55. package/dist/theme/recipes/landing.d.ts +23 -0
  56. package/dist/theme/recipes/resizable-split-layout.d.ts +106 -0
  57. package/dist/theme/recipes/window-title-bar.d.ts +16 -0
  58. package/dist/theme/tokens/colors-background.d.ts +260 -0
  59. package/dist/theme/tokens/colors-visualization.d.ts +162 -0
  60. package/dist/theme/tokens/colors.d.ts +2 -422
  61. package/dist/{theme-B-l5_a6F.js → theme-Ca-KyNoi.js} +1474 -476
  62. package/dist/theme-Ca-KyNoi.js.map +1 -0
  63. package/dist/theme.js +1 -1
  64. package/dist/tree-list-DXwHWodb.js +1348 -0
  65. package/dist/tree-list-DXwHWodb.js.map +1 -0
  66. package/package.json +2 -2
  67. package/dist/diff-editor-BnfV8cYB.js.map +0 -1
  68. package/dist/list-row-DCgdza1i.js.map +0 -1
  69. package/dist/monaco-browser-CgvlArN7.js +0 -21
  70. package/dist/monaco-browser-CgvlArN7.js.map +0 -1
  71. package/dist/param-editor-field-DRgbnL7-.js.map +0 -1
  72. package/dist/theme-B-l5_a6F.js.map +0 -1
  73. package/dist/tree-list-AlO5ZmxQ.js +0 -1262
  74. package/dist/tree-list-AlO5ZmxQ.js.map +0 -1
@@ -1,5 +1,7 @@
1
1
  interface ChatInputActionState {
2
2
  canInterrupt: boolean;
3
+ /** False while the runtime cannot accept a message, for example without a model. */
4
+ canSubmit: boolean;
3
5
  hasQuestionPrompt: boolean;
4
6
  isDisabled: boolean;
5
7
  streaming: boolean;
@@ -25,6 +25,9 @@ interface QuestionPromptControlsProps {
25
25
  onCustomAnswerChange: (question: ChatInputQuestion, questionIndex: number, answer: string) => void;
26
26
  }
27
27
  export declare const getQuestionSelectionKey: (question: ChatInputQuestion, index: number) => string;
28
+ export declare const toggleQuestionOptionSelection: (selectedOptionsByQuestion: Record<string, string[]>, question: ChatInputQuestion, questionIndex: number, optionLabel: string) => {
29
+ [x: string]: string[];
30
+ };
28
31
  export declare const getQuestionPromptSignature: (questionPrompt: ChatInputQuestionPrompt | undefined) => string;
29
32
  export declare const buildQuestionResponse: (questionPrompt: ChatInputQuestionPrompt | undefined, selectedOptionsByQuestion: Record<string, string[]>, answerInput: ChatInputQuestionCustomAnswers | string) => string;
30
33
  export declare const buildQuestionAnswerValues: (questionPrompt: ChatInputQuestionPrompt, selectedOptionsByQuestion: Record<string, string[]>, answerInput: ChatInputQuestionCustomAnswers | string) => string[][];
@@ -13,6 +13,8 @@ export interface ChatInputProps {
13
13
  attachedResources?: string[];
14
14
  onClearAttachments?: () => void;
15
15
  isDisabled?: boolean;
16
+ /** Keeps the editor usable but blocks sending, for example while no model is selected. */
17
+ submitDisabled?: boolean;
16
18
  onChange?: (text: string) => void;
17
19
  attachmentList?: ReactNode;
18
20
  actions?: ReactNode;
@@ -31,6 +31,8 @@ export interface ChatPanelProps {
31
31
  workspaceHub?: ReactNode;
32
32
  workspaceInitializing?: boolean;
33
33
  inputDisabled?: boolean;
34
+ /** Blocks sending while the editor stays usable, for example while no model is selected. */
35
+ submitDisabled?: boolean;
34
36
  chatInputQuestionPrompt?: ChatInputQuestionPrompt;
35
37
  chatInputAutoFocus?: boolean;
36
38
  queuedFollowUps?: QueuedFollowUp[];
@@ -0,0 +1,6 @@
1
+ import { TitleSegment } from './timeline';
2
+ export declare function TitleInline({ seg, isClickable, onOpenFile, }: {
3
+ seg: TitleSegment;
4
+ isClickable?: boolean;
5
+ onOpenFile?: (filePath: string) => void;
6
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -5,3 +5,4 @@ export type { ItemSectionProps } from './item-section';
5
5
  export { ItemSection } from './item-section';
6
6
  export { PANEL_HEADER_CONTROL_SIZE, PANEL_HEADER_HEIGHT, PANEL_HEADER_TAB_SIZE, } from './panel-header.constants';
7
7
  export { ResizableSplitLayout } from './resizable-split-layout';
8
+ export type { ResizableSplitSeparator } from './resizable-split-layout.handle';
@@ -1,6 +1,7 @@
1
- import { FlexProps } from '@chakra-ui/react';
1
+ import { ConditionalValue, FlexProps } from '@chakra-ui/react';
2
2
  import { ReactNode } from 'react';
3
3
  import { ResizableSplitSide } from './resizable-split-layout.geometry';
4
+ import { ResizableSplitSeparator } from './resizable-split-layout.handle';
4
5
  interface ResizableSplitLayoutProps extends Omit<FlexProps, "children" | "onResize"> {
5
6
  resizablePanel: ReactNode;
6
7
  contentPanel: ReactNode;
@@ -12,8 +13,8 @@ interface ResizableSplitLayoutProps extends Omit<FlexProps, "children" | "onResi
12
13
  collapsed?: boolean;
13
14
  collapsible?: boolean;
14
15
  resizeLabel?: string;
15
- resizeHandleSizePx?: number;
16
- showResizeSeparator?: boolean;
16
+ separator?: ResizableSplitSeparator;
17
+ layout?: ConditionalValue<"split" | "stacked" | "stacked-reverse" | "content">;
17
18
  onSizeChange?: (size: number) => void;
18
19
  onCollapsedChange?: (collapsed: boolean) => void;
19
20
  }
@@ -1,6 +1,9 @@
1
+ import { SystemStyleObject } from '@chakra-ui/react';
1
2
  import { KeyboardEvent as ReactKeyboardEvent, PointerEvent as ReactPointerEvent } from 'react';
2
3
  import { getResizableSplitAxis } from './resizable-split-layout.geometry';
4
+ export type ResizableSplitSeparator = "gap" | "line";
3
5
  interface ResizeHandleProps {
6
+ css: SystemStyleObject;
4
7
  axis: ReturnType<typeof getResizableSplitAxis>;
5
8
  bounds: {
6
9
  minSize: number;
@@ -9,11 +12,12 @@ interface ResizeHandleProps {
9
12
  collapsed: boolean;
10
13
  collapsible: boolean;
11
14
  contentPanelId: string;
15
+ dragging: boolean;
12
16
  resizablePanelId: string;
13
- resizeHandleSizePx: number;
14
17
  resizeLabel: string;
15
18
  resolvedPanelSize: number;
16
- showResizeSeparator: boolean;
19
+ separator: ResizableSplitSeparator;
20
+ onCollapse: () => void;
17
21
  onResizeKeyDown: (event: ReactKeyboardEvent<HTMLDivElement>) => void;
18
22
  onResizeStart: (event: ReactPointerEvent<HTMLDivElement>) => void;
19
23
  }
@@ -1,6 +1,9 @@
1
+ import { SystemStyleObject } from '@chakra-ui/react';
1
2
  import { KeyboardEvent as ReactKeyboardEvent, ReactNode, PointerEvent as ReactPointerEvent, RefObject } from 'react';
2
3
  import { getResizableSplitAxis } from './resizable-split-layout.geometry';
4
+ import { ResizableSplitSeparator } from './resizable-split-layout.handle';
3
5
  interface ResizableSplitPanelsProps {
6
+ styles: Record<"resizablePanel" | "contentPanel" | "separator", SystemStyleObject>;
4
7
  axis: ReturnType<typeof getResizableSplitAxis>;
5
8
  bounds: {
6
9
  minSize: number;
@@ -14,10 +17,11 @@ interface ResizableSplitPanelsProps {
14
17
  resizablePanel: ReactNode;
15
18
  resizablePanelId: string;
16
19
  resizablePanelRef: RefObject<HTMLDivElement | null>;
17
- resizeHandleSizePx: number;
20
+ dragging: boolean;
18
21
  resizeLabel: string;
19
22
  resolvedPanelSize: number;
20
- showResizeSeparator: boolean;
23
+ separator: ResizableSplitSeparator;
24
+ onCollapse: () => void;
21
25
  onResizeKeyDown: (event: ReactKeyboardEvent<HTMLDivElement>) => void;
22
26
  onResizeStart: (event: ReactPointerEvent<HTMLDivElement>) => void;
23
27
  }
@@ -0,0 +1,3 @@
1
+ import { RefObject } from 'react';
2
+ export type PanelDimension = "width" | "height";
3
+ export declare const useResizableSplitRootSize: (rootRef: RefObject<HTMLDivElement | null>, dimension: PanelDimension) => number;
@@ -0,0 +1,34 @@
1
+ import { chakra } from '@chakra-ui/react';
2
+ import { ComponentPropsWithoutRef } from 'react';
3
+ import { ListRowProps } from './list-row.types';
4
+ type ListRowRootProps = ComponentPropsWithoutRef<typeof chakra.div>;
5
+ export declare const computePaddingLeft: (depth: number) => string | undefined;
6
+ export declare const resolveListRowSizing: (variant: ListRowProps["variant"], hasDescription: boolean) => {
7
+ rowHeight: string;
8
+ minHeight: undefined;
9
+ } | {
10
+ rowHeight: string;
11
+ minHeight: string;
12
+ };
13
+ export declare const createListRowRootProps: (input: {
14
+ rootProps: ListRowRootProps;
15
+ labelId: string;
16
+ hasEndContent: boolean;
17
+ rowRole: ListRowRootProps["role"];
18
+ className?: string;
19
+ isSelected: boolean;
20
+ isExpanded: boolean;
21
+ showChevron: boolean;
22
+ rowHeight: ListRowRootProps["height"];
23
+ minHeight: ListRowRootProps["minHeight"];
24
+ verticalPadding: ListRowRootProps["py"];
25
+ paddingLeft: ListRowRootProps["pl"];
26
+ selectedBg: ListRowProps["selectedBg"];
27
+ hoverBg: ListRowProps["hoverBg"];
28
+ tone: NonNullable<ListRowProps["tone"]>;
29
+ isDisabled: boolean;
30
+ variant: ListRowProps["variant"];
31
+ }) => Omit<Omit<import('@chakra-ui/react').PatchHtmlProps<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">>, "color" | "background" | "translate" | "transition" | "width" | "height" | "content" | "_hover" | "_active" | "_focus" | "_focusWithin" | "_focusVisible" | "_disabled" | "_visited" | "_target" | "_readOnly" | "_readWrite" | "_empty" | "_checked" | "_enabled" | "_expanded" | "_highlighted" | "_complete" | "_incomplete" | "_dragging" | "_before" | "_after" | "_firstLetter" | "_firstLine" | "_marker" | "_selection" | "_file" | "_backdrop" | "_first" | "_last" | "_notFirst" | "_notLast" | "_only" | "_even" | "_odd" | "_peerFocus" | "_peerHover" | "_peerActive" | "_peerFocusWithin" | "_peerFocusVisible" | "_peerDisabled" | "_peerChecked" | "_peerInvalid" | "_peerExpanded" | "_peerPlaceholderShown" | "_groupFocus" | "_groupHover" | "_groupActive" | "_groupFocusWithin" | "_groupFocusVisible" | "_groupDisabled" | "_groupChecked" | "_groupExpanded" | "_groupInvalid" | "_indeterminate" | "_required" | "_valid" | "_invalid" | "_autofill" | "_inRange" | "_outOfRange" | "_placeholder" | "_placeholderShown" | "_pressed" | "_selected" | "_grabbed" | "_underValue" | "_overValue" | "_atValue" | "_default" | "_optional" | "_open" | "_closed" | "_fullscreen" | "_loading" | "_hidden" | "_current" | "_currentPage" | "_currentStep" | "_today" | "_unavailable" | "_rangeStart" | "_rangeEnd" | "_now" | "_topmost" | "_motionReduce" | "_motionSafe" | "_print" | "_landscape" | "_portrait" | "_dark" | "_light" | "_osDark" | "_osLight" | "_highContrast" | "_lessContrast" | "_moreContrast" | "_ltr" | "_rtl" | "_scrollbar" | "_scrollbarThumb" | "_scrollbarTrack" | "_horizontal" | "_vertical" | "_icon" | "_starting" | "sm" | "smOnly" | "smDown" | "md" | "mdOnly" | "mdDown" | "lg" | "lgOnly" | "lgDown" | "xl" | "xlOnly" | "xlDown" | "2xl" | "2xlOnly" | "2xlDown" | "3xl" | "3xlOnly" | "3xlDown" | "4xl" | "4xlOnly" | "4xlDown" | "smToMd" | "smToLg" | "smToXl" | "smTo2xl" | "smTo3xl" | "smTo4xl" | "mdToLg" | "mdToXl" | "mdTo2xl" | "mdTo3xl" | "mdTo4xl" | "lgToXl" | "lgTo2xl" | "lgTo3xl" | "lgTo4xl" | "xlTo2xl" | "xlTo3xl" | "xlTo4xl" | "2xlTo3xl" | "2xlTo4xl" | "3xlTo4xl" | "base" | "page" | "container" | "css" | "WebkitAppearance" | "WebkitBorderBefore" | "WebkitBorderBeforeColor" | "WebkitBorderBeforeStyle" | "WebkitBorderBeforeWidth" | "WebkitBoxReflect" | "WebkitLineClamp" | "WebkitMask" | "WebkitMaskAttachment" | "WebkitMaskClip" | "WebkitMaskComposite" | "WebkitMaskImage" | "WebkitMaskOrigin" | "WebkitMaskPosition" | "WebkitMaskPositionX" | "WebkitMaskPositionY" | "WebkitMaskRepeat" | "WebkitMaskRepeatX" | "WebkitMaskRepeatY" | "WebkitMaskSize" | "WebkitOverflowScrolling" | "WebkitTapHighlightColor" | "WebkitTextFillColor" | "WebkitTextStroke" | "WebkitTextStrokeColor" | "WebkitTextStrokeWidth" | "WebkitTouchCallout" | "WebkitUserModify" | "WebkitUserSelect" | "accentColor" | "alignContent" | "alignItems" | "alignSelf" | "alignTracks" | "all" | "anchorName" | "anchorScope" | "animation" | "animationComposition" | "animationDelay" | "animationDirection" | "animationDuration" | "animationFillMode" | "animationIterationCount" | "animationName" | "animationPlayState" | "animationRange" | "animationRangeEnd" | "animationRangeStart" | "animationTimeline" | "animationTimingFunction" | "appearance" | "aspectRatio" | "backdropFilter" | "backfaceVisibility" | "backgroundAttachment" | "backgroundBlendMode" | "backgroundClip" | "backgroundColor" | "backgroundImage" | "backgroundOrigin" | "backgroundPosition" | "backgroundPositionX" | "backgroundPositionY" | "backgroundRepeat" | "backgroundSize" | "blockSize" | "border" | "borderBlock" | "borderBlockColor" | "borderBlockEnd" | "borderBlockEndColor" | "borderBlockEndStyle" | "borderBlockEndWidth" | "borderBlockStart" | "borderBlockStartColor" | "borderBlockStartStyle" | "borderBlockStartWidth" | "borderBlockStyle" | "borderBlockWidth" | "borderBottom" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderColor" | "borderEndEndRadius" | "borderEndStartRadius" | "borderImage" | "borderImageOutset" | "borderImageRepeat" | "borderImageSlice" | "borderImageSource" | "borderImageWidth" | "borderInline" | "borderInlineColor" | "borderInlineEnd" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStart" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderInlineStyle" | "borderInlineWidth" | "borderLeft" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRadius" | "borderRight" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderStartEndRadius" | "borderStartStartRadius" | "borderStyle" | "borderTop" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "borderWidth" | "bottom" | "boxAlign" | "boxDecorationBreak" | "boxDirection" | "boxFlex" | "boxFlexGroup" | "boxLines" | "boxOrdinalGroup" | "boxOrient" | "boxPack" | "boxShadow" | "boxSizing" | "breakAfter" | "breakBefore" | "breakInside" | "captionSide" | "caret" | "caretColor" | "caretShape" | "clear" | "clip" | "clipPath" | "clipRule" | "colorInterpolationFilters" | "colorScheme" | "columnCount" | "columnFill" | "columnGap" | "columnRule" | "columnRuleColor" | "columnRuleStyle" | "columnRuleWidth" | "columnSpan" | "columnWidth" | "columns" | "contain" | "containIntrinsicBlockSize" | "containIntrinsicHeight" | "containIntrinsicInlineSize" | "containIntrinsicSize" | "containIntrinsicWidth" | "containerName" | "containerType" | "contentVisibility" | "counterIncrement" | "counterReset" | "counterSet" | "cursor" | "cx" | "cy" | "d" | "direction" | "display" | "dominantBaseline" | "emptyCells" | "fieldSizing" | "fill" | "fillOpacity" | "fillRule" | "filter" | "flex" | "flexBasis" | "flexDirection" | "flexFlow" | "flexGrow" | "flexShrink" | "flexWrap" | "float" | "floodColor" | "floodOpacity" | "font" | "fontFamily" | "fontFeatureSettings" | "fontKerning" | "fontLanguageOverride" | "fontOpticalSizing" | "fontPalette" | "fontSize" | "fontSizeAdjust" | "fontSmooth" | "fontStretch" | "fontStyle" | "fontSynthesis" | "fontSynthesisPosition" | "fontSynthesisSmallCaps" | "fontSynthesisStyle" | "fontSynthesisWeight" | "fontVariant" | "fontVariantAlternates" | "fontVariantCaps" | "fontVariantEastAsian" | "fontVariantEmoji" | "fontVariantLigatures" | "fontVariantNumeric" | "fontVariantPosition" | "fontVariationSettings" | "fontWeight" | "forcedColorAdjust" | "gap" | "grid" | "gridArea" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridColumn" | "gridColumnEnd" | "gridColumnGap" | "gridColumnStart" | "gridGap" | "gridRow" | "gridRowEnd" | "gridRowGap" | "gridRowStart" | "gridTemplate" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "hangingPunctuation" | "hyphenateCharacter" | "hyphenateLimitChars" | "hyphens" | "imageOrientation" | "imageRendering" | "imageResolution" | "imeMode" | "initialLetter" | "initialLetterAlign" | "inlineSize" | "inset" | "insetBlock" | "insetBlockEnd" | "insetBlockStart" | "insetInline" | "insetInlineEnd" | "insetInlineStart" | "interpolateSize" | "isolation" | "justifyContent" | "justifyItems" | "justifySelf" | "justifyTracks" | "left" | "letterSpacing" | "lightingColor" | "lineBreak" | "lineClamp" | "lineHeight" | "lineHeightStep" | "listStyle" | "listStyleImage" | "listStylePosition" | "listStyleType" | "margin" | "marginBlock" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInline" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "marginTrim" | "marker" | "markerEnd" | "markerMid" | "markerStart" | "mask" | "maskBorder" | "maskBorderMode" | "maskBorderOutset" | "maskBorderRepeat" | "maskBorderSlice" | "maskBorderSource" | "maskBorderWidth" | "maskClip" | "maskComposite" | "maskImage" | "maskMode" | "maskOrigin" | "maskPosition" | "maskRepeat" | "maskSize" | "maskType" | "masonryAutoFlow" | "mathDepth" | "mathShift" | "mathStyle" | "maxBlockSize" | "maxHeight" | "maxInlineSize" | "maxLines" | "maxWidth" | "minBlockSize" | "minHeight" | "minInlineSize" | "minWidth" | "mixBlendMode" | "objectFit" | "objectPosition" | "offset" | "offsetAnchor" | "offsetDistance" | "offsetPath" | "offsetPosition" | "offsetRotate" | "opacity" | "order" | "orphans" | "outline" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "overflow" | "overflowAnchor" | "overflowBlock" | "overflowClipBox" | "overflowClipMargin" | "overflowInline" | "overflowWrap" | "overflowX" | "overflowY" | "overlay" | "overscrollBehavior" | "overscrollBehaviorBlock" | "overscrollBehaviorInline" | "overscrollBehaviorX" | "overscrollBehaviorY" | "padding" | "paddingBlock" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInline" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "pageBreakAfter" | "pageBreakBefore" | "pageBreakInside" | "paintOrder" | "perspective" | "perspectiveOrigin" | "placeContent" | "placeItems" | "placeSelf" | "pointerEvents" | "position" | "positionAnchor" | "positionArea" | "positionTry" | "positionTryFallbacks" | "positionTryOrder" | "positionVisibility" | "printColorAdjust" | "quotes" | "r" | "resize" | "right" | "rotate" | "rowGap" | "rubyAlign" | "rubyMerge" | "rubyPosition" | "rx" | "ry" | "scale" | "scrollBehavior" | "scrollMargin" | "scrollMarginBlock" | "scrollMarginBlockEnd" | "scrollMarginBlockStart" | "scrollMarginBottom" | "scrollMarginInline" | "scrollMarginInlineEnd" | "scrollMarginInlineStart" | "scrollMarginLeft" | "scrollMarginRight" | "scrollMarginTop" | "scrollPadding" | "scrollPaddingBlock" | "scrollPaddingBlockEnd" | "scrollPaddingBlockStart" | "scrollPaddingBottom" | "scrollPaddingInline" | "scrollPaddingInlineEnd" | "scrollPaddingInlineStart" | "scrollPaddingLeft" | "scrollPaddingRight" | "scrollPaddingTop" | "scrollSnapAlign" | "scrollSnapCoordinate" | "scrollSnapDestination" | "scrollSnapPointsX" | "scrollSnapPointsY" | "scrollSnapStop" | "scrollSnapType" | "scrollSnapTypeX" | "scrollSnapTypeY" | "scrollTimeline" | "scrollTimelineAxis" | "scrollTimelineName" | "scrollbarColor" | "scrollbarGutter" | "scrollbarWidth" | "shapeImageThreshold" | "shapeMargin" | "shapeOutside" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "tabSize" | "tableLayout" | "textAlign" | "textAlignLast" | "textAnchor" | "textBox" | "textBoxEdge" | "textBoxTrim" | "textCombineUpright" | "textDecoration" | "textDecorationColor" | "textDecorationLine" | "textDecorationSkip" | "textDecorationSkipInk" | "textDecorationStyle" | "textDecorationThickness" | "textEmphasis" | "textEmphasisColor" | "textEmphasisPosition" | "textEmphasisStyle" | "textIndent" | "textJustify" | "textOrientation" | "textOverflow" | "textRendering" | "textShadow" | "textSizeAdjust" | "textSpacingTrim" | "textTransform" | "textUnderlineOffset" | "textUnderlinePosition" | "textWrap" | "textWrapMode" | "textWrapStyle" | "timelineScope" | "top" | "touchAction" | "transform" | "transformBox" | "transformOrigin" | "transformStyle" | "transitionBehavior" | "transitionDelay" | "transitionDuration" | "transitionProperty" | "transitionTimingFunction" | "unicodeBidi" | "userSelect" | "vectorEffect" | "verticalAlign" | "viewTimeline" | "viewTimelineAxis" | "viewTimelineInset" | "viewTimelineName" | "viewTransitionName" | "visibility" | "whiteSpace" | "whiteSpaceCollapse" | "widows" | "willChange" | "wordBreak" | "wordSpacing" | "wordWrap" | "writingMode" | "x" | "y" | "zIndex" | "zoom" | "alignmentBaseline" | "baselineShift" | "colorInterpolation" | "colorRendering" | "glyphOrientationVertical" | "bg" | "bgColor" | "bgSize" | "bgPos" | "bgRepeat" | "bgAttachment" | "bgClip" | "bgGradient" | "bgImg" | "bgImage" | "borderStart" | "borderEnd" | "borderX" | "borderY" | "borderStartColor" | "borderEndColor" | "borderStartStyle" | "borderEndStyle" | "rounded" | "roundedTopLeft" | "roundedStartStart" | "borderTopStartRadius" | "roundedEndStart" | "borderBottomStartRadius" | "roundedTopRight" | "roundedStartEnd" | "borderTopEndRadius" | "roundedEndEnd" | "borderBottomEndRadius" | "roundedBottomLeft" | "roundedBottomRight" | "roundedStart" | "borderStartRadius" | "roundedEnd" | "borderEndRadius" | "roundedTop" | "roundedBottom" | "roundedLeft" | "roundedRight" | "borderXWidth" | "borderStartWidth" | "borderEndWidth" | "borderYWidth" | "shadow" | "shadowColor" | "blendMode" | "bgBlendMode" | "gapY" | "gapX" | "flexDir" | "w" | "h" | "minW" | "minH" | "maxW" | "maxH" | "overscroll" | "overscrollX" | "overscrollY" | "scrollPaddingX" | "scrollPaddingY" | "listStylePos" | "listStyleImg" | "pos" | "insetX" | "insetY" | "insetStart" | "insetEnd" | "m" | "mt" | "mr" | "mb" | "ml" | "ms" | "marginStart" | "me" | "marginEnd" | "mx" | "marginX" | "my" | "marginY" | "p" | "pt" | "pr" | "pb" | "pl" | "ps" | "paddingStart" | "pe" | "paddingEnd" | "px" | "paddingX" | "py" | "paddingY" | "textDecor" | "backgroundGradient" | "gradientFrom" | "gradientTo" | "gradientVia" | "borderInlineStartRadius" | "borderInlineEndRadius" | "borderTopRadius" | "borderBottomRadius" | "borderLeftRadius" | "borderRightRadius" | "divideX" | "divideY" | "divideColor" | "divideStyle" | "boxShadowColor" | "blur" | "brightness" | "contrast" | "grayscale" | "hueRotate" | "invert" | "saturate" | "sepia" | "dropShadow" | "backdropBlur" | "backdropBrightness" | "backdropContrast" | "backdropGrayscale" | "backdropHueRotate" | "backdropInvert" | "backdropOpacity" | "backdropSaturate" | "backdropSepia" | "focusRing" | "focusVisibleRing" | "focusRingColor" | "focusRingOffset" | "focusRingWidth" | "focusRingStyle" | "boxSize" | "hideFrom" | "hideBelow" | "scrollbar" | "scrollMarginX" | "scrollMarginY" | "scrollSnapStrictness" | "scrollSnapMargin" | "scrollSnapMarginTop" | "scrollSnapMarginBottom" | "scrollSnapMarginLeft" | "scrollSnapMarginRight" | "ring" | "ringColor" | "ringOffset" | "ringOffsetColor" | "ringInset" | "skewX" | "skewY" | "scaleX" | "scaleY" | "spaceXReverse" | "spaceX" | "spaceYReverse" | "spaceY" | "rotateX" | "rotateY" | "translateX" | "translateY" | "truncate" | "borderSpacingX" | "borderSpacingY" | "srOnly" | "debug" | "WebkitAppRegion" | "colorPalette" | "textStyle" | "layerStyle" | "animationStyle" | keyof import('@chakra-ui/react').PolymorphicProps> & Omit<import('@chakra-ui/react').JsxStyleProps, never> & import('@chakra-ui/react').PolymorphicProps & {
32
+ ref?: any | undefined;
33
+ }, "ref">;
34
+ export {};
@@ -27,6 +27,8 @@ export type { SessionCompletionStatus } from './session-indicator';
27
27
  export { resolveSessionIndicatorColor, resolveSessionIndicatorIcon, SessionIndicator, sessionCompletionStatuses, } from './session-indicator';
28
28
  export type { SimpleCardBodyProps, SimpleCardProps } from './simple-card';
29
29
  export { SimpleCard, SimpleCardBody } from './simple-card';
30
+ export type { SliderProps } from './slider';
31
+ export { Slider } from './slider';
30
32
  export type { SwitchProps } from './switch';
31
33
  export { Switch } from './switch';
32
34
  export type { TagSwatchProps } from './tag-swatch';
@@ -0,0 +1,14 @@
1
+ import { ReactNode } from 'react';
2
+ export interface WindowTab {
3
+ id: string;
4
+ label: string;
5
+ icon?: ReactNode;
6
+ }
7
+ export interface WindowTabsProps {
8
+ tabs: WindowTab[];
9
+ selectedId?: string;
10
+ onSelect: (id: string) => void;
11
+ onClose: (id: string) => void;
12
+ "aria-label": string;
13
+ }
14
+ export declare const WindowTabs: (props: WindowTabsProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ export interface WindowTitleBarProps {
3
+ platform: string;
4
+ children?: ReactNode;
5
+ }
6
+ export declare const WindowTitleBar: (props: WindowTitleBarProps) => import("react/jsx-runtime").JSX.Element;
@@ -4,12 +4,12 @@ import { Text as O, Popover as te, HStack as Ee, Portal as ue, Image as dt, Butt
4
4
  import { flexRender as be, useReactTable as mt, getPaginationRowModel as ft, getCoreRowModel as ht, getSortedRowModel as gt } from "@tanstack/react-table";
5
5
  import { isValidElement as Fe, cloneElement as bt, useRef as Te, useState as Q, useEffect as Ke, Fragment as pt } from "react";
6
6
  import { S as xe, T as Je } from "./browser-storage-DPtOQJx0.js";
7
- import { u as St } from "./kanban-renderer-toolbar-Bl8xXdwU.js";
7
+ import { u as St } from "./kanban-renderer-toolbar-ebqlG13w.js";
8
8
  import { Braces as wt, ChevronRight as xt, CircleHelp as yt, Minus as Ct, Check as ye, ChevronDown as vt, Settings2 as Rt, GripVertical as It, ArrowUpAZ as Xe, ArrowDownAZ as qe, MoreVertical as At } from "lucide-react";
9
- import { C as Ce, S as $t } from "./lazy-markdown-editor-CCOchoJX.js";
10
- import { L as ce, S as _t, R as kt } from "./list-row-DCgdza1i.js";
11
- import { c as ie, g as zt, i as Ge, f as Tt, D as Dt, E as Vt, r as Mt, a as De, s as Pt, b as Ht, d as Lt, e as Ot, h as Wt, j as Nt, k as jt, l as Et, m as Bt, n as Ft, o as Kt, S as Jt, P as Xt } from "./edit-mode-data-table-DGgRuSW3.js";
12
- import { P as qt } from "./param-editor-CkDq623X.js";
9
+ import { C as Ce, S as $t } from "./lazy-markdown-editor-Obb0M8xc.js";
10
+ import { L as ce, S as _t, R as kt } from "./list-row-CRi3Luog.js";
11
+ import { c as ie, g as zt, i as Ge, f as Tt, D as Dt, E as Vt, r as Mt, a as De, s as Pt, b as Ht, d as Lt, e as Ot, h as Wt, j as Nt, k as jt, l as Et, m as Bt, n as Ft, o as Kt, S as Jt, P as Xt } from "./edit-mode-data-table-BrydKuMM.js";
12
+ import { P as qt } from "./param-editor-DhoxgwGd.js";
13
13
  import { useSensors as Gt, useSensor as Ut, PointerSensor as Yt, DndContext as Zt, closestCenter as Qt } from "@dnd-kit/core";
14
14
  import { SortableContext as eo, verticalListSortingStrategy as to, useSortable as oo } from "@dnd-kit/sortable";
15
15
  import { CSS as lo } from "@dnd-kit/utilities";
@@ -1,46 +1,11 @@
1
1
  import { jsx as m, jsxs as R } from "react/jsx-runtime";
2
- import { c as _ } from "react/compiler-runtime";
3
- import { Span as b, Box as A } from "@chakra-ui/react";
4
- import { DiffModeEnum as E, DiffView as N } from "@git-diff-view/react";
2
+ import { DiffModeEnum as E, DiffView as _ } from "@git-diff-view/react";
5
3
  import "@git-diff-view/react/styles/diff-view.css";
6
- import { useRef as V } from "react";
7
- import { generateDiffFile as z } from "@git-diff-view/file";
8
- const te = (t) => {
9
- const e = _(20), {
10
- fileName: o,
11
- additions: i,
12
- deletions: n,
13
- label: a,
14
- variant: f,
15
- size: l,
16
- onClick: r,
17
- onClickFileLink: s
18
- } = t, h = f === void 0 ? "outline" : f, j = (l === void 0 ? "default" : l) === "small", v = h === "outline" ? "1px solid" : "none", w = h === "outline" ? j ? "3xs" : "2xs" : "2px", k = j ? "label/S/regular" : void 0, D = r ? "pointer" : "default", y = r ? "bg.muted" : "none";
19
- let d;
20
- e[0] !== y ? (d = {
21
- background: y
22
- }, e[0] = y, e[1] = d) : d = e[1];
23
- let c;
24
- e[2] !== o || e[3] !== s ? (c = o && /* @__PURE__ */ m(b, { display: "inline-block", maxW: "24ch", truncate: !0, mr: "xs", title: o, onClick: (F) => {
25
- F.stopPropagation(), s?.();
26
- }, cursor: s ? "pointer" : "default", _hover: {
27
- textDecoration: s ? "underline" : "none",
28
- color: s ? "fg.blue-dark" : "fg.muted"
29
- }, children: o }), e[2] = o, e[3] = s, e[4] = c) : c = e[4];
30
- const L = `+${i}`;
31
- let u;
32
- e[5] !== L ? (u = /* @__PURE__ */ m(b, { color: "fg.success", children: L }), e[5] = L, e[6] = u) : u = e[6];
33
- const C = `-${n}`;
34
- let g;
35
- e[7] !== C ? (g = /* @__PURE__ */ m(b, { color: "fg.error", children: C }), e[7] = C, e[8] = g) : g = e[8];
36
- let x;
37
- return e[9] !== a || e[10] !== r || e[11] !== u || e[12] !== g || e[13] !== v || e[14] !== w || e[15] !== k || e[16] !== D || e[17] !== d || e[18] !== c ? (x = /* @__PURE__ */ R(b, { display: "inline-flex", alignItems: "center", gap: "2xs", border: v, borderColor: "border.subtle", color: "fg.muted", paddingX: w, paddingY: "1px", borderRadius: "xs", textStyle: k, cursor: D, onClick: r, _hover: d, children: [
38
- a,
39
- c,
40
- u,
41
- g
42
- ] }), e[9] = a, e[10] = r, e[11] = u, e[12] = g, e[13] = v, e[14] = w, e[15] = k, e[16] = D, e[17] = d, e[18] = c, e[19] = x) : x = e[19], x;
43
- }, W = "before.txt", B = "after.txt", H = 100, M = {
4
+ import { Box as A, Span as b } from "@chakra-ui/react";
5
+ import { useRef as N } from "react";
6
+ import { generateDiffFile as V } from "@git-diff-view/file";
7
+ import { c as z } from "react/compiler-runtime";
8
+ const W = "before.txt", B = "after.txt", H = 100, M = {
44
9
  ts: "typescript",
45
10
  tsx: "typescript",
46
11
  js: "javascript",
@@ -96,7 +61,7 @@ const te = (t) => {
96
61
  language: o,
97
62
  oldPath: i,
98
63
  newPath: n
99
- }), r = z(a, t, f, e, l, l, {
64
+ }), r = V(a, t, f, e, l, l, {
100
65
  context: 3
101
66
  });
102
67
  return {
@@ -126,7 +91,7 @@ const te = (t) => {
126
91
  input: e,
127
92
  data: o()
128
93
  };
129
- function oe(t) {
94
+ function te(t) {
130
95
  const {
131
96
  original: e,
132
97
  modified: o,
@@ -136,7 +101,7 @@ function oe(t) {
136
101
  sideBySide: f = !1,
137
102
  disableScroll: l = !0,
138
103
  data: r
139
- } = t, s = V(null), h = {
104
+ } = t, s = N(null), h = {
140
105
  original: e,
141
106
  modified: o,
142
107
  language: i,
@@ -163,7 +128,7 @@ function oe(t) {
163
128
  fontSize: "11px"
164
129
  }
165
130
  }, children: /* @__PURE__ */ m(
166
- N,
131
+ _,
167
132
  {
168
133
  data: s.current.data,
169
134
  diffViewMode: S,
@@ -174,9 +139,45 @@ function oe(t) {
174
139
  }
175
140
  ) });
176
141
  }
142
+ const oe = (t) => {
143
+ const e = z(20), {
144
+ fileName: o,
145
+ additions: i,
146
+ deletions: n,
147
+ label: a,
148
+ variant: f,
149
+ size: l,
150
+ onClick: r,
151
+ onClickFileLink: s
152
+ } = t, h = f === void 0 ? "outline" : f, j = (l === void 0 ? "default" : l) === "small", v = h === "outline" ? "1px solid" : "none", w = h === "outline" ? j ? "3xs" : "2xs" : "2px", k = j ? "label/S/regular" : void 0, D = r ? "pointer" : "default", y = r ? "bg.muted" : "none";
153
+ let d;
154
+ e[0] !== y ? (d = {
155
+ background: y
156
+ }, e[0] = y, e[1] = d) : d = e[1];
157
+ let c;
158
+ e[2] !== o || e[3] !== s ? (c = o && /* @__PURE__ */ m(b, { display: "inline-block", maxW: "24ch", truncate: !0, mr: "xs", title: o, onClick: (F) => {
159
+ F.stopPropagation(), s?.();
160
+ }, cursor: s ? "pointer" : "default", _hover: {
161
+ textDecoration: s ? "underline" : "none",
162
+ color: s ? "fg.blue-dark" : "fg.muted"
163
+ }, children: o }), e[2] = o, e[3] = s, e[4] = c) : c = e[4];
164
+ const L = `+${i}`;
165
+ let u;
166
+ e[5] !== L ? (u = /* @__PURE__ */ m(b, { color: "fg.success", children: L }), e[5] = L, e[6] = u) : u = e[6];
167
+ const C = `-${n}`;
168
+ let g;
169
+ e[7] !== C ? (g = /* @__PURE__ */ m(b, { color: "fg.error", children: C }), e[7] = C, e[8] = g) : g = e[8];
170
+ let x;
171
+ return e[9] !== a || e[10] !== r || e[11] !== u || e[12] !== g || e[13] !== v || e[14] !== w || e[15] !== k || e[16] !== D || e[17] !== d || e[18] !== c ? (x = /* @__PURE__ */ R(b, { display: "inline-flex", alignItems: "center", gap: "2xs", border: v, borderColor: "border.subtle", color: "fg.muted", paddingX: w, paddingY: "1px", borderRadius: "xs", textStyle: k, cursor: D, onClick: r, _hover: d, children: [
172
+ a,
173
+ c,
174
+ u,
175
+ g
176
+ ] }), e[9] = a, e[10] = r, e[11] = u, e[12] = g, e[13] = v, e[14] = w, e[15] = k, e[16] = D, e[17] = d, e[18] = c, e[19] = x) : x = e[19], x;
177
+ };
177
178
  export {
178
- oe as D,
179
- te as a,
179
+ te as D,
180
+ oe as a,
180
181
  X as b
181
182
  };
182
- //# sourceMappingURL=diff-editor-BnfV8cYB.js.map
183
+ //# sourceMappingURL=diff-bubble-DvUPRnfB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff-bubble-DvUPRnfB.js","sources":["../src/components/diff-viewer/diff-view-adapter.ts","../src/components/diff-viewer/diff-editor.tsx","../src/components/diff-viewer/diff-bubble.tsx"],"sourcesContent":["import { generateDiffFile } from \"@git-diff-view/file\";\nimport type { DiffViewProps } from \"@git-diff-view/react\";\n\nconst FALLBACK_OLD_PATH = \"before.txt\";\nconst FALLBACK_NEW_PATH = \"after.txt\";\nconst MAX_CACHE_ENTRIES = 100;\n\ninterface ResolveDiffLanguageInput {\n language?: string;\n oldPath?: string;\n newPath?: string;\n}\n\ninterface BuildDiffViewDataInput extends ResolveDiffLanguageInput {\n original: string;\n modified: string;\n}\n\nexport type DiffViewData = NonNullable<DiffViewProps<unknown>[\"data\"]>;\n\n/**\n * Diff view data enriched with the row counts the renderer will actually paint. The renderer\n * collapses unchanged context, so only lines inside the hunks are rendered — these counts come\n * from the hunk patch, not the full file length.\n */\nexport interface BuiltDiffViewData extends DiffViewData {\n /** Content rows painted in unified layout (one per added/removed/context line). */\n unifiedContentRows: number;\n /** Content rows painted in split layout (paired add/remove lines share a row). */\n splitContentRows: number;\n /** Hunk header rows — one per `@@` section, taller than content rows. */\n hunkRows: number;\n}\n\nconst extToLanguage: Record<string, string> = {\n ts: \"typescript\",\n tsx: \"typescript\",\n js: \"javascript\",\n jsx: \"javascript\",\n json: \"json\",\n md: \"markdown\",\n py: \"python\",\n go: \"go\",\n rs: \"rust\",\n css: \"css\",\n html: \"html\",\n sh: \"shell\",\n yml: \"yaml\",\n yaml: \"yaml\",\n};\n\nconst getExtension = (path: string) => {\n const fileName = path.split(/[\\\\/]/).pop() ?? path;\n const ext = fileName.split(\".\").pop();\n\n return ext?.toLowerCase();\n};\n\nexport const resolveDiffLanguage = ({ language, oldPath, newPath }: ResolveDiffLanguageInput) => {\n if (language) {\n return language;\n }\n\n const extension = getExtension(newPath ?? oldPath ?? \"\");\n\n if (!extension) {\n return \"plaintext\";\n }\n\n return extToLanguage[extension] ?? \"plaintext\";\n};\n\n// Building a diff file parses both file contents and walks every rendered line. The drawer's\n// virtualizer asks for heights far more often than the diff content changes, so memoize by\n// content signature and share one instance with the rendered editor.\nconst cache = new Map<string, BuiltDiffViewData>();\n\nconst getCacheKey = ({ original, modified, language, oldPath, newPath }: BuildDiffViewDataInput) =>\n [original, modified, language ?? \"\", oldPath ?? \"\", newPath ?? \"\"].join(\"\\0\");\n\n// The hunk patch lists exactly the rows the renderer paints (it collapses everything else).\n// Walk it once: `@@` starts a hunk header row, ` ` is a context row, and a run of `-`/`+`\n// is one change block — unified stacks every line, split pairs them so the block is as tall\n// as its longer side.\nconst countRenderedRows = (hunks: string[]) => {\n const lines = hunks.join(\"\\n\").split(\"\\n\");\n let unifiedContentRows = 0;\n let splitContentRows = 0;\n let hunkRows = 0;\n let inHunk = false;\n let blockAdditions = 0;\n let blockDeletions = 0;\n\n const flushBlock = () => {\n unifiedContentRows += blockAdditions + blockDeletions;\n splitContentRows += Math.max(blockAdditions, blockDeletions);\n blockAdditions = 0;\n blockDeletions = 0;\n };\n\n for (const line of lines) {\n if (line.startsWith(\"@@\")) {\n flushBlock();\n hunkRows += 1;\n inHunk = true;\n } else if (!inHunk) {\n // Patch header (Index:, ===, ---, +++) before the first hunk — not rendered.\n } else if (line.startsWith(\"+\")) {\n blockAdditions += 1;\n } else if (line.startsWith(\"-\")) {\n blockDeletions += 1;\n } else if (line.startsWith(\" \")) {\n flushBlock();\n unifiedContentRows += 1;\n splitContentRows += 1;\n }\n }\n flushBlock();\n\n return { unifiedContentRows, splitContentRows, hunkRows };\n};\n\nconst computeDiffViewData = ({ original, modified, language, oldPath, newPath }: BuildDiffViewDataInput) => {\n const oldFileName = oldPath ?? newPath ?? FALLBACK_OLD_PATH;\n const newFileName = newPath ?? oldPath ?? FALLBACK_NEW_PATH;\n const fileLanguage = resolveDiffLanguage({ language, oldPath, newPath });\n\n // No uuid: @git-diff-view keys its internal File cache by uuid when one is given, so a\n // shared constant would make every diff reuse the first file's content. Omitting it keys\n // the cache by raw content, which is correct.\n const diffFile = generateDiffFile(oldFileName, original, newFileName, modified, fileLanguage, fileLanguage, {\n context: 3,\n });\n\n return {\n oldFile: {\n fileName: oldFileName,\n fileLang: fileLanguage,\n content: original,\n },\n newFile: {\n fileName: newFileName,\n fileLang: fileLanguage,\n content: modified,\n },\n hunks: diffFile._diffList,\n ...countRenderedRows(diffFile._diffList),\n } satisfies BuiltDiffViewData;\n};\n\nexport const buildDiffViewData = (input: BuildDiffViewDataInput): BuiltDiffViewData => {\n const key = getCacheKey(input);\n const cached = cache.get(key);\n if (cached) return cached;\n\n const data = computeDiffViewData(input);\n\n if (cache.size >= MAX_CACHE_ENTRIES) {\n const oldest = cache.keys().next().value;\n if (oldest !== undefined) cache.delete(oldest);\n }\n cache.set(key, data);\n\n return data;\n};\n","import { DiffModeEnum, DiffView } from \"@git-diff-view/react\";\nimport \"@git-diff-view/react/styles/diff-view.css\";\nimport { Box } from \"@chakra-ui/react\";\nimport { useRef } from \"react\";\nimport { buildDiffViewData, type DiffViewData } from \"./diff-view-adapter\";\n\nexport interface DiffEditorInput {\n original: string;\n modified: string;\n language?: string;\n oldPath?: string;\n newPath?: string;\n}\n\ninterface DiffEditorProps extends DiffEditorInput {\n sideBySide?: boolean;\n disableScroll?: boolean;\n data?: DiffViewData;\n}\n\nexport interface DiffEditorDataState {\n input: DiffEditorInput;\n data: DiffViewData;\n}\n\nconst areDiffEditorInputsEqual = (current: DiffEditorInput, next: DiffEditorInput) =>\n current.original === next.original &&\n current.modified === next.modified &&\n current.language === next.language &&\n current.oldPath === next.oldPath &&\n current.newPath === next.newPath;\n\nexport const resolveDiffEditorDataState = (\n current: DiffEditorDataState | null,\n input: DiffEditorInput,\n createData: () => DiffViewData,\n) => {\n if (current && areDiffEditorInputsEqual(current.input, input)) {\n return current;\n }\n\n return {\n input,\n data: createData(),\n };\n};\n\nexport function DiffEditor(props: DiffEditorProps) {\n const { original, modified, language, oldPath, newPath, sideBySide = false, disableScroll = true, data } = props;\n const dataStateRef = useRef<DiffEditorDataState | null>(null);\n const input = { original, modified, language, oldPath, newPath };\n\n dataStateRef.current = resolveDiffEditorDataState(\n dataStateRef.current,\n input,\n () =>\n data ??\n buildDiffViewData({\n original,\n modified,\n language,\n oldPath,\n newPath,\n }),\n );\n\n const mode = sideBySide ? DiffModeEnum.Split : DiffModeEnum.Unified;\n\n return (\n <Box\n height=\"100%\"\n width=\"100%\"\n position=\"relative\"\n zIndex=\"0\"\n overflow={disableScroll ? \"hidden\" : \"auto\"}\n bg=\"bg\"\n css={{\n \"& .gdv-root, & .gdv-view, & .gdv-file, & .gdv-content, & .gdv-hunk, & .gdv-line\": {\n background: \"var(--chakra-colors-bg)\",\n },\n \"& .gdv-root\": {\n border: \"none\",\n borderRadius: \"0\",\n },\n \"& .gdv-line-number\": {\n fontSize: \"11px\",\n },\n }}\n >\n <DiffView\n data={dataStateRef.current.data}\n diffViewMode={mode}\n diffViewTheme=\"dark\"\n diffViewHighlight={true}\n // No wrap: keeps every line one fixed-height row so the virtualizer's height estimate\n // stays exact, and avoids wrapped lines being misread. Long lines scroll horizontally\n // inside DiffView's own overflow-x container.\n diffViewWrap={false}\n diffViewFontSize={11}\n />\n </Box>\n );\n}\n","import { Span } from \"@chakra-ui/react\";\nimport type React from \"react\";\nimport type { ComponentProps, MouseEvent } from \"react\";\n\ninterface DiffBubbleProps extends Omit<ComponentProps<typeof Span>, \"onClick\"> {\n fileName?: string;\n additions: number;\n deletions: number;\n label?: React.ReactNode;\n variant?: \"outline\" | \"ghost\";\n size?: \"default\" | \"small\";\n onClick?: (event: MouseEvent<HTMLSpanElement>) => void;\n onClickFileLink?: () => void;\n}\n\nexport const DiffBubble = (props: DiffBubbleProps) => {\n const {\n fileName,\n additions,\n deletions,\n label,\n variant = \"outline\",\n size = \"default\",\n onClick,\n onClickFileLink,\n } = props;\n\n const isSmall = size === \"small\";\n\n return (\n <Span\n display=\"inline-flex\"\n alignItems=\"center\"\n gap={\"2xs\"}\n border={variant === \"outline\" ? \"1px solid\" : \"none\"}\n borderColor=\"border.subtle\"\n color=\"fg.muted\"\n paddingX={variant === \"outline\" ? (isSmall ? \"3xs\" : \"2xs\") : \"2px\"}\n paddingY=\"1px\"\n borderRadius=\"xs\"\n textStyle={isSmall ? \"label/S/regular\" : undefined}\n cursor={onClick ? \"pointer\" : \"default\"}\n onClick={onClick}\n _hover={{\n background: onClick ? \"bg.muted\" : \"none\",\n }}\n >\n {label}\n {fileName && (\n <Span\n display=\"inline-block\"\n maxW=\"24ch\"\n truncate\n mr=\"xs\"\n title={fileName}\n onClick={(e) => {\n e.stopPropagation();\n onClickFileLink?.();\n }}\n cursor={onClickFileLink ? \"pointer\" : \"default\"}\n _hover={{\n textDecoration: onClickFileLink ? \"underline\" : \"none\",\n color: onClickFileLink ? \"fg.blue-dark\" : \"fg.muted\",\n }}\n >\n {fileName}\n </Span>\n )}\n <Span color=\"fg.success\">{`+${additions}`}</Span>\n <Span color=\"fg.error\">{`-${deletions}`}</Span>\n </Span>\n );\n};\n"],"names":["FALLBACK_OLD_PATH","FALLBACK_NEW_PATH","MAX_CACHE_ENTRIES","extToLanguage","ts","tsx","js","jsx","json","md","py","go","rs","css","html","sh","yml","yaml","getExtension","path","split","pop","toLowerCase","resolveDiffLanguage","language","oldPath","newPath","extension","cache","Map","getCacheKey","original","modified","join","countRenderedRows","hunks","lines","unifiedContentRows","splitContentRows","hunkRows","inHunk","blockAdditions","blockDeletions","flushBlock","Math","max","line","startsWith","computeDiffViewData","oldFileName","newFileName","fileLanguage","diffFile","generateDiffFile","context","oldFile","fileName","fileLang","content","newFile","_diffList","buildDiffViewData","input","key","cached","get","data","size","oldest","keys","next","value","undefined","delete","set","areDiffEditorInputsEqual","current","resolveDiffEditorDataState","createData","DiffEditor","props","sideBySide","disableScroll","dataStateRef","useRef","mode","DiffModeEnum","Split","Unified","Box","background","border","borderRadius","fontSize","DiffView","DiffBubble","$","_c","additions","deletions","label","variant","t0","t1","onClick","onClickFileLink","isSmall","t2","t3","t4","t5","t6","t7","t8","Span","e","stopPropagation","textDecoration","color","t9","t10","t11","t12","t13"],"mappings":";;;;;;;AAGA,MAAMA,IAAoB,cACpBC,IAAoB,aACpBC,IAAoB,KA6BpBC,IAAwC;AAAA,EAC5CC,IAAI;AAAA,EACJC,KAAK;AAAA,EACLC,IAAI;AAAA,EACJC,KAAK;AAAA,EACLC,MAAM;AAAA,EACNC,IAAI;AAAA,EACJC,IAAI;AAAA,EACJC,IAAI;AAAA,EACJC,IAAI;AAAA,EACJC,KAAK;AAAA,EACLC,MAAM;AAAA,EACNC,IAAI;AAAA,EACJC,KAAK;AAAA,EACLC,MAAM;AACR,GAEMC,IAAeA,CAACC,OACHA,EAAKC,MAAM,O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