@pierre/diffs 1.2.3 → 1.2.5
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/CodeView.d.ts +1 -0
- package/dist/components/CodeView.d.ts.map +1 -1
- package/dist/components/CodeView.js +23 -0
- package/dist/components/CodeView.js.map +1 -1
- package/dist/components/File.d.ts +5 -3
- package/dist/components/File.d.ts.map +1 -1
- package/dist/components/File.js +25 -5
- package/dist/components/File.js.map +1 -1
- package/dist/components/FileDiff.d.ts +8 -5
- package/dist/components/FileDiff.d.ts.map +1 -1
- package/dist/components/FileDiff.js +25 -5
- package/dist/components/FileDiff.js.map +1 -1
- package/dist/components/UnresolvedFile.d.ts +4 -3
- package/dist/components/UnresolvedFile.d.ts.map +1 -1
- package/dist/components/UnresolvedFile.js +2 -0
- package/dist/components/UnresolvedFile.js.map +1 -1
- package/dist/components/VirtualizedFile.js +6 -1
- package/dist/components/VirtualizedFile.js.map +1 -1
- package/dist/components/VirtualizedFileDiff.js +6 -1
- package/dist/components/VirtualizedFileDiff.js.map +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/react/UnresolvedFile.d.ts +2 -2
- package/dist/react/UnresolvedFile.d.ts.map +1 -1
- package/dist/react/UnresolvedFile.js.map +1 -1
- package/dist/react/index.d.ts +2 -2
- package/dist/ssr/index.d.ts +2 -2
- package/dist/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileDiff.d.ts","names":["GetHoveredLineResult","GetLineIndexUtility","InteractionManager","InteractionManagerBaseOptions","SelectionWriteOptions","ResizeManager","ScrollSyncManager","DiffHunksRenderer","DiffHunksRendererOptions","HunksRenderResult","AppliedThemeStyleCache","BaseDiffOptions","CustomPreProperties","DiffLineAnnotation","ExpansionDirections","FileContents","FileDiffMetadata","HunkData","HunkSeparators","PrePropertiesConfig","RenderHeaderMetadataCallback","RenderHeaderPrefixCallback","RenderRange","SelectedLineRange","ThemeTypes","WorkerPoolManager","FileDiffRenderProps","LAnnotation","HTMLElement","FileDiffHydrationProps","Omit","FileDiffOptions","Exclude","FileDiff","DocumentFragment","AnnotationElementCache","CustomHunkElementCache","HydrationSetup","SVGElement","HTMLPreElement","HTMLStyleElement","Map","__0","AnnotationSide","fileDiff","oldFile","newFile","lineAnnotations","deferManagers","forceRender","preventEmit","fileContainer","containerWrapper","renderRange","additionsContentAST","deletionsContentAST","totalLines"],"sources":["../../src/components/FileDiff.d.ts"],"sourcesContent":["import { type GetHoveredLineResult, type GetLineIndexUtility, InteractionManager, type InteractionManagerBaseOptions, type SelectionWriteOptions } from '../managers/InteractionManager';\nimport { ResizeManager } from '../managers/ResizeManager';\nimport { ScrollSyncManager } from '../managers/ScrollSyncManager';\nimport { DiffHunksRenderer, type DiffHunksRendererOptions, type HunksRenderResult } from '../renderers/DiffHunksRenderer';\nimport type { AppliedThemeStyleCache, BaseDiffOptions, CustomPreProperties, DiffLineAnnotation, ExpansionDirections, FileContents, FileDiffMetadata, HunkData, HunkSeparators, PrePropertiesConfig, RenderHeaderMetadataCallback, RenderHeaderPrefixCallback, RenderRange, SelectedLineRange, ThemeTypes } from '../types';\nimport type { WorkerPoolManager } from '../worker';\nexport interface FileDiffRenderProps<LAnnotation> {\n fileDiff?: FileDiffMetadata;\n oldFile?: FileContents;\n newFile?: FileContents;\n deferManagers?: boolean;\n forceRender?: boolean;\n preventEmit?: boolean;\n fileContainer?: HTMLElement;\n containerWrapper?: HTMLElement;\n lineAnnotations?: DiffLineAnnotation<LAnnotation>[];\n renderRange?: RenderRange;\n}\nexport interface FileDiffHydrationProps<LAnnotation> extends Omit<FileDiffRenderProps<LAnnotation>, 'fileContainer'> {\n fileContainer: HTMLElement;\n prerenderedHTML?: string;\n}\nexport interface FileDiffOptions<LAnnotation> extends Omit<BaseDiffOptions, 'hunkSeparators'>, InteractionManagerBaseOptions<'diff'> {\n hunkSeparators?: Exclude<HunkSeparators, 'custom'> /**\n * @deprecated Custom hunk separator functions are deprecated and will be\n * removed in a future version.\n */ | ((hunk: HunkData, instance: FileDiff<LAnnotation>) => HTMLElement | DocumentFragment | null | undefined);\n disableFileHeader?: boolean;\n renderHeaderPrefix?: RenderHeaderPrefixCallback;\n renderHeaderMetadata?: RenderHeaderMetadataCallback;\n renderCustomHeader?: RenderHeaderMetadataCallback;\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 renderAnnotation?(annotation: DiffLineAnnotation<LAnnotation>): HTMLElement | undefined;\n renderGutterUtility?(getHoveredRow: () => GetHoveredLineResult<'diff'> | undefined): HTMLElement | null | undefined;\n onPostRender?(node: HTMLElement, instance: FileDiff<LAnnotation>): unknown;\n}\ninterface AnnotationElementCache<LAnnotation> {\n element: HTMLElement;\n annotation: DiffLineAnnotation<LAnnotation>;\n}\ninterface CustomHunkElementCache {\n element: HTMLElement;\n hunkData: HunkData;\n}\ninterface HydrationSetup<LAnnotation> {\n fileDiff: FileDiffMetadata | undefined;\n lineAnnotations: DiffLineAnnotation<LAnnotation>[] | undefined;\n oldFile?: FileContents;\n newFile?: FileContents;\n}\nexport declare class FileDiff<LAnnotation = undefined> {\n options: FileDiffOptions<LAnnotation>;\n protected workerManager?: WorkerPoolManager | undefined;\n protected isContainerManaged: boolean;\n static LoadedCustomComponent: boolean;\n readonly __id: string;\n protected fileContainer: HTMLElement | undefined;\n protected spriteSVG: SVGElement | undefined;\n protected pre: HTMLPreElement | undefined;\n protected codeUnified: HTMLElement | undefined;\n protected codeDeletions: HTMLElement | undefined;\n protected codeAdditions: 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: boolean;\n protected unsafeCSSStyle: HTMLStyleElement | undefined;\n protected appliedUnsafeCSS: string | undefined;\n protected gutterUtilityContent: HTMLElement | undefined;\n protected headerElement: HTMLElement | undefined;\n protected headerPrefix: HTMLElement | undefined;\n protected headerMetadata: HTMLElement | undefined;\n protected headerCustom: HTMLElement | undefined;\n protected separatorCache: Map<string, CustomHunkElementCache>;\n protected errorWrapper: HTMLElement | undefined;\n protected placeHolder: HTMLElement | undefined;\n protected hunksRenderer: DiffHunksRenderer<LAnnotation>;\n protected resizeManager: ResizeManager;\n protected scrollSyncManager: ScrollSyncManager;\n protected interactionManager: InteractionManager<'diff'>;\n protected annotationCache: Map<string, AnnotationElementCache<LAnnotation>>;\n protected lineAnnotations: DiffLineAnnotation<LAnnotation>[];\n protected managersDirty: boolean;\n protected deletionFile: FileContents | undefined;\n protected additionFile: FileContents | undefined;\n protected fileDiff: FileDiffMetadata | undefined;\n protected renderRange: RenderRange | undefined;\n protected appliedPreAttributes: PrePropertiesConfig | undefined;\n protected lastRenderedHeaderHTML: string | undefined;\n protected cachedHeaderHTML: string | undefined;\n protected lastRowCount: number | undefined;\n protected enabled: boolean;\n constructor(options?: FileDiffOptions<LAnnotation>, workerManager?: WorkerPoolManager | undefined, isContainerManaged?: boolean);\n protected handleHighlightRender: () => void;\n protected getHunksRendererOptions(options: FileDiffOptions<LAnnotation>): DiffHunksRendererOptions;\n protected createHunksRenderer(options: FileDiffOptions<LAnnotation>): DiffHunksRenderer<LAnnotation>;\n getLineIndex: GetLineIndexUtility;\n setOptions(options: FileDiffOptions<LAnnotation> | undefined): void;\n protected syncInteractionOptions(): void;\n private mergeOptions;\n setThemeType(themeType: ThemeTypes): void;\n private applyCachedThemeState;\n private hasThemeChanged;\n getHoveredLine: () => {\n lineNumber: number;\n side: import(\"..\").AnnotationSide;\n } | undefined;\n setLineAnnotations(lineAnnotations: DiffLineAnnotation<LAnnotation>[]): void;\n private canPartiallyRender;\n setSelectedLines(range: SelectedLineRange | null, options?: SelectionWriteOptions): void;\n flushManagers(): void;\n cleanUp(recycle?: boolean): void;\n virtualizedSetup(): void;\n hydrate(props: FileDiffHydrationProps<LAnnotation>): void;\n protected hydrateElements(fileContainer: HTMLElement, prerenderedHTML: string | undefined): void;\n protected hydrationSetup({ fileDiff, oldFile, newFile, lineAnnotations }: HydrationSetup<LAnnotation>): void;\n rerender(): void;\n onThemeChange(): void;\n handleExpandHunk: (hunkIndex: number, direction: ExpansionDirections, expansionLineCountOverride?: number | undefined) => void;\n expandHunk: (hunkIndex: number, direction: ExpansionDirections, expansionLineCountOverride?: number | undefined) => void;\n render({ oldFile, newFile, fileDiff, deferManagers, forceRender, preventEmit, lineAnnotations, fileContainer, containerWrapper, renderRange }: FileDiffRenderProps<LAnnotation>): boolean;\n protected emitPostRender(): void;\n private removeRenderedCode;\n private clearAuxiliaryNodes;\n renderPlaceholder(height: number): boolean;\n primeHighlightCache(): void;\n private cleanChildNodes;\n private renderSeparators;\n protected renderAnnotations(): void;\n protected renderGutterUtility(): void;\n protected getOrCreateFileContainer(fileContainer?: HTMLElement, parentNode?: HTMLElement): HTMLElement;\n private adoptReusableShellElements;\n private ensureSpriteSVG;\n private getOrCreatePreNode;\n protected syncCodeNodesFromPre(pre: HTMLPreElement): void;\n private applyHeaderToDOM;\n private clearHeaderSlots;\n private upsertHeaderSlotElement;\n private replaceHeaderSlotContent;\n private createHeaderSlotElement;\n protected injectUnsafeCSS(): void;\n private applyThemeState;\n private hydrateMeasuredScrollbar;\n private applyHunksToDOM;\n private applyPartialRender;\n private insertPartialHTML;\n private renderPartialColumn;\n private mergeBuffersIfNecessary;\n private applyRowSpan;\n private trimColumnRows;\n private trimColumns;\n private getBufferSize;\n private updateBufferSize;\n private getCodeColumns;\n private applyBuffers;\n protected shouldDisableVirtualizationBuffers(): boolean;\n protected applyPreNodeAttributes(pre: HTMLPreElement, { additionsContentAST, deletionsContentAST, totalLines }: HunksRenderResult, customProperties?: CustomPreProperties): void;\n private applyErrorToDOM;\n private cleanup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AAkBe,QAAAA,wBAAAA;EAAqBC,QAAAA,eAAAA;EAAqBC,QAAAA,kBAAAA;EAAc/C,QAAAA,iBAAAA;EAAsCG,QAAAA,mBAAAA;EAAmB,QAAA,uBAAA;;;;;;;;;wCAAnI2B;;;;KAA0E9B,sCAAsCG"}
|
|
1
|
+
{"version":3,"file":"FileDiff.d.ts","names":["GetHoveredLineResult","GetLineIndexUtility","InteractionManager","InteractionManagerBaseOptions","SelectionWriteOptions","ResizeManager","ScrollSyncManager","DiffHunksRenderer","DiffHunksRendererOptions","HunksRenderResult","AppliedThemeStyleCache","BaseDiffOptions","CustomPreProperties","DiffLineAnnotation","ExpansionDirections","FileContents","FileDiffMetadata","HunkData","HunkSeparators","PostRenderPhase","PrePropertiesConfig","RenderHeaderMetadataCallback","RenderHeaderPrefixCallback","RenderRange","SelectedLineRange","ThemeTypes","WorkerPoolManager","FileDiffRenderProps","LAnnotation","HTMLElement","FileDiffHydrationProps","Omit","FileDiffType","FileDiffOptions","Exclude","FileDiff","DocumentFragment","AnnotationElementCache","CustomHunkElementCache","HydrationSetup","SVGElement","HTMLPreElement","HTMLStyleElement","Map","__0","AnnotationSide","fileDiff","oldFile","newFile","lineAnnotations","deferManagers","forceRender","preventEmit","fileContainer","containerWrapper","renderRange","additionsContentAST","deletionsContentAST","totalLines"],"sources":["../../src/components/FileDiff.d.ts"],"sourcesContent":["import { type GetHoveredLineResult, type GetLineIndexUtility, InteractionManager, type InteractionManagerBaseOptions, type SelectionWriteOptions } from '../managers/InteractionManager';\nimport { ResizeManager } from '../managers/ResizeManager';\nimport { ScrollSyncManager } from '../managers/ScrollSyncManager';\nimport { DiffHunksRenderer, type DiffHunksRendererOptions, type HunksRenderResult } from '../renderers/DiffHunksRenderer';\nimport type { AppliedThemeStyleCache, BaseDiffOptions, CustomPreProperties, DiffLineAnnotation, ExpansionDirections, FileContents, FileDiffMetadata, HunkData, HunkSeparators, PostRenderPhase, PrePropertiesConfig, RenderHeaderMetadataCallback, RenderHeaderPrefixCallback, RenderRange, SelectedLineRange, ThemeTypes } from '../types';\nimport type { WorkerPoolManager } from '../worker';\nexport interface FileDiffRenderProps<LAnnotation> {\n fileDiff?: FileDiffMetadata;\n oldFile?: FileContents;\n newFile?: FileContents;\n deferManagers?: boolean;\n forceRender?: boolean;\n preventEmit?: boolean;\n fileContainer?: HTMLElement;\n containerWrapper?: HTMLElement;\n lineAnnotations?: DiffLineAnnotation<LAnnotation>[];\n renderRange?: RenderRange;\n}\nexport interface FileDiffHydrationProps<LAnnotation> extends Omit<FileDiffRenderProps<LAnnotation>, 'fileContainer'> {\n fileContainer: HTMLElement;\n prerenderedHTML?: string;\n}\nexport type FileDiffType = 'file-diff' | 'unresolved-file';\nexport interface FileDiffOptions<LAnnotation> extends Omit<BaseDiffOptions, 'hunkSeparators'>, InteractionManagerBaseOptions<'diff'> {\n hunkSeparators?: Exclude<HunkSeparators, 'custom'> /**\n * @deprecated Custom hunk separator functions are deprecated and will be\n * removed in a future version.\n */ | ((hunk: HunkData, instance: FileDiff<LAnnotation>) => HTMLElement | DocumentFragment | null | undefined);\n disableFileHeader?: boolean;\n renderHeaderPrefix?: RenderHeaderPrefixCallback;\n renderHeaderMetadata?: RenderHeaderMetadataCallback;\n renderCustomHeader?: RenderHeaderMetadataCallback;\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 renderAnnotation?(annotation: DiffLineAnnotation<LAnnotation>): HTMLElement | undefined;\n renderGutterUtility?(getHoveredRow: () => GetHoveredLineResult<'diff'> | undefined): HTMLElement | null | undefined;\n onPostRender?(node: HTMLElement, instance: FileDiff<LAnnotation>, phase: PostRenderPhase): unknown;\n}\ninterface AnnotationElementCache<LAnnotation> {\n element: HTMLElement;\n annotation: DiffLineAnnotation<LAnnotation>;\n}\ninterface CustomHunkElementCache {\n element: HTMLElement;\n hunkData: HunkData;\n}\ninterface HydrationSetup<LAnnotation> {\n fileDiff: FileDiffMetadata | undefined;\n lineAnnotations: DiffLineAnnotation<LAnnotation>[] | undefined;\n oldFile?: FileContents;\n newFile?: FileContents;\n}\nexport declare class FileDiff<LAnnotation = undefined> {\n options: FileDiffOptions<LAnnotation>;\n protected workerManager?: WorkerPoolManager | undefined;\n protected isContainerManaged: boolean;\n static LoadedCustomComponent: boolean;\n readonly __id: string;\n readonly type: FileDiffType;\n protected fileContainer: HTMLElement | undefined;\n protected spriteSVG: SVGElement | undefined;\n protected pre: HTMLPreElement | undefined;\n protected codeUnified: HTMLElement | undefined;\n protected codeDeletions: HTMLElement | undefined;\n protected codeAdditions: 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: boolean;\n protected unsafeCSSStyle: HTMLStyleElement | undefined;\n protected appliedUnsafeCSS: string | undefined;\n protected gutterUtilityContent: HTMLElement | undefined;\n protected headerElement: HTMLElement | undefined;\n protected headerPrefix: HTMLElement | undefined;\n protected headerMetadata: HTMLElement | undefined;\n protected headerCustom: HTMLElement | undefined;\n protected separatorCache: Map<string, CustomHunkElementCache>;\n protected errorWrapper: HTMLElement | undefined;\n protected placeHolder: HTMLElement | undefined;\n protected hunksRenderer: DiffHunksRenderer<LAnnotation>;\n protected resizeManager: ResizeManager;\n protected scrollSyncManager: ScrollSyncManager;\n protected interactionManager: InteractionManager<'diff'>;\n protected annotationCache: Map<string, AnnotationElementCache<LAnnotation>>;\n protected lineAnnotations: DiffLineAnnotation<LAnnotation>[];\n protected managersDirty: boolean;\n protected deletionFile: FileContents | undefined;\n protected additionFile: FileContents | undefined;\n fileDiff: FileDiffMetadata | undefined;\n protected renderRange: RenderRange | undefined;\n protected appliedPreAttributes: PrePropertiesConfig | undefined;\n protected lastRenderedHeaderHTML: string | undefined;\n protected cachedHeaderHTML: string | undefined;\n protected lastRowCount: number | undefined;\n private mounted;\n protected enabled: boolean;\n constructor(options?: FileDiffOptions<LAnnotation>, workerManager?: WorkerPoolManager | undefined, isContainerManaged?: boolean);\n protected handleHighlightRender: () => void;\n protected getHunksRendererOptions(options: FileDiffOptions<LAnnotation>): DiffHunksRendererOptions;\n protected createHunksRenderer(options: FileDiffOptions<LAnnotation>): DiffHunksRenderer<LAnnotation>;\n getLineIndex: GetLineIndexUtility;\n setOptions(options: FileDiffOptions<LAnnotation> | undefined): void;\n protected syncInteractionOptions(): void;\n private mergeOptions;\n setThemeType(themeType: ThemeTypes): void;\n private applyCachedThemeState;\n private hasThemeChanged;\n getHoveredLine: () => {\n lineNumber: number;\n side: import(\"..\").AnnotationSide;\n } | undefined;\n setLineAnnotations(lineAnnotations: DiffLineAnnotation<LAnnotation>[]): void;\n private canPartiallyRender;\n setSelectedLines(range: SelectedLineRange | null, options?: SelectionWriteOptions): void;\n flushManagers(): void;\n cleanUp(recycle?: boolean): void;\n virtualizedSetup(): void;\n hydrate(props: FileDiffHydrationProps<LAnnotation>): void;\n protected hydrateElements(fileContainer: HTMLElement, prerenderedHTML: string | undefined): void;\n protected hydrationSetup({ fileDiff, oldFile, newFile, lineAnnotations }: HydrationSetup<LAnnotation>): void;\n rerender(): void;\n onThemeChange(): void;\n handleExpandHunk: (hunkIndex: number, direction: ExpansionDirections, expansionLineCountOverride?: number | undefined) => void;\n expandHunk: (hunkIndex: number, direction: ExpansionDirections, expansionLineCountOverride?: number | undefined) => void;\n render({ oldFile, newFile, fileDiff, deferManagers, forceRender, preventEmit, lineAnnotations, fileContainer, containerWrapper, renderRange }: FileDiffRenderProps<LAnnotation>): boolean;\n protected emitPostRender(unmount?: boolean): void;\n private removeRenderedCode;\n private clearAuxiliaryNodes;\n renderPlaceholder(height: number): boolean;\n primeHighlightCache(): void;\n private cleanChildNodes;\n private renderSeparators;\n protected renderAnnotations(): void;\n protected renderGutterUtility(): void;\n protected getOrCreateFileContainer(fileContainer?: HTMLElement, parentNode?: HTMLElement): HTMLElement;\n private adoptReusableShellElements;\n private ensureSpriteSVG;\n private getOrCreatePreNode;\n protected syncCodeNodesFromPre(pre: HTMLPreElement): void;\n private applyHeaderToDOM;\n private clearHeaderSlots;\n private upsertHeaderSlotElement;\n private replaceHeaderSlotContent;\n private createHeaderSlotElement;\n protected injectUnsafeCSS(): void;\n private applyThemeState;\n private hydrateMeasuredScrollbar;\n private applyHunksToDOM;\n private applyPartialRender;\n private insertPartialHTML;\n private renderPartialColumn;\n private mergeBuffersIfNecessary;\n private applyRowSpan;\n private trimColumnRows;\n private trimColumns;\n private getBufferSize;\n private updateBufferSize;\n private getCodeColumns;\n private applyBuffers;\n protected shouldDisableVirtualizationBuffers(): boolean;\n protected applyPreNodeAttributes(pre: HTMLPreElement, { additionsContentAST, deletionsContentAST, totalLines }: HunksRenderResult, customProperties?: CustomPreProperties): void;\n private applyErrorToDOM;\n private cleanupErrorWrapper;\n}\nexport {};\n//# sourceMappingURL=FileDiff.d.ts.map"],"mappings":";;;;;;;;;;UAMiB2B;aACFX;YACDD;YACAA;EAHGY,aAAAA,CAAAA,EAAAA,OAAmB;EACrBX,WAAAA,CAAAA,EAAAA,OAAAA;EACDD,WAAAA,CAAAA,EAAAA,OAAAA;EACAA,aAAAA,CAAAA,EAIMc,WAJNd;EAIMc,gBAAAA,CAAAA,EACGA,WADHA;EACGA,eAAAA,CAAAA,EACDhB,kBADCgB,CACkBD,WADlBC,CAAAA,EAAAA;EACkBD,WAAAA,CAAAA,EACvBL,WADuBK;;AACvBL,UAEDO,sBAFCP,CAAAA,WAAAA,CAAAA,SAE2CQ,IAF3CR,CAEgDI,mBAFhDJ,CAEoEK,WAFpEL,CAAAA,EAAAA,eAAAA,CAAAA,CAAAA;EAAW,aAAA,EAGVM,WAHU;EAEZC,eAAAA,CAAAA,EAAAA,MAAAA;;AAAiDH,KAItDK,YAAAA,GAJsDL,WAAAA,GAAAA,iBAAAA;AAC/CE,UAIFI,eAJEJ,CAAAA,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AAA,mBAAAA;EACNA,iBAAAA,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;EAClCiC,mBAAAA,CAAAA,CAAAA,EAAAA,IAAAA;EAASC,QAAAA,eAAAA;EAASF,QAAAA,gBAAAA;EAAUI,UAAAA,iBAAAA,CAAAA,CAAAA,EAAAA,IAAAA;EAAeC,UAAAA,mBAAAA,CAAAA,CAAAA,EAAAA,IAAAA;EAAaC,UAAAA,wBAAAA,CAAAA,aAAAA,CAAAA,EAUdvB,WAVcuB,EAAAA,UAAAA,CAAAA,EAUYvB,WAVZuB,CAAAA,EAU0BvB,WAV1BuB;EAAaH,QAAAA,0BAAAA;EAAiBI,QAAAA,eAAAA;EAAeC,QAAAA,kBAAAA;EAAkBC,UAAAA,oBAAAA,CAAAA,GAAAA,EAc5Fd,cAd4Fc,CAAAA,EAAAA,IAAAA;EAAmC3B,QAAAA,gBAAAA;EAApBD,QAAAA,gBAAAA;EAU5FE,QAAAA,uBAAAA;EAA0BA,QAAAA,wBAAAA;EAAcA,QAAAA,uBAAAA;EAIvDY,UAAAA,eAAAA,CAAAA,CAAAA,EAAAA,IAAAA;EAsBEA,QAAAA,eAAAA;EAAkBe,QAAAA,wBAAAA;EAAqBC,QAAAA,eAAAA;EAAqBC,QAAAA,kBAAAA;EAAcjD,QAAAA,iBAAAA;EAAsCG,QAAAA,mBAAAA;EAAmB,QAAA,uBAAA;;;;;;;;;wCAAnI6B;;;;KAA0EhC,sCAAsCG"}
|
|
@@ -32,6 +32,7 @@ let instanceId = -1;
|
|
|
32
32
|
var FileDiff = class {
|
|
33
33
|
static LoadedCustomComponent = DiffsContainerLoaded;
|
|
34
34
|
__id = `file-diff:${++instanceId}`;
|
|
35
|
+
type = "file-diff";
|
|
35
36
|
fileContainer;
|
|
36
37
|
spriteSVG;
|
|
37
38
|
pre;
|
|
@@ -68,6 +69,7 @@ var FileDiff = class {
|
|
|
68
69
|
lastRenderedHeaderHTML;
|
|
69
70
|
cachedHeaderHTML;
|
|
70
71
|
lastRowCount;
|
|
72
|
+
mounted = false;
|
|
71
73
|
enabled = true;
|
|
72
74
|
constructor(options = { theme: DEFAULT_THEMES }, workerManager, isContainerManaged = false) {
|
|
73
75
|
this.options = options;
|
|
@@ -199,6 +201,7 @@ var FileDiff = class {
|
|
|
199
201
|
this.managersDirty = false;
|
|
200
202
|
}
|
|
201
203
|
cleanUp(recycle = false) {
|
|
204
|
+
this.emitPostRender(true);
|
|
202
205
|
this.resizeManager.cleanUp();
|
|
203
206
|
this.interactionManager.cleanUp();
|
|
204
207
|
this.scrollSyncManager.cleanUp();
|
|
@@ -207,6 +210,7 @@ var FileDiff = class {
|
|
|
207
210
|
this.renderRange = void 0;
|
|
208
211
|
if (!this.isContainerManaged) this.fileContainer?.remove();
|
|
209
212
|
this.fileContainer = void 0;
|
|
213
|
+
this.mounted = false;
|
|
210
214
|
this.lineAnnotations = [];
|
|
211
215
|
this.clearAuxiliaryNodes();
|
|
212
216
|
this.annotationCache.clear();
|
|
@@ -270,6 +274,7 @@ var FileDiff = class {
|
|
|
270
274
|
if (!preventEmit) this.emitPostRender();
|
|
271
275
|
}
|
|
272
276
|
hydrateElements(fileContainer, prerenderedHTML) {
|
|
277
|
+
if (this.fileContainer !== fileContainer) this.emitPostRender(true);
|
|
273
278
|
prerenderHTMLIfNecessary(fileContainer, prerenderedHTML);
|
|
274
279
|
for (const element of fileContainer.shadowRoot?.children ?? []) {
|
|
275
280
|
if (element instanceof SVGElement) {
|
|
@@ -426,8 +431,19 @@ var FileDiff = class {
|
|
|
426
431
|
if (!preventEmit) this.emitPostRender();
|
|
427
432
|
return true;
|
|
428
433
|
}
|
|
429
|
-
emitPostRender() {
|
|
430
|
-
|
|
434
|
+
emitPostRender(unmount = false) {
|
|
435
|
+
const { fileContainer, options: { onPostRender } } = this;
|
|
436
|
+
if (unmount) {
|
|
437
|
+
if (!this.mounted) return;
|
|
438
|
+
this.mounted = false;
|
|
439
|
+
if (fileContainer == null) return;
|
|
440
|
+
this.options.onPostRender?.(fileContainer, this, "unmount");
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
if (fileContainer == null) return;
|
|
444
|
+
const phase = this.mounted ? "update" : "mount";
|
|
445
|
+
this.mounted = true;
|
|
446
|
+
onPostRender?.(fileContainer, this, phase);
|
|
431
447
|
}
|
|
432
448
|
removeRenderedCode() {
|
|
433
449
|
this.resizeManager.cleanUp();
|
|
@@ -458,6 +474,7 @@ var FileDiff = class {
|
|
|
458
474
|
}
|
|
459
475
|
renderPlaceholder(height) {
|
|
460
476
|
if (this.fileContainer == null) return false;
|
|
477
|
+
this.emitPostRender(true);
|
|
461
478
|
this.cleanChildNodes();
|
|
462
479
|
if (this.placeHolder == null) {
|
|
463
480
|
const shadowRoot = this.fileContainer.shadowRoot ?? this.fileContainer.attachShadow({ mode: "open" });
|
|
@@ -513,6 +530,7 @@ var FileDiff = class {
|
|
|
513
530
|
this.appliedUnsafeCSS = void 0;
|
|
514
531
|
this.lastRenderedHeaderHTML = void 0;
|
|
515
532
|
this.lastRowCount = void 0;
|
|
533
|
+
this.mounted = false;
|
|
516
534
|
}
|
|
517
535
|
renderSeparators(hunkData) {
|
|
518
536
|
const { hunkSeparators } = this.options;
|
|
@@ -596,9 +614,11 @@ var FileDiff = class {
|
|
|
596
614
|
this.gutterUtilityContent = gutterUtilityContent;
|
|
597
615
|
}
|
|
598
616
|
getOrCreateFileContainer(fileContainer, parentNode) {
|
|
599
|
-
const previousContainer = this
|
|
600
|
-
|
|
601
|
-
const containerChanged = previousContainer !==
|
|
617
|
+
const { fileContainer: previousContainer } = this;
|
|
618
|
+
const nextContainer = fileContainer ?? previousContainer ?? document.createElement(DIFFS_TAG_NAME);
|
|
619
|
+
const containerChanged = previousContainer !== nextContainer;
|
|
620
|
+
if (containerChanged) this.emitPostRender(true);
|
|
621
|
+
this.fileContainer = nextContainer;
|
|
602
622
|
if (previousContainer != null && containerChanged) {
|
|
603
623
|
this.lastRenderedHeaderHTML = void 0;
|
|
604
624
|
this.headerElement = void 0;
|