@pierre/diffs 1.1.0-beta.9 → 1.1.1

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 (219) hide show
  1. package/README.md +7 -18
  2. package/dist/components/AdvancedVirtualizedFileDiff.js +2 -7
  3. package/dist/components/AdvancedVirtualizedFileDiff.js.map +1 -1
  4. package/dist/components/AdvancedVirtualizer.js +1 -1
  5. package/dist/components/AdvancedVirtualizer.js.map +1 -1
  6. package/dist/components/File.d.ts +18 -8
  7. package/dist/components/File.d.ts.map +1 -1
  8. package/dist/components/File.js +111 -54
  9. package/dist/components/File.js.map +1 -1
  10. package/dist/components/FileDiff.d.ts +33 -15
  11. package/dist/components/FileDiff.d.ts.map +1 -1
  12. package/dist/components/FileDiff.js +156 -81
  13. package/dist/components/FileDiff.js.map +1 -1
  14. package/dist/components/UnresolvedFile.d.ts +60 -0
  15. package/dist/components/UnresolvedFile.d.ts.map +1 -0
  16. package/dist/components/UnresolvedFile.js +280 -0
  17. package/dist/components/UnresolvedFile.js.map +1 -0
  18. package/dist/components/VirtualizedFile.js +8 -5
  19. package/dist/components/VirtualizedFile.js.map +1 -1
  20. package/dist/components/VirtualizedFileDiff.d.ts +1 -1
  21. package/dist/components/VirtualizedFileDiff.d.ts.map +1 -1
  22. package/dist/components/VirtualizedFileDiff.js +15 -11
  23. package/dist/components/VirtualizedFileDiff.js.map +1 -1
  24. package/dist/components/Virtualizer.d.ts +3 -1
  25. package/dist/components/Virtualizer.d.ts.map +1 -1
  26. package/dist/components/Virtualizer.js +50 -24
  27. package/dist/components/Virtualizer.js.map +1 -1
  28. package/dist/constants.d.ts +3 -1
  29. package/dist/constants.d.ts.map +1 -1
  30. package/dist/constants.js +8 -1
  31. package/dist/constants.js.map +1 -1
  32. package/dist/highlighter/shared_highlighter.d.ts +4 -2
  33. package/dist/highlighter/shared_highlighter.d.ts.map +1 -1
  34. package/dist/highlighter/shared_highlighter.js +15 -7
  35. package/dist/highlighter/shared_highlighter.js.map +1 -1
  36. package/dist/index.d.ts +9 -7
  37. package/dist/index.js +8 -6
  38. package/dist/managers/InteractionManager.d.ts +146 -0
  39. package/dist/managers/InteractionManager.d.ts.map +1 -0
  40. package/dist/managers/InteractionManager.js +813 -0
  41. package/dist/managers/InteractionManager.js.map +1 -0
  42. package/dist/managers/ResizeManager.d.ts +0 -2
  43. package/dist/managers/ResizeManager.d.ts.map +1 -1
  44. package/dist/managers/ResizeManager.js +43 -32
  45. package/dist/managers/ResizeManager.js.map +1 -1
  46. package/dist/react/File.d.ts +2 -0
  47. package/dist/react/File.d.ts.map +1 -1
  48. package/dist/react/File.js +5 -2
  49. package/dist/react/File.js.map +1 -1
  50. package/dist/react/FileDiff.d.ts +2 -0
  51. package/dist/react/FileDiff.d.ts.map +1 -1
  52. package/dist/react/FileDiff.js +5 -2
  53. package/dist/react/FileDiff.js.map +1 -1
  54. package/dist/react/MultiFileDiff.d.ts +2 -0
  55. package/dist/react/MultiFileDiff.d.ts.map +1 -1
  56. package/dist/react/MultiFileDiff.js +5 -2
  57. package/dist/react/MultiFileDiff.js.map +1 -1
  58. package/dist/react/PatchDiff.d.ts +2 -0
  59. package/dist/react/PatchDiff.d.ts.map +1 -1
  60. package/dist/react/PatchDiff.js +5 -2
  61. package/dist/react/PatchDiff.js.map +1 -1
  62. package/dist/react/UnresolvedFile.d.ts +36 -0
  63. package/dist/react/UnresolvedFile.d.ts.map +1 -0
  64. package/dist/react/UnresolvedFile.js +43 -0
  65. package/dist/react/UnresolvedFile.js.map +1 -0
  66. package/dist/react/constants.d.ts +4 -2
  67. package/dist/react/constants.d.ts.map +1 -1
  68. package/dist/react/constants.js +6 -2
  69. package/dist/react/constants.js.map +1 -1
  70. package/dist/react/index.d.ts +4 -3
  71. package/dist/react/index.js +3 -2
  72. package/dist/react/jsx.d.ts.map +1 -1
  73. package/dist/react/types.d.ts +11 -2
  74. package/dist/react/types.d.ts.map +1 -1
  75. package/dist/react/utils/renderDiffChildren.d.ts +16 -5
  76. package/dist/react/utils/renderDiffChildren.d.ts.map +1 -1
  77. package/dist/react/utils/renderDiffChildren.js +34 -7
  78. package/dist/react/utils/renderDiffChildren.js.map +1 -1
  79. package/dist/react/utils/renderFileChildren.d.ts +5 -1
  80. package/dist/react/utils/renderFileChildren.d.ts.map +1 -1
  81. package/dist/react/utils/renderFileChildren.js +13 -7
  82. package/dist/react/utils/renderFileChildren.js.map +1 -1
  83. package/dist/react/utils/useFileDiffInstance.d.ts +4 -3
  84. package/dist/react/utils/useFileDiffInstance.d.ts.map +1 -1
  85. package/dist/react/utils/useFileDiffInstance.js +16 -7
  86. package/dist/react/utils/useFileDiffInstance.js.map +1 -1
  87. package/dist/react/utils/useFileInstance.d.ts +4 -3
  88. package/dist/react/utils/useFileInstance.d.ts.map +1 -1
  89. package/dist/react/utils/useFileInstance.js +14 -5
  90. package/dist/react/utils/useFileInstance.js.map +1 -1
  91. package/dist/react/utils/useUnresolvedFileInstance.d.ts +35 -0
  92. package/dist/react/utils/useUnresolvedFileInstance.d.ts.map +1 -0
  93. package/dist/react/utils/useUnresolvedFileInstance.js +88 -0
  94. package/dist/react/utils/useUnresolvedFileInstance.js.map +1 -0
  95. package/dist/renderers/DiffHunksRenderer.d.ts +50 -6
  96. package/dist/renderers/DiffHunksRenderer.d.ts.map +1 -1
  97. package/dist/renderers/DiffHunksRenderer.js +145 -45
  98. package/dist/renderers/DiffHunksRenderer.js.map +1 -1
  99. package/dist/renderers/FileRenderer.js +1 -1
  100. package/dist/renderers/UnresolvedFileHunksRenderer.d.ts +46 -0
  101. package/dist/renderers/UnresolvedFileHunksRenderer.d.ts.map +1 -0
  102. package/dist/renderers/UnresolvedFileHunksRenderer.js +207 -0
  103. package/dist/renderers/UnresolvedFileHunksRenderer.js.map +1 -0
  104. package/dist/shiki-stream/stream.d.ts +1 -1
  105. package/dist/shiki-stream/stream.d.ts.map +1 -1
  106. package/dist/shiki-stream/stream.js.map +1 -1
  107. package/dist/shiki-stream/tokenizer.d.ts +1 -1
  108. package/dist/shiki-stream/tokenizer.d.ts.map +1 -1
  109. package/dist/shiki-stream/tokenizer.js.map +1 -1
  110. package/dist/shiki-stream/types.d.ts +1 -1
  111. package/dist/shiki-stream/types.d.ts.map +1 -1
  112. package/dist/sprite.d.ts +2 -2
  113. package/dist/sprite.d.ts.map +1 -1
  114. package/dist/sprite.js +3 -0
  115. package/dist/sprite.js.map +1 -1
  116. package/dist/ssr/index.d.ts +3 -3
  117. package/dist/ssr/index.js +2 -2
  118. package/dist/ssr/preloadDiffs.d.ts +23 -14
  119. package/dist/ssr/preloadDiffs.d.ts.map +1 -1
  120. package/dist/ssr/preloadDiffs.js +40 -14
  121. package/dist/ssr/preloadDiffs.js.map +1 -1
  122. package/dist/style.js +1 -1
  123. package/dist/style.js.map +1 -1
  124. package/dist/types.d.ts +29 -2
  125. package/dist/types.d.ts.map +1 -1
  126. package/dist/utils/areMergeConflictActionsEqual.d.ts +7 -0
  127. package/dist/utils/areMergeConflictActionsEqual.d.ts.map +1 -0
  128. package/dist/utils/areMergeConflictActionsEqual.js +11 -0
  129. package/dist/utils/areMergeConflictActionsEqual.js.map +1 -0
  130. package/dist/utils/arePrePropertiesEqual.js +10 -1
  131. package/dist/utils/arePrePropertiesEqual.js.map +1 -1
  132. package/dist/utils/areSelectionPointsEqual.d.ts +7 -0
  133. package/dist/utils/areSelectionPointsEqual.d.ts.map +1 -0
  134. package/dist/utils/areSelectionPointsEqual.js +8 -0
  135. package/dist/utils/areSelectionPointsEqual.js.map +1 -0
  136. package/dist/utils/areSelectionsEqual.d.ts +1 -1
  137. package/dist/utils/areSelectionsEqual.d.ts.map +1 -1
  138. package/dist/utils/areSelectionsEqual.js.map +1 -1
  139. package/dist/utils/createFileHeaderElement.js +5 -2
  140. package/dist/utils/createFileHeaderElement.js.map +1 -1
  141. package/dist/utils/createGutterUtilityContentNode.d.ts +5 -0
  142. package/dist/utils/createGutterUtilityContentNode.d.ts.map +1 -0
  143. package/dist/utils/createGutterUtilityContentNode.js +15 -0
  144. package/dist/utils/createGutterUtilityContentNode.js.map +1 -0
  145. package/dist/utils/createGutterUtilityElement.d.ts +7 -0
  146. package/dist/utils/createGutterUtilityElement.d.ts.map +1 -0
  147. package/dist/utils/createGutterUtilityElement.js +20 -0
  148. package/dist/utils/createGutterUtilityElement.js.map +1 -0
  149. package/dist/utils/createPreElement.d.ts +2 -1
  150. package/dist/utils/createPreElement.d.ts.map +1 -1
  151. package/dist/utils/createPreElement.js +2 -1
  152. package/dist/utils/createPreElement.js.map +1 -1
  153. package/dist/utils/createSeparator.js +1 -1
  154. package/dist/utils/createSeparator.js.map +1 -1
  155. package/dist/utils/createWindowFromScrollPosition.js +12 -11
  156. package/dist/utils/createWindowFromScrollPosition.js.map +1 -1
  157. package/dist/utils/getHighlighterOptions.d.ts +7 -2
  158. package/dist/utils/getHighlighterOptions.d.ts.map +1 -1
  159. package/dist/utils/getHighlighterOptions.js +3 -2
  160. package/dist/utils/getHighlighterOptions.js.map +1 -1
  161. package/dist/utils/getMergeConflictActionSlotName.d.ts +16 -0
  162. package/dist/utils/getMergeConflictActionSlotName.d.ts.map +1 -0
  163. package/dist/utils/getMergeConflictActionSlotName.js +8 -0
  164. package/dist/utils/getMergeConflictActionSlotName.js.map +1 -0
  165. package/dist/utils/getMergeConflictLineTypes.d.ts +15 -0
  166. package/dist/utils/getMergeConflictLineTypes.d.ts.map +1 -0
  167. package/dist/utils/getMergeConflictLineTypes.js +81 -0
  168. package/dist/utils/getMergeConflictLineTypes.js.map +1 -0
  169. package/dist/utils/getOrCreateCodeNode.d.ts +3 -1
  170. package/dist/utils/getOrCreateCodeNode.d.ts.map +1 -1
  171. package/dist/utils/getOrCreateCodeNode.js +5 -3
  172. package/dist/utils/getOrCreateCodeNode.js.map +1 -1
  173. package/dist/utils/hast_utils.d.ts +2 -2
  174. package/dist/utils/hast_utils.d.ts.map +1 -1
  175. package/dist/utils/hast_utils.js +3 -2
  176. package/dist/utils/hast_utils.js.map +1 -1
  177. package/dist/utils/parseMergeConflictDiffFromFile.d.ts +26 -0
  178. package/dist/utils/parseMergeConflictDiffFromFile.d.ts.map +1 -0
  179. package/dist/utils/parseMergeConflictDiffFromFile.js +143 -0
  180. package/dist/utils/parseMergeConflictDiffFromFile.js.map +1 -0
  181. package/dist/utils/resolveMergeConflict.d.ts +7 -0
  182. package/dist/utils/resolveMergeConflict.d.ts.map +1 -0
  183. package/dist/utils/resolveMergeConflict.js +30 -0
  184. package/dist/utils/resolveMergeConflict.js.map +1 -0
  185. package/dist/utils/resolveVirtualFileMetrics.js +1 -0
  186. package/dist/utils/resolveVirtualFileMetrics.js.map +1 -1
  187. package/dist/utils/setWrapperNodeProps.d.ts +2 -1
  188. package/dist/utils/setWrapperNodeProps.d.ts.map +1 -1
  189. package/dist/utils/setWrapperNodeProps.js +5 -1
  190. package/dist/utils/setWrapperNodeProps.js.map +1 -1
  191. package/dist/worker/WorkerPoolManager.d.ts +4 -2
  192. package/dist/worker/WorkerPoolManager.d.ts.map +1 -1
  193. package/dist/worker/WorkerPoolManager.js +16 -9
  194. package/dist/worker/WorkerPoolManager.js.map +1 -1
  195. package/dist/worker/types.d.ts +3 -1
  196. package/dist/worker/types.d.ts.map +1 -1
  197. package/dist/worker/wasm-BlUZCxHM.js +10 -0
  198. package/dist/worker/wasm-BlUZCxHM.js.map +1 -0
  199. package/dist/worker/worker-portable.js +10546 -10106
  200. package/dist/worker/worker-portable.js.map +1 -1
  201. package/dist/worker/worker.js +27 -19
  202. package/dist/worker/worker.js.map +1 -1
  203. package/package.json +3 -7
  204. package/dist/managers/LineSelectionManager.d.ts +0 -64
  205. package/dist/managers/LineSelectionManager.d.ts.map +0 -1
  206. package/dist/managers/LineSelectionManager.js +0 -270
  207. package/dist/managers/LineSelectionManager.js.map +0 -1
  208. package/dist/managers/MouseEventManager.d.ts +0 -71
  209. package/dist/managers/MouseEventManager.d.ts.map +0 -1
  210. package/dist/managers/MouseEventManager.js +0 -358
  211. package/dist/managers/MouseEventManager.js.map +0 -1
  212. package/dist/themes/pierre-dark.js +0 -1328
  213. package/dist/themes/pierre-dark.js.map +0 -1
  214. package/dist/themes/pierre-light.js +0 -1328
  215. package/dist/themes/pierre-light.js.map +0 -1
  216. package/dist/utils/createHoverContentNode.d.ts +0 -5
  217. package/dist/utils/createHoverContentNode.d.ts.map +0 -1
  218. package/dist/utils/createHoverContentNode.js +0 -15
  219. package/dist/utils/createHoverContentNode.js.map +0 -1
@@ -1,6 +1,7 @@
1
1
  import { FileDiff } from "../../components/FileDiff.js";
2
2
  import { VirtualizedFileDiff } from "../../components/VirtualizedFileDiff.js";
3
3
  import { areOptionsEqual } from "../../utils/areOptionsEqual.js";
4
+ import { noopRender } from "../constants.js";
4
5
  import { useVirtualizer } from "../Virtualizer.js";
5
6
  import { WorkerPoolContext } from "../WorkerPoolContext.js";
6
7
  import { useStableCallback } from "./useStableCallback.js";
@@ -8,15 +9,15 @@ import { useCallback, useContext, useEffect, useLayoutEffect, useRef } from "rea
8
9
 
9
10
  //#region src/react/utils/useFileDiffInstance.ts
10
11
  const useIsometricEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
11
- function useFileDiffInstance({ oldFile, newFile, fileDiff, options, lineAnnotations, selectedLines, prerenderedHTML, metrics }) {
12
+ function useFileDiffInstance({ oldFile, newFile, fileDiff, options, lineAnnotations, selectedLines, prerenderedHTML, metrics, hasGutterRenderUtility }) {
12
13
  const simpleVirtualizer = useVirtualizer();
13
14
  const poolManager = useContext(WorkerPoolContext);
14
15
  const instanceRef = useRef(null);
15
16
  const ref = useStableCallback((fileContainer) => {
16
17
  if (fileContainer != null) {
17
18
  if (instanceRef.current != null) throw new Error("useFileDiffInstance: An instance should not already exist when a node is created");
18
- if (simpleVirtualizer != null) instanceRef.current = new VirtualizedFileDiff(options, simpleVirtualizer, metrics, poolManager, true);
19
- else instanceRef.current = new FileDiff(options, poolManager, true);
19
+ if (simpleVirtualizer != null) instanceRef.current = new VirtualizedFileDiff(mergeFileDiffOptions(options, hasGutterRenderUtility), simpleVirtualizer, metrics, poolManager, true);
20
+ else instanceRef.current = new FileDiff(mergeFileDiffOptions(options, hasGutterRenderUtility), poolManager, true);
20
21
  instanceRef.current.hydrate({
21
22
  fileDiff,
22
23
  oldFile,
@@ -32,10 +33,11 @@ function useFileDiffInstance({ oldFile, newFile, fileDiff, options, lineAnnotati
32
33
  }
33
34
  });
34
35
  useIsometricEffect(() => {
35
- if (instanceRef.current == null) return;
36
- const instance = instanceRef.current;
37
- const forceRender = !areOptionsEqual(instance.options, options);
38
- instance.setOptions(options);
36
+ const { current: instance } = instanceRef;
37
+ if (instance == null) return;
38
+ const newOptions = mergeFileDiffOptions(options, hasGutterRenderUtility);
39
+ const forceRender = !areOptionsEqual(instance.options, newOptions);
40
+ instance.setOptions(newOptions);
39
41
  instance.render({
40
42
  forceRender,
41
43
  fileDiff,
@@ -52,6 +54,13 @@ function useFileDiffInstance({ oldFile, newFile, fileDiff, options, lineAnnotati
52
54
  }, [])
53
55
  };
54
56
  }
57
+ function mergeFileDiffOptions(options, hasGutterRenderUtility) {
58
+ if (hasGutterRenderUtility) return {
59
+ ...options,
60
+ renderGutterUtility: noopRender
61
+ };
62
+ return options;
63
+ }
55
64
 
56
65
  //#endregion
57
66
  export { useFileDiffInstance };
@@ -1 +1 @@
1
- {"version":3,"file":"useFileDiffInstance.js","names":[],"sources":["../../../src/react/utils/useFileDiffInstance.ts"],"sourcesContent":["import {\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n} from 'react';\n\nimport { FileDiff, type FileDiffOptions } from '../../components/FileDiff';\nimport { VirtualizedFileDiff } from '../../components/VirtualizedFileDiff';\nimport type { SelectedLineRange } from '../../managers/LineSelectionManager';\nimport type { GetHoveredLineResult } from '../../managers/MouseEventManager';\nimport type {\n DiffLineAnnotation,\n FileContents,\n FileDiffMetadata,\n VirtualFileMetrics,\n} from '../../types';\nimport { areOptionsEqual } from '../../utils/areOptionsEqual';\nimport { useVirtualizer } from '../Virtualizer';\nimport { WorkerPoolContext } from '../WorkerPoolContext';\nimport { useStableCallback } from './useStableCallback';\n\nconst useIsometricEffect =\n typeof window === 'undefined' ? useEffect : useLayoutEffect;\n\ninterface UseFileDiffInstanceProps<LAnnotation> {\n oldFile?: FileContents;\n newFile?: FileContents;\n fileDiff?: FileDiffMetadata;\n options: FileDiffOptions<LAnnotation> | undefined;\n lineAnnotations: DiffLineAnnotation<LAnnotation>[] | undefined;\n selectedLines: SelectedLineRange | null | undefined;\n prerenderedHTML: string | undefined;\n metrics?: VirtualFileMetrics;\n}\n\ninterface UseFileDiffInstanceReturn {\n ref(node: HTMLElement | null): void;\n getHoveredLine(): GetHoveredLineResult<'diff'> | undefined;\n}\n\nexport function useFileDiffInstance<LAnnotation>({\n oldFile,\n newFile,\n fileDiff,\n options,\n lineAnnotations,\n selectedLines,\n prerenderedHTML,\n metrics,\n}: UseFileDiffInstanceProps<LAnnotation>): UseFileDiffInstanceReturn {\n const simpleVirtualizer = useVirtualizer();\n const poolManager = useContext(WorkerPoolContext);\n const instanceRef = useRef<\n FileDiff<LAnnotation> | VirtualizedFileDiff<LAnnotation> | null\n >(null);\n const ref = useStableCallback((fileContainer: HTMLElement | null) => {\n if (fileContainer != null) {\n if (instanceRef.current != null) {\n throw new Error(\n 'useFileDiffInstance: An instance should not already exist when a node is created'\n );\n }\n if (simpleVirtualizer != null) {\n instanceRef.current = new VirtualizedFileDiff(\n options,\n simpleVirtualizer,\n metrics,\n poolManager,\n true\n );\n } else {\n instanceRef.current = new FileDiff(options, poolManager, true);\n }\n void instanceRef.current.hydrate({\n fileDiff,\n oldFile,\n newFile,\n fileContainer,\n lineAnnotations,\n prerenderedHTML,\n });\n } else {\n if (instanceRef.current == null) {\n throw new Error(\n 'useFileDiffInstance: A FileDiff 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 forceRender = !areOptionsEqual(instance.options, options);\n instance.setOptions(options);\n void instance.render({\n forceRender,\n fileDiff,\n oldFile,\n newFile,\n lineAnnotations,\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 return { ref, getHoveredLine };\n}\n"],"mappings":";;;;;;;;;AAuBA,MAAM,qBACJ,OAAO,WAAW,cAAc,YAAY;AAkB9C,SAAgB,oBAAiC,EAC/C,SACA,SACA,UACA,SACA,iBACA,eACA,iBACA,WACmE;CACnE,MAAM,oBAAoB,gBAAgB;CAC1C,MAAM,cAAc,WAAW,kBAAkB;CACjD,MAAM,cAAc,OAElB,KAAK;CACP,MAAM,MAAM,mBAAmB,kBAAsC;AACnE,MAAI,iBAAiB,MAAM;AACzB,OAAI,YAAY,WAAW,KACzB,OAAM,IAAI,MACR,mFACD;AAEH,OAAI,qBAAqB,KACvB,aAAY,UAAU,IAAI,oBACxB,SACA,mBACA,SACA,aACA,KACD;OAED,aAAY,UAAU,IAAI,SAAS,SAAS,aAAa,KAAK;AAEhE,GAAK,YAAY,QAAQ,QAAQ;IAC/B;IACA;IACA;IACA;IACA;IACA;IACD,CAAC;SACG;AACL,OAAI,YAAY,WAAW,KACzB,OAAM,IAAI,MACR,wEACD;AAEH,eAAY,QAAQ,SAAS;AAC7B,eAAY,UAAU;;GAExB;AAEF,0BAAyB;AACvB,MAAI,YAAY,WAAW,KAAM;EACjC,MAAM,WAAW,YAAY;EAC7B,MAAM,cAAc,CAAC,gBAAgB,SAAS,SAAS,QAAQ;AAC/D,WAAS,WAAW,QAAQ;AAC5B,EAAK,SAAS,OAAO;GACnB;GACA;GACA;GACA;GACA;GACD,CAAC;AACF,MAAI,kBAAkB,OACpB,UAAS,iBAAiB,cAAc;GAE1C;AAQF,QAAO;EAAE;EAAK,gBANS,kBAEN;AACf,UAAO,YAAY,SAAS,gBAAgB;KAC3C,EAAE,CAAC;EAEwB"}
1
+ {"version":3,"file":"useFileDiffInstance.js","names":[],"sources":["../../../src/react/utils/useFileDiffInstance.ts"],"sourcesContent":["import {\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n} from 'react';\n\nimport { FileDiff, type FileDiffOptions } from '../../components/FileDiff';\nimport { VirtualizedFileDiff } from '../../components/VirtualizedFileDiff';\nimport type {\n GetHoveredLineResult,\n SelectedLineRange,\n} from '../../managers/InteractionManager';\nimport type {\n DiffLineAnnotation,\n FileContents,\n FileDiffMetadata,\n VirtualFileMetrics,\n} from '../../types';\nimport { areOptionsEqual } from '../../utils/areOptionsEqual';\nimport { noopRender as renderGutterUtility } from '../constants';\nimport { useVirtualizer } from '../Virtualizer';\nimport { WorkerPoolContext } from '../WorkerPoolContext';\nimport { useStableCallback } from './useStableCallback';\n\nconst useIsometricEffect =\n typeof window === 'undefined' ? useEffect : useLayoutEffect;\n\ninterface UseFileDiffInstanceProps<LAnnotation> {\n oldFile?: FileContents;\n newFile?: FileContents;\n fileDiff?: FileDiffMetadata;\n options: FileDiffOptions<LAnnotation> | undefined;\n lineAnnotations: DiffLineAnnotation<LAnnotation>[] | undefined;\n selectedLines: SelectedLineRange | null | undefined;\n prerenderedHTML: string | undefined;\n metrics?: VirtualFileMetrics;\n hasGutterRenderUtility: boolean;\n}\n\ninterface UseFileDiffInstanceReturn {\n ref(node: HTMLElement | null): void;\n getHoveredLine(): GetHoveredLineResult<'diff'> | undefined;\n}\n\nexport function useFileDiffInstance<LAnnotation>({\n oldFile,\n newFile,\n fileDiff,\n options,\n lineAnnotations,\n selectedLines,\n prerenderedHTML,\n metrics,\n hasGutterRenderUtility,\n}: UseFileDiffInstanceProps<LAnnotation>): UseFileDiffInstanceReturn {\n const simpleVirtualizer = useVirtualizer();\n const poolManager = useContext(WorkerPoolContext);\n const instanceRef = useRef<\n FileDiff<LAnnotation> | VirtualizedFileDiff<LAnnotation> | null\n >(null);\n const ref = useStableCallback((fileContainer: HTMLElement | null) => {\n if (fileContainer != null) {\n if (instanceRef.current != null) {\n throw new Error(\n 'useFileDiffInstance: An instance should not already exist when a node is created'\n );\n }\n if (simpleVirtualizer != null) {\n instanceRef.current = new VirtualizedFileDiff(\n mergeFileDiffOptions(options, hasGutterRenderUtility),\n simpleVirtualizer,\n metrics,\n poolManager,\n true\n );\n } else {\n instanceRef.current = new FileDiff(\n mergeFileDiffOptions(options, hasGutterRenderUtility),\n poolManager,\n true\n );\n }\n void instanceRef.current.hydrate({\n fileDiff,\n oldFile,\n newFile,\n fileContainer,\n lineAnnotations,\n prerenderedHTML,\n });\n } else {\n if (instanceRef.current == null) {\n throw new Error(\n 'useFileDiffInstance: A FileDiff instance should exist when unmounting'\n );\n }\n instanceRef.current.cleanUp();\n instanceRef.current = null;\n }\n });\n\n useIsometricEffect(() => {\n const { current: instance } = instanceRef;\n if (instance == null) return;\n const newOptions = mergeFileDiffOptions(options, hasGutterRenderUtility);\n const forceRender = !areOptionsEqual(instance.options, newOptions);\n instance.setOptions(newOptions);\n void instance.render({\n forceRender,\n fileDiff,\n oldFile,\n newFile,\n lineAnnotations,\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 return { ref, getHoveredLine };\n}\n\nfunction mergeFileDiffOptions<LAnnotation>(\n options: FileDiffOptions<LAnnotation> | undefined,\n hasGutterRenderUtility: boolean\n): FileDiffOptions<LAnnotation> | undefined {\n if (hasGutterRenderUtility) {\n return { ...options, renderGutterUtility };\n }\n return options;\n}\n"],"mappings":";;;;;;;;;;AA0BA,MAAM,qBACJ,OAAO,WAAW,cAAc,YAAY;AAmB9C,SAAgB,oBAAiC,EAC/C,SACA,SACA,UACA,SACA,iBACA,eACA,iBACA,SACA,0BACmE;CACnE,MAAM,oBAAoB,gBAAgB;CAC1C,MAAM,cAAc,WAAW,kBAAkB;CACjD,MAAM,cAAc,OAElB,KAAK;CACP,MAAM,MAAM,mBAAmB,kBAAsC;AACnE,MAAI,iBAAiB,MAAM;AACzB,OAAI,YAAY,WAAW,KACzB,OAAM,IAAI,MACR,mFACD;AAEH,OAAI,qBAAqB,KACvB,aAAY,UAAU,IAAI,oBACxB,qBAAqB,SAAS,uBAAuB,EACrD,mBACA,SACA,aACA,KACD;OAED,aAAY,UAAU,IAAI,SACxB,qBAAqB,SAAS,uBAAuB,EACrD,aACA,KACD;AAEH,GAAK,YAAY,QAAQ,QAAQ;IAC/B;IACA;IACA;IACA;IACA;IACA;IACD,CAAC;SACG;AACL,OAAI,YAAY,WAAW,KACzB,OAAM,IAAI,MACR,wEACD;AAEH,eAAY,QAAQ,SAAS;AAC7B,eAAY,UAAU;;GAExB;AAEF,0BAAyB;EACvB,MAAM,EAAE,SAAS,aAAa;AAC9B,MAAI,YAAY,KAAM;EACtB,MAAM,aAAa,qBAAqB,SAAS,uBAAuB;EACxE,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;AAQF,QAAO;EAAE;EAAK,gBANS,kBAEN;AACf,UAAO,YAAY,SAAS,gBAAgB;KAC3C,EAAE,CAAC;EAEwB;;AAGhC,SAAS,qBACP,SACA,wBAC0C;AAC1C,KAAI,uBACF,QAAO;EAAE,GAAG;EAAS;EAAqB;AAE5C,QAAO"}
@@ -1,6 +1,5 @@
1
1
  import { FileContents, LineAnnotation, VirtualFileMetrics } from "../../types.js";
2
- import { SelectedLineRange } from "../../managers/LineSelectionManager.js";
3
- import { GetHoveredLineResult } from "../../managers/MouseEventManager.js";
2
+ import { GetHoveredLineResult, SelectedLineRange } from "../../managers/InteractionManager.js";
4
3
  import { FileOptions } from "../../components/File.js";
5
4
 
6
5
  //#region src/react/utils/useFileInstance.d.ts
@@ -11,6 +10,7 @@ interface UseFileInstanceProps<LAnnotation> {
11
10
  selectedLines: SelectedLineRange | null | undefined;
12
11
  prerenderedHTML: string | undefined;
13
12
  metrics?: VirtualFileMetrics;
13
+ hasGutterRenderUtility: boolean;
14
14
  }
15
15
  interface UseFileInstanceReturn {
16
16
  ref(node: HTMLElement | null): void;
@@ -22,7 +22,8 @@ declare function useFileInstance<LAnnotation>({
22
22
  lineAnnotations,
23
23
  selectedLines,
24
24
  prerenderedHTML,
25
- metrics
25
+ metrics,
26
+ hasGutterRenderUtility
26
27
  }: UseFileInstanceProps<LAnnotation>): UseFileInstanceReturn;
27
28
  //#endregion
28
29
  export { useFileInstance };
@@ -1 +1 @@
1
- {"version":3,"file":"useFileInstance.d.ts","names":["FileOptions","SelectedLineRange","GetHoveredLineResult","FileContents","LineAnnotation","VirtualFileMetrics","UseFileInstanceProps","LAnnotation","UseFileInstanceReturn","HTMLElement","useFileInstance","file","options","lineAnnotations","selectedLines","prerenderedHTML","metrics"],"sources":["../../../src/react/utils/useFileInstance.d.ts"],"sourcesContent":["import { type FileOptions } from '../../components/File';\nimport type { SelectedLineRange } from '../../managers/LineSelectionManager';\nimport type { GetHoveredLineResult } from '../../managers/MouseEventManager';\nimport type { FileContents, LineAnnotation, VirtualFileMetrics } from '../../types';\ninterface UseFileInstanceProps<LAnnotation> {\n file: FileContents;\n options: FileOptions<LAnnotation> | undefined;\n lineAnnotations: LineAnnotation<LAnnotation>[] | undefined;\n selectedLines: SelectedLineRange | null | undefined;\n prerenderedHTML: string | undefined;\n metrics?: VirtualFileMetrics;\n}\ninterface UseFileInstanceReturn {\n ref(node: HTMLElement | null): void;\n getHoveredLine(): GetHoveredLineResult<'file'> | undefined;\n}\nexport declare function useFileInstance<LAnnotation>({ file, options, lineAnnotations, selectedLines, prerenderedHTML, metrics }: UseFileInstanceProps<LAnnotation>): UseFileInstanceReturn;\nexport {};\n//# sourceMappingURL=useFileInstance.d.ts.map"],"mappings":";;;;;;UAIUM;QACAH;EADAG,OAAAA,EAEGN,WAFHM,CAEeC,WAFKA,CAAAA,GAAAA,SAAAA;EACpBJ,eAAAA,EAEWC,cAFXD,CAE0BI,WAF1BJ,CAAAA,EAAAA,GAAAA,SAAAA;EACeI,aAAAA,EAENN,iBAFMM,GAAAA,IAAAA,GAAAA,SAAAA;EAAZP,eAAAA,EAAAA,MAAAA,GAAAA,SAAAA;EACuBO,OAAAA,CAAAA,EAGtBF,kBAHsBE;;UAK1BC,qBAAAA,CAJSP;EAELI,GAAAA,CAAAA,IAAAA,EAGAI,WAHAJ,GAAAA,IAAAA,CAAAA,EAAAA,IAAAA;EAAkB,cAAA,EAAA,EAIVH,oBAJU,CAAA,MAAA,CAAA,GAAA,SAAA;AAAA;AAMRQ,iBAAAA,eAAeH,CAAAA,WAAA,CAAA,CAAA;EAAA,IAAA;EAAA,OAAA;EAAA,eAAA;EAAA,aAAA;EAAA,eAAA;EAAA;AAAA,CAAA,EAA2FD,oBAA3F,CAAgHC,WAAhH,CAAA,CAAA,EAA+HC,qBAA/H"}
1
+ {"version":3,"file":"useFileInstance.d.ts","names":["FileOptions","GetHoveredLineResult","SelectedLineRange","FileContents","LineAnnotation","VirtualFileMetrics","UseFileInstanceProps","LAnnotation","UseFileInstanceReturn","HTMLElement","useFileInstance","file","options","lineAnnotations","selectedLines","prerenderedHTML","metrics","hasGutterRenderUtility"],"sources":["../../../src/react/utils/useFileInstance.d.ts"],"sourcesContent":["import { type FileOptions } from '../../components/File';\nimport type { GetHoveredLineResult, SelectedLineRange } from '../../managers/InteractionManager';\nimport type { FileContents, LineAnnotation, VirtualFileMetrics } from '../../types';\ninterface UseFileInstanceProps<LAnnotation> {\n file: FileContents;\n options: FileOptions<LAnnotation> | undefined;\n lineAnnotations: LineAnnotation<LAnnotation>[] | undefined;\n selectedLines: SelectedLineRange | null | undefined;\n prerenderedHTML: string | undefined;\n metrics?: VirtualFileMetrics;\n hasGutterRenderUtility: boolean;\n}\ninterface UseFileInstanceReturn {\n ref(node: HTMLElement | null): void;\n getHoveredLine(): GetHoveredLineResult<'file'> | undefined;\n}\nexport declare function useFileInstance<LAnnotation>({ file, options, lineAnnotations, selectedLines, prerenderedHTML, metrics, hasGutterRenderUtility }: UseFileInstanceProps<LAnnotation>): UseFileInstanceReturn;\nexport {};\n//# sourceMappingURL=useFileInstance.d.ts.map"],"mappings":";;;;;UAGUM;QACAH;EADAG,OAAAA,EAEGN,WAFHM,CAEeC,WAFKA,CAAAA,GAAAA,SAAAA;EACpBJ,eAAAA,EAEWC,cAFXD,CAE0BI,WAF1BJ,CAAAA,EAAAA,GAAAA,SAAAA;EACeI,aAAAA,EAENL,iBAFMK,GAAAA,IAAAA,GAAAA,SAAAA;EAAZP,eAAAA,EAAAA,MAAAA,GAAAA,SAAAA;EACuBO,OAAAA,CAAAA,EAGtBF,kBAHsBE;EAAfH,sBAAAA,EAAAA,OAAAA;;UAMXI,qBAAAA,CAHIH;EAAkB,GAAA,CAAA,IAAA,EAIlBI,WAJkB,GAAA,IAAA,CAAA,EAAA,IAAA;EAGtBD,cAAAA,EAAAA,EAEYP,oBADRQ,CAAAA,MAAAA,CAAAA,GAAAA,SACQR;AAEtB;AAAuDU,iBAA/BD,eAA+BC,CAAAA,WAAAA,CAAAA,CAAAA;EAAAA,IAAAA;EAAAA,OAAAA;EAAAA,eAAAA;EAAAA,aAAAA;EAAAA,eAAAA;EAAAA,OAAAA;EAAAA;AAAAA,CAAAA,EAAmGL,oBAAnGK,CAAwHJ,WAAxHI,CAAAA,CAAAA,EAAuIH,qBAAvIG"}
@@ -1,6 +1,7 @@
1
1
  import { File } from "../../components/File.js";
2
2
  import { VirtualizedFile } from "../../components/VirtualizedFile.js";
3
3
  import { areOptionsEqual } from "../../utils/areOptionsEqual.js";
4
+ import { noopRender } from "../constants.js";
4
5
  import { useVirtualizer } from "../Virtualizer.js";
5
6
  import { WorkerPoolContext } from "../WorkerPoolContext.js";
6
7
  import { useStableCallback } from "./useStableCallback.js";
@@ -8,15 +9,15 @@ import { useCallback, useContext, useEffect, useLayoutEffect, useRef } from "rea
8
9
 
9
10
  //#region src/react/utils/useFileInstance.ts
10
11
  const useIsometricEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
11
- function useFileInstance({ file, options, lineAnnotations, selectedLines, prerenderedHTML, metrics }) {
12
+ function useFileInstance({ file, options, lineAnnotations, selectedLines, prerenderedHTML, metrics, hasGutterRenderUtility }) {
12
13
  const simpleVirtualizer = useVirtualizer();
13
14
  const poolManager = useContext(WorkerPoolContext);
14
15
  const instanceRef = useRef(null);
15
16
  const ref = useStableCallback((node) => {
16
17
  if (node != null) {
17
18
  if (instanceRef.current != null) throw new Error("File: An instance should not already exist when a node is created");
18
- if (simpleVirtualizer != null) instanceRef.current = new VirtualizedFile(options, simpleVirtualizer, metrics, poolManager, true);
19
- else instanceRef.current = new File(options, poolManager, true);
19
+ if (simpleVirtualizer != null) instanceRef.current = new VirtualizedFile(mergeFileOptions(options, hasGutterRenderUtility), simpleVirtualizer, metrics, poolManager, true);
20
+ else instanceRef.current = new File(mergeFileOptions(options, hasGutterRenderUtility), poolManager, true);
20
21
  instanceRef.current.hydrate({
21
22
  file,
22
23
  fileContainer: node,
@@ -31,8 +32,9 @@ function useFileInstance({ file, options, lineAnnotations, selectedLines, preren
31
32
  });
32
33
  useIsometricEffect(() => {
33
34
  if (instanceRef.current == null) return;
34
- const forceRender = !areOptionsEqual(instanceRef.current.options, options);
35
- instanceRef.current.setOptions(options);
35
+ const newOptions = mergeFileOptions(options, hasGutterRenderUtility);
36
+ const forceRender = !areOptionsEqual(instanceRef.current.options, newOptions);
37
+ instanceRef.current.setOptions(newOptions);
36
38
  instanceRef.current.render({
37
39
  file,
38
40
  lineAnnotations,
@@ -47,6 +49,13 @@ function useFileInstance({ file, options, lineAnnotations, selectedLines, preren
47
49
  }, [])
48
50
  };
49
51
  }
52
+ function mergeFileOptions(options, hasGutterRenderUtility) {
53
+ if (hasGutterRenderUtility) return {
54
+ ...options,
55
+ renderGutterUtility: noopRender
56
+ };
57
+ return options;
58
+ }
50
59
 
51
60
  //#endregion
52
61
  export { useFileInstance };
@@ -1 +1 @@
1
- {"version":3,"file":"useFileInstance.js","names":[],"sources":["../../../src/react/utils/useFileInstance.ts"],"sourcesContent":["import {\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n} from 'react';\n\nimport { File, type FileOptions } from '../../components/File';\nimport { VirtualizedFile } from '../../components/VirtualizedFile';\nimport type { SelectedLineRange } from '../../managers/LineSelectionManager';\nimport type { GetHoveredLineResult } from '../../managers/MouseEventManager';\nimport type {\n FileContents,\n LineAnnotation,\n VirtualFileMetrics,\n} from '../../types';\nimport { areOptionsEqual } from '../../utils/areOptionsEqual';\nimport { useVirtualizer } from '../Virtualizer';\nimport { WorkerPoolContext } from '../WorkerPoolContext';\nimport { useStableCallback } from './useStableCallback';\n\nconst useIsometricEffect =\n typeof window === 'undefined' ? useEffect : useLayoutEffect;\n\ninterface UseFileInstanceProps<LAnnotation> {\n file: FileContents;\n options: FileOptions<LAnnotation> | undefined;\n lineAnnotations: LineAnnotation<LAnnotation>[] | undefined;\n selectedLines: SelectedLineRange | null | undefined;\n prerenderedHTML: string | undefined;\n metrics?: VirtualFileMetrics;\n}\n\ninterface UseFileInstanceReturn {\n ref(node: HTMLElement | null): void;\n getHoveredLine(): GetHoveredLineResult<'file'> | undefined;\n}\n\nexport function useFileInstance<LAnnotation>({\n file,\n options,\n lineAnnotations,\n selectedLines,\n prerenderedHTML,\n metrics,\n}: UseFileInstanceProps<LAnnotation>): UseFileInstanceReturn {\n const simpleVirtualizer = useVirtualizer();\n const poolManager = useContext(WorkerPoolContext);\n const instanceRef = useRef<\n File<LAnnotation> | VirtualizedFile<LAnnotation> | null\n >(null);\n const ref = useStableCallback((node: HTMLElement | null) => {\n if (node != null) {\n if (instanceRef.current != null) {\n throw new Error(\n 'File: An instance should not already exist when a node is created'\n );\n }\n if (simpleVirtualizer != null) {\n instanceRef.current = new VirtualizedFile(\n options,\n simpleVirtualizer,\n metrics,\n poolManager,\n true\n );\n } else {\n instanceRef.current = new File(options, poolManager, true);\n }\n void instanceRef.current.hydrate({\n file,\n fileContainer: node,\n lineAnnotations,\n prerenderedHTML,\n });\n } else {\n if (instanceRef.current == null) {\n throw new Error('File: A File instance should exist when unmounting');\n }\n instanceRef.current.cleanUp();\n instanceRef.current = null;\n }\n });\n\n useIsometricEffect(() => {\n if (instanceRef.current == null) return;\n const forceRender = !areOptionsEqual(instanceRef.current.options, options);\n instanceRef.current.setOptions(options);\n void instanceRef.current.render({ file, lineAnnotations, forceRender });\n if (selectedLines !== undefined) {\n instanceRef.current.setSelectedLines(selectedLines);\n }\n });\n\n const getHoveredLine = useCallback(():\n | GetHoveredLineResult<'file'>\n | undefined => {\n return instanceRef.current?.getHoveredLine();\n }, []);\n return { ref, getHoveredLine };\n}\n"],"mappings":";;;;;;;;;AAsBA,MAAM,qBACJ,OAAO,WAAW,cAAc,YAAY;AAgB9C,SAAgB,gBAA6B,EAC3C,MACA,SACA,iBACA,eACA,iBACA,WAC2D;CAC3D,MAAM,oBAAoB,gBAAgB;CAC1C,MAAM,cAAc,WAAW,kBAAkB;CACjD,MAAM,cAAc,OAElB,KAAK;CACP,MAAM,MAAM,mBAAmB,SAA6B;AAC1D,MAAI,QAAQ,MAAM;AAChB,OAAI,YAAY,WAAW,KACzB,OAAM,IAAI,MACR,oEACD;AAEH,OAAI,qBAAqB,KACvB,aAAY,UAAU,IAAI,gBACxB,SACA,mBACA,SACA,aACA,KACD;OAED,aAAY,UAAU,IAAI,KAAK,SAAS,aAAa,KAAK;AAE5D,GAAK,YAAY,QAAQ,QAAQ;IAC/B;IACA,eAAe;IACf;IACA;IACD,CAAC;SACG;AACL,OAAI,YAAY,WAAW,KACzB,OAAM,IAAI,MAAM,qDAAqD;AAEvE,eAAY,QAAQ,SAAS;AAC7B,eAAY,UAAU;;GAExB;AAEF,0BAAyB;AACvB,MAAI,YAAY,WAAW,KAAM;EACjC,MAAM,cAAc,CAAC,gBAAgB,YAAY,QAAQ,SAAS,QAAQ;AAC1E,cAAY,QAAQ,WAAW,QAAQ;AACvC,EAAK,YAAY,QAAQ,OAAO;GAAE;GAAM;GAAiB;GAAa,CAAC;AACvE,MAAI,kBAAkB,OACpB,aAAY,QAAQ,iBAAiB,cAAc;GAErD;AAOF,QAAO;EAAE;EAAK,gBALS,kBAEN;AACf,UAAO,YAAY,SAAS,gBAAgB;KAC3C,EAAE,CAAC;EACwB"}
1
+ {"version":3,"file":"useFileInstance.js","names":[],"sources":["../../../src/react/utils/useFileInstance.ts"],"sourcesContent":["import {\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n} from 'react';\n\nimport { File, type FileOptions } from '../../components/File';\nimport { VirtualizedFile } from '../../components/VirtualizedFile';\nimport type {\n GetHoveredLineResult,\n SelectedLineRange,\n} from '../../managers/InteractionManager';\nimport type {\n FileContents,\n LineAnnotation,\n VirtualFileMetrics,\n} from '../../types';\nimport { areOptionsEqual } from '../../utils/areOptionsEqual';\nimport { noopRender as renderGutterUtility } from '../constants';\nimport { useVirtualizer } from '../Virtualizer';\nimport { WorkerPoolContext } from '../WorkerPoolContext';\nimport { useStableCallback } from './useStableCallback';\n\nconst useIsometricEffect =\n typeof window === 'undefined' ? useEffect : useLayoutEffect;\n\ninterface UseFileInstanceProps<LAnnotation> {\n file: FileContents;\n options: FileOptions<LAnnotation> | undefined;\n lineAnnotations: LineAnnotation<LAnnotation>[] | undefined;\n selectedLines: SelectedLineRange | null | undefined;\n prerenderedHTML: string | undefined;\n metrics?: VirtualFileMetrics;\n hasGutterRenderUtility: boolean;\n}\n\ninterface UseFileInstanceReturn {\n ref(node: HTMLElement | null): void;\n getHoveredLine(): GetHoveredLineResult<'file'> | undefined;\n}\n\nexport function useFileInstance<LAnnotation>({\n file,\n options,\n lineAnnotations,\n selectedLines,\n prerenderedHTML,\n metrics,\n hasGutterRenderUtility,\n}: UseFileInstanceProps<LAnnotation>): UseFileInstanceReturn {\n const simpleVirtualizer = useVirtualizer();\n const poolManager = useContext(WorkerPoolContext);\n const instanceRef = useRef<\n File<LAnnotation> | VirtualizedFile<LAnnotation> | null\n >(null);\n const ref = useStableCallback((node: HTMLElement | null) => {\n if (node != null) {\n if (instanceRef.current != null) {\n throw new Error(\n 'File: An instance should not already exist when a node is created'\n );\n }\n if (simpleVirtualizer != null) {\n instanceRef.current = new VirtualizedFile(\n mergeFileOptions(options, hasGutterRenderUtility),\n simpleVirtualizer,\n metrics,\n poolManager,\n true\n );\n } else {\n instanceRef.current = new File(\n mergeFileOptions(options, hasGutterRenderUtility),\n poolManager,\n true\n );\n }\n void instanceRef.current.hydrate({\n file,\n fileContainer: node,\n lineAnnotations,\n prerenderedHTML,\n });\n } else {\n if (instanceRef.current == null) {\n throw new Error('File: A File instance should exist when unmounting');\n }\n instanceRef.current.cleanUp();\n instanceRef.current = null;\n }\n });\n\n useIsometricEffect(() => {\n if (instanceRef.current == null) return;\n const newOptions = mergeFileOptions(options, hasGutterRenderUtility);\n const forceRender = !areOptionsEqual(\n instanceRef.current.options,\n newOptions\n );\n instanceRef.current.setOptions(newOptions);\n void instanceRef.current.render({ file, lineAnnotations, forceRender });\n if (selectedLines !== undefined) {\n instanceRef.current.setSelectedLines(selectedLines);\n }\n });\n\n const getHoveredLine = useCallback(():\n | GetHoveredLineResult<'file'>\n | undefined => {\n return instanceRef.current?.getHoveredLine();\n }, []);\n return { ref, getHoveredLine };\n}\n\nfunction mergeFileOptions<LAnnotation>(\n options: FileOptions<LAnnotation> | undefined,\n hasGutterRenderUtility: boolean\n): FileOptions<LAnnotation> | undefined {\n if (hasGutterRenderUtility) {\n return { ...options, renderGutterUtility };\n }\n return options;\n}\n"],"mappings":";;;;;;;;;;AAyBA,MAAM,qBACJ,OAAO,WAAW,cAAc,YAAY;AAiB9C,SAAgB,gBAA6B,EAC3C,MACA,SACA,iBACA,eACA,iBACA,SACA,0BAC2D;CAC3D,MAAM,oBAAoB,gBAAgB;CAC1C,MAAM,cAAc,WAAW,kBAAkB;CACjD,MAAM,cAAc,OAElB,KAAK;CACP,MAAM,MAAM,mBAAmB,SAA6B;AAC1D,MAAI,QAAQ,MAAM;AAChB,OAAI,YAAY,WAAW,KACzB,OAAM,IAAI,MACR,oEACD;AAEH,OAAI,qBAAqB,KACvB,aAAY,UAAU,IAAI,gBACxB,iBAAiB,SAAS,uBAAuB,EACjD,mBACA,SACA,aACA,KACD;OAED,aAAY,UAAU,IAAI,KACxB,iBAAiB,SAAS,uBAAuB,EACjD,aACA,KACD;AAEH,GAAK,YAAY,QAAQ,QAAQ;IAC/B;IACA,eAAe;IACf;IACA;IACD,CAAC;SACG;AACL,OAAI,YAAY,WAAW,KACzB,OAAM,IAAI,MAAM,qDAAqD;AAEvE,eAAY,QAAQ,SAAS;AAC7B,eAAY,UAAU;;GAExB;AAEF,0BAAyB;AACvB,MAAI,YAAY,WAAW,KAAM;EACjC,MAAM,aAAa,iBAAiB,SAAS,uBAAuB;EACpE,MAAM,cAAc,CAAC,gBACnB,YAAY,QAAQ,SACpB,WACD;AACD,cAAY,QAAQ,WAAW,WAAW;AAC1C,EAAK,YAAY,QAAQ,OAAO;GAAE;GAAM;GAAiB;GAAa,CAAC;AACvE,MAAI,kBAAkB,OACpB,aAAY,QAAQ,iBAAiB,cAAc;GAErD;AAOF,QAAO;EAAE;EAAK,gBALS,kBAEN;AACf,UAAO,YAAY,SAAS,gBAAgB;KAC3C,EAAE,CAAC;EACwB;;AAGhC,SAAS,iBACP,SACA,wBACsC;AACtC,KAAI,uBACF,QAAO;EAAE,GAAG;EAAS;EAAqB;AAE5C,QAAO"}
@@ -0,0 +1,35 @@
1
+ import { DiffLineAnnotation, FileContents, FileDiffMetadata } from "../../types.js";
2
+ import { GetHoveredLineResult, SelectedLineRange } from "../../managers/InteractionManager.js";
3
+ import { MergeConflictDiffAction } from "../../utils/parseMergeConflictDiffFromFile.js";
4
+ import { UnresolvedFileHunksRendererOptions } from "../../renderers/UnresolvedFileHunksRenderer.js";
5
+ import { UnresolvedFile } from "../../components/UnresolvedFile.js";
6
+
7
+ //#region src/react/utils/useUnresolvedFileInstance.d.ts
8
+ interface UseUnresolvedFileInstanceProps<LAnnotation> {
9
+ file: FileContents;
10
+ options?: Omit<UnresolvedFileHunksRendererOptions, 'onMergeConflictAction'>;
11
+ lineAnnotations: DiffLineAnnotation<LAnnotation>[] | undefined;
12
+ selectedLines: SelectedLineRange | null | undefined;
13
+ prerenderedHTML: string | undefined;
14
+ hasConflictUtility: boolean;
15
+ hasGutterRenderUtility: boolean;
16
+ }
17
+ interface UseUnresolvedFileInstanceReturn<LAnnotation> {
18
+ fileDiff: FileDiffMetadata;
19
+ actions: MergeConflictDiffAction[];
20
+ ref(node: HTMLElement | null): void;
21
+ getHoveredLine(): GetHoveredLineResult<'diff'> | undefined;
22
+ getInstance(): UnresolvedFile<LAnnotation> | undefined;
23
+ }
24
+ declare function useUnresolvedFileInstance<LAnnotation>({
25
+ file,
26
+ options,
27
+ lineAnnotations,
28
+ selectedLines,
29
+ prerenderedHTML,
30
+ hasConflictUtility,
31
+ hasGutterRenderUtility
32
+ }: UseUnresolvedFileInstanceProps<LAnnotation>): UseUnresolvedFileInstanceReturn<LAnnotation>;
33
+ //#endregion
34
+ export { useUnresolvedFileInstance };
35
+ //# sourceMappingURL=useUnresolvedFileInstance.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,88 @@
1
+ import { parseMergeConflictDiffFromFile } from "../../utils/parseMergeConflictDiffFromFile.js";
2
+ import { UnresolvedFile } from "../../components/UnresolvedFile.js";
3
+ import { areOptionsEqual } from "../../utils/areOptionsEqual.js";
4
+ import { noopRender } from "../constants.js";
5
+ import { WorkerPoolContext } from "../WorkerPoolContext.js";
6
+ import { useStableCallback } from "./useStableCallback.js";
7
+ import { useCallback, useContext, useEffect, useLayoutEffect, useRef, useState } from "react";
8
+
9
+ //#region src/react/utils/useUnresolvedFileInstance.ts
10
+ const useIsometricEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
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);
14
+ return {
15
+ fileDiff: fileDiff$1,
16
+ actions: actions$1
17
+ };
18
+ });
19
+ const activeFileRef = useRef(file);
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
29
+ });
30
+ });
31
+ const poolManager = useContext(WorkerPoolContext);
32
+ const instanceRef = useRef(null);
33
+ const ref = useStableCallback((fileContainer) => {
34
+ if (fileContainer != null) {
35
+ if (instanceRef.current != null) throw new Error("useUnresolvedFileInstance: An instance should not already exist when a node is created");
36
+ instanceRef.current = new UnresolvedFile(mergeUnresolvedOptions(options, onMergeConflictAction, hasConflictUtility, hasGutterRenderUtility), poolManager, true);
37
+ instanceRef.current.hydrate({
38
+ fileDiff,
39
+ actions,
40
+ fileContainer,
41
+ lineAnnotations,
42
+ prerenderedHTML
43
+ });
44
+ } else {
45
+ if (instanceRef.current == null) throw new Error("useUnresolvedFileInstance: A UnresolvedFile instance should exist when unmounting");
46
+ instanceRef.current.cleanUp();
47
+ instanceRef.current = null;
48
+ }
49
+ });
50
+ useIsometricEffect(() => {
51
+ if (instanceRef.current == null) return;
52
+ const instance = instanceRef.current;
53
+ const newOptions = mergeUnresolvedOptions(options, onMergeConflictAction, hasConflictUtility, hasGutterRenderUtility);
54
+ const forceRender = !areOptionsEqual(instance.options, newOptions);
55
+ instance.setOptions(newOptions);
56
+ instance.render({
57
+ fileDiff,
58
+ actions,
59
+ lineAnnotations,
60
+ forceRender
61
+ });
62
+ if (selectedLines !== void 0) instance.setSelectedLines(selectedLines);
63
+ });
64
+ return {
65
+ ref,
66
+ getHoveredLine: useCallback(() => {
67
+ return instanceRef.current?.getHoveredLine();
68
+ }, []),
69
+ fileDiff,
70
+ actions,
71
+ getInstance: useCallback(() => {
72
+ return instanceRef.current ?? void 0;
73
+ }, [])
74
+ };
75
+ }
76
+ function mergeUnresolvedOptions(options, onMergeConflictAction, hasConflictUtility, hasGutterRenderUtility) {
77
+ return {
78
+ ...options,
79
+ onMergeConflictAction,
80
+ hunkSeparators: options?.hunkSeparators === "custom" ? noopRender : options?.hunkSeparators,
81
+ mergeConflictActionsType: hasConflictUtility || options?.mergeConflictActionsType === "custom" ? noopRender : options?.mergeConflictActionsType,
82
+ renderGutterUtility: hasGutterRenderUtility ? noopRender : void 0
83
+ };
84
+ }
85
+
86
+ //#endregion
87
+ export { useUnresolvedFileInstance };
88
+ //# sourceMappingURL=useUnresolvedFileInstance.js.map
@@ -0,0 +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,uBA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B,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,9 +1,43 @@
1
- import { BaseDiffOptions, DiffLineAnnotation, ExpansionDirections, FileDiffMetadata, HunkData, HunkExpansionRegion, RenderDiffOptions, RenderRange, ThemeTypes, ThemedDiffResult } from "../types.js";
1
+ import { AnnotationSpan, BaseDiffOptions, BaseDiffOptionsWithDefaults, CustomPreProperties, DiffLineAnnotation, ExpansionDirections, FileDiffMetadata, HunkData, HunkExpansionRegion, LineTypes, RenderDiffOptions, RenderRange, ThemeTypes, ThemedDiffResult } from "../types.js";
2
2
  import { WorkerPoolManager } from "../worker/WorkerPoolManager.js";
3
3
  import "../worker/index.js";
4
- import { Element, ElementContent } from "hast";
4
+ import { DiffLineMetadata } from "../utils/iterateOverDiff.js";
5
+ import { Element, ElementContent, Properties } from "hast";
5
6
 
6
7
  //#region src/renderers/DiffHunksRenderer.d.ts
8
+ interface UnifiedLineDecorationProps {
9
+ type: 'context' | 'context-expanded' | 'change';
10
+ lineType: LineTypes;
11
+ additionLineIndex: number | undefined;
12
+ deletionLineIndex: number | undefined;
13
+ }
14
+ interface SplitLineDecorationProps {
15
+ side: 'deletions' | 'additions';
16
+ type: 'context' | 'context-expanded' | 'change';
17
+ lineIndex: number | undefined;
18
+ }
19
+ interface LineDecoration {
20
+ gutterLineType: LineTypes;
21
+ gutterProperties?: Properties;
22
+ contentProperties?: Properties;
23
+ }
24
+ interface RenderedLineContext {
25
+ type: 'context' | 'context-expanded' | 'change';
26
+ hunkIndex: number;
27
+ lineIndex: number;
28
+ unifiedLineIndex: number;
29
+ splitLineIndex: number;
30
+ deletionLine?: DiffLineMetadata;
31
+ additionLine?: DiffLineMetadata;
32
+ }
33
+ interface InlineRow {
34
+ content: Element;
35
+ gutter: Element;
36
+ }
37
+ interface SplitInlineRow {
38
+ deletion: InlineRow | undefined;
39
+ addition: InlineRow | undefined;
40
+ }
7
41
  interface HunksRenderResult {
8
42
  unifiedGutterAST: ElementContent[] | undefined;
9
43
  unifiedContentAST: ElementContent[] | undefined;
@@ -40,17 +74,27 @@ declare class DiffHunksRenderer<LAnnotation = undefined> {
40
74
  setOptions(options: BaseDiffOptions): void;
41
75
  private mergeOptions;
42
76
  setThemeType(themeType: ThemeTypes): void;
43
- expandHunk(index: number, direction: ExpansionDirections): void;
77
+ expandHunk(index: number, direction: ExpansionDirections, expansionLineCount?: number): void;
44
78
  getExpandedHunk(hunkIndex: number): HunkExpansionRegion;
45
79
  getExpandedHunksMap(): Map<number, HunkExpansionRegion>;
46
80
  setLineAnnotations(lineAnnotations: DiffLineAnnotation<LAnnotation>[]): void;
47
- private getOptionsWithDefaults;
81
+ protected getUnifiedLineDecoration({
82
+ lineType
83
+ }: UnifiedLineDecorationProps): LineDecoration;
84
+ protected getSplitLineDecoration({
85
+ side,
86
+ type
87
+ }: SplitLineDecorationProps): LineDecoration;
88
+ protected createAnnotationElement(span: AnnotationSpan): Element;
89
+ protected getUnifiedInlineRowsForLine?: (ctx: RenderedLineContext) => InlineRow[] | undefined;
90
+ protected getSplitInlineRowsForLine?: (ctx: RenderedLineContext) => SplitInlineRow[] | undefined;
91
+ protected getOptionsWithDefaults(): BaseDiffOptionsWithDefaults;
48
92
  private initializeHighlighter;
49
93
  hydrate(diff: FileDiffMetadata | undefined): void;
50
94
  private getRenderOptions;
51
95
  renderDiff(diff?: FileDiffMetadata | undefined, renderRange?: RenderRange): HunksRenderResult | undefined;
52
96
  asyncRender(diff: FileDiffMetadata, renderRange?: RenderRange): Promise<HunksRenderResult>;
53
- private createPreElement;
97
+ protected createPreElement(split: boolean, totalLines: number, themeStyles: string, baseThemeType: 'light' | 'dark' | undefined, customProperties?: CustomPreProperties): Element;
54
98
  private asyncHighlight;
55
99
  private renderDiffWithHighlighter;
56
100
  onHighlightSuccess(diff: FileDiffMetadata, result: ThemedDiffResult, options: RenderDiffOptions): void;
@@ -64,5 +108,5 @@ declare class DiffHunksRenderer<LAnnotation = undefined> {
64
108
  private renderHeader;
65
109
  }
66
110
  //#endregion
67
- export { DiffHunksRenderer, HunksRenderResult };
111
+ export { DiffHunksRenderer, HunksRenderResult, InlineRow, LineDecoration, RenderedLineContext, SplitInlineRow, SplitLineDecorationProps, UnifiedLineDecorationProps };
68
112
  //# sourceMappingURL=DiffHunksRenderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DiffHunksRenderer.d.ts","names":["ElementContent","Element","HASTElement","BaseDiffOptions","DiffLineAnnotation","ExpansionDirections","FileDiffMetadata","HunkData","HunkExpansionRegion","RenderDiffOptions","RenderRange","ThemedDiffResult","ThemeTypes","WorkerPoolManager","HunksRenderResult","DiffHunksRenderer","LAnnotation","Map","Promise"],"sources":["../../src/renderers/DiffHunksRenderer.d.ts"],"sourcesContent":["import type { ElementContent, Element as HASTElement } from 'hast';\nimport type { BaseDiffOptions, DiffLineAnnotation, ExpansionDirections, FileDiffMetadata, HunkData, HunkExpansionRegion, RenderDiffOptions, RenderRange, ThemedDiffResult, ThemeTypes } from '../types';\nimport type { WorkerPoolManager } from '../worker';\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): void;\n getExpandedHunk(hunkIndex: number): HunkExpansionRegion;\n getExpandedHunksMap(): Map<number, HunkExpansionRegion>;\n setLineAnnotations(lineAnnotations: DiffLineAnnotation<LAnnotation>[]): void;\n private getOptionsWithDefaults;\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 private createPreElement;\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":";;;;;;UAGiBc,iBAAAA;oBACKd;qBACCA;EAFNc,kBAAAA,EAGOd,cAHU,EAAA,GAAA,SAAA;EACZA,mBAAAA,EAGGA,cAHHA,EAAAA,GAAAA,SAAAA;EACCA,kBAAAA,EAGCA,cAHDA,EAAAA,GAAAA,SAAAA;EACCA,mBAAAA,EAGC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AAAA,SAAAA,EAAAA,MAAAA,CAAAA,EAf/BN,mBAe+BM;EAAoBd,mBAAAA,CAAAA,CAAAA,EAdhEiB,GAcgEjB,CAAAA,MAAAA,EAdpDQ,mBAcoDR,CAAAA;EACjEc,kBAAAA,CAAAA,eAAAA,EAdcV,kBAcdU,CAdiCE,WAcjCF,CAAAA,EAAAA,CAAAA,EAAAA,IAAAA;EAA8Bd,QAAAA,sBAAAA;EAAmBE,QAAAA,qBAAAA;EAChDY,OAAAA,CAAAA,IAAAA,EAZTR,gBAYSQ,GAAAA,SAAAA,CAAAA,EAAAA,IAAAA;EAAkCd,QAAAA,gBAAAA;EAC7BA,UAAAA,CAAAA,IAAAA,CAAAA,EAXVM,gBAWUN,GAAAA,SAAAA,EAAAA,WAAAA,CAAAA,EAXkCU,WAWlCV,CAAAA,EAXgDc,iBAWhDd,GAAAA,SAAAA;EAAc,WAAA,CAAA,IAAA,EAVxBM,gBAUwB,EAAA,WAAA,CAAA,EAVQI,WAUR,CAAA,EAVsBQ,OAUtB,CAV8BJ,iBAU9B,CAAA;;;;2BANjBR,0BAA0BK,2BAA2BF;;;qEAGXK,oBAAoBd;wBACjEc,8BAA8Bd,mBAAmBE;yBAChDY,kCAAkCd;8BAC7BA"}
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' | 'addit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