@gravionlabs/helix-code 0.0.0-stage → 22.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gravionlabs-helix-code.mjs","names":["t","allLanguages","languages","lineNumbersExtension","handlersFacet","rangeLabel","field","decorate","handlersFacet","rangeLabel","field","decorate","CHOICES"],"sources":["../../../projects/code/src/lib/theme/code-theme.ts","../../../projects/code/src/lib/theme/code-highlight.ts","../../../projects/code/src/lib/language/language.ts","../../../projects/code/src/lib/editor/code-editor.ts","../../../projects/code/src/lib/editor/code-editor.html","../../../projects/code/src/lib/review/comment-extension.ts","../../../projects/code/src/lib/review/finding-extension.ts","../../../projects/code/src/lib/review/thread-extension.ts","../../../projects/code/src/lib/diff/diff-theme.ts","../../../projects/code/src/lib/diff/diff-view.ts","../../../projects/code/src/lib/diff/diff-view.html","../../../projects/code/src/lib/conflict/line-diff.ts","../../../projects/code/src/lib/conflict/conflict-parser.ts","../../../projects/code/src/lib/conflict/conflict-markers.ts","../../../projects/code/src/lib/conflict/conflict-merge.ts","../../../projects/code/src/lib/conflict/conflict-merge.html","../../../projects/code/src/public-api.ts"],"sourcesContent":["import type { Extension } from '@codemirror/state';\nimport { EditorView } from '@codemirror/view';\n\n/**\n * The editor theme of Helix: surfaces, text, cursor, selection, active line, gutters, panels and\n * tooltips, all on `var(--h-*)` values, so the editor follows the light and dark theme and a\n * primary colour that changes at runtime without a rebuild. Font family and size come from\n * `--hx-code-font-family` and `--hx-code-font-size`, with defaults.\n *\n * It needs no import from helix-ui: dark mode is the `.app-dark` class, through CSS only.\n * Pair it with `hxCodeHighlight()` for the syntax colours.\n */\nexport function hxCodeTheme(): Extension {\n return EditorView.theme({\n '&': {\n color: 'var(--h-text-color)',\n backgroundColor: 'var(--h-content-background)',\n fontSize: 'var(--hx-code-font-size, 0.875rem)',\n },\n '&.cm-focused': { outline: 'none' },\n '.cm-scroller': {\n fontFamily:\n 'var(--hx-code-font-family, ui-monospace, SFMono-Regular, Menlo, Consolas, \"Liberation Mono\", monospace)',\n },\n '.cm-content': { caretColor: 'var(--h-primary-color)' },\n '.cm-cursor, .cm-dropCursor': { borderLeftColor: 'var(--h-primary-color)' },\n '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection':\n { backgroundColor: 'var(--h-highlight-background)' },\n '.cm-activeLine': { backgroundColor: 'var(--h-content-hover-background)' },\n '.cm-selectionMatch': { backgroundColor: 'var(--h-highlight-background)' },\n '&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket': {\n backgroundColor: 'var(--h-highlight-background)',\n },\n '.cm-gutters': {\n color: 'var(--h-text-muted-color)',\n backgroundColor: 'var(--h-content-background)',\n borderRight: '1px solid var(--h-content-border-color)',\n },\n '.cm-activeLineGutter': {\n color: 'var(--h-text-color)',\n backgroundColor: 'var(--h-content-hover-background)',\n },\n '.cm-foldPlaceholder': {\n color: 'var(--h-text-muted-color)',\n backgroundColor: 'var(--h-content-hover-background)',\n border: '1px solid var(--h-content-border-color)',\n },\n '.cm-panels': {\n color: 'var(--h-text-color)',\n backgroundColor: 'var(--h-content-background)',\n },\n '.cm-panels.cm-panels-top': { borderBottom: '1px solid var(--h-content-border-color)' },\n '.cm-panels.cm-panels-bottom': { borderTop: '1px solid var(--h-content-border-color)' },\n '.cm-tooltip': {\n color: 'var(--h-overlay-popover-color, var(--h-text-color))',\n backgroundColor: 'var(--h-overlay-popover-background, var(--h-content-background))',\n border: '1px solid var(--h-overlay-popover-border-color, var(--h-content-border-color))',\n borderRadius: 'var(--h-overlay-popover-border-radius, var(--h-content-border-radius))',\n },\n '.cm-tooltip-autocomplete > ul > li[aria-selected]': {\n color: 'var(--h-highlight-color)',\n backgroundColor: 'var(--h-highlight-background)',\n },\n });\n}\n","import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';\nimport type { Extension } from '@codemirror/state';\nimport { EditorView } from '@codemirror/view';\nimport { tags as t } from '@lezer/highlight';\n\n/** The syntax roles of Helix code, each one a CSS variable `--hx-code-<role>`. */\nexport type HxCodeRole =\n | 'keyword'\n | 'string'\n | 'number'\n | 'comment'\n | 'function'\n | 'type'\n | 'property'\n | 'operator'\n | 'meta'\n | 'invalid'\n | 'link'\n | 'heading';\n\n/** The default colour of a role in the light and the dark theme. */\nexport interface HxCodeColor {\n readonly light: string;\n readonly dark: string;\n}\n\n/**\n * The defaults of `--hx-code-*`. Every colour reaches at least 4.5:1 against the editor background\n * (`--h-content-background`: `#ffffff` light, `#1b1b1f` dark); the token test checks it.\n */\nexport const HX_CODE_PALETTE: Readonly<Record<HxCodeRole, HxCodeColor>> = {\n keyword: { light: '#6d28d9', dark: '#c4b5fd' },\n string: { light: '#0f766e', dark: '#5eead4' },\n number: { light: '#b45309', dark: '#fdba74' },\n comment: { light: '#667085', dark: '#9ca3af' },\n function: { light: '#1d4ed8', dark: '#93c5fd' },\n type: { light: '#0e7490', dark: '#67e8f9' },\n property: { light: '#0369a1', dark: '#7dd3fc' },\n operator: { light: '#475569', dark: '#cbd5e1' },\n meta: { light: '#4b5563', dark: '#9ca3af' },\n invalid: { light: '#b91c1c', dark: '#fca5a5' },\n link: { light: '#1d4ed8', dark: '#93c5fd' },\n heading: { light: '#1e40af', dark: '#bfdbfe' },\n};\n\nconst ROLES = Object.keys(HX_CODE_PALETTE) as HxCodeRole[];\n\n/** `var(--hx-code-<role>)`, falling back to the built-in default of the current theme. */\nfunction roleColor(role: HxCodeRole): string {\n return `var(--hx-code-${role}, var(--hx-code-default-${role}))`;\n}\n\n/**\n * The built-in defaults live on the editor under the name `--hx-code-default-*`, light first and\n * `.app-dark` after it. The public `--hx-code-*` stay unset, so an app overrides one anywhere above\n * the editor (`:root`, a container) and the override wins in both themes.\n */\nconst defaultsTheme = EditorView.baseTheme({\n '&': Object.fromEntries(ROLES.map((r) => [`--hx-code-default-${r}`, HX_CODE_PALETTE[r].light])),\n '.app-dark &': Object.fromEntries(\n ROLES.map((r) => [`--hx-code-default-${r}`, HX_CODE_PALETTE[r].dark]),\n ),\n});\n\nconst style = HighlightStyle.define([\n {\n tag: [t.keyword, t.controlKeyword, t.moduleKeyword, t.definitionKeyword],\n color: roleColor('keyword'),\n },\n { tag: [t.string, t.special(t.string), t.regexp, t.character], color: roleColor('string') },\n { tag: [t.number, t.bool, t.null, t.atom, t.unit], color: roleColor('number') },\n {\n tag: [t.comment, t.lineComment, t.blockComment, t.docComment],\n color: roleColor('comment'),\n fontStyle: 'italic',\n },\n {\n tag: [t.function(t.variableName), t.function(t.propertyName), t.macroName, t.labelName],\n color: roleColor('function'),\n },\n { tag: [t.typeName, t.className, t.namespace, t.tagName], color: roleColor('type') },\n {\n tag: [t.propertyName, t.attributeName, t.definition(t.variableName)],\n color: roleColor('property'),\n },\n { tag: [t.operator, t.punctuation, t.separator, t.bracket], color: roleColor('operator') },\n {\n tag: [t.meta, t.processingInstruction, t.annotation, t.documentMeta],\n color: roleColor('meta'),\n },\n { tag: t.invalid, color: roleColor('invalid') },\n { tag: [t.link, t.url], color: roleColor('link'), textDecoration: 'underline' },\n { tag: t.heading, color: roleColor('heading'), fontWeight: '600' },\n { tag: t.emphasis, fontStyle: 'italic' },\n { tag: t.strong, fontWeight: '600' },\n { tag: t.strikethrough, textDecoration: 'line-through' },\n]);\n\n/**\n * The syntax highlighting of Helix code: a `HighlightStyle` on lezer tags whose colours are the CSS\n * variables `--hx-code-<role>` (see {@link HX_CODE_PALETTE}), with defaults for the light and the\n * dark (`.app-dark`) theme set inside the extension; there is no stylesheet to import.\n * A theme switch needs no rebuild of the editor.\n */\nexport function hxCodeHighlight(): Extension {\n return [defaultsTheme, syntaxHighlighting(style)];\n}\n","import { InjectionToken } from '@angular/core';\nimport { LanguageDescription, type LanguageSupport } from '@codemirror/language';\nimport { languages as allLanguages } from '@codemirror/language-data';\n\n/**\n * The languages an `hx-code-editor` knows. Defaults to `@codemirror/language-data`; provide a\n * shorter list to leave out grammars. Only the editor reads it and passes it to the functions.\n */\nexport const HX_CODE_LANGUAGES = new InjectionToken<readonly LanguageDescription[]>(\n 'HX_CODE_LANGUAGES',\n { providedIn: 'root', factory: () => allLanguages },\n);\n\n/** The `LanguageDescription` for a file name or path, or `null` when none matches. */\nexport function hxLanguageFor(\n path: string,\n languages: readonly LanguageDescription[] = allLanguages,\n): LanguageDescription | null {\n const name = path.split(/[\\\\/]/).pop() ?? path;\n if (!name) return null;\n return LanguageDescription.matchFilename(languages, name);\n}\n\n/**\n * Loads the `LanguageSupport` for a file name; the grammar is a lazy chunk.\n * Resolves to `null` when no language matches or the load fails; it never throws.\n */\nexport async function hxLoadLanguage(\n path: string,\n languages: readonly LanguageDescription[] = allLanguages,\n): Promise<LanguageSupport | null> {\n const description = hxLanguageFor(path, languages);\n if (!description) return null;\n try {\n return await description.load();\n } catch {\n return null;\n }\n}\n","import {\n afterNextRender,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n effect,\n forwardRef,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { ElementRef } from '@angular/core';\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport type { FormValueControl } from '@angular/forms/signals';\nimport { defaultKeymap, history, historyKeymap } from '@codemirror/commands';\nimport { Annotation, Compartment, type Extension, EditorState } from '@codemirror/state';\nimport { EditorView, keymap, lineNumbers as lineNumbersExtension } from '@codemirror/view';\nimport { HX_CODE_LANGUAGES, hxLoadLanguage } from '../language/language';\nimport { hxCodeHighlight } from '../theme/code-highlight';\nimport { hxCodeTheme } from '../theme/code-theme';\n\n/** Marks a transaction that comes from the `value` binding, so it is not reported as a user edit. */\nconst external = Annotation.define<boolean>();\n\n/**\n * A CodeMirror editor in an Angular template: text in and out, the language chosen by file path,\n * the Helix theme and highlighting by default, and `extensions` for the app's own features.\n * A real form control for template-driven, reactive and signal forms.\n *\n * ```html\n * <hx-code-editor aria-label=\"Source\" path=\"app.ts\" [(value)]=\"text\" />\n * <hx-code-editor aria-label=\"Config\" path=\"a.json\" [formControl]=\"control\" />\n * ```\n *\n * `valueChange` fires on user edits only. Every other input reconfigures the running view; the\n * view is created once and destroyed with the component. Give the editor an accessible name with\n * `aria-label` or `aria-labelledby` on the host.\n */\n@Component({\n selector: 'hx-code-editor',\n templateUrl: './code-editor.html',\n styleUrl: './code-editor.scss',\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => HxCodeEditor), multi: true },\n ],\n host: {\n class: 'hx-code-editor',\n '[class.hx-code-editor-invalid]': 'invalid()',\n '[class.hx-code-editor-disabled]': 'isDisabled()',\n // The name moves to the editable element; the host is not the control.\n '[attr.aria-label]': 'null',\n '[attr.aria-labelledby]': 'null',\n '(focusout)': 'onFocusOut()',\n },\n})\nexport class HxCodeEditor implements ControlValueAccessor, FormValueControl<string> {\n readonly #languages = inject(HX_CODE_LANGUAGES);\n\n // The signal-forms contract (FormValueControl): value, disabled, invalid, touch.\n readonly value = model<string>('');\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly invalid = input(false, { transform: booleanAttribute });\n readonly touch = output<void>();\n\n /** A file name or path; it selects the language. Empty: plain text. */\n readonly path = input('');\n readonly readOnly = input(false, { transform: booleanAttribute });\n readonly lineNumbers = input(true, { transform: booleanAttribute });\n readonly lineWrapping = input(false, { transform: booleanAttribute });\n /** Extra CodeMirror extensions of the app (completion, search, linting, …). */\n readonly extensions = input<readonly Extension[]>([]);\n readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n readonly ariaLabelledby = input<string | null>(null, { alias: 'aria-labelledby' });\n\n readonly #view = signal<EditorView | null>(null);\n /** The `EditorView`, or `null` before the first render. */\n readonly view = this.#view.asReadonly();\n\n private readonly container = viewChild.required<ElementRef<HTMLElement>>('container');\n /** Text written by a form control: it must not emit `valueChange`, so it bypasses the model. */\n readonly #written = signal<{ text: string } | null>(null);\n readonly #cvaDisabled = signal(false);\n protected readonly isDisabled = () => this.disabled() || this.#cvaDisabled();\n\n readonly #readOnly = new Compartment();\n readonly #lineNumbers = new Compartment();\n readonly #lineWrapping = new Compartment();\n readonly #language = new Compartment();\n readonly #userExtensions = new Compartment();\n readonly #labels = new Compartment();\n #generation = 0;\n\n #onChange: (value: string) => void = () => {};\n #onTouched: () => void = () => {};\n\n constructor() {\n afterNextRender(() => {\n const view = new EditorView({\n parent: this.container().nativeElement,\n state: EditorState.create({\n doc: untracked(() => this.#written()?.text ?? this.value()),\n extensions: [\n hxCodeTheme(),\n hxCodeHighlight(),\n history(),\n keymap.of([...defaultKeymap, ...historyKeymap]),\n this.#readOnly.of(this.#readOnlyExtension()),\n this.#lineNumbers.of(this.lineNumbers() ? lineNumbersExtension() : []),\n this.#lineWrapping.of(this.lineWrapping() ? EditorView.lineWrapping : []),\n this.#language.of([]),\n this.#userExtensions.of([...this.extensions()]),\n this.#labels.of(this.#labelExtension()),\n EditorView.updateListener.of((update) => {\n if (!update.docChanged) return;\n if (update.transactions.some((tr) => tr.annotation(external))) return;\n const text = update.state.doc.toString();\n this.value.set(text);\n this.#onChange(text);\n }),\n ],\n }),\n });\n this.#view.set(view);\n });\n\n inject(DestroyRef).onDestroy(() => {\n this.#generation++;\n this.#view()?.destroy();\n });\n\n // The value binding: replace the document in place (scroll position and view are kept).\n effect(() => this.#setDocument(this.value() ?? ''));\n effect(() => {\n const written = this.#written();\n if (written) this.#setDocument(written.text);\n });\n\n effect(() => {\n const view = this.#view();\n if (!view) return;\n view.dispatch({ effects: this.#readOnly.reconfigure(this.#readOnlyExtension()) });\n });\n\n effect(() => {\n this.#view()?.dispatch({\n effects: this.#lineNumbers.reconfigure(this.lineNumbers() ? lineNumbersExtension() : []),\n });\n });\n\n effect(() => {\n this.#view()?.dispatch({\n effects: this.#lineWrapping.reconfigure(this.lineWrapping() ? EditorView.lineWrapping : []),\n });\n });\n\n effect(() => {\n this.#view()?.dispatch({\n effects: this.#userExtensions.reconfigure([...this.extensions()]),\n });\n });\n\n effect(() => {\n this.#view()?.dispatch({ effects: this.#labels.reconfigure(this.#labelExtension()) });\n });\n\n // The language: loaded lazily; a late result of an earlier path is ignored.\n effect(() => {\n const view = this.#view();\n const path = this.path();\n if (!view) return;\n const generation = ++this.#generation;\n void hxLoadLanguage(path, this.#languages).then((support) => {\n if (generation !== this.#generation) return;\n view.dispatch({ effects: this.#language.reconfigure(support ?? []) });\n });\n });\n }\n\n /** Moves the keyboard focus into the editor. */\n focus(): void {\n this.#view()?.focus();\n }\n\n #setDocument(text: string): void {\n const view = this.#view();\n if (!view || view.state.doc.toString() === text) return;\n view.dispatch({\n changes: { from: 0, to: view.state.doc.length, insert: text },\n annotations: external.of(true),\n });\n }\n\n #readOnlyExtension(): Extension {\n const locked = this.readOnly() || this.isDisabled();\n return [EditorState.readOnly.of(locked), EditorView.editable.of(!this.isDisabled())];\n }\n\n #labelExtension(): Extension {\n const attributes: Record<string, string> = {};\n const label = this.ariaLabel();\n const labelledby = this.ariaLabelledby();\n if (label) attributes['aria-label'] = label;\n if (labelledby) attributes['aria-labelledby'] = labelledby;\n return EditorView.contentAttributes.of(attributes);\n }\n\n protected onFocusOut(): void {\n this.touch.emit();\n this.#onTouched();\n }\n\n writeValue(value: string | null): void {\n this.#written.set({ text: value ?? '' });\n }\n registerOnChange(fn: (value: string) => void): void {\n this.#onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.#onTouched = fn;\n }\n setDisabledState(disabled: boolean): void {\n this.#cvaDisabled.set(disabled);\n }\n}\n","<div #container class=\"hx-code-editor-container\"></div>\n","import { Facet, StateEffect, StateField, type Extension, type Range } from '@codemirror/state';\nimport {\n Decoration,\n EditorView,\n lineNumbers,\n WidgetType,\n type DecorationSet,\n} from '@codemirror/view';\n\n/** A comment on lines of one side of a diff. Lines are 1-based. */\nexport interface HxDiffComment {\n readonly id: string;\n readonly side: 'original' | 'modified';\n readonly startLine: number;\n readonly endLine: number;\n readonly text: string;\n readonly author?: string;\n /** ISO 8601, as GitHub `created_at`. */\n readonly time?: string;\n}\n\n/** A comment as one editor shows it: `mark` tells whether its lines are tinted. */\nexport interface HxPlacedComment {\n readonly comment: HxDiffComment;\n readonly start: number;\n readonly end: number;\n readonly mark: boolean;\n}\n\n/** What a comment-enabled editor tells its owner. */\nexport interface HxCommentHandlers {\n /** A draft was opened in this editor (the owner closes drafts of other editors). */\n opened(view: EditorView): void;\n /** The draft was saved; `start` and `end` are line numbers of this editor. */\n saved(view: EditorView, start: number, end: number, text: string): void;\n}\n\ninterface Draft {\n readonly start: number;\n readonly end: number;\n readonly anchor: number;\n text: string;\n}\n\nconst setComments = StateEffect.define<readonly HxPlacedComment[]>();\nconst setDraft = StateEffect.define<Draft | null>();\nconst handlersFacet = Facet.define<HxCommentHandlers, HxCommentHandlers | null>({\n combine: (values) => values[0] ?? null,\n});\n\nconst formatTime = (time: string | undefined): string => {\n if (!time) return '';\n const date = new Date(time);\n return Number.isNaN(date.getTime()) ? '' : date.toLocaleString();\n};\n\nconst rangeLabel = (start: number, end: number): string =>\n start === end ? `line ${start}` : `lines ${start}-${end}`;\n\nclass CommentBox extends WidgetType {\n constructor(private readonly placed: HxPlacedComment) {\n super();\n }\n override eq(other: CommentBox): boolean {\n const a = this.placed;\n const b = other.placed.comment;\n const c = a.comment;\n return (\n c.id === b.id &&\n c.text === b.text &&\n c.author === b.author &&\n c.time === b.time &&\n c.side === b.side &&\n c.startLine === b.startLine &&\n c.endLine === b.endLine &&\n a.end === other.placed.end\n );\n }\n override toDOM(): HTMLElement {\n const c = this.placed.comment;\n const box = document.createElement('div');\n box.className = 'cm-comment-box';\n box.setAttribute('role', 'group');\n box.setAttribute('aria-label', `Comment on ${rangeLabel(c.startLine, c.endLine)}`);\n const head = document.createElement('div');\n head.className = 'cm-comment-range';\n const parts = [\n c.author,\n c.side === 'original' ? 'old' : '',\n rangeLabel(c.startLine, c.endLine),\n ];\n head.textContent = [...parts.filter(Boolean), formatTime(c.time)].filter(Boolean).join(' · ');\n const text = document.createElement('div');\n text.className = 'cm-comment-text';\n text.textContent = c.text;\n box.append(head, text);\n return box;\n }\n override ignoreEvent(): boolean {\n return false;\n }\n}\n\nclass DraftBox extends WidgetType {\n constructor(private readonly draft: Draft) {\n super();\n }\n override eq(other: DraftBox): boolean {\n return other.draft.start === this.draft.start && other.draft.end === this.draft.end;\n }\n override toDOM(view: EditorView): HTMLElement {\n const { start, end, text } = this.draft;\n const close = (save: boolean, value: string) => closeDraft(view, save, value);\n const box = document.createElement('div');\n box.className = 'cm-comment-box cm-comment-draft';\n const input = document.createElement('textarea');\n input.className = 'cm-comment-input';\n input.rows = 3;\n input.value = text;\n input.placeholder = `Comment on ${rangeLabel(start, end)}`;\n input.setAttribute('aria-label', input.placeholder);\n const save = document.createElement('button');\n save.type = 'button';\n save.className = 'cm-comment-save';\n save.textContent = 'Add comment';\n save.disabled = !input.value.trim();\n const cancel = document.createElement('button');\n cancel.type = 'button';\n cancel.className = 'cm-comment-cancel';\n cancel.textContent = 'Cancel';\n const submit = () => {\n if (input.value.trim()) close(true, input.value);\n };\n save.addEventListener('click', submit);\n cancel.addEventListener('click', () => close(false, ''));\n input.addEventListener('input', () => {\n this.draft.text = input.value;\n save.disabled = !input.value.trim();\n });\n input.addEventListener('keydown', (event) => {\n if (event.key === 'Escape') close(false, '');\n else if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) submit();\n else return;\n event.preventDefault();\n event.stopPropagation();\n });\n const actions = document.createElement('div');\n actions.className = 'cm-comment-actions';\n actions.append(save, cancel);\n box.append(input, actions);\n queueMicrotask(() => input.focus());\n return box;\n }\n override ignoreEvent(): boolean {\n return true;\n }\n}\n\ninterface Shown {\n readonly comments: readonly HxPlacedComment[];\n readonly draft: Draft | null;\n readonly decorations: DecorationSet;\n}\n\nconst closeDraft = (view: EditorView, save: boolean, text: string): void => {\n const draft = view.state.field(field).draft;\n if (!draft) return;\n view.dispatch({ effects: setDraft.of(null) });\n if (save) view.state.facet(handlersFacet)?.saved(view, draft.start, draft.end, text);\n view.focus();\n};\n\nconst field: StateField<Shown> = StateField.define<Shown>({\n create: () => ({ comments: [], draft: null, decorations: Decoration.none }),\n update(value, tr) {\n let { comments, draft } = value;\n let changed = false;\n for (const effect of tr.effects) {\n if (effect.is(setComments)) {\n comments = effect.value;\n changed = true;\n } else if (effect.is(setDraft)) {\n draft = effect.value;\n changed = true;\n }\n }\n if (!changed) return value;\n return { comments, draft, decorations: decorate(tr.state.doc, comments, draft) };\n },\n provide: (f) => EditorView.decorations.from(f, (v) => v.decorations),\n});\n\nfunction decorate(\n doc: EditorView['state']['doc'],\n comments: readonly HxPlacedComment[],\n draft: Draft | null,\n): DecorationSet {\n const ranges: Range<Decoration>[] = [];\n const place = (start: number, end: number, widget: WidgetType, mark: boolean) => {\n if (start < 1 || end < start || end > doc.lines) return;\n if (mark) {\n for (let n = start; n <= end; n++) {\n ranges.push(Decoration.line({ class: 'cm-commented-line' }).range(doc.line(n).from));\n }\n }\n ranges.push(Decoration.widget({ widget, block: true, side: 3 }).range(doc.line(end).to));\n };\n for (const c of comments) place(c.start, c.end, new CommentBox(c), c.mark);\n if (draft) {\n place(draft.start, draft.end, new DraftBox(draft), false);\n for (let n = draft.start; n <= draft.end && n <= doc.lines; n++) {\n ranges.push(Decoration.line({ class: 'cm-draft-line' }).range(doc.line(n).from));\n }\n }\n return Decoration.set(ranges, true);\n}\n\n/** Shows `comments` (already placed on this editor's lines) as boxes below their last line. */\nexport function showComments(view: EditorView, comments: readonly HxPlacedComment[]): void {\n view.dispatch({ effects: setComments.of(comments) });\n}\n\n/** Closes the draft box of the editor without saving. */\nexport function discardDraft(view: EditorView): void {\n if (view.state.field(field, false)?.draft) view.dispatch({ effects: setDraft.of(null) });\n}\n\n/** The text of the lines `start`..`end` (1-based) of the editor. */\nexport function quoteOf(view: EditorView, start: number, end: number): string {\n const doc = view.state.doc;\n return doc.sliceString(doc.line(start).from, doc.line(end).to);\n}\n\nfunction openDraft(view: EditorView, line: number, extend: boolean): boolean {\n const state = view.state.field(field, false);\n if (!state) return false;\n const doc = view.state.doc;\n if (line < 1 || line > doc.lines) return false;\n const old = state.draft;\n const textarea = view.dom.querySelector<HTMLTextAreaElement>('.cm-comment-input');\n const text = textarea ? textarea.value : (old?.text ?? '');\n const anchor = extend && old ? old.anchor : line;\n const draft: Draft = {\n start: Math.min(anchor, line),\n end: Math.max(anchor, line),\n anchor,\n text: old ? text : '',\n };\n view.dispatch({ effects: setDraft.of(draft) });\n if (!old) view.state.facet(handlersFacet)?.opened(view);\n return true;\n}\n\n/**\n * CodeMirror command: opens the comment draft box on the line of the cursor, so the box is\n * reachable by keyboard; focus moves into its textarea and back to the editor when it closes.\n * It does nothing (returns `false`) in an editor without comments enabled. Bind it to a key:\n * `keymap.of([{ key: 'Mod-Alt-m', run: openCommentDraft }])`.\n */\nexport function openCommentDraft(view: EditorView): boolean {\n const line = view.state.doc.lineAt(view.state.selection.main.head).number;\n return openDraft(view, line, false);\n}\n\n/**\n * Line comments for one editor: a click on a line number opens a draft box (Shift-click extends\n * the range), comments and the draft are block widgets below their last line. Fed by\n * {@link showComments}.\n */\nexport function commentExtension(handlers: HxCommentHandlers): Extension {\n return [\n handlersFacet.of(handlers),\n field,\n lineNumbers({\n domEventHandlers: {\n mousedown(view, block, event) {\n // The number on the clicked element; the block (found by geometry) is the fallback.\n const label = (event.target as HTMLElement).closest('.cm-gutterElement')?.textContent;\n const shown = /^\\d+$/.test(label ?? '') ? Number(label) : 0;\n const line = shown || view.state.doc.lineAt(block.from).number;\n openDraft(view, line, (event as MouseEvent).shiftKey);\n event.preventDefault();\n return true;\n },\n },\n }),\n EditorView.baseTheme({\n '.cm-lineNumbers .cm-gutterElement': { cursor: 'pointer' },\n '.cm-commented-line': { backgroundColor: 'var(--h-highlight-background)' },\n '.cm-draft-line': { backgroundColor: 'var(--h-highlight-focus-background)' },\n '.cm-comment-box': {\n margin: '4px 8px 4px 48px',\n padding: '6px 8px',\n border: '1px solid var(--h-content-border-color)',\n borderLeft: '3px solid var(--h-primary-color)',\n borderRadius: 'var(--h-border-radius, 4px)',\n backgroundColor: 'var(--h-content-background)',\n color: 'var(--h-text-color)',\n fontFamily: 'inherit',\n },\n '.cm-comment-range': { color: 'var(--h-text-muted-color)', fontSize: '0.75em' },\n '.cm-comment-text': { whiteSpace: 'pre-wrap' },\n '.cm-comment-input': {\n display: 'block',\n width: '100%',\n boxSizing: 'border-box',\n font: 'inherit',\n color: 'inherit',\n background: 'transparent',\n border: '1px solid var(--h-content-border-color)',\n borderRadius: 'var(--h-border-radius, 4px)',\n resize: 'vertical',\n },\n '.cm-comment-input:focus-visible, .cm-comment-actions button:focus-visible': {\n outline: '2px solid var(--h-primary-color)',\n outlineOffset: '1px',\n },\n '.cm-comment-actions': { display: 'flex', gap: '6px', marginTop: '6px' },\n '.cm-comment-actions button': {\n font: 'inherit',\n color: 'inherit',\n background: 'transparent',\n border: '1px solid var(--h-content-border-color)',\n borderRadius: 'var(--h-border-radius, 4px)',\n padding: '2px 10px',\n cursor: 'pointer',\n },\n '.cm-comment-actions button.cm-comment-save': {\n background: 'var(--h-primary-color)',\n borderColor: 'var(--h-primary-color)',\n color: 'var(--h-primary-contrast-color)',\n },\n '.cm-comment-actions button:disabled': { opacity: '0.6', cursor: 'default' },\n }),\n ];\n}\n","import {\n Facet,\n RangeSet,\n StateEffect,\n StateField,\n type Extension,\n type Range,\n} from '@codemirror/state';\nimport {\n Decoration,\n EditorView,\n GutterMarker,\n lineNumberMarkers,\n WidgetType,\n type DecorationSet,\n} from '@codemirror/view';\n\n/** A review finding on lines of one side of a diff. Lines are 1-based. */\nexport interface HxDiffFinding {\n readonly id: string;\n readonly side: 'original' | 'modified';\n readonly startLine: number;\n readonly endLine: number;\n readonly severity: 'blocking' | 'note';\n readonly title: string;\n readonly detail?: string;\n}\n\n/** A finding as one editor shows it: `mark` tells whether its lines are marked in the gutter. */\nexport interface HxPlacedFinding {\n readonly finding: HxDiffFinding;\n readonly start: number;\n readonly end: number;\n readonly mark: boolean;\n}\n\n/** What a finding-enabled editor tells its owner. */\nexport interface HxFindingHandlers {\n /** The action button of a finding box was pressed in `view`. */\n action(view: EditorView, finding: HxDiffFinding): void;\n}\n\nconst setFindings = StateEffect.define<{\n readonly findings: readonly HxPlacedFinding[];\n readonly actionLabel: string;\n}>();\nconst handlersFacet = Facet.define<HxFindingHandlers, HxFindingHandlers | null>({\n combine: (values) => values[0] ?? null,\n});\n\nconst SVG_NS = 'http://www.w3.org/2000/svg';\n\n/** Inline icons (no icon font): a filled octagon with a bar for blocking, a circle with an i for a note. */\nconst icon = (severity: HxDiffFinding['severity']): SVGElement => {\n const svg = document.createElementNS(SVG_NS, 'svg');\n svg.setAttribute('viewBox', '0 0 16 16');\n svg.setAttribute('width', '14');\n svg.setAttribute('height', '14');\n svg.setAttribute('aria-hidden', 'true');\n svg.setAttribute('focusable', 'false');\n svg.setAttribute('class', 'cm-finding-icon');\n const shape = document.createElementNS(SVG_NS, 'path');\n shape.setAttribute('fill', 'currentColor');\n const glyph = document.createElementNS(SVG_NS, 'path');\n glyph.setAttribute('fill', 'none');\n glyph.setAttribute('stroke', 'var(--h-content-background)');\n glyph.setAttribute('stroke-width', '1.6');\n glyph.setAttribute('stroke-linecap', 'round');\n if (severity === 'blocking') {\n shape.setAttribute('d', 'M5 1h6l4 4v6l-4 4H5l-4-4V5z');\n glyph.setAttribute('d', 'M8 4.5v4M8 11v.5');\n } else {\n shape.setAttribute('d', 'M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1z');\n glyph.setAttribute('d', 'M8 7.2V11.5M8 4.6v.5');\n }\n svg.append(shape, glyph);\n return svg;\n};\n\nconst rangeLabel = (start: number, end: number): string =>\n start === end ? `line ${start}` : `lines ${start}-${end}`;\n\nconst severityText = (severity: HxDiffFinding['severity']): string =>\n severity === 'blocking' ? 'Blocking' : 'Note';\n\nclass FindingBox extends WidgetType {\n constructor(\n private readonly placed: HxPlacedFinding,\n private readonly actionLabel: string,\n ) {\n super();\n }\n override eq(other: FindingBox): boolean {\n const a = this.placed.finding;\n const b = other.placed.finding;\n return (\n a.id === b.id &&\n a.severity === b.severity &&\n a.title === b.title &&\n a.detail === b.detail &&\n a.side === b.side &&\n a.startLine === b.startLine &&\n a.endLine === b.endLine &&\n this.placed.end === other.placed.end &&\n this.actionLabel === other.actionLabel\n );\n }\n override toDOM(view: EditorView): HTMLElement {\n const f = this.placed.finding;\n const box = document.createElement('div');\n box.className = `cm-finding-box cm-finding-${f.severity}`;\n box.setAttribute('role', 'group');\n box.setAttribute(\n 'aria-label',\n `${severityText(f.severity)} finding on ${rangeLabel(f.startLine, f.endLine)}`,\n );\n const head = document.createElement('div');\n head.className = 'cm-finding-head';\n const severity = document.createElement('span');\n severity.className = 'cm-finding-severity';\n severity.append(icon(f.severity), document.createTextNode(severityText(f.severity)));\n const title = document.createElement('span');\n title.className = 'cm-finding-title';\n title.textContent = f.title;\n const range = document.createElement('span');\n range.className = 'cm-finding-range';\n range.textContent = `${f.side === 'original' ? 'old ' : ''}${rangeLabel(f.startLine, f.endLine)}`;\n head.append(severity, title, range);\n box.append(head);\n if (f.detail) {\n const detail = document.createElement('div');\n detail.className = 'cm-finding-detail';\n detail.textContent = f.detail;\n box.append(detail);\n }\n if (this.actionLabel) {\n const button = document.createElement('button');\n button.type = 'button';\n button.className = 'cm-finding-action';\n button.textContent = this.actionLabel;\n button.addEventListener('click', () => view.state.facet(handlersFacet)?.action(view, f));\n const actions = document.createElement('div');\n actions.className = 'cm-finding-actions';\n actions.append(button);\n box.append(actions);\n }\n return box;\n }\n override ignoreEvent(): boolean {\n return true;\n }\n}\n\nclass FindingGutterMarker extends GutterMarker {\n override elementClass: string;\n constructor(private readonly severity: HxDiffFinding['severity']) {\n super();\n this.elementClass = `cm-finding-gutter cm-finding-gutter-${severity}`;\n }\n override eq(other: GutterMarker): boolean {\n return other instanceof FindingGutterMarker && other.severity === this.severity;\n }\n}\n\ninterface Shown {\n readonly findings: readonly HxPlacedFinding[];\n readonly actionLabel: string;\n readonly decorations: DecorationSet;\n}\n\nconst buildDecorations = (\n doc: EditorView['state']['doc'],\n findings: readonly HxPlacedFinding[],\n actionLabel: string,\n): DecorationSet => {\n const ranges: Range<Decoration>[] = [];\n for (const placed of findings) {\n const { start, end } = placed;\n if (start < 1 || end < start || end > doc.lines) continue;\n if (placed.mark) {\n for (let n = start; n <= end; n++) {\n ranges.push(\n Decoration.line({\n class: `cm-finding-line cm-finding-line-${placed.finding.severity}`,\n }).range(doc.line(n).from),\n );\n }\n }\n // Side 1: first; thread boxes use side 2, comment boxes side 3.\n ranges.push(\n Decoration.widget({\n widget: new FindingBox(placed, actionLabel),\n block: true,\n side: 1,\n }).range(doc.line(end).to),\n );\n }\n return Decoration.set(ranges, true);\n};\n\nconst buildMarkers = (\n doc: EditorView['state']['doc'],\n findings: readonly HxPlacedFinding[],\n): RangeSet<GutterMarker> => {\n const lines = new Map<number, HxDiffFinding['severity']>();\n for (const { finding, start, end, mark } of findings) {\n if (!mark || start < 1 || end < start || end > doc.lines) continue;\n for (let n = start; n <= end; n++) {\n // A blocking finding wins over a note on the same line.\n if (lines.get(n) !== 'blocking') lines.set(n, finding.severity);\n }\n }\n const ranges = [...lines].map(([n, severity]) =>\n new FindingGutterMarker(severity).range(doc.line(n).from),\n );\n return RangeSet.of(ranges, true);\n};\n\nconst field: StateField<Shown> = StateField.define<Shown>({\n create: () => ({ findings: [], actionLabel: '', decorations: Decoration.none }),\n update(value, tr) {\n let { findings, actionLabel } = value;\n let changed = false;\n for (const effect of tr.effects) {\n if (effect.is(setFindings)) {\n findings = effect.value.findings;\n actionLabel = effect.value.actionLabel;\n changed = true;\n }\n }\n if (!changed) return value;\n return {\n findings,\n actionLabel,\n decorations: buildDecorations(tr.state.doc, findings, actionLabel),\n };\n },\n provide: (f) => [\n EditorView.decorations.from(f, (v) => v.decorations),\n lineNumberMarkers.compute([f], (state) => buildMarkers(state.doc, state.field(f).findings)),\n ],\n});\n\n/**\n * Shows `findings` (already placed on this editor's lines) as boxes below their last line.\n * A non-empty `actionLabel` adds an action button to each box.\n */\nexport function showFindings(\n view: EditorView,\n findings: readonly HxPlacedFinding[],\n actionLabel: string,\n): void {\n view.dispatch({ effects: setFindings.of({ findings, actionLabel }) });\n}\n\n/**\n * Review findings for one editor: a box with severity, title and detail below the last line of\n * each finding, the lines marked in the line-number gutter. The action button calls\n * `handlers.action`. Fed by {@link showFindings}.\n */\nexport function findingExtension(handlers: HxFindingHandlers): Extension {\n return [\n handlersFacet.of(handlers),\n field,\n EditorView.baseTheme({\n '.cm-finding-gutter-blocking': {\n boxShadow: 'inset 3px 0 0 var(--h-danger-color)',\n fontWeight: 'bold',\n },\n '.cm-finding-gutter-note': {\n boxShadow: 'inset 3px 0 0 var(--h-info-color, var(--h-primary-color))',\n fontStyle: 'italic',\n },\n '.cm-finding-line-blocking': { backgroundColor: 'var(--h-highlight-background)' },\n '.cm-finding-line-note': { backgroundColor: 'var(--h-highlight-background)' },\n '.cm-finding-box': {\n margin: '4px 8px 4px 48px',\n padding: '6px 8px',\n border: '1px solid var(--h-content-border-color)',\n borderLeft: '3px solid var(--h-info-color, var(--h-primary-color))',\n borderRadius: 'var(--h-border-radius, 4px)',\n backgroundColor: 'var(--h-content-background)',\n color: 'var(--h-text-color)',\n fontFamily: 'inherit',\n },\n '.cm-finding-box.cm-finding-blocking': {\n borderLeft: '3px solid var(--h-danger-color)',\n },\n '.cm-finding-head': { display: 'flex', flexWrap: 'wrap', gap: '8px', alignItems: 'center' },\n '.cm-finding-severity': {\n display: 'inline-flex',\n alignItems: 'center',\n gap: '4px',\n fontWeight: 'bold',\n },\n '.cm-finding-blocking .cm-finding-icon': { color: 'var(--h-danger-color)' },\n '.cm-finding-note .cm-finding-icon': {\n color: 'var(--h-info-color, var(--h-primary-color))',\n },\n '.cm-finding-title': { fontWeight: '600' },\n '.cm-finding-range': {\n color: 'var(--h-text-muted-color)',\n fontSize: '0.75em',\n marginLeft: 'auto',\n },\n '.cm-finding-detail': { whiteSpace: 'pre-wrap', marginTop: '4px' },\n '.cm-finding-actions': { marginTop: '6px' },\n '.cm-finding-action': {\n font: 'inherit',\n color: 'inherit',\n background: 'transparent',\n border: '1px solid var(--h-content-border-color)',\n borderRadius: 'var(--h-border-radius, 4px)',\n padding: '2px 10px',\n cursor: 'pointer',\n },\n '.cm-finding-action:focus-visible': {\n outline: '2px solid var(--h-primary-color)',\n outlineOffset: '1px',\n },\n }),\n ];\n}\n","import { Facet, StateEffect, StateField, type Extension, type Range } from '@codemirror/state';\nimport { Decoration, EditorView, WidgetType, type DecorationSet } from '@codemirror/view';\n\n/** One comment of a thread. `time` is ISO 8601, as GitHub `created_at`. */\nexport interface HxDiffThreadComment {\n readonly id: string;\n readonly author: string;\n readonly time: string;\n readonly text: string;\n}\n\n/** A review thread on lines of one side of a diff: the first comment, its replies, resolved state. */\nexport interface HxDiffThread {\n readonly id: string;\n readonly side: 'original' | 'modified';\n readonly startLine: number;\n readonly endLine: number;\n readonly resolved: boolean;\n readonly comments: readonly HxDiffThreadComment[];\n}\n\n/** A thread as one editor shows it: `mark` tells whether its lines are tinted. */\nexport interface HxPlacedThread {\n readonly thread: HxDiffThread;\n readonly start: number;\n readonly end: number;\n readonly mark: boolean;\n}\n\n/** What a thread-enabled editor tells its owner. */\nexport interface HxThreadHandlers {\n reply(view: EditorView, threadId: string, text: string): void;\n resolve(view: EditorView, threadId: string, resolved: boolean): void;\n}\n\n/** Turns comment text into safe HTML; `null`: the text is plain. */\nexport type HxThreadRender = ((text: string) => string) | null;\n\nconst setThreads = StateEffect.define<{\n readonly threads: readonly HxPlacedThread[];\n readonly render: HxThreadRender;\n}>();\nconst toggleOpen = StateEffect.define<string>();\nconst handlersFacet = Facet.define<HxThreadHandlers, HxThreadHandlers | null>({\n combine: (values) => values[0] ?? null,\n});\n\nconst rangeLabel = (start: number, end: number): string =>\n start === end ? `line ${start}` : `lines ${start}-${end}`;\n\nconst UNITS: readonly [Intl.RelativeTimeFormatUnit, number][] = [\n ['year', 365 * 24 * 3600],\n ['month', 30 * 24 * 3600],\n ['week', 7 * 24 * 3600],\n ['day', 24 * 3600],\n ['hour', 3600],\n ['minute', 60],\n];\n\n/** \"3 hours ago\" for an ISO time; empty when it is not a date. */\nexport function relativeTime(time: string, now = Date.now()): string {\n const date = new Date(time).getTime();\n if (Number.isNaN(date)) return '';\n const seconds = Math.round((date - now) / 1000);\n const format = new Intl.RelativeTimeFormat(undefined, { numeric: 'auto' });\n for (const [unit, size] of UNITS) {\n if (Math.abs(seconds) >= size) return format.format(Math.round(seconds / size), unit);\n }\n return format.format(seconds, 'second');\n}\n\nconst fullTime = (time: string): string => {\n const date = new Date(time);\n return Number.isNaN(date.getTime()) ? time : date.toLocaleString();\n};\n\nconst sameComments = (a: HxDiffThread, b: HxDiffThread): boolean =>\n a.comments.length === b.comments.length &&\n a.comments.every((c, i) => {\n const o = b.comments[i];\n return c.id === o.id && c.author === o.author && c.time === o.time && c.text === o.text;\n });\n\nclass ThreadBox extends WidgetType {\n constructor(\n private readonly placed: HxPlacedThread,\n private readonly open: boolean,\n private readonly render: HxThreadRender,\n ) {\n super();\n }\n override eq(other: ThreadBox): boolean {\n const t = this.placed.thread;\n const o = other.placed.thread;\n return (\n t.id === o.id &&\n t.resolved === o.resolved &&\n t.side === o.side &&\n t.startLine === o.startLine &&\n t.endLine === o.endLine &&\n sameComments(t, o) &&\n this.placed.end === other.placed.end &&\n this.open === other.open &&\n this.render === other.render\n );\n }\n override toDOM(view: EditorView): HTMLElement {\n const t = this.placed.thread;\n const collapsed = t.resolved && !this.open;\n const box = document.createElement('div');\n box.className = `cm-thread-box${t.resolved ? ' cm-thread-resolved' : ''}${\n collapsed ? ' cm-thread-collapsed' : ''\n }`;\n box.setAttribute('role', 'group');\n box.setAttribute('aria-label', `Thread on ${rangeLabel(t.startLine, t.endLine)}`);\n const first = t.comments[0];\n const count = t.comments.length;\n\n const head = document.createElement('div');\n head.className = 'cm-thread-head';\n if (t.resolved) {\n const toggle = document.createElement('button');\n toggle.type = 'button';\n toggle.className = 'cm-thread-toggle';\n toggle.setAttribute('aria-expanded', String(!collapsed));\n toggle.textContent = collapsed\n ? `Resolved · ${first?.author ?? ''} · ${count} comment${count === 1 ? '' : 's'}`\n : 'Resolved';\n toggle.addEventListener('click', () => view.dispatch({ effects: toggleOpen.of(t.id) }));\n head.append(toggle);\n }\n const range = document.createElement('span');\n range.className = 'cm-thread-range';\n range.textContent = `${t.side === 'original' ? 'old ' : ''}${rangeLabel(t.startLine, t.endLine)}`;\n head.append(range);\n const resolve = document.createElement('button');\n resolve.type = 'button';\n resolve.className = 'cm-thread-resolve';\n resolve.textContent = t.resolved ? 'Unresolve' : 'Resolve';\n resolve.addEventListener('click', () =>\n view.state.facet(handlersFacet)?.resolve(view, t.id, !t.resolved),\n );\n head.append(resolve);\n box.append(head);\n if (collapsed) return box;\n\n for (const c of t.comments) {\n const item = document.createElement('div');\n item.className = 'cm-thread-comment';\n const meta = document.createElement('div');\n meta.className = 'cm-thread-meta';\n const author = document.createElement('span');\n author.className = 'cm-thread-author';\n author.textContent = c.author;\n const time = document.createElement('time');\n time.className = 'cm-thread-time';\n time.dateTime = c.time;\n time.title = fullTime(c.time);\n time.textContent = relativeTime(c.time);\n meta.append(author, time);\n const body = document.createElement('div');\n body.className = 'cm-thread-text';\n if (this.render) body.innerHTML = this.render(c.text);\n else body.textContent = c.text;\n item.append(meta, body);\n box.append(item);\n }\n\n const input = document.createElement('textarea');\n input.className = 'cm-thread-input';\n input.rows = 2;\n input.placeholder = 'Reply';\n input.setAttribute('aria-label', `Reply to thread on ${rangeLabel(t.startLine, t.endLine)}`);\n const send = document.createElement('button');\n send.type = 'button';\n send.className = 'cm-thread-reply';\n send.textContent = 'Reply';\n send.disabled = true;\n const submit = () => {\n const text = input.value.trim();\n if (!text) return;\n input.value = '';\n send.disabled = true;\n view.state.facet(handlersFacet)?.reply(view, t.id, text);\n };\n input.addEventListener('input', () => {\n send.disabled = !input.value.trim();\n });\n input.addEventListener('keydown', (event) => {\n if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {\n submit();\n event.preventDefault();\n }\n event.stopPropagation();\n });\n send.addEventListener('click', submit);\n const actions = document.createElement('div');\n actions.className = 'cm-thread-actions';\n actions.append(send);\n box.append(input, actions);\n return box;\n }\n override ignoreEvent(): boolean {\n return true;\n }\n}\n\ninterface Shown {\n readonly threads: readonly HxPlacedThread[];\n readonly render: HxThreadRender;\n /** Ids of resolved threads the reader expanded. */\n readonly open: ReadonlySet<string>;\n readonly decorations: DecorationSet;\n}\n\nconst decorate = (\n doc: EditorView['state']['doc'],\n threads: readonly HxPlacedThread[],\n open: ReadonlySet<string>,\n render: HxThreadRender,\n): DecorationSet => {\n const ranges: Range<Decoration>[] = [];\n for (const placed of threads) {\n const { start, end } = placed;\n if (start < 1 || end < start || end > doc.lines) continue;\n if (placed.mark) {\n for (let n = start; n <= end; n++) {\n ranges.push(Decoration.line({ class: 'cm-thread-line' }).range(doc.line(n).from));\n }\n }\n // Side 2: after findings (side 1), before comments (side 3).\n ranges.push(\n Decoration.widget({\n widget: new ThreadBox(placed, open.has(placed.thread.id), render),\n block: true,\n side: 2,\n }).range(doc.line(end).to),\n );\n }\n return Decoration.set(ranges, true);\n};\n\nconst field: StateField<Shown> = StateField.define<Shown>({\n create: () => ({\n threads: [],\n render: null,\n open: new Set(),\n decorations: Decoration.none,\n }),\n update(value, tr) {\n let { threads, render, open } = value;\n let changed = false;\n for (const effect of tr.effects) {\n if (effect.is(setThreads)) {\n threads = effect.value.threads;\n render = effect.value.render;\n changed = true;\n } else if (effect.is(toggleOpen)) {\n const next = new Set(open);\n if (!next.delete(effect.value)) next.add(effect.value);\n open = next;\n changed = true;\n }\n }\n if (!changed) return value;\n return {\n threads,\n render,\n open,\n decorations: decorate(tr.state.doc, threads, open, render),\n };\n },\n provide: (f) => EditorView.decorations.from(f, (v) => v.decorations),\n});\n\n/**\n * Shows `threads` (already placed on this editor's lines) as boxes below their last line.\n * `render` turns comment text into HTML that is already sanitized; `null` shows plain text.\n */\nexport function showThreads(\n view: EditorView,\n threads: readonly HxPlacedThread[],\n render: HxThreadRender,\n): void {\n view.dispatch({ effects: setThreads.of({ threads, render }) });\n}\n\n/**\n * Review threads for one editor: a box with the comments in order, a reply field and a resolve\n * button; a resolved thread is one line until it is clicked. Fed by {@link showThreads}.\n */\nexport function threadExtension(handlers: HxThreadHandlers): Extension {\n return [\n handlersFacet.of(handlers),\n field,\n EditorView.baseTheme({\n '.cm-thread-line': { backgroundColor: 'var(--h-highlight-background)' },\n '.cm-thread-box': {\n margin: '4px 8px 4px 48px',\n padding: '6px 8px',\n border: '1px solid var(--h-content-border-color)',\n borderLeft: '3px solid var(--h-primary-color)',\n borderRadius: 'var(--h-border-radius, 4px)',\n backgroundColor: 'var(--h-content-background)',\n color: 'var(--h-text-color)',\n fontFamily: 'inherit',\n },\n '.cm-thread-resolved': {\n borderLeftColor: 'var(--h-content-border-color)',\n },\n '.cm-thread-head': { display: 'flex', gap: '8px', alignItems: 'center' },\n '.cm-thread-range': {\n color: 'var(--h-text-muted-color)',\n fontSize: '0.75em',\n marginLeft: 'auto',\n },\n '.cm-thread-comment': {\n marginTop: '6px',\n paddingTop: '6px',\n borderTop: '1px solid var(--h-content-border-color)',\n },\n '.cm-thread-comment:first-of-type': {\n borderTop: 'none',\n paddingTop: '0',\n },\n '.cm-thread-meta': { display: 'flex', gap: '8px', fontSize: '0.75em' },\n '.cm-thread-author': { fontWeight: '600' },\n '.cm-thread-time': { color: 'var(--h-text-muted-color)' },\n '.cm-thread-text': { whiteSpace: 'pre-wrap' },\n '.cm-thread-input': {\n display: 'block',\n width: '100%',\n boxSizing: 'border-box',\n marginTop: '8px',\n font: 'inherit',\n color: 'inherit',\n background: 'transparent',\n border: '1px solid var(--h-content-border-color)',\n borderRadius: 'var(--h-border-radius, 4px)',\n resize: 'vertical',\n },\n '.cm-thread-actions': { display: 'flex', gap: '6px', marginTop: '6px' },\n '.cm-thread-box button': {\n font: 'inherit',\n color: 'inherit',\n background: 'transparent',\n border: '1px solid var(--h-content-border-color)',\n borderRadius: 'var(--h-border-radius, 4px)',\n padding: '2px 10px',\n cursor: 'pointer',\n },\n '.cm-thread-box button.cm-thread-toggle': {\n border: 'none',\n padding: '0',\n textAlign: 'left',\n },\n '.cm-thread-box button:disabled': { opacity: '0.6', cursor: 'default' },\n '.cm-thread-box button:focus-visible, .cm-thread-input:focus-visible': {\n outline: '2px solid var(--h-primary-color)',\n outlineOffset: '1px',\n },\n }),\n ];\n}\n","import type { Extension } from '@codemirror/state';\nimport { EditorView } from '@codemirror/view';\n\n/** The roles of the diff colors: `--hx-diff-added-*` and `--hx-diff-removed-*`. */\nexport type HxDiffKind = 'added' | 'removed';\n/** `background` tints a changed line, `mark` a changed word, `sign` the gutter sign. */\nexport type HxDiffPart = 'background' | 'mark' | 'sign';\n\n/** The defaults of `--hx-diff-*` in the light and the dark theme. */\nexport const HX_DIFF_PALETTE: Readonly<\n Record<HxDiffKind, Readonly<Record<HxDiffPart, { light: string; dark: string }>>>\n> = {\n added: {\n background: {\n light: 'rgba(22, 163, 74, 0.12)',\n dark: 'rgba(74, 222, 128, 0.14)',\n },\n mark: {\n light: 'rgba(22, 163, 74, 0.32)',\n dark: 'rgba(74, 222, 128, 0.34)',\n },\n sign: { light: '#15803d', dark: '#86efac' },\n },\n removed: {\n background: {\n light: 'rgba(220, 38, 38, 0.1)',\n dark: 'rgba(248, 113, 113, 0.14)',\n },\n mark: {\n light: 'rgba(220, 38, 38, 0.3)',\n dark: 'rgba(248, 113, 113, 0.34)',\n },\n sign: { light: '#b91c1c', dark: '#fca5a5' },\n },\n};\n\nconst KINDS = Object.keys(HX_DIFF_PALETTE) as HxDiffKind[];\nconst PARTS: HxDiffPart[] = ['background', 'mark', 'sign'];\n\nconst color = (kind: HxDiffKind, part: HxDiffPart): string =>\n `var(--hx-diff-${kind}-${part}, var(--hx-diff-default-${kind}-${part}))`;\n\nconst defaults = (mode: 'light' | 'dark'): Record<string, string> =>\n Object.fromEntries(\n KINDS.flatMap((k) =>\n PARTS.map((p) => [`--hx-diff-default-${k}-${p}`, HX_DIFF_PALETTE[k][p][mode]]),\n ),\n );\n\nconst ADDED_LINE = '&.cm-merge-b .cm-changedLine, & .cm-inlineChangedLine';\nconst REMOVED_LINE = '&.cm-merge-a .cm-changedLine, & .cm-deletedChunk';\nconst ADDED_MARK = '&.cm-merge-b .cm-changedText, & .cm-inlineChangedLine .cm-changedText';\nconst REMOVED_MARK = '&.cm-merge-a .cm-changedText, & .cm-deletedChunk .cm-deletedText';\nconst ADDED_SIGN = '&.cm-merge-b .cm-changedLineGutter, & .cm-inlineChangedLineGutter';\nconst REMOVED_SIGN = '&.cm-merge-a .cm-changedLineGutter, & .cm-deletedLineGutter';\n\nconst sign = (kind: HxDiffKind, char: string) => ({\n color: color(kind, 'sign'),\n background: 'transparent',\n textAlign: 'center',\n fontWeight: '600',\n '&::before': { content: `\"${char}\"` },\n});\n\n/**\n * The Helix colors of the diff view. Added and removed lines, changed words and the gutter signs\n * (`+`, `-`) take their colors from `--hx-diff-added-*` and `--hx-diff-removed-*`; the defaults for\n * `.app-dark` are set here, so a theme switch needs no rebuild.\n */\nexport function hxDiffTheme(): Extension {\n return [\n EditorView.baseTheme({\n '&': defaults('light'),\n '.app-dark &': defaults('dark'),\n }),\n EditorView.theme({\n [ADDED_LINE]: { backgroundColor: color('added', 'background') },\n [REMOVED_LINE]: { backgroundColor: color('removed', 'background') },\n [ADDED_MARK]: { background: color('added', 'mark') },\n [REMOVED_MARK]: { background: color('removed', 'mark') },\n '.cm-changeGutter': { width: '1.25rem', padding: '0' },\n [ADDED_SIGN]: sign('added', '+'),\n [REMOVED_SIGN]: sign('removed', '-'),\n '.cm-collapsedLines': {\n color: 'var(--h-text-muted-color)',\n background: 'var(--h-content-hover-background)',\n },\n '.cm-deletedChunk': { backgroundColor: color('removed', 'background') },\n '.cm-chunkButtons': { display: 'flex', gap: '6px', padding: '2px 4px' },\n '.cm-review-button': {\n font: 'inherit',\n color: 'inherit',\n background: 'var(--h-content-background)',\n border: '1px solid var(--h-content-border-color)',\n borderRadius: 'var(--h-border-radius, 4px)',\n padding: '0 8px',\n cursor: 'pointer',\n },\n '.cm-review-button:hover': { background: 'var(--h-content-hover-background)' },\n '.cm-review-button:focus-visible': {\n outline: '2px solid var(--h-primary-color)',\n outlineOffset: '1px',\n },\n }),\n ];\n}\n","import {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n effect,\n ElementRef,\n inject,\n input,\n output,\n SecurityContext,\n signal,\n untracked,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n acceptChunk,\n type Chunk,\n getChunks,\n getOriginalDoc,\n MergeView,\n rejectChunk,\n uncollapseUnchanged,\n unifiedMergeView,\n} from '@codemirror/merge';\nimport {\n Compartment,\n EditorSelection,\n EditorState,\n type Extension,\n type Text,\n} from '@codemirror/state';\nimport { EditorView, lineNumbers } from '@codemirror/view';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { HX_CODE_LANGUAGES, hxLoadLanguage } from '../language/language';\nimport {\n commentExtension,\n discardDraft,\n type HxDiffComment,\n type HxPlacedComment,\n quoteOf,\n showComments,\n} from '../review/comment-extension';\nimport {\n findingExtension,\n type HxDiffFinding,\n type HxPlacedFinding,\n showFindings,\n} from '../review/finding-extension';\nimport {\n type HxDiffThread,\n type HxPlacedThread,\n showThreads,\n threadExtension,\n} from '../review/thread-extension';\nimport { hxCodeHighlight } from '../theme/code-highlight';\nimport { hxCodeTheme } from '../theme/code-theme';\nimport { hxDiffTheme } from './diff-theme';\n\n/** How the two versions are laid out. `auto`: split when the host is wide enough, else unified. */\nexport type HxDiffLayout = 'auto' | 'split' | 'unified';\n\n/** The text a line number refers to. */\nexport type HxDiffSide = 'original' | 'modified';\n\n/** The collapsing of unchanged regions: `margin` lines stay visible, at least `minSize` collapse. */\nexport interface HxDiffCollapse {\n readonly margin?: number;\n readonly minSize?: number;\n}\n\n/** A comment the reviewer wrote: the lines on `side` and the text of those lines as `quote`. */\nexport interface HxDiffCommentAdded {\n readonly side: HxDiffSide;\n readonly startLine: number;\n readonly endLine: number;\n readonly text: string;\n readonly quote: string;\n}\n\n/** A reply was written in a thread. */\nexport interface HxDiffReplyAdded {\n readonly threadId: string;\n readonly text: string;\n}\n\n/** The resolve button of a thread was used. */\nexport interface HxDiffResolvedChange {\n readonly threadId: string;\n readonly resolved: boolean;\n}\n\n/** The action of a finding box was used: the finding and the text of its lines on its side. */\nexport interface HxDiffFindingAction {\n readonly id: string;\n readonly quote: string;\n}\n\n/** The decision on one change in review mode. */\nexport type HxChangeDecision = 'accept' | 'reject';\n\n/** A change was decided: its position in the initial list of changes and the decision. */\nexport interface HxDiffChangeDecided {\n readonly index: number;\n readonly decision: HxChangeDecision;\n}\n\nconst DEFAULT_SPLIT_MIN_WIDTH = 900;\nconst DEFAULT_COLLAPSE = { margin: 3, minSize: 4 } as const;\n\n/**\n * Shows two versions of a text, side by side or unified, read-only: syntax highlighting, marked\n * changed words, a change gutter with `+` and `-`, and collapsed unchanged regions.\n *\n * ```html\n * <hx-diff-view aria-label=\"Changes\" path=\"app.ts\" [original]=\"before\" [modified]=\"after\" />\n * ```\n *\n * With `commentable`, a click on a line number opens a comment box (Shift-click extends the range)\n * and `commentAdded` reports the saved text; `comments` are shown below their last line.\n *\n * `findings` are shown as boxes below their last line, the lines marked in the gutter; with\n * `findingActionLabel` each box has a button and `findingAction` reports `{id, quote}`.\n *\n * `threads` (`HxDiffThread`) are boxes below their last line, after findings and before comments:\n * the comments in order, a reply field (`replyAdded`) and a resolve button (`resolvedChange`); a\n * resolved thread is one line until clicked. `renderComment` turns text into HTML (Markdown); its\n * result is sanitized with Angular `DomSanitizer` before it is inserted.\n *\n * With `reviewable` (unified layout only, ignored with `layout=\"split\"`) each change has an accept\n * and a reject button; `changeDecided` reports `{index, decision}` (`index` is the position in the\n * initial list of changes and stays stable), `result()` is the text after the decisions so far\n * (undecided changes stay as in `modified`), `pendingChanges()` counts the undecided changes, and\n * `acceptAll()` / `rejectAll()` decide the rest. A decided change leaves `changeCount()`.\n *\n * The view is rebuilt when a text, `layout`, `path`, `reviewable` or `collapseUnchanged` changes; a theme switch\n * needs no rebuild (colors are CSS variables `--hx-diff-added-*`, `--hx-diff-removed-*`).\n */\n@Component({\n selector: 'hx-diff-view',\n templateUrl: './diff-view.html',\n styleUrl: './diff-view.scss',\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'hx-diff-view',\n '[attr.aria-label]': 'null',\n '[attr.aria-labelledby]': 'null',\n },\n})\nexport class HxDiffView {\n readonly #languages = inject(HX_CODE_LANGUAGES);\n readonly #sanitizer = inject(DomSanitizer);\n\n /** The old version. Empty: a new file. */\n readonly original = input.required<string>();\n /** The new version. Empty: a deleted file. */\n readonly modified = input.required<string>();\n /** A file name or path; it selects the language. Empty: plain text. */\n readonly path = input('');\n /** `split` (default), `unified`, or `auto`: split from `splitMinWidth` of the host, else unified. */\n readonly layout = input<HxDiffLayout>('split');\n /** With `layout=\"auto\"`: the host width in px from which the split layout is used. */\n readonly splitMinWidth = input(DEFAULT_SPLIT_MIN_WIDTH);\n /** `true` (default): margin 3, minimum 4. `false`: show everything. Or set both numbers. */\n readonly collapseUnchanged = input<boolean | HxDiffCollapse>(true);\n /** The comments to show, below their last line. Changing them does not rebuild the view. */\n readonly comments = input<readonly HxDiffComment[]>([]);\n /** `true`: a click on a line number opens a comment box. Default off. */\n readonly commentable = input(false);\n /** The review findings to show, below their last line. Changing them does not rebuild the view. */\n readonly findings = input<readonly HxDiffFinding[]>([]);\n /** The label of the button on each finding box. Empty (default): no button. */\n readonly findingActionLabel = input('');\n /** The button of a finding box was pressed. */\n readonly findingAction = output<HxDiffFindingAction>();\n /** The review threads to show, below their last line. Changing them does not rebuild the view. */\n readonly threads = input<readonly HxDiffThread[]>([]);\n /** Optional: text of a comment to HTML (e.g. Markdown). The result is sanitized. Default plain text. */\n readonly renderComment = input<((text: string) => string) | null>(null);\n /** A reply was written in a thread; the app stores it and passes the thread back. */\n readonly replyAdded = output<HxDiffReplyAdded>();\n /** The resolve button of a thread was used. */\n readonly resolvedChange = output<HxDiffResolvedChange>();\n /** A comment was written; the app stores it and passes it back through `comments`. */\n readonly commentAdded = output<HxDiffCommentAdded>();\n /** `true`: each change has an accept and a reject button. Unified layout only. Default off. */\n readonly reviewable = input(false);\n /** A change was accepted or rejected. */\n readonly changeDecided = output<HxDiffChangeDecided>();\n readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n readonly ariaLabelledby = input<string | null>(null, {\n alias: 'aria-labelledby',\n });\n\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly #width = signal<number | null>(null);\n readonly #changes = signal(0);\n readonly #current = signal(0);\n /** The number of changes (chunks) of the diff. */\n readonly changeCount = this.#changes.asReadonly();\n /** The 1-based number of the change at the cursor; 0 when no change is selected yet. */\n readonly currentChange = this.#current.asReadonly();\n readonly #result = signal('');\n /** The text after the decisions so far; undecided changes show as in `modified`. */\n readonly result = this.#result.asReadonly();\n /** The number of changes without a decision. */\n readonly pendingChanges = this.#changes.asReadonly();\n /** The layout in use: `auto` resolved by the host width. `null` while `auto` is not measured. */\n readonly effectiveLayout = computed<'split' | 'unified' | null>(() => {\n const layout = this.layout();\n if (layout !== 'auto') return layout;\n const width = this.#width();\n if (width === null) return null;\n return width >= this.splitMinWidth() ? 'split' : 'unified';\n });\n\n private readonly container = viewChild.required<ElementRef<HTMLElement>>('container');\n readonly #ready = signal(false);\n readonly #language = new Compartment();\n readonly #review = new Compartment();\n readonly #built = signal(0);\n #reviewOn = false;\n readonly #commentExtension = commentExtension({\n opened: (view) => {\n const views = this.#views;\n if (!views || views.original === views.modified) return;\n discardDraft(view === views.original ? views.modified : views.original);\n },\n saved: (view, startLine, endLine, text) => {\n const views = this.#views;\n const side: HxDiffSide =\n views && views.original !== views.modified && view === views.original\n ? 'original'\n : 'modified';\n this.commentAdded.emit({\n side,\n startLine,\n endLine,\n text,\n quote: quoteOf(view, startLine, endLine),\n });\n },\n });\n readonly #findingExtension = findingExtension({\n action: (view, finding) => {\n const views = this.#views;\n const split = !!views && views.original !== views.modified;\n let quote = '';\n if (views && finding.endLine >= finding.startLine && finding.startLine >= 1) {\n const target = split\n ? finding.side === 'original'\n ? views.original\n : views.modified\n : view;\n const doc =\n !split && finding.side === 'original' ? getOriginalDoc(target.state) : target.state.doc;\n if (finding.endLine <= doc.lines) {\n quote = doc.sliceString(doc.line(finding.startLine).from, doc.line(finding.endLine).to);\n }\n }\n this.findingAction.emit({ id: finding.id, quote });\n },\n });\n readonly #threadExtension = threadExtension({\n reply: (_view, threadId, text) => this.replyAdded.emit({ threadId, text }),\n resolve: (_view, threadId, resolved) => this.resolvedChange.emit({ threadId, resolved }),\n });\n #renderCache: { source: (text: string) => string; wrapped: (text: string) => string } | null =\n null;\n #generation = 0;\n #destroy: (() => void) | null = null;\n /** Initial index of each undecided change, in document order. */\n #undecided: number[] = [];\n #views: { original: EditorView; modified: EditorView } | null = null;\n #reviewMode = false;\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n let observer: ResizeObserver | null = null;\n afterNextRender(() => {\n this.#ready.set(true);\n if (typeof ResizeObserver === 'undefined') {\n this.#width.set(this.#host.nativeElement.getBoundingClientRect().width);\n return;\n }\n // The host element is observed, not the window: a resizable panel switches the layout too.\n observer = new ResizeObserver((entries) => {\n const entry = entries[entries.length - 1];\n if (entry) this.#width.set(entry.contentRect.width);\n });\n observer.observe(this.#host.nativeElement);\n });\n\n destroyRef.onDestroy(() => {\n observer?.disconnect();\n this.#generation++;\n this.#teardown();\n });\n\n effect(() => {\n this.#built();\n this.commentable();\n this.comments();\n this.findings();\n this.findingActionLabel();\n this.threads();\n this.renderComment();\n untracked(() => this.#showReview());\n });\n\n effect(() => {\n if (!this.#ready()) return;\n const original = this.original();\n const modified = this.modified();\n const layout = this.effectiveLayout();\n if (layout === null) return;\n const reviewable = this.reviewable() && layout === 'unified';\n const path = this.path();\n const collapse = this.#collapse();\n const label = this.#labels();\n const generation = ++this.#generation;\n untracked(() => {\n this.#teardown();\n const views = this.#build(layout, original, modified, collapse, label, reviewable);\n const count = this.#chunks(views[views.length - 1]).length;\n this.#undecided = Array.from({ length: count }, (_, i) => i);\n this.#changes.set(count);\n this.#result.set(modified);\n this.#built.update((n) => n + 1);\n void hxLoadLanguage(path, this.#languages).then((support) => {\n if (generation !== this.#generation || !support) return;\n for (const view of views) {\n view.dispatch({ effects: this.#language.reconfigure(support) });\n }\n });\n });\n });\n }\n\n #showReview(): void {\n const views = this.#views;\n if (!views) return;\n const commentable = this.commentable();\n const comments = this.comments();\n const findings = this.findings();\n const actionLabel = this.findingActionLabel();\n const threads = this.threads();\n const render = this.#renderer();\n const split = views.original !== views.modified;\n for (const [side, view] of [\n ['original', views.original],\n ['modified', views.modified],\n ] as const) {\n if (!split && side === 'original') continue;\n if (this.#reviewOn !== commentable) {\n view.dispatch({\n effects: this.#review.reconfigure(commentable ? this.#commentExtension : []),\n });\n }\n const placed = commentable\n ? comments.flatMap((c) => this.#place(c, side, view, views.modified, split))\n : [];\n showComments(view, placed);\n const placedFindings = findings.flatMap((f) =>\n this.#placeFinding(f, side, view, views.modified, split),\n );\n showFindings(view, placedFindings, actionLabel);\n const placedThreads = threads.flatMap((t) =>\n this.#placeThread(t, side, view, views.modified, split),\n );\n showThreads(view, placedThreads, render);\n }\n this.#reviewOn = commentable;\n }\n\n /** Where a comment shows in `view`; `[]` when it belongs to the other editor. */\n #place(\n c: HxDiffComment,\n side: HxDiffSide,\n view: EditorView,\n modified: EditorView,\n split: boolean,\n ): HxPlacedComment[] {\n const at = this.#placeLines(c, side, view, modified, split);\n return at ? [{ comment: c, ...at }] : [];\n }\n\n /** Where a finding shows in `view`; `[]` when it belongs to the other editor. */\n #placeFinding(\n f: HxDiffFinding,\n side: HxDiffSide,\n view: EditorView,\n modified: EditorView,\n split: boolean,\n ): HxPlacedFinding[] {\n const at = this.#placeLines(f, side, view, modified, split);\n return at ? [{ finding: f, ...at }] : [];\n }\n\n /** Where a thread shows in `view`; `[]` when it belongs to the other editor. */\n #placeThread(\n t: HxDiffThread,\n side: HxDiffSide,\n view: EditorView,\n modified: EditorView,\n split: boolean,\n ): HxPlacedThread[] {\n const at = this.#placeLines(t, side, view, modified, split);\n return at ? [{ thread: t, ...at }] : [];\n }\n\n /** The app's renderer wrapped so that its HTML always passes the Angular sanitizer. */\n #renderer(): ((text: string) => string) | null {\n const render = this.renderComment();\n if (!render) return null;\n const cached = this.#renderCache;\n if (cached?.source === render) return cached.wrapped;\n const wrapped = (text: string): string =>\n this.#sanitizer.sanitize(SecurityContext.HTML, render(text)) ?? '';\n this.#renderCache = { source: render, wrapped };\n return wrapped;\n }\n\n #placeLines(\n c: { side: HxDiffSide; startLine: number; endLine: number },\n side: HxDiffSide,\n view: EditorView,\n modified: EditorView,\n split: boolean,\n ): { start: number; end: number; mark: boolean } | null {\n if (split ? c.side !== side : false) return null;\n const lines = view.state.doc.lines;\n if (c.side === 'modified' || split) {\n if (c.endLine < c.startLine || c.startLine < 1 || c.endLine > lines) return null;\n return { start: c.startLine, end: c.endLine, mark: true };\n }\n // Unified layout, text on the old side: it hangs below the matching line of the new text.\n const original = getOriginalDoc(modified.state);\n if (c.endLine < c.startLine || c.startLine < 1 || c.endLine > original.lines) return null;\n const at = this.#map(modified, original.line(c.endLine).from, true);\n const end = modified.state.doc.lineAt(Math.min(at, modified.state.doc.length)).number;\n return { start: end, end, mark: false };\n }\n\n /** Accepts every undecided change: the modified text is kept. */\n acceptAll(): void {\n this.#decideAll('accept');\n }\n\n /** Rejects every undecided change: the original lines are restored. */\n rejectAll(): void {\n this.#decideAll('reject');\n }\n\n #decideAll(decision: HxChangeDecision): void {\n const view = this.#views?.modified;\n if (!view || !this.#reviewing) return;\n for (let chunk = this.#chunks(view)[0]; chunk; chunk = this.#chunks(view)[0]) {\n if (!this.#decide(view, chunk.fromB, decision)) break;\n }\n }\n\n /** Decides the change at `pos` and reports it. Returns false when there is none. */\n #decide(view: EditorView, pos: number, decision: HxChangeDecision): boolean {\n const position = this.#chunks(view).findIndex((c) => c.fromB <= pos && pos <= c.endB);\n if (position < 0) return false;\n const done = decision === 'accept' ? acceptChunk(view, pos) : rejectChunk(view, pos);\n if (!done) return false;\n const [index] = this.#undecided.splice(position, 1);\n this.#sync(view);\n this.changeDecided.emit({ index, decision });\n return true;\n }\n\n /** The buttons of a change; `mergeControls` of `unifiedMergeView`. */\n #control(type: 'accept' | 'reject'): HTMLElement {\n const button = document.createElement('button');\n button.type = 'button';\n button.className = `cm-review-button cm-review-${type}`;\n button.textContent = type === 'accept' ? 'Accept' : 'Reject';\n button.setAttribute(\n 'aria-label',\n type === 'accept' ? 'Accept this change' : 'Reject this change',\n );\n // `click`, not `mousedown`: Enter and Space on the focused button work as well.\n button.addEventListener('click', (e) => {\n e.preventDefault();\n const view = this.#views?.modified;\n const widget = button.closest('.cm-deletedChunk');\n if (!view || !widget) return;\n this.#decide(view, view.posAtDOM(widget), type);\n });\n return button;\n }\n\n /** Brings counts, cursor index and result up to date after the document or the chunks changed. */\n #sync(view: EditorView): void {\n const count = this.#chunks(view).length;\n if (count !== this.#changes()) this.#changes.set(count);\n this.#result.set(view.state.doc.toString());\n this.#current.set(this.#indexAt(view));\n }\n\n /** Moves to the next change; after the last one it wraps to the first. */\n next(): void {\n const count = this.#changes();\n if (count) this.#goTo(this.#current() % count);\n }\n\n /** Moves to the previous change; before the first one it wraps to the last. */\n previous(): void {\n const count = this.#changes();\n if (count) this.#goTo(this.#current() <= 1 ? count - 1 : this.#current() - 2);\n }\n\n /**\n * Scrolls to a 1-based line of the original or the modified text and expands a collapsed region\n * around it. A line outside the text is clamped.\n */\n revealLine(line: number, side: HxDiffSide = 'modified'): void {\n const views = this.#views;\n if (!views) return;\n const split = this.effectiveLayout() === 'split';\n const original = side === 'original';\n const view = split && original ? views.original : views.modified;\n const doc = !split && original ? getOriginalDoc(view.state) : view.state.doc;\n const own = this.#lineStart(doc, line);\n // Position in the modified text and, in split layout, in the original text.\n const b = original ? this.#map(view, own, true) : own;\n const a = original ? own : this.#map(views.modified, own, false);\n this.#uncollapse(views.modified, b);\n if (split) this.#uncollapse(views.original, a);\n const pos = original && split ? a : b;\n view.dispatch({\n effects: EditorView.scrollIntoView(pos, { y: 'center' }),\n selection: { anchor: pos },\n });\n }\n\n #lineStart(doc: Text, line: number): number {\n const n = Math.min(Math.max(Math.trunc(line) || 1, 1), doc.lines);\n return doc.line(n).from;\n }\n\n /** Maps a position of the original text (`fromA`) or of the modified text to the other one. */\n #map(view: EditorView, pos: number, fromA: boolean): number {\n let delta = 0;\n for (const chunk of this.#chunks(view)) {\n const [from, to] = fromA ? [chunk.fromA, chunk.toA] : [chunk.fromB, chunk.toB];\n if (pos < from) break;\n if (pos < to) return fromA ? chunk.fromB : chunk.fromA;\n delta += fromA\n ? chunk.toB - chunk.fromB - (chunk.toA - chunk.fromA)\n : chunk.toA - chunk.fromA - (chunk.toB - chunk.fromB);\n }\n return Math.max(pos + delta, 0);\n }\n\n /** Expands the collapsed region that contains `pos`. */\n #uncollapse(view: EditorView, pos: number): void {\n const starts: number[] = [];\n for (const source of view.state.facet(EditorView.decorations)) {\n if (typeof source === 'function') continue;\n source.between(0, view.state.doc.length, (from, to, deco) => {\n const widget = deco.spec.widget as { type?: string } | undefined;\n if (widget?.type === 'collapsed-unchanged-code' && from <= pos && pos <= to)\n starts.push(from);\n });\n }\n if (starts.length) {\n view.dispatch({ effects: starts.map((from) => uncollapseUnchanged.of(from)) });\n }\n }\n\n #goTo(index: number): void {\n const view = this.#views?.modified;\n const chunk = view && this.#chunks(view)[index];\n if (!view || !chunk) return;\n view.dispatch({\n selection: { anchor: chunk.fromB },\n userEvent: 'select.byChunk',\n effects: EditorView.scrollIntoView(EditorSelection.range(chunk.endB, chunk.fromB), {\n y: 'center',\n }),\n });\n }\n\n /** The 1-based number of the change that contains the cursor; 0 when there is none. */\n #indexAt(view: EditorView): number {\n const head = view.state.selection.main.head;\n return this.#chunks(view).findIndex((c) => c.fromB <= head && head <= c.endB) + 1;\n }\n\n #chunks(view: EditorView): readonly Chunk[] {\n return getChunks(view.state)?.chunks ?? [];\n }\n\n #collapse(): HxDiffCollapse | null {\n const value = this.collapseUnchanged();\n if (value === false) return null;\n if (value === true) return DEFAULT_COLLAPSE;\n return { ...DEFAULT_COLLAPSE, ...value };\n }\n\n #labels(): Extension {\n const attributes: Record<string, string> = { 'aria-readonly': 'true' };\n const label = this.ariaLabel();\n const labelledby = this.ariaLabelledby();\n if (label) attributes['aria-label'] = label;\n if (labelledby) attributes['aria-labelledby'] = labelledby;\n return EditorView.contentAttributes.of(attributes);\n }\n\n get #reviewing(): boolean {\n return (\n this.#views !== null && this.#views.original === this.#views.modified && this.#reviewMode\n );\n }\n\n #shared(labels: Extension): Extension[] {\n return [\n hxCodeTheme(),\n hxCodeHighlight(),\n hxDiffTheme(),\n EditorState.readOnly.of(true),\n EditorView.editable.of(false),\n lineNumbers(),\n this.#language.of([]),\n this.#review.of([]),\n this.#findingExtension,\n this.#threadExtension,\n EditorView.updateListener.of((update) => {\n if (update.selectionSet && !update.docChanged && update.view === this.#views?.modified) {\n this.#current.set(this.#indexAt(update.view));\n }\n }),\n labels,\n ];\n }\n\n #build(\n layout: 'split' | 'unified',\n original: string,\n modified: string,\n collapse: HxDiffCollapse | null,\n labels: Extension,\n reviewable: boolean,\n ): EditorView[] {\n this.#reviewMode = reviewable;\n const parent = this.container().nativeElement;\n const collapseUnchanged = collapse ?? undefined;\n if (layout === 'unified') {\n const view = new EditorView({\n parent,\n doc: modified,\n extensions: [\n ...this.#shared(labels),\n unifiedMergeView({\n original,\n mergeControls: reviewable ? (type) => this.#control(type) : false,\n gutter: true,\n highlightChanges: true,\n collapseUnchanged,\n }),\n ],\n });\n this.#destroy = () => view.destroy();\n this.#views = { original: view, modified: view };\n return [view];\n }\n const extensions = this.#shared(labels);\n const merge = new MergeView({\n parent,\n a: { doc: original, extensions },\n b: { doc: modified, extensions },\n gutter: true,\n highlightChanges: true,\n collapseUnchanged,\n });\n this.#destroy = () => merge.destroy();\n this.#views = { original: merge.a, modified: merge.b };\n return [merge.a, merge.b];\n }\n\n #teardown(): void {\n this.#destroy?.();\n this.#destroy = null;\n this.#views = null;\n this.#reviewOn = false;\n this.#reviewMode = false;\n this.#undecided = [];\n this.#changes.set(0);\n this.#current.set(0);\n }\n}\n","<div #container class=\"hx-diff-view-container\"></div>\n","/** A piece of a changed line; `changed` pieces are the words that differ from the paired line. */\nexport interface HxSegment {\n text: string;\n changed: boolean;\n}\n\nexport interface HxDiffRow {\n kind: 'same' | 'add' | 'del';\n /** The line without its line break. */\n text: string;\n /** Word-level pieces of a line that has a partner on the other side; absent otherwise. */\n segments?: HxSegment[];\n}\n\n/** Longest common subsequence as index pairs; the common head and tail are matched first. */\nfunction lcs<T>(a: readonly T[], b: readonly T[]): [number, number][] {\n let head = 0;\n while (head < a.length && head < b.length && a[head] === b[head]) head++;\n let tail = 0;\n while (\n tail < a.length - head &&\n tail < b.length - head &&\n a[a.length - 1 - tail] === b[b.length - 1 - tail]\n )\n tail++;\n const pairs: [number, number][] = [];\n for (let i = 0; i < head; i++) pairs.push([i, i]);\n const n = a.length - head - tail;\n const m = b.length - head - tail;\n if (n > 0 && m > 0) {\n // A very large middle falls back to 'all replaced' instead of an O(n*m) table.\n if (n * m <= 4_000_000) {\n const w = m + 1;\n const t = new Uint32Array((n + 1) * w);\n for (let i = n - 1; i >= 0; i--) {\n for (let j = m - 1; j >= 0; j--) {\n t[i * w + j] =\n a[head + i] === b[head + j]\n ? t[(i + 1) * w + j + 1] + 1\n : Math.max(t[(i + 1) * w + j], t[i * w + j + 1]);\n }\n }\n let i = 0;\n let j = 0;\n while (i < n && j < m) {\n if (a[head + i] === b[head + j]) {\n pairs.push([head + i, head + j]);\n i++;\n j++;\n } else if (t[(i + 1) * w + j] >= t[i * w + j + 1]) i++;\n else j++;\n }\n }\n }\n for (let k = tail; k > 0; k--) pairs.push([a.length - k, b.length - k]);\n return pairs;\n}\n\n/** Splits into words, whitespace runs and single punctuation marks; joining gives the input back. */\nfunction tokenize(line: string): string[] {\n return line.match(/\\s+|[\\p{L}\\p{N}_]+|[^\\s\\p{L}\\p{N}_]/gu) ?? [];\n}\n\n/** Word-level difference of two lines: the pieces of each side, marking what the other lacks. */\nexport function hxWordDiff(\n oldLine: string,\n newLine: string,\n): { old: HxSegment[]; new: HxSegment[] } {\n const a = tokenize(oldLine);\n const b = tokenize(newLine);\n const pairs = lcs(a, b);\n const keptA = new Set(pairs.map((p) => p[0]));\n const keptB = new Set(pairs.map((p) => p[1]));\n const build = (tokens: string[], kept: Set<number>): HxSegment[] => {\n const out: HxSegment[] = [];\n tokens.forEach((text, i) => {\n const changed = !kept.has(i);\n const last = out[out.length - 1];\n if (last?.changed === changed) last.text += text;\n else out.push({ text, changed });\n });\n return out;\n };\n return { old: build(a, keptA), new: build(b, keptB) };\n}\n\n/** Lines of a text; a trailing line break does not add an empty line, an empty text has none. */\nfunction splitLines(text: string): string[] {\n if (text === '') return [];\n const lines = text.replace(/\\r\\n/g, '\\n').split('\\n');\n if (lines[lines.length - 1] === '') lines.pop();\n return lines;\n}\n\n/**\n * Line-based diff of two texts (longest common subsequence over lines, after the common head and\n * tail are trimmed). Where a run of removed lines is followed by a run of added lines, the lines\n * are paired in order and get word-level `segments`; surplus lines get none.\n *\n * CRLF is read as LF, and a final line break does not add a line, so `'x\\n'` and `'x'` give no\n * rows. If the differing middle has more than 4,000,000 cells (n*m), it falls back to\n * \"all deleted, then all added\" instead of building the table.\n */\nexport function hxDiffLines(oldText: string, newText: string): HxDiffRow[] {\n const a = splitLines(oldText);\n const b = splitLines(newText);\n const pairs = lcs(a, b);\n const rows: HxDiffRow[] = [];\n let i = 0;\n let j = 0;\n const flush = (ai: number, bj: number): void => {\n const removed = a.slice(i, ai);\n const added = b.slice(j, bj);\n const paired = Math.min(removed.length, added.length);\n const delRows: HxDiffRow[] = removed.map((text) => ({ kind: 'del', text }));\n const addRows: HxDiffRow[] = added.map((text) => ({ kind: 'add', text }));\n for (let k = 0; k < paired; k++) {\n const w = hxWordDiff(removed[k], added[k]);\n delRows[k].segments = w.old;\n addRows[k].segments = w.new;\n }\n rows.push(...delRows, ...addRows);\n };\n for (const [pi, pj] of pairs) {\n flush(pi, pj);\n rows.push({ kind: 'same', text: a[pi] });\n i = pi + 1;\n j = pj + 1;\n }\n flush(a.length, b.length);\n return rows;\n}\n\n/** Number of added and removed lines. */\nexport function hxDiffStat(rows: readonly HxDiffRow[]): { added: number; removed: number } {\n return {\n added: rows.filter((r) => r.kind === 'add').length,\n removed: rows.filter((r) => r.kind === 'del').length,\n };\n}\n\n/** A run of lines both versions share, or a hunk where they differ. */\nexport type HxMergePart =\n | { kind: 'same'; lines: string[] }\n | { kind: 'hunk'; index: number; mine: string[]; theirs: string[] };\n\n/** Which side of a hunk goes into the merged note. */\nexport type HxMergeChoice = 'mine' | 'theirs' | 'both';\n\n/** Splits the difference of two texts into shared runs and hunks (`mine` is `a`, `theirs` is `b`). */\nexport function hxMergeParts(a: string, b: string): HxMergePart[] {\n const parts: HxMergePart[] = [];\n let hunks = 0;\n for (const row of hxDiffLines(a, b)) {\n const last = parts[parts.length - 1];\n if (row.kind === 'same') {\n if (last?.kind === 'same') last.lines.push(row.text);\n else parts.push({ kind: 'same', lines: [row.text] });\n } else {\n let hunk = last?.kind === 'hunk' ? last : null;\n if (!hunk) {\n hunk = { kind: 'hunk', index: hunks++, mine: [], theirs: [] };\n parts.push(hunk);\n }\n (row.kind === 'del' ? hunk.mine : hunk.theirs).push(row.text);\n }\n }\n return parts;\n}\n\n/** The merged text; a hunk without a choice takes `'mine'`. It ends with a line break when `endsWithBreak` is true and it has lines. */\nexport function hxMergeText(\n parts: readonly HxMergePart[],\n choices: Readonly<Record<number, HxMergeChoice>>,\n endsWithBreak: boolean,\n): string {\n const lines: string[] = [];\n for (const part of parts) {\n if (part.kind === 'same') lines.push(...part.lines);\n else {\n const choice = choices[part.index] ?? 'mine';\n if (choice !== 'theirs') lines.push(...part.mine);\n if (choice !== 'mine') lines.push(...part.theirs);\n }\n }\n return lines.length > 0 && endsWithBreak ? `${lines.join('\\n')}\\n` : lines.join('\\n');\n}\n","/** A line range of a conflict, 0-based, both ends inclusive and both marker lines. */\nexport interface HxConflictRange {\n from: number;\n to: number;\n}\n\n/**\n * A Git conflict in a text. Line numbers are 0-based.\n *\n * Each range runs from the line of its own marker to the line of the next marker, so the content\n * of a side is the lines strictly between `from` and `to`:\n *\n * - `ours`: `<<<<<<<` to `|||||||` (diff3 style) or to `=======`\n * - `base` (diff3 style only): `|||||||` to `=======`\n * - `theirs`: `=======` to `>>>>>>>`\n *\n * `start` is the `<<<<<<<` line, `end` the `>>>>>>>` line. The labels are the text after the markers.\n */\nexport interface HxConflict {\n start: number;\n end: number;\n ours: HxConflictRange;\n base?: HxConflictRange;\n theirs: HxConflictRange;\n oursLabel: string;\n baseLabel?: string;\n theirsLabel: string;\n}\n\ntype Marker = '<' | '|' | '=' | '>';\n\n/** The kind of conflict marker a line is, or `null`: seven characters, then nothing or a blank. */\nexport function hxConflictMarker(line: string): Marker | null {\n if (line.length < 7) return null;\n const c = line[0];\n if (c !== '<' && c !== '|' && c !== '=' && c !== '>') return null;\n for (let i = 1; i < 7; i++) if (line[i] !== c) return null;\n if (line.length > 7 && line[7] !== ' ' && line[7] !== '\\t' && line[7] !== '\\r') return null;\n // `=======` takes no label.\n if (c === '=' && line.slice(7).trim() !== '') return null;\n return c;\n}\n\nconst labelOf = (line: string): string => line.slice(7).trim();\n\n/**\n * Finds the conflicts of `text`. Malformed markers (no end, a start inside a conflict, markers in\n * the wrong order) are left as plain text; this never throws.\n */\nexport function hxParseConflicts(text: string): HxConflict[] {\n return hxParseConflictLines(text.split('\\n'));\n}\n\n/** {@link hxParseConflicts} for lines that are already split. */\nexport function hxParseConflictLines(lines: readonly string[]): HxConflict[] {\n const found: HxConflict[] = [];\n let start = -1;\n let base = -1;\n let sep = -1;\n for (let i = 0; i < lines.length; i++) {\n const marker = hxConflictMarker(lines[i]);\n if (marker === null) continue;\n if (marker === '<') {\n // A start inside a conflict: the earlier one stays plain text, this one begins anew.\n start = i;\n base = -1;\n sep = -1;\n } else if (start < 0) {\n continue;\n } else if (marker === '|') {\n if (base >= 0 || sep >= 0) start = -1;\n else base = i;\n } else if (marker === '=') {\n if (sep >= 0) start = -1;\n else sep = i;\n } else {\n if (sep >= 0) {\n found.push({\n start,\n end: i,\n ours: { from: start, to: base >= 0 ? base : sep },\n ...(base >= 0 ? { base: { from: base, to: sep } } : {}),\n theirs: { from: sep, to: i },\n oursLabel: labelOf(lines[start]),\n ...(base >= 0 ? { baseLabel: labelOf(lines[base]) } : {}),\n theirsLabel: labelOf(lines[i]),\n });\n }\n start = -1;\n }\n if (start < 0) {\n base = -1;\n sep = -1;\n }\n }\n return found;\n}\n","import {\n EditorSelection,\n StateField,\n type EditorState,\n type Extension,\n type Range,\n type Text,\n} from '@codemirror/state';\nimport { Decoration, EditorView, WidgetType, type DecorationSet } from '@codemirror/view';\nimport { hxParseConflictLines, type HxConflict } from './conflict-parser';\n\nexport type HxConflictChoice = 'ours' | 'theirs' | 'both';\n\nconst linesOf = (doc: Text): string[] => {\n const lines: string[] = [];\n for (const line of doc.iterLines()) lines.push(line);\n return lines;\n};\n\n/** The conflicts of the document; they follow every edit. */\nexport const hxConflictField: StateField<readonly HxConflict[]> = StateField.define<\n readonly HxConflict[]\n>({\n create: (state) => hxParseConflictLines(linesOf(state.doc)),\n update: (value, tr) => (tr.docChanged ? hxParseConflictLines(linesOf(tr.state.doc)) : value),\n});\n\n/** The number of conflicts left in the document; 0 without the extension. */\nexport function hxConflictCount(state: EditorState): number {\n return state.field(hxConflictField, false)?.length ?? 0;\n}\n\n/** The lines (without their breaks) between the marker lines `from` and `to`. */\nconst content = (doc: Text, from: number, to: number): string[] => {\n const out: string[] = [];\n for (let n = from + 2; n <= to; n++) out.push(doc.line(n).text);\n return out;\n};\n\n/** The replacement of `conflict` for `choice`; lines are 0-based, so `doc.line(n + 1)`. */\nfunction resolution(\n doc: Text,\n conflict: HxConflict,\n choice: HxConflictChoice,\n): { from: number; to: number; insert: string } {\n const lines = [\n ...(choice === 'theirs' ? [] : content(doc, conflict.ours.from, conflict.ours.to)),\n ...(choice === 'ours' ? [] : content(doc, conflict.theirs.from, conflict.theirs.to)),\n ];\n const first = doc.line(conflict.start + 1);\n const last = doc.line(conflict.end + 1);\n if (lines.length > 0) return { from: first.from, to: last.to, insert: lines.join('\\n') };\n // Nothing is left: take the line break with the lines, so no empty line stays behind.\n if (last.to < doc.length) return { from: first.from, to: last.to + 1, insert: '' };\n return { from: Math.max(0, first.from - 1), to: last.to, insert: '' };\n}\n\n/** Replaces the conflict that starts on 0-based line `start` with `choice`, as one change. */\nfunction accept(view: EditorView, start: number, choice: HxConflictChoice): boolean {\n const conflict = view.state.field(hxConflictField, false)?.find((c) => c.start === start);\n if (!conflict) return false;\n view.dispatch({\n changes: resolution(view.state.doc, conflict, choice),\n userEvent: 'input.conflict.accept',\n scrollIntoView: true,\n });\n return true;\n}\n\nconst CHOICES: readonly { choice: HxConflictChoice; text: string }[] = [\n { choice: 'ours', text: 'Accept ours' },\n { choice: 'theirs', text: 'Accept theirs' },\n { choice: 'both', text: 'Accept both' },\n];\n\nclass ConflictActions extends WidgetType {\n constructor(\n private readonly conflict: HxConflict,\n private readonly index: number,\n private readonly total: number,\n ) {\n super();\n }\n override eq(other: ConflictActions): boolean {\n const a = this.conflict;\n const b = other.conflict;\n return (\n a.start === b.start &&\n a.end === b.end &&\n a.oursLabel === b.oursLabel &&\n a.theirsLabel === b.theirsLabel &&\n this.index === other.index &&\n this.total === other.total\n );\n }\n override toDOM(view: EditorView): HTMLElement {\n const c = this.conflict;\n const row = document.createElement('div');\n row.className = 'cm-hx-conflict-actions';\n row.setAttribute('role', 'group');\n row.setAttribute('aria-label', `Conflict ${this.index + 1} of ${this.total}`);\n const title = document.createElement('span');\n title.className = 'cm-hx-conflict-title';\n title.textContent = `Conflict ${this.index + 1} of ${this.total}`;\n row.append(title);\n for (const { choice, text } of CHOICES) {\n const button = document.createElement('button');\n button.type = 'button';\n button.className = `cm-hx-conflict-action cm-hx-conflict-action-${choice}`;\n button.textContent = text;\n const side =\n choice === 'ours'\n ? c.oursLabel\n : choice === 'theirs'\n ? c.theirsLabel\n : [c.oursLabel, c.theirsLabel].filter(Boolean).join(' and ');\n button.setAttribute('aria-label', side ? `${text}: ${side}` : text);\n button.addEventListener('click', () => {\n // Look the conflict up now: the widget can outlive edits above it.\n const start = view.state.doc.lineAt(view.posAtDOM(row)).number - 1;\n accept(view, start, choice);\n });\n row.append(button);\n }\n return row;\n }\n override ignoreEvent(): boolean {\n return true;\n }\n}\n\nconst decorate = (state: EditorState): DecorationSet => {\n const conflicts = state.field(hxConflictField);\n const doc = state.doc;\n const ranges: Range<Decoration>[] = [];\n const line = (n: number, cls: string) =>\n ranges.push(Decoration.line({ class: cls }).range(doc.line(n + 1).from));\n conflicts.forEach((c, index) => {\n ranges.push(\n Decoration.widget({\n widget: new ConflictActions(c, index, conflicts.length),\n block: true,\n side: -1,\n }).range(doc.line(c.start + 1).from),\n );\n for (let n = c.start; n <= c.end; n++) {\n const marker = n === c.ours.from || n === c.theirs.from || n === c.end || n === c.base?.from;\n if (marker) line(n, 'cm-hx-conflict-marker');\n else if (n < (c.base?.from ?? c.ours.to)) line(n, 'cm-hx-conflict-ours');\n else if (c.base && n < c.base.to) line(n, 'cm-hx-conflict-base');\n else line(n, 'cm-hx-conflict-theirs');\n }\n });\n return Decoration.set(ranges, true);\n};\n\n/** Moves the cursor to the start of the conflict that `pick` chooses; false when there is none. */\nconst move =\n (pick: (conflicts: readonly HxConflict[], line: number) => HxConflict | undefined) =>\n (view: EditorView): boolean => {\n const conflicts = view.state.field(hxConflictField, false);\n if (!conflicts?.length) return false;\n const line = view.state.doc.lineAt(view.state.selection.main.head).number - 1;\n const target = pick(conflicts, line) ?? undefined;\n if (!target) return false;\n view.dispatch({\n selection: EditorSelection.cursor(view.state.doc.line(target.start + 1).from),\n scrollIntoView: true,\n userEvent: 'select',\n });\n return true;\n };\n\n/** Moves the cursor to the next conflict after the cursor line; wraps around. */\nexport const hxNextConflict: (view: EditorView) => boolean = move(\n (conflicts, line) => conflicts.find((c) => c.start > line) ?? conflicts[0],\n);\n\n/** Moves the cursor to the previous conflict before the cursor line; wraps around. */\nexport const hxPreviousConflict: (view: EditorView) => boolean = move(\n (conflicts, line) =>\n [...conflicts].reverse().find((c) => c.start < line) ?? conflicts[conflicts.length - 1],\n);\n\n/**\n * Shows Git conflict markers as blocks: the ours, base and theirs lines colored, the marker lines\n * dimmed, and a row above each conflict with Accept ours, Accept theirs and Accept both. An\n * action is one undoable change. There is no key map: bind {@link hxNextConflict} and\n * {@link hxPreviousConflict} in the app.\n *\n * Colors: `--hx-code-conflict-ours-bg`, `--hx-code-conflict-theirs-bg` and\n * `--hx-code-conflict-marker-opacity`, with defaults for the light and the dark theme.\n */\nexport function hxConflictMarkers(): Extension {\n return [\n hxConflictField,\n EditorView.decorations.compute([hxConflictField], decorate),\n EditorView.baseTheme({\n '&light .cm-hx-conflict-ours': {\n backgroundColor: 'var(--hx-code-conflict-ours-bg, rgba(46, 160, 67, 0.16))',\n },\n '&dark .cm-hx-conflict-ours': {\n backgroundColor: 'var(--hx-code-conflict-ours-bg, rgba(46, 160, 67, 0.24))',\n },\n '&light .cm-hx-conflict-theirs': {\n backgroundColor: 'var(--hx-code-conflict-theirs-bg, rgba(31, 111, 235, 0.16))',\n },\n '&dark .cm-hx-conflict-theirs': {\n backgroundColor: 'var(--hx-code-conflict-theirs-bg, rgba(56, 139, 253, 0.26))',\n },\n '.cm-hx-conflict-base': { backgroundColor: 'rgba(128, 128, 128, 0.14)' },\n '.cm-hx-conflict-marker': {\n opacity: 'var(--hx-code-conflict-marker-opacity, 0.6)',\n fontStyle: 'italic',\n },\n '.cm-hx-conflict-actions': {\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n gap: '6px',\n padding: '2px 8px',\n fontFamily: 'inherit',\n color: 'var(--h-text-color)',\n },\n '.cm-hx-conflict-title': {\n color: 'var(--h-text-muted-color)',\n fontSize: '0.75em',\n marginRight: '4px',\n },\n '.cm-hx-conflict-action': {\n font: 'inherit',\n fontSize: '0.8em',\n color: 'inherit',\n background: 'transparent',\n border: '1px solid var(--h-content-border-color)',\n borderRadius: 'var(--h-border-radius, 4px)',\n padding: '1px 8px',\n cursor: 'pointer',\n },\n '.cm-hx-conflict-action:focus-visible': {\n outline: '2px solid var(--h-primary-color)',\n outlineOffset: '1px',\n },\n }),\n ];\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n linkedSignal,\n output,\n} from '@angular/core';\nimport { type HxMergeChoice, hxMergeParts, hxMergeText } from './line-diff';\n\nlet nextId = 0;\n\nconst CHOICES: readonly { value: HxMergeChoice; label: 'mine' | 'theirs' | 'both' }[] = [\n { value: 'mine', label: 'mine' },\n { value: 'theirs', label: 'theirs' },\n { value: 'both', label: 'both' },\n];\n\n/**\n * Merges two versions of a text: shared lines are shown once, each differing part offers mine, theirs or both,\n * and the result can be edited before it is taken. It renders no dialog; the app places it.\n */\n@Component({\n selector: 'hx-conflict-merge',\n templateUrl: './conflict-merge.html',\n styleUrl: './conflict-merge.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'hx-conflict-merge' },\n})\nexport class HxConflictMerge {\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n protected readonly id = `hx-conflict-merge-${nextId++}`;\n\n /** My version of the text. */\n readonly mine = input.required<string>();\n /** Their version of the text. */\n readonly theirs = input.required<string>();\n readonly mineLabel = input('Mine');\n readonly theirsLabel = input('Theirs');\n\n /** The final text on confirm. */\n readonly merged = output<string>();\n /** Cancel was pressed. */\n readonly cancelled = output<void>();\n\n protected readonly parts = computed(() => hxMergeParts(this.mine(), this.theirs()));\n protected readonly hunks = computed(() => this.parts().filter((part) => part.kind === 'hunk'));\n\n /** Choices the user made; a change of `mine` or `theirs` resets them. */\n protected readonly choices = linkedSignal<unknown, Record<number, HxMergeChoice>>({\n source: this.parts,\n computation: () => ({}),\n });\n /** The hand-edited result, or `null` while the result follows the choices. */\n protected readonly edit = linkedSignal<unknown, string | null>({\n source: this.parts,\n computation: () => null,\n });\n /** A choice waiting for the answer to the overwrite prompt. */\n protected readonly pending = linkedSignal<\n unknown,\n { index: number; choice: HxMergeChoice } | null\n >({ source: this.parts, computation: () => null });\n\n protected readonly choiceOptions = CHOICES;\n\n /** The merged text for the current choices; a part without a choice takes mine. */\n readonly result = computed(() =>\n hxMergeText(this.parts(), this.choices(), this.mine().endsWith('\\n')),\n );\n /** The number of differing parts the user has not chosen yet. */\n readonly unresolved = computed(\n () => this.hunks().filter((part) => this.choices()[part.index] === undefined).length,\n );\n\n /** The text in the result field: the hand edit, else the merged text. */\n protected readonly text = computed(() => this.edit() ?? this.result());\n\n protected choiceOf(index: number): HxMergeChoice {\n return this.choices()[index] ?? 'mine';\n }\n\n protected choose(index: number, choice: HxMergeChoice): void {\n if (this.edit() !== null && this.choiceOf(index) !== choice) {\n // The prompt decides; the radio keeps showing the current choice until then.\n this.pending.set({ index, choice });\n this.restoreRadios(index);\n return;\n }\n this.apply(index, choice);\n }\n\n protected overwrite(): void {\n const pending = this.pending();\n if (!pending) return;\n this.edit.set(null);\n this.apply(pending.index, pending.choice);\n }\n\n protected keepEdit(): void {\n const pending = this.pending();\n this.pending.set(null);\n if (pending) this.restoreRadios(pending.index);\n }\n\n protected onEdit(event: Event): void {\n this.edit.set((event.target as HTMLTextAreaElement).value);\n this.pending.set(null);\n }\n\n protected confirm(): void {\n this.merged.emit(this.text());\n }\n\n protected lines(lines: readonly string[]): string {\n return lines.join('\\n');\n }\n\n private apply(index: number, choice: HxMergeChoice): void {\n this.pending.set(null);\n this.choices.update((choices) => ({ ...choices, [index]: choice }));\n }\n\n /** Native radios check themselves before the click handler runs; put the check back on the current choice. */\n private restoreRadios(index: number): void {\n const current = this.choiceOf(index);\n for (const radio of this.#host.nativeElement.querySelectorAll<HTMLInputElement>(\n `input[name=\"${this.id}-${index}\"]`,\n )) {\n radio.checked = radio.value === current;\n }\n }\n}\n","<p class=\"hx-conflict-merge-summary\" role=\"status\">\n {{ hunks().length === 1 ? '1 difference' : hunks().length + ' differences' }}\n @if (hunks().length > 0) {\n · {{ unresolved() }} not chosen yet\n }\n</p>\n\n<div class=\"hx-conflict-merge-parts\">\n @for (part of parts(); track $index) {\n @if (part.kind === 'same') {\n <pre class=\"hx-conflict-merge-same\">{{ lines(part.lines) }}</pre>\n } @else {\n <fieldset class=\"hx-conflict-merge-hunk\">\n <legend>Difference {{ part.index + 1 }}</legend>\n <div class=\"hx-conflict-merge-sides\">\n <div class=\"hx-conflict-merge-side hx-conflict-merge-mine\">\n <span class=\"hx-conflict-merge-side-label\">{{ mineLabel() }}</span>\n <pre>{{ lines(part.mine) }}</pre>\n </div>\n <div class=\"hx-conflict-merge-side hx-conflict-merge-theirs\">\n <span class=\"hx-conflict-merge-side-label\">{{ theirsLabel() }}</span>\n <pre>{{ lines(part.theirs) }}</pre>\n </div>\n </div>\n <div\n class=\"hx-conflict-merge-choices\"\n role=\"radiogroup\"\n [attr.aria-label]=\"'Choice for difference ' + (part.index + 1)\"\n >\n @for (option of choiceOptions; track option.value) {\n <label>\n <input\n type=\"radio\"\n [name]=\"id + '-' + part.index\"\n [value]=\"option.value\"\n [checked]=\"choiceOf(part.index) === option.value\"\n (click)=\"choose(part.index, option.value)\"\n />\n {{\n option.value === 'mine'\n ? mineLabel()\n : option.value === 'theirs'\n ? theirsLabel()\n : 'Both'\n }}\n </label>\n }\n </div>\n </fieldset>\n }\n }\n</div>\n\n<div class=\"hx-conflict-merge-result\">\n <label [for]=\"id + '-result'\">Result</label>\n <textarea\n [id]=\"id + '-result'\"\n rows=\"10\"\n spellcheck=\"false\"\n [value]=\"text()\"\n (input)=\"onEdit($event)\"\n ></textarea>\n @if (pending()) {\n <div class=\"hx-conflict-merge-prompt\" role=\"alert\">\n <span>Your edit of the result will be lost. Overwrite it with the new choice?</span>\n <button type=\"button\" class=\"hx-conflict-merge-overwrite\" (click)=\"overwrite()\">\n Overwrite\n </button>\n <button type=\"button\" class=\"hx-conflict-merge-keep\" (click)=\"keepEdit()\">Keep edit</button>\n </div>\n }\n</div>\n\n<div class=\"hx-conflict-merge-actions\">\n <button type=\"button\" class=\"hx-conflict-merge-cancel\" (click)=\"cancelled.emit()\">Cancel</button>\n <button type=\"button\" class=\"hx-conflict-merge-confirm\" (click)=\"confirm()\">Merge</button>\n</div>\n","/** Version of `@gravionlabs/helix-code`; a placeholder until the editor components land. */\nexport const HELIX_CODE_VERSION = '0.1.0';\n\nexport { hxCodeTheme } from './lib/theme/code-theme';\nexport {\n hxCodeHighlight,\n HX_CODE_PALETTE,\n type HxCodeColor,\n type HxCodeRole,\n} from './lib/theme/code-highlight';\nexport { hxLanguageFor, hxLoadLanguage, HX_CODE_LANGUAGES } from './lib/language/language';\nexport { HxCodeEditor } from './lib/editor/code-editor';\nexport {\n HxDiffView,\n type HxChangeDecision,\n type HxDiffChangeDecided,\n type HxDiffCollapse,\n type HxDiffCommentAdded,\n type HxDiffFindingAction,\n type HxDiffLayout,\n type HxDiffReplyAdded,\n type HxDiffResolvedChange,\n type HxDiffSide,\n} from './lib/diff/diff-view';\nexport { hxDiffTheme, HX_DIFF_PALETTE } from './lib/diff/diff-theme';\nexport { openCommentDraft, type HxDiffComment } from './lib/review/comment-extension';\nexport type { HxDiffFinding } from './lib/review/finding-extension';\nexport type { HxDiffThread, HxDiffThreadComment } from './lib/review/thread-extension';\nexport {\n hxDiffLines,\n hxDiffStat,\n hxMergeParts,\n hxMergeText,\n hxWordDiff,\n type HxDiffRow,\n type HxMergeChoice,\n type HxMergePart,\n type HxSegment,\n} from './lib/conflict/line-diff';\nexport {\n hxParseConflicts,\n type HxConflict,\n type HxConflictRange,\n} from './lib/conflict/conflict-parser';\nexport {\n hxConflictCount,\n hxConflictField,\n hxConflictMarkers,\n hxNextConflict,\n hxPreviousConflict,\n type HxConflictChoice,\n} from './lib/conflict/conflict-markers';\nexport { HxConflictMerge } from './lib/conflict/conflict-merge';\n"],"mappings":";;;;;;;;;;;AAYA,SAAgB,cAAW;CACzB,OAAO,WAAW,MAAM;EACtB,KAAK;GACH,OAAO;GACP,iBAAiB;GACjB,UAAU;EACX;EACD,gBAAgB,EAAE,SAAS,OAAM;EACjC,gBAAgB,EACd,YACE,4GACH;EACD,eAAe,EAAE,YAAY,yBAAwB;EACrD,8BAA8B,EAAE,iBAAiB,yBAAwB;EACzE,8HACE,EAAE,iBAAiB,gCAA+B;EACpD,kBAAkB,EAAE,iBAAiB,oCAAmC;EACxE,sBAAsB,EAAE,iBAAiB,gCAA+B;EACxE,yEAAyE,EACvE,iBAAiB,gCAClB;EACD,eAAe;GACb,OAAO;GACP,iBAAiB;GACjB,aAAa;EACd;EACD,wBAAwB;GACtB,OAAO;GACP,iBAAiB;EAClB;EACD,uBAAuB;GACrB,OAAO;GACP,iBAAiB;GACjB,QAAQ;EACT;EACD,cAAc;GACZ,OAAO;GACP,iBAAiB;EAClB;EACD,4BAA4B,EAAE,cAAc,0CAAyC;EACrF,+BAA+B,EAAE,WAAW,0CAAyC;EACrF,eAAe;GACb,OAAO;GACP,iBAAiB;GACjB,QAAQ;GACR,cAAc;EACf;EACD,qDAAqD;GACnD,OAAO;GACP,iBAAiB;EAClB;CACF,CAAA;AACH;AClCA,MAAa,kBAA6D;CACxE,SAAS;EAAE,OAAO;EAAW,MAAM;CAAS;CAC5C,QAAQ;EAAE,OAAO;EAAW,MAAM;CAAS;CAC3C,QAAQ;EAAE,OAAO;EAAW,MAAM;CAAS;CAC3C,SAAS;EAAE,OA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AAA,gBAAA;CAAA,CAAA;CAAf,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAe,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,QAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,WAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,aAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,SAAA;GAAA,QAAA;GAAA,WAAA;EAAA;EAAA,MAAA,EAAA,gBAAA,oBAAA;EAAA,UAAA;EAAA,UC/B5B;EA6EA,QAAA,CAAA,m2CAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AD9Ca,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAe,YAAA,CAAA;EAP3B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAmB,iBAGZ,wBAAwB;GAAM,MACzC,EAAE,OAAO,oBAAmB;GAAE,UAAA;GAAA,QAAA,CAAA,m2CAAA;EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AE5BtC,MAAa,qBAAqB"}
@@ -0,0 +1,5 @@
1
+ {
2
+ "module": "../fesm2022/gravionlabs-helix-code-git.mjs",
3
+ "typings": "../types/gravionlabs-helix-code-git.d.ts",
4
+ "types": "../types/gravionlabs-helix-code-git.d.ts"
5
+ }
package/package.json CHANGED
@@ -1,6 +1,83 @@
1
1
  {
2
+ "description": "Helix code editing for Angular: CodeMirror editor, diff and merge views. Git views in the /git entry.",
3
+ "license": "MIT",
4
+ "keywords": [
5
+ "helix",
6
+ "angular",
7
+ "codemirror",
8
+ "editor",
9
+ "diff"
10
+ ],
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/GravionLabs/helix.git",
14
+ "directory": "projects/code"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "peerDependencies": {
20
+ "@angular/cdk": ">=22",
21
+ "@angular/common": ">=22",
22
+ "@angular/core": ">=22",
23
+ "@angular/forms": ">=22",
24
+ "@codemirror/commands": "^6",
25
+ "@codemirror/language": "^6",
26
+ "@codemirror/language-data": "^6",
27
+ "@codemirror/merge": "^6",
28
+ "@codemirror/search": "^6",
29
+ "@codemirror/state": "^6",
30
+ "@codemirror/view": "^6",
31
+ "@lezer/highlight": "^1"
32
+ },
33
+ "dependencies": {
34
+ "tslib": "^2.3.0"
35
+ },
36
+ "peerDependenciesMeta": {
37
+ "@codemirror/commands": {
38
+ "optional": true
39
+ },
40
+ "@codemirror/language": {
41
+ "optional": true
42
+ },
43
+ "@codemirror/language-data": {
44
+ "optional": true
45
+ },
46
+ "@codemirror/merge": {
47
+ "optional": true
48
+ },
49
+ "@codemirror/search": {
50
+ "optional": true
51
+ },
52
+ "@codemirror/state": {
53
+ "optional": true
54
+ },
55
+ "@codemirror/view": {
56
+ "optional": true
57
+ },
58
+ "@lezer/highlight": {
59
+ "optional": true
60
+ }
61
+ },
2
62
  "name": "@gravionlabs/helix-code",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
63
+ "type": "module",
64
+ "sideEffects": false,
65
+ "main": "./fesm2022/gravionlabs-helix-code.mjs",
66
+ "module": "./fesm2022/gravionlabs-helix-code.mjs",
67
+ "typings": "./types/gravionlabs-helix-code.d.ts",
68
+ "types": "./types/gravionlabs-helix-code.d.ts",
69
+ "exports": {
70
+ ".": {
71
+ "types": "./types/gravionlabs-helix-code.d.ts",
72
+ "default": "./fesm2022/gravionlabs-helix-code.mjs"
73
+ },
74
+ "./git": {
75
+ "types": "./types/gravionlabs-helix-code-git.d.ts",
76
+ "default": "./fesm2022/gravionlabs-helix-code-git.mjs"
77
+ },
78
+ "./package.json": {
79
+ "default": "./package.json"
80
+ }
81
+ },
82
+ "version": "22.8.0"
83
+ }