@pierre/diffs 1.1.9 → 1.1.10
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/UnresolvedFile.d.ts.map +1 -1
- package/dist/components/VirtulizerDevelopment.d.ts.map +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/react/MultiFileDiff.js +6 -2
- package/dist/react/MultiFileDiff.js.map +1 -1
- package/dist/react/jsx.d.ts +0 -1
- package/dist/react/jsx.d.ts.map +1 -1
- package/dist/react/types.js +0 -1
- package/dist/ssr/FileDiffReact.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnresolvedFile.d.ts","names":["HunksRenderResult","UnresolvedFileHunksRenderer","UnresolvedFileHunksRendererOptions","FileContents","FileDiffMetadata","MergeConflictActionPayload","MergeConflictMarkerRow","MergeConflictResolution","MergeConflictDiffAction","WorkerPoolManager","FileDiff","FileDiffOptions","FileDiffRenderProps","RenderMergeConflictActions","LAnnotation","UnresolvedFile","HTMLElement","DocumentFragment","MergeConflictActionsTypeOption","UnresolvedFileOptions","Omit","UnresolvedFileRenderProps","UnresolvedFileHydrationProps","GetOrComputeDiffProps","ResolveConflictReturn","UnresolvedFileDataCache","HTMLPreElement","getUnresolvedDiffHunksRendererOptions"],"sources":["../../src/components/UnresolvedFile.d.ts"],"sourcesContent":["import type { HunksRenderResult } from '../renderers/DiffHunksRenderer';\nimport { UnresolvedFileHunksRenderer, type UnresolvedFileHunksRendererOptions } from '../renderers/UnresolvedFileHunksRenderer';\nimport type { FileContents, FileDiffMetadata, MergeConflictActionPayload, MergeConflictMarkerRow, MergeConflictResolution } from '../types';\nimport { type MergeConflictDiffAction } from '../utils/parseMergeConflictDiffFromFile';\nimport type { WorkerPoolManager } from '../worker';\nimport { FileDiff, type FileDiffOptions, type FileDiffRenderProps } from './FileDiff';\nexport type RenderMergeConflictActions<LAnnotation> = (action: MergeConflictDiffAction, instance: UnresolvedFile<LAnnotation>) => HTMLElement | DocumentFragment | null | undefined;\nexport type MergeConflictActionsTypeOption<LAnnotation> = 'none' | 'default' | RenderMergeConflictActions<LAnnotation>;\nexport interface UnresolvedFileOptions<LAnnotation> extends Omit<FileDiffOptions<LAnnotation>, 'diffStyle'> {\n onPostRender?(node: HTMLElement, instance: UnresolvedFile<LAnnotation>): unknown;\n mergeConflictActionsType?: MergeConflictActionsTypeOption<LAnnotation>;\n onMergeConflictAction?(payload: MergeConflictActionPayload, instance: UnresolvedFile<LAnnotation>): void;\n onMergeConflictResolve?(file: FileContents, payload: MergeConflictActionPayload): void;\n maxContextLines?: number;\n}\nexport interface UnresolvedFileRenderProps<LAnnotation> extends Omit<FileDiffRenderProps<LAnnotation>, 'oldFile' | 'newFile'> {\n file?: FileContents;\n actions?: (MergeConflictDiffAction | undefined)[];\n markerRows?: MergeConflictMarkerRow[];\n}\nexport interface UnresolvedFileHydrationProps<LAnnotation> extends Omit<UnresolvedFileRenderProps<LAnnotation>, 'file'> {\n file?: FileContents;\n fileContainer: HTMLElement;\n prerenderedHTML?: string;\n}\ninterface GetOrComputeDiffProps {\n file: FileContents | undefined;\n fileDiff: FileDiffMetadata | undefined;\n actions: (MergeConflictDiffAction | undefined)[] | undefined;\n markerRows: MergeConflictMarkerRow[] | undefined;\n}\ninterface ResolveConflictReturn {\n file: FileContents;\n fileDiff: FileDiffMetadata;\n actions: (MergeConflictDiffAction | undefined)[];\n markerRows: MergeConflictMarkerRow[];\n}\ntype UnresolvedFileDataCache = GetOrComputeDiffProps;\nexport declare class UnresolvedFile<LAnnotation = undefined> extends FileDiff<LAnnotation> {\n options: UnresolvedFileOptions<LAnnotation>;\n readonly __id: string;\n protected computedCache: UnresolvedFileDataCache;\n private conflictActions;\n private markerRows;\n private conflictActionCache;\n constructor(options?: UnresolvedFileOptions<LAnnotation>, workerManager?: WorkerPoolManager | undefined, isContainerManaged?: boolean);\n setOptions(options: UnresolvedFileOptions<LAnnotation> | undefined): void;\n protected createHunksRenderer(options: UnresolvedFileOptions<LAnnotation>): UnresolvedFileHunksRenderer<LAnnotation>;\n protected getHunksRendererOptions(options: UnresolvedFileOptions<LAnnotation>): UnresolvedFileHunksRendererOptions;\n protected applyPreNodeAttributes(pre: HTMLPreElement, result: HunksRenderResult): void;\n cleanUp(): void;\n private getOrComputeDiff;\n hydrate(props: UnresolvedFileHydrationProps<LAnnotation>): void;\n rerender(): void;\n render(props?: UnresolvedFileRenderProps<LAnnotation>): boolean;\n resolveConflict(conflictIndex: number, resolution: MergeConflictResolution, fileDiff?: FileDiffMetadata | undefined): ResolveConflictReturn | undefined;\n private resolveConflictAndRender;\n private setActiveMergeConflictState;\n private handleMergeConflictActionClick;\n private renderMergeConflictActionSlots;\n private renderMergeConflictAction;\n private clearMergeConflictActionCache;\n}\nexport declare function getUnresolvedDiffHunksRendererOptions<LAnnotation>(options?: UnresolvedFileOptions<LAnnotation>, baseOptions?: UnresolvedFileOptions<LAnnotation>): UnresolvedFileHunksRendererOptions;\nexport {};\n//# sourceMappingURL=UnresolvedFile.d.ts.map"],"mappings":";;;;;;;;;KAMYa,mDAAmDL,mCAAmCO,eAAeD,iBAAiBE,cAAcC;KACpIC,mEAAmEL,2BAA2BC;UACzFK,2CAA2CC,KAAKT,gBAAgBG;EAFrED,YAAAA,EAAAA,IAAAA,EAGYG,WAHc,EAAA,QAAAF,EAGSC,cAHT,CAGwBD,WAHxB,CAAA,CAAA,EAAA,OAAA;EAAyBN,wBAAAA,CAAAA,EAIhCU,8BAJgCV,CAIDM,WAJCN,CAAAA;EAAkDM,qBAAAA,EAAAA,OAAAA,EAK7ET,0BAL6ES,EAAAA,QAAAA,EAKvCC,cALuCD,CAKxBA,WALwBA,CAAAA,CAAAA,EAAAA,IAAAA;EAAfC,sBAAAA,EAAAA,IAAAA,EAMhEZ,YANgEY,EAAAA,OAAAA,EAMzCV,0BANyCU,CAAAA,EAAAA,IAAAA;EAAgCC,eAAAA,CAAAA,EAAAA,MAAAA;;AAA8B,UAS/IK,yBAT+I,CAAA,WAAA,CAAA,SAShGD,IATgG,CAS3FR,mBAT2F,CASvEE,WATuE,CAAA,EAAA,SAAA,GAAA,SAAA,CAAA,CAAA;EACpJI,IAAAA,CAAAA,EASDf,YATCe;EACKC,OAAAA,CAAAA,EAAAA,CASFX,uBATuBM,GAAAA,
|
|
1
|
+
{"version":3,"file":"UnresolvedFile.d.ts","names":["HunksRenderResult","UnresolvedFileHunksRenderer","UnresolvedFileHunksRendererOptions","FileContents","FileDiffMetadata","MergeConflictActionPayload","MergeConflictMarkerRow","MergeConflictResolution","MergeConflictDiffAction","WorkerPoolManager","FileDiff","FileDiffOptions","FileDiffRenderProps","RenderMergeConflictActions","LAnnotation","UnresolvedFile","HTMLElement","DocumentFragment","MergeConflictActionsTypeOption","UnresolvedFileOptions","Omit","UnresolvedFileRenderProps","UnresolvedFileHydrationProps","GetOrComputeDiffProps","ResolveConflictReturn","UnresolvedFileDataCache","HTMLPreElement","getUnresolvedDiffHunksRendererOptions"],"sources":["../../src/components/UnresolvedFile.d.ts"],"sourcesContent":["import type { HunksRenderResult } from '../renderers/DiffHunksRenderer';\nimport { UnresolvedFileHunksRenderer, type UnresolvedFileHunksRendererOptions } from '../renderers/UnresolvedFileHunksRenderer';\nimport type { FileContents, FileDiffMetadata, MergeConflictActionPayload, MergeConflictMarkerRow, MergeConflictResolution } from '../types';\nimport { type MergeConflictDiffAction } from '../utils/parseMergeConflictDiffFromFile';\nimport type { WorkerPoolManager } from '../worker';\nimport { FileDiff, type FileDiffOptions, type FileDiffRenderProps } from './FileDiff';\nexport type RenderMergeConflictActions<LAnnotation> = (action: MergeConflictDiffAction, instance: UnresolvedFile<LAnnotation>) => HTMLElement | DocumentFragment | null | undefined;\nexport type MergeConflictActionsTypeOption<LAnnotation> = 'none' | 'default' | RenderMergeConflictActions<LAnnotation>;\nexport interface UnresolvedFileOptions<LAnnotation> extends Omit<FileDiffOptions<LAnnotation>, 'diffStyle'> {\n onPostRender?(node: HTMLElement, instance: UnresolvedFile<LAnnotation>): unknown;\n mergeConflictActionsType?: MergeConflictActionsTypeOption<LAnnotation>;\n onMergeConflictAction?(payload: MergeConflictActionPayload, instance: UnresolvedFile<LAnnotation>): void;\n onMergeConflictResolve?(file: FileContents, payload: MergeConflictActionPayload): void;\n maxContextLines?: number;\n}\nexport interface UnresolvedFileRenderProps<LAnnotation> extends Omit<FileDiffRenderProps<LAnnotation>, 'oldFile' | 'newFile'> {\n file?: FileContents;\n actions?: (MergeConflictDiffAction | undefined)[];\n markerRows?: MergeConflictMarkerRow[];\n}\nexport interface UnresolvedFileHydrationProps<LAnnotation> extends Omit<UnresolvedFileRenderProps<LAnnotation>, 'file'> {\n file?: FileContents;\n fileContainer: HTMLElement;\n prerenderedHTML?: string;\n}\ninterface GetOrComputeDiffProps {\n file: FileContents | undefined;\n fileDiff: FileDiffMetadata | undefined;\n actions: (MergeConflictDiffAction | undefined)[] | undefined;\n markerRows: MergeConflictMarkerRow[] | undefined;\n}\ninterface ResolveConflictReturn {\n file: FileContents;\n fileDiff: FileDiffMetadata;\n actions: (MergeConflictDiffAction | undefined)[];\n markerRows: MergeConflictMarkerRow[];\n}\ntype UnresolvedFileDataCache = GetOrComputeDiffProps;\nexport declare class UnresolvedFile<LAnnotation = undefined> extends FileDiff<LAnnotation> {\n options: UnresolvedFileOptions<LAnnotation>;\n readonly __id: string;\n protected computedCache: UnresolvedFileDataCache;\n private conflictActions;\n private markerRows;\n private conflictActionCache;\n constructor(options?: UnresolvedFileOptions<LAnnotation>, workerManager?: WorkerPoolManager | undefined, isContainerManaged?: boolean);\n setOptions(options: UnresolvedFileOptions<LAnnotation> | undefined): void;\n protected createHunksRenderer(options: UnresolvedFileOptions<LAnnotation>): UnresolvedFileHunksRenderer<LAnnotation>;\n protected getHunksRendererOptions(options: UnresolvedFileOptions<LAnnotation>): UnresolvedFileHunksRendererOptions;\n protected applyPreNodeAttributes(pre: HTMLPreElement, result: HunksRenderResult): void;\n cleanUp(): void;\n private getOrComputeDiff;\n hydrate(props: UnresolvedFileHydrationProps<LAnnotation>): void;\n rerender(): void;\n render(props?: UnresolvedFileRenderProps<LAnnotation>): boolean;\n resolveConflict(conflictIndex: number, resolution: MergeConflictResolution, fileDiff?: FileDiffMetadata | undefined): ResolveConflictReturn | undefined;\n private resolveConflictAndRender;\n private setActiveMergeConflictState;\n private handleMergeConflictActionClick;\n private renderMergeConflictActionSlots;\n private renderMergeConflictAction;\n private clearMergeConflictActionCache;\n}\nexport declare function getUnresolvedDiffHunksRendererOptions<LAnnotation>(options?: UnresolvedFileOptions<LAnnotation>, baseOptions?: UnresolvedFileOptions<LAnnotation>): UnresolvedFileHunksRendererOptions;\nexport {};\n//# sourceMappingURL=UnresolvedFile.d.ts.map"],"mappings":";;;;;;;;;KAMYa,mDAAmDL,mCAAmCO,eAAeD,iBAAiBE,cAAcC;KACpIC,mEAAmEL,2BAA2BC;UACzFK,2CAA2CC,KAAKT,gBAAgBG;EAFrED,YAAAA,EAAAA,IAAAA,EAGYG,WAHc,EAAA,QAAAF,EAGSC,cAHT,CAGwBD,WAHxB,CAAA,CAAA,EAAA,OAAA;EAAyBN,wBAAAA,CAAAA,EAIhCU,8BAJgCV,CAIDM,WAJCN,CAAAA;EAAkDM,qBAAAA,EAAAA,OAAAA,EAK7ET,0BAL6ES,EAAAA,QAAAA,EAKvCC,cALuCD,CAKxBA,WALwBA,CAAAA,CAAAA,EAAAA,IAAAA;EAAfC,sBAAAA,EAAAA,IAAAA,EAMhEZ,YANgEY,EAAAA,OAAAA,EAMzCV,0BANyCU,CAAAA,EAAAA,IAAAA;EAAgCC,eAAAA,CAAAA,EAAAA,MAAAA;;AAA8B,UAS/IK,yBAT+I,CAAA,WAAA,CAAA,SAShGD,IATgG,CAS3FR,mBAT2F,CASvEE,WATuE,CAAA,EAAA,SAAA,GAAA,SAAA,CAAA,CAAA;EACpJI,IAAAA,CAAAA,EASDf,YATCe;EACKC,OAAAA,CAAAA,EAAAA,CASFX,uB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wEA,qBAxBxEA,CAwB8FL,WAxB9FK,CAAAA,EAAAA,WAAAA,CAAAA,EAwB0HA,qBAxB1HA,CAwBgJL,WAxBhJK,CAAAA,CAAAA,EAwB+JjB,kCAxB/JiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtulizerDevelopment.d.ts","names":["AdvancedVirtualizer","Virtualizer","
|
|
1
|
+
{"version":3,"file":"VirtulizerDevelopment.d.ts","names":["AdvancedVirtualizer","Virtualizer","_0","sideEffect"],"sources":["../../src/components/VirtulizerDevelopment.d.ts"],"sourcesContent":["import type { AdvancedVirtualizer } from './AdvancedVirtualizer';\nimport type { Virtualizer } from './Virtualizer';\n\n// FIXME(amadeus): REMOVE ME AFTER RELEASING VIRTUALIZATION\ndeclare global {\n interface Window {\n // oxlint-disable-next-line typescript/no-explicit-any\n __INSTANCE?: AdvancedVirtualizer<any> | Virtualizer;\n __TOGGLE?: () => void;\n __LOG?: boolean;\n }\n}\n"],"mappings":";;;;;AACiD,QAAAE,MAAA,CAAA;EAAA,UAAA,MAAA,CAAA;;IAMMC,UAAAD,CAAA,EAAtCF,mBAAsC,CAAA,GAAA,CAAA,GAAXC,WAAW;IAAA,QAAA,CAAA,EAAA,GAAA,GAAA,IAAA"}
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","names":["HunkExpansionRegion","RenderRange","ThemesType","VirtualFileMetrics","DIFFS_TAG_NAME","COMMIT_METADATA_SPLIT","RegExp","GIT_DIFF_FILE_BREAK_REGEX","UNIFIED_DIFF_FILE_BREAK_REGEX","FILE_CONTEXT_BLOB","HUNK_HEADER","SPLIT_WITH_NEWLINES","FILENAME_HEADER_REGEX","FILENAME_HEADER_REGEX_GIT","ALTERNATE_FILE_NAMES_GIT","INDEX_LINE_METADATA","MERGE_CONFLICT_START_MARKER_REGEX","MERGE_CONFLICT_BASE_MARKER_REGEX","MERGE_CONFLICT_SEPARATOR_MARKER_REGEX","MERGE_CONFLICT_END_MARKER_REGEX","HEADER_PREFIX_SLOT_ID","HEADER_METADATA_SLOT_ID","CUSTOM_HEADER_SLOT_ID","DEFAULT_THEMES","THEME_CSS_ATTRIBUTE","UNSAFE_CSS_ATTRIBUTE","CORE_CSS_ATTRIBUTE","DEFAULT_COLLAPSED_CONTEXT_THRESHOLD","DEFAULT_VIRTUAL_FILE_METRICS","DEFAULT_EXPANDED_REGION","DEFAULT_RENDER_RANGE","EMPTY_RENDER_RANGE"],"sources":["../src/constants.d.ts"],"sourcesContent":["import type { HunkExpansionRegion, RenderRange, ThemesType, VirtualFileMetrics } from './types';\nexport declare const DIFFS_TAG_NAME: \"diffs-container\";\nexport declare const COMMIT_METADATA_SPLIT: RegExp;\nexport declare const GIT_DIFF_FILE_BREAK_REGEX: RegExp;\nexport declare const UNIFIED_DIFF_FILE_BREAK_REGEX: RegExp;\nexport declare const FILE_CONTEXT_BLOB: RegExp;\nexport declare const HUNK_HEADER: RegExp;\nexport declare const SPLIT_WITH_NEWLINES: RegExp;\nexport declare const FILENAME_HEADER_REGEX: RegExp;\nexport declare const FILENAME_HEADER_REGEX_GIT: RegExp;\nexport declare const ALTERNATE_FILE_NAMES_GIT: RegExp;\nexport declare const INDEX_LINE_METADATA: RegExp;\nexport declare const MERGE_CONFLICT_START_MARKER_REGEX: RegExp;\nexport declare const MERGE_CONFLICT_BASE_MARKER_REGEX: RegExp;\nexport declare const MERGE_CONFLICT_SEPARATOR_MARKER_REGEX: RegExp;\nexport declare const MERGE_CONFLICT_END_MARKER_REGEX: RegExp;\nexport declare const HEADER_PREFIX_SLOT_ID = \"header-prefix\";\nexport declare const HEADER_METADATA_SLOT_ID = \"header-metadata\";\nexport declare const CUSTOM_HEADER_SLOT_ID = \"header-custom\";\nexport declare const DEFAULT_THEMES: ThemesType;\nexport declare const THEME_CSS_ATTRIBUTE = \"data-theme-css\";\nexport declare const UNSAFE_CSS_ATTRIBUTE = \"data-unsafe-css\";\nexport declare const CORE_CSS_ATTRIBUTE = \"data-core-css\";\nexport declare const DEFAULT_COLLAPSED_CONTEXT_THRESHOLD = 1;\nexport declare const DEFAULT_VIRTUAL_FILE_METRICS: VirtualFileMetrics;\nexport declare const DEFAULT_EXPANDED_REGION: HunkExpansionRegion;\nexport declare const DEFAULT_RENDER_RANGE: RenderRange;\nexport declare const EMPTY_RENDER_RANGE: RenderRange;\n//# sourceMappingURL=constants.d.ts.map"],"mappings":";;;cACqBI;cACAC,uBAAuBC;AADvBF,cAEAG,yBAFiC,EAEND,MAFM;AACjCD,cAEAG,6BAF6B,EAEEF,MAFF;AAC7BC,cAEAE,iBAFiC,EAEdH,MAFQA;AAC3BE,cAEAE,WAFAF,EAEaF,MAFwB;AACrCG,cAEAE,mBAFmBL,EAEEA,MAFI;AACzBI,cAEAE,qBAFmB,EAEIN,MAFJ;AACnBK,cAEAE,yBAF2B,EAEAP,MAFA;AAC3BM,cAEAE,wBAFuBR,EAEGA,MAFG;AAC7BO,cAEAE,mBAFiC,EAEZT,MAFMA;AAC3BQ,cAEAE,iCAFgC,EAEGV,MAFH;AAChCS,cAEAE,gCAF2B,EAEOX,MAFP;AAC3BU,cAEAE,qCAFmCZ,EAEIA,MAFE;AACzCW,cAEAE,+BAFkCb,EAEDA,MAFO;AACxCY,cAEAE,qBAAAA,GAF6C,eAANd;AACvCa,cAEAE,uBAAAA,GAFuC,iBAAA;AACvCD,cAEAE,qBAAAA,GAFqB,eAAA;AACrBD,cAEAE,cAFuB,EAEPrB,UAFO;AACvBoB,cAEAE,mBAAAA,GAFqB,gBAAA;AACrBD,cAEAE,oBAAAA,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","names":["HunkExpansionRegion","RenderRange","ThemesType","VirtualFileMetrics","DIFFS_TAG_NAME","COMMIT_METADATA_SPLIT","RegExp","GIT_DIFF_FILE_BREAK_REGEX","UNIFIED_DIFF_FILE_BREAK_REGEX","FILE_CONTEXT_BLOB","HUNK_HEADER","SPLIT_WITH_NEWLINES","FILENAME_HEADER_REGEX","FILENAME_HEADER_REGEX_GIT","ALTERNATE_FILE_NAMES_GIT","INDEX_LINE_METADATA","MERGE_CONFLICT_START_MARKER_REGEX","MERGE_CONFLICT_BASE_MARKER_REGEX","MERGE_CONFLICT_SEPARATOR_MARKER_REGEX","MERGE_CONFLICT_END_MARKER_REGEX","HEADER_PREFIX_SLOT_ID","HEADER_METADATA_SLOT_ID","CUSTOM_HEADER_SLOT_ID","DEFAULT_THEMES","THEME_CSS_ATTRIBUTE","UNSAFE_CSS_ATTRIBUTE","CORE_CSS_ATTRIBUTE","DEFAULT_COLLAPSED_CONTEXT_THRESHOLD","DEFAULT_VIRTUAL_FILE_METRICS","DEFAULT_EXPANDED_REGION","DEFAULT_RENDER_RANGE","EMPTY_RENDER_RANGE"],"sources":["../src/constants.d.ts"],"sourcesContent":["import type { HunkExpansionRegion, RenderRange, ThemesType, VirtualFileMetrics } from './types';\nexport declare const DIFFS_TAG_NAME: \"diffs-container\";\nexport declare const COMMIT_METADATA_SPLIT: RegExp;\nexport declare const GIT_DIFF_FILE_BREAK_REGEX: RegExp;\nexport declare const UNIFIED_DIFF_FILE_BREAK_REGEX: RegExp;\nexport declare const FILE_CONTEXT_BLOB: RegExp;\nexport declare const HUNK_HEADER: RegExp;\nexport declare const SPLIT_WITH_NEWLINES: RegExp;\nexport declare const FILENAME_HEADER_REGEX: RegExp;\nexport declare const FILENAME_HEADER_REGEX_GIT: RegExp;\nexport declare const ALTERNATE_FILE_NAMES_GIT: RegExp;\nexport declare const INDEX_LINE_METADATA: RegExp;\nexport declare const MERGE_CONFLICT_START_MARKER_REGEX: RegExp;\nexport declare const MERGE_CONFLICT_BASE_MARKER_REGEX: RegExp;\nexport declare const MERGE_CONFLICT_SEPARATOR_MARKER_REGEX: RegExp;\nexport declare const MERGE_CONFLICT_END_MARKER_REGEX: RegExp;\nexport declare const HEADER_PREFIX_SLOT_ID = \"header-prefix\";\nexport declare const HEADER_METADATA_SLOT_ID = \"header-metadata\";\nexport declare const CUSTOM_HEADER_SLOT_ID = \"header-custom\";\nexport declare const DEFAULT_THEMES: ThemesType;\nexport declare const THEME_CSS_ATTRIBUTE = \"data-theme-css\";\nexport declare const UNSAFE_CSS_ATTRIBUTE = \"data-unsafe-css\";\nexport declare const CORE_CSS_ATTRIBUTE = \"data-core-css\";\nexport declare const DEFAULT_COLLAPSED_CONTEXT_THRESHOLD = 1;\nexport declare const DEFAULT_VIRTUAL_FILE_METRICS: VirtualFileMetrics;\nexport declare const DEFAULT_EXPANDED_REGION: HunkExpansionRegion;\nexport declare const DEFAULT_RENDER_RANGE: RenderRange;\nexport declare const EMPTY_RENDER_RANGE: RenderRange;\n//# sourceMappingURL=constants.d.ts.map"],"mappings":";;;cACqBI;cACAC,uBAAuBC;AADvBF,cAEAG,yBAFiC,EAEND,MAFM;AACjCD,cAEAG,6BAF6B,EAEEF,MAFF;AAC7BC,cAEAE,iBAFiC,EAEdH,MAFQA;AAC3BE,cAEAE,WAFAF,EAEaF,MAFwB;AACrCG,cAEAE,mBAFmBL,EAEEA,MAFI;AACzBI,cAEAE,qBAFmB,EAEIN,MAFJ;AACnBK,cAEAE,yBAF2B,EAEAP,MAFA;AAC3BM,cAEAE,wBAFuBR,EAEGA,MAFG;AAC7BO,cAEAE,mBAFiC,EAEZT,MAFMA;AAC3BQ,cAEAE,iCAFgC,EAEGV,MAFH;AAChCS,cAEAE,gCAF2B,EAEOX,MAFP;AAC3BU,cAEAE,qCAFmCZ,EAEIA,MAFE;AACzCW,cAEAE,+BAFkCb,EAEDA,MAFO;AACxCY,cAEAE,qBAAAA,GAF6C,eAANd;AACvCa,cAEAE,uBAAAA,GAFuC,iBAAA;AACvCD,cAEAE,qBAAAA,GAFqB,eAAA;AACrBD,cAEAE,cAFuB,EAEPrB,UAFO;AACvBoB,cAEAE,mBAAAA,GAFqB,gBAAA;AACrBD,cAEAE,oBAAAA,GAFgBvB,iBAAU;AAC1BsB,cAEAE,kBAAAA,GAFmB,eAAA;AACnBD,cAEAE,mCAAAA,GAFoB,CAAA;AACpBD,cAEAE,4BAFkB,EAEYzB,kBAFZ;AAClBwB,cAEAE,uBAFmC,EAEV7B,mBAFU;AACnC4B,cAEAE,oBAFgD,EAE1B7B,WAFQE;AAC9B0B,cAEAE,kBAF4C,EAExB9B,WAFKD"}
|
|
@@ -12,8 +12,12 @@ import { jsx } from "react/jsx-runtime";
|
|
|
12
12
|
//#region src/react/MultiFileDiff.tsx
|
|
13
13
|
function MultiFileDiff({ oldFile, newFile, options, metrics, lineAnnotations, selectedLines, className, style, prerenderedHTML, renderAnnotation, renderCustomHeader, renderHeaderPrefix, renderHeaderMetadata, renderGutterUtility, renderHoverUtility, disableWorkerPool = false }) {
|
|
14
14
|
const fileDiff = useMemo(() => {
|
|
15
|
-
return parseDiffFromFile(oldFile, newFile);
|
|
16
|
-
}, [
|
|
15
|
+
return parseDiffFromFile(oldFile, newFile, options?.parseDiffOptions);
|
|
16
|
+
}, [
|
|
17
|
+
oldFile,
|
|
18
|
+
newFile,
|
|
19
|
+
options?.parseDiffOptions
|
|
20
|
+
]);
|
|
17
21
|
const { ref, getHoveredLine } = useFileDiffInstance({
|
|
18
22
|
fileDiff,
|
|
19
23
|
options,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiFileDiff.js","names":[],"sources":["../../src/react/MultiFileDiff.tsx"],"sourcesContent":["'use client';\n\nimport { useMemo } from 'react';\n\nimport { DIFFS_TAG_NAME } from '../constants';\nimport type { FileContents } from '../types';\nimport { parseDiffFromFile } from '../utils/parseDiffFromFile';\nimport type { DiffBasePropsReact } from './types';\nimport { renderDiffChildren } from './utils/renderDiffChildren';\nimport { templateRender } from './utils/templateRender';\nimport { useFileDiffInstance } from './utils/useFileDiffInstance';\n\nexport type { FileContents };\n\nexport interface MultiFileDiffProps<\n LAnnotation,\n> extends DiffBasePropsReact<LAnnotation> {\n oldFile: FileContents;\n newFile: FileContents;\n disableWorkerPool?: boolean;\n}\n\nexport function MultiFileDiff<LAnnotation = undefined>({\n oldFile,\n newFile,\n options,\n metrics,\n lineAnnotations,\n selectedLines,\n className,\n style,\n prerenderedHTML,\n renderAnnotation,\n renderCustomHeader,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderGutterUtility,\n renderHoverUtility,\n disableWorkerPool = false,\n}: MultiFileDiffProps<LAnnotation>): React.JSX.Element {\n const fileDiff = useMemo(() => {\n return parseDiffFromFile(oldFile, newFile);\n }, [oldFile, newFile]);\n const { ref, getHoveredLine } = useFileDiffInstance({\n fileDiff,\n options,\n metrics,\n lineAnnotations,\n selectedLines,\n prerenderedHTML,\n hasGutterRenderUtility:\n renderGutterUtility != null || renderHoverUtility != null,\n hasCustomHeader: renderCustomHeader != null,\n disableWorkerPool,\n });\n const children = renderDiffChildren({\n fileDiff,\n renderCustomHeader,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderAnnotation,\n lineAnnotations,\n renderGutterUtility,\n renderHoverUtility,\n getHoveredLine,\n });\n return (\n <DIFFS_TAG_NAME ref={ref} className={className} style={style}>\n {templateRender(children, prerenderedHTML)}\n </DIFFS_TAG_NAME>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAsBA,SAAgB,cAAuC,EACrD,SACA,SACA,SACA,SACA,iBACA,eACA,WACA,OACA,iBACA,kBACA,oBACA,oBACA,sBACA,qBACA,oBACA,oBAAoB,SACiC;CACrD,MAAM,WAAW,cAAc;AAC7B,SAAO,kBAAkB,SAAS,
|
|
1
|
+
{"version":3,"file":"MultiFileDiff.js","names":[],"sources":["../../src/react/MultiFileDiff.tsx"],"sourcesContent":["'use client';\n\nimport { useMemo } from 'react';\n\nimport { DIFFS_TAG_NAME } from '../constants';\nimport type { FileContents } from '../types';\nimport { parseDiffFromFile } from '../utils/parseDiffFromFile';\nimport type { DiffBasePropsReact } from './types';\nimport { renderDiffChildren } from './utils/renderDiffChildren';\nimport { templateRender } from './utils/templateRender';\nimport { useFileDiffInstance } from './utils/useFileDiffInstance';\n\nexport type { FileContents };\n\nexport interface MultiFileDiffProps<\n LAnnotation,\n> extends DiffBasePropsReact<LAnnotation> {\n oldFile: FileContents;\n newFile: FileContents;\n disableWorkerPool?: boolean;\n}\n\nexport function MultiFileDiff<LAnnotation = undefined>({\n oldFile,\n newFile,\n options,\n metrics,\n lineAnnotations,\n selectedLines,\n className,\n style,\n prerenderedHTML,\n renderAnnotation,\n renderCustomHeader,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderGutterUtility,\n renderHoverUtility,\n disableWorkerPool = false,\n}: MultiFileDiffProps<LAnnotation>): React.JSX.Element {\n const fileDiff = useMemo(() => {\n return parseDiffFromFile(oldFile, newFile, options?.parseDiffOptions);\n }, [oldFile, newFile, options?.parseDiffOptions]);\n const { ref, getHoveredLine } = useFileDiffInstance({\n fileDiff,\n options,\n metrics,\n lineAnnotations,\n selectedLines,\n prerenderedHTML,\n hasGutterRenderUtility:\n renderGutterUtility != null || renderHoverUtility != null,\n hasCustomHeader: renderCustomHeader != null,\n disableWorkerPool,\n });\n const children = renderDiffChildren({\n fileDiff,\n renderCustomHeader,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderAnnotation,\n lineAnnotations,\n renderGutterUtility,\n renderHoverUtility,\n getHoveredLine,\n });\n return (\n <DIFFS_TAG_NAME ref={ref} className={className} style={style}>\n {templateRender(children, prerenderedHTML)}\n </DIFFS_TAG_NAME>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAsBA,SAAgB,cAAuC,EACrD,SACA,SACA,SACA,SACA,iBACA,eACA,WACA,OACA,iBACA,kBACA,oBACA,oBACA,sBACA,qBACA,oBACA,oBAAoB,SACiC;CACrD,MAAM,WAAW,cAAc;AAC7B,SAAO,kBAAkB,SAAS,SAAS,SAAS,iBAAiB;IACpE;EAAC;EAAS;EAAS,SAAS;EAAiB,CAAC;CACjD,MAAM,EAAE,KAAK,mBAAmB,oBAAoB;EAClD;EACA;EACA;EACA;EACA;EACA;EACA,wBACE,uBAAuB,QAAQ,sBAAsB;EACvD,iBAAiB,sBAAsB;EACvC;EACD,CAAC;AAYF,QACE,oBAAC;EAAoB;EAAgB;EAAkB;YACpD,eAbY,mBAAmB;GAClC;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC,EAG4B,gBAAgB;GAC3B"}
|
package/dist/react/jsx.d.ts
CHANGED
package/dist/react/jsx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx.d.ts","names":["DIFFS_TAG_NAME","
|
|
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":";;;AACmD,eAAA,OAAA,CAAA;EAAA,UAAA,GAAA,CAAA;cAAA,iBAAA,CAAA;MAMtBE,CADtBF,cAAAA,CACsBE,EADLC,KAAAA,CAAME,iBACDH,CAArBC,KAAAA,CAAMC,cAAAA,CAAeF,WAAfE,CAAAA,EACNF,WAAAA,CAFgBC;IAAjBH;EAAc"}
|
package/dist/react/types.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "react";
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
import { DIFFS_TAG_NAME } from "../constants.js";
|
|
5
5
|
import { getLineAnnotationName } from "../utils/getLineAnnotationName.js";
|
|
6
6
|
import { useEffect, useRef } from "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
8
|
import { hydrateRoot } from "react-dom/client";
|
|
8
9
|
import { renderToString } from "react-dom/server";
|
|
9
|
-
import { jsx } from "react/jsx-runtime";
|
|
10
10
|
|
|
11
11
|
//#region src/ssr/FileDiffReact.tsx
|
|
12
12
|
function escapeHtml(unsafe) {
|