@pierre/diffs 1.1.1 → 1.1.3

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.
Files changed (88) hide show
  1. package/dist/components/File.d.ts +7 -3
  2. package/dist/components/File.d.ts.map +1 -1
  3. package/dist/components/File.js +12 -3
  4. package/dist/components/File.js.map +1 -1
  5. package/dist/components/FileDiff.d.ts +4 -0
  6. package/dist/components/FileDiff.d.ts.map +1 -1
  7. package/dist/components/FileDiff.js +12 -3
  8. package/dist/components/FileDiff.js.map +1 -1
  9. package/dist/components/UnresolvedFile.d.ts +19 -9
  10. package/dist/components/UnresolvedFile.d.ts.map +1 -1
  11. package/dist/components/UnresolvedFile.js +160 -53
  12. package/dist/components/UnresolvedFile.js.map +1 -1
  13. package/dist/components/VirtulizerDevelopment.d.ts.map +1 -1
  14. package/dist/constants.d.ts +5 -1
  15. package/dist/constants.d.ts.map +1 -1
  16. package/dist/constants.js +5 -1
  17. package/dist/constants.js.map +1 -1
  18. package/dist/index.d.ts +8 -7
  19. package/dist/index.js +5 -4
  20. package/dist/react/UnresolvedFile.d.ts +9 -3
  21. package/dist/react/UnresolvedFile.d.ts.map +1 -1
  22. package/dist/react/UnresolvedFile.js.map +1 -1
  23. package/dist/react/index.d.ts +3 -3
  24. package/dist/react/utils/renderDiffChildren.d.ts +1 -1
  25. package/dist/react/utils/renderDiffChildren.d.ts.map +1 -1
  26. package/dist/react/utils/renderDiffChildren.js +6 -4
  27. package/dist/react/utils/renderDiffChildren.js.map +1 -1
  28. package/dist/react/utils/useUnresolvedFileInstance.d.ts +3 -2
  29. package/dist/react/utils/useUnresolvedFileInstance.d.ts.map +1 -1
  30. package/dist/react/utils/useUnresolvedFileInstance.js +15 -12
  31. package/dist/react/utils/useUnresolvedFileInstance.js.map +1 -1
  32. package/dist/renderers/DiffHunksRenderer.d.ts +15 -7
  33. package/dist/renderers/DiffHunksRenderer.d.ts.map +1 -1
  34. package/dist/renderers/DiffHunksRenderer.js +9 -7
  35. package/dist/renderers/DiffHunksRenderer.js.map +1 -1
  36. package/dist/renderers/UnresolvedFileHunksRenderer.d.ts +11 -16
  37. package/dist/renderers/UnresolvedFileHunksRenderer.d.ts.map +1 -1
  38. package/dist/renderers/UnresolvedFileHunksRenderer.js +68 -75
  39. package/dist/renderers/UnresolvedFileHunksRenderer.js.map +1 -1
  40. package/dist/ssr/index.d.ts +2 -2
  41. package/dist/ssr/preloadDiffs.d.ts +2 -2
  42. package/dist/ssr/preloadDiffs.d.ts.map +1 -1
  43. package/dist/ssr/preloadDiffs.js +4 -3
  44. package/dist/ssr/preloadDiffs.js.map +1 -1
  45. package/dist/style.js +1 -1
  46. package/dist/style.js.map +1 -1
  47. package/dist/types.d.ts +41 -1
  48. package/dist/types.d.ts.map +1 -1
  49. package/dist/utils/areMergeConflictActionsEqual.js +1 -1
  50. package/dist/utils/areMergeConflictActionsEqual.js.map +1 -1
  51. package/dist/utils/diffAcceptRejectHunk.d.ts +3 -2
  52. package/dist/utils/diffAcceptRejectHunk.d.ts.map +1 -1
  53. package/dist/utils/diffAcceptRejectHunk.js +24 -89
  54. package/dist/utils/diffAcceptRejectHunk.js.map +1 -1
  55. package/dist/utils/getMergeConflictActionSlotName.d.ts +4 -6
  56. package/dist/utils/getMergeConflictActionSlotName.d.ts.map +1 -1
  57. package/dist/utils/getMergeConflictActionSlotName.js +2 -2
  58. package/dist/utils/getMergeConflictActionSlotName.js.map +1 -1
  59. package/dist/utils/getMergeConflictLineTypes.d.ts +1 -2
  60. package/dist/utils/getMergeConflictLineTypes.d.ts.map +1 -1
  61. package/dist/utils/getMergeConflictLineTypes.js +7 -12
  62. package/dist/utils/getMergeConflictLineTypes.js.map +1 -1
  63. package/dist/utils/normalizeDiffResolution.d.ts +7 -0
  64. package/dist/utils/normalizeDiffResolution.d.ts.map +1 -0
  65. package/dist/utils/normalizeDiffResolution.js +11 -0
  66. package/dist/utils/normalizeDiffResolution.js.map +1 -0
  67. package/dist/utils/parseMergeConflictDiffFromFile.d.ts +16 -12
  68. package/dist/utils/parseMergeConflictDiffFromFile.d.ts.map +1 -1
  69. package/dist/utils/parseMergeConflictDiffFromFile.js +474 -117
  70. package/dist/utils/parseMergeConflictDiffFromFile.js.map +1 -1
  71. package/dist/utils/resolveConflict.d.ts +7 -0
  72. package/dist/utils/resolveConflict.d.ts.map +1 -0
  73. package/dist/utils/resolveConflict.js +23 -0
  74. package/dist/utils/resolveConflict.js.map +1 -0
  75. package/dist/utils/resolveRegion.d.ts +14 -0
  76. package/dist/utils/resolveRegion.d.ts.map +1 -0
  77. package/dist/utils/resolveRegion.js +215 -0
  78. package/dist/utils/resolveRegion.js.map +1 -0
  79. package/dist/utils/trimPatchContext.js +19 -20
  80. package/dist/utils/trimPatchContext.js.map +1 -1
  81. package/dist/worker/worker-portable.js +4 -0
  82. package/dist/worker/worker-portable.js.map +1 -1
  83. package/dist/worker/worker.js.map +1 -1
  84. package/package.json +2 -1
  85. package/dist/utils/resolveMergeConflict.d.ts +0 -7
  86. package/dist/utils/resolveMergeConflict.d.ts.map +0 -1
  87. package/dist/utils/resolveMergeConflict.js +0 -30
  88. package/dist/utils/resolveMergeConflict.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,18 +1,18 @@
1
- import { AnnotationLineMap, AnnotationSide, AnnotationSpan, BaseCodeOptions, BaseDiffOptions, BaseDiffOptionsWithDefaults, BundledLanguage, ChangeContent, ChangeTypes, CodeColumnType, CodeToHastOptions, ContextContent, CustomPreProperties, DecorationItem, DiffLineAnnotation, DiffLineEventBaseProps, DiffsHighlighter, DiffsThemeNames, ExpansionDirections, ExtensionFormatMap, FileContents, FileDiffMetadata, ForceDiffPlainTextOptions, ForceFilePlainTextOptions, GapSpan, HighlighterTypes, Hunk, HunkData, HunkExpansionRegion, HunkLineType, HunkSeparators, LanguageRegistration, LineAnnotation, LineDiffTypes, LineEventBaseProps, LineInfo, LineSpans, LineTypes, MergeConflictActionPayload, MergeConflictRegion, MergeConflictResolution, ObservedAnnotationNodes, ObservedGridNodes, ParsedPatch, PrePropertiesConfig, RenderDiffFilesResult, RenderDiffOptions, RenderDiffResult, RenderFileMetadata, RenderFileOptions, RenderFileResult, RenderHeaderMetadataCallback, RenderHeaderMetadataProps, RenderHeaderPrefixCallback, RenderRange, RenderWindow, RenderedDiffASTCache, RenderedFileASTCache, SelectionPoint, SelectionSide, SharedRenderState, ShikiTransformer, SupportedLanguages, ThemeRegistrationResolved, ThemeTypes, ThemedDiffResult, ThemedFileResult, ThemedToken, ThemesType, VirtualFileMetrics, VirtualWindowSpecs } from "./types.js";
1
+ import { AnnotationLineMap, AnnotationSide, AnnotationSpan, BaseCodeOptions, BaseDiffOptions, BaseDiffOptionsWithDefaults, BundledLanguage, ChangeContent, ChangeTypes, CodeColumnType, CodeToHastOptions, ConflictResolverTypes, ContextContent, CustomPreProperties, DecorationItem, DiffAcceptRejectHunkConfig, DiffAcceptRejectHunkType, DiffLineAnnotation, DiffLineEventBaseProps, DiffsHighlighter, DiffsThemeNames, ExpansionDirections, ExtensionFormatMap, FileContents, FileDiffMetadata, ForceDiffPlainTextOptions, ForceFilePlainTextOptions, GapSpan, HighlighterTypes, Hunk, HunkData, HunkExpansionRegion, HunkLineType, HunkSeparators, LanguageRegistration, LineAnnotation, LineDiffTypes, LineEventBaseProps, LineInfo, LineSpans, LineTypes, MergeConflictActionPayload, MergeConflictMarkerRow, MergeConflictMarkerRowType, MergeConflictRegion, MergeConflictResolution, ObservedAnnotationNodes, ObservedGridNodes, ParsedPatch, PrePropertiesConfig, ProcessFileConflictData, RenderDiffFilesResult, RenderDiffOptions, RenderDiffResult, RenderFileMetadata, RenderFileOptions, RenderFileResult, RenderHeaderMetadataCallback, RenderHeaderMetadataProps, RenderHeaderPrefixCallback, RenderRange, RenderWindow, RenderedDiffASTCache, RenderedFileASTCache, SelectionPoint, SelectionSide, SharedRenderState, ShikiTransformer, SupportedLanguages, ThemeRegistrationResolved, ThemeTypes, ThemedDiffResult, ThemedFileResult, ThemedToken, ThemesType, VirtualFileMetrics, VirtualWindowSpecs } from "./types.js";
2
2
  import { GetHoveredLineResult, GetLineIndexUtility, InteractionManager, InteractionManagerBaseOptions, InteractionManagerMode, InteractionManagerOptions, LogTypes, MergeConflictActionTarget, OnDiffLineClickProps, OnDiffLineEnterLeaveProps, OnLineClickProps, OnLineEnterLeaveProps, SelectedLineRange, pluckInteractionOptions } from "./managers/InteractionManager.js";
3
3
  import { ResizeManager } from "./managers/ResizeManager.js";
4
4
  import { FileRenderResult, FileRenderer, FileRendererOptions } from "./renderers/FileRenderer.js";
5
- import { File, FileHyrdateProps, FileOptions, FileRenderProps } from "./components/File.js";
5
+ import { File, FileHydrateProps, FileOptions, FileRenderProps } from "./components/File.js";
6
6
  import { CodeToTokenTransformStreamOptions, RecallToken, ShikiStreamTokenizerEnqueueResult, ShikiStreamTokenizerOptions } from "./shiki-stream/types.js";
7
7
  import { ShikiStreamTokenizer } from "./shiki-stream/tokenizer.js";
8
8
  import { CodeToTokenTransformStream } from "./shiki-stream/stream.js";
9
9
  import { FileStream, FileStreamOptions } from "./components/FileStream.js";
10
- import { DiffHunksRenderer, HunksRenderResult, InlineRow, LineDecoration, RenderedLineContext, SplitInlineRow, SplitLineDecorationProps, UnifiedLineDecorationProps } from "./renderers/DiffHunksRenderer.js";
11
- import { MergeConflictActionsTypeOption, RenderMergeConflictActions, UnresolvedFile, UnresolvedFileHydrationProps, UnresolvedFileOptions, UnresolvedFileRenderProps } from "./components/UnresolvedFile.js";
10
+ import { DiffHunksRenderer, HunksRenderResult, InjectedRow, LineDecoration, RenderedLineContext, SplitInjectedRow, SplitInjectedRowPlacement, SplitLineDecorationProps, UnifiedInjectedRowPlacement, UnifiedLineDecorationProps } from "./renderers/DiffHunksRenderer.js";
11
+ import { MergeConflictActionsTypeOption, RenderMergeConflictActions, UnresolvedFile, UnresolvedFileHydrationProps, UnresolvedFileOptions, UnresolvedFileRenderProps, getUnresolvedDiffHunksRendererOptions } from "./components/UnresolvedFile.js";
12
12
  import { Virtualizer, VirtualizerConfig } from "./components/Virtualizer.js";
13
13
  import { VirtualizedFile } from "./components/VirtualizedFile.js";
14
14
  import { VirtualizedFileDiff } from "./components/VirtualizedFileDiff.js";
15
- import { ALTERNATE_FILE_NAMES_GIT, COMMIT_METADATA_SPLIT, CORE_CSS_ATTRIBUTE, DEFAULT_COLLAPSED_CONTEXT_THRESHOLD, DEFAULT_EXPANDED_REGION, DEFAULT_RENDER_RANGE, DEFAULT_THEMES, DEFAULT_VIRTUAL_FILE_METRICS, DIFFS_TAG_NAME, EMPTY_RENDER_RANGE, FILENAME_HEADER_REGEX, FILENAME_HEADER_REGEX_GIT, FILE_CONTEXT_BLOB, GIT_DIFF_FILE_BREAK_REGEX, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID, HUNK_HEADER, INDEX_LINE_METADATA, SPLIT_WITH_NEWLINES, UNIFIED_DIFF_FILE_BREAK_REGEX, UNSAFE_CSS_ATTRIBUTE } from "./constants.js";
15
+ import { ALTERNATE_FILE_NAMES_GIT, COMMIT_METADATA_SPLIT, CORE_CSS_ATTRIBUTE, DEFAULT_COLLAPSED_CONTEXT_THRESHOLD, DEFAULT_EXPANDED_REGION, DEFAULT_RENDER_RANGE, DEFAULT_THEMES, DEFAULT_VIRTUAL_FILE_METRICS, DIFFS_TAG_NAME, EMPTY_RENDER_RANGE, FILENAME_HEADER_REGEX, FILENAME_HEADER_REGEX_GIT, FILE_CONTEXT_BLOB, GIT_DIFF_FILE_BREAK_REGEX, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID, HUNK_HEADER, INDEX_LINE_METADATA, MERGE_CONFLICT_BASE_MARKER_REGEX, MERGE_CONFLICT_END_MARKER_REGEX, MERGE_CONFLICT_SEPARATOR_MARKER_REGEX, MERGE_CONFLICT_START_MARKER_REGEX, SPLIT_WITH_NEWLINES, UNIFIED_DIFF_FILE_BREAK_REGEX, UNSAFE_CSS_ATTRIBUTE } from "./constants.js";
16
16
  import { areLanguagesAttached } from "./highlighter/languages/areLanguagesAttached.js";
17
17
  import { attachResolvedLanguages } from "./highlighter/languages/attachResolvedLanguages.js";
18
18
  import { cleanUpResolvedLanguages } from "./highlighter/languages/cleanUpResolvedLanguages.js";
@@ -92,10 +92,11 @@ import { prerenderHTMLIfNecessary } from "./utils/prerenderHTMLIfNecessary.js";
92
92
  import { processLine } from "./utils/processLine.js";
93
93
  import { renderDiffWithHighlighter } from "./utils/renderDiffWithHighlighter.js";
94
94
  import { renderFileWithHighlighter } from "./utils/renderFileWithHighlighter.js";
95
- import { resolveMergeConflict } from "./utils/resolveMergeConflict.js";
95
+ import { resolveConflict } from "./utils/resolveConflict.js";
96
+ import { resolveRegion } from "./utils/resolveRegion.js";
96
97
  import { setLanguageOverride } from "./utils/setLanguageOverride.js";
97
98
  import { setPreNodeProperties } from "./utils/setWrapperNodeProps.js";
98
99
  import { trimPatchContext } from "./utils/trimPatchContext.js";
99
100
  import { FileDiff, FileDiffHydrationProps, FileDiffOptions, FileDiffRenderProps } from "./components/FileDiff.js";
100
101
  import { codeToHtml, createCssVariablesTheme as createCSSVariablesTheme } from "shiki";
101
- export { ALTERNATE_FILE_NAMES_GIT, AnnotationLineMap, AnnotationSide, AnnotationSpan, AttachedLanguages, AttachedThemes, BaseCodeOptions, BaseDiffOptions, BaseDiffOptionsWithDefaults, BundledLanguage, COMMIT_METADATA_SPLIT, CORE_CSS_ATTRIBUTE, CUSTOM_EXTENSION_TO_FILE_FORMAT, ChangeContent, ChangeTypes, CodeColumnType, CodeToHastOptions, CodeToTokenTransformStream, CodeToTokenTransformStreamOptions, ContextContent, CreateFileHeaderElementProps, CustomPreProperties, DEFAULT_COLLAPSED_CONTEXT_THRESHOLD, DEFAULT_EXPANDED_REGION, DEFAULT_RENDER_RANGE, DEFAULT_THEMES, DEFAULT_VIRTUAL_FILE_METRICS, DIFFS_TAG_NAME, DecorationItem, DiffHunksRenderer, DiffLineAnnotation, DiffLineEventBaseProps, DiffsHighlighter, DiffsThemeNames, EMPTY_RENDER_RANGE, EXTENSION_TO_FILE_FORMAT, ExpansionDirections, ExtensionFormatMap, FILENAME_HEADER_REGEX, FILENAME_HEADER_REGEX_GIT, FILE_CONTEXT_BLOB, File, FileContents, FileDiff, FileDiffHydrationProps, FileDiffMetadata, FileDiffOptions, FileDiffRenderProps, FileHyrdateProps, FileOptions, FileRenderProps, FileRenderResult, FileRenderer, FileRendererOptions, FileStream, FileStreamOptions, ForceDiffPlainTextOptions, ForceFilePlainTextOptions, GIT_DIFF_FILE_BREAK_REGEX, GapSpan, GetHoveredLineResult, GetLineIndexUtility, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID, HUNK_HEADER, HighlighterTypes, Hunk, HunkData, HunkExpansionRegion, HunkLineType, HunkSeparators, HunksRenderResult, INDEX_LINE_METADATA, InlineRow, InteractionManager, InteractionManagerBaseOptions, InteractionManagerMode, InteractionManagerOptions, LanguageRegistration, LineAnnotation, LineDecoration, LineDiffTypes, LineEventBaseProps, LineInfo, LineSpans, LineTypes, LogTypes, MergeConflictActionPayload, MergeConflictActionTarget, MergeConflictActionsTypeOption, MergeConflictRegion, MergeConflictResolution, ObservedAnnotationNodes, ObservedGridNodes, OnDiffLineClickProps, OnDiffLineEnterLeaveProps, OnLineClickProps, OnLineEnterLeaveProps, ParsedLine, ParsedPatch, PrePropertiesConfig, RecallToken, RegisteredCustomLanguages, RegisteredCustomThemes, RenderDiffFilesResult, RenderDiffOptions, RenderDiffResult, RenderFileMetadata, RenderFileOptions, RenderFileResult, RenderHeaderMetadataCallback, RenderHeaderMetadataProps, RenderHeaderPrefixCallback, RenderMergeConflictActions, RenderRange, RenderWindow, RenderedDiffASTCache, RenderedFileASTCache, RenderedLineContext, ResizeManager, ResolvedLanguages, ResolvedThemes, ResolvingLanguages, ResolvingThemes, SPLIT_WITH_NEWLINES, SVGSpriteNames, SVGSpriteSheet, ScrollSyncManager, SelectedLineRange, SelectionPoint, SelectionSide, SharedRenderState, ShikiStreamTokenizer, ShikiStreamTokenizerEnqueueResult, ShikiStreamTokenizerOptions, ShikiTransformer, SplitInlineRow, SplitLineDecorationProps, SupportedLanguages, ThemeRegistrationResolved, ThemeTypes, ThemedDiffResult, ThemedFileResult, ThemedToken, ThemesType, UNIFIED_DIFF_FILE_BREAK_REGEX, UNSAFE_CSS_ATTRIBUTE, UnifiedLineDecorationProps, UnresolvedFile, UnresolvedFileHydrationProps, UnresolvedFileOptions, UnresolvedFileRenderProps, VirtualFileMetrics, VirtualWindowSpecs, VirtualizedFile, VirtualizedFileDiff, Virtualizer, VirtualizerConfig, areDiffLineAnnotationsEqual, areFilesEqual, areHunkDataEqual, areLanguagesAttached, areLineAnnotationsEqual, areObjectsEqual, areOptionsEqual, arePrePropertiesEqual, areRenderRangesEqual, areSelectionsEqual, areThemesAttached, areThemesEqual, areVirtualWindowSpecsEqual, areWorkerStatsEqual, attachResolvedLanguages, attachResolvedThemes, cleanLastNewline, cleanUpResolvedLanguages, cleanUpResolvedThemes, codeToHtml, createAnnotationElement, createAnnotationWrapperNode, createCSSVariablesTheme, createDiffSpanDecoration, createEmptyRowBuffer, createFileHeaderElement, createGutterGap, createGutterItem, createGutterUtilityContentNode, createGutterUtilityElement, createGutterWrapper, createHastElement, createIconElement, createNoNewlineElement, createPreElement, createPreWrapperProperties, createRowNodes, createSeparator, createSpanFromToken, createStyleElement, createTextNodeElement, createTransformerWithState, createUnsafeCSSStyleNode, createWindowFromScrollPosition, diffAcceptRejectHunk, disposeHighlighter, extendFileFormatMap, findCodeElement, formatCSSVariablePrefix, getFiletypeFromFileName, getHighlighterIfLoaded, getHighlighterOptions, getHighlighterThemeStyles, getHunkSeparatorSlotName, getIconForType, getLineAnnotationName, getLineEndingType, getLineNodes, getOrCreateCodeNode, getResolvedLanguages, getResolvedOrResolveLanguage, getResolvedOrResolveTheme, getResolvedThemes, getSharedHighlighter, getSingularPatch, getThemes, getTotalLineCountFromHunks, hasResolvedLanguages, hasResolvedThemes, isDefaultRenderRange, isHighlighterLoaded, isHighlighterLoading, isHighlighterNull, isWorkerContext, parseDiffFromFile, parseLineType, parsePatchFiles, pluckInteractionOptions, preloadHighlighter, prerenderHTMLIfNecessary, processFile, processLine, processPatch, pushOrJoinSpan, queueRender, registerCustomCSSVariableTheme, registerCustomLanguage, registerCustomTheme, renderDiffWithHighlighter, renderFileWithHighlighter, resolveLanguage, resolveLanguages, resolveMergeConflict, resolveTheme, resolveThemes, setLanguageOverride, setPreNodeProperties, trimPatchContext, wrapCoreCSS, wrapUnsafeCSS };
102
+ export { ALTERNATE_FILE_NAMES_GIT, AnnotationLineMap, AnnotationSide, AnnotationSpan, AttachedLanguages, AttachedThemes, BaseCodeOptions, BaseDiffOptions, BaseDiffOptionsWithDefaults, BundledLanguage, COMMIT_METADATA_SPLIT, CORE_CSS_ATTRIBUTE, CUSTOM_EXTENSION_TO_FILE_FORMAT, ChangeContent, ChangeTypes, CodeColumnType, CodeToHastOptions, CodeToTokenTransformStream, CodeToTokenTransformStreamOptions, ConflictResolverTypes, ContextContent, CreateFileHeaderElementProps, CustomPreProperties, DEFAULT_COLLAPSED_CONTEXT_THRESHOLD, DEFAULT_EXPANDED_REGION, DEFAULT_RENDER_RANGE, DEFAULT_THEMES, DEFAULT_VIRTUAL_FILE_METRICS, DIFFS_TAG_NAME, DecorationItem, DiffAcceptRejectHunkConfig, DiffAcceptRejectHunkType, DiffHunksRenderer, DiffLineAnnotation, DiffLineEventBaseProps, DiffsHighlighter, DiffsThemeNames, EMPTY_RENDER_RANGE, EXTENSION_TO_FILE_FORMAT, ExpansionDirections, ExtensionFormatMap, FILENAME_HEADER_REGEX, FILENAME_HEADER_REGEX_GIT, FILE_CONTEXT_BLOB, File, FileContents, FileDiff, FileDiffHydrationProps, FileDiffMetadata, FileDiffOptions, FileDiffRenderProps, FileHydrateProps, FileOptions, FileRenderProps, FileRenderResult, FileRenderer, FileRendererOptions, FileStream, FileStreamOptions, ForceDiffPlainTextOptions, ForceFilePlainTextOptions, GIT_DIFF_FILE_BREAK_REGEX, GapSpan, GetHoveredLineResult, GetLineIndexUtility, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID, HUNK_HEADER, HighlighterTypes, Hunk, HunkData, HunkExpansionRegion, HunkLineType, HunkSeparators, HunksRenderResult, INDEX_LINE_METADATA, InjectedRow, InteractionManager, InteractionManagerBaseOptions, InteractionManagerMode, InteractionManagerOptions, LanguageRegistration, LineAnnotation, LineDecoration, LineDiffTypes, LineEventBaseProps, LineInfo, LineSpans, LineTypes, LogTypes, MERGE_CONFLICT_BASE_MARKER_REGEX, MERGE_CONFLICT_END_MARKER_REGEX, MERGE_CONFLICT_SEPARATOR_MARKER_REGEX, MERGE_CONFLICT_START_MARKER_REGEX, MergeConflictActionPayload, MergeConflictActionTarget, MergeConflictActionsTypeOption, MergeConflictMarkerRow, MergeConflictMarkerRowType, MergeConflictRegion, MergeConflictResolution, ObservedAnnotationNodes, ObservedGridNodes, OnDiffLineClickProps, OnDiffLineEnterLeaveProps, OnLineClickProps, OnLineEnterLeaveProps, ParsedLine, ParsedPatch, PrePropertiesConfig, ProcessFileConflictData, RecallToken, RegisteredCustomLanguages, RegisteredCustomThemes, RenderDiffFilesResult, RenderDiffOptions, RenderDiffResult, RenderFileMetadata, RenderFileOptions, RenderFileResult, RenderHeaderMetadataCallback, RenderHeaderMetadataProps, RenderHeaderPrefixCallback, RenderMergeConflictActions, RenderRange, RenderWindow, RenderedDiffASTCache, RenderedFileASTCache, RenderedLineContext, ResizeManager, ResolvedLanguages, ResolvedThemes, ResolvingLanguages, ResolvingThemes, SPLIT_WITH_NEWLINES, SVGSpriteNames, SVGSpriteSheet, ScrollSyncManager, SelectedLineRange, SelectionPoint, SelectionSide, SharedRenderState, ShikiStreamTokenizer, ShikiStreamTokenizerEnqueueResult, ShikiStreamTokenizerOptions, ShikiTransformer, SplitInjectedRow, SplitInjectedRowPlacement, SplitLineDecorationProps, SupportedLanguages, ThemeRegistrationResolved, ThemeTypes, ThemedDiffResult, ThemedFileResult, ThemedToken, ThemesType, UNIFIED_DIFF_FILE_BREAK_REGEX, UNSAFE_CSS_ATTRIBUTE, UnifiedInjectedRowPlacement, UnifiedLineDecorationProps, UnresolvedFile, UnresolvedFileHydrationProps, UnresolvedFileOptions, UnresolvedFileRenderProps, VirtualFileMetrics, VirtualWindowSpecs, VirtualizedFile, VirtualizedFileDiff, Virtualizer, VirtualizerConfig, areDiffLineAnnotationsEqual, areFilesEqual, areHunkDataEqual, areLanguagesAttached, areLineAnnotationsEqual, areObjectsEqual, areOptionsEqual, arePrePropertiesEqual, areRenderRangesEqual, areSelectionsEqual, areThemesAttached, areThemesEqual, areVirtualWindowSpecsEqual, areWorkerStatsEqual, attachResolvedLanguages, attachResolvedThemes, cleanLastNewline, cleanUpResolvedLanguages, cleanUpResolvedThemes, codeToHtml, createAnnotationElement, createAnnotationWrapperNode, createCSSVariablesTheme, createDiffSpanDecoration, createEmptyRowBuffer, createFileHeaderElement, createGutterGap, createGutterItem, createGutterUtilityContentNode, createGutterUtilityElement, createGutterWrapper, createHastElement, createIconElement, createNoNewlineElement, createPreElement, createPreWrapperProperties, createRowNodes, createSeparator, createSpanFromToken, createStyleElement, createTextNodeElement, createTransformerWithState, createUnsafeCSSStyleNode, createWindowFromScrollPosition, diffAcceptRejectHunk, disposeHighlighter, extendFileFormatMap, findCodeElement, formatCSSVariablePrefix, getFiletypeFromFileName, getHighlighterIfLoaded, getHighlighterOptions, getHighlighterThemeStyles, getHunkSeparatorSlotName, getIconForType, getLineAnnotationName, getLineEndingType, getLineNodes, getOrCreateCodeNode, getResolvedLanguages, getResolvedOrResolveLanguage, getResolvedOrResolveTheme, getResolvedThemes, getSharedHighlighter, getSingularPatch, getThemes, getTotalLineCountFromHunks, getUnresolvedDiffHunksRendererOptions, hasResolvedLanguages, hasResolvedThemes, isDefaultRenderRange, isHighlighterLoaded, isHighlighterLoading, isHighlighterNull, isWorkerContext, parseDiffFromFile, parseLineType, parsePatchFiles, pluckInteractionOptions, preloadHighlighter, prerenderHTMLIfNecessary, processFile, processLine, processPatch, pushOrJoinSpan, queueRender, registerCustomCSSVariableTheme, registerCustomLanguage, registerCustomTheme, renderDiffWithHighlighter, renderFileWithHighlighter, resolveConflict, resolveLanguage, resolveLanguages, resolveRegion, resolveTheme, resolveThemes, setLanguageOverride, setPreNodeProperties, trimPatchContext, wrapCoreCSS, wrapUnsafeCSS };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ALTERNATE_FILE_NAMES_GIT, COMMIT_METADATA_SPLIT, CORE_CSS_ATTRIBUTE, DEFAULT_COLLAPSED_CONTEXT_THRESHOLD, DEFAULT_EXPANDED_REGION, DEFAULT_RENDER_RANGE, DEFAULT_THEMES, DEFAULT_VIRTUAL_FILE_METRICS, DIFFS_TAG_NAME, EMPTY_RENDER_RANGE, FILENAME_HEADER_REGEX, FILENAME_HEADER_REGEX_GIT, FILE_CONTEXT_BLOB, GIT_DIFF_FILE_BREAK_REGEX, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID, HUNK_HEADER, INDEX_LINE_METADATA, SPLIT_WITH_NEWLINES, UNIFIED_DIFF_FILE_BREAK_REGEX, UNSAFE_CSS_ATTRIBUTE } from "./constants.js";
1
+ import { ALTERNATE_FILE_NAMES_GIT, COMMIT_METADATA_SPLIT, CORE_CSS_ATTRIBUTE, DEFAULT_COLLAPSED_CONTEXT_THRESHOLD, DEFAULT_EXPANDED_REGION, DEFAULT_RENDER_RANGE, DEFAULT_THEMES, DEFAULT_VIRTUAL_FILE_METRICS, DIFFS_TAG_NAME, EMPTY_RENDER_RANGE, FILENAME_HEADER_REGEX, FILENAME_HEADER_REGEX_GIT, FILE_CONTEXT_BLOB, GIT_DIFF_FILE_BREAK_REGEX, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID, HUNK_HEADER, INDEX_LINE_METADATA, MERGE_CONFLICT_BASE_MARKER_REGEX, MERGE_CONFLICT_END_MARKER_REGEX, MERGE_CONFLICT_SEPARATOR_MARKER_REGEX, MERGE_CONFLICT_START_MARKER_REGEX, SPLIT_WITH_NEWLINES, UNIFIED_DIFF_FILE_BREAK_REGEX, UNSAFE_CSS_ATTRIBUTE } from "./constants.js";
2
2
  import { areSelectionsEqual } from "./utils/areSelectionsEqual.js";
3
3
  import { createGutterGap, createGutterItem, createGutterWrapper, createHastElement, createIconElement, createTextNodeElement, findCodeElement } from "./utils/hast_utils.js";
4
4
  import { createGutterUtilityElement } from "./utils/createGutterUtilityElement.js";
@@ -71,8 +71,9 @@ import { ShikiStreamTokenizer } from "./shiki-stream/tokenizer.js";
71
71
  import { CodeToTokenTransformStream } from "./shiki-stream/stream.js";
72
72
  import { createSpanFromToken } from "./utils/createSpanNodeFromToken.js";
73
73
  import { FileStream } from "./components/FileStream.js";
74
- import { resolveMergeConflict } from "./utils/resolveMergeConflict.js";
75
- import { UnresolvedFile } from "./components/UnresolvedFile.js";
74
+ import { resolveRegion } from "./utils/resolveRegion.js";
75
+ import { resolveConflict } from "./utils/resolveConflict.js";
76
+ import { UnresolvedFile, getUnresolvedDiffHunksRendererOptions } from "./components/UnresolvedFile.js";
76
77
  import { VirtualizedFile } from "./components/VirtualizedFile.js";
77
78
  import { VirtualizedFileDiff } from "./components/VirtualizedFileDiff.js";
78
79
  import { areVirtualWindowSpecsEqual } from "./utils/areVirtualWindowSpecsEqual.js";
@@ -97,4 +98,4 @@ import { setLanguageOverride } from "./utils/setLanguageOverride.js";
97
98
  import { trimPatchContext } from "./utils/trimPatchContext.js";
98
99
  import { codeToHtml, createCssVariablesTheme as createCSSVariablesTheme } from "shiki";
99
100
 
100
- export { ALTERNATE_FILE_NAMES_GIT, AttachedLanguages, AttachedThemes, COMMIT_METADATA_SPLIT, CORE_CSS_ATTRIBUTE, CUSTOM_EXTENSION_TO_FILE_FORMAT, CodeToTokenTransformStream, DEFAULT_COLLAPSED_CONTEXT_THRESHOLD, DEFAULT_EXPANDED_REGION, DEFAULT_RENDER_RANGE, DEFAULT_THEMES, DEFAULT_VIRTUAL_FILE_METRICS, DIFFS_TAG_NAME, DiffHunksRenderer, EMPTY_RENDER_RANGE, EXTENSION_TO_FILE_FORMAT, FILENAME_HEADER_REGEX, FILENAME_HEADER_REGEX_GIT, FILE_CONTEXT_BLOB, File, FileDiff, FileRenderer, FileStream, GIT_DIFF_FILE_BREAK_REGEX, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID, HUNK_HEADER, INDEX_LINE_METADATA, InteractionManager, RegisteredCustomLanguages, RegisteredCustomThemes, ResizeManager, ResolvedLanguages, ResolvedThemes, ResolvingLanguages, ResolvingThemes, SPLIT_WITH_NEWLINES, SVGSpriteSheet, ScrollSyncManager, ShikiStreamTokenizer, UNIFIED_DIFF_FILE_BREAK_REGEX, UNSAFE_CSS_ATTRIBUTE, UnresolvedFile, VirtualizedFile, VirtualizedFileDiff, Virtualizer, areDiffLineAnnotationsEqual, areFilesEqual, areHunkDataEqual, areLanguagesAttached, areLineAnnotationsEqual, areObjectsEqual, areOptionsEqual, arePrePropertiesEqual, areRenderRangesEqual, areSelectionsEqual, areThemesAttached, areThemesEqual, areVirtualWindowSpecsEqual, areWorkerStatsEqual, attachResolvedLanguages, attachResolvedThemes, cleanLastNewline, cleanUpResolvedLanguages, cleanUpResolvedThemes, codeToHtml, createAnnotationElement, createAnnotationWrapperNode, createCSSVariablesTheme, createDiffSpanDecoration, createEmptyRowBuffer, createFileHeaderElement, createGutterGap, createGutterItem, createGutterUtilityContentNode, createGutterUtilityElement, createGutterWrapper, createHastElement, createIconElement, createNoNewlineElement, createPreElement, createPreWrapperProperties, createRowNodes, createSeparator, createSpanFromToken, createStyleElement, createTextNodeElement, createTransformerWithState, createUnsafeCSSStyleNode, createWindowFromScrollPosition, diffAcceptRejectHunk, disposeHighlighter, extendFileFormatMap, findCodeElement, formatCSSVariablePrefix, getFiletypeFromFileName, getHighlighterIfLoaded, getHighlighterOptions, getHighlighterThemeStyles, getHunkSeparatorSlotName, getIconForType, getLineAnnotationName, getLineEndingType, getLineNodes, getOrCreateCodeNode, getResolvedLanguages, getResolvedOrResolveLanguage, getResolvedOrResolveTheme, getResolvedThemes, getSharedHighlighter, getSingularPatch, getThemes, getTotalLineCountFromHunks, hasResolvedLanguages, hasResolvedThemes, isDefaultRenderRange, isHighlighterLoaded, isHighlighterLoading, isHighlighterNull, isWorkerContext, parseDiffFromFile, parseLineType, parsePatchFiles, pluckInteractionOptions, preloadHighlighter, prerenderHTMLIfNecessary, processFile, processLine, processPatch, pushOrJoinSpan, queueRender, registerCustomCSSVariableTheme, registerCustomLanguage, registerCustomTheme, renderDiffWithHighlighter, renderFileWithHighlighter, resolveLanguage, resolveLanguages, resolveMergeConflict, resolveTheme, resolveThemes, setLanguageOverride, setPreNodeProperties, trimPatchContext, wrapCoreCSS, wrapUnsafeCSS };
101
+ export { ALTERNATE_FILE_NAMES_GIT, AttachedLanguages, AttachedThemes, COMMIT_METADATA_SPLIT, CORE_CSS_ATTRIBUTE, CUSTOM_EXTENSION_TO_FILE_FORMAT, CodeToTokenTransformStream, DEFAULT_COLLAPSED_CONTEXT_THRESHOLD, DEFAULT_EXPANDED_REGION, DEFAULT_RENDER_RANGE, DEFAULT_THEMES, DEFAULT_VIRTUAL_FILE_METRICS, DIFFS_TAG_NAME, DiffHunksRenderer, EMPTY_RENDER_RANGE, EXTENSION_TO_FILE_FORMAT, FILENAME_HEADER_REGEX, FILENAME_HEADER_REGEX_GIT, FILE_CONTEXT_BLOB, File, FileDiff, FileRenderer, FileStream, GIT_DIFF_FILE_BREAK_REGEX, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID, HUNK_HEADER, INDEX_LINE_METADATA, InteractionManager, MERGE_CONFLICT_BASE_MARKER_REGEX, MERGE_CONFLICT_END_MARKER_REGEX, MERGE_CONFLICT_SEPARATOR_MARKER_REGEX, MERGE_CONFLICT_START_MARKER_REGEX, RegisteredCustomLanguages, RegisteredCustomThemes, ResizeManager, ResolvedLanguages, ResolvedThemes, ResolvingLanguages, ResolvingThemes, SPLIT_WITH_NEWLINES, SVGSpriteSheet, ScrollSyncManager, ShikiStreamTokenizer, UNIFIED_DIFF_FILE_BREAK_REGEX, UNSAFE_CSS_ATTRIBUTE, UnresolvedFile, VirtualizedFile, VirtualizedFileDiff, Virtualizer, areDiffLineAnnotationsEqual, areFilesEqual, areHunkDataEqual, areLanguagesAttached, areLineAnnotationsEqual, areObjectsEqual, areOptionsEqual, arePrePropertiesEqual, areRenderRangesEqual, areSelectionsEqual, areThemesAttached, areThemesEqual, areVirtualWindowSpecsEqual, areWorkerStatsEqual, attachResolvedLanguages, attachResolvedThemes, cleanLastNewline, cleanUpResolvedLanguages, cleanUpResolvedThemes, codeToHtml, createAnnotationElement, createAnnotationWrapperNode, createCSSVariablesTheme, createDiffSpanDecoration, createEmptyRowBuffer, createFileHeaderElement, createGutterGap, createGutterItem, createGutterUtilityContentNode, createGutterUtilityElement, createGutterWrapper, createHastElement, createIconElement, createNoNewlineElement, createPreElement, createPreWrapperProperties, createRowNodes, createSeparator, createSpanFromToken, createStyleElement, createTextNodeElement, createTransformerWithState, createUnsafeCSSStyleNode, createWindowFromScrollPosition, diffAcceptRejectHunk, disposeHighlighter, extendFileFormatMap, findCodeElement, formatCSSVariablePrefix, getFiletypeFromFileName, getHighlighterIfLoaded, getHighlighterOptions, getHighlighterThemeStyles, getHunkSeparatorSlotName, getIconForType, getLineAnnotationName, getLineEndingType, getLineNodes, getOrCreateCodeNode, getResolvedLanguages, getResolvedOrResolveLanguage, getResolvedOrResolveTheme, getResolvedThemes, getSharedHighlighter, getSingularPatch, getThemes, getTotalLineCountFromHunks, getUnresolvedDiffHunksRendererOptions, hasResolvedLanguages, hasResolvedThemes, isDefaultRenderRange, isHighlighterLoaded, isHighlighterLoading, isHighlighterNull, isWorkerContext, parseDiffFromFile, parseLineType, parsePatchFiles, pluckInteractionOptions, preloadHighlighter, prerenderHTMLIfNecessary, processFile, processLine, processPatch, pushOrJoinSpan, queueRender, registerCustomCSSVariableTheme, registerCustomLanguage, registerCustomTheme, renderDiffWithHighlighter, renderFileWithHighlighter, resolveConflict, resolveLanguage, resolveLanguages, resolveRegion, resolveTheme, resolveThemes, setLanguageOverride, setPreNodeProperties, trimPatchContext, wrapCoreCSS, wrapUnsafeCSS };
@@ -1,8 +1,9 @@
1
- import { FileContents, MergeConflictResolution } from "../types.js";
1
+ import { FileContents, HunkSeparators, MergeConflictResolution } from "../types.js";
2
2
  import { MergeConflictDiffAction } from "../utils/parseMergeConflictDiffFromFile.js";
3
3
  import { UnresolvedFileHunksRendererOptions } from "../renderers/UnresolvedFileHunksRenderer.js";
4
4
  import { UnresolvedFile as UnresolvedFile$1 } from "../components/UnresolvedFile.js";
5
5
  import { FileDiffProps } from "./FileDiff.js";
6
+ import { FileDiffOptions } from "../components/FileDiff.js";
6
7
  import { ReactNode } from "react";
7
8
 
8
9
  //#region src/react/UnresolvedFile.d.ts
@@ -11,9 +12,14 @@ interface RenderMergeConflictActionContext {
11
12
  }
12
13
  type RenderMergeConflictActions = (action: MergeConflictDiffAction, context: RenderMergeConflictActionContext) => ReactNode;
13
14
  type MergeConflictActionsTypeOption = 'none' | 'default' | RenderMergeConflictActions;
15
+ interface UnresolvedFileReactOptions<LAnnotation> extends Omit<FileDiffOptions<LAnnotation>, 'hunkSeparators' | 'diffStyle' | 'onMergeConflictAction' | 'onPostRender'>, UnresolvedFileHunksRendererOptions {
16
+ hunkSeparators?: HunkSeparators;
17
+ onPostRender?(node: HTMLElement, instance: UnresolvedFile$1<LAnnotation>): unknown;
18
+ maxContextLines?: number;
19
+ }
14
20
  interface UnresolvedFileProps<LAnnotation> extends Omit<FileDiffProps<LAnnotation>, 'fileDiff' | 'options'> {
15
21
  file: FileContents;
16
- options?: Omit<UnresolvedFileHunksRendererOptions, 'onMergeConflictAction'>;
22
+ options?: UnresolvedFileReactOptions<LAnnotation>;
17
23
  renderMergeConflictUtility?(action: MergeConflictDiffAction, getInstance: () => UnresolvedFile$1<LAnnotation> | undefined): ReactNode;
18
24
  }
19
25
  declare function UnresolvedFile<LAnnotation = undefined>({
@@ -32,5 +38,5 @@ declare function UnresolvedFile<LAnnotation = undefined>({
32
38
  renderMergeConflictUtility
33
39
  }: UnresolvedFileProps<LAnnotation>): React.JSX.Element;
34
40
  //#endregion
35
- export { MergeConflictActionsTypeOption, RenderMergeConflictActionContext, RenderMergeConflictActions, UnresolvedFile, UnresolvedFileProps };
41
+ export { MergeConflictActionsTypeOption, RenderMergeConflictActionContext, RenderMergeConflictActions, UnresolvedFile, UnresolvedFileProps, UnresolvedFileReactOptions };
36
42
  //# sourceMappingURL=UnresolvedFile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UnresolvedFile.d.ts","names":["ReactNode","UnresolvedFile","UnresolvedFileClass","UnresolvedFileHunksRendererOptions","FileContents","MergeConflictResolution","MergeConflictDiffAction","FileDiffProps","RenderMergeConflictActionContext","RenderMergeConflictActions","MergeConflictActionsTypeOption","UnresolvedFileProps","LAnnotation","Omit","file","options","lineAnnotations","selectedLines","className","style","prerenderedHTML","renderAnnotation","renderHeaderPrefix","renderHeaderMetadata","renderGutterUtility","renderHoverUtility","renderMergeConflictUtility","React","JSX","Element"],"sources":["../../src/react/UnresolvedFile.d.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { UnresolvedFile as UnresolvedFileClass } from '../components/UnresolvedFile';\nimport type { UnresolvedFileHunksRendererOptions } from '../renderers/UnresolvedFileHunksRenderer';\nimport type { FileContents, MergeConflictResolution } from '../types';\nimport { type MergeConflictDiffAction } from '../utils/parseMergeConflictDiffFromFile';\nimport type { FileDiffProps } from './FileDiff';\nexport interface RenderMergeConflictActionContext {\n resolveConflict(resolution: MergeConflictResolution): void;\n}\nexport type RenderMergeConflictActions = (action: MergeConflictDiffAction, context: RenderMergeConflictActionContext) => ReactNode;\nexport type MergeConflictActionsTypeOption = 'none' | 'default' | RenderMergeConflictActions;\nexport interface UnresolvedFileProps<LAnnotation> extends Omit<FileDiffProps<LAnnotation>, 'fileDiff' | 'options'> {\n file: FileContents;\n options?: Omit<UnresolvedFileHunksRendererOptions, 'onMergeConflictAction'>;\n renderMergeConflictUtility?(action: MergeConflictDiffAction, getInstance: () => UnresolvedFileClass<LAnnotation> | undefined): ReactNode;\n}\nexport declare function UnresolvedFile<LAnnotation = undefined>({ file, options, lineAnnotations, selectedLines, className, style, prerenderedHTML, renderAnnotation, renderHeaderPrefix, renderHeaderMetadata, renderGutterUtility, renderHoverUtility, renderMergeConflictUtility }: UnresolvedFileProps<LAnnotation>): React.JSX.Element;\n//# sourceMappingURL=UnresolvedFile.d.ts.map"],"mappings":";;;;;;;;UAMiBQ,gCAAAA;8BACeH;AADhC;AAGYI,KAAAA,0BAAAA,GAA0B,CAAA,MAAA,EAAYH,uBAAZ,EAAA,OAAA,EAA8CE,gCAA9C,EAAA,GAAmFR,SAAnF;AAAYM,KACtCI,8BAAAA,GADsCJ,MAAAA,GAAAA,SAAAA,GACgBG,0BADhBH;AAAkCE,UAEnEG,mBAFmEH,CAAAA,WAAAA,CAAAA,SAE1BK,IAF0BL,CAErBD,aAFqBC,CAEPI,WAFOJ,CAAAA,EAAAA,UAAAA,GAAAA,SAAAA,CAAAA,CAAAA;EAAqCR,IAAAA,EAG/GI,YAH+GJ;EAAS,OAAA,CAAA,EAIpHa,IAJoH,CAI/GV,kCAJ+G,EAAA,uBAAA,CAAA;EACtHO,0BAAAA,EAAAA,MAA8B,EAIFJ,uBAJ0BG,EAAAA,WAAAA,EAA0B,GAAA,GAIRP,gBAJQ,CAIYU,WAJZ,CAAA,GAAA,SAAA,CAAA,EAIuCZ,SAJvC;AAC5F;AAA6EY,iBAKrDX,cALqDW,CAAAA,cAAAA,SAAAA,CAAAA,CAAAA;EAAAA,IAAAA;EAAAA,OAAAA;EAAAA,eAAAA;EAAAA,aAAAA;EAAAA,SAAAA;EAAAA,KAAAA;EAAAA,eAAAA;EAAAA,gBAAAA;EAAAA,kBAAAA;EAAAA,oBAAAA;EAAAA,mBAAAA;EAAAA,kBAAAA;EAAAA;AAAAA,CAAAA,EAK0MD,mBAL1MC,CAK8NA,WAL9NA,CAAAA,CAAAA,EAK6Oe,KAAAA,CAAMC,GAAAA,CAAIC,OALvPjB"}
1
+ {"version":3,"file":"UnresolvedFile.d.ts","names":["ReactNode","FileDiffOptions","UnresolvedFile","UnresolvedFileClass","UnresolvedFileHunksRendererOptions","FileContents","HunkSeparators","MergeConflictResolution","MergeConflictDiffAction","FileDiffProps","RenderMergeConflictActionContext","RenderMergeConflictActions","MergeConflictActionsTypeOption","UnresolvedFileReactOptions","LAnnotation","HTMLElement","Omit","UnresolvedFileProps","file","options","lineAnnotations","selectedLines","className","style","prerenderedHTML","renderAnnotation","renderHeaderPrefix","renderHeaderMetadata","renderGutterUtility","renderHoverUtility","renderMergeConflictUtility","React","JSX","Element"],"sources":["../../src/react/UnresolvedFile.d.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { FileDiffOptions } from '../components/FileDiff';\nimport type { UnresolvedFile as UnresolvedFileClass } from '../components/UnresolvedFile';\nimport type { UnresolvedFileHunksRendererOptions } from '../renderers/UnresolvedFileHunksRenderer';\nimport type { FileContents, HunkSeparators, MergeConflictResolution } from '../types';\nimport { type MergeConflictDiffAction } from '../utils/parseMergeConflictDiffFromFile';\nimport type { FileDiffProps } from './FileDiff';\nexport interface RenderMergeConflictActionContext {\n resolveConflict(resolution: MergeConflictResolution): void;\n}\nexport type RenderMergeConflictActions = (action: MergeConflictDiffAction, context: RenderMergeConflictActionContext) => ReactNode;\nexport type MergeConflictActionsTypeOption = 'none' | 'default' | RenderMergeConflictActions;\nexport interface UnresolvedFileReactOptions<LAnnotation> extends Omit<FileDiffOptions<LAnnotation>, 'hunkSeparators' | 'diffStyle' | 'onMergeConflictAction' | 'onPostRender'>, UnresolvedFileHunksRendererOptions {\n hunkSeparators?: HunkSeparators;\n onPostRender?(node: HTMLElement, instance: UnresolvedFileClass<LAnnotation>): unknown;\n maxContextLines?: number;\n}\nexport interface UnresolvedFileProps<LAnnotation> extends Omit<FileDiffProps<LAnnotation>, 'fileDiff' | 'options'> {\n file: FileContents;\n options?: UnresolvedFileReactOptions<LAnnotation>;\n renderMergeConflictUtility?(action: MergeConflictDiffAction, getInstance: () => UnresolvedFileClass<LAnnotation> | undefined): ReactNode;\n}\nexport declare function UnresolvedFile<LAnnotation = undefined>({ file, options, lineAnnotations, selectedLines, className, style, prerenderedHTML, renderAnnotation, renderHeaderPrefix, renderHeaderMetadata, renderGutterUtility, renderHoverUtility, renderMergeConflictUtility }: UnresolvedFileProps<LAnnotation>): React.JSX.Element;\n//# sourceMappingURL=UnresolvedFile.d.ts.map"],"mappings":";;;;;;;;;UAOiBU,gCAAAA;8BACeH;AADhC;AAGYI,KAAAA,0BAAAA,GAA0B,CAAA,MAAA,EAAYH,uBAAZ,EAAA,OAAA,EAA8CE,gCAA9C,EAAA,GAAmFV,SAAnF;AAAYQ,KACtCI,8BAAAA,GADsCJ,MAAAA,GAAAA,SAAAA,GACgBG,0BADhBH;AAAkCE,UAEnEG,0BAFmEH,CAAAA,WAAAA,CAAAA,SAEnBM,IAFmBN,CAEdT,eAFcS,CAEEI,WAFFJ,CAAAA,EAAAA,gBAAAA,GAAAA,WAAAA,GAAAA,uBAAAA,GAAAA,cAAAA,CAAAA,EAE4FN,kCAF5FM,CAAAA;EAAqCV,cAAAA,CAAAA,EAGpGM,cAHoGN;EAAS,YAAA,EAAA,IAAA,EAI1Ge,WAJ0G,EAAA,QAAA,EAInFZ,gBAJmF,CAI/DW,WAJ+D,CAAA,CAAA,EAAA,OAAA;EACtHF,eAAAA,CAAAA,EAAAA,MAAAA;AACZ;AAAsFE,UAKrEG,mBALqEH,CAAAA,WAAAA,CAAAA,SAK5BE,IAL4BF,CAKvBL,aALuBK,CAKTA,WALSA,CAAAA,EAAAA,UAAAA,GAAAA,SAAAA,CAAAA,CAAAA;EAAhBb,IAAAA,EAM5DI,YAN4DJ;EACjDK,OAAAA,CAAAA,EAMPO,0BANOP,CAMoBQ,WANpBR,CAAAA;EACGS,0BAAAA,EAAAA,MAAAA,EAMgBP,uBANhBO,EAAAA,WAAAA,EAAAA,GAAAA,GAM4DZ,gBAN5DY,CAMgFD,WANhFC,CAAAA,GAAAA,SAAAA,CAAAA,EAM2Gf,SAN3Ge;;AAAuBZ,iBAQvBD,cARuBC,CAAAA,cAAAA,SAAAA,CAAAA,CAAAA;EAAAA,IAAAA;EAAAA,OAAAA;EAAAA,eAAAA;EAAAA,aAAAA;EAAAA,SAAAA;EAAAA,KAAAA;EAAAA,eAAAA;EAAAA,gBAAAA;EAAAA,kBAAAA;EAAAA,oBAAAA;EAAAA,mBAAAA;EAAAA,kBAAAA;EAAAA;AAAAA,CAAAA,EAQwOc,mBARxOd,CAQ4PW,WAR5PX,CAAAA,CAAAA,EAQ2Q4B,KAAAA,CAAMC,GAAAA,CAAIC,OARrR9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"UnresolvedFile.js","names":[],"sources":["../../src/react/UnresolvedFile.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\n\nimport type { UnresolvedFile as UnresolvedFileClass } from '../components/UnresolvedFile';\nimport { DIFFS_TAG_NAME } from '../constants';\nimport type { UnresolvedFileHunksRendererOptions } from '../renderers/UnresolvedFileHunksRenderer';\nimport type { FileContents, MergeConflictResolution } from '../types';\nimport { type MergeConflictDiffAction } from '../utils/parseMergeConflictDiffFromFile';\nimport type { FileDiffProps } from './FileDiff';\nimport { renderDiffChildren } from './utils/renderDiffChildren';\nimport { templateRender } from './utils/templateRender';\nimport { useUnresolvedFileInstance } from './utils/useUnresolvedFileInstance';\n\nexport interface RenderMergeConflictActionContext {\n resolveConflict(resolution: MergeConflictResolution): void;\n}\n\nexport type RenderMergeConflictActions = (\n action: MergeConflictDiffAction,\n context: RenderMergeConflictActionContext\n) => ReactNode;\n\nexport type MergeConflictActionsTypeOption =\n | 'none'\n | 'default'\n | RenderMergeConflictActions;\n\nexport interface UnresolvedFileProps<LAnnotation> extends Omit<\n FileDiffProps<LAnnotation>,\n 'fileDiff' | 'options'\n> {\n file: FileContents;\n options?: Omit<UnresolvedFileHunksRendererOptions, 'onMergeConflictAction'>;\n renderMergeConflictUtility?(\n action: MergeConflictDiffAction,\n getInstance: () => UnresolvedFileClass<LAnnotation> | undefined\n ): ReactNode;\n}\n\nexport function UnresolvedFile<LAnnotation = undefined>({\n file,\n options,\n lineAnnotations,\n selectedLines,\n className,\n style,\n prerenderedHTML,\n renderAnnotation,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderGutterUtility,\n renderHoverUtility,\n renderMergeConflictUtility,\n}: UnresolvedFileProps<LAnnotation>): React.JSX.Element {\n const { ref, getHoveredLine, fileDiff, actions, getInstance } =\n useUnresolvedFileInstance({\n file,\n options,\n lineAnnotations,\n selectedLines,\n prerenderedHTML,\n hasConflictUtility: renderMergeConflictUtility != null,\n hasGutterRenderUtility:\n renderGutterUtility != null || renderHoverUtility != null,\n });\n const children = renderDiffChildren({\n fileDiff,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderAnnotation,\n renderGutterUtility,\n renderHoverUtility,\n lineAnnotations,\n getHoveredLine,\n actions,\n renderMergeConflictUtility,\n getInstance,\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":";;;;;;;;;;AAwCA,SAAgB,eAAwC,EACtD,MACA,SACA,iBACA,eACA,WACA,OACA,iBACA,kBACA,oBACA,sBACA,qBACA,oBACA,8BACsD;CACtD,MAAM,EAAE,KAAK,gBAAgB,UAAU,SAAS,gBAC9C,0BAA0B;EACxB;EACA;EACA;EACA;EACA;EACA,oBAAoB,8BAA8B;EAClD,wBACE,uBAAuB,QAAQ,sBAAsB;EACxD,CAAC;AAcJ,QACE,oBAAC;EAAoB;EAAgB;EAAkB;YACpD,eAfY,mBAAmB;GAClC;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC,EAG4B,gBAAgB;GAC3B"}
1
+ {"version":3,"file":"UnresolvedFile.js","names":[],"sources":["../../src/react/UnresolvedFile.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\n\nimport type { FileDiffOptions } from '../components/FileDiff';\nimport type { UnresolvedFile as UnresolvedFileClass } from '../components/UnresolvedFile';\nimport { DIFFS_TAG_NAME } from '../constants';\nimport type { UnresolvedFileHunksRendererOptions } from '../renderers/UnresolvedFileHunksRenderer';\nimport type {\n FileContents,\n HunkSeparators,\n MergeConflictResolution,\n} from '../types';\nimport { type MergeConflictDiffAction } from '../utils/parseMergeConflictDiffFromFile';\nimport type { FileDiffProps } from './FileDiff';\nimport { renderDiffChildren } from './utils/renderDiffChildren';\nimport { templateRender } from './utils/templateRender';\nimport { useUnresolvedFileInstance } from './utils/useUnresolvedFileInstance';\n\nexport interface RenderMergeConflictActionContext {\n resolveConflict(resolution: MergeConflictResolution): void;\n}\n\nexport type RenderMergeConflictActions = (\n action: MergeConflictDiffAction,\n context: RenderMergeConflictActionContext\n) => ReactNode;\n\nexport type MergeConflictActionsTypeOption =\n | 'none'\n | 'default'\n | RenderMergeConflictActions;\n\nexport interface UnresolvedFileReactOptions<LAnnotation>\n extends\n Omit<\n FileDiffOptions<LAnnotation>,\n 'hunkSeparators' | 'diffStyle' | 'onMergeConflictAction' | 'onPostRender'\n >,\n UnresolvedFileHunksRendererOptions {\n hunkSeparators?: HunkSeparators;\n onPostRender?(\n node: HTMLElement,\n instance: UnresolvedFileClass<LAnnotation>\n ): unknown;\n maxContextLines?: number;\n}\n\nexport interface UnresolvedFileProps<LAnnotation> extends Omit<\n FileDiffProps<LAnnotation>,\n 'fileDiff' | 'options'\n> {\n file: FileContents;\n options?: UnresolvedFileReactOptions<LAnnotation>;\n renderMergeConflictUtility?(\n action: MergeConflictDiffAction,\n getInstance: () => UnresolvedFileClass<LAnnotation> | undefined\n ): ReactNode;\n}\n\nexport function UnresolvedFile<LAnnotation = undefined>({\n file,\n options,\n lineAnnotations,\n selectedLines,\n className,\n style,\n prerenderedHTML,\n renderAnnotation,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderGutterUtility,\n renderHoverUtility,\n renderMergeConflictUtility,\n}: UnresolvedFileProps<LAnnotation>): React.JSX.Element {\n const { ref, getHoveredLine, fileDiff, actions, getInstance } =\n useUnresolvedFileInstance({\n file,\n options,\n lineAnnotations,\n selectedLines,\n prerenderedHTML,\n hasConflictUtility: renderMergeConflictUtility != null,\n hasGutterRenderUtility:\n renderGutterUtility != null || renderHoverUtility != null,\n });\n const children = renderDiffChildren({\n fileDiff,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderAnnotation,\n renderGutterUtility,\n renderHoverUtility,\n lineAnnotations,\n getHoveredLine,\n actions,\n renderMergeConflictUtility,\n getInstance,\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":";;;;;;;;;;AA4DA,SAAgB,eAAwC,EACtD,MACA,SACA,iBACA,eACA,WACA,OACA,iBACA,kBACA,oBACA,sBACA,qBACA,oBACA,8BACsD;CACtD,MAAM,EAAE,KAAK,gBAAgB,UAAU,SAAS,gBAC9C,0BAA0B;EACxB;EACA;EACA;EACA;EACA;EACA,oBAAoB,8BAA8B;EAClD,wBACE,uBAAuB,QAAQ,sBAAsB;EACxD,CAAC;AAcJ,QACE,oBAAC;EAAoB;EAAgB;EAAkB;YACpD,eAfY,mBAAmB;GAClC;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC,EAG4B,gBAAgB;GAC3B"}
@@ -1,10 +1,10 @@
1
- import { AnnotationLineMap, AnnotationSide, AnnotationSpan, BaseCodeOptions, BaseDiffOptions, BaseDiffOptionsWithDefaults, BundledLanguage, ChangeContent, ChangeTypes, CodeColumnType, CodeToHastOptions, ContextContent, CustomPreProperties, DecorationItem, DiffLineAnnotation, DiffLineEventBaseProps, DiffsHighlighter, DiffsThemeNames, ExpansionDirections, ExtensionFormatMap, FileContents, FileDiffMetadata, ForceDiffPlainTextOptions, ForceFilePlainTextOptions, GapSpan, HighlighterTypes, Hunk, HunkData, HunkExpansionRegion, HunkLineType, HunkSeparators, LanguageRegistration, LineAnnotation, LineDiffTypes, LineEventBaseProps, LineInfo, LineSpans, LineTypes, MergeConflictActionPayload, MergeConflictRegion, MergeConflictResolution, ObservedAnnotationNodes, ObservedGridNodes, ParsedPatch, PrePropertiesConfig, RenderDiffFilesResult, RenderDiffOptions, RenderDiffResult, RenderFileMetadata, RenderFileOptions, RenderFileResult, RenderHeaderMetadataCallback, RenderHeaderMetadataProps, RenderHeaderPrefixCallback, RenderRange, RenderWindow, RenderedDiffASTCache, RenderedFileASTCache, SelectionPoint, SelectionSide, SharedRenderState, ShikiTransformer, SupportedLanguages, ThemeRegistrationResolved, ThemeTypes, ThemedDiffResult, ThemedFileResult, ThemedToken, ThemesType, VirtualFileMetrics, VirtualWindowSpecs } from "../types.js";
1
+ import { AnnotationLineMap, AnnotationSide, AnnotationSpan, BaseCodeOptions, BaseDiffOptions, BaseDiffOptionsWithDefaults, BundledLanguage, ChangeContent, ChangeTypes, CodeColumnType, CodeToHastOptions, ConflictResolverTypes, ContextContent, CustomPreProperties, DecorationItem, DiffAcceptRejectHunkConfig, DiffAcceptRejectHunkType, DiffLineAnnotation, DiffLineEventBaseProps, DiffsHighlighter, DiffsThemeNames, ExpansionDirections, ExtensionFormatMap, FileContents, FileDiffMetadata, ForceDiffPlainTextOptions, ForceFilePlainTextOptions, GapSpan, HighlighterTypes, Hunk, HunkData, HunkExpansionRegion, HunkLineType, HunkSeparators, LanguageRegistration, LineAnnotation, LineDiffTypes, LineEventBaseProps, LineInfo, LineSpans, LineTypes, MergeConflictActionPayload, MergeConflictMarkerRow, MergeConflictMarkerRowType, MergeConflictRegion, MergeConflictResolution, ObservedAnnotationNodes, ObservedGridNodes, ParsedPatch, PrePropertiesConfig, ProcessFileConflictData, RenderDiffFilesResult, RenderDiffOptions, RenderDiffResult, RenderFileMetadata, RenderFileOptions, RenderFileResult, RenderHeaderMetadataCallback, RenderHeaderMetadataProps, RenderHeaderPrefixCallback, RenderRange, RenderWindow, RenderedDiffASTCache, RenderedFileASTCache, SelectionPoint, SelectionSide, SharedRenderState, ShikiTransformer, SupportedLanguages, ThemeRegistrationResolved, ThemeTypes, ThemedDiffResult, ThemedFileResult, ThemedToken, ThemesType, VirtualFileMetrics, VirtualWindowSpecs } from "../types.js";
2
2
  import { WorkerInitializationRenderOptions, WorkerPoolOptions } from "../worker/types.js";
3
3
  import { FileOptions } from "../components/File.js";
4
4
  import { DiffBasePropsReact, FileProps } from "./types.js";
5
5
  import { File } from "./File.js";
6
6
  import { FileDiff, FileDiffProps } from "./FileDiff.js";
7
- import { MergeConflictActionsTypeOption, RenderMergeConflictActionContext, RenderMergeConflictActions, UnresolvedFile, UnresolvedFileProps } from "./UnresolvedFile.js";
7
+ import { MergeConflictActionsTypeOption, RenderMergeConflictActionContext, RenderMergeConflictActions, UnresolvedFile, UnresolvedFileProps, UnresolvedFileReactOptions } from "./UnresolvedFile.js";
8
8
  import { MultiFileDiff, MultiFileDiffProps } from "./MultiFileDiff.js";
9
9
  import { PatchDiff, PatchDiffProps } from "./PatchDiff.js";
10
10
  import { Virtualizer, VirtualizerContext, useVirtualizer } from "./Virtualizer.js";
@@ -16,4 +16,4 @@ import { templateRender } from "./utils/templateRender.js";
16
16
  import { useFileDiffInstance } from "./utils/useFileDiffInstance.js";
17
17
  import { useFileInstance } from "./utils/useFileInstance.js";
18
18
  import { useStableCallback } from "./utils/useStableCallback.js";
19
- export { AnnotationLineMap, AnnotationSide, AnnotationSpan, BaseCodeOptions, BaseDiffOptions, BaseDiffOptionsWithDefaults, BundledLanguage, ChangeContent, ChangeTypes, CodeColumnType, CodeToHastOptions, ContextContent, CustomPreProperties, DecorationItem, DiffBasePropsReact, DiffLineAnnotation, DiffLineEventBaseProps, DiffsHighlighter, DiffsThemeNames, ExpansionDirections, ExtensionFormatMap, File, FileContents, FileDiff, FileDiffMetadata, FileDiffProps, FileOptions, FileProps, ForceDiffPlainTextOptions, ForceFilePlainTextOptions, GapSpan, GutterUtilitySlotStyles, HighlighterTypes, Hunk, HunkData, HunkExpansionRegion, HunkLineType, HunkSeparators, LanguageRegistration, LineAnnotation, LineDiffTypes, LineEventBaseProps, LineInfo, LineSpans, LineTypes, MergeConflictActionPayload, MergeConflictActionsTypeOption, MergeConflictRegion, MergeConflictResolution, MergeConflictSlotStyles, MultiFileDiff, MultiFileDiffProps, ObservedAnnotationNodes, ObservedGridNodes, ParsedPatch, PatchDiff, PatchDiffProps, PrePropertiesConfig, RenderDiffFilesResult, RenderDiffOptions, RenderDiffResult, RenderFileMetadata, RenderFileOptions, RenderFileResult, RenderHeaderMetadataCallback, RenderHeaderMetadataProps, RenderHeaderPrefixCallback, RenderMergeConflictActionContext, RenderMergeConflictActions, RenderRange, RenderWindow, RenderedDiffASTCache, RenderedFileASTCache, SelectionPoint, SelectionSide, SharedRenderState, ShikiTransformer, SupportedLanguages, ThemeRegistrationResolved, ThemeTypes, ThemedDiffResult, ThemedFileResult, ThemedToken, ThemesType, UnresolvedFile, UnresolvedFileProps, VirtualFileMetrics, VirtualWindowSpecs, Virtualizer, VirtualizerContext, WorkerInitializationRenderOptions, WorkerPoolContext, WorkerPoolContextProvider, WorkerPoolOptions, noopRender, renderDiffChildren, renderFileChildren, templateRender, useFileDiffInstance, useFileInstance, useStableCallback, useVirtualizer, useWorkerPool };
19
+ export { AnnotationLineMap, AnnotationSide, AnnotationSpan, BaseCodeOptions, BaseDiffOptions, BaseDiffOptionsWithDefaults, BundledLanguage, ChangeContent, ChangeTypes, CodeColumnType, CodeToHastOptions, ConflictResolverTypes, ContextContent, CustomPreProperties, DecorationItem, DiffAcceptRejectHunkConfig, DiffAcceptRejectHunkType, DiffBasePropsReact, DiffLineAnnotation, DiffLineEventBaseProps, DiffsHighlighter, DiffsThemeNames, ExpansionDirections, ExtensionFormatMap, File, FileContents, FileDiff, FileDiffMetadata, FileDiffProps, FileOptions, FileProps, ForceDiffPlainTextOptions, ForceFilePlainTextOptions, GapSpan, GutterUtilitySlotStyles, HighlighterTypes, Hunk, HunkData, HunkExpansionRegion, HunkLineType, HunkSeparators, LanguageRegistration, LineAnnotation, LineDiffTypes, LineEventBaseProps, LineInfo, LineSpans, LineTypes, MergeConflictActionPayload, MergeConflictActionsTypeOption, MergeConflictMarkerRow, MergeConflictMarkerRowType, MergeConflictRegion, MergeConflictResolution, MergeConflictSlotStyles, MultiFileDiff, MultiFileDiffProps, ObservedAnnotationNodes, ObservedGridNodes, ParsedPatch, PatchDiff, PatchDiffProps, PrePropertiesConfig, ProcessFileConflictData, RenderDiffFilesResult, RenderDiffOptions, RenderDiffResult, RenderFileMetadata, RenderFileOptions, RenderFileResult, RenderHeaderMetadataCallback, RenderHeaderMetadataProps, RenderHeaderPrefixCallback, RenderMergeConflictActionContext, RenderMergeConflictActions, RenderRange, RenderWindow, RenderedDiffASTCache, RenderedFileASTCache, SelectionPoint, SelectionSide, SharedRenderState, ShikiTransformer, SupportedLanguages, ThemeRegistrationResolved, ThemeTypes, ThemedDiffResult, ThemedFileResult, ThemedToken, ThemesType, UnresolvedFile, UnresolvedFileProps, UnresolvedFileReactOptions, VirtualFileMetrics, VirtualWindowSpecs, Virtualizer, VirtualizerContext, WorkerInitializationRenderOptions, WorkerPoolContext, WorkerPoolContextProvider, WorkerPoolOptions, noopRender, renderDiffChildren, renderFileChildren, templateRender, useFileDiffInstance, useFileInstance, useStableCallback, useVirtualizer, useWorkerPool };
@@ -7,7 +7,7 @@ import { ReactNode } from "react";
7
7
  //#region src/react/utils/renderDiffChildren.d.ts
8
8
  interface RenderDiffChildrenProps<LAnnotation, T> {
9
9
  fileDiff?: FileDiffMetadata;
10
- actions?: MergeConflictDiffAction[];
10
+ actions?: (MergeConflictDiffAction | undefined)[];
11
11
  deletionFile?: FileContents;
12
12
  additionFile?: FileContents;
13
13
  renderHeaderPrefix: DiffBasePropsReact<LAnnotation>['renderHeaderPrefix'];
@@ -1 +1 @@
1
- {"version":3,"file":"renderDiffChildren.d.ts","names":["ReactNode","GetHoveredLineResult","FileContents","FileDiffMetadata","MergeConflictDiffAction","DiffBasePropsReact","RenderDiffChildrenProps","LAnnotation","T","renderDiffChildren","fileDiff","actions","deletionFile","additionFile","renderHeaderPrefix","renderHeaderMetadata","renderAnnotation","renderGutterUtility","renderHoverUtility","renderMergeConflictUtility","lineAnnotations","getHoveredLine","getInstance"],"sources":["../../../src/react/utils/renderDiffChildren.d.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { GetHoveredLineResult } from '../../managers/InteractionManager';\nimport type { FileContents, FileDiffMetadata } from '../../types';\nimport { type MergeConflictDiffAction } from '../../utils/parseMergeConflictDiffFromFile';\nimport type { DiffBasePropsReact } from '../types';\ninterface RenderDiffChildrenProps<LAnnotation, T> {\n fileDiff?: FileDiffMetadata;\n actions?: MergeConflictDiffAction[];\n deletionFile?: FileContents;\n additionFile?: FileContents;\n renderHeaderPrefix: DiffBasePropsReact<LAnnotation>['renderHeaderPrefix'];\n renderHeaderMetadata: DiffBasePropsReact<LAnnotation>['renderHeaderMetadata'];\n renderAnnotation: DiffBasePropsReact<LAnnotation>['renderAnnotation'];\n renderGutterUtility: DiffBasePropsReact<LAnnotation>['renderGutterUtility'];\n renderHoverUtility: DiffBasePropsReact<LAnnotation>['renderHoverUtility'];\n renderMergeConflictUtility?(action: MergeConflictDiffAction, getInstance: () => T | undefined): ReactNode;\n lineAnnotations: DiffBasePropsReact<LAnnotation>['lineAnnotations'];\n getHoveredLine(): GetHoveredLineResult<'diff'> | undefined;\n getInstance?(): T | undefined;\n}\nexport declare function renderDiffChildren<LAnnotation, T>({ fileDiff, actions, deletionFile, additionFile, renderHeaderPrefix, renderHeaderMetadata, renderAnnotation, renderGutterUtility, renderHoverUtility, renderMergeConflictUtility, lineAnnotations, getHoveredLine, getInstance }: RenderDiffChildrenProps<LAnnotation, T>): ReactNode;\nexport {};\n//# sourceMappingURL=renderDiffChildren.d.ts.map"],"mappings":";;;;;;;UAKUM;aACKH;EADLG,OAAAA,CAAAA,EAEIF,uBAFmBG,EAAAA;EAClBJ,YAAAA,CAAAA,EAEID,YAFJC;EACDC,YAAAA,CAAAA,EAEKF,YAFLE;EACKF,kBAAAA,EAEKG,kBAFLH,CAEwBK,WAFxBL,CAAAA,CAAAA,oBAAAA,CAAAA;EACAA,oBAAAA,EAEOG,kBAFPH,CAE0BK,WAF1BL,CAAAA,CAAAA,sBAAAA,CAAAA;EACwBK,gBAAAA,EAErBF,kBAFqBE,CAEFA,WAFEA,CAAAA,CAAAA,kBAAAA,CAAAA;EAAnBF,mBAAAA,EAGCA,kBAHDA,CAGoBE,WAHpBF,CAAAA,CAAAA,qBAAAA,CAAAA;EACqBE,kBAAAA,EAGrBF,kBAHqBE,CAGFA,WAHEA,CAAAA,CAAAA,oBAAAA,CAAAA;EAAnBF,0BAAAA,EAAAA,MAAAA,EAIcD,uBAJdC,EAAAA,WAAAA,EAAAA,GAAAA,GAI0DG,CAJ1DH,GAAAA,SAAAA,CAAAA,EAI0EL,SAJ1EK;EACeE,eAAAA,EAIpBF,kBAJoBE,CAIDA,WAJCA,CAAAA,CAAAA,iBAAAA,CAAAA;EAAnBF,cAAAA,EAAAA,EAKAJ,oBALAI,CAAAA,MAAAA,CAAAA,GAAAA,SAAAA;EACsBE,WAAAA,GAAAA,EAKxBC,CALwBD,GAAAA,SAAAA;;AACDA,iBAMnBE,kBANmBF,CAAAA,WAAAA,EAAAA,CAAAA,CAAAA,CAAAA;EAAAA,QAAAA;EAAAA,OAAAA;EAAAA,YAAAA;EAAAA,YAAAA;EAAAA,kBAAAA;EAAAA,oBAAAA;EAAAA,gBAAAA;EAAAA,mBAAAA;EAAAA,kBAAAA;EAAAA,0BAAAA;EAAAA,eAAAA;EAAAA,cAAAA;EAAAA;AAAAA,CAAAA,EAMkPD,uBANlPC,CAM0QA,WAN1QA,EAMuRC,CANvRD,CAAAA,CAAAA,EAM4RP,SAN5RO"}
1
+ {"version":3,"file":"renderDiffChildren.d.ts","names":["ReactNode","GetHoveredLineResult","FileContents","FileDiffMetadata","MergeConflictDiffAction","DiffBasePropsReact","RenderDiffChildrenProps","LAnnotation","T","renderDiffChildren","fileDiff","actions","deletionFile","additionFile","renderHeaderPrefix","renderHeaderMetadata","renderAnnotation","renderGutterUtility","renderHoverUtility","renderMergeConflictUtility","lineAnnotations","getHoveredLine","getInstance"],"sources":["../../../src/react/utils/renderDiffChildren.d.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { GetHoveredLineResult } from '../../managers/InteractionManager';\nimport type { FileContents, FileDiffMetadata } from '../../types';\nimport { type MergeConflictDiffAction } from '../../utils/parseMergeConflictDiffFromFile';\nimport type { DiffBasePropsReact } from '../types';\ninterface RenderDiffChildrenProps<LAnnotation, T> {\n fileDiff?: FileDiffMetadata;\n actions?: (MergeConflictDiffAction | undefined)[];\n deletionFile?: FileContents;\n additionFile?: FileContents;\n renderHeaderPrefix: DiffBasePropsReact<LAnnotation>['renderHeaderPrefix'];\n renderHeaderMetadata: DiffBasePropsReact<LAnnotation>['renderHeaderMetadata'];\n renderAnnotation: DiffBasePropsReact<LAnnotation>['renderAnnotation'];\n renderGutterUtility: DiffBasePropsReact<LAnnotation>['renderGutterUtility'];\n renderHoverUtility: DiffBasePropsReact<LAnnotation>['renderHoverUtility'];\n renderMergeConflictUtility?(action: MergeConflictDiffAction, getInstance: () => T | undefined): ReactNode;\n lineAnnotations: DiffBasePropsReact<LAnnotation>['lineAnnotations'];\n getHoveredLine(): GetHoveredLineResult<'diff'> | undefined;\n getInstance?(): T | undefined;\n}\nexport declare function renderDiffChildren<LAnnotation, T>({ fileDiff, actions, deletionFile, additionFile, renderHeaderPrefix, renderHeaderMetadata, renderAnnotation, renderGutterUtility, renderHoverUtility, renderMergeConflictUtility, lineAnnotations, getHoveredLine, getInstance }: RenderDiffChildrenProps<LAnnotation, T>): ReactNode;\nexport {};\n//# sourceMappingURL=renderDiffChildren.d.ts.map"],"mappings":";;;;;;;UAKUM;aACKH;EADLG,OAAAA,CAAAA,EAAAA,CAEKF,uBAFkBG,GAAAA,SAAAC,CAAAA,EAAAA;EAClBL,YAAAA,CAAAA,EAEID,YAFJC;EACAC,YAAAA,CAAAA,EAEIF,YAFJE;EACIF,kBAAAA,EAEKG,kBAFLH,CAEwBK,WAFxBL,CAAAA,CAAAA,oBAAAA,CAAAA;EACAA,oBAAAA,EAEOG,kBAFPH,CAE0BK,WAF1BL,CAAAA,CAAAA,sBAAAA,CAAAA;EACwBK,gBAAAA,EAErBF,kBAFqBE,CAEFA,WAFEA,CAAAA,CAAAA,kBAAAA,CAAAA;EAAnBF,mBAAAA,EAGCA,kBAHDA,CAGoBE,WAHpBF,CAAAA,CAAAA,qBAAAA,CAAAA;EACqBE,kBAAAA,EAGrBF,kBAHqBE,CAGFA,WAHEA,CAAAA,CAAAA,oBAAAA,CAAAA;EAAnBF,0BAAAA,EAAAA,MAAAA,EAIcD,uBAJdC,EAAAA,WAAAA,EAAAA,GAAAA,GAI0DG,CAJ1DH,GAAAA,SAAAA,CAAAA,EAI0EL,SAJ1EK;EACeE,eAAAA,EAIpBF,kBAJoBE,CAIDA,WAJCA,CAAAA,CAAAA,iBAAAA,CAAAA;EAAnBF,cAAAA,EAAAA,EAKAJ,oBALAI,CAAAA,MAAAA,CAAAA,GAAAA,SAAAA;EACsBE,WAAAA,GAAAA,EAKxBC,CALwBD,GAAAA,SAAAA;;AACDA,iBAMnBE,kBANmBF,CAAAA,WAAAA,EAAAA,CAAAA,CAAAA,CAAAA;EAAAA,QAAAA;EAAAA,OAAAA;EAAAA,YAAAA;EAAAA,YAAAA;EAAAA,kBAAAA;EAAAA,oBAAAA;EAAAA,gBAAAA;EAAAA,mBAAAA;EAAAA,kBAAAA;EAAAA,0BAAAA;EAAAA,eAAAA;EAAAA,cAAAA;EAAAA;AAAAA,CAAAA,EAMkPD,uBANlPC,CAM0QA,WAN1QA,EAMuRC,CANvRD,CAAAA,CAAAA,EAM4RP,SAN5RO"}
@@ -32,7 +32,8 @@ function renderDiffChildren({ fileDiff, actions, deletionFile, additionFile, ren
32
32
  children: renderAnnotation(annotation)
33
33
  }, index)),
34
34
  actions != null && renderMergeConflictUtility != null && getInstance != null && actions.map((action) => {
35
- const slot = getSlotName(action);
35
+ if (action == null || fileDiff == null) return;
36
+ const slot = getSlotName(action, fileDiff);
36
37
  return /* @__PURE__ */ jsx("div", {
37
38
  slot,
38
39
  style: MergeConflictSlotStyles,
@@ -46,10 +47,11 @@ function renderDiffChildren({ fileDiff, actions, deletionFile, additionFile, ren
46
47
  })
47
48
  ] });
48
49
  }
49
- function getSlotName(action) {
50
- const anchor = getMergeConflictActionAnchor(action);
50
+ function getSlotName(action, fileDiff) {
51
+ const anchor = getMergeConflictActionAnchor(action, fileDiff);
51
52
  return anchor != null ? getMergeConflictActionSlotName({
52
- ...anchor,
53
+ hunkIndex: anchor.hunkIndex,
54
+ lineIndex: anchor.lineIndex,
53
55
  conflictIndex: action.conflictIndex
54
56
  }) : void 0;
55
57
  }
@@ -1 +1 @@
1
- {"version":3,"file":"renderDiffChildren.js","names":[],"sources":["../../../src/react/utils/renderDiffChildren.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport {\n HEADER_METADATA_SLOT_ID,\n HEADER_PREFIX_SLOT_ID,\n} from '../../constants';\nimport type { GetHoveredLineResult } from '../../managers/InteractionManager';\nimport type { FileContents, FileDiffMetadata } from '../../types';\nimport { getLineAnnotationName } from '../../utils/getLineAnnotationName';\nimport { getMergeConflictActionSlotName } from '../../utils/getMergeConflictActionSlotName';\nimport {\n getMergeConflictActionAnchor,\n type MergeConflictDiffAction,\n} from '../../utils/parseMergeConflictDiffFromFile';\nimport { GutterUtilitySlotStyles, MergeConflictSlotStyles } from '../constants';\nimport type { DiffBasePropsReact } from '../types';\n\ninterface RenderDiffChildrenProps<LAnnotation, T> {\n fileDiff?: FileDiffMetadata;\n actions?: MergeConflictDiffAction[];\n deletionFile?: FileContents;\n additionFile?: FileContents;\n renderHeaderPrefix: DiffBasePropsReact<LAnnotation>['renderHeaderPrefix'];\n renderHeaderMetadata: DiffBasePropsReact<LAnnotation>['renderHeaderMetadata'];\n renderAnnotation: DiffBasePropsReact<LAnnotation>['renderAnnotation'];\n renderGutterUtility: DiffBasePropsReact<LAnnotation>['renderGutterUtility'];\n renderHoverUtility: DiffBasePropsReact<LAnnotation>['renderHoverUtility'];\n renderMergeConflictUtility?(\n action: MergeConflictDiffAction,\n getInstance: () => T | undefined\n ): ReactNode;\n lineAnnotations: DiffBasePropsReact<LAnnotation>['lineAnnotations'];\n getHoveredLine(): GetHoveredLineResult<'diff'> | undefined;\n getInstance?(): T | undefined;\n}\n\nexport function renderDiffChildren<LAnnotation, T>({\n fileDiff,\n actions,\n deletionFile,\n additionFile,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderAnnotation,\n renderGutterUtility,\n renderHoverUtility,\n renderMergeConflictUtility,\n lineAnnotations,\n getHoveredLine,\n getInstance,\n}: RenderDiffChildrenProps<LAnnotation, T>): ReactNode {\n const gutterUtility = renderGutterUtility ?? renderHoverUtility;\n const prefix = renderHeaderPrefix?.({\n fileDiff,\n deletionFile,\n additionFile,\n });\n const metadata = renderHeaderMetadata?.({\n fileDiff,\n deletionFile,\n additionFile,\n });\n return (\n <>\n {prefix != null && <div slot={HEADER_PREFIX_SLOT_ID}>{prefix}</div>}\n {metadata != null && <div slot={HEADER_METADATA_SLOT_ID}>{metadata}</div>}\n {renderAnnotation != null &&\n lineAnnotations?.map((annotation, index) => (\n <div key={index} slot={getLineAnnotationName(annotation)}>\n {renderAnnotation(annotation)}\n </div>\n ))}\n {actions != null &&\n renderMergeConflictUtility != null &&\n getInstance != null &&\n actions.map((action) => {\n const slot = getSlotName(action);\n return (\n <div key={slot} slot={slot} style={MergeConflictSlotStyles}>\n {renderMergeConflictUtility(action, getInstance)}\n </div>\n );\n })}\n {gutterUtility != null && (\n <div slot=\"gutter-utility-slot\" style={GutterUtilitySlotStyles}>\n {gutterUtility(getHoveredLine)}\n </div>\n )}\n </>\n );\n}\n\nfunction getSlotName(action: MergeConflictDiffAction): string | undefined {\n const anchor = getMergeConflictActionAnchor(action);\n return anchor != null\n ? getMergeConflictActionSlotName({\n ...anchor,\n conflictIndex: action.conflictIndex,\n })\n : undefined;\n}\n"],"mappings":";;;;;;;;AAoCA,SAAgB,mBAAmC,EACjD,UACA,SACA,cACA,cACA,oBACA,sBACA,kBACA,qBACA,oBACA,4BACA,iBACA,gBACA,eACqD;CACrD,MAAM,gBAAgB,uBAAuB;CAC7C,MAAM,SAAS,qBAAqB;EAClC;EACA;EACA;EACD,CAAC;CACF,MAAM,WAAW,uBAAuB;EACtC;EACA;EACA;EACD,CAAC;AACF,QACE;EACG,UAAU,QAAQ,oBAAC;GAAI,MAAM;aAAwB;IAAa;EAClE,YAAY,QAAQ,oBAAC;GAAI,MAAM;aAA0B;IAAe;EACxE,oBAAoB,QACnB,iBAAiB,KAAK,YAAY,UAChC,oBAAC;GAAgB,MAAM,sBAAsB,WAAW;aACrD,iBAAiB,WAAW;KADrB,MAEJ,CACN;EACH,WAAW,QACV,8BAA8B,QAC9B,eAAe,QACf,QAAQ,KAAK,WAAW;GACtB,MAAM,OAAO,YAAY,OAAO;AAChC,UACE,oBAAC;IAAqB;IAAM,OAAO;cAChC,2BAA2B,QAAQ,YAAY;MADxC,KAEJ;IAER;EACH,iBAAiB,QAChB,oBAAC;GAAI,MAAK;GAAsB,OAAO;aACpC,cAAc,eAAe;IAC1B;KAEP;;AAIP,SAAS,YAAY,QAAqD;CACxE,MAAM,SAAS,6BAA6B,OAAO;AACnD,QAAO,UAAU,OACb,+BAA+B;EAC7B,GAAG;EACH,eAAe,OAAO;EACvB,CAAC,GACF"}
1
+ {"version":3,"file":"renderDiffChildren.js","names":[],"sources":["../../../src/react/utils/renderDiffChildren.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport {\n HEADER_METADATA_SLOT_ID,\n HEADER_PREFIX_SLOT_ID,\n} from '../../constants';\nimport type { GetHoveredLineResult } from '../../managers/InteractionManager';\nimport type { FileContents, FileDiffMetadata } from '../../types';\nimport { getLineAnnotationName } from '../../utils/getLineAnnotationName';\nimport { getMergeConflictActionSlotName } from '../../utils/getMergeConflictActionSlotName';\nimport {\n getMergeConflictActionAnchor,\n type MergeConflictDiffAction,\n} from '../../utils/parseMergeConflictDiffFromFile';\nimport { GutterUtilitySlotStyles, MergeConflictSlotStyles } from '../constants';\nimport type { DiffBasePropsReact } from '../types';\n\ninterface RenderDiffChildrenProps<LAnnotation, T> {\n fileDiff?: FileDiffMetadata;\n actions?: (MergeConflictDiffAction | undefined)[];\n deletionFile?: FileContents;\n additionFile?: FileContents;\n renderHeaderPrefix: DiffBasePropsReact<LAnnotation>['renderHeaderPrefix'];\n renderHeaderMetadata: DiffBasePropsReact<LAnnotation>['renderHeaderMetadata'];\n renderAnnotation: DiffBasePropsReact<LAnnotation>['renderAnnotation'];\n renderGutterUtility: DiffBasePropsReact<LAnnotation>['renderGutterUtility'];\n renderHoverUtility: DiffBasePropsReact<LAnnotation>['renderHoverUtility'];\n renderMergeConflictUtility?(\n action: MergeConflictDiffAction,\n getInstance: () => T | undefined\n ): ReactNode;\n lineAnnotations: DiffBasePropsReact<LAnnotation>['lineAnnotations'];\n getHoveredLine(): GetHoveredLineResult<'diff'> | undefined;\n getInstance?(): T | undefined;\n}\n\nexport function renderDiffChildren<LAnnotation, T>({\n fileDiff,\n actions,\n deletionFile,\n additionFile,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderAnnotation,\n renderGutterUtility,\n renderHoverUtility,\n renderMergeConflictUtility,\n lineAnnotations,\n getHoveredLine,\n getInstance,\n}: RenderDiffChildrenProps<LAnnotation, T>): ReactNode {\n const gutterUtility = renderGutterUtility ?? renderHoverUtility;\n const prefix = renderHeaderPrefix?.({\n fileDiff,\n deletionFile,\n additionFile,\n });\n const metadata = renderHeaderMetadata?.({\n fileDiff,\n deletionFile,\n additionFile,\n });\n return (\n <>\n {prefix != null && <div slot={HEADER_PREFIX_SLOT_ID}>{prefix}</div>}\n {metadata != null && <div slot={HEADER_METADATA_SLOT_ID}>{metadata}</div>}\n {renderAnnotation != null &&\n lineAnnotations?.map((annotation, index) => (\n <div key={index} slot={getLineAnnotationName(annotation)}>\n {renderAnnotation(annotation)}\n </div>\n ))}\n {actions != null &&\n renderMergeConflictUtility != null &&\n getInstance != null &&\n actions.map((action) => {\n if (action == null || fileDiff == null) {\n return undefined;\n }\n const slot = getSlotName(action, fileDiff);\n return (\n <div key={slot} slot={slot} style={MergeConflictSlotStyles}>\n {renderMergeConflictUtility(action, getInstance)}\n </div>\n );\n })}\n {gutterUtility != null && (\n <div slot=\"gutter-utility-slot\" style={GutterUtilitySlotStyles}>\n {gutterUtility(getHoveredLine)}\n </div>\n )}\n </>\n );\n}\n\nfunction getSlotName(\n action: MergeConflictDiffAction,\n fileDiff: FileDiffMetadata\n): string | undefined {\n const anchor = getMergeConflictActionAnchor(action, fileDiff);\n return anchor != null\n ? getMergeConflictActionSlotName({\n hunkIndex: anchor.hunkIndex,\n lineIndex: anchor.lineIndex,\n conflictIndex: action.conflictIndex,\n })\n : undefined;\n}\n"],"mappings":";;;;;;;;AAoCA,SAAgB,mBAAmC,EACjD,UACA,SACA,cACA,cACA,oBACA,sBACA,kBACA,qBACA,oBACA,4BACA,iBACA,gBACA,eACqD;CACrD,MAAM,gBAAgB,uBAAuB;CAC7C,MAAM,SAAS,qBAAqB;EAClC;EACA;EACA;EACD,CAAC;CACF,MAAM,WAAW,uBAAuB;EACtC;EACA;EACA;EACD,CAAC;AACF,QACE;EACG,UAAU,QAAQ,oBAAC;GAAI,MAAM;aAAwB;IAAa;EAClE,YAAY,QAAQ,oBAAC;GAAI,MAAM;aAA0B;IAAe;EACxE,oBAAoB,QACnB,iBAAiB,KAAK,YAAY,UAChC,oBAAC;GAAgB,MAAM,sBAAsB,WAAW;aACrD,iBAAiB,WAAW;KADrB,MAEJ,CACN;EACH,WAAW,QACV,8BAA8B,QAC9B,eAAe,QACf,QAAQ,KAAK,WAAW;AACtB,OAAI,UAAU,QAAQ,YAAY,KAChC;GAEF,MAAM,OAAO,YAAY,QAAQ,SAAS;AAC1C,UACE,oBAAC;IAAqB;IAAM,OAAO;cAChC,2BAA2B,QAAQ,YAAY;MADxC,KAEJ;IAER;EACH,iBAAiB,QAChB,oBAAC;GAAI,MAAK;GAAsB,OAAO;aACpC,cAAc,eAAe;IAC1B;KAEP;;AAIP,SAAS,YACP,QACA,UACoB;CACpB,MAAM,SAAS,6BAA6B,QAAQ,SAAS;AAC7D,QAAO,UAAU,OACb,+BAA+B;EAC7B,WAAW,OAAO;EAClB,WAAW,OAAO;EAClB,eAAe,OAAO;EACvB,CAAC,GACF"}
@@ -1,4 +1,4 @@
1
- import { DiffLineAnnotation, FileContents, FileDiffMetadata } from "../../types.js";
1
+ import { DiffLineAnnotation, FileContents, FileDiffMetadata, MergeConflictMarkerRow } from "../../types.js";
2
2
  import { GetHoveredLineResult, SelectedLineRange } from "../../managers/InteractionManager.js";
3
3
  import { MergeConflictDiffAction } from "../../utils/parseMergeConflictDiffFromFile.js";
4
4
  import { UnresolvedFileHunksRendererOptions } from "../../renderers/UnresolvedFileHunksRenderer.js";
@@ -16,7 +16,8 @@ interface UseUnresolvedFileInstanceProps<LAnnotation> {
16
16
  }
17
17
  interface UseUnresolvedFileInstanceReturn<LAnnotation> {
18
18
  fileDiff: FileDiffMetadata;
19
- actions: MergeConflictDiffAction[];
19
+ actions: (MergeConflictDiffAction | undefined)[];
20
+ markerRows: MergeConflictMarkerRow[];
20
21
  ref(node: HTMLElement | null): void;
21
22
  getHoveredLine(): GetHoveredLineResult<'diff'> | undefined;
22
23
  getInstance(): UnresolvedFile<LAnnotation> | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"useUnresolvedFileInstance.d.ts","names":["UnresolvedFile","GetHoveredLineResult","SelectedLineRange","UnresolvedFileHunksRendererOptions","DiffLineAnnotation","FileContents","FileDiffMetadata","MergeConflictDiffAction","UseUnresolvedFileInstanceProps","LAnnotation","Omit","UseUnresolvedFileInstanceReturn","HTMLElement","useUnresolvedFileInstance","file","options","lineAnnotations","selectedLines","prerenderedHTML","hasConflictUtility","hasGutterRenderUtility"],"sources":["../../../src/react/utils/useUnresolvedFileInstance.d.ts"],"sourcesContent":["import { UnresolvedFile } from '../../components/UnresolvedFile';\nimport type { GetHoveredLineResult, SelectedLineRange } from '../../managers/InteractionManager';\nimport type { UnresolvedFileHunksRendererOptions } from '../../renderers/UnresolvedFileHunksRenderer';\nimport type { DiffLineAnnotation, FileContents, FileDiffMetadata } from '../../types';\nimport { type MergeConflictDiffAction } from '../../utils/parseMergeConflictDiffFromFile';\ninterface UseUnresolvedFileInstanceProps<LAnnotation> {\n file: FileContents;\n options?: Omit<UnresolvedFileHunksRendererOptions, 'onMergeConflictAction'>;\n lineAnnotations: DiffLineAnnotation<LAnnotation>[] | undefined;\n selectedLines: SelectedLineRange | null | undefined;\n prerenderedHTML: string | undefined;\n hasConflictUtility: boolean;\n hasGutterRenderUtility: boolean;\n}\ninterface UseUnresolvedFileInstanceReturn<LAnnotation> {\n fileDiff: FileDiffMetadata;\n actions: MergeConflictDiffAction[];\n ref(node: HTMLElement | null): void;\n getHoveredLine(): GetHoveredLineResult<'diff'> | undefined;\n getInstance(): UnresolvedFile<LAnnotation> | undefined;\n}\nexport declare function useUnresolvedFileInstance<LAnnotation>({ file, options, lineAnnotations, selectedLines, prerenderedHTML, hasConflictUtility, hasGutterRenderUtility }: UseUnresolvedFileInstanceProps<LAnnotation>): UseUnresolvedFileInstanceReturn<LAnnotation>;\nexport {};\n//# sourceMappingURL=useUnresolvedFileInstance.d.ts.map"],"mappings":";;;;;;;UAKUQ;QACAH;EADAG,OAAAA,CAAAA,EAEIE,IAFJF,CAESL,kCAFqBM,EAAAA,uBAAA,CAAA;EAC9BJ,eAAAA,EAEWD,kBAFXC,CAE8BI,WAF9BJ,CAAAA,EAAAA,GAAAA,SAAAA;EACSF,aAAAA,EAEAD,iBAFAC,GAAAA,IAAAA,GAAAA,SAAAA;EAALO,eAAAA,EAAAA,MAAAA,GAAAA,SAAAA;EAC0BD,kBAAAA,EAAAA,OAAAA;EAAnBL,sBAAAA,EAAAA,OAAAA;;UAMXO,+BAL0B,CAAA,WAAA,CAAA,CAAA;EAK1BA,QAAAA,EACIL,gBADJK;EACIL,OAAAA,EACDC,uBADCD,EAAAA;EACDC,GAAAA,CAAAA,IAAAA,EACCK,WADDL,GAAAA,IAAAA,CAAAA,EAAAA,IAAAA;EACCK,cAAAA,EAAAA,EACQX,oBADRW,CAAAA,MAAAA,CAAAA,GAAAA,SAAAA;EACQX,WAAAA,EAAAA,EACHD,cADGC,CACYQ,WADZR,CAAAA,GAAAA,SAAAA;;AACHD,iBAEKa,yBAFLb,CAAAA,WAAAA,CAAAA,CAAAA;EAAAA,IAAAA;EAAAA,OAAAA;EAAAA,eAAAA;EAAAA,aAAAA;EAAAA,eAAAA;EAAAA,kBAAAA;EAAAA;AAAAA,CAAAA,EAE4JQ,8BAF5JR,CAE2LS,WAF3LT,CAAAA,CAAAA,EAE0MW,+BAF1MX,CAE0OS,WAF1OT,CAAAA"}
1
+ {"version":3,"file":"useUnresolvedFileInstance.d.ts","names":["UnresolvedFile","GetHoveredLineResult","SelectedLineRange","UnresolvedFileHunksRendererOptions","DiffLineAnnotation","FileContents","FileDiffMetadata","MergeConflictMarkerRow","MergeConflictDiffAction","UseUnresolvedFileInstanceProps","LAnnotation","Omit","UseUnresolvedFileInstanceReturn","HTMLElement","useUnresolvedFileInstance","file","options","lineAnnotations","selectedLines","prerenderedHTML","hasConflictUtility","hasGutterRenderUtility"],"sources":["../../../src/react/utils/useUnresolvedFileInstance.d.ts"],"sourcesContent":["import { UnresolvedFile } from '../../components/UnresolvedFile';\nimport type { GetHoveredLineResult, SelectedLineRange } from '../../managers/InteractionManager';\nimport type { UnresolvedFileHunksRendererOptions } from '../../renderers/UnresolvedFileHunksRenderer';\nimport type { DiffLineAnnotation, FileContents, FileDiffMetadata, MergeConflictMarkerRow } from '../../types';\nimport { type MergeConflictDiffAction } from '../../utils/parseMergeConflictDiffFromFile';\ninterface UseUnresolvedFileInstanceProps<LAnnotation> {\n file: FileContents;\n options?: Omit<UnresolvedFileHunksRendererOptions, 'onMergeConflictAction'>;\n lineAnnotations: DiffLineAnnotation<LAnnotation>[] | undefined;\n selectedLines: SelectedLineRange | null | undefined;\n prerenderedHTML: string | undefined;\n hasConflictUtility: boolean;\n hasGutterRenderUtility: boolean;\n}\ninterface UseUnresolvedFileInstanceReturn<LAnnotation> {\n fileDiff: FileDiffMetadata;\n actions: (MergeConflictDiffAction | undefined)[];\n markerRows: MergeConflictMarkerRow[];\n ref(node: HTMLElement | null): void;\n getHoveredLine(): GetHoveredLineResult<'diff'> | undefined;\n getInstance(): UnresolvedFile<LAnnotation> | undefined;\n}\nexport declare function useUnresolvedFileInstance<LAnnotation>({ file, options, lineAnnotations, selectedLines, prerenderedHTML, hasConflictUtility, hasGutterRenderUtility }: UseUnresolvedFileInstanceProps<LAnnotation>): UseUnresolvedFileInstanceReturn<LAnnotation>;\nexport {};\n//# sourceMappingURL=useUnresolvedFileInstance.d.ts.map"],"mappings":";;;;;;;UAKUS;QACAJ;EADAI,OAAAA,CAAAA,EAEIE,IAFJF,CAESN,kCAFqBO,EAAAA,uBAAA,CAAA;EAC9BL,eAAAA,EAEWD,kBAFXC,CAE8BK,WAF9BL,CAAAA,EAAAA,GAAAA,SAAAA;EACSF,aAAAA,EAEAD,iBAFAC,GAAAA,IAAAA,GAAAA,SAAAA;EAALQ,eAAAA,EAAAA,MAAAA,GAAAA,SAAAA;EAC0BD,kBAAAA,EAAAA,OAAAA;EAAnBN,sBAAAA,EAAAA,OAAAA;;UAMXQ,+BAL0B,CAAA,WAAA,CAAA,CAAA;EAK1BA,QAAAA,EACIN,gBADJM;EACIN,OAAAA,EAAAA,CACAE,uBADAF,GAAAA,SAAAA,CAAAA,EAAAA;EACAE,UAAAA,EACED,sBADFC,EAAAA;EACED,GAAAA,CAAAA,IAAAA,EACFM,WADEN,GAAAA,IAAAA,CAAAA,EAAAA,IAAAA;EACFM,cAAAA,EAAAA,EACQZ,oBADRY,CAAAA,MAAAA,CAAAA,GAAAA,SAAAA;EACQZ,WAAAA,EAAAA,EACHD,cADGC,CACYS,WADZT,CAAAA,GAAAA,SAAAA;;AACHD,iBAEKc,yBAFLd,CAAAA,WAAAA,CAAAA,CAAAA;EAAAA,IAAAA;EAAAA,OAAAA;EAAAA,eAAAA;EAAAA,aAAAA;EAAAA,eAAAA;EAAAA,kBAAAA;EAAAA;AAAAA,CAAAA,EAE4JS,8BAF5JT,CAE2LU,WAF3LV,CAAAA,CAAAA,EAE0MY,+BAF1MZ,CAE0OU,WAF1OV,CAAAA"}
@@ -9,23 +9,23 @@ import { useCallback, useContext, useEffect, useLayoutEffect, useRef, useState }
9
9
  //#region src/react/utils/useUnresolvedFileInstance.ts
10
10
  const useIsometricEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
11
11
  function useUnresolvedFileInstance({ file, options, lineAnnotations, selectedLines, prerenderedHTML, hasConflictUtility, hasGutterRenderUtility }) {
12
- const [{ fileDiff, actions }, setState] = useState(() => {
13
- const { fileDiff: fileDiff$1, actions: actions$1 } = parseMergeConflictDiffFromFile(file);
12
+ const [{ fileDiff, actions, markerRows }, setState] = useState(() => {
13
+ const { fileDiff: fileDiff$1, actions: actions$1, markerRows: markerRows$1 } = parseMergeConflictDiffFromFile(file);
14
14
  return {
15
15
  fileDiff: fileDiff$1,
16
- actions: actions$1
16
+ actions: actions$1,
17
+ markerRows: markerRows$1
17
18
  };
18
19
  });
19
- const activeFileRef = useRef(file);
20
20
  const onMergeConflictAction = useStableCallback((payload, instance) => {
21
- const activeFile = activeFileRef.current;
22
- const newFile = instance.resolveConflict(payload.conflict.conflictIndex, payload.resolution, activeFile);
23
- if (newFile == null) return;
24
- activeFileRef.current = newFile;
25
- const { fileDiff: fileDiff$1, actions: actions$1 } = parseMergeConflictDiffFromFile(newFile);
26
- setState({
27
- fileDiff: fileDiff$1,
28
- actions: actions$1
21
+ setState((prevState) => {
22
+ const { fileDiff: fileDiff$1, actions: actions$1, markerRows: markerRows$1 } = instance.resolveConflict(payload.conflict.conflictIndex, payload.resolution, prevState.fileDiff) ?? {};
23
+ if (fileDiff$1 == null || actions$1 == null || markerRows$1 == null) return prevState;
24
+ else return {
25
+ fileDiff: fileDiff$1,
26
+ actions: actions$1,
27
+ markerRows: markerRows$1
28
+ };
29
29
  });
30
30
  });
31
31
  const poolManager = useContext(WorkerPoolContext);
@@ -37,6 +37,7 @@ function useUnresolvedFileInstance({ file, options, lineAnnotations, selectedLin
37
37
  instanceRef.current.hydrate({
38
38
  fileDiff,
39
39
  actions,
40
+ markerRows,
40
41
  fileContainer,
41
42
  lineAnnotations,
42
43
  prerenderedHTML
@@ -56,6 +57,7 @@ function useUnresolvedFileInstance({ file, options, lineAnnotations, selectedLin
56
57
  instance.render({
57
58
  fileDiff,
58
59
  actions,
60
+ markerRows,
59
61
  lineAnnotations,
60
62
  forceRender
61
63
  });
@@ -68,6 +70,7 @@ function useUnresolvedFileInstance({ file, options, lineAnnotations, selectedLin
68
70
  }, []),
69
71
  fileDiff,
70
72
  actions,
73
+ markerRows,
71
74
  getInstance: useCallback(() => {
72
75
  return instanceRef.current ?? void 0;
73
76
  }, [])
@@ -1 +1 @@
1
- {"version":3,"file":"useUnresolvedFileInstance.js","names":["UnresolvedFileClass"],"sources":["../../../src/react/utils/useUnresolvedFileInstance.ts"],"sourcesContent":["import {\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\n\nimport {\n UnresolvedFile,\n UnresolvedFile as UnresolvedFileClass,\n type UnresolvedFileOptions,\n} from '../../components/UnresolvedFile';\nimport type {\n GetHoveredLineResult,\n SelectedLineRange,\n} from '../../managers/InteractionManager';\nimport type { UnresolvedFileHunksRendererOptions } from '../../renderers/UnresolvedFileHunksRenderer';\nimport type {\n DiffLineAnnotation,\n FileContents,\n FileDiffMetadata,\n MergeConflictActionPayload,\n} from '../../types';\nimport { areOptionsEqual } from '../../utils/areOptionsEqual';\nimport {\n type MergeConflictDiffAction,\n parseMergeConflictDiffFromFile,\n} from '../../utils/parseMergeConflictDiffFromFile';\nimport { noopRender } from '../constants';\nimport { WorkerPoolContext } from '../WorkerPoolContext';\nimport { useStableCallback } from './useStableCallback';\n\nconst useIsometricEffect =\n typeof window === 'undefined' ? useEffect : useLayoutEffect;\n\ninterface UseUnresolvedFileInstanceProps<LAnnotation> {\n file: FileContents;\n options?: Omit<UnresolvedFileHunksRendererOptions, 'onMergeConflictAction'>;\n lineAnnotations: DiffLineAnnotation<LAnnotation>[] | undefined;\n selectedLines: SelectedLineRange | null | undefined;\n prerenderedHTML: string | undefined;\n hasConflictUtility: boolean;\n hasGutterRenderUtility: boolean;\n}\n\ninterface UseUnresolvedFileInstanceReturn<LAnnotation> {\n fileDiff: FileDiffMetadata;\n actions: MergeConflictDiffAction[];\n ref(node: HTMLElement | null): void;\n getHoveredLine(): GetHoveredLineResult<'diff'> | undefined;\n getInstance(): UnresolvedFile<LAnnotation> | undefined;\n}\n\nexport function useUnresolvedFileInstance<LAnnotation>({\n file,\n options,\n lineAnnotations,\n selectedLines,\n prerenderedHTML,\n hasConflictUtility,\n hasGutterRenderUtility,\n}: UseUnresolvedFileInstanceProps<LAnnotation>): UseUnresolvedFileInstanceReturn<LAnnotation> {\n const [{ fileDiff, actions }, setState] = useState(() => {\n const { fileDiff, actions } = parseMergeConflictDiffFromFile(file);\n return { fileDiff, actions };\n });\n // UnresolvedFile is intentionally uncontrolled in React. Keep an internal\n // source-of-truth file so sequential conflict actions apply to the latest\n // resolved contents rather than the initial prop value.\n const activeFileRef = useRef(file);\n const onMergeConflictAction = useStableCallback(\n (\n payload: MergeConflictActionPayload,\n instance: UnresolvedFile<LAnnotation>\n ) => {\n const activeFile = activeFileRef.current;\n const newFile = instance.resolveConflict(\n payload.conflict.conflictIndex,\n payload.resolution,\n activeFile\n );\n if (newFile == null) return;\n activeFileRef.current = newFile;\n const { fileDiff, actions } = parseMergeConflictDiffFromFile(newFile);\n setState({ fileDiff, actions });\n }\n );\n const poolManager = useContext(WorkerPoolContext);\n const instanceRef = useRef<UnresolvedFileClass<LAnnotation> | null>(null);\n const ref = useStableCallback((fileContainer: HTMLElement | null) => {\n if (fileContainer != null) {\n if (instanceRef.current != null) {\n throw new Error(\n 'useUnresolvedFileInstance: An instance should not already exist when a node is created'\n );\n }\n instanceRef.current = new UnresolvedFileClass(\n mergeUnresolvedOptions(\n options,\n onMergeConflictAction,\n hasConflictUtility,\n hasGutterRenderUtility\n ),\n poolManager,\n true\n );\n void instanceRef.current.hydrate({\n fileDiff,\n actions,\n fileContainer,\n lineAnnotations,\n prerenderedHTML,\n });\n } else {\n if (instanceRef.current == null) {\n throw new Error(\n 'useUnresolvedFileInstance: A UnresolvedFile instance should exist when unmounting'\n );\n }\n instanceRef.current.cleanUp();\n instanceRef.current = null;\n }\n });\n\n useIsometricEffect(() => {\n if (instanceRef.current == null) return;\n const instance = instanceRef.current;\n const newOptions = mergeUnresolvedOptions(\n options,\n onMergeConflictAction,\n hasConflictUtility,\n hasGutterRenderUtility\n );\n const forceRender = !areOptionsEqual(instance.options, newOptions);\n instance.setOptions(newOptions);\n void instance.render({\n fileDiff,\n actions,\n lineAnnotations,\n forceRender,\n });\n if (selectedLines !== undefined) {\n instance.setSelectedLines(selectedLines);\n }\n });\n\n const getHoveredLine = useCallback(():\n | GetHoveredLineResult<'diff'>\n | undefined => {\n return instanceRef.current?.getHoveredLine();\n }, []);\n\n const getInstance = useCallback(() => {\n return instanceRef.current ?? undefined;\n }, []);\n\n return { ref, getHoveredLine, fileDiff, actions, getInstance };\n}\n\nfunction mergeUnresolvedOptions<LAnnotation>(\n options: UnresolvedFileHunksRendererOptions | undefined,\n onMergeConflictAction: UnresolvedFileOptions<LAnnotation>['onMergeConflictAction'],\n hasConflictUtility: boolean,\n hasGutterRenderUtility: boolean\n): UnresolvedFileOptions<LAnnotation> {\n return {\n ...options,\n onMergeConflictAction,\n hunkSeparators:\n options?.hunkSeparators === 'custom'\n ? noopRender\n : options?.hunkSeparators,\n // Add a placeholder type for the custom render\n mergeConflictActionsType:\n hasConflictUtility || options?.mergeConflictActionsType === 'custom'\n ? noopRender\n : options?.mergeConflictActionsType,\n renderGutterUtility: hasGutterRenderUtility ? noopRender : undefined,\n };\n}\n"],"mappings":";;;;;;;;;AAkCA,MAAM,qBACJ,OAAO,WAAW,cAAc,YAAY;AAoB9C,SAAgB,0BAAuC,EACrD,MACA,SACA,iBACA,eACA,iBACA,oBACA,0BAC4F;CAC5F,MAAM,CAAC,EAAE,UAAU,WAAW,YAAY,eAAe;EACvD,MAAM,EAAE,sBAAU,uBAAY,+BAA+B,KAAK;AAClE,SAAO;GAAE;GAAU;GAAS;GAC5B;CAIF,MAAM,gBAAgB,OAAO,KAAK;CAClC,MAAM,wBAAwB,mBAE1B,SACA,aACG;EACH,MAAM,aAAa,cAAc;EACjC,MAAM,UAAU,SAAS,gBACvB,QAAQ,SAAS,eACjB,QAAQ,YACR,WACD;AACD,MAAI,WAAW,KAAM;AACrB,gBAAc,UAAU;EACxB,MAAM,EAAE,sBAAU,uBAAY,+BAA+B,QAAQ;AACrE,WAAS;GAAE;GAAU;GAAS,CAAC;GAElC;CACD,MAAM,cAAc,WAAW,kBAAkB;CACjD,MAAM,cAAc,OAAgD,KAAK;CACzE,MAAM,MAAM,mBAAmB,kBAAsC;AACnE,MAAI,iBAAiB,MAAM;AACzB,OAAI,YAAY,WAAW,KACzB,OAAM,IAAI,MACR,yFACD;AAEH,eAAY,UAAU,IAAIA,eACxB,uBACE,SACA,uBACA,oBACA,uBACD,EACD,aACA,KACD;AACD,GAAK,YAAY,QAAQ,QAAQ;IAC/B;IACA;IACA;IACA;IACA;IACD,CAAC;SACG;AACL,OAAI,YAAY,WAAW,KACzB,OAAM,IAAI,MACR,oFACD;AAEH,eAAY,QAAQ,SAAS;AAC7B,eAAY,UAAU;;GAExB;AAEF,0BAAyB;AACvB,MAAI,YAAY,WAAW,KAAM;EACjC,MAAM,WAAW,YAAY;EAC7B,MAAM,aAAa,uBACjB,SACA,uBACA,oBACA,uBACD;EACD,MAAM,cAAc,CAAC,gBAAgB,SAAS,SAAS,WAAW;AAClE,WAAS,WAAW,WAAW;AAC/B,EAAK,SAAS,OAAO;GACnB;GACA;GACA;GACA;GACD,CAAC;AACF,MAAI,kBAAkB,OACpB,UAAS,iBAAiB,cAAc;GAE1C;AAYF,QAAO;EAAE;EAAK,gBAVS,kBAEN;AACf,UAAO,YAAY,SAAS,gBAAgB;KAC3C,EAAE,CAAC;EAMwB;EAAU;EAAS,aAJ7B,kBAAkB;AACpC,UAAO,YAAY,WAAW;KAC7B,EAAE,CAAC;EAEwD;;AAGhE,SAAS,uBACP,SACA,uBACA,oBACA,wBACoC;AACpC,QAAO;EACL,GAAG;EACH;EACA,gBACE,SAAS,mBAAmB,WACxB,aACA,SAAS;EAEf,0BACE,sBAAsB,SAAS,6BAA6B,WACxD,aACA,SAAS;EACf,qBAAqB,yBAAyB,aAAa;EAC5D"}
1
+ {"version":3,"file":"useUnresolvedFileInstance.js","names":["fileDiff","actions","markerRows","UnresolvedFileClass"],"sources":["../../../src/react/utils/useUnresolvedFileInstance.ts"],"sourcesContent":["import {\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\n\nimport {\n UnresolvedFile,\n UnresolvedFile as UnresolvedFileClass,\n type UnresolvedFileOptions,\n} from '../../components/UnresolvedFile';\nimport type {\n GetHoveredLineResult,\n SelectedLineRange,\n} from '../../managers/InteractionManager';\nimport type { UnresolvedFileHunksRendererOptions } from '../../renderers/UnresolvedFileHunksRenderer';\nimport type {\n DiffLineAnnotation,\n FileContents,\n FileDiffMetadata,\n MergeConflictActionPayload,\n MergeConflictMarkerRow,\n} from '../../types';\nimport { areOptionsEqual } from '../../utils/areOptionsEqual';\nimport {\n type MergeConflictDiffAction,\n parseMergeConflictDiffFromFile,\n} from '../../utils/parseMergeConflictDiffFromFile';\nimport { noopRender } from '../constants';\nimport { WorkerPoolContext } from '../WorkerPoolContext';\nimport { useStableCallback } from './useStableCallback';\n\nconst useIsometricEffect =\n typeof window === 'undefined' ? useEffect : useLayoutEffect;\n\ninterface UseUnresolvedFileInstanceProps<LAnnotation> {\n file: FileContents;\n options?: Omit<UnresolvedFileHunksRendererOptions, 'onMergeConflictAction'>;\n lineAnnotations: DiffLineAnnotation<LAnnotation>[] | undefined;\n selectedLines: SelectedLineRange | null | undefined;\n prerenderedHTML: string | undefined;\n hasConflictUtility: boolean;\n hasGutterRenderUtility: boolean;\n}\n\ninterface UseUnresolvedFileInstanceReturn<LAnnotation> {\n fileDiff: FileDiffMetadata;\n actions: (MergeConflictDiffAction | undefined)[];\n markerRows: MergeConflictMarkerRow[];\n ref(node: HTMLElement | null): void;\n getHoveredLine(): GetHoveredLineResult<'diff'> | undefined;\n getInstance(): UnresolvedFile<LAnnotation> | undefined;\n}\n\nexport function useUnresolvedFileInstance<LAnnotation>({\n file,\n options,\n lineAnnotations,\n selectedLines,\n prerenderedHTML,\n hasConflictUtility,\n hasGutterRenderUtility,\n}: UseUnresolvedFileInstanceProps<LAnnotation>): UseUnresolvedFileInstanceReturn<LAnnotation> {\n const [{ fileDiff, actions, markerRows }, setState] = useState(() => {\n const { fileDiff, actions, markerRows } =\n parseMergeConflictDiffFromFile(file);\n return { fileDiff, actions, markerRows };\n });\n // UnresolvedFile is intentionally uncontrolled in React. Keep an internal\n // source-of-truth file so sequential conflict actions apply to the latest\n // resolved contents rather than the initial prop value.\n const onMergeConflictAction = useStableCallback(\n (\n payload: MergeConflictActionPayload,\n instance: UnresolvedFile<LAnnotation>\n ) => {\n setState((prevState) => {\n const { fileDiff, actions, markerRows } =\n instance.resolveConflict(\n payload.conflict.conflictIndex,\n payload.resolution,\n prevState.fileDiff\n ) ?? {};\n if (fileDiff == null || actions == null || markerRows == null) {\n return prevState;\n } else {\n return { fileDiff, actions, markerRows };\n }\n });\n }\n );\n const poolManager = useContext(WorkerPoolContext);\n const instanceRef = useRef<UnresolvedFileClass<LAnnotation> | null>(null);\n const ref = useStableCallback((fileContainer: HTMLElement | null) => {\n if (fileContainer != null) {\n if (instanceRef.current != null) {\n throw new Error(\n 'useUnresolvedFileInstance: An instance should not already exist when a node is created'\n );\n }\n instanceRef.current = new UnresolvedFileClass(\n mergeUnresolvedOptions(\n options,\n onMergeConflictAction,\n hasConflictUtility,\n hasGutterRenderUtility\n ),\n poolManager,\n true\n );\n void instanceRef.current.hydrate({\n fileDiff,\n actions,\n markerRows,\n fileContainer,\n lineAnnotations,\n prerenderedHTML,\n });\n } else {\n if (instanceRef.current == null) {\n throw new Error(\n 'useUnresolvedFileInstance: A UnresolvedFile instance should exist when unmounting'\n );\n }\n instanceRef.current.cleanUp();\n instanceRef.current = null;\n }\n });\n\n useIsometricEffect(() => {\n if (instanceRef.current == null) return;\n const instance = instanceRef.current;\n const newOptions = mergeUnresolvedOptions(\n options,\n onMergeConflictAction,\n hasConflictUtility,\n hasGutterRenderUtility\n );\n const forceRender = !areOptionsEqual(instance.options, newOptions);\n instance.setOptions(newOptions);\n void instance.render({\n fileDiff,\n actions,\n markerRows,\n lineAnnotations,\n forceRender,\n });\n if (selectedLines !== undefined) {\n instance.setSelectedLines(selectedLines);\n }\n });\n\n const getHoveredLine = useCallback(():\n | GetHoveredLineResult<'diff'>\n | undefined => {\n return instanceRef.current?.getHoveredLine();\n }, []);\n\n const getInstance = useCallback(() => {\n return instanceRef.current ?? undefined;\n }, []);\n\n return { ref, getHoveredLine, fileDiff, actions, markerRows, getInstance };\n}\n\nfunction mergeUnresolvedOptions<LAnnotation>(\n options: UnresolvedFileHunksRendererOptions | undefined,\n onMergeConflictAction: UnresolvedFileOptions<LAnnotation>['onMergeConflictAction'],\n hasConflictUtility: boolean,\n hasGutterRenderUtility: boolean\n): UnresolvedFileOptions<LAnnotation> {\n return {\n ...options,\n onMergeConflictAction,\n hunkSeparators:\n options?.hunkSeparators === 'custom'\n ? noopRender\n : options?.hunkSeparators,\n // Add a placeholder type for the custom render\n mergeConflictActionsType:\n hasConflictUtility || options?.mergeConflictActionsType === 'custom'\n ? noopRender\n : options?.mergeConflictActionsType,\n renderGutterUtility: hasGutterRenderUtility ? noopRender : undefined,\n };\n}\n"],"mappings":";;;;;;;;;AAmCA,MAAM,qBACJ,OAAO,WAAW,cAAc,YAAY;AAqB9C,SAAgB,0BAAuC,EACrD,MACA,SACA,iBACA,eACA,iBACA,oBACA,0BAC4F;CAC5F,MAAM,CAAC,EAAE,UAAU,SAAS,cAAc,YAAY,eAAe;EACnE,MAAM,EAAE,sBAAU,oBAAS,6BACzB,+BAA+B,KAAK;AACtC,SAAO;GAAE;GAAU;GAAS;GAAY;GACxC;CAIF,MAAM,wBAAwB,mBAE1B,SACA,aACG;AACH,YAAU,cAAc;GACtB,MAAM,EAAE,sBAAU,oBAAS,6BACzB,SAAS,gBACP,QAAQ,SAAS,eACjB,QAAQ,YACR,UAAU,SACX,IAAI,EAAE;AACT,OAAIA,cAAY,QAAQC,aAAW,QAAQC,gBAAc,KACvD,QAAO;OAEP,QAAO;IAAE;IAAU;IAAS;IAAY;IAE1C;GAEL;CACD,MAAM,cAAc,WAAW,kBAAkB;CACjD,MAAM,cAAc,OAAgD,KAAK;CACzE,MAAM,MAAM,mBAAmB,kBAAsC;AACnE,MAAI,iBAAiB,MAAM;AACzB,OAAI,YAAY,WAAW,KACzB,OAAM,IAAI,MACR,yFACD;AAEH,eAAY,UAAU,IAAIC,eACxB,uBACE,SACA,uBACA,oBACA,uBACD,EACD,aACA,KACD;AACD,GAAK,YAAY,QAAQ,QAAQ;IAC/B;IACA;IACA;IACA;IACA;IACA;IACD,CAAC;SACG;AACL,OAAI,YAAY,WAAW,KACzB,OAAM,IAAI,MACR,oFACD;AAEH,eAAY,QAAQ,SAAS;AAC7B,eAAY,UAAU;;GAExB;AAEF,0BAAyB;AACvB,MAAI,YAAY,WAAW,KAAM;EACjC,MAAM,WAAW,YAAY;EAC7B,MAAM,aAAa,uBACjB,SACA,uBACA,oBACA,uBACD;EACD,MAAM,cAAc,CAAC,gBAAgB,SAAS,SAAS,WAAW;AAClE,WAAS,WAAW,WAAW;AAC/B,EAAK,SAAS,OAAO;GACnB;GACA;GACA;GACA;GACA;GACD,CAAC;AACF,MAAI,kBAAkB,OACpB,UAAS,iBAAiB,cAAc;GAE1C;AAYF,QAAO;EAAE;EAAK,gBAVS,kBAEN;AACf,UAAO,YAAY,SAAS,gBAAgB;KAC3C,EAAE,CAAC;EAMwB;EAAU;EAAS;EAAY,aAJzC,kBAAkB;AACpC,UAAO,YAAY,WAAW;KAC7B,EAAE,CAAC;EAEoE;;AAG5E,SAAS,uBACP,SACA,uBACA,oBACA,wBACoC;AACpC,QAAO;EACL,GAAG;EACH;EACA,gBACE,SAAS,mBAAmB,WACxB,aACA,SAAS;EAEf,0BACE,sBAAsB,SAAS,6BAA6B,WACxD,aACA,SAAS;EACf,qBAAqB,yBAAyB,aAAa;EAC5D"}
@@ -30,13 +30,21 @@ interface RenderedLineContext {
30
30
  deletionLine?: DiffLineMetadata;
31
31
  additionLine?: DiffLineMetadata;
32
32
  }
33
- interface InlineRow {
33
+ interface InjectedRow {
34
34
  content: Element;
35
35
  gutter: Element;
36
36
  }
37
- interface SplitInlineRow {
38
- deletion: InlineRow | undefined;
39
- addition: InlineRow | undefined;
37
+ interface SplitInjectedRow {
38
+ deletion: InjectedRow | undefined;
39
+ addition: InjectedRow | undefined;
40
+ }
41
+ interface UnifiedInjectedRowPlacement {
42
+ before?: InjectedRow[];
43
+ after?: InjectedRow[];
44
+ }
45
+ interface SplitInjectedRowPlacement {
46
+ before?: SplitInjectedRow[];
47
+ after?: SplitInjectedRow[];
40
48
  }
41
49
  interface HunksRenderResult {
42
50
  unifiedGutterAST: ElementContent[] | undefined;
@@ -86,8 +94,8 @@ declare class DiffHunksRenderer<LAnnotation = undefined> {
86
94
  type
87
95
  }: SplitLineDecorationProps): LineDecoration;
88
96
  protected createAnnotationElement(span: AnnotationSpan): Element;
89
- protected getUnifiedInlineRowsForLine?: (ctx: RenderedLineContext) => InlineRow[] | undefined;
90
- protected getSplitInlineRowsForLine?: (ctx: RenderedLineContext) => SplitInlineRow[] | undefined;
97
+ protected getUnifiedInjectedRowsForLine?: (ctx: RenderedLineContext) => UnifiedInjectedRowPlacement | undefined;
98
+ protected getSplitInjectedRowsForLine?: (ctx: RenderedLineContext) => SplitInjectedRowPlacement | undefined;
91
99
  protected getOptionsWithDefaults(): BaseDiffOptionsWithDefaults;
92
100
  private initializeHighlighter;
93
101
  hydrate(diff: FileDiffMetadata | undefined): void;
@@ -108,5 +116,5 @@ declare class DiffHunksRenderer<LAnnotation = undefined> {
108
116
  private renderHeader;
109
117
  }
110
118
  //#endregion
111
- export { DiffHunksRenderer, HunksRenderResult, InlineRow, LineDecoration, RenderedLineContext, SplitInlineRow, SplitLineDecorationProps, UnifiedLineDecorationProps };
119
+ export { DiffHunksRenderer, HunksRenderResult, InjectedRow, LineDecoration, RenderedLineContext, SplitInjectedRow, SplitInjectedRowPlacement, SplitLineDecorationProps, UnifiedInjectedRowPlacement, UnifiedLineDecorationProps };
112
120
  //# sourceMappingURL=DiffHunksRenderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DiffHunksRenderer.d.ts","names":["ElementContent","Element","HASTElement","Properties","AnnotationSpan","BaseDiffOptions","BaseDiffOptionsWithDefaults","CustomPreProperties","DiffLineAnnotation","ExpansionDirections","FileDiffMetadata","HunkData","HunkExpansionRegion","LineTypes","RenderDiffOptions","RenderRange","ThemedDiffResult","ThemeTypes","DiffLineMetadata","WorkerPoolManager","UnifiedLineDecorationProps","SplitLineDecorationProps","LineDecoration","RenderedLineContext","InlineRow","SplitInlineRow","HunksRenderResult","DiffHunksRenderer","LAnnotation","Map","lineType","side","type","Promise"],"sources":["../../src/renderers/DiffHunksRenderer.d.ts"],"sourcesContent":["import type { ElementContent, Element as HASTElement, Properties } from 'hast';\nimport type { AnnotationSpan, BaseDiffOptions, BaseDiffOptionsWithDefaults, CustomPreProperties, DiffLineAnnotation, ExpansionDirections, FileDiffMetadata, HunkData, HunkExpansionRegion, LineTypes, RenderDiffOptions, RenderRange, ThemedDiffResult, ThemeTypes } from '../types';\nimport type { DiffLineMetadata } from '../utils/iterateOverDiff';\nimport type { WorkerPoolManager } from '../worker';\nexport interface UnifiedLineDecorationProps {\n type: 'context' | 'context-expanded' | 'change';\n lineType: LineTypes;\n additionLineIndex: number | undefined;\n deletionLineIndex: number | undefined;\n}\nexport interface SplitLineDecorationProps {\n side: 'deletions' | 'additions';\n type: 'context' | 'context-expanded' | 'change';\n lineIndex: number | undefined;\n}\nexport interface LineDecoration {\n gutterLineType: LineTypes;\n gutterProperties?: Properties;\n contentProperties?: Properties;\n}\nexport interface RenderedLineContext {\n type: 'context' | 'context-expanded' | 'change';\n hunkIndex: number;\n lineIndex: number;\n unifiedLineIndex: number;\n splitLineIndex: number;\n deletionLine?: DiffLineMetadata;\n additionLine?: DiffLineMetadata;\n}\nexport interface InlineRow {\n content: HASTElement;\n gutter: HASTElement;\n}\nexport interface SplitInlineRow {\n deletion: InlineRow | undefined;\n addition: InlineRow | undefined;\n}\nexport interface HunksRenderResult {\n unifiedGutterAST: ElementContent[] | undefined;\n unifiedContentAST: ElementContent[] | undefined;\n deletionsGutterAST: ElementContent[] | undefined;\n deletionsContentAST: ElementContent[] | undefined;\n additionsGutterAST: ElementContent[] | undefined;\n additionsContentAST: ElementContent[] | undefined;\n hunkData: HunkData[];\n css: string;\n preNode: HASTElement;\n headerElement: HASTElement | undefined;\n totalLines: number;\n themeStyles: string;\n baseThemeType: 'light' | 'dark' | undefined;\n rowCount: number;\n bufferBefore: number;\n bufferAfter: number;\n}\nexport declare class DiffHunksRenderer<LAnnotation = undefined> {\n options: BaseDiffOptions;\n private onRenderUpdate?;\n private workerManager?;\n readonly __id: string;\n private highlighter;\n private diff;\n private expandedHunks;\n private deletionAnnotations;\n private additionAnnotations;\n private computedLang;\n private renderCache;\n constructor(options?: BaseDiffOptions, onRenderUpdate?: (() => unknown) | undefined, workerManager?: WorkerPoolManager | undefined);\n cleanUp(): void;\n recycle(): void;\n setOptions(options: BaseDiffOptions): void;\n private mergeOptions;\n setThemeType(themeType: ThemeTypes): void;\n expandHunk(index: number, direction: ExpansionDirections, expansionLineCount?: number): void;\n getExpandedHunk(hunkIndex: number): HunkExpansionRegion;\n getExpandedHunksMap(): Map<number, HunkExpansionRegion>;\n setLineAnnotations(lineAnnotations: DiffLineAnnotation<LAnnotation>[]): void;\n protected getUnifiedLineDecoration({ lineType }: UnifiedLineDecorationProps): LineDecoration;\n protected getSplitLineDecoration({ side, type }: SplitLineDecorationProps): LineDecoration;\n protected createAnnotationElement(span: AnnotationSpan): HASTElement;\n protected getUnifiedInlineRowsForLine?: (ctx: RenderedLineContext) => InlineRow[] | undefined;\n protected getSplitInlineRowsForLine?: (ctx: RenderedLineContext) => SplitInlineRow[] | undefined;\n protected getOptionsWithDefaults(): BaseDiffOptionsWithDefaults;\n private initializeHighlighter;\n hydrate(diff: FileDiffMetadata | undefined): void;\n private getRenderOptions;\n renderDiff(diff?: FileDiffMetadata | undefined, renderRange?: RenderRange): HunksRenderResult | undefined;\n asyncRender(diff: FileDiffMetadata, renderRange?: RenderRange): Promise<HunksRenderResult>;\n protected createPreElement(split: boolean, totalLines: number, themeStyles: string, baseThemeType: 'light' | 'dark' | undefined, customProperties?: CustomPreProperties): HASTElement;\n private asyncHighlight;\n private renderDiffWithHighlighter;\n onHighlightSuccess(diff: FileDiffMetadata, result: ThemedDiffResult, options: RenderDiffOptions): void;\n onHighlightError(error: unknown): void;\n private processDiffResult;\n renderCodeAST(type: 'unified' | 'deletions' | 'additions', result: HunksRenderResult): ElementContent[] | undefined;\n renderFullAST(result: HunksRenderResult, children?: ElementContent[]): HASTElement;\n renderFullHTML(result: HunksRenderResult, tempChildren?: ElementContent[]): string;\n renderPartialHTML(children: ElementContent[], columnType?: 'unified' | 'deletions' | 'additions'): string;\n private getAnnotations;\n private renderHeader;\n}\n//# sourceMappingURL=DiffHunksRenderer.d.ts.map"],"mappings":"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"}
1
+ {"version":3,"file":"DiffHunksRenderer.d.ts","names":["ElementContent","Element","HASTElement","Properties","AnnotationSpan","BaseDiffOptions","BaseDiffOptionsWithDefaults","CustomPreProperties","DiffLineAnnotation","ExpansionDirections","FileDiffMetadata","HunkData","HunkExpansionRegion","LineTypes","RenderDiffOptions","RenderRange","ThemedDiffResult","ThemeTypes","DiffLineMetadata","WorkerPoolManager","UnifiedLineDecorationProps","SplitLineDecorationProps","LineDecoration","RenderedLineContext","InjectedRow","SplitInjectedRow","UnifiedInjectedRowPlacement","SplitInjectedRowPlacement","HunksRenderResult","DiffHunksRenderer","LAnnotation","Map","lineType","side","type","Promise"],"sources":["../../src/renderers/DiffHunksRenderer.d.ts"],"sourcesContent":["import type { ElementContent, Element as HASTElement, Properties } from 'hast';\nimport type { AnnotationSpan, BaseDiffOptions, BaseDiffOptionsWithDefaults, CustomPreProperties, DiffLineAnnotation, ExpansionDirections, FileDiffMetadata, HunkData, HunkExpansionRegion, LineTypes, RenderDiffOptions, RenderRange, ThemedDiffResult, ThemeTypes } from '../types';\nimport type { DiffLineMetadata } from '../utils/iterateOverDiff';\nimport type { WorkerPoolManager } from '../worker';\nexport interface UnifiedLineDecorationProps {\n type: 'context' | 'context-expanded' | 'change';\n lineType: LineTypes;\n additionLineIndex: number | undefined;\n deletionLineIndex: number | undefined;\n}\nexport interface SplitLineDecorationProps {\n side: 'deletions' | 'additions';\n type: 'context' | 'context-expanded' | 'change';\n lineIndex: number | undefined;\n}\nexport interface LineDecoration {\n gutterLineType: LineTypes;\n gutterProperties?: Properties;\n contentProperties?: Properties;\n}\nexport interface RenderedLineContext {\n type: 'context' | 'context-expanded' | 'change';\n hunkIndex: number;\n lineIndex: number;\n unifiedLineIndex: number;\n splitLineIndex: number;\n deletionLine?: DiffLineMetadata;\n additionLine?: DiffLineMetadata;\n}\nexport interface InjectedRow {\n content: HASTElement;\n gutter: HASTElement;\n}\nexport interface SplitInjectedRow {\n deletion: InjectedRow | undefined;\n addition: InjectedRow | undefined;\n}\nexport interface UnifiedInjectedRowPlacement {\n before?: InjectedRow[];\n after?: InjectedRow[];\n}\nexport interface SplitInjectedRowPlacement {\n before?: SplitInjectedRow[];\n after?: SplitInjectedRow[];\n}\nexport interface HunksRenderResult {\n unifiedGutterAST: ElementContent[] | undefined;\n unifiedContentAST: ElementContent[] | undefined;\n deletionsGutterAST: ElementContent[] | undefined;\n deletionsContentAST: ElementContent[] | undefined;\n additionsGutterAST: ElementContent[] | undefined;\n additionsContentAST: ElementContent[] | undefined;\n hunkData: HunkData[];\n css: string;\n preNode: HASTElement;\n headerElement: HASTElement | undefined;\n totalLines: number;\n themeStyles: string;\n baseThemeType: 'light' | 'dark' | undefined;\n rowCount: number;\n bufferBefore: number;\n bufferAfter: number;\n}\nexport declare class DiffHunksRenderer<LAnnotation = undefined> {\n options: BaseDiffOptions;\n private onRenderUpdate?;\n private workerManager?;\n readonly __id: string;\n private highlighter;\n private diff;\n private expandedHunks;\n private deletionAnnotations;\n private additionAnnotations;\n private computedLang;\n private renderCache;\n constructor(options?: BaseDiffOptions, onRenderUpdate?: (() => unknown) | undefined, workerManager?: WorkerPoolManager | undefined);\n cleanUp(): void;\n recycle(): void;\n setOptions(options: BaseDiffOptions): void;\n private mergeOptions;\n setThemeType(themeType: ThemeTypes): void;\n expandHunk(index: number, direction: ExpansionDirections, expansionLineCount?: number): void;\n getExpandedHunk(hunkIndex: number): HunkExpansionRegion;\n getExpandedHunksMap(): Map<number, HunkExpansionRegion>;\n setLineAnnotations(lineAnnotations: DiffLineAnnotation<LAnnotation>[]): void;\n protected getUnifiedLineDecoration({ lineType }: UnifiedLineDecorationProps): LineDecoration;\n protected getSplitLineDecoration({ side, type }: SplitLineDecorationProps): LineDecoration;\n protected createAnnotationElement(span: AnnotationSpan): HASTElement;\n protected getUnifiedInjectedRowsForLine?: (ctx: RenderedLineContext) => UnifiedInjectedRowPlacement | undefined;\n protected getSplitInjectedRowsForLine?: (ctx: RenderedLineContext) => SplitInjectedRowPlacement | undefined;\n protected getOptionsWithDefaults(): BaseDiffOptionsWithDefaults;\n private initializeHighlighter;\n hydrate(diff: FileDiffMetadata | undefined): void;\n private getRenderOptions;\n renderDiff(diff?: FileDiffMetadata | undefined, renderRange?: RenderRange): HunksRenderResult | undefined;\n asyncRender(diff: FileDiffMetadata, renderRange?: RenderRange): Promise<HunksRenderResult>;\n protected createPreElement(split: boolean, totalLines: number, themeStyles: string, baseThemeType: 'light' | 'dark' | undefined, customProperties?: CustomPreProperties): HASTElement;\n private asyncHighlight;\n private renderDiffWithHighlighter;\n onHighlightSuccess(diff: FileDiffMetadata, result: ThemedDiffResult, options: RenderDiffOptions): void;\n onHighlightError(error: unknown): void;\n private processDiffResult;\n renderCodeAST(type: 'unified' | 'deletions' | 'additions', result: HunksRenderResult): ElementContent[] | undefined;\n renderFullAST(result: HunksRenderResult, children?: ElementContent[]): HASTElement;\n renderFullHTML(result: HunksRenderResult, tempChildren?: ElementContent[]): string;\n renderPartialHTML(children: ElementContent[], columnType?: 'unified' | 'deletions' | 'additions'): string;\n private getAnnotations;\n private renderHeader;\n}\n//# sourceMappingURL=DiffHunksRenderer.d.ts.map"],"mappings":"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"}