@pierre/diffs 1.1.0-beta.18 → 1.1.0-beta.19

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.
@@ -1 +1 @@
1
- {"version":3,"file":"FileDiff.d.ts","names":["GetHoveredLineResult","GetLineIndexUtility","InteractionManager","InteractionManagerBaseOptions","SelectedLineRange","ResizeManager","ScrollSyncManager","DiffHunksRenderer","BaseDiffOptions","DiffLineAnnotation","ExpansionDirections","FileContents","FileDiffMetadata","HunkData","HunkSeparators","PrePropertiesConfig","RenderHeaderMetadataCallback","RenderHeaderPrefixCallback","RenderRange","ThemeTypes","WorkerPoolManager","FileDiffRenderProps","LAnnotation","HTMLElement","FileDiffHydrationProps","Omit","FileDiffOptions","Exclude","FileDiff","DocumentFragment","AnnotationElementCache","CustomHunkElementCache","SVGElement","HTMLPreElement","HTMLStyleElement","Map","__0","AnnotationSide","oldFile","newFile","fileDiff","forceRender","lineAnnotations","fileContainer","containerWrapper","renderRange"],"sources":["../../src/components/FileDiff.d.ts"],"sourcesContent":["import { type GetHoveredLineResult, type GetLineIndexUtility, InteractionManager, type InteractionManagerBaseOptions, type SelectedLineRange } from '../managers/InteractionManager';\nimport { ResizeManager } from '../managers/ResizeManager';\nimport { ScrollSyncManager } from '../managers/ScrollSyncManager';\nimport { DiffHunksRenderer } from '../renderers/DiffHunksRenderer';\nimport type { BaseDiffOptions, DiffLineAnnotation, ExpansionDirections, FileContents, FileDiffMetadata, HunkData, HunkSeparators, PrePropertiesConfig, RenderHeaderMetadataCallback, RenderHeaderPrefixCallback, RenderRange, ThemeTypes } from '../types';\nimport type { WorkerPoolManager } from '../worker';\nexport interface FileDiffRenderProps<LAnnotation> {\n fileDiff?: FileDiffMetadata;\n oldFile?: FileContents;\n newFile?: FileContents;\n forceRender?: 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);\n disableFileHeader?: boolean;\n /**\n * @deprecated Use `enableGutterUtility` instead.\n */\n enableHoverUtility?: boolean;\n renderHeaderPrefix?: RenderHeaderPrefixCallback;\n renderHeaderMetadata?: 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;\n /**\n * @deprecated Use `renderGutterUtility` instead.\n */\n renderHoverUtility?(getHoveredRow: () => GetHoveredLineResult<'diff'> | undefined): HTMLElement | null;\n}\ninterface AnnotationElementCache<LAnnotation> {\n element: HTMLElement;\n annotation: DiffLineAnnotation<LAnnotation>;\n}\ninterface CustomHunkElementCache {\n element: HTMLElement;\n hunkData: HunkData;\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 unsafeCSSStyle: HTMLStyleElement | undefined;\n protected gutterUtilityContent: HTMLElement | undefined;\n protected headerElement: HTMLElement | undefined;\n protected headerPrefix: HTMLElement | undefined;\n protected headerMetadata: 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 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 lastRowCount: number | undefined;\n protected enabled: boolean;\n constructor(options?: FileDiffOptions<LAnnotation>, workerManager?: WorkerPoolManager | undefined, isContainerManaged?: boolean);\n private handleHighlightRender;\n getLineIndex: GetLineIndexUtility;\n setOptions(options: FileDiffOptions<LAnnotation> | undefined): void;\n private mergeOptions;\n setThemeType(themeType: ThemeTypes): void;\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): void;\n cleanUp(recycle?: boolean): void;\n virtualizedSetup(): void;\n hydrate(props: FileDiffHydrationProps<LAnnotation>): void;\n rerender(): void;\n handleExpandHunk: (hunkIndex: number, direction: ExpansionDirections, expandFully?: boolean) => void;\n expandHunk(hunkIndex: number, direction: ExpansionDirections): void;\n expandHunkFully(hunkIndex: number): void;\n render({ oldFile, newFile, fileDiff, forceRender, lineAnnotations, fileContainer, containerWrapper, renderRange }: FileDiffRenderProps<LAnnotation>): boolean;\n private removeRenderedCode;\n private clearAuxiliaryNodes;\n renderPlaceholder(height: number): boolean;\n private cleanChildNodes;\n private renderSeparators;\n private renderAnnotations;\n private renderGutterUtility;\n protected getOrCreateFileContainer(fileContainer?: HTMLElement, parentNode?: HTMLElement): HTMLElement;\n protected getFileContainer(): HTMLElement | undefined;\n private getOrCreatePreNode;\n private syncCodeNodesFromPre;\n private applyHeaderToDOM;\n private injectUnsafeCSS;\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 private applyPreNodeAttributes;\n private applyErrorToDOM;\n private cleanupErrorWrapper;\n}\nexport {};\n//# sourceMappingURL=FileDiff.d.ts.map"],"mappings":";;;;;;;;;;UAMiBqB;aACFT;YACDD;YACAA;EAHGU,WAAAA,CAAAA,EAAAA,OAAAA;EACFT,aAAAA,CAAAA,EAIKW,WAJLX;EACDD,gBAAAA,CAAAA,EAISY,WAJTZ;EACAA,eAAAA,CAAAA,EAIQF,kBAJRE,CAI2BW,WAJ3BX,CAAAA,EAAAA;EAEMY,WAAAA,CAAAA,EAGFL,WAHEK;;AAEqBD,UAGxBE,sBAHwBF,CAAAA,WAAAA,CAAAA,SAGoBG,IAHpBH,CAGyBD,mBAHzBC,CAG6CA,WAH7CA,CAAAA,EAAAA,eAAAA,CAAAA,CAAAA;EAAnBb,aAAAA,EAIHc,WAJGd;EACJS,eAAAA,CAAAA,EAAAA,MAAAA;;AAEDM,UAIAE,eAJsB,CAAA,WAAAJ,CAAAA,SAIeG,IAJf,CAIoBjB,eAJpB,EAAA,gBAAA,CAAA,EAIwDL,6BAJxD,CAAA,MAAA,CAAA,CAAA;EAA+CmB,cAAAA,CAAAA,EAKjEK,OALiEL,CAKzDR,cALyDQ,EAAA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AAA,CAAAA,CAAAA,EAAAA,IAAAA;EAEhC4B,OAAAA,CAAAA,KAAAA,EALMd,sBAKNc,CAL6BhB,WAK7BgB,CAAAA,CAAAA,EAAAA,IAAAA;EAASC,QAAAA,CAAAA,CAAAA,EAAAA,IAAAA;EAASC,gBAAAA,EAAAA,CAAAA,SAAAA,EAAAA,MAAAA,EAAAA,SAAAA,EAHsB9B,mBAGtB8B,EAAAA,WAAAA,CAAAA,EAAAA,OAAAA,EAAAA,GAAAA,IAAAA;EAAUC,UAAAA,CAAAA,SAAAA,EAAAA,MAAAA,EAAAA,SAAAA,EAFI/B,mBAEJ+B,CAAAA,EAAAA,IAAAA;EAAaC,eAAAA,CAAAA,SAAAA,EAAAA,MAAAA,CAAAA,EAAAA,IAAAA;EAAiBC,MAAAA,CAAAA;IAAAA,OAAAA;IAAAA,OAAAA;IAAAA,QAAAA;IAAAA,WAAAA;IAAAA,eAAAA;IAAAA,aAAAA;IAAAA,gBAAAA;IAAAA;EAAAA,CAAAA,EAAgDtB,mBAAhDsB,CAAoErB,WAApEqB,CAAAA,CAAAA,EAAAA,OAAAA;EAAeC,QAAAA,kBAAAA;EAAkBC,QAAAA,mBAAAA;EAAmCvB,iBAAAA,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;EAApBD,QAAAA,eAAAA;EAQhEE,QAAAA,gBAAAA;EAA0BA,QAAAA,iBAAAA;EAAcA,QAAAA,mBAAAA;EAC7DA,UAAAA,wBAAAA,CAAAA,aAAAA,CAAAA,EADqBA,WACrBA,EAAAA,UAAAA,CAAAA,EAD+CA,WAC/CA,CAAAA,EAD6DA,WAC7DA;EAAW,UAAA,gBAAA,CAAA,CAAA,EAAXA,WAAW,GAAA,SAAA"}
1
+ {"version":3,"file":"FileDiff.d.ts","names":["GetHoveredLineResult","GetLineIndexUtility","InteractionManager","InteractionManagerBaseOptions","SelectedLineRange","ResizeManager","ScrollSyncManager","DiffHunksRenderer","BaseDiffOptions","DiffLineAnnotation","ExpansionDirections","FileContents","FileDiffMetadata","HunkData","HunkSeparators","PrePropertiesConfig","RenderHeaderMetadataCallback","RenderHeaderPrefixCallback","RenderRange","ThemeTypes","WorkerPoolManager","FileDiffRenderProps","LAnnotation","HTMLElement","FileDiffHydrationProps","Omit","FileDiffOptions","Exclude","FileDiff","DocumentFragment","AnnotationElementCache","CustomHunkElementCache","SVGElement","HTMLPreElement","HTMLStyleElement","Map","__0","AnnotationSide","oldFile","newFile","fileDiff","forceRender","lineAnnotations","fileContainer","containerWrapper","renderRange"],"sources":["../../src/components/FileDiff.d.ts"],"sourcesContent":["import { type GetHoveredLineResult, type GetLineIndexUtility, InteractionManager, type InteractionManagerBaseOptions, type SelectedLineRange } from '../managers/InteractionManager';\nimport { ResizeManager } from '../managers/ResizeManager';\nimport { ScrollSyncManager } from '../managers/ScrollSyncManager';\nimport { DiffHunksRenderer } from '../renderers/DiffHunksRenderer';\nimport type { BaseDiffOptions, DiffLineAnnotation, ExpansionDirections, FileContents, FileDiffMetadata, HunkData, HunkSeparators, PrePropertiesConfig, RenderHeaderMetadataCallback, RenderHeaderPrefixCallback, RenderRange, ThemeTypes } from '../types';\nimport type { WorkerPoolManager } from '../worker';\nexport interface FileDiffRenderProps<LAnnotation> {\n fileDiff?: FileDiffMetadata;\n oldFile?: FileContents;\n newFile?: FileContents;\n forceRender?: 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);\n disableFileHeader?: boolean;\n /**\n * @deprecated Use `enableGutterUtility` instead.\n */\n enableHoverUtility?: boolean;\n renderHeaderPrefix?: RenderHeaderPrefixCallback;\n renderHeaderMetadata?: 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;\n /**\n * @deprecated Use `renderGutterUtility` instead.\n */\n renderHoverUtility?(getHoveredRow: () => GetHoveredLineResult<'diff'> | undefined): HTMLElement | null;\n}\ninterface AnnotationElementCache<LAnnotation> {\n element: HTMLElement;\n annotation: DiffLineAnnotation<LAnnotation>;\n}\ninterface CustomHunkElementCache {\n element: HTMLElement;\n hunkData: HunkData;\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 unsafeCSSStyle: HTMLStyleElement | undefined;\n protected gutterUtilityContent: HTMLElement | undefined;\n protected headerElement: HTMLElement | undefined;\n protected headerPrefix: HTMLElement | undefined;\n protected headerMetadata: 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 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 lastRowCount: number | undefined;\n protected enabled: boolean;\n constructor(options?: FileDiffOptions<LAnnotation>, workerManager?: WorkerPoolManager | undefined, isContainerManaged?: boolean);\n private handleHighlightRender;\n getLineIndex: GetLineIndexUtility;\n setOptions(options: FileDiffOptions<LAnnotation> | undefined): void;\n private mergeOptions;\n setThemeType(themeType: ThemeTypes): void;\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): void;\n cleanUp(recycle?: boolean): void;\n virtualizedSetup(): void;\n hydrate(props: FileDiffHydrationProps<LAnnotation>): void;\n rerender(): void;\n handleExpandHunk: (hunkIndex: number, direction: ExpansionDirections, expandFully?: boolean) => void;\n expandHunk(hunkIndex: number, direction: ExpansionDirections): void;\n expandHunkFully(hunkIndex: number): void;\n render({ oldFile, newFile, fileDiff, forceRender, lineAnnotations, fileContainer, containerWrapper, renderRange }: FileDiffRenderProps<LAnnotation>): boolean;\n private removeRenderedCode;\n private clearAuxiliaryNodes;\n renderPlaceholder(height: number): boolean;\n private cleanChildNodes;\n private renderSeparators;\n private renderAnnotations;\n private renderGutterUtility;\n protected getOrCreateFileContainer(fileContainer?: HTMLElement, parentNode?: HTMLElement): HTMLElement;\n protected getFileContainer(): HTMLElement | undefined;\n private getOrCreatePreNode;\n private syncCodeNodesFromPre;\n private applyHeaderToDOM;\n private injectUnsafeCSS;\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 private applyPreNodeAttributes;\n private applyErrorToDOM;\n private cleanupErrorWrapper;\n}\nexport {};\n//# sourceMappingURL=FileDiff.d.ts.map"],"mappings":";;;;;;;;;;UAMiBqB;aACFT;YACDD;YACAA;EAHGU,WAAAA,CAAAA,EAAAA,OAAAA;EACFT,aAAAA,CAAAA,EAIKW,WAJLX;EACDD,gBAAAA,CAAAA,EAISY,WAJTZ;EACAA,eAAAA,CAAAA,EAIQF,kBAJRE,CAI2BW,WAJ3BX,CAAAA,EAAAA;EAEMY,WAAAA,CAAAA,EAGFL,WAHEK;;AAEqBD,UAGxBE,sBAHwBF,CAAAA,WAAAA,CAAAA,SAGoBG,IAHpBH,CAGyBD,mBAHzBC,CAG6CA,WAH7CA,CAAAA,EAAAA,eAAAA,CAAAA,CAAAA;EAAnBb,aAAAA,EAIHc,WAJGd;EACJS,eAAAA,CAAAA,EAAAA,MAAAA;;AAEDM,UAIAE,eAJsB,CAAA,WAAAJ,CAAAA,SAIeG,IAJf,CAIoBjB,eAJpB,EAAA,gBAAA,CAAA,EAIwDL,6BAJxD,CAAA,MAAA,CAAA,CAAA;EAA+CmB,cAAAA,CAAAA,EAKjEK,OALiEL,CAKzDR,cALyDQ,EAAAA,QAAAA,CAAAA,CAAAA;;;uDAAAA,GAAzBG,CAAAA,CAAAA,IAAAA,EAQzCZ,QARyCY,EAAAA,QAAAA,EAQrBG,QARqBH,CAQZH,WARYG,CAAAA,EAAAA,GAQKF,WARLE,GAQmBI,gBARnBJ,CAAAA;EAAI,iBAAA,CAAA,EAAA,OAAA;EAIhDC;;;EACIC,kBAAAA,CAAAA,EAAAA,OAAAA;EAGDd,kBAAAA,CAAAA,EAMKI,0B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AA,EAAAA,GAAAA,IAAAA;EAAUC,UAAAA,CAAAA,SAAAA,EAAAA,MAAAA,EAAAA,SAAAA,EAFI/B,mBAEJ+B,CAAAA,EAAAA,IAAAA;EAAaC,eAAAA,CAAAA,SAAAA,EAAAA,MAAAA,CAAAA,EAAAA,IAAAA;EAAiBC,MAAAA,CAAAA;IAAAA,OAAAA;IAAAA,OAAAA;IAAAA,QAAAA;IAAAA,WAAAA;IAAAA,eAAAA;IAAAA,aAAAA;IAAAA,gBAAAA;IAAAA;EAAAA,CAAAA,EAAgDtB,mBAAhDsB,CAAoErB,WAApEqB,CAAAA,CAAAA,EAAAA,OAAAA;EAAeC,QAAAA,kBAAAA;EAAkBC,QAAAA,mBAAAA;EAAmCvB,iBAAAA,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;EAApBD,QAAAA,eAAAA;EAQhEE,QAAAA,gBAAAA;EAA0BA,QAAAA,iBAAAA;EAAcA,QAAAA,mBAAAA;EAC7DA,UAAAA,wBAAAA,CAAAA,aAAAA,CAAAA,EADqBA,WACrBA,EAAAA,UAAAA,CAAAA,EAD+CA,WAC/CA,CAAAA,EAD6DA,WAC7DA;EAAW,UAAA,gBAAA,CAAA,CAAA,EAAXA,WAAW,GAAA,SAAA"}
@@ -1,13 +1,11 @@
1
1
  //#region src/managers/ResizeManager.d.ts
2
2
  declare class ResizeManager {
3
3
  private observedNodes;
4
- private timeoutID;
5
4
  private queuedUpdates;
6
5
  cleanUp(): void;
7
6
  private resizeObserver;
8
7
  setup(pre: HTMLPreElement, disableAnnotations: boolean): void;
9
8
  private handleResizeObserver;
10
- private queueColumnUpdate;
11
9
  private handleColumnChange;
12
10
  private applyNewHeight;
13
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ResizeManager.d.ts","names":["ResizeManager","HTMLPreElement"],"sources":["../../src/managers/ResizeManager.d.ts"],"sourcesContent":["export declare class ResizeManager {\n private observedNodes;\n private timeoutID;\n private queuedUpdates;\n cleanUp(): void;\n private resizeObserver;\n setup(pre: HTMLPreElement, disableAnnotations: boolean): void;\n private handleResizeObserver;\n private queueColumnUpdate;\n private handleColumnChange;\n private applyNewHeight;\n}\n//# sourceMappingURL=ResizeManager.d.ts.map"],"mappings":";cAAqBA,aAAAA;EAAAA,QAAAA,aAAa;;;;;aAMnBC"}
1
+ {"version":3,"file":"ResizeManager.d.ts","names":["ResizeManager","HTMLPreElement"],"sources":["../../src/managers/ResizeManager.d.ts"],"sourcesContent":["export declare class ResizeManager {\n private observedNodes;\n private queuedUpdates;\n cleanUp(): void;\n private resizeObserver;\n setup(pre: HTMLPreElement, disableAnnotations: boolean): void;\n private handleResizeObserver;\n private handleColumnChange;\n private applyNewHeight;\n}\n//# sourceMappingURL=ResizeManager.d.ts.map"],"mappings":";cAAqBA,aAAAA;EAAAA,QAAAA,aAAa;;;;aAKnBC"}
@@ -1,12 +1,11 @@
1
1
  //#region src/managers/ResizeManager.ts
2
2
  var ResizeManager = class {
3
3
  observedNodes = /* @__PURE__ */ new Map();
4
- timeoutID;
5
4
  queuedUpdates = /* @__PURE__ */ new Map();
6
5
  cleanUp() {
7
6
  this.resizeObserver?.disconnect();
8
7
  this.observedNodes.clear();
9
- if (this.timeoutID != null) clearTimeout(this.timeoutID);
8
+ this.queuedUpdates.clear();
10
9
  }
11
10
  resizeObserver;
12
11
  setup(pre, disableAnnotations) {
@@ -16,25 +15,38 @@ var ResizeManager = class {
16
15
  this.observedNodes.clear();
17
16
  for (const codeElement of codeElements) {
18
17
  let item = observedNodes.get(codeElement);
18
+ if (item != null && item.type !== "code") throw new Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");
19
+ let numberElement = codeElement.firstElementChild;
20
+ if (!(numberElement instanceof HTMLElement)) numberElement = null;
19
21
  if (item != null) {
20
22
  this.observedNodes.set(codeElement, item);
21
23
  observedNodes.delete(codeElement);
22
- continue;
23
- }
24
- let numberElement = codeElement.querySelector("[data-gutter]");
25
- if (!(numberElement instanceof HTMLElement)) numberElement = null;
26
- item = {
27
- type: "code",
28
- codeElement,
29
- numberElement,
30
- codeWidth: "auto",
31
- numberWidth: 0
32
- };
33
- this.observedNodes.set(codeElement, item);
34
- this.resizeObserver.observe(codeElement);
35
- if (numberElement != null) {
36
- this.observedNodes.set(numberElement, item);
37
- this.resizeObserver.observe(numberElement);
24
+ if (item.numberElement !== numberElement) {
25
+ if (item.numberElement != null) this.resizeObserver.unobserve(item.numberElement);
26
+ if (numberElement != null) {
27
+ this.resizeObserver.observe(numberElement);
28
+ observedNodes.delete(numberElement);
29
+ this.observedNodes.set(numberElement, item);
30
+ }
31
+ item.numberElement = numberElement;
32
+ } else if (item.numberElement != null) {
33
+ observedNodes.delete(item.numberElement);
34
+ this.observedNodes.set(item.numberElement, item);
35
+ }
36
+ } else {
37
+ item = {
38
+ type: "code",
39
+ codeElement,
40
+ numberElement,
41
+ codeWidth: "auto",
42
+ numberWidth: 0
43
+ };
44
+ this.observedNodes.set(codeElement, item);
45
+ this.resizeObserver.observe(codeElement);
46
+ if (numberElement != null) {
47
+ this.observedNodes.set(numberElement, item);
48
+ this.resizeObserver.observe(numberElement);
49
+ }
38
50
  }
39
51
  }
40
52
  if (codeElements.length > 1 && !disableAnnotations) {
@@ -136,27 +148,26 @@ var ResizeManager = class {
136
148
  const newHeight = Math.max(item.column1.childHeight, item.column2.childHeight);
137
149
  this.applyNewHeight(item, newHeight);
138
150
  } else if (item.type === "code") {
139
- this.queuedUpdates.set(target, [item, specs]);
140
- this.queueColumnUpdate();
151
+ const update = [target, specs.inlineSize];
152
+ const updates = this.queuedUpdates.get(item) ?? [];
153
+ updates.push(update);
154
+ this.queuedUpdates.set(item, updates);
141
155
  }
142
156
  }
157
+ this.handleColumnChange();
143
158
  };
144
- queueColumnUpdate() {
145
- if (this.timeoutID != null) clearTimeout(this.timeoutID);
146
- this.timeoutID = setTimeout(this.handleColumnChange, 1e3 / 30);
147
- }
148
159
  handleColumnChange = () => {
149
- this.timeoutID = void 0;
150
- for (const [target, [item, specs]] of this.queuedUpdates) if (target === item.codeElement) {
151
- const inlineSize = Math.max(Math.floor(specs.inlineSize), 0);
160
+ for (const [item, updates] of this.queuedUpdates) for (const [target, targetInlineSize] of updates) if (target === item.codeElement) {
161
+ const inlineSize = Math.max(Math.floor(targetInlineSize), 0);
152
162
  if (inlineSize !== item.codeWidth) {
153
- item.codeWidth = inlineSize;
154
- const targetWidth = Math.max(item.codeWidth - item.numberWidth, 0);
155
- item.codeElement.style.setProperty("--diffs-column-content-width", `${targetWidth === 0 ? "auto" : `${targetWidth}px`}`);
156
- item.codeElement.style.setProperty("--diffs-column-width", `${item.codeWidth === 0 ? "auto" : `${item.codeWidth}px`}`);
163
+ const targetWidth = Math.max(inlineSize - item.numberWidth, 0);
164
+ item.codeWidth = inlineSize === 0 ? "auto" : inlineSize;
165
+ item.codeElement.style.setProperty("--diffs-column-content-width", `${targetWidth > 0 ? `${targetWidth}px` : "auto"}`);
166
+ item.codeElement.style.setProperty("--diffs-column-width", `${typeof item.codeWidth === "number" ? `${item.codeWidth}px` : "auto"}`);
157
167
  }
168
+ if (item.numberElement != null && typeof item.codeWidth === "number" && item.numberWidth === 0) updates.push([item.numberElement, item.numberElement.getBoundingClientRect().width]);
158
169
  } else if (target === item.numberElement) {
159
- const inlineSize = Math.max(Math.ceil(specs.inlineSize), 0);
170
+ const inlineSize = Math.max(Math.ceil(targetInlineSize), 0);
160
171
  if (inlineSize !== item.numberWidth) {
161
172
  item.numberWidth = inlineSize;
162
173
  item.codeElement.style.setProperty("--diffs-column-number-width", `${item.numberWidth === 0 ? "auto" : `${item.numberWidth}px`}`);
@@ -1 +1 @@
1
- {"version":3,"file":"ResizeManager.js","names":["item: ObservedGridNodes | ObservedAnnotationNodes | undefined"],"sources":["../../src/managers/ResizeManager.ts"],"sourcesContent":["import type { ObservedAnnotationNodes, ObservedGridNodes } from '../types';\n\nexport class ResizeManager {\n private observedNodes = new Map<\n HTMLElement,\n ObservedAnnotationNodes | ObservedGridNodes\n >();\n private timeoutID: NodeJS.Timeout | undefined;\n private queuedUpdates: Map<\n HTMLElement,\n [ObservedGridNodes, ResizeObserverSize]\n > = new Map();\n\n cleanUp(): void {\n // Disconnect any existing observer\n this.resizeObserver?.disconnect();\n this.observedNodes.clear();\n if (this.timeoutID != null) {\n clearTimeout(this.timeoutID);\n }\n }\n\n private resizeObserver: ResizeObserver | undefined;\n\n setup(pre: HTMLPreElement, disableAnnotations: boolean): void {\n this.resizeObserver ??= new ResizeObserver(this.handleResizeObserver);\n const codeElements = pre.querySelectorAll('code');\n\n const observedNodes = new Map(this.observedNodes);\n this.observedNodes.clear();\n for (const codeElement of codeElements) {\n let item: ObservedGridNodes | ObservedAnnotationNodes | undefined =\n observedNodes.get(codeElement);\n if (item != null) {\n this.observedNodes.set(codeElement, item);\n observedNodes.delete(codeElement);\n continue;\n }\n let numberElement = codeElement.querySelector('[data-gutter]');\n if (!(numberElement instanceof HTMLElement)) {\n numberElement = null;\n }\n item = {\n type: 'code',\n codeElement,\n numberElement,\n codeWidth: 'auto',\n numberWidth: 0,\n };\n this.observedNodes.set(codeElement, item);\n this.resizeObserver.observe(codeElement);\n if (numberElement != null) {\n this.observedNodes.set(numberElement, item);\n this.resizeObserver.observe(numberElement);\n }\n }\n\n if (codeElements.length > 1 && !disableAnnotations) {\n const annotationElements = pre.querySelectorAll(\n '[data-line-annotation*=\",\"]'\n );\n\n const elementMap = new Map<string, HTMLElement[]>();\n for (const element of annotationElements) {\n if (!(element instanceof HTMLElement)) {\n continue;\n }\n const { lineAnnotation = '' } = element.dataset;\n if (!/^\\d+,\\d+$/.test(lineAnnotation)) {\n console.error(\n 'DiffFileRenderer.setupResizeObserver: Invalid element or annotation',\n { lineAnnotation, element }\n );\n continue;\n }\n let pairs = elementMap.get(lineAnnotation);\n if (pairs == null) {\n pairs = [];\n elementMap.set(lineAnnotation, pairs);\n }\n pairs.push(element);\n }\n\n for (const [key, pair] of elementMap) {\n if (pair.length !== 2) {\n console.error(\n 'DiffFileRenderer.setupResizeObserver: Bad Pair',\n key,\n pair\n );\n continue;\n }\n const [container1, container2] = pair;\n const child1 = container1.firstElementChild;\n const child2 = container2.firstElementChild;\n if (\n !(container1 instanceof HTMLElement) ||\n !(container2 instanceof HTMLElement) ||\n !(child1 instanceof HTMLElement) ||\n !(child2 instanceof HTMLElement)\n ) {\n continue;\n }\n\n let item = observedNodes.get(child1);\n\n if (item != null) {\n this.observedNodes.set(child1, item);\n this.observedNodes.set(child2, item);\n observedNodes.delete(child1);\n observedNodes.delete(child2);\n continue;\n }\n\n item = {\n type: 'annotations',\n column1: {\n container: container1,\n child: child1,\n childHeight: child1.getBoundingClientRect().height,\n },\n column2: {\n container: container2,\n child: child2,\n childHeight: child2.getBoundingClientRect().height,\n },\n currentHeight: 'auto',\n };\n\n const newHeight = Math.max(\n item.column1.childHeight,\n item.column2.childHeight\n );\n this.applyNewHeight(item, newHeight);\n\n this.observedNodes.set(child1, item);\n this.observedNodes.set(child2, item);\n this.resizeObserver.observe(child1);\n this.resizeObserver.observe(child2);\n }\n }\n\n for (const element of observedNodes.keys()) {\n if (element.isConnected) {\n element.style.removeProperty('--diffs-column-content-width');\n element.style.removeProperty('--diffs-column-number-width');\n element.style.removeProperty('--diffs-column-width');\n if (element.parentElement instanceof HTMLElement) {\n element.parentElement.style.removeProperty(\n '--diffs-annotation-min-height'\n );\n }\n }\n this.resizeObserver.unobserve(element);\n }\n observedNodes.clear();\n }\n\n private handleResizeObserver = (entries: ResizeObserverEntry[]) => {\n for (const entry of entries) {\n const { target, borderBoxSize } = entry;\n if (!(target instanceof HTMLElement)) {\n console.error(\n 'FileDiff.handleResizeObserver: Invalid element for ResizeObserver',\n entry\n );\n continue;\n }\n const item = this.observedNodes.get(target);\n if (item == null) {\n console.error(\n 'FileDiff.handleResizeObserver: Not a valid observed node',\n entry\n );\n continue;\n }\n const specs = borderBoxSize[0];\n if (item.type === 'annotations') {\n const column = (() => {\n if (target === item.column1.child) {\n return item.column1;\n }\n if (target === item.column2.child) {\n return item.column2;\n }\n return undefined;\n })();\n\n if (column == null) {\n console.error(\n `FileDiff.handleResizeObserver: Couldn't find a column for`,\n { item, target }\n );\n continue;\n }\n\n column.childHeight = specs.blockSize;\n const newHeight = Math.max(\n item.column1.childHeight,\n item.column2.childHeight\n );\n this.applyNewHeight(item, newHeight);\n } else if (item.type === 'code') {\n // We debounce code column updates to help with resize performance (mb)\n this.queuedUpdates.set(target, [item, specs]);\n this.queueColumnUpdate();\n }\n }\n };\n\n private queueColumnUpdate() {\n if (this.timeoutID != null) {\n clearTimeout(this.timeoutID);\n }\n // Attempt to debounce resize events to improve general performance... mb\n this.timeoutID = setTimeout(this.handleColumnChange, 1000 / 30);\n }\n\n private handleColumnChange = () => {\n this.timeoutID = undefined;\n for (const [target, [item, specs]] of this.queuedUpdates) {\n // FIXME(amadeus): This needs to be re-worked with display: contents,\n // not sure setting to auto is a good assumption most of the time...\n if (target === item.codeElement) {\n const inlineSize = Math.max(Math.floor(specs.inlineSize), 0);\n if (inlineSize !== item.codeWidth) {\n item.codeWidth = inlineSize;\n const targetWidth = Math.max(item.codeWidth - item.numberWidth, 0);\n item.codeElement.style.setProperty(\n '--diffs-column-content-width',\n `${targetWidth === 0 ? 'auto' : `${targetWidth}px`}`\n );\n item.codeElement.style.setProperty(\n '--diffs-column-width',\n `${item.codeWidth === 0 ? 'auto' : `${item.codeWidth}px`}`\n );\n }\n } else if (target === item.numberElement) {\n const inlineSize = Math.max(Math.ceil(specs.inlineSize), 0);\n if (inlineSize !== item.numberWidth) {\n item.numberWidth = inlineSize;\n item.codeElement.style.setProperty(\n '--diffs-column-number-width',\n `${item.numberWidth === 0 ? 'auto' : `${item.numberWidth}px`}`\n );\n // We probably need to update code width variable if\n // `numberWidth` changed\n if (item.codeWidth !== 'auto') {\n const targetWidth = Math.max(item.codeWidth - item.numberWidth, 0);\n item.codeElement.style.setProperty(\n '--diffs-column-content-width',\n `${targetWidth === 0 ? 'auto' : `${targetWidth}px`}`\n );\n }\n }\n }\n }\n this.queuedUpdates.clear();\n };\n\n private applyNewHeight(item: ObservedAnnotationNodes, newHeight: number) {\n if (newHeight !== item.currentHeight) {\n item.currentHeight = Math.max(newHeight, 0);\n item.column1.container.style.setProperty(\n '--diffs-annotation-min-height',\n `${item.currentHeight}px`\n );\n item.column2.container.style.setProperty(\n '--diffs-annotation-min-height',\n `${item.currentHeight}px`\n );\n }\n }\n}\n"],"mappings":";AAEA,IAAa,gBAAb,MAA2B;CACzB,AAAQ,gCAAgB,IAAI,KAGzB;CACH,AAAQ;CACR,AAAQ,gCAGJ,IAAI,KAAK;CAEb,UAAgB;AAEd,OAAK,gBAAgB,YAAY;AACjC,OAAK,cAAc,OAAO;AAC1B,MAAI,KAAK,aAAa,KACpB,cAAa,KAAK,UAAU;;CAIhC,AAAQ;CAER,MAAM,KAAqB,oBAAmC;AAC5D,OAAK,mBAAmB,IAAI,eAAe,KAAK,qBAAqB;EACrE,MAAM,eAAe,IAAI,iBAAiB,OAAO;EAEjD,MAAM,gBAAgB,IAAI,IAAI,KAAK,cAAc;AACjD,OAAK,cAAc,OAAO;AAC1B,OAAK,MAAM,eAAe,cAAc;GACtC,IAAIA,OACF,cAAc,IAAI,YAAY;AAChC,OAAI,QAAQ,MAAM;AAChB,SAAK,cAAc,IAAI,aAAa,KAAK;AACzC,kBAAc,OAAO,YAAY;AACjC;;GAEF,IAAI,gBAAgB,YAAY,cAAc,gBAAgB;AAC9D,OAAI,EAAE,yBAAyB,aAC7B,iBAAgB;AAElB,UAAO;IACL,MAAM;IACN;IACA;IACA,WAAW;IACX,aAAa;IACd;AACD,QAAK,cAAc,IAAI,aAAa,KAAK;AACzC,QAAK,eAAe,QAAQ,YAAY;AACxC,OAAI,iBAAiB,MAAM;AACzB,SAAK,cAAc,IAAI,eAAe,KAAK;AAC3C,SAAK,eAAe,QAAQ,cAAc;;;AAI9C,MAAI,aAAa,SAAS,KAAK,CAAC,oBAAoB;GAClD,MAAM,qBAAqB,IAAI,iBA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efined","update: CodeColumnUpdate"],"sources":["../../src/managers/ResizeManager.ts"],"sourcesContent":["import type { ObservedAnnotationNodes, ObservedGridNodes } from '../types';\n\ntype CodeColumnUpdate = [HTMLElement, number];\n\nexport class ResizeManager {\n private observedNodes = new Map<\n HTMLElement,\n ObservedAnnotationNodes | ObservedGridNodes\n >();\n private queuedUpdates: Map<ObservedGridNodes, CodeColumnUpdate[]> = new Map();\n\n cleanUp(): void {\n // Disconnect any existing observer\n this.resizeObserver?.disconnect();\n this.observedNodes.clear();\n this.queuedUpdates.clear();\n }\n\n private resizeObserver: ResizeObserver | undefined;\n\n setup(pre: HTMLPreElement, disableAnnotations: boolean): void {\n this.resizeObserver ??= new ResizeObserver(this.handleResizeObserver);\n const codeElements = pre.querySelectorAll('code');\n\n const observedNodes = new Map(this.observedNodes);\n this.observedNodes.clear();\n for (const codeElement of codeElements) {\n let item: ObservedGridNodes | ObservedAnnotationNodes | undefined =\n observedNodes.get(codeElement);\n if (item != null && item.type !== 'code') {\n throw new Error(\n 'ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible'\n );\n }\n\n let numberElement = codeElement.firstElementChild;\n if (!(numberElement instanceof HTMLElement)) {\n numberElement = null;\n }\n\n if (item != null) {\n this.observedNodes.set(codeElement, item);\n observedNodes.delete(codeElement);\n if (item.numberElement !== numberElement) {\n if (item.numberElement != null) {\n this.resizeObserver.unobserve(item.numberElement);\n }\n if (numberElement != null) {\n this.resizeObserver.observe(numberElement);\n observedNodes.delete(numberElement);\n this.observedNodes.set(numberElement, item);\n }\n item.numberElement = numberElement;\n } else if (item.numberElement != null) {\n observedNodes.delete(item.numberElement);\n this.observedNodes.set(item.numberElement, item);\n }\n } else {\n item = {\n type: 'code',\n codeElement,\n numberElement,\n codeWidth: 'auto',\n numberWidth: 0,\n };\n this.observedNodes.set(codeElement, item);\n this.resizeObserver.observe(codeElement);\n if (numberElement != null) {\n this.observedNodes.set(numberElement, item);\n this.resizeObserver.observe(numberElement);\n }\n }\n }\n\n if (codeElements.length > 1 && !disableAnnotations) {\n const annotationElements = pre.querySelectorAll(\n '[data-line-annotation*=\",\"]'\n );\n\n const elementMap = new Map<string, HTMLElement[]>();\n for (const element of annotationElements) {\n if (!(element instanceof HTMLElement)) {\n continue;\n }\n const { lineAnnotation = '' } = element.dataset;\n if (!/^\\d+,\\d+$/.test(lineAnnotation)) {\n console.error(\n 'DiffFileRenderer.setupResizeObserver: Invalid element or annotation',\n { lineAnnotation, element }\n );\n continue;\n }\n let pairs = elementMap.get(lineAnnotation);\n if (pairs == null) {\n pairs = [];\n elementMap.set(lineAnnotation, pairs);\n }\n pairs.push(element);\n }\n\n for (const [key, pair] of elementMap) {\n if (pair.length !== 2) {\n console.error(\n 'DiffFileRenderer.setupResizeObserver: Bad Pair',\n key,\n pair\n );\n continue;\n }\n const [container1, container2] = pair;\n const child1 = container1.firstElementChild;\n const child2 = container2.firstElementChild;\n if (\n !(container1 instanceof HTMLElement) ||\n !(container2 instanceof HTMLElement) ||\n !(child1 instanceof HTMLElement) ||\n !(child2 instanceof HTMLElement)\n ) {\n continue;\n }\n\n let item = observedNodes.get(child1);\n\n if (item != null) {\n this.observedNodes.set(child1, item);\n this.observedNodes.set(child2, item);\n observedNodes.delete(child1);\n observedNodes.delete(child2);\n continue;\n }\n\n item = {\n type: 'annotations',\n column1: {\n container: container1,\n child: child1,\n childHeight: child1.getBoundingClientRect().height,\n },\n column2: {\n container: container2,\n child: child2,\n childHeight: child2.getBoundingClientRect().height,\n },\n currentHeight: 'auto',\n };\n\n const newHeight = Math.max(\n item.column1.childHeight,\n item.column2.childHeight\n );\n this.applyNewHeight(item, newHeight);\n\n this.observedNodes.set(child1, item);\n this.observedNodes.set(child2, item);\n this.resizeObserver.observe(child1);\n this.resizeObserver.observe(child2);\n }\n }\n\n for (const element of observedNodes.keys()) {\n if (element.isConnected) {\n element.style.removeProperty('--diffs-column-content-width');\n element.style.removeProperty('--diffs-column-number-width');\n element.style.removeProperty('--diffs-column-width');\n if (element.parentElement instanceof HTMLElement) {\n element.parentElement.style.removeProperty(\n '--diffs-annotation-min-height'\n );\n }\n }\n this.resizeObserver.unobserve(element);\n }\n observedNodes.clear();\n }\n\n private handleResizeObserver = (entries: ResizeObserverEntry[]) => {\n for (const entry of entries) {\n const { target, borderBoxSize } = entry;\n if (!(target instanceof HTMLElement)) {\n console.error(\n 'FileDiff.handleResizeObserver: Invalid element for ResizeObserver',\n entry\n );\n continue;\n }\n const item = this.observedNodes.get(target);\n if (item == null) {\n console.error(\n 'FileDiff.handleResizeObserver: Not a valid observed node',\n entry\n );\n continue;\n }\n const specs = borderBoxSize[0];\n if (item.type === 'annotations') {\n const column = (() => {\n if (target === item.column1.child) {\n return item.column1;\n }\n if (target === item.column2.child) {\n return item.column2;\n }\n return undefined;\n })();\n\n if (column == null) {\n console.error(\n `FileDiff.handleResizeObserver: Couldn't find a column for`,\n { item, target }\n );\n continue;\n }\n\n column.childHeight = specs.blockSize;\n const newHeight = Math.max(\n item.column1.childHeight,\n item.column2.childHeight\n );\n this.applyNewHeight(item, newHeight);\n } else if (item.type === 'code') {\n const update: CodeColumnUpdate = [target, specs.inlineSize];\n const updates = this.queuedUpdates.get(item) ?? [];\n updates.push(update);\n this.queuedUpdates.set(item, updates);\n }\n }\n this.handleColumnChange();\n };\n\n private handleColumnChange = () => {\n for (const [item, updates] of this.queuedUpdates) {\n for (const [target, targetInlineSize] of updates) {\n // FIXME(amadeus): This needs to be re-worked with display: contents,\n // not sure setting to auto is a good assumption most of the time...\n if (target === item.codeElement) {\n const inlineSize = Math.max(Math.floor(targetInlineSize), 0);\n if (inlineSize !== item.codeWidth) {\n const targetWidth = Math.max(inlineSize - item.numberWidth, 0);\n item.codeWidth = inlineSize === 0 ? 'auto' : inlineSize;\n item.codeElement.style.setProperty(\n '--diffs-column-content-width',\n `${targetWidth > 0 ? `${targetWidth}px` : 'auto'}`\n );\n item.codeElement.style.setProperty(\n '--diffs-column-width',\n `${typeof item.codeWidth === 'number' ? `${item.codeWidth}px` : 'auto'}`\n );\n }\n if (\n item.numberElement != null &&\n typeof item.codeWidth === 'number' &&\n item.numberWidth === 0\n ) {\n updates.push([\n item.numberElement,\n item.numberElement.getBoundingClientRect().width,\n ]);\n }\n } else if (target === item.numberElement) {\n const inlineSize = Math.max(Math.ceil(targetInlineSize), 0);\n if (inlineSize !== item.numberWidth) {\n item.numberWidth = inlineSize;\n item.codeElement.style.setProperty(\n '--diffs-column-number-width',\n `${item.numberWidth === 0 ? 'auto' : `${item.numberWidth}px`}`\n );\n // We probably need to update code width variable if\n // `numberWidth` changed\n if (item.codeWidth !== 'auto') {\n const targetWidth = Math.max(\n item.codeWidth - item.numberWidth,\n 0\n );\n item.codeElement.style.setProperty(\n '--diffs-column-content-width',\n `${targetWidth === 0 ? 'auto' : `${targetWidth}px`}`\n );\n }\n }\n }\n }\n }\n this.queuedUpdates.clear();\n };\n\n private applyNewHeight(item: ObservedAnnotationNodes, newHeight: number) {\n if (newHeight !== item.currentHeight) {\n item.currentHeight = Math.max(newHeight, 0);\n item.column1.container.style.setProperty(\n '--diffs-annotation-min-height',\n `${item.currentHeight}px`\n );\n item.column2.container.style.setProperty(\n '--diffs-annotation-min-height',\n `${item.currentHeight}px`\n );\n }\n }\n}\n"],"mappings":";AAIA,IAAa,gBAAb,MAA2B;CACzB,AAAQ,gCAAgB,IAAI,KAGzB;CACH,AAAQ,gCAA4D,IAAI,KAAK;CAE7E,UAAgB;AAEd,OAAK,gBAAgB,YAAY;AACjC,OAAK,cAAc,OAAO;AAC1B,OAAK,cAAc,OAAO;;CAG5B,AAAQ;CAER,MAAM,KAAqB,oBAAmC;AAC5D,OAAK,mBAAmB,IAAI,eAAe,KAAK,qBAAqB;EACrE,MAAM,eAAe,IAAI,iBAAiB,OAAO;EAEjD,MAAM,gBAAgB,IAAI,IAAI,KAAK,cAAc;AACjD,OAAK,cAAc,OAAO;AAC1B,OAAK,MAAM,eAAe,cAAc;GACtC,IAAIA,OACF,cAAc,IAAI,YAAY;A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,IAAI,GAAG,YAAY,MAAM,SAC3C;AACD,SAAK,YAAY,MAAM,YACrB,wBACA,GAAG,OAAO,KAAK,cAAc,WAAW,GAAG,KAAK,UAAU,MAAM,SACjE;;AAEH,OACE,KAAK,iBAAiB,QACtB,OAAO,KAAK,cAAc,YAC1B,KAAK,gBAAgB,EAErB,SAAQ,KAAK,CACX,KAAK,eACL,KAAK,cAAc,uBAAuB,CAAC,MAC5C,CAAC;aAEK,WAAW,KAAK,eAAe;GACxC,MAAM,aAAa,KAAK,IAAI,KAAK,KAAK,iBAAiB,EAAE,EAAE;AAC3D,OAAI,eAAe,KAAK,aAAa;AACnC,SAAK,cAAc;AACnB,SAAK,YAAY,MAAM,YACrB,+BACA,GAAG,KAAK,gBAAgB,IAAI,SAAS,GAAG,KAAK,YAAY,MAC1D;AAGD,QAAI,KAAK,cAAc,QAAQ;KAC7B,MAAM,cAAc,KAAK,IACvB,KAAK,YAAY,KAAK,aACtB,EACD;AACD,UAAK,YAAY,MAAM,YACrB,gCACA,GAAG,gBAAgB,IAAI,SAAS,GAAG,YAAY,MAChD;;;;AAMX,OAAK,cAAc,OAAO;;CAG5B,AAAQ,eAAe,MAA+B,WAAmB;AACvE,MAAI,cAAc,KAAK,eAAe;AACpC,QAAK,gBAAgB,KAAK,IAAI,WAAW,EAAE;AAC3C,QAAK,QAAQ,UAAU,MAAM,YAC3B,iCACA,GAAG,KAAK,cAAc,IACvB;AACD,QAAK,QAAQ,UAAU,MAAM,YAC3B,iCACA,GAAG,KAAK,cAAc,IACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"jsx.d.ts","names":["DIFFS_TAG_NAME","_1","HTMLElement","React","HTMLAttributes","DetailedHTMLProps","sideEffect"],"sources":["../../src/react/jsx.d.ts"],"sourcesContent":["import 'react';\nimport type { DIFFS_TAG_NAME } from '../constants';\n\ndeclare module 'react' {\n namespace JSX {\n interface IntrinsicElements {\n [DIFFS_TAG_NAME]: React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLElement>,\n HTMLElement\n >;\n }\n }\n}\n"],"mappings":";;;;;EACmD,UAAA,GAAA,CAAA;IAAA,UAAA,iBAAA,CAAA;OAK5CA,cAAAA,CAL4C,EAK3BG,KAAAA,CAAME,iBALqB,CAM3CF,KAAAA,CAAMC,cAAeF,CAAAA,WAAAA,CAAAA,EACrBA,WADME,CACNF;IAFgBC;EAAjBH"}
1
+ {"version":3,"file":"jsx.d.ts","names":["DIFFS_TAG_NAME","_0","HTMLElement","React","HTMLAttributes","DetailedHTMLProps","sideEffect"],"sources":["../../src/react/jsx.d.ts"],"sourcesContent":["import 'react';\nimport type { DIFFS_TAG_NAME } from '../constants';\n\ndeclare module 'react' {\n namespace JSX {\n interface IntrinsicElements {\n [DIFFS_TAG_NAME]: React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLElement>,\n HTMLElement\n >;\n }\n }\n}\n"],"mappings":";;;;;EACmD,UAAA,GAAA,CAAA;IAAA,UAAA,iBAAA,CAAA;OAK5CA,cAAAA,CAL4C,EAK3BG,KAAAA,CAAME,iBALqB,CAM3CF,KAAAA,CAAMC,cAAeF,CAAAA,WAAAA,CAAAA,EACrBA,WADME,CACNF;IAFgBC;EAAjBH"}
@@ -9157,7 +9157,7 @@ function l(a$1) {
9157
9157
  }
9158
9158
 
9159
9159
  //#endregion
9160
- //#region ../../node_modules/.bun/regex@6.0.1/node_modules/regex/src/utils-internals.js
9160
+ //#region ../../node_modules/.bun/regex@6.1.0/node_modules/regex/src/utils-internals.js
9161
9161
  const noncapturingDelim = String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;
9162
9162
  /**
9163
9163
  Updates the array in place by incrementing each value greater than or equal to the threshold.
@@ -9345,13 +9345,16 @@ function getGroupContents(expression, contentsStartPos) {
9345
9345
  }
9346
9346
 
9347
9347
  //#endregion
9348
- //#region ../../node_modules/.bun/regex@6.0.1/node_modules/regex/src/atomic.js
9348
+ //#region ../../node_modules/.bun/regex@6.1.0/node_modules/regex/src/atomic.js
9349
+ /**
9350
+ @import {PluginData, PluginResult} from './regex.js';
9351
+ */
9349
9352
  const atomicPluginToken = new RegExp(String.raw`(?<noncapturingStart>${noncapturingDelim})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`, "gsu");
9350
9353
  /**
9351
9354
  Apply transformations for atomic groups: `(?>…)`.
9352
9355
  @param {string} expression
9353
- @param {import('./regex.js').PluginData} [data]
9354
- @returns {Required<import('./regex.js').PluginResult>}
9356
+ @param {PluginData} [data]
9357
+ @returns {Required<PluginResult>}
9355
9358
  */
9356
9359
  function atomic(expression, data) {
9357
9360
  const hiddenCaptures = data?.hiddenCaptures ?? [];
@@ -9459,7 +9462,7 @@ Transform posessive quantifiers into atomic groups. The posessessive quantifiers
9459
9462
  This follows Java, PCRE, Perl, and Python.
9460
9463
  Possessive quantifiers in Oniguruma and Onigmo are only: `?+`, `*+`, `++`.
9461
9464
  @param {string} expression
9462
- @returns {import('./regex.js').PluginResult}
9465
+ @returns {PluginResult}
9463
9466
  */
9464
9467
  function possessive(expression) {
9465
9468
  if (!new RegExp(`${baseQuantifier}\\+`).test(expression)) {
@@ -9518,7 +9521,7 @@ function possessive(expression) {
9518
9521
  }
9519
9522
 
9520
9523
  //#endregion
9521
- //#region ../../node_modules/.bun/regex@6.0.1/node_modules/regex/src/subclass.js
9524
+ //#region ../../node_modules/.bun/regex@6.1.0/node_modules/regex/src/subclass.js
9522
9525
  /**
9523
9526
  Works the same as JavaScript's native `RegExp` constructor in all contexts, but automatically
9524
9527
  adjusts subpattern matches and indices (with flag `d`) to account for captures added as part of