@pierre/diffs 1.6.1 → 1.6.2
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.
- package/dist/components/File.d.ts.map +1 -1
- package/dist/components/File.js +3 -4
- package/dist/components/File.js.map +1 -1
- package/dist/components/FileDiff.d.ts.map +1 -1
- package/dist/components/FileDiff.js +3 -4
- package/dist/components/FileDiff.js.map +1 -1
- package/dist/editor/editor2.js +1 -1
- package/dist/editor/editor2.js.map +1 -1
- package/dist/editor/searchPanel.d.ts.map +1 -1
- package/dist/editor/searchPanel.js +15 -0
- package/dist/editor/searchPanel.js.map +1 -1
- package/dist/editor/sprite.d.ts +2 -2
- package/dist/editor/sprite.d.ts.map +1 -1
- package/dist/editor/sprite.js +3 -0
- package/dist/editor/sprite.js.map +1 -1
- package/dist/utils/setDeferredArrayItem.d.ts +3 -1
- package/dist/utils/setDeferredArrayItem.d.ts.map +1 -1
- package/dist/utils/setDeferredArrayItem.js +6 -5
- package/dist/utils/setDeferredArrayItem.js.map +1 -1
- package/dist/worker/hastLinesTransport.js +1 -1
- package/dist/worker/hastLinesTransport.js.map +1 -1
- package/dist/worker/worker-portable.js +3 -3
- package/dist/worker/worker-portable.js.map +1 -1
- package/dist/worker/worker.js +6 -5
- package/dist/worker/worker.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"File.d.ts","names":[],"sources":["../../src/components/File.ts"],"mappings":";;;;;;;;;;UA8FiB,gBAAgB;EAC/B,MAAM;EACN,gBAAgB;EAChB,mBAAmB;EACnB;EACA;EACA;EACA,kBAAkB,eAAe;EACjC,cAAc;;UAGC,iBAAiB,qBAAqB,KACrD,gBAAgB;EAGhB,eAAe;EACf;;KAGU,sBAAsB,aAAa,UAC7C,OAAO,0BAA0B,aAAa;;;;;;;;;KAWpC,wBAAwB,aAAa,UAC/C,OAAO,sBAAsB,aAAa,WACvC;UAEY,YAAY,aAAa,eAChC,iBA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ACf;YAkDQ,iBACR,MACA,mBACC,eAAe;EAoBX,qBACL,OAAM;YAOE,cAAc,aAAa;UAM7B;;EAuDD;;EAOA,qBACL,OAAO,0BAA0B,aAAa;EAQzC,eACL,OAAO,0BAA0B,aAAa;;EAOzC;;EAKA,eACL,QAAQ,eAAe,aAAa;;EAoB/B,eAAe,QAAQ,eAAe,aAAa;UAOlD;;;;;;;;;;;;;;;EAiDD,sBACL,QAAQ,eAAe,aAAa,QACpC;UAKM;EAwFD,oBACL,cAAc,qBAAqB,cACnC,qBAAqB,eAAe;;EAgB/B,6BACL,cAAc,qBAAqB,cACnC,qBAAqB,eAAe;EAS/B,kBACL,YAAY,YAAY,MAAM,oBAC9B,6BACA;IACE;;EAiBG,SACL,MACA,eACA,aACA,aACA,kBACA,eACA,iBACA,eACC,gBAAgB;YAwMT;UAEF;UA2BA;UAmBA;UAUA;EAWD,kBAAkB;YAkBf,qBAAqB;EAQlB,oBACX,OAAM,2BACL;UA4BK;UA0CA;UA+CA;UAqBA;UAkCA;UAqDA;YAeE;UAIF;UA6BA;UA6GA;UAcA;UA2BA;UA8CA;UASA;YAiDE;UAIF;UA4EA;UAYA;UAkBA;UAYA;YAME,6BACR,gBAAgB,aAChB,aAAa,cACZ;UAmCK;UAyBA;UAgBA;UAwBA;UAaA;UAqBA;UAqBA"}
|
package/dist/components/File.js
CHANGED
|
@@ -316,6 +316,7 @@ var File = class {
|
|
|
316
316
|
this.pendingData = void 0;
|
|
317
317
|
}
|
|
318
318
|
this.clearAuxiliaryNodes();
|
|
319
|
+
this.pre?.remove();
|
|
319
320
|
this.pre = void 0;
|
|
320
321
|
this.code = void 0;
|
|
321
322
|
this.bufferBefore?.remove();
|
|
@@ -324,11 +325,9 @@ var File = class {
|
|
|
324
325
|
this.bufferAfter = void 0;
|
|
325
326
|
this.appliedPreAttributes = void 0;
|
|
326
327
|
this.lastRowCount = void 0;
|
|
328
|
+
this.headerElement?.remove();
|
|
327
329
|
this.headerElement = void 0;
|
|
328
|
-
this.
|
|
329
|
-
this.headerFilenameSuffix = void 0;
|
|
330
|
-
this.headerMetadata = void 0;
|
|
331
|
-
this.headerCustom = void 0;
|
|
330
|
+
this.clearHeaderSlots();
|
|
332
331
|
this.lastRenderedHeaderHTML = void 0;
|
|
333
332
|
if (!recycle) this.cachedHeaderHTML = void 0;
|
|
334
333
|
this.errorWrapper?.remove();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"File.js","names":[],"sources":["../../src/components/File.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport {\n CUSTOM_HEADER_SLOT_ID,\n DEFAULT_THEMES,\n DEFAULT_TOKENIZE_MAX_LENGTH,\n DIFFS_TAG_NAME,\n EMPTY_LINE_ANNOTATIONS,\n EMPTY_RENDER_RANGE,\n HEADER_FILENAME_SUFFIX_SLOT_ID,\n HEADER_METADATA_SLOT_ID,\n HEADER_PREFIX_SLOT_ID,\n THEME_CSS_ATTRIBUTE,\n UNSAFE_CSS_ATTRIBUTE,\n} from '../constants';\nimport type { Editor } from '../editor/editor';\nimport type { TextDocument } from '../editor/textDocument';\nimport type {\n EditCompletionDecision,\n EditorActiveLineOptions,\n EditorChangeEvent,\n FileEditCompleteEvent,\n} from '../editor/types';\nimport {\n type GetHoveredLineResult,\n InteractionManager,\n type InteractionManagerBaseOptions,\n pluckInteractionOptions,\n type SelectionWriteOptions,\n} from '../managers/InteractionManager';\nimport { ResizeManager } from '../managers/ResizeManager';\nimport { FileRenderer, type FileRenderResult } from '../renderers/FileRenderer';\nimport { SVGSpriteSheet } from '../sprite';\nexport type { FileEditCompleteEvent } from '../editor/types';\nimport {\n getHighlighterIfLoaded,\n getSharedHighlighter,\n HighlighterDisposedError,\n} from '../highlighter/shared_highlighter';\nimport type {\n AppliedThemeStyleCache,\n BaseCodeOptions,\n DiffLineAnnotation,\n DiffsHighlighter,\n FileContents,\n HighlightedToken,\n LineAnnotation,\n PostRenderPhase,\n PrePropertiesConfig,\n RenderFileMetadata,\n RenderRange,\n SelectedLineRange,\n ThemeTypes,\n} from '../types';\nimport { areFileTargetsEqual } from '../utils/areFileTargetsEqual';\nimport { areLineAnnotationsEqual } from '../utils/areLineAnnotationsEqual';\nimport { arePrePropertiesEqual } from '../utils/arePrePropertiesEqual';\nimport { areRenderRangesEqual } from '../utils/areRenderRangesEqual';\nimport { areThemesEqual } from '../utils/areThemesEqual';\nimport { createAnnotationWrapperNode } from '../utils/createAnnotationWrapperNode';\nimport { createGutterUtilityContentNode } from '../utils/createGutterUtilityContentNode';\nimport { createUnsafeCSSStyleNode } from '../utils/createUnsafeCSSStyleNode';\nimport {\n patchScrollbarGutterSize,\n wrapThemeCSS,\n wrapUnsafeCSS,\n} from '../utils/cssWrappers';\nimport {\n adoptEditSessionAnnotations,\n type EditSessionAnnotations,\n resolveEditSessionSlotName,\n writeEditSessionAnnotations,\n} from '../utils/editSessionAnnotations';\nimport { getFileRendererOptions } from '../utils/getFileRendererOptions';\nimport { getFiletypeFromFileName } from '../utils/getFiletypeFromFileName';\nimport { getLineAnnotationName } from '../utils/getLineAnnotationName';\nimport { getOrCreateCodeNode } from '../utils/getOrCreateCodeNode';\nimport { getThemes } from '../utils/getThemes';\nimport { guardWebKitScrollDuringRebuild } from '../utils/guardWebKitScrollDuringRebuild';\nimport { hastToHtml } from '../utils/hastToHtml';\nimport { upsertHostThemeStyle } from '../utils/hostTheme';\nimport { isFilePlainText } from '../utils/isFilePlainText';\nimport { isStyleNode } from '../utils/isStyleNode';\nimport { isSafari } from '../utils/platform';\nimport { prerenderHTMLIfNecessary } from '../utils/prerenderHTMLIfNecessary';\nimport { resolvePreferredHighlighter } from '../utils/resolvePreferredHighlighter';\nimport { getMeasuredScrollbarGutter } from '../utils/scrollbarGutter';\nimport { setPreNodeProperties } from '../utils/setWrapperNodeProps';\nimport type { WorkerPoolManager } from '../worker';\nimport { isHandledWorkerPoolError } from '../worker/errors';\nimport { DiffsContainerLoaded } from './web-components';\n\nconst EMPTY_STRINGS: string[] = [''];\n\nexport interface FileRenderProps<LAnnotation> {\n file: FileContents;\n fileContainer?: HTMLElement;\n containerWrapper?: HTMLElement;\n deferManagers?: boolean;\n forceRender?: boolean;\n preventEmit?: boolean;\n lineAnnotations?: LineAnnotation<LAnnotation>[];\n renderRange?: RenderRange;\n}\n\nexport interface FileHydrateProps<LAnnotation> extends Omit<\n FileRenderProps<LAnnotation>,\n 'fileContainer'\n> {\n fileContainer: HTMLElement;\n prerenderedHTML?: string;\n}\n\nexport type FileEditChangeHandler<LAnnotation, Caret> = (\n event: EditorChangeEvent<'file', LAnnotation, Caret>\n) => void;\n\n/**\n * Decides a completed edit synchronously: return `'accept'` to install the\n * event's `file` and annotations, or `'reject'` to restore the original values.\n * The event is frozen, so re-key the accepted file in place\n * (`event.file.cacheKey = '…'`) before accepting. The event's editor is\n * detached and returns its final state from `getViewState()`. A missing handler\n * rejects.\n */\nexport type FileEditCompleteHandler<LAnnotation, Caret> = (\n event: FileEditCompleteEvent<LAnnotation, Caret>\n) => EditCompletionDecision;\n\nexport interface FileOptions<LAnnotation, Caret>\n extends BaseCodeOptions, InteractionManagerBaseOptions<'file'> {\n disableFileHeader?: boolean;\n renderHeaderPrefix?: RenderFileMetadata;\n renderHeaderFilenameSuffix?: RenderFileMetadata;\n renderHeaderMetadata?: RenderFileMetadata;\n renderCustomHeader?: RenderFileMetadata;\n /**\n * When true, errors during rendering are rethrown instead of being caught\n * and displayed in the DOM. Useful for testing or when you want to handle\n * errors yourself.\n */\n disableErrorHandling?: boolean;\n /** Receives the matching file, including any editor changes. */\n renderAnnotation?(\n annotation: LineAnnotation<LAnnotation>,\n file: FileContents\n ): HTMLElement | undefined;\n renderGutterUtility?(\n getHoveredRow: () => GetHoveredLineResult<'file'> | undefined\n ): HTMLElement | null | undefined;\n\n onPostRender?(\n node: HTMLElement,\n instance: File<LAnnotation, Caret>,\n phase: PostRenderPhase\n ): unknown;\n\n /**\n * Fired for every document change of an active edit session on this\n * component, with the same `EditorChangeEvent` the editor reports through\n * its own `onChange`. Do not feed the event's file back into the component\n * while the session is active.\n */\n onEditChange?: FileEditChangeHandler<LAnnotation, Caret>;\n\n /**\n * Fired when `edit` toggles false or a component unmounts, including when the\n * final contents are unchanged. If no callback is provided, the component\n * reverts to the last `file` and annotations passed into it. The callback\n * receives the detached editor with its final pre-detach state.\n */\n onEditComplete?: FileEditCompleteHandler<LAnnotation, Caret>;\n}\n\ninterface AnnotationElementCache<LAnnotation> {\n element: HTMLElement;\n annotation: LineAnnotation<LAnnotation>;\n file: FileContents;\n}\n\ninterface ColumnElements {\n gutter: HTMLElement;\n content: HTMLElement;\n}\n\ninterface HydrationSetup<LAnnotation> {\n file: FileContents;\n lineAnnotations: LineAnnotation<LAnnotation>[] | undefined;\n}\n\nexport interface FileRenderData<LAnnotation> {\n file: FileContents;\n lineAnnotations: LineAnnotation<LAnnotation>[];\n}\n\nexport interface FileRenderInput<LAnnotation> {\n file: FileContents;\n lineAnnotations: LineAnnotation<LAnnotation>[] | undefined;\n}\n\ninterface EditSession<LAnnotation> {\n // Editable copy of the file. Changes in the editor are written here.\n file: FileContents;\n // Latest input, kept separately so rejecting edits can restore it.\n // Basically the original version of the FileContents before the edit took\n // place\n inputFile: FileContents;\n annotations: EditSessionAnnotations<LineAnnotation<LAnnotation>> | undefined;\n /*\n * `externalReplacement` records that the host swapped in a new file\n * mid-session, so the next sync tells the editor to adopt `file` over its\n * own document\n */\n externalReplacement: boolean;\n}\n\nfunction createEditSessionFile(file: FileContents): FileContents {\n const editSessionFile = { ...file };\n delete editSessionFile.cacheKey;\n return editSessionFile;\n}\n\nlet instanceId = -1;\n\nexport class File<LAnnotation = undefined, Caret = undefined> {\n static LoadedCustomComponent: boolean = DiffsContainerLoaded;\n\n readonly __id: string = `file:${++instanceId}`;\n readonly type = 'file';\n\n protected fileContainer: HTMLElement | undefined;\n protected spriteSVG: SVGElement | undefined;\n protected pre: HTMLPreElement | undefined;\n protected code: HTMLElement | undefined;\n protected bufferBefore: HTMLElement | undefined;\n protected bufferAfter: HTMLElement | undefined;\n protected themeCSSStyle: HTMLStyleElement | undefined;\n protected appliedThemeCSS: AppliedThemeStyleCache | undefined;\n protected hasAdoptedThemeCSS = false;\n protected unsafeCSSStyle: HTMLStyleElement | undefined;\n protected appliedUnsafeCSS: string | undefined;\n protected gutterUtilityContent: HTMLElement | undefined;\n protected errorWrapper: HTMLElement | undefined;\n protected placeHolder: HTMLElement | undefined;\n protected lastRenderedHeaderHTML: string | undefined;\n protected cachedHeaderHTML: string | undefined;\n protected appliedPreAttributes: PrePropertiesConfig | undefined;\n protected lastRowCount: number | undefined;\n private mounted = false;\n\n protected headerElement: HTMLElement | undefined;\n protected headerCustom: HTMLElement | undefined;\n protected headerPrefix: HTMLElement | undefined;\n protected headerFilenameSuffix: HTMLElement | undefined;\n protected headerMetadata: HTMLElement | undefined;\n\n protected fileRenderer: FileRenderer<LAnnotation>;\n protected resizeManager: ResizeManager;\n protected interactionManager: InteractionManager<'file'>;\n\n protected annotationCache: Map<string, AnnotationElementCache<LAnnotation>> =\n new Map();\n // Annotations for the displayed file, stored with that file in renderedData.\n protected get lineAnnotations(): LineAnnotation<LAnnotation>[] {\n return this.renderedData?.lineAnnotations ?? EMPTY_LINE_ANNOTATIONS;\n }\n protected managersDirty = false;\n\n // Latest input. Editor changes are kept in the private edit session.\n public file: FileContents | undefined;\n private editSession: EditSession<LAnnotation> | undefined;\n // File and annotations currently displayed. Absent until a file is rendered.\n private renderedData: FileRenderData<LAnnotation> | undefined;\n // Keep the next file and its annotations together until that file renders.\n private pendingData: FileRenderData<LAnnotation> | undefined;\n // Forces the next render() call, such as the one the owner makes after\n // requestOwnerRender.\n protected forceRenderOverride: true | undefined;\n protected renderRange: RenderRange | undefined;\n protected enabled = true;\n\n protected editor: Editor<'file', LAnnotation, Caret> | undefined;\n\n constructor(\n public options: FileOptions<LAnnotation, Caret> = {\n theme: DEFAULT_THEMES,\n },\n private workerManager?: WorkerPoolManager | undefined,\n // Set when an owner such as React manages the container. Internal renders\n // call it, and the owner must call render().\n private requestOwnerRender?: () => void\n ) {\n this.fileRenderer = new FileRenderer<LAnnotation>(\n options,\n this.getAnnotationSlotName,\n this.handleHighlightRender,\n this.workerManager\n );\n this.resizeManager = new ResizeManager();\n this.interactionManager = new InteractionManager(\n 'file',\n pluckInteractionOptions(options)\n );\n this.workerManager?.subscribeToThemeChanges(this);\n }\n\n public getAnnotationSlotName = (\n annotation: LineAnnotation<LAnnotation> | DiffLineAnnotation<LAnnotation>\n ): string => {\n return resolveEditSessionSlotName(\n this.editSession?.annotations,\n annotation,\n getLineAnnotationName\n );\n };\n\n private handleHighlightRender = (): void => {\n this.rerender();\n };\n\n public rerender(): void {\n const file = this.getInputFile();\n if (!this.enabled || file == null) return;\n if (this.requestRender()) return;\n this.render({\n file,\n forceRender: true,\n renderRange: this.renderRange,\n });\n }\n\n // Editors update their rows directly. Other internal renders can be driven\n // by the owner, so React updates its children before calling render().\n protected requestRender(): boolean {\n const { requestOwnerRender } = this;\n if (this.editSession != null || requestOwnerRender == null) {\n return false;\n }\n this.forceRenderOverride = true;\n requestOwnerRender();\n return true;\n }\n\n protected get isComponentManaged(): boolean {\n return this.requestOwnerRender != null;\n }\n\n private getTheme() {\n return (\n this.workerManager?.getFileRenderOptions().theme ??\n this.options.theme ??\n DEFAULT_THEMES\n );\n }\n\n // Return the latest input without editor changes. It may be newer than the\n // displayed file while a replacement is being highlighted.\n protected getInputFile(): FileContents | undefined {\n return this.file;\n }\n\n // Return the editor's copy, including its changes, or the input when there\n // is no edit session. Use fallbackFile if the new input is not stored yet.\n protected getWorkingFile(\n fallbackFile: FileContents | undefined = this.file\n ): FileContents | undefined {\n return this.editSession?.file ?? fallbackFile;\n }\n\n // Return the displayed file. While a replacement is being highlighted, this\n // still returns the previous file.\n protected getRenderedFile(): FileContents | undefined {\n return this.renderedData?.file;\n }\n\n /**\n * @internal Data the next render() with this input will display. While a\n * replacement file is being highlighted, this is still the displayed data.\n */\n public __getNextRenderData({\n file,\n lineAnnotations,\n }: FileRenderInput<LAnnotation>): FileRenderData<LAnnotation> {\n const sessionAnnotations = this.editSession?.annotations;\n // Keep the supplied content during editing. The editor moves annotation\n // rows through stable slots without rerendering their React children.\n if (sessionAnnotations != null) {\n return {\n file,\n lineAnnotations:\n lineAnnotations != null && this.isNewAnnotations(lineAnnotations)\n ? lineAnnotations\n : sessionAnnotations.provided,\n };\n }\n const workingFile = this.getWorkingFile(file) ?? file;\n const nextFile = this.fileRenderer.getFileForNextRender(workingFile);\n return {\n file: nextFile,\n lineAnnotations:\n lineAnnotations != null && areFileTargetsEqual(nextFile, workingFile)\n ? lineAnnotations\n : this.getAnnotationsForFile(nextFile),\n };\n }\n\n // Return the working file's annotations, including updates that have not\n // rendered yet.\n protected getLatestAnnotations(): LineAnnotation<LAnnotation>[] {\n return (\n this.pendingData?.lineAnnotations ??\n this.editSession?.annotations?.current ??\n this.lineAnnotations\n );\n }\n\n // Use pending annotations only when their file is selected for rendering.\n protected getAnnotationsForFile(\n file: FileContents\n ): LineAnnotation<LAnnotation>[] {\n const { pendingData } = this;\n return pendingData != null && areFileTargetsEqual(file, pendingData.file)\n ? pendingData.lineAnnotations\n : this.lineAnnotations;\n }\n\n // Update the displayed file and its annotations together after rendering. If\n // highlighting keeps the previous file displayed, leave the next pair queued\n // in pendingData.\n private adoptRenderData(file: FileContents): void {\n const { pendingData } = this;\n const matchesPending =\n pendingData != null && areFileTargetsEqual(file, pendingData.file);\n this.renderedData = {\n file,\n lineAnnotations: matchesPending\n ? pendingData.lineAnnotations\n : this.lineAnnotations,\n };\n if (matchesPending) {\n this.pendingData = undefined;\n }\n }\n\n // Check whether the annotation array is new. Reusing a tracked array must\n // not reset positions moved by editing.\n protected isNewAnnotations(\n lineAnnotations: LineAnnotation<LAnnotation>[]\n ): boolean {\n const session = this.editSession?.annotations;\n const latestAnnotations = this.getLatestAnnotations();\n if (lineAnnotations === latestAnnotations) {\n return false;\n }\n return (\n session == null ||\n (lineAnnotations !== session.provided &&\n lineAnnotations !== session.current)\n );\n }\n\n // Store a new input and create its editable copy if an editor is attached.\n // The next editor sync decides whether to keep or reset undo history. Return\n // false if the input has not changed.\n protected updateInputFile(\n incomingFile: FileContents,\n lineAnnotations?: LineAnnotation<LAnnotation>[]\n ): boolean {\n if (areFileTargetsEqual(this.getInputFile(), incomingFile)) {\n return false;\n }\n\n const hadSession = this.editSession != null;\n const previousAnnotations = this.getLatestAnnotations();\n this.file = incomingFile;\n\n if (hadSession || this.editor != null) {\n this.installEditSession(\n incomingFile,\n hadSession\n ? undefined\n : this.editor?.__getDocumentContents(incomingFile),\n true\n );\n } else {\n this.editSession = undefined;\n }\n if (this.editSession?.annotations != null && lineAnnotations != null) {\n // These annotations arrived with the new file, so their line numbers\n // describe it. The positions the session tracked for the old document\n // mean nothing now: the session restarts from these annotations, and\n // they also become what renders once the session ends.\n this.editSession.annotations = adoptEditSessionAnnotations(\n lineAnnotations,\n getLineAnnotationName,\n this.editSession.annotations\n );\n }\n this.pendingData = {\n file: this.editSession?.file ?? incomingFile,\n lineAnnotations:\n this.editSession?.annotations?.current ??\n lineAnnotations ??\n previousAnnotations,\n };\n return true;\n }\n\n // Create an editable copy of inputFile. When reopening a saved document,\n // retainedDocument supplies its edited text instead. Keep tracked\n // annotations if a session already exists.\n //\n // hostReplacement tells the next sync to replace the editor's text when\n // the editable copy uses the new input text.\n private installEditSession(\n inputFile: FileContents,\n retainedDocument?: FileContents,\n hostReplacement = false\n ): void {\n const usesInputDocument =\n retainedDocument == null ||\n (retainedDocument.name === inputFile.name &&\n retainedDocument.lang === inputFile.lang &&\n retainedDocument.contents === inputFile.contents);\n const file = createEditSessionFile(retainedDocument ?? inputFile);\n // Seed annotations on first attach so a later external replacement can\n // restart their positions. A live session keeps its current collection.\n const annotations =\n this.editSession?.annotations ??\n adoptEditSessionAnnotations(\n this.getLatestAnnotations(),\n getLineAnnotationName\n );\n this.editSession = {\n file,\n inputFile,\n externalReplacement: hostReplacement && usesInputDocument,\n annotations,\n };\n this.pendingData = {\n file,\n lineAnnotations: annotations.current,\n };\n this.fileRenderer.beginEditSession(\n file,\n usesInputDocument ? inputFile : undefined\n );\n }\n\n public onThemeChange(): void {\n this.fileRenderer.clearRenderCache();\n this.rerender();\n }\n\n public setOptions(\n options: FileOptions<LAnnotation, Caret> | undefined\n ): void {\n if (options == null) return;\n this.options = options;\n this.cachedHeaderHTML = undefined;\n this.syncInteractionOptions();\n }\n\n protected syncInteractionOptions(): void {\n this.interactionManager.setOptions(pluckInteractionOptions(this.options));\n }\n\n private mergeOptions(\n options: Partial<FileOptions<LAnnotation, Caret>>\n ): void {\n this.options = { ...this.options, ...options };\n }\n\n public setThemeType(themeType: ThemeTypes): void {\n if ((this.options.themeType ?? 'system') === themeType) {\n return;\n }\n this.mergeOptions({ themeType });\n this.applyCachedThemeState(themeType);\n }\n\n private applyCachedThemeState(themeType: ThemeTypes): boolean {\n if (\n typeof this.options.theme === 'string' ||\n this.fileContainer == null ||\n this.appliedThemeCSS == null\n ) {\n return false;\n }\n const effectiveThemeType = this.appliedThemeCSS.baseThemeType ?? themeType;\n if (this.appliedThemeCSS.themeType === effectiveThemeType) {\n return false;\n }\n this.applyThemeState(\n this.fileContainer,\n this.appliedThemeCSS.themeStyles,\n themeType,\n this.appliedThemeCSS.baseThemeType\n );\n return true;\n }\n\n private hasThemeChanged(): boolean {\n return (\n this.appliedThemeCSS != null &&\n !areThemesEqual(this.appliedThemeCSS.theme, this.getTheme())\n );\n }\n\n public getHoveredLine = (): GetHoveredLineResult<'file'> | undefined => {\n return this.interactionManager.getHoveredLine();\n };\n\n public setLineAnnotations(\n lineAnnotations: LineAnnotation<LAnnotation>[]\n ): void {\n const sessionAnnotations = this.editSession?.annotations;\n if (sessionAnnotations != null) {\n if (!this.isNewAnnotations(lineAnnotations)) {\n return;\n }\n // Keep the caller's collection for completion and revert; editing can\n // remap the displayed collection without changing this baseline.\n writeEditSessionAnnotations(\n sessionAnnotations,\n lineAnnotations,\n getLineAnnotationName\n );\n }\n const file = this.getWorkingFile();\n if (file != null) {\n this.pendingData = { file, lineAnnotations };\n }\n }\n\n // Takes annotations the editor remapped and makes them what the session\n // renders: updates the session, feeds the renderer, and re-renders\n // annotation rows. Returns true when new annotations were adopted —\n // virtualized subclasses override this and refresh their layout on true.\n //\n // The editor delivers annotations through two calls. An edit that changes\n // the line count sends them with the structural rebuild\n // (applyDocumentChange) and again with the change event (__acceptEditorChange);\n // the identity check makes the second call a no-op. An edit that keeps the\n // line count skips the rebuild, so the event is its only path here.\n //\n // The annotations the caller passed in are never touched — stale\n // re-renders keep deduping against them.\n protected syncEditSessionAnnotationsFromEditor(\n lineAnnotations: LineAnnotation<LAnnotation>[]\n ): boolean {\n const session = this.editSession?.annotations;\n if (session == null || lineAnnotations === session.current) {\n return false;\n }\n session.current = lineAnnotations;\n if (this.renderedData != null) {\n this.renderedData.lineAnnotations = lineAnnotations;\n }\n this.pendingData = undefined;\n this.fileRenderer.setLineAnnotations(lineAnnotations);\n this.renderAnnotations();\n return true;\n }\n\n public setSelectedLines(\n range: SelectedLineRange | null,\n options?: SelectionWriteOptions\n ): void {\n this.interactionManager.setSelection(range, options);\n }\n\n public setEditorActiveLine(\n lineNumber: number | null,\n options?: EditorActiveLineOptions\n ): void {\n this.interactionManager.setEditorActiveLine(lineNumber, {\n lineNumberOnly: options?.lineNumberOnly,\n side: options?.side ?? 'additions',\n });\n }\n\n public getCodeScrollLeft(): number {\n return this.code?.scrollLeft ?? 0;\n }\n\n public setCodeScrollLeft(position: number): void {\n if (this.code != null) {\n this.code.scrollLeft = position;\n }\n }\n\n public __getEffectiveCodeOptions(): BaseCodeOptions {\n return { ...this.options, ...this.fileRenderer.getEffectiveCodeOptions() };\n }\n\n public flushManagers(): void {\n if (!this.managersDirty || this.pre == null) {\n this.managersDirty = false;\n return;\n }\n\n const { overflow = 'scroll' } = this.options;\n this.interactionManager.setup(this.pre);\n this.resizeManager.setup(this.pre, {\n disableAnnotations: overflow === 'wrap',\n columnVariables: this.shouldApplyColumnVariables(overflow)\n ? 'apply'\n : 'measure',\n });\n this.managersDirty = false;\n }\n\n protected shouldApplyColumnVariables(overflow: 'scroll' | 'wrap'): boolean {\n return overflow === 'scroll' && this.lineAnnotations.length > 0;\n }\n\n public cleanUp(recycle = false): void {\n const editor = this.editor;\n this.emitPostRender(true);\n // Tear the editor down while the code scroller still exists. A recycle\n // keeps its document and undo history; a full teardown drops them as the\n // session ends.\n editor?.cleanUp(recycle ? 'recycle' : 'discard');\n if (!recycle) {\n this.editor = undefined;\n }\n this.resizeManager.cleanUp();\n this.interactionManager.cleanUp();\n this.managersDirty = false;\n this.workerManager?.unsubscribeToThemeChanges(this);\n this.renderRange = undefined;\n\n // Clean up the elements\n if (!this.isComponentManaged) {\n this.fileContainer?.remove();\n }\n this.fileContainer = undefined;\n this.mounted = false;\n if (!recycle) {\n this.renderedData = undefined;\n this.pendingData = undefined;\n }\n this.clearAuxiliaryNodes();\n this.pre = undefined;\n this.code = undefined;\n this.bufferBefore?.remove();\n this.bufferBefore = undefined;\n this.bufferAfter?.remove();\n this.bufferAfter = undefined;\n this.appliedPreAttributes = undefined;\n this.lastRowCount = undefined;\n this.headerElement = undefined;\n this.headerPrefix = undefined;\n this.headerFilenameSuffix = undefined;\n this.headerMetadata = undefined;\n this.headerCustom = undefined;\n this.lastRenderedHeaderHTML = undefined;\n if (!recycle) {\n this.cachedHeaderHTML = undefined;\n }\n this.errorWrapper?.remove();\n this.errorWrapper = undefined;\n this.spriteSVG = undefined;\n this.themeCSSStyle = undefined;\n this.appliedThemeCSS = undefined;\n this.hasAdoptedThemeCSS = false;\n this.unsafeCSSStyle = undefined;\n this.appliedUnsafeCSS = undefined;\n this.placeHolder?.remove();\n this.placeHolder = undefined;\n\n if (recycle) {\n this.fileRenderer.recycle();\n } else {\n this.fileRenderer.cleanUp();\n this.workerManager = undefined;\n this.file = undefined;\n this.editSession = undefined;\n }\n this.enabled = false;\n }\n\n public virtualizedSetup(): void {\n this.enabled = true;\n this.workerManager?.subscribeToThemeChanges(this);\n }\n\n public hydrate(props: FileHydrateProps<LAnnotation>): void {\n const {\n fileContainer,\n prerenderedHTML,\n preventEmit = false,\n file,\n lineAnnotations,\n } = props;\n if (!this.enabled) {\n throw new Error(\n 'File.hydrate: attempting to call hydrate after cleaned up'\n );\n }\n if (this.fileContainer != null) {\n throw new Error(\n 'File.hydrate: hydrate can only be called before the instance has rendered or hydrated'\n );\n }\n this.hydrateElements(fileContainer, prerenderedHTML);\n // An editor attached before hydration may carry a retained keyed document.\n // Render through the private edit session instead of adopting external\n // markup, so the restored document owns the first hydrated paint.\n const forceEditorRender = this.editor != null;\n if (\n forceEditorRender ||\n shouldRenderCode(this.pre, file, this.options.collapsed) ||\n shouldRenderHeader(\n this.headerElement,\n file,\n this.options.disableFileHeader\n )\n ) {\n this.render({\n ...props,\n forceRender: forceEditorRender || props.forceRender,\n preventEmit: true,\n });\n }\n // Otherwise orchestrate our setup.\n else {\n this.hydrationSetup({ file, lineAnnotations });\n }\n if (!preventEmit) {\n this.emitPostRender();\n }\n }\n\n protected hydrateElements(\n fileContainer: HTMLElement,\n prerenderedHTML: string | undefined\n ): void {\n if (this.fileContainer !== fileContainer) {\n this.emitPostRender(true);\n }\n prerenderHTMLIfNecessary(fileContainer, prerenderedHTML);\n for (const element of Array.from(\n fileContainer.shadowRoot?.children ?? []\n )) {\n if (element instanceof SVGElement) {\n this.spriteSVG = element;\n continue;\n }\n if (!(element instanceof HTMLElement)) {\n continue;\n }\n if (element instanceof HTMLPreElement) {\n this.pre = element;\n this.appliedPreAttributes = undefined;\n continue;\n }\n if (\n element instanceof HTMLStyleElement &&\n element.hasAttribute(THEME_CSS_ATTRIBUTE)\n ) {\n this.themeCSSStyle = element;\n continue;\n }\n if (\n element instanceof HTMLStyleElement &&\n element.hasAttribute(UNSAFE_CSS_ATTRIBUTE)\n ) {\n this.unsafeCSSStyle = element;\n this.appliedUnsafeCSS = element.textContent;\n continue;\n }\n if ('diffsHeader' in element.dataset) {\n this.headerElement = element;\n this.lastRenderedHeaderHTML = undefined;\n continue;\n }\n }\n if (this.pre != null) {\n this.syncCodeNodeFromPre(this.pre);\n this.pre.removeAttribute('data-dehydrated');\n }\n this.fileContainer = fileContainer;\n this.hydrateMeasuredScrollbar();\n }\n\n protected hydrationSetup({\n file,\n lineAnnotations,\n }: HydrationSetup<LAnnotation>): void {\n this.renderedData = {\n file,\n lineAnnotations: lineAnnotations ?? this.getLatestAnnotations(),\n };\n this.pendingData = undefined;\n this.file = file;\n this.fileRenderer.setOptions(getFileRendererOptions(this.options));\n this.syncInteractionOptions();\n if (this.pre == null) {\n return;\n }\n this.fileRenderer.hydrate(file);\n this.renderAnnotations();\n this.renderGutterUtility();\n this.injectUnsafeCSS();\n this.managersDirty = true;\n this.flushManagers();\n }\n\n public getOrCreateLineCache(\n file: FileContents | undefined = this.getWorkingFile()\n ): string[] {\n return file != null\n ? this.fileRenderer.getOrCreateLineCache(file)\n : EMPTY_STRINGS;\n }\n\n protected updateBuffers(renderRange: RenderRange): void {\n if (this.pre != null) {\n this.applyBuffers(this.pre, renderRange);\n }\n }\n\n private syncRenderViewToEditor(): void {\n const { editor, fileContainer, renderRange } = this;\n const lineAnnotations = this.getLatestAnnotations();\n const file = this.getWorkingFile();\n if (editor == null || fileContainer == null || file == null) {\n return;\n }\n const syncEditor = (highlighter: DiffsHighlighter): void => {\n if (\n !this.enabled ||\n this.editor !== editor ||\n this.fileContainer !== fileContainer ||\n this.getWorkingFile() !== file\n ) {\n return;\n }\n editor.__syncRenderView({\n highlighter,\n fileContainer,\n file,\n lineAnnotations,\n renderRange,\n externalDocument: this.editSession?.externalReplacement === true,\n });\n };\n\n const theme = this.getTheme();\n const lang = file.lang ?? getFiletypeFromFileName(file.name);\n // Sync editor synchronously whenever the shared highlighter is ready;\n // otherwise load it and sync once it resolves.\n const highlighter = getHighlighterIfLoaded({\n theme,\n lang,\n });\n if (highlighter != null) {\n syncEditor(highlighter);\n } else {\n void getSharedHighlighter({\n themes: getThemes(theme),\n langs: Array.from(new Set(['text', lang])),\n preferredHighlighter: resolvePreferredHighlighter(\n this.workerManager,\n this.options\n ),\n })\n .then(syncEditor)\n .catch((error: unknown) => {\n if (!(error instanceof HighlighterDisposedError)) {\n console.error(error);\n }\n });\n }\n }\n\n /** @internal The editor applied or edited past the pending external replacement. */\n public __acknowledgeDocumentUpdate(): void {\n if (this.editSession != null) {\n this.editSession.externalReplacement = false;\n }\n }\n\n /** @internal Settle annotations */\n public __acceptEditorChange(\n event: EditorChangeEvent<'file', LAnnotation, Caret>\n ): void {\n const { lineAnnotations } = event;\n if (lineAnnotations != null) {\n this.syncEditSessionAnnotationsFromEditor(lineAnnotations);\n }\n }\n\n public emitEditChange(\n event: EditorChangeEvent<'file', LAnnotation, Caret>\n ): void {\n const { onEditChange } = this.options;\n onEditChange?.(event);\n }\n\n /** @internal Plain files have no component-owned diff session state. */\n public __captureDocumentSessionState(): undefined {\n return undefined;\n }\n\n /** @internal Associate this component with its editor for a render lifecycle. */\n public __attachEditor(\n editor: Editor<'file', LAnnotation, Caret>\n ): () => void {\n if (this.editor != null) {\n throw new Error('File.__attachEditor: an editor is already attached');\n }\n this.editor = editor;\n const detach = () => {\n this.editor = undefined;\n this.fileRenderer.endEditSession();\n };\n try {\n this.resumeEditorRendering(editor);\n return detach;\n } catch (error) {\n detach();\n throw error;\n }\n }\n\n /** @internal Resume rendering for the editor already associated with this component. */\n public __resumeEditor(editor: Editor<'file', LAnnotation, Caret>): void {\n if (this.editor !== editor) {\n throw new Error('File.__resumeEditor: editor association changed');\n }\n this.resumeEditorRendering(editor);\n }\n\n private resumeEditorRendering(\n editor: Editor<'file', LAnnotation, Caret>\n ): void {\n // A retained session just re-starts its render; a fresh attach with a file\n // installs a session seeded from the editor's document. The editor can also\n // attach before the file arrives, there is nothing to begin yet, so the\n // session installs on the later hydrate.\n if (this.editSession != null) {\n this.fileRenderer.beginEditSession(this.editSession.file);\n } else {\n const inputFile = this.getInputFile();\n if (inputFile != null) {\n this.installEditSession(\n inputFile,\n editor.__getDocumentContents(inputFile)\n );\n }\n }\n const editSessionFile = this.editSession?.file;\n if (this.fileRenderer.editorRenderReady()) {\n if (\n editSessionFile != null &&\n this.fileRenderer.fileCache === editSessionFile\n ) {\n this.adoptRenderData(editSessionFile);\n }\n this.syncRenderViewToEditor();\n } else {\n // The current markup is missing the editor's token metadata, or its\n // highlight is still pending: render through the session, which also\n // syncs the render view once it paints.\n this.rerender();\n }\n }\n\n /**\n * @internal\n *\n * Ends the edit session and settles which file this component renders.\n * Requires the editor to be detached first. Does nothing when no session\n * exists, so callers can invoke it again safely after it has settled.\n *\n * `onEditComplete` receives the completed file, current input file, and\n * both annotation collections even when the final text is unchanged. In\n * `install` mode, accepting installs the completed file and its annotations;\n * rejecting or having no handler restores the external values. `discard`\n * mode always restores the external values. An accepted file cannot reuse\n * the replaced file's `cacheKey`.\n */\n public __completeEditSession(\n editor: Editor<'file', LAnnotation, Caret>,\n mode: 'install' | 'discard'\n ): void {\n this.settleEditSession(mode === 'install', editor);\n }\n\n private settleEditSession(\n installResult: boolean,\n editor: Editor<'file', LAnnotation, Caret> | undefined\n ): void {\n const { editSession } = this;\n if (editSession == null) {\n return;\n }\n const {\n file: editSessionFile,\n inputFile,\n annotations: editSessionAnnotations,\n } = editSession;\n const inputAnnotations =\n editSessionAnnotations?.provided ?? this.lineAnnotations;\n if (this.editor != null) {\n throw new Error(\n 'File.__completeEditSession: detach the editor before completing the session'\n );\n }\n\n const sessionAnnotationsCurrent = editSessionAnnotations?.current;\n let acceptedFile: FileContents | undefined;\n let failed = false;\n let failure: unknown;\n if (editor == null) {\n throw new Error(\n 'File.__completeEditSession: editor is required for completion'\n );\n }\n const completedFile = { ...editSessionFile };\n const event: FileEditCompleteEvent<LAnnotation, Caret> = {\n file: completedFile,\n editor,\n originalFile: inputFile,\n lineAnnotations: sessionAnnotationsCurrent,\n originalLineAnnotations: inputAnnotations,\n };\n // Frozen so a handler cannot swap the event's file/originalFile\n // references; nested mutation (a fresh cacheKey on event.file) still\n // works.\n Object.freeze(event);\n try {\n editor.__emitEditComplete(event);\n const decision = this.options.onEditComplete?.(event);\n if (decision === 'accept') {\n if (\n completedFile.cacheKey != null &&\n completedFile.cacheKey === inputFile.cacheKey\n ) {\n throw new Error(\n 'File.__completeEditSession: an accepted file must not reuse the replaced file cacheKey'\n );\n }\n acceptedFile = completedFile;\n }\n } catch (error) {\n failed = true;\n failure = error;\n }\n\n const settledFile =\n installResult && acceptedFile != null ? acceptedFile : inputFile;\n const settledAnnotations =\n installResult && acceptedFile != null\n ? (sessionAnnotationsCurrent ?? inputAnnotations)\n : inputAnnotations;\n this.editSession = undefined;\n this.file = settledFile;\n this.pendingData = {\n file: settledFile,\n lineAnnotations: settledAnnotations,\n };\n // The renderer can adopt the settled identity without repainting when\n // its current content already matches the completed or reverted file.\n this.fileRenderer.endEditSession(settledFile);\n if (areFileTargetsEqual(this.getRenderedFile(), settledFile)) {\n this.adoptRenderData(settledFile);\n }\n if (installResult && this.fileContainer != null) {\n this.rerender();\n }\n if (failed) {\n throw failure;\n }\n }\n\n // normally triggered by the host when the document line count changes\n public applyDocumentChange(\n textDocument: TextDocument<'file', LAnnotation>,\n newLineAnnotations?: LineAnnotation<LAnnotation>[]\n ): void {\n const editSessionFile = this.editSession?.file;\n if (editSessionFile == null) {\n throw new Error(\n 'File.applyDocumentChange: requires an active edit session'\n );\n }\n this.fileRenderer.beginEditSession(editSessionFile);\n this.fileRenderer.applyDocumentChange(textDocument);\n if (newLineAnnotations != null) {\n this.syncEditSessionAnnotationsFromEditor(newLineAnnotations);\n }\n }\n\n /** Update the session source without editor DOM, then rehighlight on return. */\n public applySuspendedDocumentChange(\n textDocument: TextDocument<'file', LAnnotation>,\n newLineAnnotations?: LineAnnotation<LAnnotation>[]\n ): void {\n if (this.editSession == null) {\n return;\n }\n this.applyDocumentChange(textDocument, newLineAnnotations);\n this.fileRenderer.clearRenderCache();\n }\n\n public updateRenderCache(\n dirtyLines: Map<number, Array<HighlightedToken>>,\n themeType: 'dark' | 'light',\n options?: {\n lineCountChangeInFlight?: boolean;\n }\n ): void {\n const editSessionFile = this.editSession?.file;\n if (editSessionFile == null) {\n throw new Error(\n 'File.updateRenderCache: requires an active edit session'\n );\n }\n this.fileRenderer.beginEditSession(editSessionFile);\n this.fileRenderer.updateRenderCache(\n dirtyLines,\n themeType,\n options?.lineCountChangeInFlight\n );\n }\n\n public render({\n file,\n fileContainer,\n forceRender = false,\n preventEmit = false,\n containerWrapper,\n deferManagers = false,\n lineAnnotations,\n renderRange,\n }: FileRenderProps<LAnnotation>): boolean {\n if (!this.enabled) {\n throw new Error(\n 'File.render: attempting to call render after cleaned up'\n );\n }\n forceRender = this.forceRenderOverride ?? forceRender;\n this.forceRenderOverride = undefined;\n\n // postpone background tokenizing to next frame for avoiding UI freeze\n // during render\n this.editor?.__postponeBgTokenizeToNextFrame();\n\n const { collapsed = false, themeType = 'system' } = this.options;\n const nextRenderRange = collapsed ? undefined : renderRange;\n const previousRenderRange = this.renderRange;\n const themeChanged = this.hasThemeChanged();\n const annotationsChanged =\n lineAnnotations != null &&\n (lineAnnotations.length > 0 || this.getLatestAnnotations().length > 0)\n ? this.isNewAnnotations(lineAnnotations)\n : false;\n const didFileChange = !areFileTargetsEqual(this.getInputFile(), file);\n if (didFileChange) {\n this.updateInputFile(file, lineAnnotations);\n }\n const workingFile = this.getWorkingFile(file) ?? file;\n if (\n !collapsed &&\n !forceRender &&\n areRenderRangesEqual(nextRenderRange, this.renderRange) &&\n !didFileChange &&\n !annotationsChanged &&\n !themeChanged\n ) {\n const rendered = this.applyCachedThemeState(themeType);\n if (rendered) {\n this.finalizeRender();\n }\n return rendered;\n }\n\n this.renderRange = nextRenderRange;\n if (didFileChange) {\n this.cachedHeaderHTML = undefined;\n }\n this.fileRenderer.setOptions(getFileRendererOptions(this.options));\n this.syncInteractionOptions();\n if (lineAnnotations != null) {\n this.setLineAnnotations(lineAnnotations);\n }\n const nextRenderFile = this.fileRenderer.getFileForNextRender(workingFile);\n this.fileRenderer.setLineAnnotations(\n this.getAnnotationsForFile(nextRenderFile)\n );\n\n const { disableErrorHandling = false, disableFileHeader = false } =\n this.options;\n if (disableFileHeader) {\n // Remove existing header from DOM\n if (this.headerElement != null) {\n this.headerElement.remove();\n this.headerElement = undefined;\n this.lastRenderedHeaderHTML = undefined;\n }\n this.clearHeaderSlots();\n }\n\n fileContainer = this.getOrCreateFileContainerNode(\n fileContainer,\n containerWrapper\n );\n this.applyCachedThemeState(themeType);\n\n if (collapsed) {\n this.removeRenderedCode();\n this.clearAuxiliaryNodes();\n\n try {\n const fileResult = this.fileRenderer.renderFile(\n workingFile,\n EMPTY_RENDER_RANGE\n );\n if (fileResult != null) {\n this.applyThemeState(\n fileContainer,\n fileResult.themeStyles,\n themeType,\n fileResult.baseThemeType\n );\n }\n if (fileResult?.headerAST != null) {\n this.applyHeaderToDOM(\n fileResult.headerAST,\n fileContainer,\n fileResult.file\n );\n }\n this.adoptRenderData(fileResult?.file ?? workingFile);\n this.injectUnsafeCSS();\n } catch (error: unknown) {\n if (disableErrorHandling) {\n throw error;\n }\n console.error(error);\n if (error instanceof Error) {\n this.applyErrorToDOM(error, fileContainer);\n }\n }\n this.finalizeRender();\n if (!preventEmit) {\n this.emitPostRender();\n }\n return true;\n }\n\n try {\n const pre = this.getOrCreatePreNode(fileContainer);\n let renderedFile = this.getRenderedFile();\n if (\n !this.canPartiallyRender(\n forceRender,\n annotationsChanged,\n didFileChange ||\n themeChanged ||\n !areFileTargetsEqual(this.getRenderedFile(), workingFile)\n ) ||\n !this.applyPartialRender(\n workingFile,\n previousRenderRange,\n nextRenderRange\n )\n ) {\n const fileResult = this.fileRenderer.renderFile(\n workingFile,\n nextRenderRange\n );\n if (fileResult == null) {\n if (\n this.workerManager?.isInitialized() === false &&\n this.workerManager.isWorkingPool()\n ) {\n void this.workerManager\n .initialize()\n .catch(() => {})\n .then(() => this.rerender());\n }\n return false;\n }\n this.applyThemeState(\n fileContainer,\n fileResult.themeStyles,\n themeType,\n fileResult.baseThemeType\n );\n if (fileResult.headerAST != null) {\n this.applyHeaderToDOM(\n fileResult.headerAST,\n fileContainer,\n fileResult.file\n );\n }\n this.applyFullRender(fileResult, pre);\n renderedFile = fileResult.file;\n }\n\n this.applyBuffers(pre, nextRenderRange);\n this.injectUnsafeCSS();\n if (renderedFile != null) {\n this.adoptRenderData(renderedFile);\n }\n this.renderAnnotations();\n this.renderGutterUtility();\n\n this.managersDirty = true;\n if (!deferManagers) {\n this.flushManagers();\n }\n\n this.finalizeRender();\n if (this.editor != null) {\n this.syncRenderViewToEditor();\n }\n } catch (error: unknown) {\n if (disableErrorHandling) {\n throw error;\n }\n console.error(error);\n if (error instanceof Error) {\n this.applyErrorToDOM(error, fileContainer);\n }\n }\n if (!preventEmit) {\n this.emitPostRender();\n }\n return true;\n }\n\n // Finish subclass layout bookkeeping before editor sync or post-render\n // callbacks can synchronously replace or dispose this component.\n protected finalizeRender(): void {}\n\n private emitPostRender(unmount = false) {\n const {\n fileContainer,\n options: { onPostRender },\n } = this;\n\n if (unmount) {\n if (!this.mounted) {\n return;\n }\n this.mounted = false;\n if (fileContainer == null) {\n return;\n }\n onPostRender?.(fileContainer, this, 'unmount');\n return;\n }\n\n if (fileContainer == null) {\n return;\n }\n\n const phase: PostRenderPhase = this.mounted ? 'update' : 'mount';\n this.mounted = true;\n onPostRender?.(fileContainer, this, phase);\n }\n\n private removeRenderedCode(): void {\n this.resizeManager.cleanUp();\n this.interactionManager.cleanUp();\n\n this.bufferBefore?.remove();\n this.bufferBefore = undefined;\n this.bufferAfter?.remove();\n this.bufferAfter = undefined;\n\n this.code?.remove();\n this.code = undefined;\n\n this.pre?.remove();\n this.pre = undefined;\n\n this.appliedPreAttributes = undefined;\n this.lastRowCount = undefined;\n }\n\n private clearAuxiliaryNodes(): void {\n for (const { element } of this.annotationCache.values()) {\n element.remove();\n }\n this.annotationCache.clear();\n\n this.gutterUtilityContent?.remove();\n this.gutterUtilityContent = undefined;\n }\n\n private canPartiallyRender(\n forceRender: boolean,\n annotationsChanged: boolean,\n didContentChange: boolean\n ): boolean {\n if (forceRender || annotationsChanged || didContentChange) {\n return false;\n }\n return true;\n }\n\n public renderPlaceholder(height: number): boolean {\n if (this.fileContainer == null) {\n return false;\n }\n this.emitPostRender(true);\n this.cleanChildNodes();\n\n if (this.placeHolder == null) {\n const shadowRoot =\n this.fileContainer.shadowRoot ??\n this.fileContainer.attachShadow({ mode: 'open' });\n this.placeHolder = document.createElement('div');\n this.placeHolder.dataset.placeholder = '';\n shadowRoot.appendChild(this.placeHolder);\n }\n return this.setPlaceholderHeight(height);\n }\n\n protected setPlaceholderHeight(height: number): boolean {\n if (this.placeHolder == null) {\n return false;\n }\n this.placeHolder.style.setProperty('height', `${height}px`);\n return true;\n }\n\n public async primeHighlightCache(\n file: FileContents | undefined = this.getInputFile()\n ): Promise<void> {\n const { workerManager } = this;\n if (\n file == null ||\n workerManager == null ||\n !workerManager.isWorkingPool() ||\n file.cacheKey == null ||\n isFilePlainText(file)\n ) {\n return;\n }\n const tokenizeMaxLength =\n this.options.tokenizeMaxLength ?? DEFAULT_TOKENIZE_MAX_LENGTH;\n const lines = this.fileRenderer.getOrCreateLineCache(file);\n if (lines.length > tokenizeMaxLength) {\n return;\n }\n\n await workerManager\n .primeFileHighlightCache(file)\n .catch((error: unknown) => {\n if (isHandledWorkerPoolError(error)) {\n return;\n }\n console.error(error);\n });\n }\n\n private cleanChildNodes() {\n this.resizeManager.cleanUp();\n this.interactionManager.cleanUp();\n this.clearAuxiliaryNodes();\n\n this.bufferAfter?.remove();\n this.bufferBefore?.remove();\n this.code?.remove();\n this.errorWrapper?.remove();\n this.headerElement?.remove();\n this.headerPrefix?.remove();\n this.headerFilenameSuffix?.remove();\n this.headerMetadata?.remove();\n this.headerCustom?.remove();\n this.pre?.remove();\n this.spriteSVG?.remove();\n this.themeCSSStyle?.remove();\n this.unsafeCSSStyle?.remove();\n\n this.bufferAfter = undefined;\n this.bufferBefore = undefined;\n this.code = undefined;\n this.errorWrapper = undefined;\n this.headerElement = undefined;\n this.headerPrefix = undefined;\n this.headerFilenameSuffix = undefined;\n this.headerMetadata = undefined;\n this.headerCustom = undefined;\n this.pre = undefined;\n this.spriteSVG = undefined;\n this.themeCSSStyle = undefined;\n this.appliedThemeCSS = undefined;\n this.hasAdoptedThemeCSS = false;\n this.unsafeCSSStyle = undefined;\n this.appliedUnsafeCSS = undefined;\n\n this.lastRenderedHeaderHTML = undefined;\n this.lastRowCount = undefined;\n\n this.mounted = false;\n }\n\n private renderAnnotations(): void {\n if (this.isComponentManaged || this.fileContainer == null) {\n for (const { element } of this.annotationCache.values()) {\n element.remove();\n }\n this.annotationCache.clear();\n return;\n }\n const staleAnnotations = new Map(this.annotationCache);\n const { renderAnnotation } = this.options;\n const { renderedData } = this;\n if (renderAnnotation != null && renderedData != null) {\n const { file, lineAnnotations } = renderedData;\n for (const [index, annotation] of lineAnnotations.entries()) {\n const name = this.getAnnotationSlotName(annotation);\n const id = `${index}-${name}`;\n let cache = this.annotationCache.get(id);\n if (\n cache == null ||\n cache.file !== file ||\n !areLineAnnotationsEqual(annotation, cache.annotation)\n ) {\n cache?.element.remove();\n const content = renderAnnotation(annotation, file);\n // If we can't render anything, then we should not render anything\n // and clear the annotation cache if necessary.\n if (content == null) {\n continue;\n }\n cache = {\n element: createAnnotationWrapperNode(name),\n annotation,\n file,\n };\n cache.element.appendChild(content);\n this.fileContainer.appendChild(cache.element);\n this.annotationCache.set(id, cache);\n }\n staleAnnotations.delete(id);\n }\n }\n for (const [id, { element }] of staleAnnotations.entries()) {\n this.annotationCache.delete(id);\n element.remove();\n }\n }\n\n private renderGutterUtility() {\n const { renderGutterUtility } = this.options;\n if (this.fileContainer == null || renderGutterUtility == null) {\n this.gutterUtilityContent?.remove();\n this.gutterUtilityContent = undefined;\n return;\n }\n const element = renderGutterUtility(this.interactionManager.getHoveredLine);\n if (element != null && this.gutterUtilityContent != null) {\n return;\n } else if (element == null) {\n this.gutterUtilityContent?.remove();\n this.gutterUtilityContent = undefined;\n return;\n }\n const gutterUtilityContent = createGutterUtilityContentNode();\n gutterUtilityContent.appendChild(element);\n this.fileContainer.appendChild(gutterUtilityContent);\n this.gutterUtilityContent = gutterUtilityContent;\n }\n\n private injectUnsafeCSS(): void {\n const { unsafeCSS } = this.options;\n this.pre?.toggleAttribute('data-custom-styles', Boolean(unsafeCSS));\n const shadowRoot = this.fileContainer?.shadowRoot;\n if (shadowRoot == null) {\n return;\n }\n\n if (unsafeCSS == null || unsafeCSS === '') {\n if (this.unsafeCSSStyle != null) {\n this.unsafeCSSStyle.remove();\n this.unsafeCSSStyle = undefined;\n }\n this.appliedUnsafeCSS = undefined;\n return;\n }\n\n if (\n this.unsafeCSSStyle?.parentNode === shadowRoot &&\n this.appliedUnsafeCSS === unsafeCSS\n ) {\n return;\n }\n\n // Create or update the style element\n this.unsafeCSSStyle ??= createUnsafeCSSStyleNode();\n if (this.unsafeCSSStyle.parentNode !== shadowRoot) {\n shadowRoot.appendChild(this.unsafeCSSStyle);\n }\n // Wrap in @layer unsafe to match SSR behavior\n this.unsafeCSSStyle.textContent = wrapUnsafeCSS(unsafeCSS);\n this.appliedUnsafeCSS = unsafeCSS;\n }\n\n private applyThemeState(\n container: HTMLElement,\n themeStyles: string,\n themeType: ThemeTypes,\n baseThemeType?: 'light' | 'dark'\n ): void {\n const shadowRoot =\n container.shadowRoot ?? container.attachShadow({ mode: 'open' });\n const effectiveThemeType = baseThemeType ?? themeType;\n const currentTheme = this.getTheme();\n const theme =\n typeof currentTheme === 'string' ? currentTheme : { ...currentTheme };\n const scrollbarGutter = getMeasuredScrollbarGutter(shadowRoot);\n if (\n this.themeCSSStyle?.parentNode === shadowRoot &&\n this.appliedThemeCSS?.themeStyles === themeStyles &&\n this.appliedThemeCSS.themeType === effectiveThemeType &&\n this.appliedThemeCSS.scrollbarGutter === scrollbarGutter\n ) {\n this.appliedThemeCSS.theme = theme;\n return;\n }\n if (\n this.hasAdoptedThemeCSS &&\n this.themeCSSStyle?.parentNode === shadowRoot\n ) {\n this.hasAdoptedThemeCSS = false;\n this.appliedThemeCSS = {\n theme,\n themeStyles,\n themeType: effectiveThemeType,\n baseThemeType,\n scrollbarGutter,\n };\n return;\n }\n this.themeCSSStyle = upsertHostThemeStyle({\n shadowRoot,\n currentNode: this.themeCSSStyle,\n themeCSS: wrapThemeCSS(themeStyles, effectiveThemeType, scrollbarGutter),\n });\n this.appliedThemeCSS =\n this.themeCSSStyle != null\n ? {\n theme,\n themeStyles,\n themeType: effectiveThemeType,\n baseThemeType,\n scrollbarGutter,\n }\n : undefined;\n }\n\n private hydrateMeasuredScrollbar(): void {\n const shadowRoot = this.fileContainer?.shadowRoot;\n if (shadowRoot == null || this.themeCSSStyle == null) {\n return;\n }\n this.themeCSSStyle.textContent = patchScrollbarGutterSize(\n this.themeCSSStyle.textContent ?? '',\n getMeasuredScrollbarGutter(shadowRoot)\n );\n }\n\n // A boolean check to ensure that edit mode in WebKit doesn't cause potential\n // scroll jumps to due bugs with WebKit. The workarounds have performance\n // implications so we avoid running the workarounds on browsers or scenarios\n // where they are not applicable\n protected shouldGuardRebuildScroll(): boolean {\n return this.editor != null && isSafari();\n }\n\n private applyFullRender(result: FileRenderResult, pre: HTMLPreElement): void {\n this.cleanupErrorWrapper();\n this.applyPreNodeAttributes(pre, result);\n const code = (this.code = getOrCreateCodeNode({ code: this.code }));\n const codeAst = this.fileRenderer.renderCodeAST(result);\n this.editor?.__captureFocusForDOMReplacement();\n const applyColumns = () => {\n if (code.childElementCount >= 2) {\n for (let i = 0; i < 2; i++) {\n const domEl = code.children[i] as HTMLElement;\n const astEl = codeAst[i] as HASTElement;\n domEl.innerHTML = hastToHtml(astEl.children);\n domEl.style.cssText = astEl.properties.style as string;\n }\n } else {\n code.innerHTML = hastToHtml(codeAst);\n }\n if (!pre.contains(code)) {\n pre.replaceChildren(code);\n }\n };\n if (this.shouldGuardRebuildScroll()) {\n guardWebKitScrollDuringRebuild(pre, applyColumns);\n } else {\n applyColumns();\n }\n this.lastRowCount = result.rowCount;\n }\n\n private applyPartialRender(\n file: FileContents,\n previousRenderRange: RenderRange | undefined,\n renderRange: RenderRange | undefined\n ): boolean {\n if (previousRenderRange == null || renderRange == null) {\n return false;\n }\n const { code } = this;\n const columns = code != null ? this.getColumns(code) : undefined;\n if (code == null || columns == null) {\n return false;\n }\n\n const previousStart = previousRenderRange.startingLine;\n const nextStart = renderRange.startingLine;\n const previousEnd =\n previousRenderRange.totalLines === Infinity\n ? Number.POSITIVE_INFINITY\n : previousStart + previousRenderRange.totalLines;\n const nextEnd =\n renderRange.totalLines === Infinity\n ? Number.POSITIVE_INFINITY\n : nextStart + renderRange.totalLines;\n\n const overlapStart = Math.max(previousStart, nextStart);\n const overlapEnd = Math.min(previousEnd, nextEnd);\n if (overlapEnd <= overlapStart) {\n return false;\n }\n\n if (\n !this.trimDOMToOverlap(columns.gutter, overlapStart, overlapEnd) ||\n !this.trimDOMToOverlap(columns.content, overlapStart, overlapEnd)\n ) {\n throw new Error('File.applyPartialRender: failed to trim to overlap');\n }\n\n let { length: rowCount } = columns.content.children;\n\n const renderChunk = (\n startingLine: number,\n totalLines: number\n ): FileRenderResult | undefined => {\n if (totalLines <= 0) {\n return undefined;\n }\n return this.fileRenderer.renderFile(file, {\n startingLine,\n totalLines,\n bufferBefore: 0,\n bufferAfter: 0,\n });\n };\n\n const prependResult =\n nextStart < overlapStart\n ? renderChunk(nextStart, overlapStart - nextStart)\n : undefined;\n if (prependResult === undefined && nextStart < overlapStart) {\n return false;\n }\n\n const appendTotalLines =\n nextEnd === Number.POSITIVE_INFINITY\n ? Number.POSITIVE_INFINITY\n : Math.max(0, nextEnd - overlapEnd);\n const appendResult =\n nextEnd > overlapEnd\n ? renderChunk(overlapEnd, appendTotalLines)\n : undefined;\n if (appendResult === undefined && nextEnd > overlapEnd) {\n return false;\n }\n\n this.cleanupErrorWrapper();\n if (prependResult != null) {\n columns.gutter.insertAdjacentHTML(\n 'afterbegin',\n this.fileRenderer.renderPartialHTML(prependResult.gutterAST)\n );\n columns.content.insertAdjacentHTML(\n 'afterbegin',\n this.fileRenderer.renderPartialHTML(prependResult.contentAST)\n );\n rowCount += prependResult.rowCount;\n }\n\n if (appendResult != null) {\n columns.gutter.insertAdjacentHTML(\n 'beforeend',\n this.fileRenderer.renderPartialHTML(appendResult.gutterAST)\n );\n columns.content.insertAdjacentHTML(\n 'beforeend',\n this.fileRenderer.renderPartialHTML(appendResult.contentAST)\n );\n rowCount += appendResult.rowCount;\n }\n\n if (this.lastRowCount !== rowCount) {\n columns.gutter.style.setProperty('grid-row', `span ${rowCount}`);\n columns.content.style.setProperty('grid-row', `span ${rowCount}`);\n this.lastRowCount = rowCount;\n }\n\n return true;\n }\n\n private getColumns(code: HTMLElement): ColumnElements | undefined {\n const gutter = code.children[0];\n const content = code.children[1];\n if (\n !(gutter instanceof HTMLElement) ||\n !(content instanceof HTMLElement) ||\n gutter.dataset.gutter == null ||\n content.dataset.content == null\n ) {\n return undefined;\n }\n return { gutter, content };\n }\n\n private trimDOMToOverlap(\n container: HTMLElement,\n overlapStart: number,\n overlapEnd: number\n ): boolean {\n const boundaryIndices = this.getDOMBoundaryIndices(container, [\n overlapStart,\n overlapEnd,\n ]);\n const startIndex =\n boundaryIndices.get(overlapStart) ?? container.children.length;\n const endIndex =\n boundaryIndices.get(overlapEnd) ?? container.children.length;\n\n if (startIndex > endIndex) {\n return false;\n }\n\n for (let i = container.children.length - 1; i >= endIndex; i -= 1) {\n container.children[i]?.remove();\n }\n for (let i = startIndex - 1; i >= 0; i -= 1) {\n container.children[i]?.remove();\n }\n return true;\n }\n\n private getDOMBoundaryIndices(\n container: HTMLElement,\n boundaries: number[]\n ): Map<number, number> {\n const sortedBoundaries = [...new Set(boundaries)].sort((a, b) => a - b);\n const boundaryIndices = new Map<number, number>();\n if (sortedBoundaries.length === 0) {\n return boundaryIndices;\n }\n let boundaryIndex = 0;\n let nextBoundary = sortedBoundaries[boundaryIndex];\n const { children } = container;\n\n if (nextBoundary === 0) {\n boundaryIndices.set(0, 0);\n boundaryIndex += 1;\n nextBoundary = sortedBoundaries[boundaryIndex];\n }\n\n for (let i = 0; i < children.length; i += 1) {\n const child = children[i];\n if (!(child instanceof HTMLElement)) {\n continue;\n }\n const lineIndex = this.getLineIndexFromDOMNode(child);\n if (lineIndex == null) {\n continue;\n }\n while (nextBoundary != null && lineIndex >= nextBoundary) {\n boundaryIndices.set(nextBoundary, i);\n boundaryIndex += 1;\n nextBoundary = sortedBoundaries[boundaryIndex];\n }\n if (boundaryIndex >= sortedBoundaries.length) {\n break;\n }\n }\n\n for (const boundary of sortedBoundaries) {\n if (!boundaryIndices.has(boundary)) {\n boundaryIndices.set(boundary, children.length);\n }\n }\n return boundaryIndices;\n }\n\n private getLineIndexFromDOMNode(node: HTMLElement): number | undefined {\n const lineIndexAttr = node.dataset.lineIndex;\n if (lineIndexAttr == null) {\n return undefined;\n }\n const parsed = Number(lineIndexAttr);\n return Number.isNaN(parsed) ? undefined : parsed;\n }\n\n private applyBuffers(\n pre: HTMLPreElement,\n renderRange: RenderRange | undefined\n ) {\n if (renderRange == null || this.shouldDisableVirtualizationBuffers()) {\n if (this.bufferBefore != null) {\n this.bufferBefore.remove();\n this.bufferBefore = undefined;\n }\n if (this.bufferAfter != null) {\n this.bufferAfter.remove();\n this.bufferAfter = undefined;\n }\n return;\n }\n\n if (renderRange.bufferBefore > 0) {\n if (this.bufferBefore == null) {\n this.bufferBefore = document.createElement('div');\n this.bufferBefore.dataset.virtualizerBuffer = 'before';\n pre.before(this.bufferBefore);\n }\n this.bufferBefore.style.setProperty(\n 'height',\n `${renderRange.bufferBefore}px`\n );\n this.bufferBefore.style.setProperty('contain', 'strict');\n } else if (this.bufferBefore != null) {\n this.bufferBefore.remove();\n this.bufferBefore = undefined;\n }\n\n if (renderRange.bufferAfter > 0) {\n if (this.bufferAfter == null) {\n this.bufferAfter = document.createElement('div');\n this.bufferAfter.dataset.virtualizerBuffer = 'after';\n pre.after(this.bufferAfter);\n }\n this.bufferAfter.style.setProperty(\n 'height',\n `${renderRange.bufferAfter}px`\n );\n this.bufferAfter.style.setProperty('contain', 'strict');\n } else if (this.bufferAfter != null) {\n this.bufferAfter.remove();\n this.bufferAfter = undefined;\n }\n }\n\n protected shouldDisableVirtualizationBuffers(): boolean {\n return this.options.disableVirtualizationBuffers ?? false;\n }\n\n private applyHeaderToDOM(\n headerAST: HASTElement,\n container: HTMLElement,\n file: FileContents\n ): void {\n this.cleanupErrorWrapper();\n this.placeHolder?.remove();\n this.placeHolder = undefined;\n const headerHTML = this.cachedHeaderHTML ?? hastToHtml(headerAST);\n this.cachedHeaderHTML = headerHTML;\n if (headerHTML !== this.lastRenderedHeaderHTML) {\n const tempDiv = document.createElement('div');\n tempDiv.innerHTML = headerHTML;\n const newHeader = tempDiv.firstElementChild;\n if (!(newHeader instanceof HTMLElement)) {\n return;\n }\n if (this.headerElement != null) {\n container.shadowRoot?.replaceChild(newHeader, this.headerElement);\n } else {\n container.shadowRoot?.prepend(newHeader);\n }\n this.headerElement = newHeader;\n this.lastRenderedHeaderHTML = headerHTML;\n }\n\n if (this.isComponentManaged) return;\n\n const {\n renderHeaderPrefix,\n renderHeaderFilenameSuffix,\n renderCustomHeader,\n renderHeaderMetadata,\n } = this.options;\n\n if (renderCustomHeader != null) {\n const content = renderCustomHeader(file) ?? undefined;\n this.headerCustom = this.upsertHeaderSlotElement(\n container,\n this.headerCustom,\n CUSTOM_HEADER_SLOT_ID,\n content\n );\n this.headerPrefix?.remove();\n this.headerFilenameSuffix?.remove();\n this.headerMetadata?.remove();\n this.headerPrefix = undefined;\n this.headerFilenameSuffix = undefined;\n this.headerMetadata = undefined;\n } else {\n const prefix = renderHeaderPrefix?.(file) ?? undefined;\n const suffix = renderHeaderFilenameSuffix?.(file) ?? undefined;\n const content = renderHeaderMetadata?.(file) ?? undefined;\n this.headerPrefix = this.upsertHeaderSlotElement(\n container,\n this.headerPrefix,\n HEADER_PREFIX_SLOT_ID,\n prefix\n );\n this.headerFilenameSuffix = this.upsertHeaderSlotElement(\n container,\n this.headerFilenameSuffix,\n HEADER_FILENAME_SUFFIX_SLOT_ID,\n suffix\n );\n this.headerMetadata = this.upsertHeaderSlotElement(\n container,\n this.headerMetadata,\n HEADER_METADATA_SLOT_ID,\n content\n );\n this.headerCustom?.remove();\n this.headerCustom = undefined;\n }\n }\n\n private clearHeaderSlots(): void {\n this.headerPrefix?.remove();\n this.headerFilenameSuffix?.remove();\n this.headerMetadata?.remove();\n this.headerCustom?.remove();\n this.headerPrefix = undefined;\n this.headerFilenameSuffix = undefined;\n this.headerMetadata = undefined;\n this.headerCustom = undefined;\n }\n\n // Header slot callbacks are presence-based render hooks, not reactive views.\n private upsertHeaderSlotElement(\n container: HTMLElement,\n current: HTMLElement | undefined,\n slot: string,\n content: Element | string | number | undefined\n ): HTMLElement | undefined {\n if (content == null) {\n current?.remove();\n return undefined;\n }\n const element = current ?? this.createHeaderSlotElement(slot);\n if (current == null) {\n container.appendChild(element);\n }\n this.replaceHeaderSlotContent(element, content);\n return element;\n }\n\n private replaceHeaderSlotContent(\n element: HTMLElement,\n content: Element | string | number\n ): void {\n element.replaceChildren();\n if (content instanceof Element) {\n element.appendChild(content);\n } else {\n element.innerText = `${content}`;\n }\n }\n\n private createHeaderSlotElement(slot: string): HTMLElement {\n const element = document.createElement('div');\n element.slot = slot;\n return element;\n }\n\n protected getOrCreateFileContainerNode(\n fileContainer?: HTMLElement,\n parentNode?: HTMLElement\n ): HTMLElement {\n const { fileContainer: previousContainer } = this;\n const nextContainer =\n fileContainer ??\n previousContainer ??\n document.createElement(DIFFS_TAG_NAME);\n const containerChanged = previousContainer !== nextContainer;\n if (previousContainer != null && containerChanged) {\n this.editor?.__captureFocusForDOMReplacement();\n }\n if (containerChanged) {\n this.emitPostRender(true);\n }\n this.fileContainer = nextContainer;\n if (previousContainer != null && containerChanged) {\n this.lastRenderedHeaderHTML = undefined;\n this.headerElement = undefined;\n }\n if (parentNode != null && this.fileContainer.parentNode !== parentNode) {\n parentNode.appendChild(this.fileContainer);\n }\n if (containerChanged) {\n this.adoptReusableShellElements(this.fileContainer);\n }\n this.ensureSpriteSVG(this.fileContainer);\n return this.fileContainer;\n }\n\n // NOTE(amadeus): Technically this method is not safe for use outside of\n // the CodeView component, however I don't think in practice it really\n // should matter, but maybe there's some system we need in place to prevent\n // this from running outside of that environment?\n //\n // It's making very specific assumptions that all the elements will have the\n // correct content based on CodeView global options\n private adoptReusableShellElements(fileContainer: HTMLElement): void {\n const { shadowRoot } = fileContainer;\n if (shadowRoot == null) {\n return;\n }\n\n for (const element of shadowRoot.children) {\n if (element instanceof SVGElement) {\n this.spriteSVG ??= element;\n } else if (\n isStyleNode(element) &&\n element.hasAttribute(THEME_CSS_ATTRIBUTE)\n ) {\n this.themeCSSStyle ??= element;\n this.hasAdoptedThemeCSS = true;\n } else if (\n isStyleNode(element) &&\n element.hasAttribute(UNSAFE_CSS_ATTRIBUTE)\n ) {\n this.unsafeCSSStyle ??= element;\n this.appliedUnsafeCSS ??= this.options.unsafeCSS ?? undefined;\n }\n }\n }\n\n private ensureSpriteSVG(fileContainer: HTMLElement): void {\n const shadowRoot =\n fileContainer.shadowRoot ?? fileContainer.attachShadow({ mode: 'open' });\n if (this.spriteSVG == null) {\n const fragment = document.createElement('div');\n fragment.innerHTML = SVGSpriteSheet;\n const firstChild = fragment.firstChild;\n if (firstChild instanceof SVGElement) {\n this.spriteSVG = firstChild;\n }\n }\n if (this.spriteSVG != null && this.spriteSVG.parentNode !== shadowRoot) {\n shadowRoot.appendChild(this.spriteSVG);\n }\n }\n\n private getOrCreatePreNode(container: HTMLElement): HTMLPreElement {\n const shadowRoot =\n container.shadowRoot ?? container.attachShadow({ mode: 'open' });\n // If we haven't created a pre element yet, lets go ahead and do that\n if (this.pre == null) {\n this.pre = document.createElement('pre');\n this.appliedPreAttributes = undefined;\n this.code = undefined;\n shadowRoot.appendChild(this.pre);\n }\n // If we have a new parent container for the pre element, lets go ahead and\n // move it into the new container\n else if (this.pre.parentNode !== shadowRoot) {\n this.editor?.__captureFocusForDOMReplacement();\n container.shadowRoot?.appendChild(this.pre);\n this.appliedPreAttributes = undefined;\n }\n\n this.placeHolder?.remove();\n this.placeHolder = undefined;\n\n return this.pre;\n }\n\n private syncCodeNodeFromPre(pre: HTMLPreElement): void {\n this.code = undefined;\n for (const child of Array.from(pre.children)) {\n if (!(child instanceof HTMLElement)) {\n continue;\n }\n if (child.hasAttribute('data-code')) {\n this.code = child;\n return;\n }\n }\n }\n\n private applyPreNodeAttributes(\n pre: HTMLPreElement,\n { totalLines }: FileRenderResult\n ): void {\n const { overflow = 'scroll', disableLineNumbers = false } = this.options;\n const preProperties: PrePropertiesConfig = {\n type: 'file',\n split: false,\n overflow,\n disableLineNumbers,\n diffIndicators: 'none',\n disableBackground: true,\n totalLines,\n };\n if (arePrePropertiesEqual(preProperties, this.appliedPreAttributes)) {\n return;\n }\n setPreNodeProperties(pre, preProperties);\n this.appliedPreAttributes = preProperties;\n }\n\n private applyErrorToDOM(error: Error, container: HTMLElement) {\n this.cleanupErrorWrapper();\n this.pre?.remove();\n this.pre = undefined;\n this.appliedPreAttributes = undefined;\n const shadowRoot =\n container.shadowRoot ?? container.attachShadow({ mode: 'open' });\n this.errorWrapper ??= document.createElement('div');\n this.errorWrapper.dataset.errorWrapper = '';\n this.errorWrapper.textContent = '';\n shadowRoot.appendChild(this.errorWrapper);\n const errorMessage = document.createElement('div');\n errorMessage.dataset.errorMessage = '';\n errorMessage.innerText = error.message;\n this.errorWrapper.appendChild(errorMessage);\n const errorStack = document.createElement('pre');\n errorStack.dataset.errorStack = '';\n errorStack.innerText = error.stack ?? 'No Error Stack';\n this.errorWrapper.appendChild(errorStack);\n }\n\n private cleanupErrorWrapper() {\n this.errorWrapper?.remove();\n this.errorWrapper = undefined;\n }\n}\n\nfunction shouldRenderCode(\n pre: HTMLPreElement | undefined,\n file: FileContents | undefined,\n collapsed = false\n): boolean {\n return !collapsed && pre == null && file != null;\n}\n\nfunction shouldRenderHeader(\n headerElement: HTMLElement | undefined,\n file: FileContents | undefined,\n disableFileHeader: boolean = false\n): boolean {\n return headerElement == null && file != null && !disableFileHeader;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4FA,MAAM,gBAA0B,CAAC,EAAE;AA4HnC,SAAS,sBAAsB,MAAkC;CAC/D,MAAM,kBAAkB,EAAE,GAAG,KAAK;CAClC,OAAO,gBAAgB;CACvB,OAAO;AACT;AAEA,IAAI,aAAa;AAEjB,IAAa,OAAb,MAA8D;CA4DnD;CAGC;CAGA;CAjEV,OAAO,wBAAA;CAEP,OAAwB,QAAQ,EAAE;CAClC,OAAgB;CAEhB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,qBAA+B;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,UAAkB;CAElB;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CAEA,kCACE,IAAI,IAAI;CAEV,IAAc,kBAAiD;EAC7D,OAAO,KAAK,cAAc,mBAAmB;CAC/C;CACA,gBAA0B;CAG1B;CACA;CAEA;CAEA;CAGA;CACA;CACA,UAAoB;CAEpB;CAEA,YACE,UAAkD,EAChD,OAAO,eACT,GACA,eAGA,oBACA;EAPO,KAAA,UAAA;EAGC,KAAA,gBAAA;EAGA,KAAA,qBAAA;EAER,KAAK,eAAe,IAAI,aACtB,SACA,KAAK,uBACL,KAAK,uBACL,KAAK,aACP;EACA,KAAK,gBAAgB,IAAI,cAAc;EACvC,KAAK,qBAAqB,IAAI,mBAC5B,QACA,wBAAwB,OAAO,CACjC;EACA,KAAK,eAAe,wBAAwB,IAAI;CAClD;CAEA,yBACE,eACW;EACX,OAAO,2BACL,KAAK,aAAa,aAClB,YACA,qBACF;CACF;CAEA,8BAA4C;EAC1C,KAAK,SAAS;CAChB;CAEA,WAAwB;EACtB,MAAM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cAAc;EAChC,WAAW,YAAY,KAAK,YAAY;EACxC,MAAM,eAAe,SAAS,cAAc,KAAK;EACjD,aAAa,QAAQ,eAAe;EACpC,aAAa,YAAY,MAAM;EAC/B,KAAK,aAAa,YAAY,YAAY;EAC1C,MAAM,aAAa,SAAS,cAAc,KAAK;EAC/C,WAAW,QAAQ,aAAa;EAChC,WAAW,YAAY,MAAM,SAAS;EACtC,KAAK,aAAa,YAAY,UAAU;CAC1C;CAEA,sBAA8B;EAC5B,KAAK,cAAc,OAAO;EAC1B,KAAK,eAAe,KAAA;CACtB;AACF;AAEA,SAAS,iBACP,KACA,MACA,YAAY,OACH;CACT,OAAO,CAAC,aAAa,OAAO,QAAQ,QAAQ;AAC9C;AAEA,SAAS,mBACP,eACA,MACA,oBAA6B,OACpB;CACT,OAAO,iBAAiB,QAAQ,QAAQ,QAAQ,CAAC;AACnD"}
|
|
1
|
+
{"version":3,"file":"File.js","names":[],"sources":["../../src/components/File.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport {\n CUSTOM_HEADER_SLOT_ID,\n DEFAULT_THEMES,\n DEFAULT_TOKENIZE_MAX_LENGTH,\n DIFFS_TAG_NAME,\n EMPTY_LINE_ANNOTATIONS,\n EMPTY_RENDER_RANGE,\n HEADER_FILENAME_SUFFIX_SLOT_ID,\n HEADER_METADATA_SLOT_ID,\n HEADER_PREFIX_SLOT_ID,\n THEME_CSS_ATTRIBUTE,\n UNSAFE_CSS_ATTRIBUTE,\n} from '../constants';\nimport type { Editor } from '../editor/editor';\nimport type { TextDocument } from '../editor/textDocument';\nimport type {\n EditCompletionDecision,\n EditorActiveLineOptions,\n EditorChangeEvent,\n FileEditCompleteEvent,\n} from '../editor/types';\nimport {\n type GetHoveredLineResult,\n InteractionManager,\n type InteractionManagerBaseOptions,\n pluckInteractionOptions,\n type SelectionWriteOptions,\n} from '../managers/InteractionManager';\nimport { ResizeManager } from '../managers/ResizeManager';\nimport { FileRenderer, type FileRenderResult } from '../renderers/FileRenderer';\nimport { SVGSpriteSheet } from '../sprite';\nexport type { FileEditCompleteEvent } from '../editor/types';\nimport {\n getHighlighterIfLoaded,\n getSharedHighlighter,\n HighlighterDisposedError,\n} from '../highlighter/shared_highlighter';\nimport type {\n AppliedThemeStyleCache,\n BaseCodeOptions,\n DiffLineAnnotation,\n DiffsHighlighter,\n FileContents,\n HighlightedToken,\n LineAnnotation,\n PostRenderPhase,\n PrePropertiesConfig,\n RenderFileMetadata,\n RenderRange,\n SelectedLineRange,\n ThemeTypes,\n} from '../types';\nimport { areFileTargetsEqual } from '../utils/areFileTargetsEqual';\nimport { areLineAnnotationsEqual } from '../utils/areLineAnnotationsEqual';\nimport { arePrePropertiesEqual } from '../utils/arePrePropertiesEqual';\nimport { areRenderRangesEqual } from '../utils/areRenderRangesEqual';\nimport { areThemesEqual } from '../utils/areThemesEqual';\nimport { createAnnotationWrapperNode } from '../utils/createAnnotationWrapperNode';\nimport { createGutterUtilityContentNode } from '../utils/createGutterUtilityContentNode';\nimport { createUnsafeCSSStyleNode } from '../utils/createUnsafeCSSStyleNode';\nimport {\n patchScrollbarGutterSize,\n wrapThemeCSS,\n wrapUnsafeCSS,\n} from '../utils/cssWrappers';\nimport {\n adoptEditSessionAnnotations,\n type EditSessionAnnotations,\n resolveEditSessionSlotName,\n writeEditSessionAnnotations,\n} from '../utils/editSessionAnnotations';\nimport { getFileRendererOptions } from '../utils/getFileRendererOptions';\nimport { getFiletypeFromFileName } from '../utils/getFiletypeFromFileName';\nimport { getLineAnnotationName } from '../utils/getLineAnnotationName';\nimport { getOrCreateCodeNode } from '../utils/getOrCreateCodeNode';\nimport { getThemes } from '../utils/getThemes';\nimport { guardWebKitScrollDuringRebuild } from '../utils/guardWebKitScrollDuringRebuild';\nimport { hastToHtml } from '../utils/hastToHtml';\nimport { upsertHostThemeStyle } from '../utils/hostTheme';\nimport { isFilePlainText } from '../utils/isFilePlainText';\nimport { isStyleNode } from '../utils/isStyleNode';\nimport { isSafari } from '../utils/platform';\nimport { prerenderHTMLIfNecessary } from '../utils/prerenderHTMLIfNecessary';\nimport { resolvePreferredHighlighter } from '../utils/resolvePreferredHighlighter';\nimport { getMeasuredScrollbarGutter } from '../utils/scrollbarGutter';\nimport { setPreNodeProperties } from '../utils/setWrapperNodeProps';\nimport type { WorkerPoolManager } from '../worker';\nimport { isHandledWorkerPoolError } from '../worker/errors';\nimport { DiffsContainerLoaded } from './web-components';\n\nconst EMPTY_STRINGS: string[] = [''];\n\nexport interface FileRenderProps<LAnnotation> {\n file: FileContents;\n fileContainer?: HTMLElement;\n containerWrapper?: HTMLElement;\n deferManagers?: boolean;\n forceRender?: boolean;\n preventEmit?: boolean;\n lineAnnotations?: LineAnnotation<LAnnotation>[];\n renderRange?: RenderRange;\n}\n\nexport interface FileHydrateProps<LAnnotation> extends Omit<\n FileRenderProps<LAnnotation>,\n 'fileContainer'\n> {\n fileContainer: HTMLElement;\n prerenderedHTML?: string;\n}\n\nexport type FileEditChangeHandler<LAnnotation, Caret> = (\n event: EditorChangeEvent<'file', LAnnotation, Caret>\n) => void;\n\n/**\n * Decides a completed edit synchronously: return `'accept'` to install the\n * event's `file` and annotations, or `'reject'` to restore the original values.\n * The event is frozen, so re-key the accepted file in place\n * (`event.file.cacheKey = '…'`) before accepting. The event's editor is\n * detached and returns its final state from `getViewState()`. A missing handler\n * rejects.\n */\nexport type FileEditCompleteHandler<LAnnotation, Caret> = (\n event: FileEditCompleteEvent<LAnnotation, Caret>\n) => EditCompletionDecision;\n\nexport interface FileOptions<LAnnotation, Caret>\n extends BaseCodeOptions, InteractionManagerBaseOptions<'file'> {\n disableFileHeader?: boolean;\n renderHeaderPrefix?: RenderFileMetadata;\n renderHeaderFilenameSuffix?: RenderFileMetadata;\n renderHeaderMetadata?: RenderFileMetadata;\n renderCustomHeader?: RenderFileMetadata;\n /**\n * When true, errors during rendering are rethrown instead of being caught\n * and displayed in the DOM. Useful for testing or when you want to handle\n * errors yourself.\n */\n disableErrorHandling?: boolean;\n /** Receives the matching file, including any editor changes. */\n renderAnnotation?(\n annotation: LineAnnotation<LAnnotation>,\n file: FileContents\n ): HTMLElement | undefined;\n renderGutterUtility?(\n getHoveredRow: () => GetHoveredLineResult<'file'> | undefined\n ): HTMLElement | null | undefined;\n\n onPostRender?(\n node: HTMLElement,\n instance: File<LAnnotation, Caret>,\n phase: PostRenderPhase\n ): unknown;\n\n /**\n * Fired for every document change of an active edit session on this\n * component, with the same `EditorChangeEvent` the editor reports through\n * its own `onChange`. Do not feed the event's file back into the component\n * while the session is active.\n */\n onEditChange?: FileEditChangeHandler<LAnnotation, Caret>;\n\n /**\n * Fired when `edit` toggles false or a component unmounts, including when the\n * final contents are unchanged. If no callback is provided, the component\n * reverts to the last `file` and annotations passed into it. The callback\n * receives the detached editor with its final pre-detach state.\n */\n onEditComplete?: FileEditCompleteHandler<LAnnotation, Caret>;\n}\n\ninterface AnnotationElementCache<LAnnotation> {\n element: HTMLElement;\n annotation: LineAnnotation<LAnnotation>;\n file: FileContents;\n}\n\ninterface ColumnElements {\n gutter: HTMLElement;\n content: HTMLElement;\n}\n\ninterface HydrationSetup<LAnnotation> {\n file: FileContents;\n lineAnnotations: LineAnnotation<LAnnotation>[] | undefined;\n}\n\nexport interface FileRenderData<LAnnotation> {\n file: FileContents;\n lineAnnotations: LineAnnotation<LAnnotation>[];\n}\n\nexport interface FileRenderInput<LAnnotation> {\n file: FileContents;\n lineAnnotations: LineAnnotation<LAnnotation>[] | undefined;\n}\n\ninterface EditSession<LAnnotation> {\n // Editable copy of the file. Changes in the editor are written here.\n file: FileContents;\n // Latest input, kept separately so rejecting edits can restore it.\n // Basically the original version of the FileContents before the edit took\n // place\n inputFile: FileContents;\n annotations: EditSessionAnnotations<LineAnnotation<LAnnotation>> | undefined;\n /*\n * `externalReplacement` records that the host swapped in a new file\n * mid-session, so the next sync tells the editor to adopt `file` over its\n * own document\n */\n externalReplacement: boolean;\n}\n\nfunction createEditSessionFile(file: FileContents): FileContents {\n const editSessionFile = { ...file };\n delete editSessionFile.cacheKey;\n return editSessionFile;\n}\n\nlet instanceId = -1;\n\nexport class File<LAnnotation = undefined, Caret = undefined> {\n static LoadedCustomComponent: boolean = DiffsContainerLoaded;\n\n readonly __id: string = `file:${++instanceId}`;\n readonly type = 'file';\n\n protected fileContainer: HTMLElement | undefined;\n protected spriteSVG: SVGElement | undefined;\n protected pre: HTMLPreElement | undefined;\n protected code: HTMLElement | undefined;\n protected bufferBefore: HTMLElement | undefined;\n protected bufferAfter: HTMLElement | undefined;\n protected themeCSSStyle: HTMLStyleElement | undefined;\n protected appliedThemeCSS: AppliedThemeStyleCache | undefined;\n protected hasAdoptedThemeCSS = false;\n protected unsafeCSSStyle: HTMLStyleElement | undefined;\n protected appliedUnsafeCSS: string | undefined;\n protected gutterUtilityContent: HTMLElement | undefined;\n protected errorWrapper: HTMLElement | undefined;\n protected placeHolder: HTMLElement | undefined;\n protected lastRenderedHeaderHTML: string | undefined;\n protected cachedHeaderHTML: string | undefined;\n protected appliedPreAttributes: PrePropertiesConfig | undefined;\n protected lastRowCount: number | undefined;\n private mounted = false;\n\n protected headerElement: HTMLElement | undefined;\n protected headerCustom: HTMLElement | undefined;\n protected headerPrefix: HTMLElement | undefined;\n protected headerFilenameSuffix: HTMLElement | undefined;\n protected headerMetadata: HTMLElement | undefined;\n\n protected fileRenderer: FileRenderer<LAnnotation>;\n protected resizeManager: ResizeManager;\n protected interactionManager: InteractionManager<'file'>;\n\n protected annotationCache: Map<string, AnnotationElementCache<LAnnotation>> =\n new Map();\n // Annotations for the displayed file, stored with that file in renderedData.\n protected get lineAnnotations(): LineAnnotation<LAnnotation>[] {\n return this.renderedData?.lineAnnotations ?? EMPTY_LINE_ANNOTATIONS;\n }\n protected managersDirty = false;\n\n // Latest input. Editor changes are kept in the private edit session.\n public file: FileContents | undefined;\n private editSession: EditSession<LAnnotation> | undefined;\n // File and annotations currently displayed. Absent until a file is rendered.\n private renderedData: FileRenderData<LAnnotation> | undefined;\n // Keep the next file and its annotations together until that file renders.\n private pendingData: FileRenderData<LAnnotation> | undefined;\n // Forces the next render() call, such as the one the owner makes after\n // requestOwnerRender.\n protected forceRenderOverride: true | undefined;\n protected renderRange: RenderRange | undefined;\n protected enabled = true;\n\n protected editor: Editor<'file', LAnnotation, Caret> | undefined;\n\n constructor(\n public options: FileOptions<LAnnotation, Caret> = {\n theme: DEFAULT_THEMES,\n },\n private workerManager?: WorkerPoolManager | undefined,\n // Set when an owner such as React manages the container. Internal renders\n // call it, and the owner must call render().\n private requestOwnerRender?: () => void\n ) {\n this.fileRenderer = new FileRenderer<LAnnotation>(\n options,\n this.getAnnotationSlotName,\n this.handleHighlightRender,\n this.workerManager\n );\n this.resizeManager = new ResizeManager();\n this.interactionManager = new InteractionManager(\n 'file',\n pluckInteractionOptions(options)\n );\n this.workerManager?.subscribeToThemeChanges(this);\n }\n\n public getAnnotationSlotName = (\n annotation: LineAnnotation<LAnnotation> | DiffLineAnnotation<LAnnotation>\n ): string => {\n return resolveEditSessionSlotName(\n this.editSession?.annotations,\n annotation,\n getLineAnnotationName\n );\n };\n\n private handleHighlightRender = (): void => {\n this.rerender();\n };\n\n public rerender(): void {\n const file = this.getInputFile();\n if (!this.enabled || file == null) return;\n if (this.requestRender()) return;\n this.render({\n file,\n forceRender: true,\n renderRange: this.renderRange,\n });\n }\n\n // Editors update their rows directly. Other internal renders can be driven\n // by the owner, so React updates its children before calling render().\n protected requestRender(): boolean {\n const { requestOwnerRender } = this;\n if (this.editSession != null || requestOwnerRender == null) {\n return false;\n }\n this.forceRenderOverride = true;\n requestOwnerRender();\n return true;\n }\n\n protected get isComponentManaged(): boolean {\n return this.requestOwnerRender != null;\n }\n\n private getTheme() {\n return (\n this.workerManager?.getFileRenderOptions().theme ??\n this.options.theme ??\n DEFAULT_THEMES\n );\n }\n\n // Return the latest input without editor changes. It may be newer than the\n // displayed file while a replacement is being highlighted.\n protected getInputFile(): FileContents | undefined {\n return this.file;\n }\n\n // Return the editor's copy, including its changes, or the input when there\n // is no edit session. Use fallbackFile if the new input is not stored yet.\n protected getWorkingFile(\n fallbackFile: FileContents | undefined = this.file\n ): FileContents | undefined {\n return this.editSession?.file ?? fallbackFile;\n }\n\n // Return the displayed file. While a replacement is being highlighted, this\n // still returns the previous file.\n protected getRenderedFile(): FileContents | undefined {\n return this.renderedData?.file;\n }\n\n /**\n * @internal Data the next render() with this input will display. While a\n * replacement file is being highlighted, this is still the displayed data.\n */\n public __getNextRenderData({\n file,\n lineAnnotations,\n }: FileRenderInput<LAnnotation>): FileRenderData<LAnnotation> {\n const sessionAnnotations = this.editSession?.annotations;\n // Keep the supplied content during editing. The editor moves annotation\n // rows through stable slots without rerendering their React children.\n if (sessionAnnotations != null) {\n return {\n file,\n lineAnnotations:\n lineAnnotations != null && this.isNewAnnotations(lineAnnotations)\n ? lineAnnotations\n : sessionAnnotations.provided,\n };\n }\n const workingFile = this.getWorkingFile(file) ?? file;\n const nextFile = this.fileRenderer.getFileForNextRender(workingFile);\n return {\n file: nextFile,\n lineAnnotations:\n lineAnnotations != null && areFileTargetsEqual(nextFile, workingFile)\n ? lineAnnotations\n : this.getAnnotationsForFile(nextFile),\n };\n }\n\n // Return the working file's annotations, including updates that have not\n // rendered yet.\n protected getLatestAnnotations(): LineAnnotation<LAnnotation>[] {\n return (\n this.pendingData?.lineAnnotations ??\n this.editSession?.annotations?.current ??\n this.lineAnnotations\n );\n }\n\n // Use pending annotations only when their file is selected for rendering.\n protected getAnnotationsForFile(\n file: FileContents\n ): LineAnnotation<LAnnotation>[] {\n const { pendingData } = this;\n return pendingData != null && areFileTargetsEqual(file, pendingData.file)\n ? pendingData.lineAnnotations\n : this.lineAnnotations;\n }\n\n // Update the displayed file and its annotations together after rendering. If\n // highlighting keeps the previous file displayed, leave the next pair queued\n // in pendingData.\n private adoptRenderData(file: FileContents): void {\n const { pendingData } = this;\n const matchesPending =\n pendingData != null && areFileTargetsEqual(file, pendingData.file);\n this.renderedData = {\n file,\n lineAnnotations: matchesPending\n ? pendingData.lineAnnotations\n : this.lineAnnotations,\n };\n if (matchesPending) {\n this.pendingData = undefined;\n }\n }\n\n // Check whether the annotation array is new. Reusing a tracked array must\n // not reset positions moved by editing.\n protected isNewAnnotations(\n lineAnnotations: LineAnnotation<LAnnotation>[]\n ): boolean {\n const session = this.editSession?.annotations;\n const latestAnnotations = this.getLatestAnnotations();\n if (lineAnnotations === latestAnnotations) {\n return false;\n }\n return (\n session == null ||\n (lineAnnotations !== session.provided &&\n lineAnnotations !== session.current)\n );\n }\n\n // Store a new input and create its editable copy if an editor is attached.\n // The next editor sync decides whether to keep or reset undo history. Return\n // false if the input has not changed.\n protected updateInputFile(\n incomingFile: FileContents,\n lineAnnotations?: LineAnnotation<LAnnotation>[]\n ): boolean {\n if (areFileTargetsEqual(this.getInputFile(), incomingFile)) {\n return false;\n }\n\n const hadSession = this.editSession != null;\n const previousAnnotations = this.getLatestAnnotations();\n this.file = incomingFile;\n\n if (hadSession || this.editor != null) {\n this.installEditSession(\n incomingFile,\n hadSession\n ? undefined\n : this.editor?.__getDocumentContents(incomingFile),\n true\n );\n } else {\n this.editSession = undefined;\n }\n if (this.editSession?.annotations != null && lineAnnotations != null) {\n // These annotations arrived with the new file, so their line numbers\n // describe it. The positions the session tracked for the old document\n // mean nothing now: the session restarts from these annotations, and\n // they also become what renders once the session ends.\n this.editSession.annotations = adoptEditSessionAnnotations(\n lineAnnotations,\n getLineAnnotationName,\n this.editSession.annotations\n );\n }\n this.pendingData = {\n file: this.editSession?.file ?? incomingFile,\n lineAnnotations:\n this.editSession?.annotations?.current ??\n lineAnnotations ??\n previousAnnotations,\n };\n return true;\n }\n\n // Create an editable copy of inputFile. When reopening a saved document,\n // retainedDocument supplies its edited text instead. Keep tracked\n // annotations if a session already exists.\n //\n // hostReplacement tells the next sync to replace the editor's text when\n // the editable copy uses the new input text.\n private installEditSession(\n inputFile: FileContents,\n retainedDocument?: FileContents,\n hostReplacement = false\n ): void {\n const usesInputDocument =\n retainedDocument == null ||\n (retainedDocument.name === inputFile.name &&\n retainedDocument.lang === inputFile.lang &&\n retainedDocument.contents === inputFile.contents);\n const file = createEditSessionFile(retainedDocument ?? inputFile);\n // Seed annotations on first attach so a later external replacement can\n // restart their positions. A live session keeps its current collection.\n const annotations =\n this.editSession?.annotations ??\n adoptEditSessionAnnotations(\n this.getLatestAnnotations(),\n getLineAnnotationName\n );\n this.editSession = {\n file,\n inputFile,\n externalReplacement: hostReplacement && usesInputDocument,\n annotations,\n };\n this.pendingData = {\n file,\n lineAnnotations: annotations.current,\n };\n this.fileRenderer.beginEditSession(\n file,\n usesInputDocument ? inputFile : undefined\n );\n }\n\n public onThemeChange(): void {\n this.fileRenderer.clearRenderCache();\n this.rerender();\n }\n\n public setOptions(\n options: FileOptions<LAnnotation, Caret> | undefined\n ): void {\n if (options == null) return;\n this.options = options;\n this.cachedHeaderHTML = undefined;\n this.syncInteractionOptions();\n }\n\n protected syncInteractionOptions(): void {\n this.interactionManager.setOptions(pluckInteractionOptions(this.options));\n }\n\n private mergeOptions(\n options: Partial<FileOptions<LAnnotation, Caret>>\n ): void {\n this.options = { ...this.options, ...options };\n }\n\n public setThemeType(themeType: ThemeTypes): void {\n if ((this.options.themeType ?? 'system') === themeType) {\n return;\n }\n this.mergeOptions({ themeType });\n this.applyCachedThemeState(themeType);\n }\n\n private applyCachedThemeState(themeType: ThemeTypes): boolean {\n if (\n typeof this.options.theme === 'string' ||\n this.fileContainer == null ||\n this.appliedThemeCSS == null\n ) {\n return false;\n }\n const effectiveThemeType = this.appliedThemeCSS.baseThemeType ?? themeType;\n if (this.appliedThemeCSS.themeType === effectiveThemeType) {\n return false;\n }\n this.applyThemeState(\n this.fileContainer,\n this.appliedThemeCSS.themeStyles,\n themeType,\n this.appliedThemeCSS.baseThemeType\n );\n return true;\n }\n\n private hasThemeChanged(): boolean {\n return (\n this.appliedThemeCSS != null &&\n !areThemesEqual(this.appliedThemeCSS.theme, this.getTheme())\n );\n }\n\n public getHoveredLine = (): GetHoveredLineResult<'file'> | undefined => {\n return this.interactionManager.getHoveredLine();\n };\n\n public setLineAnnotations(\n lineAnnotations: LineAnnotation<LAnnotation>[]\n ): void {\n const sessionAnnotations = this.editSession?.annotations;\n if (sessionAnnotations != null) {\n if (!this.isNewAnnotations(lineAnnotations)) {\n return;\n }\n // Keep the caller's collection for completion and revert; editing can\n // remap the displayed collection without changing this baseline.\n writeEditSessionAnnotations(\n sessionAnnotations,\n lineAnnotations,\n getLineAnnotationName\n );\n }\n const file = this.getWorkingFile();\n if (file != null) {\n this.pendingData = { file, lineAnnotations };\n }\n }\n\n // Takes annotations the editor remapped and makes them what the session\n // renders: updates the session, feeds the renderer, and re-renders\n // annotation rows. Returns true when new annotations were adopted —\n // virtualized subclasses override this and refresh their layout on true.\n //\n // The editor delivers annotations through two calls. An edit that changes\n // the line count sends them with the structural rebuild\n // (applyDocumentChange) and again with the change event (__acceptEditorChange);\n // the identity check makes the second call a no-op. An edit that keeps the\n // line count skips the rebuild, so the event is its only path here.\n //\n // The annotations the caller passed in are never touched — stale\n // re-renders keep deduping against them.\n protected syncEditSessionAnnotationsFromEditor(\n lineAnnotations: LineAnnotation<LAnnotation>[]\n ): boolean {\n const session = this.editSession?.annotations;\n if (session == null || lineAnnotations === session.current) {\n return false;\n }\n session.current = lineAnnotations;\n if (this.renderedData != null) {\n this.renderedData.lineAnnotations = lineAnnotations;\n }\n this.pendingData = undefined;\n this.fileRenderer.setLineAnnotations(lineAnnotations);\n this.renderAnnotations();\n return true;\n }\n\n public setSelectedLines(\n range: SelectedLineRange | null,\n options?: SelectionWriteOptions\n ): void {\n this.interactionManager.setSelection(range, options);\n }\n\n public setEditorActiveLine(\n lineNumber: number | null,\n options?: EditorActiveLineOptions\n ): void {\n this.interactionManager.setEditorActiveLine(lineNumber, {\n lineNumberOnly: options?.lineNumberOnly,\n side: options?.side ?? 'additions',\n });\n }\n\n public getCodeScrollLeft(): number {\n return this.code?.scrollLeft ?? 0;\n }\n\n public setCodeScrollLeft(position: number): void {\n if (this.code != null) {\n this.code.scrollLeft = position;\n }\n }\n\n public __getEffectiveCodeOptions(): BaseCodeOptions {\n return { ...this.options, ...this.fileRenderer.getEffectiveCodeOptions() };\n }\n\n public flushManagers(): void {\n if (!this.managersDirty || this.pre == null) {\n this.managersDirty = false;\n return;\n }\n\n const { overflow = 'scroll' } = this.options;\n this.interactionManager.setup(this.pre);\n this.resizeManager.setup(this.pre, {\n disableAnnotations: overflow === 'wrap',\n columnVariables: this.shouldApplyColumnVariables(overflow)\n ? 'apply'\n : 'measure',\n });\n this.managersDirty = false;\n }\n\n protected shouldApplyColumnVariables(overflow: 'scroll' | 'wrap'): boolean {\n return overflow === 'scroll' && this.lineAnnotations.length > 0;\n }\n\n public cleanUp(recycle = false): void {\n const editor = this.editor;\n this.emitPostRender(true);\n // Tear the editor down while the code scroller still exists. A recycle\n // keeps its document and undo history; a full teardown drops them as the\n // session ends.\n editor?.cleanUp(recycle ? 'recycle' : 'discard');\n if (!recycle) {\n this.editor = undefined;\n }\n this.resizeManager.cleanUp();\n this.interactionManager.cleanUp();\n this.managersDirty = false;\n this.workerManager?.unsubscribeToThemeChanges(this);\n this.renderRange = undefined;\n\n // Clean up the elements\n if (!this.isComponentManaged) {\n this.fileContainer?.remove();\n }\n this.fileContainer = undefined;\n this.mounted = false;\n if (!recycle) {\n this.renderedData = undefined;\n this.pendingData = undefined;\n }\n this.clearAuxiliaryNodes();\n this.pre?.remove();\n this.pre = undefined;\n this.code = undefined;\n this.bufferBefore?.remove();\n this.bufferBefore = undefined;\n this.bufferAfter?.remove();\n this.bufferAfter = undefined;\n this.appliedPreAttributes = undefined;\n this.lastRowCount = undefined;\n this.headerElement?.remove();\n this.headerElement = undefined;\n this.clearHeaderSlots();\n this.lastRenderedHeaderHTML = undefined;\n if (!recycle) {\n this.cachedHeaderHTML = undefined;\n }\n this.errorWrapper?.remove();\n this.errorWrapper = undefined;\n this.spriteSVG = undefined;\n this.themeCSSStyle = undefined;\n this.appliedThemeCSS = undefined;\n this.hasAdoptedThemeCSS = false;\n this.unsafeCSSStyle = undefined;\n this.appliedUnsafeCSS = undefined;\n this.placeHolder?.remove();\n this.placeHolder = undefined;\n\n if (recycle) {\n this.fileRenderer.recycle();\n } else {\n this.fileRenderer.cleanUp();\n this.workerManager = undefined;\n this.file = undefined;\n this.editSession = undefined;\n }\n this.enabled = false;\n }\n\n public virtualizedSetup(): void {\n this.enabled = true;\n this.workerManager?.subscribeToThemeChanges(this);\n }\n\n public hydrate(props: FileHydrateProps<LAnnotation>): void {\n const {\n fileContainer,\n prerenderedHTML,\n preventEmit = false,\n file,\n lineAnnotations,\n } = props;\n if (!this.enabled) {\n throw new Error(\n 'File.hydrate: attempting to call hydrate after cleaned up'\n );\n }\n if (this.fileContainer != null) {\n throw new Error(\n 'File.hydrate: hydrate can only be called before the instance has rendered or hydrated'\n );\n }\n this.hydrateElements(fileContainer, prerenderedHTML);\n // An editor attached before hydration may carry a retained keyed document.\n // Render through the private edit session instead of adopting external\n // markup, so the restored document owns the first hydrated paint.\n const forceEditorRender = this.editor != null;\n if (\n forceEditorRender ||\n shouldRenderCode(this.pre, file, this.options.collapsed) ||\n shouldRenderHeader(\n this.headerElement,\n file,\n this.options.disableFileHeader\n )\n ) {\n this.render({\n ...props,\n forceRender: forceEditorRender || props.forceRender,\n preventEmit: true,\n });\n }\n // Otherwise orchestrate our setup.\n else {\n this.hydrationSetup({ file, lineAnnotations });\n }\n if (!preventEmit) {\n this.emitPostRender();\n }\n }\n\n protected hydrateElements(\n fileContainer: HTMLElement,\n prerenderedHTML: string | undefined\n ): void {\n if (this.fileContainer !== fileContainer) {\n this.emitPostRender(true);\n }\n prerenderHTMLIfNecessary(fileContainer, prerenderedHTML);\n for (const element of Array.from(\n fileContainer.shadowRoot?.children ?? []\n )) {\n if (element instanceof SVGElement) {\n this.spriteSVG = element;\n continue;\n }\n if (!(element instanceof HTMLElement)) {\n continue;\n }\n if (element instanceof HTMLPreElement) {\n this.pre = element;\n this.appliedPreAttributes = undefined;\n continue;\n }\n if (\n element instanceof HTMLStyleElement &&\n element.hasAttribute(THEME_CSS_ATTRIBUTE)\n ) {\n this.themeCSSStyle = element;\n continue;\n }\n if (\n element instanceof HTMLStyleElement &&\n element.hasAttribute(UNSAFE_CSS_ATTRIBUTE)\n ) {\n this.unsafeCSSStyle = element;\n this.appliedUnsafeCSS = element.textContent;\n continue;\n }\n if ('diffsHeader' in element.dataset) {\n this.headerElement = element;\n this.lastRenderedHeaderHTML = undefined;\n continue;\n }\n }\n if (this.pre != null) {\n this.syncCodeNodeFromPre(this.pre);\n this.pre.removeAttribute('data-dehydrated');\n }\n this.fileContainer = fileContainer;\n this.hydrateMeasuredScrollbar();\n }\n\n protected hydrationSetup({\n file,\n lineAnnotations,\n }: HydrationSetup<LAnnotation>): void {\n this.renderedData = {\n file,\n lineAnnotations: lineAnnotations ?? this.getLatestAnnotations(),\n };\n this.pendingData = undefined;\n this.file = file;\n this.fileRenderer.setOptions(getFileRendererOptions(this.options));\n this.syncInteractionOptions();\n if (this.pre == null) {\n return;\n }\n this.fileRenderer.hydrate(file);\n this.renderAnnotations();\n this.renderGutterUtility();\n this.injectUnsafeCSS();\n this.managersDirty = true;\n this.flushManagers();\n }\n\n public getOrCreateLineCache(\n file: FileContents | undefined = this.getWorkingFile()\n ): string[] {\n return file != null\n ? this.fileRenderer.getOrCreateLineCache(file)\n : EMPTY_STRINGS;\n }\n\n protected updateBuffers(renderRange: RenderRange): void {\n if (this.pre != null) {\n this.applyBuffers(this.pre, renderRange);\n }\n }\n\n private syncRenderViewToEditor(): void {\n const { editor, fileContainer, renderRange } = this;\n const lineAnnotations = this.getLatestAnnotations();\n const file = this.getWorkingFile();\n if (editor == null || fileContainer == null || file == null) {\n return;\n }\n const syncEditor = (highlighter: DiffsHighlighter): void => {\n if (\n !this.enabled ||\n this.editor !== editor ||\n this.fileContainer !== fileContainer ||\n this.getWorkingFile() !== file\n ) {\n return;\n }\n editor.__syncRenderView({\n highlighter,\n fileContainer,\n file,\n lineAnnotations,\n renderRange,\n externalDocument: this.editSession?.externalReplacement === true,\n });\n };\n\n const theme = this.getTheme();\n const lang = file.lang ?? getFiletypeFromFileName(file.name);\n // Sync editor synchronously whenever the shared highlighter is ready;\n // otherwise load it and sync once it resolves.\n const highlighter = getHighlighterIfLoaded({\n theme,\n lang,\n });\n if (highlighter != null) {\n syncEditor(highlighter);\n } else {\n void getSharedHighlighter({\n themes: getThemes(theme),\n langs: Array.from(new Set(['text', lang])),\n preferredHighlighter: resolvePreferredHighlighter(\n this.workerManager,\n this.options\n ),\n })\n .then(syncEditor)\n .catch((error: unknown) => {\n if (!(error instanceof HighlighterDisposedError)) {\n console.error(error);\n }\n });\n }\n }\n\n /** @internal The editor applied or edited past the pending external replacement. */\n public __acknowledgeDocumentUpdate(): void {\n if (this.editSession != null) {\n this.editSession.externalReplacement = false;\n }\n }\n\n /** @internal Settle annotations */\n public __acceptEditorChange(\n event: EditorChangeEvent<'file', LAnnotation, Caret>\n ): void {\n const { lineAnnotations } = event;\n if (lineAnnotations != null) {\n this.syncEditSessionAnnotationsFromEditor(lineAnnotations);\n }\n }\n\n public emitEditChange(\n event: EditorChangeEvent<'file', LAnnotation, Caret>\n ): void {\n const { onEditChange } = this.options;\n onEditChange?.(event);\n }\n\n /** @internal Plain files have no component-owned diff session state. */\n public __captureDocumentSessionState(): undefined {\n return undefined;\n }\n\n /** @internal Associate this component with its editor for a render lifecycle. */\n public __attachEditor(\n editor: Editor<'file', LAnnotation, Caret>\n ): () => void {\n if (this.editor != null) {\n throw new Error('File.__attachEditor: an editor is already attached');\n }\n this.editor = editor;\n const detach = () => {\n this.editor = undefined;\n this.fileRenderer.endEditSession();\n };\n try {\n this.resumeEditorRendering(editor);\n return detach;\n } catch (error) {\n detach();\n throw error;\n }\n }\n\n /** @internal Resume rendering for the editor already associated with this component. */\n public __resumeEditor(editor: Editor<'file', LAnnotation, Caret>): void {\n if (this.editor !== editor) {\n throw new Error('File.__resumeEditor: editor association changed');\n }\n this.resumeEditorRendering(editor);\n }\n\n private resumeEditorRendering(\n editor: Editor<'file', LAnnotation, Caret>\n ): void {\n // A retained session just re-starts its render; a fresh attach with a file\n // installs a session seeded from the editor's document. The editor can also\n // attach before the file arrives, there is nothing to begin yet, so the\n // session installs on the later hydrate.\n if (this.editSession != null) {\n this.fileRenderer.beginEditSession(this.editSession.file);\n } else {\n const inputFile = this.getInputFile();\n if (inputFile != null) {\n this.installEditSession(\n inputFile,\n editor.__getDocumentContents(inputFile)\n );\n }\n }\n const editSessionFile = this.editSession?.file;\n if (this.fileRenderer.editorRenderReady()) {\n if (\n editSessionFile != null &&\n this.fileRenderer.fileCache === editSessionFile\n ) {\n this.adoptRenderData(editSessionFile);\n }\n this.syncRenderViewToEditor();\n } else {\n // The current markup is missing the editor's token metadata, or its\n // highlight is still pending: render through the session, which also\n // syncs the render view once it paints.\n this.rerender();\n }\n }\n\n /**\n * @internal\n *\n * Ends the edit session and settles which file this component renders.\n * Requires the editor to be detached first. Does nothing when no session\n * exists, so callers can invoke it again safely after it has settled.\n *\n * `onEditComplete` receives the completed file, current input file, and\n * both annotation collections even when the final text is unchanged. In\n * `install` mode, accepting installs the completed file and its annotations;\n * rejecting or having no handler restores the external values. `discard`\n * mode always restores the external values. An accepted file cannot reuse\n * the replaced file's `cacheKey`.\n */\n public __completeEditSession(\n editor: Editor<'file', LAnnotation, Caret>,\n mode: 'install' | 'discard'\n ): void {\n this.settleEditSession(mode === 'install', editor);\n }\n\n private settleEditSession(\n installResult: boolean,\n editor: Editor<'file', LAnnotation, Caret> | undefined\n ): void {\n const { editSession } = this;\n if (editSession == null) {\n return;\n }\n const {\n file: editSessionFile,\n inputFile,\n annotations: editSessionAnnotations,\n } = editSession;\n const inputAnnotations =\n editSessionAnnotations?.provided ?? this.lineAnnotations;\n if (this.editor != null) {\n throw new Error(\n 'File.__completeEditSession: detach the editor before completing the session'\n );\n }\n\n const sessionAnnotationsCurrent = editSessionAnnotations?.current;\n let acceptedFile: FileContents | undefined;\n let failed = false;\n let failure: unknown;\n if (editor == null) {\n throw new Error(\n 'File.__completeEditSession: editor is required for completion'\n );\n }\n const completedFile = { ...editSessionFile };\n const event: FileEditCompleteEvent<LAnnotation, Caret> = {\n file: completedFile,\n editor,\n originalFile: inputFile,\n lineAnnotations: sessionAnnotationsCurrent,\n originalLineAnnotations: inputAnnotations,\n };\n // Frozen so a handler cannot swap the event's file/originalFile\n // references; nested mutation (a fresh cacheKey on event.file) still\n // works.\n Object.freeze(event);\n try {\n editor.__emitEditComplete(event);\n const decision = this.options.onEditComplete?.(event);\n if (decision === 'accept') {\n if (\n completedFile.cacheKey != null &&\n completedFile.cacheKey === inputFile.cacheKey\n ) {\n throw new Error(\n 'File.__completeEditSession: an accepted file must not reuse the replaced file cacheKey'\n );\n }\n acceptedFile = completedFile;\n }\n } catch (error) {\n failed = true;\n failure = error;\n }\n\n const settledFile =\n installResult && acceptedFile != null ? acceptedFile : inputFile;\n const settledAnnotations =\n installResult && acceptedFile != null\n ? (sessionAnnotationsCurrent ?? inputAnnotations)\n : inputAnnotations;\n this.editSession = undefined;\n this.file = settledFile;\n this.pendingData = {\n file: settledFile,\n lineAnnotations: settledAnnotations,\n };\n // The renderer can adopt the settled identity without repainting when\n // its current content already matches the completed or reverted file.\n this.fileRenderer.endEditSession(settledFile);\n if (areFileTargetsEqual(this.getRenderedFile(), settledFile)) {\n this.adoptRenderData(settledFile);\n }\n if (installResult && this.fileContainer != null) {\n this.rerender();\n }\n if (failed) {\n throw failure;\n }\n }\n\n // normally triggered by the host when the document line count changes\n public applyDocumentChange(\n textDocument: TextDocument<'file', LAnnotation>,\n newLineAnnotations?: LineAnnotation<LAnnotation>[]\n ): void {\n const editSessionFile = this.editSession?.file;\n if (editSessionFile == null) {\n throw new Error(\n 'File.applyDocumentChange: requires an active edit session'\n );\n }\n this.fileRenderer.beginEditSession(editSessionFile);\n this.fileRenderer.applyDocumentChange(textDocument);\n if (newLineAnnotations != null) {\n this.syncEditSessionAnnotationsFromEditor(newLineAnnotations);\n }\n }\n\n /** Update the session source without editor DOM, then rehighlight on return. */\n public applySuspendedDocumentChange(\n textDocument: TextDocument<'file', LAnnotation>,\n newLineAnnotations?: LineAnnotation<LAnnotation>[]\n ): void {\n if (this.editSession == null) {\n return;\n }\n this.applyDocumentChange(textDocument, newLineAnnotations);\n this.fileRenderer.clearRenderCache();\n }\n\n public updateRenderCache(\n dirtyLines: Map<number, Array<HighlightedToken>>,\n themeType: 'dark' | 'light',\n options?: {\n lineCountChangeInFlight?: boolean;\n }\n ): void {\n const editSessionFile = this.editSession?.file;\n if (editSessionFile == null) {\n throw new Error(\n 'File.updateRenderCache: requires an active edit session'\n );\n }\n this.fileRenderer.beginEditSession(editSessionFile);\n this.fileRenderer.updateRenderCache(\n dirtyLines,\n themeType,\n options?.lineCountChangeInFlight\n );\n }\n\n public render({\n file,\n fileContainer,\n forceRender = false,\n preventEmit = false,\n containerWrapper,\n deferManagers = false,\n lineAnnotations,\n renderRange,\n }: FileRenderProps<LAnnotation>): boolean {\n if (!this.enabled) {\n throw new Error(\n 'File.render: attempting to call render after cleaned up'\n );\n }\n forceRender = this.forceRenderOverride ?? forceRender;\n this.forceRenderOverride = undefined;\n\n // postpone background tokenizing to next frame for avoiding UI freeze\n // during render\n this.editor?.__postponeBgTokenizeToNextFrame();\n\n const { collapsed = false, themeType = 'system' } = this.options;\n const nextRenderRange = collapsed ? undefined : renderRange;\n const previousRenderRange = this.renderRange;\n const themeChanged = this.hasThemeChanged();\n const annotationsChanged =\n lineAnnotations != null &&\n (lineAnnotations.length > 0 || this.getLatestAnnotations().length > 0)\n ? this.isNewAnnotations(lineAnnotations)\n : false;\n const didFileChange = !areFileTargetsEqual(this.getInputFile(), file);\n if (didFileChange) {\n this.updateInputFile(file, lineAnnotations);\n }\n const workingFile = this.getWorkingFile(file) ?? file;\n if (\n !collapsed &&\n !forceRender &&\n areRenderRangesEqual(nextRenderRange, this.renderRange) &&\n !didFileChange &&\n !annotationsChanged &&\n !themeChanged\n ) {\n const rendered = this.applyCachedThemeState(themeType);\n if (rendered) {\n this.finalizeRender();\n }\n return rendered;\n }\n\n this.renderRange = nextRenderRange;\n if (didFileChange) {\n this.cachedHeaderHTML = undefined;\n }\n this.fileRenderer.setOptions(getFileRendererOptions(this.options));\n this.syncInteractionOptions();\n if (lineAnnotations != null) {\n this.setLineAnnotations(lineAnnotations);\n }\n const nextRenderFile = this.fileRenderer.getFileForNextRender(workingFile);\n this.fileRenderer.setLineAnnotations(\n this.getAnnotationsForFile(nextRenderFile)\n );\n\n const { disableErrorHandling = false, disableFileHeader = false } =\n this.options;\n if (disableFileHeader) {\n // Remove existing header from DOM\n if (this.headerElement != null) {\n this.headerElement.remove();\n this.headerElement = undefined;\n this.lastRenderedHeaderHTML = undefined;\n }\n this.clearHeaderSlots();\n }\n\n fileContainer = this.getOrCreateFileContainerNode(\n fileContainer,\n containerWrapper\n );\n this.applyCachedThemeState(themeType);\n\n if (collapsed) {\n this.removeRenderedCode();\n this.clearAuxiliaryNodes();\n\n try {\n const fileResult = this.fileRenderer.renderFile(\n workingFile,\n EMPTY_RENDER_RANGE\n );\n if (fileResult != null) {\n this.applyThemeState(\n fileContainer,\n fileResult.themeStyles,\n themeType,\n fileResult.baseThemeType\n );\n }\n if (fileResult?.headerAST != null) {\n this.applyHeaderToDOM(\n fileResult.headerAST,\n fileContainer,\n fileResult.file\n );\n }\n this.adoptRenderData(fileResult?.file ?? workingFile);\n this.injectUnsafeCSS();\n } catch (error: unknown) {\n if (disableErrorHandling) {\n throw error;\n }\n console.error(error);\n if (error instanceof Error) {\n this.applyErrorToDOM(error, fileContainer);\n }\n }\n this.finalizeRender();\n if (!preventEmit) {\n this.emitPostRender();\n }\n return true;\n }\n\n try {\n const pre = this.getOrCreatePreNode(fileContainer);\n let renderedFile = this.getRenderedFile();\n if (\n !this.canPartiallyRender(\n forceRender,\n annotationsChanged,\n didFileChange ||\n themeChanged ||\n !areFileTargetsEqual(this.getRenderedFile(), workingFile)\n ) ||\n !this.applyPartialRender(\n workingFile,\n previousRenderRange,\n nextRenderRange\n )\n ) {\n const fileResult = this.fileRenderer.renderFile(\n workingFile,\n nextRenderRange\n );\n if (fileResult == null) {\n if (\n this.workerManager?.isInitialized() === false &&\n this.workerManager.isWorkingPool()\n ) {\n void this.workerManager\n .initialize()\n .catch(() => {})\n .then(() => this.rerender());\n }\n return false;\n }\n this.applyThemeState(\n fileContainer,\n fileResult.themeStyles,\n themeType,\n fileResult.baseThemeType\n );\n if (fileResult.headerAST != null) {\n this.applyHeaderToDOM(\n fileResult.headerAST,\n fileContainer,\n fileResult.file\n );\n }\n this.applyFullRender(fileResult, pre);\n renderedFile = fileResult.file;\n }\n\n this.applyBuffers(pre, nextRenderRange);\n this.injectUnsafeCSS();\n if (renderedFile != null) {\n this.adoptRenderData(renderedFile);\n }\n this.renderAnnotations();\n this.renderGutterUtility();\n\n this.managersDirty = true;\n if (!deferManagers) {\n this.flushManagers();\n }\n\n this.finalizeRender();\n if (this.editor != null) {\n this.syncRenderViewToEditor();\n }\n } catch (error: unknown) {\n if (disableErrorHandling) {\n throw error;\n }\n console.error(error);\n if (error instanceof Error) {\n this.applyErrorToDOM(error, fileContainer);\n }\n }\n if (!preventEmit) {\n this.emitPostRender();\n }\n return true;\n }\n\n // Finish subclass layout bookkeeping before editor sync or post-render\n // callbacks can synchronously replace or dispose this component.\n protected finalizeRender(): void {}\n\n private emitPostRender(unmount = false) {\n const {\n fileContainer,\n options: { onPostRender },\n } = this;\n\n if (unmount) {\n if (!this.mounted) {\n return;\n }\n this.mounted = false;\n if (fileContainer == null) {\n return;\n }\n onPostRender?.(fileContainer, this, 'unmount');\n return;\n }\n\n if (fileContainer == null) {\n return;\n }\n\n const phase: PostRenderPhase = this.mounted ? 'update' : 'mount';\n this.mounted = true;\n onPostRender?.(fileContainer, this, phase);\n }\n\n private removeRenderedCode(): void {\n this.resizeManager.cleanUp();\n this.interactionManager.cleanUp();\n\n this.bufferBefore?.remove();\n this.bufferBefore = undefined;\n this.bufferAfter?.remove();\n this.bufferAfter = undefined;\n\n this.code?.remove();\n this.code = undefined;\n\n this.pre?.remove();\n this.pre = undefined;\n\n this.appliedPreAttributes = undefined;\n this.lastRowCount = undefined;\n }\n\n private clearAuxiliaryNodes(): void {\n for (const { element } of this.annotationCache.values()) {\n element.remove();\n }\n this.annotationCache.clear();\n\n this.gutterUtilityContent?.remove();\n this.gutterUtilityContent = undefined;\n }\n\n private canPartiallyRender(\n forceRender: boolean,\n annotationsChanged: boolean,\n didContentChange: boolean\n ): boolean {\n if (forceRender || annotationsChanged || didContentChange) {\n return false;\n }\n return true;\n }\n\n public renderPlaceholder(height: number): boolean {\n if (this.fileContainer == null) {\n return false;\n }\n this.emitPostRender(true);\n this.cleanChildNodes();\n\n if (this.placeHolder == null) {\n const shadowRoot =\n this.fileContainer.shadowRoot ??\n this.fileContainer.attachShadow({ mode: 'open' });\n this.placeHolder = document.createElement('div');\n this.placeHolder.dataset.placeholder = '';\n shadowRoot.appendChild(this.placeHolder);\n }\n return this.setPlaceholderHeight(height);\n }\n\n protected setPlaceholderHeight(height: number): boolean {\n if (this.placeHolder == null) {\n return false;\n }\n this.placeHolder.style.setProperty('height', `${height}px`);\n return true;\n }\n\n public async primeHighlightCache(\n file: FileContents | undefined = this.getInputFile()\n ): Promise<void> {\n const { workerManager } = this;\n if (\n file == null ||\n workerManager == null ||\n !workerManager.isWorkingPool() ||\n file.cacheKey == null ||\n isFilePlainText(file)\n ) {\n return;\n }\n const tokenizeMaxLength =\n this.options.tokenizeMaxLength ?? DEFAULT_TOKENIZE_MAX_LENGTH;\n const lines = this.fileRenderer.getOrCreateLineCache(file);\n if (lines.length > tokenizeMaxLength) {\n return;\n }\n\n await workerManager\n .primeFileHighlightCache(file)\n .catch((error: unknown) => {\n if (isHandledWorkerPoolError(error)) {\n return;\n }\n console.error(error);\n });\n }\n\n private cleanChildNodes() {\n this.resizeManager.cleanUp();\n this.interactionManager.cleanUp();\n this.clearAuxiliaryNodes();\n\n this.bufferAfter?.remove();\n this.bufferBefore?.remove();\n this.code?.remove();\n this.errorWrapper?.remove();\n this.headerElement?.remove();\n this.headerPrefix?.remove();\n this.headerFilenameSuffix?.remove();\n this.headerMetadata?.remove();\n this.headerCustom?.remove();\n this.pre?.remove();\n this.spriteSVG?.remove();\n this.themeCSSStyle?.remove();\n this.unsafeCSSStyle?.remove();\n\n this.bufferAfter = undefined;\n this.bufferBefore = undefined;\n this.code = undefined;\n this.errorWrapper = undefined;\n this.headerElement = undefined;\n this.headerPrefix = undefined;\n this.headerFilenameSuffix = undefined;\n this.headerMetadata = undefined;\n this.headerCustom = undefined;\n this.pre = undefined;\n this.spriteSVG = undefined;\n this.themeCSSStyle = undefined;\n this.appliedThemeCSS = undefined;\n this.hasAdoptedThemeCSS = false;\n this.unsafeCSSStyle = undefined;\n this.appliedUnsafeCSS = undefined;\n\n this.lastRenderedHeaderHTML = undefined;\n this.lastRowCount = undefined;\n\n this.mounted = false;\n }\n\n private renderAnnotations(): void {\n if (this.isComponentManaged || this.fileContainer == null) {\n for (const { element } of this.annotationCache.values()) {\n element.remove();\n }\n this.annotationCache.clear();\n return;\n }\n const staleAnnotations = new Map(this.annotationCache);\n const { renderAnnotation } = this.options;\n const { renderedData } = this;\n if (renderAnnotation != null && renderedData != null) {\n const { file, lineAnnotations } = renderedData;\n for (const [index, annotation] of lineAnnotations.entries()) {\n const name = this.getAnnotationSlotName(annotation);\n const id = `${index}-${name}`;\n let cache = this.annotationCache.get(id);\n if (\n cache == null ||\n cache.file !== file ||\n !areLineAnnotationsEqual(annotation, cache.annotation)\n ) {\n cache?.element.remove();\n const content = renderAnnotation(annotation, file);\n // If we can't render anything, then we should not render anything\n // and clear the annotation cache if necessary.\n if (content == null) {\n continue;\n }\n cache = {\n element: createAnnotationWrapperNode(name),\n annotation,\n file,\n };\n cache.element.appendChild(content);\n this.fileContainer.appendChild(cache.element);\n this.annotationCache.set(id, cache);\n }\n staleAnnotations.delete(id);\n }\n }\n for (const [id, { element }] of staleAnnotations.entries()) {\n this.annotationCache.delete(id);\n element.remove();\n }\n }\n\n private renderGutterUtility() {\n const { renderGutterUtility } = this.options;\n if (this.fileContainer == null || renderGutterUtility == null) {\n this.gutterUtilityContent?.remove();\n this.gutterUtilityContent = undefined;\n return;\n }\n const element = renderGutterUtility(this.interactionManager.getHoveredLine);\n if (element != null && this.gutterUtilityContent != null) {\n return;\n } else if (element == null) {\n this.gutterUtilityContent?.remove();\n this.gutterUtilityContent = undefined;\n return;\n }\n const gutterUtilityContent = createGutterUtilityContentNode();\n gutterUtilityContent.appendChild(element);\n this.fileContainer.appendChild(gutterUtilityContent);\n this.gutterUtilityContent = gutterUtilityContent;\n }\n\n private injectUnsafeCSS(): void {\n const { unsafeCSS } = this.options;\n this.pre?.toggleAttribute('data-custom-styles', Boolean(unsafeCSS));\n const shadowRoot = this.fileContainer?.shadowRoot;\n if (shadowRoot == null) {\n return;\n }\n\n if (unsafeCSS == null || unsafeCSS === '') {\n if (this.unsafeCSSStyle != null) {\n this.unsafeCSSStyle.remove();\n this.unsafeCSSStyle = undefined;\n }\n this.appliedUnsafeCSS = undefined;\n return;\n }\n\n if (\n this.unsafeCSSStyle?.parentNode === shadowRoot &&\n this.appliedUnsafeCSS === unsafeCSS\n ) {\n return;\n }\n\n // Create or update the style element\n this.unsafeCSSStyle ??= createUnsafeCSSStyleNode();\n if (this.unsafeCSSStyle.parentNode !== shadowRoot) {\n shadowRoot.appendChild(this.unsafeCSSStyle);\n }\n // Wrap in @layer unsafe to match SSR behavior\n this.unsafeCSSStyle.textContent = wrapUnsafeCSS(unsafeCSS);\n this.appliedUnsafeCSS = unsafeCSS;\n }\n\n private applyThemeState(\n container: HTMLElement,\n themeStyles: string,\n themeType: ThemeTypes,\n baseThemeType?: 'light' | 'dark'\n ): void {\n const shadowRoot =\n container.shadowRoot ?? container.attachShadow({ mode: 'open' });\n const effectiveThemeType = baseThemeType ?? themeType;\n const currentTheme = this.getTheme();\n const theme =\n typeof currentTheme === 'string' ? currentTheme : { ...currentTheme };\n const scrollbarGutter = getMeasuredScrollbarGutter(shadowRoot);\n if (\n this.themeCSSStyle?.parentNode === shadowRoot &&\n this.appliedThemeCSS?.themeStyles === themeStyles &&\n this.appliedThemeCSS.themeType === effectiveThemeType &&\n this.appliedThemeCSS.scrollbarGutter === scrollbarGutter\n ) {\n this.appliedThemeCSS.theme = theme;\n return;\n }\n if (\n this.hasAdoptedThemeCSS &&\n this.themeCSSStyle?.parentNode === shadowRoot\n ) {\n this.hasAdoptedThemeCSS = false;\n this.appliedThemeCSS = {\n theme,\n themeStyles,\n themeType: effectiveThemeType,\n baseThemeType,\n scrollbarGutter,\n };\n return;\n }\n this.themeCSSStyle = upsertHostThemeStyle({\n shadowRoot,\n currentNode: this.themeCSSStyle,\n themeCSS: wrapThemeCSS(themeStyles, effectiveThemeType, scrollbarGutter),\n });\n this.appliedThemeCSS =\n this.themeCSSStyle != null\n ? {\n theme,\n themeStyles,\n themeType: effectiveThemeType,\n baseThemeType,\n scrollbarGutter,\n }\n : undefined;\n }\n\n private hydrateMeasuredScrollbar(): void {\n const shadowRoot = this.fileContainer?.shadowRoot;\n if (shadowRoot == null || this.themeCSSStyle == null) {\n return;\n }\n this.themeCSSStyle.textContent = patchScrollbarGutterSize(\n this.themeCSSStyle.textContent ?? '',\n getMeasuredScrollbarGutter(shadowRoot)\n );\n }\n\n // A boolean check to ensure that edit mode in WebKit doesn't cause potential\n // scroll jumps to due bugs with WebKit. The workarounds have performance\n // implications so we avoid running the workarounds on browsers or scenarios\n // where they are not applicable\n protected shouldGuardRebuildScroll(): boolean {\n return this.editor != null && isSafari();\n }\n\n private applyFullRender(result: FileRenderResult, pre: HTMLPreElement): void {\n this.cleanupErrorWrapper();\n this.applyPreNodeAttributes(pre, result);\n const code = (this.code = getOrCreateCodeNode({ code: this.code }));\n const codeAst = this.fileRenderer.renderCodeAST(result);\n this.editor?.__captureFocusForDOMReplacement();\n const applyColumns = () => {\n if (code.childElementCount >= 2) {\n for (let i = 0; i < 2; i++) {\n const domEl = code.children[i] as HTMLElement;\n const astEl = codeAst[i] as HASTElement;\n domEl.innerHTML = hastToHtml(astEl.children);\n domEl.style.cssText = astEl.properties.style as string;\n }\n } else {\n code.innerHTML = hastToHtml(codeAst);\n }\n if (!pre.contains(code)) {\n pre.replaceChildren(code);\n }\n };\n if (this.shouldGuardRebuildScroll()) {\n guardWebKitScrollDuringRebuild(pre, applyColumns);\n } else {\n applyColumns();\n }\n this.lastRowCount = result.rowCount;\n }\n\n private applyPartialRender(\n file: FileContents,\n previousRenderRange: RenderRange | undefined,\n renderRange: RenderRange | undefined\n ): boolean {\n if (previousRenderRange == null || renderRange == null) {\n return false;\n }\n const { code } = this;\n const columns = code != null ? this.getColumns(code) : undefined;\n if (code == null || columns == null) {\n return false;\n }\n\n const previousStart = previousRenderRange.startingLine;\n const nextStart = renderRange.startingLine;\n const previousEnd =\n previousRenderRange.totalLines === Infinity\n ? Number.POSITIVE_INFINITY\n : previousStart + previousRenderRange.totalLines;\n const nextEnd =\n renderRange.totalLines === Infinity\n ? Number.POSITIVE_INFINITY\n : nextStart + renderRange.totalLines;\n\n const overlapStart = Math.max(previousStart, nextStart);\n const overlapEnd = Math.min(previousEnd, nextEnd);\n if (overlapEnd <= overlapStart) {\n return false;\n }\n\n if (\n !this.trimDOMToOverlap(columns.gutter, overlapStart, overlapEnd) ||\n !this.trimDOMToOverlap(columns.content, overlapStart, overlapEnd)\n ) {\n throw new Error('File.applyPartialRender: failed to trim to overlap');\n }\n\n let { length: rowCount } = columns.content.children;\n\n const renderChunk = (\n startingLine: number,\n totalLines: number\n ): FileRenderResult | undefined => {\n if (totalLines <= 0) {\n return undefined;\n }\n return this.fileRenderer.renderFile(file, {\n startingLine,\n totalLines,\n bufferBefore: 0,\n bufferAfter: 0,\n });\n };\n\n const prependResult =\n nextStart < overlapStart\n ? renderChunk(nextStart, overlapStart - nextStart)\n : undefined;\n if (prependResult === undefined && nextStart < overlapStart) {\n return false;\n }\n\n const appendTotalLines =\n nextEnd === Number.POSITIVE_INFINITY\n ? Number.POSITIVE_INFINITY\n : Math.max(0, nextEnd - overlapEnd);\n const appendResult =\n nextEnd > overlapEnd\n ? renderChunk(overlapEnd, appendTotalLines)\n : undefined;\n if (appendResult === undefined && nextEnd > overlapEnd) {\n return false;\n }\n\n this.cleanupErrorWrapper();\n if (prependResult != null) {\n columns.gutter.insertAdjacentHTML(\n 'afterbegin',\n this.fileRenderer.renderPartialHTML(prependResult.gutterAST)\n );\n columns.content.insertAdjacentHTML(\n 'afterbegin',\n this.fileRenderer.renderPartialHTML(prependResult.contentAST)\n );\n rowCount += prependResult.rowCount;\n }\n\n if (appendResult != null) {\n columns.gutter.insertAdjacentHTML(\n 'beforeend',\n this.fileRenderer.renderPartialHTML(appendResult.gutterAST)\n );\n columns.content.insertAdjacentHTML(\n 'beforeend',\n this.fileRenderer.renderPartialHTML(appendResult.contentAST)\n );\n rowCount += appendResult.rowCount;\n }\n\n if (this.lastRowCount !== rowCount) {\n columns.gutter.style.setProperty('grid-row', `span ${rowCount}`);\n columns.content.style.setProperty('grid-row', `span ${rowCount}`);\n this.lastRowCount = rowCount;\n }\n\n return true;\n }\n\n private getColumns(code: HTMLElement): ColumnElements | undefined {\n const gutter = code.children[0];\n const content = code.children[1];\n if (\n !(gutter instanceof HTMLElement) ||\n !(content instanceof HTMLElement) ||\n gutter.dataset.gutter == null ||\n content.dataset.content == null\n ) {\n return undefined;\n }\n return { gutter, content };\n }\n\n private trimDOMToOverlap(\n container: HTMLElement,\n overlapStart: number,\n overlapEnd: number\n ): boolean {\n const boundaryIndices = this.getDOMBoundaryIndices(container, [\n overlapStart,\n overlapEnd,\n ]);\n const startIndex =\n boundaryIndices.get(overlapStart) ?? container.children.length;\n const endIndex =\n boundaryIndices.get(overlapEnd) ?? container.children.length;\n\n if (startIndex > endIndex) {\n return false;\n }\n\n for (let i = container.children.length - 1; i >= endIndex; i -= 1) {\n container.children[i]?.remove();\n }\n for (let i = startIndex - 1; i >= 0; i -= 1) {\n container.children[i]?.remove();\n }\n return true;\n }\n\n private getDOMBoundaryIndices(\n container: HTMLElement,\n boundaries: number[]\n ): Map<number, number> {\n const sortedBoundaries = [...new Set(boundaries)].sort((a, b) => a - b);\n const boundaryIndices = new Map<number, number>();\n if (sortedBoundaries.length === 0) {\n return boundaryIndices;\n }\n let boundaryIndex = 0;\n let nextBoundary = sortedBoundaries[boundaryIndex];\n const { children } = container;\n\n if (nextBoundary === 0) {\n boundaryIndices.set(0, 0);\n boundaryIndex += 1;\n nextBoundary = sortedBoundaries[boundaryIndex];\n }\n\n for (let i = 0; i < children.length; i += 1) {\n const child = children[i];\n if (!(child instanceof HTMLElement)) {\n continue;\n }\n const lineIndex = this.getLineIndexFromDOMNode(child);\n if (lineIndex == null) {\n continue;\n }\n while (nextBoundary != null && lineIndex >= nextBoundary) {\n boundaryIndices.set(nextBoundary, i);\n boundaryIndex += 1;\n nextBoundary = sortedBoundaries[boundaryIndex];\n }\n if (boundaryIndex >= sortedBoundaries.length) {\n break;\n }\n }\n\n for (const boundary of sortedBoundaries) {\n if (!boundaryIndices.has(boundary)) {\n boundaryIndices.set(boundary, children.length);\n }\n }\n return boundaryIndices;\n }\n\n private getLineIndexFromDOMNode(node: HTMLElement): number | undefined {\n const lineIndexAttr = node.dataset.lineIndex;\n if (lineIndexAttr == null) {\n return undefined;\n }\n const parsed = Number(lineIndexAttr);\n return Number.isNaN(parsed) ? undefined : parsed;\n }\n\n private applyBuffers(\n pre: HTMLPreElement,\n renderRange: RenderRange | undefined\n ) {\n if (renderRange == null || this.shouldDisableVirtualizationBuffers()) {\n if (this.bufferBefore != null) {\n this.bufferBefore.remove();\n this.bufferBefore = undefined;\n }\n if (this.bufferAfter != null) {\n this.bufferAfter.remove();\n this.bufferAfter = undefined;\n }\n return;\n }\n\n if (renderRange.bufferBefore > 0) {\n if (this.bufferBefore == null) {\n this.bufferBefore = document.createElement('div');\n this.bufferBefore.dataset.virtualizerBuffer = 'before';\n pre.before(this.bufferBefore);\n }\n this.bufferBefore.style.setProperty(\n 'height',\n `${renderRange.bufferBefore}px`\n );\n this.bufferBefore.style.setProperty('contain', 'strict');\n } else if (this.bufferBefore != null) {\n this.bufferBefore.remove();\n this.bufferBefore = undefined;\n }\n\n if (renderRange.bufferAfter > 0) {\n if (this.bufferAfter == null) {\n this.bufferAfter = document.createElement('div');\n this.bufferAfter.dataset.virtualizerBuffer = 'after';\n pre.after(this.bufferAfter);\n }\n this.bufferAfter.style.setProperty(\n 'height',\n `${renderRange.bufferAfter}px`\n );\n this.bufferAfter.style.setProperty('contain', 'strict');\n } else if (this.bufferAfter != null) {\n this.bufferAfter.remove();\n this.bufferAfter = undefined;\n }\n }\n\n protected shouldDisableVirtualizationBuffers(): boolean {\n return this.options.disableVirtualizationBuffers ?? false;\n }\n\n private applyHeaderToDOM(\n headerAST: HASTElement,\n container: HTMLElement,\n file: FileContents\n ): void {\n this.cleanupErrorWrapper();\n this.placeHolder?.remove();\n this.placeHolder = undefined;\n const headerHTML = this.cachedHeaderHTML ?? hastToHtml(headerAST);\n this.cachedHeaderHTML = headerHTML;\n if (headerHTML !== this.lastRenderedHeaderHTML) {\n const tempDiv = document.createElement('div');\n tempDiv.innerHTML = headerHTML;\n const newHeader = tempDiv.firstElementChild;\n if (!(newHeader instanceof HTMLElement)) {\n return;\n }\n if (this.headerElement != null) {\n container.shadowRoot?.replaceChild(newHeader, this.headerElement);\n } else {\n container.shadowRoot?.prepend(newHeader);\n }\n this.headerElement = newHeader;\n this.lastRenderedHeaderHTML = headerHTML;\n }\n\n if (this.isComponentManaged) return;\n\n const {\n renderHeaderPrefix,\n renderHeaderFilenameSuffix,\n renderCustomHeader,\n renderHeaderMetadata,\n } = this.options;\n\n if (renderCustomHeader != null) {\n const content = renderCustomHeader(file) ?? undefined;\n this.headerCustom = this.upsertHeaderSlotElement(\n container,\n this.headerCustom,\n CUSTOM_HEADER_SLOT_ID,\n content\n );\n this.headerPrefix?.remove();\n this.headerFilenameSuffix?.remove();\n this.headerMetadata?.remove();\n this.headerPrefix = undefined;\n this.headerFilenameSuffix = undefined;\n this.headerMetadata = undefined;\n } else {\n const prefix = renderHeaderPrefix?.(file) ?? undefined;\n const suffix = renderHeaderFilenameSuffix?.(file) ?? undefined;\n const content = renderHeaderMetadata?.(file) ?? undefined;\n this.headerPrefix = this.upsertHeaderSlotElement(\n container,\n this.headerPrefix,\n HEADER_PREFIX_SLOT_ID,\n prefix\n );\n this.headerFilenameSuffix = this.upsertHeaderSlotElement(\n container,\n this.headerFilenameSuffix,\n HEADER_FILENAME_SUFFIX_SLOT_ID,\n suffix\n );\n this.headerMetadata = this.upsertHeaderSlotElement(\n container,\n this.headerMetadata,\n HEADER_METADATA_SLOT_ID,\n content\n );\n this.headerCustom?.remove();\n this.headerCustom = undefined;\n }\n }\n\n private clearHeaderSlots(): void {\n this.headerPrefix?.remove();\n this.headerFilenameSuffix?.remove();\n this.headerMetadata?.remove();\n this.headerCustom?.remove();\n this.headerPrefix = undefined;\n this.headerFilenameSuffix = undefined;\n this.headerMetadata = undefined;\n this.headerCustom = undefined;\n }\n\n // Header slot callbacks are presence-based render hooks, not reactive views.\n private upsertHeaderSlotElement(\n container: HTMLElement,\n current: HTMLElement | undefined,\n slot: string,\n content: Element | string | number | undefined\n ): HTMLElement | undefined {\n if (content == null) {\n current?.remove();\n return undefined;\n }\n const element = current ?? this.createHeaderSlotElement(slot);\n if (current == null) {\n container.appendChild(element);\n }\n this.replaceHeaderSlotContent(element, content);\n return element;\n }\n\n private replaceHeaderSlotContent(\n element: HTMLElement,\n content: Element | string | number\n ): void {\n element.replaceChildren();\n if (content instanceof Element) {\n element.appendChild(content);\n } else {\n element.innerText = `${content}`;\n }\n }\n\n private createHeaderSlotElement(slot: string): HTMLElement {\n const element = document.createElement('div');\n element.slot = slot;\n return element;\n }\n\n protected getOrCreateFileContainerNode(\n fileContainer?: HTMLElement,\n parentNode?: HTMLElement\n ): HTMLElement {\n const { fileContainer: previousContainer } = this;\n const nextContainer =\n fileContainer ??\n previousContainer ??\n document.createElement(DIFFS_TAG_NAME);\n const containerChanged = previousContainer !== nextContainer;\n if (previousContainer != null && containerChanged) {\n this.editor?.__captureFocusForDOMReplacement();\n }\n if (containerChanged) {\n this.emitPostRender(true);\n }\n this.fileContainer = nextContainer;\n if (previousContainer != null && containerChanged) {\n this.lastRenderedHeaderHTML = undefined;\n this.headerElement = undefined;\n }\n if (parentNode != null && this.fileContainer.parentNode !== parentNode) {\n parentNode.appendChild(this.fileContainer);\n }\n if (containerChanged) {\n this.adoptReusableShellElements(this.fileContainer);\n }\n this.ensureSpriteSVG(this.fileContainer);\n return this.fileContainer;\n }\n\n // NOTE(amadeus): Technically this method is not safe for use outside of\n // the CodeView component, however I don't think in practice it really\n // should matter, but maybe there's some system we need in place to prevent\n // this from running outside of that environment?\n //\n // It's making very specific assumptions that all the elements will have the\n // correct content based on CodeView global options\n private adoptReusableShellElements(fileContainer: HTMLElement): void {\n const { shadowRoot } = fileContainer;\n if (shadowRoot == null) {\n return;\n }\n\n for (const element of shadowRoot.children) {\n if (element instanceof SVGElement) {\n this.spriteSVG ??= element;\n } else if (\n isStyleNode(element) &&\n element.hasAttribute(THEME_CSS_ATTRIBUTE)\n ) {\n this.themeCSSStyle ??= element;\n this.hasAdoptedThemeCSS = true;\n } else if (\n isStyleNode(element) &&\n element.hasAttribute(UNSAFE_CSS_ATTRIBUTE)\n ) {\n this.unsafeCSSStyle ??= element;\n this.appliedUnsafeCSS ??= this.options.unsafeCSS ?? undefined;\n }\n }\n }\n\n private ensureSpriteSVG(fileContainer: HTMLElement): void {\n const shadowRoot =\n fileContainer.shadowRoot ?? fileContainer.attachShadow({ mode: 'open' });\n if (this.spriteSVG == null) {\n const fragment = document.createElement('div');\n fragment.innerHTML = SVGSpriteSheet;\n const firstChild = fragment.firstChild;\n if (firstChild instanceof SVGElement) {\n this.spriteSVG = firstChild;\n }\n }\n if (this.spriteSVG != null && this.spriteSVG.parentNode !== shadowRoot) {\n shadowRoot.appendChild(this.spriteSVG);\n }\n }\n\n private getOrCreatePreNode(container: HTMLElement): HTMLPreElement {\n const shadowRoot =\n container.shadowRoot ?? container.attachShadow({ mode: 'open' });\n // If we haven't created a pre element yet, lets go ahead and do that\n if (this.pre == null) {\n this.pre = document.createElement('pre');\n this.appliedPreAttributes = undefined;\n this.code = undefined;\n shadowRoot.appendChild(this.pre);\n }\n // If we have a new parent container for the pre element, lets go ahead and\n // move it into the new container\n else if (this.pre.parentNode !== shadowRoot) {\n this.editor?.__captureFocusForDOMReplacement();\n container.shadowRoot?.appendChild(this.pre);\n this.appliedPreAttributes = undefined;\n }\n\n this.placeHolder?.remove();\n this.placeHolder = undefined;\n\n return this.pre;\n }\n\n private syncCodeNodeFromPre(pre: HTMLPreElement): void {\n this.code = undefined;\n for (const child of Array.from(pre.children)) {\n if (!(child instanceof HTMLElement)) {\n continue;\n }\n if (child.hasAttribute('data-code')) {\n this.code = child;\n return;\n }\n }\n }\n\n private applyPreNodeAttributes(\n pre: HTMLPreElement,\n { totalLines }: FileRenderResult\n ): void {\n const { overflow = 'scroll', disableLineNumbers = false } = this.options;\n const preProperties: PrePropertiesConfig = {\n type: 'file',\n split: false,\n overflow,\n disableLineNumbers,\n diffIndicators: 'none',\n disableBackground: true,\n totalLines,\n };\n if (arePrePropertiesEqual(preProperties, this.appliedPreAttributes)) {\n return;\n }\n setPreNodeProperties(pre, preProperties);\n this.appliedPreAttributes = preProperties;\n }\n\n private applyErrorToDOM(error: Error, container: HTMLElement) {\n this.cleanupErrorWrapper();\n this.pre?.remove();\n this.pre = undefined;\n this.appliedPreAttributes = undefined;\n const shadowRoot =\n container.shadowRoot ?? container.attachShadow({ mode: 'open' });\n this.errorWrapper ??= document.createElement('div');\n this.errorWrapper.dataset.errorWrapper = '';\n this.errorWrapper.textContent = '';\n shadowRoot.appendChild(this.errorWrapper);\n const errorMessage = document.createElement('div');\n errorMessage.dataset.errorMessage = '';\n errorMessage.innerText = error.message;\n this.errorWrapper.appendChild(errorMessage);\n const errorStack = document.createElement('pre');\n errorStack.dataset.errorStack = '';\n errorStack.innerText = error.stack ?? 'No Error Stack';\n this.errorWrapper.appendChild(errorStack);\n }\n\n private cleanupErrorWrapper() {\n this.errorWrapper?.remove();\n this.errorWrapper = undefined;\n }\n}\n\nfunction shouldRenderCode(\n pre: HTMLPreElement | undefined,\n file: FileContents | undefined,\n collapsed = false\n): boolean {\n return !collapsed && pre == null && file != null;\n}\n\nfunction shouldRenderHeader(\n headerElement: HTMLElement | undefined,\n file: FileContents | undefined,\n disableFileHeader: boolean = false\n): boolean {\n return headerElement == null && file != null && !disableFileHeader;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4FA,MAAM,gBAA0B,CAAC,EAAE;AA4HnC,SAAS,sBAAsB,MAAkC;CAC/D,MAAM,kBAAkB,EAAE,GAAG,KAAK;CAClC,OAAO,gBAAgB;CACvB,OAAO;AACT;AAEA,IAAI,aAAa;AAEjB,IAAa,OAAb,MAA8D;CA4DnD;CAGC;CAGA;CAjEV,OAAO,wBAAA;CAEP,OAAwB,QAAQ,EAAE;CAClC,OAAgB;CAEhB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,qBAA+B;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,UAAkB;CAElB;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CAEA,kCACE,IAAI,IAAI;CAEV,IAAc,kBAAiD;EAC7D,OAAO,KAAK,cAAc,mBAAmB;CAC/C;CACA,gBAA0B;CAG1B;CACA;CAEA;CAEA;CAGA;CACA;CACA,UAAoB;CAEpB;CAEA,YACE,UAAkD,EAChD,OAAO,eACT,GACA,eAGA,oBACA;EAPO,KAAA,UAAA;EAGC,KAAA,gBAAA;EAGA,KAAA,qBAAA;EAER,KAAK,eAAe,IAAI,aACtB,SACA,KAAK,uBACL,KAAK,uBACL,KAAK,aACP;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6KA;UA2DA;UAKA;UAMA;UAmBA;YAoBE,cAAc,aAAa;UAM7B;YAkDE;YAIA,uBACR,KAAK,kBACH,qBAAqB,qBAAqB,cAAc,mBAC1D,mBAAmB;UA6Bb;UAqBA"}
|
|
@@ -369,6 +369,7 @@ var FileDiff = class {
|
|
|
369
369
|
}
|
|
370
370
|
this.clearAuxiliaryNodes();
|
|
371
371
|
this.annotationCache.clear();
|
|
372
|
+
this.pre?.remove();
|
|
372
373
|
this.pre = void 0;
|
|
373
374
|
this.codeUnified = void 0;
|
|
374
375
|
this.codeDeletions = void 0;
|
|
@@ -378,11 +379,9 @@ var FileDiff = class {
|
|
|
378
379
|
this.bufferAfter?.remove();
|
|
379
380
|
this.bufferAfter = void 0;
|
|
380
381
|
this.appliedPreAttributes = void 0;
|
|
382
|
+
this.headerElement?.remove();
|
|
381
383
|
this.headerElement = void 0;
|
|
382
|
-
this.
|
|
383
|
-
this.headerFilenameSuffix = void 0;
|
|
384
|
-
this.headerMetadata = void 0;
|
|
385
|
-
this.headerCustom = void 0;
|
|
384
|
+
this.clearHeaderSlots();
|
|
386
385
|
this.placeHolder?.remove();
|
|
387
386
|
this.placeHolder = void 0;
|
|
388
387
|
this.headerCache.lastRenderedHTML = void 0;
|