@openclaw/diffs 2026.8.1-beta.3 → 2026.8.2

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 (620) hide show
  1. package/dist/assets/viewer-runtime.js +129 -156
  2. package/dist/{browser.runtime-_hkQDewM.js → browser.runtime-DTKAejqd.js} +1 -1
  3. package/dist/index.js +18 -16
  4. package/dist/{viewer-assets-DKR8WLAI.js → viewer-assets-D3qrnaxI.js} +11 -23
  5. package/node_modules/@pierre/diffs/README.md +9 -0
  6. package/node_modules/@pierre/diffs/dist/components/CodeView.d.ts +94 -7
  7. package/node_modules/@pierre/diffs/dist/components/CodeView.d.ts.map +1 -1
  8. package/node_modules/@pierre/diffs/dist/components/CodeView.js +333 -47
  9. package/node_modules/@pierre/diffs/dist/components/CodeView.js.map +1 -1
  10. package/node_modules/@pierre/diffs/dist/components/File.d.ts +22 -4
  11. package/node_modules/@pierre/diffs/dist/components/File.d.ts.map +1 -1
  12. package/node_modules/@pierre/diffs/dist/components/File.js +143 -23
  13. package/node_modules/@pierre/diffs/dist/components/File.js.map +1 -1
  14. package/node_modules/@pierre/diffs/dist/components/FileDiff.d.ts +83 -19
  15. package/node_modules/@pierre/diffs/dist/components/FileDiff.d.ts.map +1 -1
  16. package/node_modules/@pierre/diffs/dist/components/FileDiff.js +461 -46
  17. package/node_modules/@pierre/diffs/dist/components/FileDiff.js.map +1 -1
  18. package/node_modules/@pierre/diffs/dist/components/FileStream.d.ts.map +1 -1
  19. package/node_modules/@pierre/diffs/dist/components/FileStream.js +2 -1
  20. package/node_modules/@pierre/diffs/dist/components/FileStream.js.map +1 -1
  21. package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.d.ts +2 -2
  22. package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.d.ts.map +1 -1
  23. package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.js +9 -4
  24. package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.js.map +1 -1
  25. package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.d.ts +7 -3
  26. package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.d.ts.map +1 -1
  27. package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.js +87 -60
  28. package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.js.map +1 -1
  29. package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.d.ts +30 -5
  30. package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.d.ts.map +1 -1
  31. package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.js +277 -56
  32. package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.js.map +1 -1
  33. package/node_modules/@pierre/diffs/dist/components/Virtualizer.d.ts +17 -3
  34. package/node_modules/@pierre/diffs/dist/components/Virtualizer.d.ts.map +1 -1
  35. package/node_modules/@pierre/diffs/dist/components/Virtualizer.js +44 -5
  36. package/node_modules/@pierre/diffs/dist/components/Virtualizer.js.map +1 -1
  37. package/node_modules/@pierre/diffs/dist/constants.d.ts +4 -1
  38. package/node_modules/@pierre/diffs/dist/constants.d.ts.map +1 -1
  39. package/node_modules/@pierre/diffs/dist/constants.js +4 -1
  40. package/node_modules/@pierre/diffs/dist/constants.js.map +1 -1
  41. package/node_modules/@pierre/diffs/dist/edit/index.d.ts +6 -0
  42. package/node_modules/@pierre/diffs/dist/edit/index.js +3 -0
  43. package/node_modules/@pierre/diffs/dist/editor/command.d.ts +15 -0
  44. package/node_modules/@pierre/diffs/dist/editor/command.d.ts.map +1 -0
  45. package/node_modules/@pierre/diffs/dist/editor/command.js +128 -0
  46. package/node_modules/@pierre/diffs/dist/editor/command.js.map +1 -0
  47. package/node_modules/@pierre/diffs/dist/editor/editStack.d.ts +76 -0
  48. package/node_modules/@pierre/diffs/dist/editor/editStack.d.ts.map +1 -0
  49. package/node_modules/@pierre/diffs/dist/editor/editStack.js +259 -0
  50. package/node_modules/@pierre/diffs/dist/editor/editStack.js.map +1 -0
  51. package/node_modules/@pierre/diffs/dist/editor/editor.d.ts +118 -0
  52. package/node_modules/@pierre/diffs/dist/editor/editor.d.ts.map +1 -0
  53. package/node_modules/@pierre/diffs/dist/editor/editor.js +2880 -0
  54. package/node_modules/@pierre/diffs/dist/editor/editor.js.map +1 -0
  55. package/node_modules/@pierre/diffs/dist/editor/editor2.js +6 -0
  56. package/node_modules/@pierre/diffs/dist/editor/editor2.js.map +1 -0
  57. package/node_modules/@pierre/diffs/dist/editor/languages.d.ts +26 -0
  58. package/node_modules/@pierre/diffs/dist/editor/languages.d.ts.map +1 -0
  59. package/node_modules/@pierre/diffs/dist/editor/languages.js +363 -0
  60. package/node_modules/@pierre/diffs/dist/editor/languages.js.map +1 -0
  61. package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.d.ts +9 -0
  62. package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.d.ts.map +1 -0
  63. package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.js +212 -0
  64. package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.js.map +1 -0
  65. package/node_modules/@pierre/diffs/dist/editor/marker.d.ts +38 -0
  66. package/node_modules/@pierre/diffs/dist/editor/marker.d.ts.map +1 -0
  67. package/node_modules/@pierre/diffs/dist/editor/marker.js +245 -0
  68. package/node_modules/@pierre/diffs/dist/editor/marker.js.map +1 -0
  69. package/node_modules/@pierre/diffs/dist/editor/matchBrackets.d.ts +9 -0
  70. package/node_modules/@pierre/diffs/dist/editor/matchBrackets.d.ts.map +1 -0
  71. package/node_modules/@pierre/diffs/dist/editor/matchBrackets.js +138 -0
  72. package/node_modules/@pierre/diffs/dist/editor/matchBrackets.js.map +1 -0
  73. package/node_modules/@pierre/diffs/dist/editor/pieceTable.d.ts +40 -0
  74. package/node_modules/@pierre/diffs/dist/editor/pieceTable.d.ts.map +1 -0
  75. package/node_modules/@pierre/diffs/dist/editor/pieceTable.js +706 -0
  76. package/node_modules/@pierre/diffs/dist/editor/pieceTable.js.map +1 -0
  77. package/node_modules/@pierre/diffs/dist/editor/platform.d.ts +11 -0
  78. package/node_modules/@pierre/diffs/dist/editor/platform.d.ts.map +1 -0
  79. package/node_modules/@pierre/diffs/dist/editor/platform.js +31 -0
  80. package/node_modules/@pierre/diffs/dist/editor/platform.js.map +1 -0
  81. package/node_modules/@pierre/diffs/dist/editor/popover.d.ts +65 -0
  82. package/node_modules/@pierre/diffs/dist/editor/popover.d.ts.map +1 -0
  83. package/node_modules/@pierre/diffs/dist/editor/popover.js +191 -0
  84. package/node_modules/@pierre/diffs/dist/editor/popover.js.map +1 -0
  85. package/node_modules/@pierre/diffs/dist/editor/searchPanel.d.ts +41 -0
  86. package/node_modules/@pierre/diffs/dist/editor/searchPanel.d.ts.map +1 -0
  87. package/node_modules/@pierre/diffs/dist/editor/searchPanel.js +318 -0
  88. package/node_modules/@pierre/diffs/dist/editor/searchPanel.js.map +1 -0
  89. package/node_modules/@pierre/diffs/dist/editor/selection.d.ts +211 -0
  90. package/node_modules/@pierre/diffs/dist/editor/selection.d.ts.map +1 -0
  91. package/node_modules/@pierre/diffs/dist/editor/selection.js +1626 -0
  92. package/node_modules/@pierre/diffs/dist/editor/selection.js.map +1 -0
  93. package/node_modules/@pierre/diffs/dist/editor/selectionAction.d.ts +47 -0
  94. package/node_modules/@pierre/diffs/dist/editor/selectionAction.d.ts.map +1 -0
  95. package/node_modules/@pierre/diffs/dist/editor/selectionAction.js +66 -0
  96. package/node_modules/@pierre/diffs/dist/editor/selectionAction.js.map +1 -0
  97. package/node_modules/@pierre/diffs/dist/editor/sprite.d.ts +8 -0
  98. package/node_modules/@pierre/diffs/dist/editor/sprite.d.ts.map +1 -0
  99. package/node_modules/@pierre/diffs/dist/editor/sprite.js +45 -0
  100. package/node_modules/@pierre/diffs/dist/editor/sprite.js.map +1 -0
  101. package/node_modules/@pierre/diffs/dist/editor/stateStorage.d.ts +15 -0
  102. package/node_modules/@pierre/diffs/dist/editor/stateStorage.d.ts.map +1 -0
  103. package/node_modules/@pierre/diffs/dist/editor/stateStorage.js +65 -0
  104. package/node_modules/@pierre/diffs/dist/editor/stateStorage.js.map +1 -0
  105. package/node_modules/@pierre/diffs/dist/editor/textDocument.d.ts +67 -0
  106. package/node_modules/@pierre/diffs/dist/editor/textDocument.d.ts.map +1 -0
  107. package/node_modules/@pierre/diffs/dist/editor/textDocument.js +278 -0
  108. package/node_modules/@pierre/diffs/dist/editor/textDocument.js.map +1 -0
  109. package/node_modules/@pierre/diffs/dist/editor/textMeasure.d.ts +61 -0
  110. package/node_modules/@pierre/diffs/dist/editor/textMeasure.d.ts.map +1 -0
  111. package/node_modules/@pierre/diffs/dist/editor/textMeasure.js +209 -0
  112. package/node_modules/@pierre/diffs/dist/editor/textMeasure.js.map +1 -0
  113. package/node_modules/@pierre/diffs/dist/editor/tokenizer.d.ts +41 -0
  114. package/node_modules/@pierre/diffs/dist/editor/tokenizer.d.ts.map +1 -0
  115. package/node_modules/@pierre/diffs/dist/editor/tokenizer.js +596 -0
  116. package/node_modules/@pierre/diffs/dist/editor/tokenizer.js.map +1 -0
  117. package/node_modules/@pierre/diffs/dist/editor/utils.d.ts +22 -0
  118. package/node_modules/@pierre/diffs/dist/editor/utils.d.ts.map +1 -0
  119. package/node_modules/@pierre/diffs/dist/editor/utils.js +78 -0
  120. package/node_modules/@pierre/diffs/dist/editor/utils.js.map +1 -0
  121. package/node_modules/@pierre/diffs/dist/index.d.ts +12 -9
  122. package/node_modules/@pierre/diffs/dist/index.js +13 -10
  123. package/node_modules/@pierre/diffs/dist/managers/InteractionManager.d.ts +20 -2
  124. package/node_modules/@pierre/diffs/dist/managers/InteractionManager.d.ts.map +1 -1
  125. package/node_modules/@pierre/diffs/dist/managers/InteractionManager.js +155 -79
  126. package/node_modules/@pierre/diffs/dist/managers/InteractionManager.js.map +1 -1
  127. package/node_modules/@pierre/diffs/dist/managers/ResizeManager.d.ts +10 -2
  128. package/node_modules/@pierre/diffs/dist/managers/ResizeManager.d.ts.map +1 -1
  129. package/node_modules/@pierre/diffs/dist/managers/ResizeManager.js +33 -13
  130. package/node_modules/@pierre/diffs/dist/managers/ResizeManager.js.map +1 -1
  131. package/node_modules/@pierre/diffs/dist/managers/UniversalRenderingManager.d.ts +2 -1
  132. package/node_modules/@pierre/diffs/dist/managers/UniversalRenderingManager.d.ts.map +1 -1
  133. package/node_modules/@pierre/diffs/dist/managers/UniversalRenderingManager.js +7 -3
  134. package/node_modules/@pierre/diffs/dist/managers/UniversalRenderingManager.js.map +1 -1
  135. package/node_modules/@pierre/diffs/dist/react/CodeView.d.ts +29 -3
  136. package/node_modules/@pierre/diffs/dist/react/CodeView.d.ts.map +1 -1
  137. package/node_modules/@pierre/diffs/dist/react/CodeView.js +111 -30
  138. package/node_modules/@pierre/diffs/dist/react/CodeView.js.map +1 -1
  139. package/node_modules/@pierre/diffs/dist/react/EditContext.d.ts +20 -0
  140. package/node_modules/@pierre/diffs/dist/react/EditContext.d.ts.map +1 -0
  141. package/node_modules/@pierre/diffs/dist/react/EditContext.js +27 -0
  142. package/node_modules/@pierre/diffs/dist/react/EditContext.js.map +1 -0
  143. package/node_modules/@pierre/diffs/dist/react/File.d.ts +4 -1
  144. package/node_modules/@pierre/diffs/dist/react/File.d.ts.map +1 -1
  145. package/node_modules/@pierre/diffs/dist/react/File.js +5 -2
  146. package/node_modules/@pierre/diffs/dist/react/File.js.map +1 -1
  147. package/node_modules/@pierre/diffs/dist/react/FileDiff.d.ts +4 -1
  148. package/node_modules/@pierre/diffs/dist/react/FileDiff.d.ts.map +1 -1
  149. package/node_modules/@pierre/diffs/dist/react/FileDiff.js +5 -2
  150. package/node_modules/@pierre/diffs/dist/react/FileDiff.js.map +1 -1
  151. package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.d.ts +7 -5
  152. package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.d.ts.map +1 -1
  153. package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.js +5 -2
  154. package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.js.map +1 -1
  155. package/node_modules/@pierre/diffs/dist/react/PatchDiff.d.ts +4 -1
  156. package/node_modules/@pierre/diffs/dist/react/PatchDiff.d.ts.map +1 -1
  157. package/node_modules/@pierre/diffs/dist/react/PatchDiff.js +5 -2
  158. package/node_modules/@pierre/diffs/dist/react/PatchDiff.js.map +1 -1
  159. package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.d.ts +2 -1
  160. package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.d.ts.map +1 -1
  161. package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.js +2 -1
  162. package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.js.map +1 -1
  163. package/node_modules/@pierre/diffs/dist/react/index.d.ts +4 -3
  164. package/node_modules/@pierre/diffs/dist/react/index.js +3 -2
  165. package/node_modules/@pierre/diffs/dist/react/types.d.ts +11 -0
  166. package/node_modules/@pierre/diffs/dist/react/types.d.ts.map +1 -1
  167. package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.d.ts +2 -0
  168. package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.d.ts.map +1 -1
  169. package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.js +16 -8
  170. package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.js.map +1 -1
  171. package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.d.ts +2 -0
  172. package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.d.ts.map +1 -1
  173. package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.js +16 -8
  174. package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.js.map +1 -1
  175. package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.d.ts +6 -2
  176. package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.d.ts.map +1 -1
  177. package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.js +21 -6
  178. package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.js.map +1 -1
  179. package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.d.ts +7 -2
  180. package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.d.ts.map +1 -1
  181. package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.js +21 -6
  182. package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.js.map +1 -1
  183. package/node_modules/@pierre/diffs/dist/react/utils/useUnresolvedFileInstance.js +4 -4
  184. package/node_modules/@pierre/diffs/dist/react/utils/useUnresolvedFileInstance.js.map +1 -1
  185. package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.d.ts +47 -2
  186. package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.d.ts.map +1 -1
  187. package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.js +361 -37
  188. package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.js.map +1 -1
  189. package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.d.ts +26 -1
  190. package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.d.ts.map +1 -1
  191. package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.js +240 -55
  192. package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.js.map +1 -1
  193. package/node_modules/@pierre/diffs/dist/ssr/index.d.ts +2 -2
  194. package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.d.ts +11 -10
  195. package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.d.ts.map +1 -1
  196. package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.js +17 -7
  197. package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.js.map +1 -1
  198. package/node_modules/@pierre/diffs/dist/ssr/preloadFile.d.ts.map +1 -1
  199. package/node_modules/@pierre/diffs/dist/ssr/preloadFile.js +2 -0
  200. package/node_modules/@pierre/diffs/dist/ssr/preloadFile.js.map +1 -1
  201. package/node_modules/@pierre/diffs/dist/style.js +1 -1
  202. package/node_modules/@pierre/diffs/dist/types.d.ts +336 -5
  203. package/node_modules/@pierre/diffs/dist/types.d.ts.map +1 -1
  204. package/node_modules/@pierre/diffs/dist/utils/annotationHelpers.d.ts +20 -0
  205. package/node_modules/@pierre/diffs/dist/utils/annotationHelpers.d.ts.map +1 -0
  206. package/node_modules/@pierre/diffs/dist/utils/annotationHelpers.js +29 -0
  207. package/node_modules/@pierre/diffs/dist/utils/annotationHelpers.js.map +1 -0
  208. package/node_modules/@pierre/diffs/dist/utils/applyLineTextWithNewline.d.ts +5 -0
  209. package/node_modules/@pierre/diffs/dist/utils/applyLineTextWithNewline.d.ts.map +1 -0
  210. package/node_modules/@pierre/diffs/dist/utils/applyLineTextWithNewline.js +11 -0
  211. package/node_modules/@pierre/diffs/dist/utils/applyLineTextWithNewline.js.map +1 -0
  212. package/node_modules/@pierre/diffs/dist/utils/areHunkDataEqual.js +1 -1
  213. package/node_modules/@pierre/diffs/dist/utils/areHunkDataEqual.js.map +1 -1
  214. package/node_modules/@pierre/diffs/dist/utils/areManagedSnapshotsEqual.d.ts +2 -2
  215. package/node_modules/@pierre/diffs/dist/utils/areManagedSnapshotsEqual.d.ts.map +1 -1
  216. package/node_modules/@pierre/diffs/dist/utils/areManagedSnapshotsEqual.js +6 -1
  217. package/node_modules/@pierre/diffs/dist/utils/areManagedSnapshotsEqual.js.map +1 -1
  218. package/node_modules/@pierre/diffs/dist/utils/awaitWithTimeout.d.ts +5 -0
  219. package/node_modules/@pierre/diffs/dist/utils/awaitWithTimeout.d.ts.map +1 -0
  220. package/node_modules/@pierre/diffs/dist/utils/awaitWithTimeout.js +15 -0
  221. package/node_modules/@pierre/diffs/dist/utils/awaitWithTimeout.js.map +1 -0
  222. package/node_modules/@pierre/diffs/dist/utils/cleanLastNewline.js +6 -1
  223. package/node_modules/@pierre/diffs/dist/utils/cleanLastNewline.js.map +1 -1
  224. package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.d.ts +7 -0
  225. package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.d.ts.map +1 -0
  226. package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.js +16 -0
  227. package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.js.map +1 -0
  228. package/node_modules/@pierre/diffs/dist/utils/computeEstimatedDiffHeights.d.ts +3 -1
  229. package/node_modules/@pierre/diffs/dist/utils/computeEstimatedDiffHeights.d.ts.map +1 -1
  230. package/node_modules/@pierre/diffs/dist/utils/computeEstimatedDiffHeights.js +8 -1
  231. package/node_modules/@pierre/diffs/dist/utils/computeEstimatedDiffHeights.js.map +1 -1
  232. package/node_modules/@pierre/diffs/dist/utils/computeFileOffsets.d.ts +21 -0
  233. package/node_modules/@pierre/diffs/dist/utils/computeFileOffsets.d.ts.map +1 -0
  234. package/node_modules/@pierre/diffs/dist/utils/computeFileOffsets.js +80 -0
  235. package/node_modules/@pierre/diffs/dist/utils/computeFileOffsets.js.map +1 -0
  236. package/node_modules/@pierre/diffs/dist/utils/createCodeViewHeaderFooterHostElement.d.ts +5 -0
  237. package/node_modules/@pierre/diffs/dist/utils/createCodeViewHeaderFooterHostElement.d.ts.map +1 -0
  238. package/node_modules/@pierre/diffs/dist/utils/createCodeViewHeaderFooterHostElement.js +19 -0
  239. package/node_modules/@pierre/diffs/dist/utils/createCodeViewHeaderFooterHostElement.js.map +1 -0
  240. package/node_modules/@pierre/diffs/dist/utils/createFileHeaderElement.d.ts.map +1 -1
  241. package/node_modules/@pierre/diffs/dist/utils/createFileHeaderElement.js +5 -1
  242. package/node_modules/@pierre/diffs/dist/utils/createFileHeaderElement.js.map +1 -1
  243. package/node_modules/@pierre/diffs/dist/utils/createTransformerWithState.js +9 -0
  244. package/node_modules/@pierre/diffs/dist/utils/createTransformerWithState.js.map +1 -1
  245. package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.d.ts +66 -0
  246. package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.d.ts.map +1 -0
  247. package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.js +437 -0
  248. package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.js.map +1 -0
  249. package/node_modules/@pierre/diffs/dist/utils/getDiffFileInput.d.ts +14 -0
  250. package/node_modules/@pierre/diffs/dist/utils/getDiffFileInput.d.ts.map +1 -0
  251. package/node_modules/@pierre/diffs/dist/utils/getDiffFileInput.js +24 -0
  252. package/node_modules/@pierre/diffs/dist/utils/getDiffFileInput.js.map +1 -0
  253. package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.d.ts.map +1 -1
  254. package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.js +3 -1
  255. package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.js.map +1 -1
  256. package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.d.ts.map +1 -1
  257. package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.js +2 -1
  258. package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.js.map +1 -1
  259. package/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.d.ts.map +1 -1
  260. package/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.js +2 -0
  261. package/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.js.map +1 -1
  262. package/node_modules/@pierre/diffs/dist/utils/getHunkSideBoundaries.d.ts +7 -0
  263. package/node_modules/@pierre/diffs/dist/utils/getHunkSideBoundaries.d.ts.map +1 -0
  264. package/node_modules/@pierre/diffs/dist/utils/getHunkSideBoundaries.js +12 -0
  265. package/node_modules/@pierre/diffs/dist/utils/getHunkSideBoundaries.js.map +1 -0
  266. package/node_modules/@pierre/diffs/dist/utils/getTotalLineCountFromHunks.d.ts.map +1 -1
  267. package/node_modules/@pierre/diffs/dist/utils/getTotalLineCountFromHunks.js +2 -1
  268. package/node_modules/@pierre/diffs/dist/utils/getTotalLineCountFromHunks.js.map +1 -1
  269. package/node_modules/@pierre/diffs/dist/utils/guardWebKitScrollDuringRebuild.d.ts +20 -0
  270. package/node_modules/@pierre/diffs/dist/utils/guardWebKitScrollDuringRebuild.d.ts.map +1 -0
  271. package/node_modules/@pierre/diffs/dist/utils/guardWebKitScrollDuringRebuild.js +34 -0
  272. package/node_modules/@pierre/diffs/dist/utils/guardWebKitScrollDuringRebuild.js.map +1 -0
  273. package/node_modules/@pierre/diffs/dist/utils/hydratePartialDiff.d.ts +10 -0
  274. package/node_modules/@pierre/diffs/dist/utils/hydratePartialDiff.d.ts.map +1 -0
  275. package/node_modules/@pierre/diffs/dist/utils/hydratePartialDiff.js +141 -0
  276. package/node_modules/@pierre/diffs/dist/utils/hydratePartialDiff.js.map +1 -0
  277. package/node_modules/@pierre/diffs/dist/utils/isGutterUtilityPath.d.ts +5 -0
  278. package/node_modules/@pierre/diffs/dist/utils/isGutterUtilityPath.d.ts.map +1 -0
  279. package/node_modules/@pierre/diffs/dist/utils/isGutterUtilityPath.js +12 -0
  280. package/node_modules/@pierre/diffs/dist/utils/isGutterUtilityPath.js.map +1 -0
  281. package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.d.ts.map +1 -1
  282. package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.js +20 -15
  283. package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.js.map +1 -1
  284. package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.d.ts +1 -1
  285. package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.d.ts.map +1 -1
  286. package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.js +26 -5
  287. package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.js.map +1 -1
  288. package/node_modules/@pierre/diffs/dist/utils/parseMergeConflictDiffFromFile.d.ts.map +1 -1
  289. package/node_modules/@pierre/diffs/dist/utils/parseMergeConflictDiffFromFile.js +9 -6
  290. package/node_modules/@pierre/diffs/dist/utils/parseMergeConflictDiffFromFile.js.map +1 -1
  291. package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.d.ts.map +1 -1
  292. package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.js +6 -3
  293. package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.js.map +1 -1
  294. package/node_modules/@pierre/diffs/dist/utils/platform.d.ts +14 -0
  295. package/node_modules/@pierre/diffs/dist/utils/platform.d.ts.map +1 -0
  296. package/node_modules/@pierre/diffs/dist/utils/platform.js +32 -0
  297. package/node_modules/@pierre/diffs/dist/utils/platform.js.map +1 -0
  298. package/node_modules/@pierre/diffs/dist/utils/realignChangeContent.d.ts +33 -0
  299. package/node_modules/@pierre/diffs/dist/utils/realignChangeContent.d.ts.map +1 -0
  300. package/node_modules/@pierre/diffs/dist/utils/realignChangeContent.js +148 -0
  301. package/node_modules/@pierre/diffs/dist/utils/realignChangeContent.js.map +1 -0
  302. package/node_modules/@pierre/diffs/dist/utils/renderDiffWithHighlighter.js +1 -1
  303. package/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.d.ts.map +1 -1
  304. package/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.js +5 -14
  305. package/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.js.map +1 -1
  306. package/node_modules/@pierre/diffs/dist/utils/resolveRegion.d.ts.map +1 -1
  307. package/node_modules/@pierre/diffs/dist/utils/resolveRegion.js +18 -2
  308. package/node_modules/@pierre/diffs/dist/utils/resolveRegion.js.map +1 -1
  309. package/node_modules/@pierre/diffs/dist/utils/shouldUseTokenTransformer.d.ts +7 -3
  310. package/node_modules/@pierre/diffs/dist/utils/shouldUseTokenTransformer.d.ts.map +1 -1
  311. package/node_modules/@pierre/diffs/dist/utils/shouldUseTokenTransformer.js +1 -1
  312. package/node_modules/@pierre/diffs/dist/utils/shouldUseTokenTransformer.js.map +1 -1
  313. package/node_modules/@pierre/diffs/dist/utils/updateDiffHunks.d.ts +24 -0
  314. package/node_modules/@pierre/diffs/dist/utils/updateDiffHunks.d.ts.map +1 -0
  315. package/node_modules/@pierre/diffs/dist/utils/updateDiffHunks.js +236 -0
  316. package/node_modules/@pierre/diffs/dist/utils/updateDiffHunks.js.map +1 -0
  317. package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.d.ts +43 -2
  318. package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.d.ts.map +1 -1
  319. package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.js +107 -5
  320. package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.js.map +1 -1
  321. package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.d.ts +9 -3
  322. package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.d.ts.map +1 -1
  323. package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.js +86 -18
  324. package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.js.map +1 -1
  325. package/node_modules/@pierre/diffs/dist/worker/index.d.ts +2 -2
  326. package/node_modules/@pierre/diffs/dist/worker/types.d.ts +11 -1
  327. package/node_modules/@pierre/diffs/dist/worker/types.d.ts.map +1 -1
  328. package/node_modules/@pierre/diffs/dist/worker/wasm-B9ZqxnKj.js.map +1 -1
  329. package/node_modules/@pierre/diffs/dist/worker/worker-portable.js +116 -95
  330. package/node_modules/@pierre/diffs/dist/worker/worker-portable.js.map +1 -1
  331. package/node_modules/@pierre/diffs/dist/worker/worker.js +102 -80
  332. package/node_modules/@pierre/diffs/dist/worker/worker.js.map +1 -1
  333. package/node_modules/@pierre/diffs/node_modules/@pierre/theme/LICENSE +189 -21
  334. package/node_modules/@pierre/diffs/node_modules/@pierre/theme/NOTICE.md +32 -0
  335. package/node_modules/@pierre/diffs/node_modules/@pierre/theme/package.json +3 -2
  336. package/node_modules/@pierre/diffs/node_modules/@pierre/theming/LICENSE.md +189 -0
  337. package/node_modules/@pierre/diffs/node_modules/@pierre/theming/README.md +9 -0
  338. package/node_modules/@pierre/diffs/node_modules/@pierre/theming/package.json +5 -5
  339. package/node_modules/@pierre/diffs/node_modules/@shikijs/core/dist/index.d.mts +0 -1
  340. package/node_modules/@pierre/diffs/node_modules/@shikijs/core/dist/index.mjs +22 -3
  341. package/node_modules/@pierre/diffs/node_modules/@shikijs/core/package.json +4 -4
  342. package/node_modules/@pierre/diffs/node_modules/@shikijs/engine-javascript/dist/{engine-compile-CMRQUZTL.d.mts → engine-compile-Bdn9ihA2.d.mts} +0 -1
  343. package/node_modules/@pierre/diffs/node_modules/@shikijs/engine-javascript/dist/engine-compile.d.mts +1 -1
  344. package/node_modules/@pierre/diffs/node_modules/@shikijs/engine-javascript/dist/engine-raw.d.mts +0 -1
  345. package/node_modules/@pierre/diffs/node_modules/@shikijs/engine-javascript/dist/index.d.mts +1 -1
  346. package/node_modules/@pierre/diffs/node_modules/@shikijs/engine-javascript/package.json +2 -2
  347. package/node_modules/@pierre/diffs/node_modules/@shikijs/engine-oniguruma/package.json +2 -2
  348. package/node_modules/@pierre/diffs/node_modules/@shikijs/primitive/dist/index.d.mts +0 -1
  349. package/node_modules/@pierre/diffs/node_modules/@shikijs/primitive/package.json +3 -3
  350. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/catppuccin-frappe.mjs +1 -1
  351. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/catppuccin-latte.mjs +1 -1
  352. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/catppuccin-macchiato.mjs +1 -1
  353. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/catppuccin-mocha.mjs +1 -1
  354. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/kanagawa-dragon.mjs +1 -1
  355. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/kanagawa-lotus.mjs +1 -1
  356. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/kanagawa-wave.mjs +1 -1
  357. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/monokai.mjs +1 -1
  358. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/red.mjs +1 -1
  359. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/rose-pine-dawn.mjs +1 -1
  360. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/rose-pine-moon.mjs +1 -1
  361. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/rose-pine.mjs +1 -1
  362. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/solarized-dark.mjs +1 -1
  363. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/solarized-light.mjs +1 -1
  364. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/package.json +3 -3
  365. package/node_modules/@pierre/diffs/node_modules/@shikijs/transformers/dist/index.d.mts +0 -1
  366. package/node_modules/@pierre/diffs/node_modules/@shikijs/transformers/dist/index.mjs +2 -1
  367. package/node_modules/@pierre/diffs/node_modules/@shikijs/transformers/package.json +3 -3
  368. package/node_modules/@pierre/diffs/node_modules/@shikijs/types/dist/index.d.mts +0 -1
  369. package/node_modules/@pierre/diffs/node_modules/@shikijs/types/package.json +2 -2
  370. package/node_modules/@pierre/diffs/node_modules/shiki/dist/bundle-full.d.mts +4 -7
  371. package/node_modules/@pierre/diffs/node_modules/shiki/dist/bundle-full.mjs +3 -19
  372. package/node_modules/@pierre/diffs/node_modules/shiki/dist/bundle-web.d.mts +5 -6
  373. package/node_modules/@pierre/diffs/node_modules/shiki/dist/bundle-web.mjs +7 -0
  374. package/node_modules/@pierre/diffs/node_modules/shiki/dist/core-CaxrMD1A.d.mts +1 -0
  375. package/node_modules/@pierre/diffs/node_modules/shiki/dist/core.d.mts +1 -0
  376. package/node_modules/@pierre/diffs/node_modules/shiki/dist/index.d.mts +3 -9
  377. package/node_modules/@pierre/diffs/node_modules/shiki/dist/index.mjs +3 -24
  378. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/actionscript.d.mts +1 -0
  379. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/actionscript.mjs +1 -0
  380. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/ahk.d.mts +1 -0
  381. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/ahk.mjs +1 -0
  382. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/ahk1.d.mts +1 -0
  383. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/ahk1.mjs +1 -0
  384. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/ahk2.d.mts +1 -0
  385. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/ahk2.mjs +1 -0
  386. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/as3.d.mts +1 -0
  387. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/as3.mjs +1 -0
  388. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/chapel.d.mts +1 -0
  389. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/chapel.mjs +1 -0
  390. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/chpl.d.mts +1 -0
  391. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/chpl.mjs +1 -0
  392. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/justfile.d.mts +1 -0
  393. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/justfile.mjs +1 -0
  394. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/nsis.d.mts +1 -0
  395. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/nsis.mjs +1 -0
  396. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/org.d.mts +1 -0
  397. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/org.mjs +1 -0
  398. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/pwsh.d.mts +1 -0
  399. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/pwsh.mjs +1 -0
  400. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/rbs.d.mts +1 -0
  401. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/rbs.mjs +1 -0
  402. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/ruby-signature.d.mts +1 -0
  403. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/ruby-signature.mjs +1 -0
  404. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/smithy.d.mts +1 -0
  405. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/smithy.mjs +1 -0
  406. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs-B38xGbib.d.mts +1 -0
  407. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs-bundle-full-B4n9xYHw.d.mts +13 -0
  408. package/node_modules/@pierre/diffs/node_modules/shiki/dist/{langs-bundle-full-4noeO3oH.mjs → langs-bundle-full-xQVO1Cek.mjs} +48 -5
  409. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs.d.mts +2 -1
  410. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs.mjs +1 -1
  411. package/node_modules/@pierre/diffs/node_modules/shiki/dist/{themes-NeZbxnKu.d.mts → themes-BKdFAJ1v.d.mts} +0 -1
  412. package/node_modules/@pierre/diffs/node_modules/shiki/dist/themes.d.mts +1 -1
  413. package/node_modules/@pierre/diffs/node_modules/shiki/dist/types.d.mts +3 -3
  414. package/node_modules/@pierre/diffs/node_modules/shiki/package.json +10 -10
  415. package/node_modules/@pierre/diffs/package.json +13 -4
  416. package/node_modules/@shikijs/langs/dist/actionscript-3.mjs +1 -1
  417. package/node_modules/@shikijs/langs/dist/actionscript.d.mts +3 -0
  418. package/node_modules/@shikijs/langs/dist/actionscript.mjs +2 -0
  419. package/node_modules/@shikijs/langs/dist/ahk.d.mts +3 -0
  420. package/node_modules/@shikijs/langs/dist/ahk.mjs +5 -0
  421. package/node_modules/@shikijs/langs/dist/ahk1.d.mts +3 -0
  422. package/node_modules/@shikijs/langs/dist/ahk1.mjs +2 -0
  423. package/node_modules/@shikijs/langs/dist/ahk2.d.mts +3 -0
  424. package/node_modules/@shikijs/langs/dist/ahk2.mjs +5 -0
  425. package/node_modules/@shikijs/langs/dist/apex.mjs +1 -1
  426. package/node_modules/@shikijs/langs/dist/as3.d.mts +3 -0
  427. package/node_modules/@shikijs/langs/dist/as3.mjs +2 -0
  428. package/node_modules/@shikijs/langs/dist/asciidoc.mjs +1 -1
  429. package/node_modules/@shikijs/langs/dist/bat.mjs +1 -1
  430. package/node_modules/@shikijs/langs/dist/bird2.mjs +1 -1
  431. package/node_modules/@shikijs/langs/dist/bsl.mjs +1 -1
  432. package/node_modules/@shikijs/langs/dist/c3.mjs +1 -1
  433. package/node_modules/@shikijs/langs/dist/chapel.d.mts +3 -0
  434. package/node_modules/@shikijs/langs/dist/chapel.mjs +8 -0
  435. package/node_modules/@shikijs/langs/dist/chpl.d.mts +3 -0
  436. package/node_modules/@shikijs/langs/dist/chpl.mjs +2 -0
  437. package/node_modules/@shikijs/langs/dist/clarity.mjs +1 -1
  438. package/node_modules/@shikijs/langs/dist/cmd.mjs +2 -2
  439. package/node_modules/@shikijs/langs/dist/coq.mjs +1 -1
  440. package/node_modules/@shikijs/langs/dist/cpp-macro.mjs +1 -3
  441. package/node_modules/@shikijs/langs/dist/cpp.mjs +1 -3
  442. package/node_modules/@shikijs/langs/dist/emacs-lisp.mjs +1 -1
  443. package/node_modules/@shikijs/langs/dist/gdscript.mjs +1 -1
  444. package/node_modules/@shikijs/langs/dist/hack.mjs +1 -1
  445. package/node_modules/@shikijs/langs/dist/haxe.mjs +1 -1
  446. package/node_modules/@shikijs/langs/dist/hxml.mjs +1 -1
  447. package/node_modules/@shikijs/langs/dist/index.mjs +14 -0
  448. package/node_modules/@shikijs/langs/dist/just.mjs +1 -1
  449. package/node_modules/@shikijs/langs/dist/justfile.d.mts +3 -0
  450. package/node_modules/@shikijs/langs/dist/justfile.mjs +2 -0
  451. package/node_modules/@shikijs/langs/dist/llvm.mjs +1 -1
  452. package/node_modules/@shikijs/langs/dist/luau.mjs +1 -1
  453. package/node_modules/@shikijs/langs/dist/mdc.mjs +1 -1
  454. package/node_modules/@shikijs/langs/dist/mermaid.mjs +1 -1
  455. package/node_modules/@shikijs/langs/dist/mojo.mjs +1 -1
  456. package/node_modules/@shikijs/langs/dist/moonbit.mjs +1 -1
  457. package/node_modules/@shikijs/langs/dist/move.mjs +1 -1
  458. package/node_modules/@shikijs/langs/dist/nsis.d.mts +3 -0
  459. package/node_modules/@shikijs/langs/dist/nsis.mjs +5 -0
  460. package/node_modules/@shikijs/langs/dist/nushell.mjs +1 -1
  461. package/node_modules/@shikijs/langs/dist/org.d.mts +3 -0
  462. package/node_modules/@shikijs/langs/dist/org.mjs +100 -0
  463. package/node_modules/@shikijs/langs/dist/powershell.mjs +1 -1
  464. package/node_modules/@shikijs/langs/dist/prisma.mjs +1 -1
  465. package/node_modules/@shikijs/langs/dist/pwsh.d.mts +3 -0
  466. package/node_modules/@shikijs/langs/dist/pwsh.mjs +2 -0
  467. package/node_modules/@shikijs/langs/dist/r.mjs +1 -1
  468. package/node_modules/@shikijs/langs/dist/rbs.d.mts +3 -0
  469. package/node_modules/@shikijs/langs/dist/rbs.mjs +5 -0
  470. package/node_modules/@shikijs/langs/dist/ruby-signature.d.mts +3 -0
  471. package/node_modules/@shikijs/langs/dist/ruby-signature.mjs +2 -0
  472. package/node_modules/@shikijs/langs/dist/scala.mjs +1 -1
  473. package/node_modules/@shikijs/langs/dist/smalltalk.mjs +1 -1
  474. package/node_modules/@shikijs/langs/dist/smithy.d.mts +3 -0
  475. package/node_modules/@shikijs/langs/dist/smithy.mjs +5 -0
  476. package/node_modules/@shikijs/langs/dist/solidity.mjs +1 -1
  477. package/node_modules/@shikijs/langs/dist/surrealql.mjs +1 -1
  478. package/node_modules/@shikijs/langs/dist/swift.mjs +1 -1
  479. package/node_modules/@shikijs/langs/dist/system-verilog.mjs +1 -1
  480. package/node_modules/@shikijs/langs/dist/twig.mjs +1 -1
  481. package/node_modules/@shikijs/langs/dist/typst.mjs +116 -1
  482. package/node_modules/@shikijs/langs/dist/v.mjs +1 -1
  483. package/node_modules/@shikijs/langs/dist/vb.mjs +1 -1
  484. package/node_modules/@shikijs/langs/dist/verilog.mjs +1 -1
  485. package/node_modules/@shikijs/langs/dist/vue.mjs +1 -1
  486. package/node_modules/@shikijs/langs/node_modules/@shikijs/types/dist/index.d.mts +0 -1
  487. package/node_modules/@shikijs/langs/node_modules/@shikijs/types/package.json +2 -2
  488. package/node_modules/@shikijs/langs/package.json +18 -4
  489. package/node_modules/typebox/build/format/date.d.mts +1 -1
  490. package/node_modules/typebox/build/format/date.mjs +1 -1
  491. package/node_modules/typebox/build/format/date_time.d.mts +2 -2
  492. package/node_modules/typebox/build/format/date_time.mjs +3 -3
  493. package/node_modules/typebox/build/format/email.d.mts +1 -1
  494. package/node_modules/typebox/build/format/email.mjs +2 -2
  495. package/node_modules/typebox/build/format/hostname.mjs +2 -10
  496. package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
  497. package/node_modules/typebox/build/format/idn_email.mjs +3 -3
  498. package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
  499. package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
  500. package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
  501. package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
  502. package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
  503. package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
  504. package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
  505. package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
  506. package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
  507. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +41 -0
  508. package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
  509. package/node_modules/typebox/build/format/idna/index.mjs +2 -0
  510. package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
  511. package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
  512. package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
  513. package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
  514. package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
  515. package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
  516. package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
  517. package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
  518. package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
  519. package/node_modules/typebox/build/format/ipv4.mjs +2 -32
  520. package/node_modules/typebox/build/format/ipv6.mjs +2 -61
  521. package/node_modules/typebox/build/format/iri.d.mts +2 -2
  522. package/node_modules/typebox/build/format/iri.mjs +26 -8
  523. package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
  524. package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
  525. package/node_modules/typebox/build/format/regex.d.mts +1 -2
  526. package/node_modules/typebox/build/format/regex.mjs +2 -6
  527. package/node_modules/typebox/build/format/time.d.mts +2 -2
  528. package/node_modules/typebox/build/format/time.mjs +19 -14
  529. package/node_modules/typebox/build/format/uri.d.mts +1 -1
  530. package/node_modules/typebox/build/format/uri.mjs +3 -130
  531. package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
  532. package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
  533. package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
  534. package/node_modules/typebox/build/format/uri_template.mjs +4 -5
  535. package/node_modules/typebox/build/format/url.d.mts +3 -3
  536. package/node_modules/typebox/build/format/url.mjs +4 -5
  537. package/node_modules/typebox/build/guard/emit.d.mts +3 -1
  538. package/node_modules/typebox/build/guard/emit.mjs +12 -5
  539. package/node_modules/typebox/build/guard/guard.d.mts +8 -2
  540. package/node_modules/typebox/build/guard/guard.mjs +25 -4
  541. package/node_modules/typebox/build/guard/string.d.mts +2 -2
  542. package/node_modules/typebox/build/guard/string.mjs +7 -7
  543. package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
  544. package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
  545. package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
  546. package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
  547. package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
  548. package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
  549. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
  550. package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
  551. package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
  552. package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
  553. package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
  554. package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
  555. package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
  556. package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
  557. package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
  558. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
  559. package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
  560. package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
  561. package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
  562. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
  563. package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
  564. package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
  565. package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
  566. package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
  567. package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
  568. package/node_modules/typebox/build/schema/types/index.mjs +0 -2
  569. package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
  570. package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
  571. package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
  572. package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
  573. package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
  574. package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
  575. package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
  576. package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
  577. package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
  578. package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
  579. package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
  580. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
  581. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
  582. package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
  583. package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
  584. package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
  585. package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
  586. package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
  587. package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
  588. package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
  589. package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
  590. package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
  591. package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
  592. package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
  593. package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
  594. package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
  595. package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
  596. package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
  597. package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
  598. package/node_modules/typebox/build/type/script/parser.mjs +27 -23
  599. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
  600. package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
  601. package/node_modules/typebox/package.json +27 -27
  602. package/node_modules/typebox/readme.md +79 -82
  603. package/package.json +9 -8
  604. package/node_modules/@pierre/diffs/dist/utils/iterateOverFile.d.ts +0 -50
  605. package/node_modules/@pierre/diffs/dist/utils/iterateOverFile.d.ts.map +0 -1
  606. package/node_modules/@pierre/diffs/dist/utils/iterateOverFile.js +0 -49
  607. package/node_modules/@pierre/diffs/dist/utils/iterateOverFile.js.map +0 -1
  608. package/node_modules/@pierre/diffs/node_modules/shiki/dist/core-BVVgDSdq.d.mts +0 -1
  609. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs-BVVgDSdq.d.mts +0 -1
  610. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs-bundle-full-WSWgUeqW.d.mts +0 -14
  611. package/node_modules/typebox/build/format/_idna.d.mts +0 -2
  612. package/node_modules/typebox/build/format/_idna.mjs +0 -246
  613. package/node_modules/typebox/build/format/_puny.d.mts +0 -1
  614. package/node_modules/typebox/build/format/_puny.mjs +0 -77
  615. package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
  616. package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
  617. package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
  618. package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
  619. package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
  620. package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
@@ -0,0 +1,236 @@
1
+ import { getHunkSideEndBoundary, getHunkSideStartBoundary } from "./getHunkSideBoundaries.js";
2
+ import { cleanLastNewline } from "./cleanLastNewline.js";
3
+ import { parseDiffFromFile } from "./parseDiffFromFile.js";
4
+ import { hasTrailingContextMismatch } from "./virtualDiffLayout.js";
5
+ //#region src/utils/updateDiffHunks.ts
6
+ /** Rebuilds all hunk metadata from the current deletion/addition line arrays. */
7
+ function recomputeDiffHunks(diff, parseDiffOptions) {
8
+ const recomputed = parseDiffFromFile({
9
+ name: diff.prevName ?? diff.name,
10
+ contents: diff.deletionLines.join("")
11
+ }, {
12
+ name: diff.name,
13
+ contents: diff.additionLines.join(""),
14
+ lang: diff.lang
15
+ }, parseDiffOptions);
16
+ return {
17
+ hunks: recomputed.hunks,
18
+ splitLineCount: recomputed.splitLineCount,
19
+ unifiedLineCount: recomputed.unifiedLineCount,
20
+ additionLines: recomputed.additionLines,
21
+ deletionLines: recomputed.deletionLines,
22
+ type: recomputed.type
23
+ };
24
+ }
25
+ function buildTopAlignedAdditionSentinel(lineCount, deletionContents) {
26
+ const count = Math.max(lineCount, 1);
27
+ let sentinel = Array.from({ length: count }, (_, index) => `${" ".repeat(index + 1)}\n`).join("");
28
+ if (sentinel === deletionContents) sentinel = Array.from({ length: count }, (_, index) => `\u0000${" ".repeat(index)}\n`).join("");
29
+ return sentinel;
30
+ }
31
+ function hasOnlyBlankAdditionContents(additionLines) {
32
+ for (const line of additionLines) if (line.trim().length > 0) return false;
33
+ return true;
34
+ }
35
+ function shouldTopAlignAdditionRecompute(diff, additionLines) {
36
+ return additionLines.length > 0 && additionLines.length < diff.deletionLines.length && hasOnlyBlankAdditionContents(additionLines);
37
+ }
38
+ function recomputeTopAlignedAdditionDiff(diff, additionLines, parseDiffOptions) {
39
+ const deletionContents = diff.deletionLines.join("");
40
+ const additionSentinel = buildTopAlignedAdditionSentinel(additionLines.length, deletionContents);
41
+ const recomputed = parseDiffFromFile({
42
+ name: diff.prevName ?? diff.name,
43
+ contents: deletionContents
44
+ }, {
45
+ name: diff.name,
46
+ contents: additionSentinel,
47
+ lang: diff.lang
48
+ }, parseDiffOptions);
49
+ return {
50
+ hunks: recomputed.hunks,
51
+ splitLineCount: recomputed.splitLineCount,
52
+ unifiedLineCount: recomputed.unifiedLineCount,
53
+ additionLines,
54
+ deletionLines: recomputed.deletionLines,
55
+ type: recomputed.type
56
+ };
57
+ }
58
+ function recomputeEmptyDocumentDiff(diff, parseDiffOptions) {
59
+ return recomputeTopAlignedAdditionDiff(diff, [""], parseDiffOptions);
60
+ }
61
+ /** Rebuilds diff hunks after an edit, top-aligning sparse addition sides when needed. */
62
+ function recomputeDiffHunksForEdit(diff, parseDiffOptions) {
63
+ if (diff.additionLines.length === 0) return recomputeEmptyDocumentDiff(diff, parseDiffOptions);
64
+ if (shouldTopAlignAdditionRecompute(diff, diff.additionLines)) return recomputeTopAlignedAdditionDiff(diff, diff.additionLines, parseDiffOptions);
65
+ const additionLines = diff.additionLines;
66
+ const recomputed = recomputeDiffHunks(diff, parseDiffOptions);
67
+ preserveTrailingEditorBlankLine(recomputed, additionLines);
68
+ return recomputed;
69
+ }
70
+ function hasTrailingEditorBlankLine(additionLines) {
71
+ return additionLines.length > 1 && additionLines.at(-1) === "";
72
+ }
73
+ function preserveTrailingEditorBlankLine(recomputed, additionLines) {
74
+ if (!hasTrailingEditorBlankLine(additionLines)) return;
75
+ const extraLineCount = additionLines.length - recomputed.additionLines.length;
76
+ if (extraLineCount <= 0) return;
77
+ const extraAdditionLineIndex = recomputed.additionLines.length;
78
+ const lastHunk = recomputed.hunks.at(-1);
79
+ if (lastHunk == null) return;
80
+ if (getHunkSideEndBoundary(lastHunk.additionStart, lastHunk.additionCount) !== extraAdditionLineIndex) return;
81
+ for (const content of lastHunk.hunkContent) if (content.type === "change" && content.additions < content.deletions && content.additionLineIndex + content.additions === extraAdditionLineIndex) {
82
+ recomputed.additionLines = additionLines;
83
+ content.additions += extraLineCount;
84
+ lastHunk.additionCount += extraLineCount;
85
+ lastHunk.additionLines += extraLineCount;
86
+ recomputeDiffRenderLineCounts(recomputed);
87
+ return;
88
+ }
89
+ }
90
+ /** Updates hunk metadata after addition lines change; re-parses affected hunks only. */
91
+ function updateDiffHunks(diff, changedAdditionLineIndexes, parseDiffOptions) {
92
+ if (diff.isPartial) return applyHunkUpdateResult(diff, recomputeDiffHunks(diff, parseDiffOptions));
93
+ if (diff.deletionLines.length !== diff.additionLines.length) return applyHunkUpdateResult(diff, recomputeDiffHunks(diff, parseDiffOptions));
94
+ const changedLines = Array.from(changedAdditionLineIndexes);
95
+ if (changedLines.length === 0) return applyHunkUpdateResult(diff, {
96
+ hunks: diff.hunks,
97
+ splitLineCount: diff.splitLineCount,
98
+ unifiedLineCount: diff.unifiedLineCount,
99
+ type: diff.type
100
+ });
101
+ for (const line of changedLines) {
102
+ const additionLine = diff.additionLines[line];
103
+ const deletionLine = diff.deletionLines[line];
104
+ if (additionLine == null || deletionLine == null) return applyHunkUpdateResult(diff, recomputeDiffHunks(diff, parseDiffOptions));
105
+ if (cleanLastNewline(additionLine) === cleanLastNewline(deletionLine)) return applyHunkUpdateResult(diff, recomputeDiffHunks(diff, parseDiffOptions));
106
+ }
107
+ const affectedHunkIndexes = getAffectedHunkIndexes(diff, changedLines);
108
+ if (affectedHunkIndexes.size === 0) return applyHunkUpdateResult(diff, recomputeDiffHunks(diff, parseDiffOptions));
109
+ for (const hunkIndex of affectedHunkIndexes) if (!reparseHunkRegion(diff, hunkIndex, parseDiffOptions)) return applyHunkUpdateResult(diff, recomputeDiffHunks(diff, parseDiffOptions));
110
+ recomputeDiffRenderLineCounts(diff);
111
+ if (hasTrailingContextMismatch(diff)) return applyHunkUpdateResult(diff, recomputeDiffHunks(diff, parseDiffOptions));
112
+ return applyHunkUpdateResult(diff, {
113
+ hunks: diff.hunks,
114
+ splitLineCount: diff.splitLineCount,
115
+ unifiedLineCount: diff.unifiedLineCount,
116
+ type: diff.type
117
+ });
118
+ }
119
+ function applyHunkUpdateResult(diff, result) {
120
+ Object.assign(diff, result);
121
+ return result;
122
+ }
123
+ function getAffectedHunkIndexes(diff, changedAdditionLineIndexes) {
124
+ const indexes = /* @__PURE__ */ new Set();
125
+ for (const line of changedAdditionLineIndexes) {
126
+ const hunkIndex = findHunkIndexForAdditionLine(diff, line);
127
+ if (hunkIndex == null) return /* @__PURE__ */ new Set();
128
+ indexes.add(hunkIndex);
129
+ }
130
+ return indexes;
131
+ }
132
+ function findHunkIndexForAdditionLine(diff, line) {
133
+ for (const [hunkIndex, hunk] of diff.hunks.entries()) {
134
+ const end = hunk.additionLineIndex + hunk.additionCount;
135
+ if (line >= hunk.additionLineIndex && line < end) return hunkIndex;
136
+ }
137
+ }
138
+ function reparseHunkRegion(diff, hunkIndex, parseDiffOptions) {
139
+ const hunk = diff.hunks[hunkIndex];
140
+ if (hunk == null) return false;
141
+ const deletionSlice = diff.deletionLines.slice(hunk.deletionLineIndex, hunk.deletionLineIndex + hunk.deletionCount);
142
+ const additionSlice = diff.additionLines.slice(hunk.additionLineIndex, hunk.additionLineIndex + hunk.additionCount);
143
+ const reparsed = parseDiffFromFile({
144
+ name: diff.prevName ?? diff.name,
145
+ contents: deletionSlice.join("")
146
+ }, {
147
+ name: diff.name,
148
+ contents: additionSlice.join(""),
149
+ lang: diff.lang
150
+ }, {
151
+ ...parseDiffOptions,
152
+ context: 0
153
+ });
154
+ const reparsedHunk = reparsed.hunks[0];
155
+ if (reparsedHunk == null || reparsed.hunks.length !== 1) return false;
156
+ applyReparsedHunk(hunk, reparsedHunk);
157
+ syncHunkNoEOFCRFromFullFile(diff, hunkIndex);
158
+ return true;
159
+ }
160
+ function syncHunkNoEOFCRFromFullFile(diff, hunkIndex) {
161
+ const hunk = diff.hunks[hunkIndex];
162
+ if (hunk == null) return;
163
+ if (!(hunkIndex === diff.hunks.length - 1)) {
164
+ hunk.noEOFCRAdditions = false;
165
+ hunk.noEOFCRDeletions = false;
166
+ return;
167
+ }
168
+ const lastAdditionLine = diff.additionLines.at(-1);
169
+ const lastDeletionLine = diff.deletionLines.at(-1);
170
+ hunk.noEOFCRAdditions = lastAdditionLine != null && lastAdditionLine !== "" && !lastAdditionLine.endsWith("\n");
171
+ hunk.noEOFCRDeletions = lastDeletionLine != null && lastDeletionLine !== "" && !lastDeletionLine.endsWith("\n");
172
+ }
173
+ function applyReparsedHunk(target, parsed) {
174
+ const additionOffset = target.additionLineIndex;
175
+ const deletionOffset = target.deletionLineIndex;
176
+ target.hunkContent = parsed.hunkContent.map((content) => offsetHunkContent(content, additionOffset, deletionOffset));
177
+ target.additionLineIndex = additionOffset + parsed.additionLineIndex;
178
+ target.additionStart = target.additionStart + parsed.additionLineIndex;
179
+ target.additionCount = parsed.additionCount;
180
+ target.additionLines = parsed.additionLines;
181
+ if (parsed.deletionLineIndex >= 0) {
182
+ target.deletionLineIndex = deletionOffset + parsed.deletionLineIndex;
183
+ target.deletionStart = target.deletionStart + parsed.deletionLineIndex;
184
+ }
185
+ target.deletionCount = parsed.deletionCount;
186
+ target.deletionLines = parsed.deletionLines;
187
+ target.noEOFCRAdditions = parsed.noEOFCRAdditions;
188
+ target.noEOFCRDeletions = parsed.noEOFCRDeletions;
189
+ recomputeHunkRenderLineCounts(target);
190
+ }
191
+ function offsetHunkContent(content, additionOffset, deletionOffset) {
192
+ return {
193
+ ...content,
194
+ additionLineIndex: content.additionLineIndex + additionOffset,
195
+ deletionLineIndex: content.deletionLineIndex + deletionOffset
196
+ };
197
+ }
198
+ function recomputeHunkRenderLineCounts(hunk) {
199
+ let splitLineCount = 0;
200
+ let unifiedLineCount = 0;
201
+ for (const content of hunk.hunkContent) if (content.type === "context") {
202
+ splitLineCount += content.lines;
203
+ unifiedLineCount += content.lines;
204
+ } else {
205
+ splitLineCount += Math.max(content.additions, content.deletions);
206
+ unifiedLineCount += content.additions + content.deletions;
207
+ }
208
+ hunk.splitLineCount = splitLineCount;
209
+ hunk.unifiedLineCount = unifiedLineCount;
210
+ }
211
+ function recomputeDiffRenderLineCounts(diff) {
212
+ let splitTotal = 0;
213
+ let unifiedTotal = 0;
214
+ let lastHunkAdditionEnd = 0;
215
+ for (const hunk of diff.hunks) {
216
+ hunk.collapsedBefore = Math.max(getHunkSideStartBoundary(hunk.additionStart, hunk.additionCount) - lastHunkAdditionEnd, 0);
217
+ hunk.splitLineStart = splitTotal + hunk.collapsedBefore;
218
+ hunk.unifiedLineStart = unifiedTotal + hunk.collapsedBefore;
219
+ recomputeHunkRenderLineCounts(hunk);
220
+ splitTotal += hunk.collapsedBefore + hunk.splitLineCount;
221
+ unifiedTotal += hunk.collapsedBefore + hunk.unifiedLineCount;
222
+ lastHunkAdditionEnd = getHunkSideEndBoundary(hunk.additionStart, hunk.additionCount);
223
+ }
224
+ if (diff.hunks.length > 0) {
225
+ const lastHunk = diff.hunks[diff.hunks.length - 1];
226
+ const collapsedAfter = Math.max(diff.additionLines.length - getHunkSideEndBoundary(lastHunk.additionStart, lastHunk.additionCount), 0);
227
+ splitTotal += collapsedAfter;
228
+ unifiedTotal += collapsedAfter;
229
+ }
230
+ diff.splitLineCount = splitTotal;
231
+ diff.unifiedLineCount = unifiedTotal;
232
+ }
233
+ //#endregion
234
+ export { offsetHunkContent, preserveTrailingEditorBlankLine, recomputeDiffHunks, recomputeDiffHunksForEdit, recomputeDiffRenderLineCounts, recomputeEmptyDocumentDiff, recomputeHunkRenderLineCounts, recomputeTopAlignedAdditionDiff, shouldTopAlignAdditionRecompute, syncHunkNoEOFCRFromFullFile, updateDiffHunks };
235
+
236
+ //# sourceMappingURL=updateDiffHunks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateDiffHunks.js","names":[],"sources":["../../src/utils/updateDiffHunks.ts"],"sourcesContent":["import type { CreatePatchOptionsNonabortable } from 'diff';\n\nimport type {\n ChangeContent,\n ContextContent,\n FileDiffMetadata,\n Hunk,\n} from '../types';\nimport { cleanLastNewline } from './cleanLastNewline';\nimport {\n getHunkSideEndBoundary,\n getHunkSideStartBoundary,\n} from './getHunkSideBoundaries';\nimport { parseDiffFromFile } from './parseDiffFromFile';\nimport { hasTrailingContextMismatch } from './virtualDiffLayout';\n\ntype HunkContent = ContextContent | ChangeContent;\n\ntype HunkMetadataUpdate = Pick<\n FileDiffMetadata,\n 'hunks' | 'splitLineCount' | 'unifiedLineCount' | 'type'\n>;\n\ntype FullDiffHunkUpdate = HunkMetadataUpdate &\n Pick<FileDiffMetadata, 'additionLines' | 'deletionLines'>;\n\n/** Rebuilds all hunk metadata from the current deletion/addition line arrays. */\nexport function recomputeDiffHunks(\n diff: FileDiffMetadata,\n parseDiffOptions?: CreatePatchOptionsNonabortable\n): FullDiffHunkUpdate {\n const recomputed = parseDiffFromFile(\n {\n name: diff.prevName ?? diff.name,\n contents: diff.deletionLines.join(''),\n },\n {\n name: diff.name,\n contents: diff.additionLines.join(''),\n lang: diff.lang,\n },\n parseDiffOptions\n );\n return {\n hunks: recomputed.hunks,\n splitLineCount: recomputed.splitLineCount,\n unifiedLineCount: recomputed.unifiedLineCount,\n additionLines: recomputed.additionLines,\n deletionLines: recomputed.deletionLines,\n type: recomputed.type,\n };\n}\n\n// Builds placeholder addition contents that diff as one top-aligned change row per\n// line. Bare `\\\\n` sentinels align as context against the first deletion lines,\n// which pushes the real addition rows down in split view.\nfunction buildTopAlignedAdditionSentinel(\n lineCount: number,\n deletionContents: string\n): string {\n const count = Math.max(lineCount, 1);\n let sentinel = Array.from(\n { length: count },\n (_, index) => `${' '.repeat(index + 1)}\\n`\n ).join('');\n if (sentinel === deletionContents) {\n sentinel = Array.from(\n { length: count },\n (_, index) => `\\u0000${' '.repeat(index)}\\n`\n ).join('');\n }\n return sentinel;\n}\n\nfunction hasOnlyBlankAdditionContents(additionLines: string[]): boolean {\n for (const line of additionLines) {\n if (line.trim().length > 0) {\n return false;\n }\n }\n return true;\n}\n\n// After delete-all the editable side is blank and much shorter than the deletion\n// side. A normal recompute can still treat newline-only additions as context and\n// render the first editable row deep in split view instead of at the top.\nexport function shouldTopAlignAdditionRecompute(\n diff: FileDiffMetadata,\n additionLines: string[]\n): boolean {\n return (\n additionLines.length > 0 &&\n additionLines.length < diff.deletionLines.length &&\n hasOnlyBlankAdditionContents(additionLines)\n );\n}\n\n// Rebuilds hunk metadata while keeping the editable addition rows top-aligned in\n// split view. The sentinel only shapes hunks; the caller's addition lines are\n// preserved so the editor document stays the source of truth.\nexport function recomputeTopAlignedAdditionDiff(\n diff: FileDiffMetadata,\n additionLines: string[],\n parseDiffOptions?: CreatePatchOptionsNonabortable\n): FullDiffHunkUpdate {\n const deletionContents = diff.deletionLines.join('');\n const additionSentinel = buildTopAlignedAdditionSentinel(\n additionLines.length,\n deletionContents\n );\n const recomputed = parseDiffFromFile(\n {\n name: diff.prevName ?? diff.name,\n contents: deletionContents,\n },\n {\n name: diff.name,\n contents: additionSentinel,\n lang: diff.lang,\n },\n parseDiffOptions\n );\n return {\n hunks: recomputed.hunks,\n splitLineCount: recomputed.splitLineCount,\n unifiedLineCount: recomputed.unifiedLineCount,\n additionLines,\n deletionLines: recomputed.deletionLines,\n type: recomputed.type,\n };\n}\n\n// Rebuilds hunk metadata when the editable side has been emptied of all text.\n//\n// The editor always keeps one (empty) line for an empty document, but an empty\n// string splits into zero addition lines, so a normal recompute produces a diff\n// with no addition rows at all. Rendering that leaves the attached editor with\n// no line element to host its caret.\nexport function recomputeEmptyDocumentDiff(\n diff: FileDiffMetadata,\n parseDiffOptions?: CreatePatchOptionsNonabortable\n): FullDiffHunkUpdate {\n return recomputeTopAlignedAdditionDiff(diff, [''], parseDiffOptions);\n}\n\n/** Rebuilds diff hunks after an edit, top-aligning sparse addition sides when needed. */\nexport function recomputeDiffHunksForEdit(\n diff: FileDiffMetadata,\n parseDiffOptions?: CreatePatchOptionsNonabortable\n): FullDiffHunkUpdate {\n if (diff.additionLines.length === 0) {\n return recomputeEmptyDocumentDiff(diff, parseDiffOptions);\n }\n if (shouldTopAlignAdditionRecompute(diff, diff.additionLines)) {\n return recomputeTopAlignedAdditionDiff(\n diff,\n diff.additionLines,\n parseDiffOptions\n );\n }\n const additionLines = diff.additionLines;\n const recomputed = recomputeDiffHunks(diff, parseDiffOptions);\n preserveTrailingEditorBlankLine(recomputed, additionLines);\n return recomputed;\n}\n\nfunction hasTrailingEditorBlankLine(additionLines: string[]): boolean {\n return additionLines.length > 1 && additionLines.at(-1) === '';\n}\n\n// Re-adds the editor's phantom trailing empty line (a document ending in a\n// newline exposes one extra empty line) as an addition row when the last\n// hunk's final change block can absorb it, so the caret keeps a rendered row.\nexport function preserveTrailingEditorBlankLine(\n recomputed: Pick<\n FullDiffHunkUpdate,\n 'hunks' | 'additionLines' | 'splitLineCount' | 'unifiedLineCount'\n >,\n additionLines: string[]\n): void {\n if (!hasTrailingEditorBlankLine(additionLines)) {\n return;\n }\n const extraLineCount = additionLines.length - recomputed.additionLines.length;\n if (extraLineCount <= 0) {\n return;\n }\n const extraAdditionLineIndex = recomputed.additionLines.length;\n\n const lastHunk = recomputed.hunks.at(-1);\n if (lastHunk == null) {\n return;\n }\n\n const lastHunkAdditionEnd = getHunkSideEndBoundary(\n lastHunk.additionStart,\n lastHunk.additionCount\n );\n if (lastHunkAdditionEnd !== extraAdditionLineIndex) {\n return;\n }\n\n for (const content of lastHunk.hunkContent) {\n if (\n content.type === 'change' &&\n content.additions < content.deletions &&\n content.additionLineIndex + content.additions === extraAdditionLineIndex\n ) {\n recomputed.additionLines = additionLines;\n content.additions += extraLineCount;\n lastHunk.additionCount += extraLineCount;\n lastHunk.additionLines += extraLineCount;\n recomputeDiffRenderLineCounts(recomputed);\n return;\n }\n }\n}\n\n/** Updates hunk metadata after addition lines change; re-parses affected hunks only. */\nexport function updateDiffHunks(\n diff: FileDiffMetadata,\n changedAdditionLineIndexes: Iterable<number>,\n parseDiffOptions?: CreatePatchOptionsNonabortable\n): HunkMetadataUpdate {\n if (diff.isPartial) {\n return applyHunkUpdateResult(\n diff,\n recomputeDiffHunks(diff, parseDiffOptions)\n );\n }\n\n if (diff.deletionLines.length !== diff.additionLines.length) {\n return applyHunkUpdateResult(\n diff,\n recomputeDiffHunks(diff, parseDiffOptions)\n );\n }\n\n const changedLines = Array.from(changedAdditionLineIndexes);\n if (changedLines.length === 0) {\n return applyHunkUpdateResult(diff, {\n hunks: diff.hunks,\n splitLineCount: diff.splitLineCount,\n unifiedLineCount: diff.unifiedLineCount,\n type: diff.type,\n });\n }\n for (const line of changedLines) {\n const additionLine = diff.additionLines[line];\n const deletionLine = diff.deletionLines[line];\n if (additionLine == null || deletionLine == null) {\n return applyHunkUpdateResult(\n diff,\n recomputeDiffHunks(diff, parseDiffOptions)\n );\n }\n // Restoring a line to the old side can merge/split hunks across context windows.\n if (cleanLastNewline(additionLine) === cleanLastNewline(deletionLine)) {\n return applyHunkUpdateResult(\n diff,\n recomputeDiffHunks(diff, parseDiffOptions)\n );\n }\n }\n\n const affectedHunkIndexes = getAffectedHunkIndexes(diff, changedLines);\n if (affectedHunkIndexes.size === 0) {\n return applyHunkUpdateResult(\n diff,\n recomputeDiffHunks(diff, parseDiffOptions)\n );\n }\n\n for (const hunkIndex of affectedHunkIndexes) {\n const updated = reparseHunkRegion(diff, hunkIndex, parseDiffOptions);\n if (!updated) {\n return applyHunkUpdateResult(\n diff,\n recomputeDiffHunks(diff, parseDiffOptions)\n );\n }\n }\n\n recomputeDiffRenderLineCounts(diff);\n\n if (hasTrailingContextMismatch(diff)) {\n return applyHunkUpdateResult(\n diff,\n recomputeDiffHunks(diff, parseDiffOptions)\n );\n }\n\n return applyHunkUpdateResult(diff, {\n hunks: diff.hunks,\n splitLineCount: diff.splitLineCount,\n unifiedLineCount: diff.unifiedLineCount,\n type: diff.type,\n });\n}\n\nfunction applyHunkUpdateResult<T extends HunkMetadataUpdate>(\n diff: FileDiffMetadata,\n result: T\n): T {\n Object.assign(diff, result);\n return result;\n}\n\nfunction getAffectedHunkIndexes(\n diff: FileDiffMetadata,\n changedAdditionLineIndexes: Iterable<number>\n): Set<number> {\n const indexes = new Set<number>();\n for (const line of changedAdditionLineIndexes) {\n const hunkIndex = findHunkIndexForAdditionLine(diff, line);\n if (hunkIndex == null) {\n return new Set();\n }\n indexes.add(hunkIndex);\n }\n return indexes;\n}\n\nfunction findHunkIndexForAdditionLine(\n diff: FileDiffMetadata,\n line: number\n): number | undefined {\n for (const [hunkIndex, hunk] of diff.hunks.entries()) {\n const end = hunk.additionLineIndex + hunk.additionCount;\n if (line >= hunk.additionLineIndex && line < end) {\n return hunkIndex;\n }\n }\n return undefined;\n}\n\nfunction reparseHunkRegion(\n diff: FileDiffMetadata,\n hunkIndex: number,\n parseDiffOptions?: CreatePatchOptionsNonabortable\n): boolean {\n const hunk = diff.hunks[hunkIndex];\n if (hunk == null) {\n return false;\n }\n\n const deletionSlice = diff.deletionLines.slice(\n hunk.deletionLineIndex,\n hunk.deletionLineIndex + hunk.deletionCount\n );\n const additionSlice = diff.additionLines.slice(\n hunk.additionLineIndex,\n hunk.additionLineIndex + hunk.additionCount\n );\n\n const reparsed = parseDiffFromFile(\n {\n name: diff.prevName ?? diff.name,\n contents: deletionSlice.join(''),\n },\n {\n name: diff.name,\n contents: additionSlice.join(''),\n lang: diff.lang,\n },\n { ...parseDiffOptions, context: 0 }\n );\n\n const reparsedHunk = reparsed.hunks[0];\n if (reparsedHunk == null || reparsed.hunks.length !== 1) {\n return false;\n }\n\n applyReparsedHunk(hunk, reparsedHunk);\n syncHunkNoEOFCRFromFullFile(diff, hunkIndex);\n return true;\n}\n\nexport function syncHunkNoEOFCRFromFullFile(\n diff: FileDiffMetadata,\n hunkIndex: number\n): void {\n const hunk = diff.hunks[hunkIndex];\n if (hunk == null) {\n return;\n }\n\n const isLastHunk = hunkIndex === diff.hunks.length - 1;\n if (!isLastHunk) {\n hunk.noEOFCRAdditions = false;\n hunk.noEOFCRDeletions = false;\n return;\n }\n\n const lastAdditionLine = diff.additionLines.at(-1);\n const lastDeletionLine = diff.deletionLines.at(-1);\n hunk.noEOFCRAdditions =\n lastAdditionLine != null &&\n lastAdditionLine !== '' &&\n !lastAdditionLine.endsWith('\\n');\n hunk.noEOFCRDeletions =\n lastDeletionLine != null &&\n lastDeletionLine !== '' &&\n !lastDeletionLine.endsWith('\\n');\n}\n\nfunction applyReparsedHunk(target: Hunk, parsed: Hunk): void {\n const additionOffset = target.additionLineIndex;\n const deletionOffset = target.deletionLineIndex;\n\n target.hunkContent = parsed.hunkContent.map((content) =>\n offsetHunkContent(content, additionOffset, deletionOffset)\n );\n target.additionLineIndex = additionOffset + parsed.additionLineIndex;\n target.additionStart = target.additionStart + parsed.additionLineIndex;\n target.additionCount = parsed.additionCount;\n target.additionLines = parsed.additionLines;\n if (parsed.deletionLineIndex >= 0) {\n target.deletionLineIndex = deletionOffset + parsed.deletionLineIndex;\n target.deletionStart = target.deletionStart + parsed.deletionLineIndex;\n }\n target.deletionCount = parsed.deletionCount;\n target.deletionLines = parsed.deletionLines;\n target.noEOFCRAdditions = parsed.noEOFCRAdditions;\n target.noEOFCRDeletions = parsed.noEOFCRDeletions;\n\n recomputeHunkRenderLineCounts(target);\n}\n\nexport function offsetHunkContent(\n content: HunkContent,\n additionOffset: number,\n deletionOffset: number\n): HunkContent {\n return {\n ...content,\n additionLineIndex: content.additionLineIndex + additionOffset,\n deletionLineIndex: content.deletionLineIndex + deletionOffset,\n };\n}\n\nexport function recomputeHunkRenderLineCounts(hunk: Hunk): void {\n let splitLineCount = 0;\n let unifiedLineCount = 0;\n\n for (const content of hunk.hunkContent) {\n if (content.type === 'context') {\n splitLineCount += content.lines;\n unifiedLineCount += content.lines;\n } else {\n splitLineCount += Math.max(content.additions, content.deletions);\n unifiedLineCount += content.additions + content.deletions;\n }\n }\n\n hunk.splitLineCount = splitLineCount;\n hunk.unifiedLineCount = unifiedLineCount;\n}\n\nexport function recomputeDiffRenderLineCounts(\n diff: Pick<\n FileDiffMetadata,\n 'hunks' | 'splitLineCount' | 'unifiedLineCount' | 'additionLines'\n >\n): void {\n let splitTotal = 0;\n let unifiedTotal = 0;\n let lastHunkAdditionEnd = 0;\n\n for (const hunk of diff.hunks) {\n hunk.collapsedBefore = Math.max(\n getHunkSideStartBoundary(hunk.additionStart, hunk.additionCount) -\n lastHunkAdditionEnd,\n 0\n );\n hunk.splitLineStart = splitTotal + hunk.collapsedBefore;\n hunk.unifiedLineStart = unifiedTotal + hunk.collapsedBefore;\n\n recomputeHunkRenderLineCounts(hunk);\n\n splitTotal += hunk.collapsedBefore + hunk.splitLineCount;\n unifiedTotal += hunk.collapsedBefore + hunk.unifiedLineCount;\n lastHunkAdditionEnd = getHunkSideEndBoundary(\n hunk.additionStart,\n hunk.additionCount\n );\n }\n\n if (diff.hunks.length > 0) {\n const lastHunk = diff.hunks[diff.hunks.length - 1];\n const collapsedAfter = Math.max(\n diff.additionLines.length -\n getHunkSideEndBoundary(lastHunk.additionStart, lastHunk.additionCount),\n 0\n );\n splitTotal += collapsedAfter;\n unifiedTotal += collapsedAfter;\n }\n\n diff.splitLineCount = splitTotal;\n diff.unifiedLineCount = unifiedTotal;\n}\n"],"mappings":";;;;;;AA2BA,SAAgB,mBACd,MACA,kBACoB;CACpB,MAAM,aAAa,kBACjB;EACE,MAAM,KAAK,YAAY,KAAK;EAC5B,UAAU,KAAK,cAAc,KAAK,EAAE;CACtC,GACA;EACE,MAAM,KAAK;EACX,UAAU,KAAK,cAAc,KAAK,EAAE;EACpC,MAAM,KAAK;CACb,GACA,gBACF;CACA,OAAO;EACL,OAAO,WAAW;EAClB,gBAAgB,WAAW;EAC3B,kBAAkB,WAAW;EAC7B,eAAe,WAAW;EAC1B,eAAe,WAAW;EAC1B,MAAM,WAAW;CACnB;AACF;AAKA,SAAS,gCACP,WACA,kBACQ;CACR,MAAM,QAAQ,KAAK,IAAI,WAAW,CAAC;CACnC,IAAI,WAAW,MAAM,KACnB,EAAE,QAAQ,MAAM,IACf,GAAG,UAAU,GAAG,IAAI,OAAO,QAAQ,CAAC,EAAE,GACzC,CAAC,CAAC,KAAK,EAAE;CACT,IAAI,aAAa,kBACf,WAAW,MAAM,KACf,EAAE,QAAQ,MAAM,IACf,GAAG,UAAU,SAAS,IAAI,OAAO,KAAK,EAAE,GAC3C,CAAC,CAAC,KAAK,EAAE;CAEX,OAAO;AACT;AAEA,SAAS,6BAA6B,eAAkC;CACtE,KAAK,MAAM,QAAQ,eACjB,IAAI,KAAK,KAAK,CAAC,CAAC,SAAS,GACvB,OAAO;CAGX,OAAO;AACT;AAKA,SAAgB,gCACd,MACA,eACS;CACT,OACE,cAAc,SAAS,KACvB,cAAc,SAAS,KAAK,cAAc,UAC1C,6BAA6B,aAAa;AAE9C;AAKA,SAAgB,gCACd,MACA,eACA,kBAC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Q,WAAW,QAAQ,SAAS;EAC/D,oBAAoB,QAAQ,YAAY,QAAQ;CAClD;CAGF,KAAK,iBAAiB;CACtB,KAAK,mBAAmB;AAC1B;AAEA,SAAgB,8BACd,MAIM;CACN,IAAI,aAAa;CACjB,IAAI,eAAe;CACnB,IAAI,sBAAsB;CAE1B,KAAK,MAAM,QAAQ,KAAK,OAAO;EAC7B,KAAK,kBAAkB,KAAK,IAC1B,yBAAyB,KAAK,eAAe,KAAK,aAAa,IAC7D,qBACF,CACF;EACA,KAAK,iBAAiB,aAAa,KAAK;EACxC,KAAK,mBAAmB,eAAe,KAAK;EAE5C,8BAA8B,IAAI;EAElC,cAAc,KAAK,kBAAkB,KAAK;EAC1C,gBAAgB,KAAK,kBAAkB,KAAK;EAC5C,sBAAsB,uBACpB,KAAK,eACL,KAAK,aACP;CACF;CAEA,IAAI,KAAK,MAAM,SAAS,GAAG;EACzB,MAAM,WAAW,KAAK,MAAM,KAAK,MAAM,SAAS;EAChD,MAAM,iBAAiB,KAAK,IAC1B,KAAK,cAAc,SACjB,uBAAuB,SAAS,eAAe,SAAS,aAAa,GACvE,CACF;EACA,cAAc;EACd,gBAAgB;CAClB;CAEA,KAAK,iBAAiB;CACtB,KAAK,mBAAmB;AAC1B"}
@@ -1,4 +1,4 @@
1
- import { FileDiffMetadata, HunkExpansionRegion, HunkSeparators, VirtualFileMetrics } from "../types.js";
1
+ import { FileDiffMetadata, Hunk, HunkExpansionRegion, HunkSeparators, VirtualFileMetrics } from "../types.js";
2
2
 
3
3
  //#region src/utils/virtualDiffLayout.d.ts
4
4
  interface ExpandedRegionResult {
@@ -24,6 +24,8 @@ interface GetTrailingExpandedRegionProps extends GetTrailingContextRangeSizeProp
24
24
  expandedHunks: GetExpandedRegionProps['expandedHunks'];
25
25
  collapsedContextThreshold: number;
26
26
  }
27
+ /** One-based new-file line range covered by a hunk, as `[start, end)`. */
28
+ declare function getHunkAdditionLineRange(hunk: Hunk): [number, number];
27
29
  interface HunkSeparatorLayout {
28
30
  height: number;
29
31
  gapBefore: number;
@@ -46,6 +48,7 @@ declare function getExpandedRegion({
46
48
  collapsedContextThreshold
47
49
  }: GetExpandedRegionProps): ExpandedRegionResult;
48
50
  declare function hasTrailingContext(fileDiff: FileDiffMetadata): boolean;
51
+ declare function hasTrailingContextMismatch(fileDiff: FileDiffMetadata): boolean;
49
52
  declare function getTrailingContextRangeSize({
50
53
  fileDiff,
51
54
  errorPrefix
@@ -57,6 +60,44 @@ declare function getTrailingExpandedRegion({
57
60
  collapsedContextThreshold,
58
61
  errorPrefix
59
62
  }: GetTrailingExpandedRegionProps): ExpandedRegionResult | undefined;
63
+ interface IsAdditionLineRenderableProps {
64
+ fileDiff: FileDiffMetadata;
65
+ /** One-based line number in the new file. */
66
+ lineNumber: number;
67
+ expandedHunks: Map<number, HunkExpansionRegion> | true | undefined;
68
+ collapsedContextThreshold: number;
69
+ }
70
+ /**
71
+ * Whether a one-based new-file line currently has (or will have on scroll) a
72
+ * rendered row under the given expansion state — the editor-facing
73
+ * visibility oracle. False only for lines hidden inside a collapsed
74
+ * unchanged region; lines outside the diff's modeled range report true so
75
+ * callers keep their existing missing-row handling. Computed from the same
76
+ * inputs as `iterateOverDiff` so layout math and the oracle cannot diverge.
77
+ */
78
+ declare function isAdditionLineRenderable({
79
+ fileDiff,
80
+ lineNumber,
81
+ expandedHunks,
82
+ collapsedContextThreshold
83
+ }: IsAdditionLineRenderableProps): boolean;
84
+ interface GetNearestRenderableAdditionLineProps extends IsAdditionLineRenderableProps {
85
+ direction: 'up' | 'down';
86
+ }
87
+ /**
88
+ * The nearest renderable new-file line at or beyond `lineNumber` in the
89
+ * given direction (one-based), or undefined when every line that way is
90
+ * hidden inside collapsed regions. Sequential caret motion uses this to skip
91
+ * over collapsed regions like code folds; it walks the hunk metadata once
92
+ * instead of probing line by line across a gap.
93
+ */
94
+ declare function getNearestRenderableAdditionLine({
95
+ fileDiff,
96
+ lineNumber,
97
+ direction,
98
+ expandedHunks,
99
+ collapsedContextThreshold
100
+ }: GetNearestRenderableAdditionLineProps): number | undefined;
60
101
  declare function getHunkSeparatorHeight({
61
102
  type,
62
103
  metrics
@@ -82,5 +123,5 @@ declare function getTrailingHunkSeparatorLayout({
82
123
  metrics
83
124
  }: HunkSeparatorBaseProps): HunkSeparatorLayout | undefined;
84
125
  //#endregion
85
- export { ExpandedRegionResult, GetExpandedRegionProps, GetTrailingContextRangeSizeProps, GetTrailingExpandedRegionProps, HunkSeparatorLayout, getExpandedRegion, getHunkSeparatorGap, getHunkSeparatorHeight, getLeadingHunkSeparatorLayout, getTrailingContextRangeSize, getTrailingExpandedRegion, getTrailingHunkSeparatorLayout, hasLeadingHunkSeparator, hasTrailingContext, hasTrailingHunkSeparator };
126
+ export { ExpandedRegionResult, GetExpandedRegionProps, GetNearestRenderableAdditionLineProps, GetTrailingContextRangeSizeProps, GetTrailingExpandedRegionProps, HunkSeparatorLayout, IsAdditionLineRenderableProps, getExpandedRegion, getHunkAdditionLineRange, getHunkSeparatorGap, getHunkSeparatorHeight, getLeadingHunkSeparatorLayout, getNearestRenderableAdditionLine, getTrailingContextRangeSize, getTrailingExpandedRegion, getTrailingHunkSeparatorLayout, hasLeadingHunkSeparator, hasTrailingContext, hasTrailingContextMismatch, hasTrailingHunkSeparator, isAdditionLineRenderable };
86
127
  //# sourceMappingURL=virtualDiffLayout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"virtualDiffLayout.d.ts","names":[],"sources":["../../src/utils/virtualDiffLayout.ts"],"mappings":";;;UAQiB,oBAAA;EACf,SAAA;EACA,OAAA;EACA,SAAA;EACA,cAAA;EACA,SAAA;AAAA;AAAA,UAGe,sBAAA;EACf,SAAA;EACA,SAAA;EACA,aAAA,EAAe,GAAG,SAAS,mBAAA;EAC3B,SAAA;EACA,yBAAA;AAAA;AAAA,UAGe,gCAAA;EACf,QAAA,EAAU,gBAAgB;EAC1B,WAAA;AAAA;AAAA,UAGe,8BAAA,SAAuC,gCAAgC;EACtF,SAAA;EACA,aAAA,EAAe,sBAAA;EACf,yBAAA;AAAA;AAAA,UAGe,mBAAA;EACf,MAAA;EACA,SAAA;EACA,QAAA;EACA,WAAA;AAAA;AAAA,UAGQ,sBAAA;EACR,IAAA,EAAM,cAAA;EACN,OAAA,EAAS,kBAAkB;AAAA;AAAA,UAGnB,+BAAA,SAAwC,sBAAsB;EACtE,SAAA;EACA,SAAA;AAAA;AAAA,iBAKc,iBAAA;EACd,SAAA;EACA,SAAA;EACA,aAAA;EACA,SAAA;EACA;AAAA,GACC,sBAAA,GAAyB,oBAAA;AAAA,iBA6CZ,kBAAA,CAAmB,QAA0B,EAAhB,gBAAgB;AAAA,iBAuB7C,2BAAA;EACd,QAAA;EACA;AAAA,GACC,gCAAA;AAAA,iBA8Ba,yBAAA;EACd,QAAA;EACA,SAAA;EACA,aAAA;EACA,yBAAA;EACA;AAAA,GACC,8BAAA,GAAiC,oBAAA;AAAA,iBA0CpB,sBAAA;EACd,IAAA;EACA;AAAA,GACC,sBAAA;AAAA,iBAIa,mBAAA;EACd,IAAA;EACA;AAAA,GACC,sBAAA;AAAA,iBAMa,uBAAA;EACd,IAAA;EACA,SAAA;EACA;AAAA,GACC,IAAA,CAAK,+BAAA;AAAA,iBAaQ,wBAAA,CAAyB,IAAoB,EAAd,cAAc;AAAA,iBAK7C,6BAAA;EACd,IAAA;EACA,OAAA;EACA,SAAA;EACA;AAAA,GACC,+BAAA,GAAkC,mBAAA;AAAA,iBAmBrB,8BAAA;EACd,IAAA;EACA;AAAA,GACC,sBAAA,GAAyB,mBAAA"}
1
+ {"version":3,"file":"virtualDiffLayout.d.ts","names":[],"sources":["../../src/utils/virtualDiffLayout.ts"],"mappings":";;;UAaiB,oBAAA;EACf,SAAA;EACA,OAAA;EACA,SAAA;EACA,cAAA;EACA,SAAA;AAAA;AAAA,UAGe,sBAAA;EACf,SAAA;EACA,SAAA;EACA,aAAA,EAAe,GAAG,SAAS,mBAAA;EAC3B,SAAA;EACA,yBAAA;AAA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GACC,sBAAA;AAAA,iBAMa,uBAAA;EACd,IAAA;EACA,SAAA;EACA;AAAA,GACC,IAAA,CAAK,+BAAA;AAAA,iBAaQ,wBAAA,CAAyB,IAAoB,EAAd,cAAc;AAAA,iBAK7C,6BAAA;EACd,IAAA;EACA,OAAA;EACA,SAAA;EACA;AAAA,GACC,+BAAA,GAAkC,mBAAA;AAAA,iBAmBrB,8BAAA;EACd,IAAA;EACA;AAAA,GACC,sBAAA,GAAyB,mBAAA"}
@@ -1,5 +1,10 @@
1
+ import { getHunkSideEndBoundary, getHunkSideStartBoundary } from "./getHunkSideBoundaries.js";
1
2
  import { getDefaultHunkSeparatorHeight } from "./computeVirtualFileMetrics.js";
2
3
  //#region src/utils/virtualDiffLayout.ts
4
+ /** One-based new-file line range covered by a hunk, as `[start, end)`. */
5
+ function getHunkAdditionLineRange(hunk) {
6
+ return [getHunkSideStartBoundary(hunk.additionStart, hunk.additionCount) + 1, getHunkSideEndBoundary(hunk.additionStart, hunk.additionCount) + 1];
7
+ }
3
8
  function getExpandedRegion({ isPartial, rangeSize, expandedHunks, hunkIndex, collapsedContextThreshold }) {
4
9
  const normalizedRangeSize = Math.max(rangeSize, 0);
5
10
  if (normalizedRangeSize === 0 || isPartial) return {
@@ -32,15 +37,23 @@ function getExpandedRegion({ isPartial, rangeSize, expandedHunks, hunkIndex, col
32
37
  function hasTrailingContext(fileDiff) {
33
38
  const lastHunk = fileDiff.hunks[fileDiff.hunks.length - 1];
34
39
  if (lastHunk == null || fileDiff.isPartial || fileDiff.additionLines.length === 0 || fileDiff.deletionLines.length === 0) return false;
35
- const additionRemaining = fileDiff.additionLines.length - (lastHunk.additionLineIndex + lastHunk.additionCount);
36
- const deletionRemaining = fileDiff.deletionLines.length - (lastHunk.deletionLineIndex + lastHunk.deletionCount);
40
+ const additionRemaining = fileDiff.additionLines.length - getHunkSideEndBoundary(lastHunk.additionStart, lastHunk.additionCount);
41
+ const deletionRemaining = fileDiff.deletionLines.length - getHunkSideEndBoundary(lastHunk.deletionStart, lastHunk.deletionCount);
37
42
  return additionRemaining > 0 || deletionRemaining > 0;
38
43
  }
44
+ function hasTrailingContextMismatch(fileDiff) {
45
+ const lastHunk = fileDiff.hunks[fileDiff.hunks.length - 1];
46
+ if (lastHunk == null || fileDiff.isPartial || fileDiff.additionLines.length === 0 || fileDiff.deletionLines.length === 0) return false;
47
+ const additionRemaining = fileDiff.additionLines.length - getHunkSideEndBoundary(lastHunk.additionStart, lastHunk.additionCount);
48
+ const deletionRemaining = fileDiff.deletionLines.length - getHunkSideEndBoundary(lastHunk.deletionStart, lastHunk.deletionCount);
49
+ if (additionRemaining <= 0 && deletionRemaining <= 0) return false;
50
+ return additionRemaining !== deletionRemaining;
51
+ }
39
52
  function getTrailingContextRangeSize({ fileDiff, errorPrefix }) {
40
53
  const lastHunk = fileDiff.hunks[fileDiff.hunks.length - 1];
41
54
  if (lastHunk == null || fileDiff.isPartial || fileDiff.additionLines.length === 0 || fileDiff.deletionLines.length === 0) return 0;
42
- const additionRemaining = fileDiff.additionLines.length - (lastHunk.additionLineIndex + lastHunk.additionCount);
43
- const deletionRemaining = fileDiff.deletionLines.length - (lastHunk.deletionLineIndex + lastHunk.deletionCount);
55
+ const additionRemaining = fileDiff.additionLines.length - getHunkSideEndBoundary(lastHunk.additionStart, lastHunk.additionCount);
56
+ const deletionRemaining = fileDiff.deletionLines.length - getHunkSideEndBoundary(lastHunk.deletionStart, lastHunk.deletionCount);
44
57
  if (additionRemaining <= 0 && deletionRemaining <= 0) return 0;
45
58
  if (additionRemaining !== deletionRemaining) throw new Error(`${errorPrefix}: trailing context mismatch (additions=${additionRemaining}, deletions=${deletionRemaining}) for ${fileDiff.name}`);
46
59
  return Math.min(additionRemaining, deletionRemaining);
@@ -69,6 +82,95 @@ function getTrailingExpandedRegion({ fileDiff, hunkIndex, expandedHunks, collaps
69
82
  renderAll: fromStart >= trailingRangeSize
70
83
  };
71
84
  }
85
+ /**
86
+ * Whether a one-based new-file line currently has (or will have on scroll) a
87
+ * rendered row under the given expansion state — the editor-facing
88
+ * visibility oracle. False only for lines hidden inside a collapsed
89
+ * unchanged region; lines outside the diff's modeled range report true so
90
+ * callers keep their existing missing-row handling. Computed from the same
91
+ * inputs as `iterateOverDiff` so layout math and the oracle cannot diverge.
92
+ */
93
+ function isAdditionLineRenderable({ fileDiff, lineNumber, expandedHunks, collapsedContextThreshold }) {
94
+ if (expandedHunks === true || fileDiff.isPartial) return true;
95
+ for (const [hunkIndex, hunk] of fileDiff.hunks.entries()) {
96
+ const [hunkStart, hunkEnd] = getHunkAdditionLineRange(hunk);
97
+ if (lineNumber < hunkStart) {
98
+ const region = getExpandedRegion({
99
+ isPartial: fileDiff.isPartial,
100
+ rangeSize: hunk.collapsedBefore,
101
+ expandedHunks,
102
+ hunkIndex,
103
+ collapsedContextThreshold
104
+ });
105
+ const gapStart = hunkStart - region.rangeSize;
106
+ return region.renderAll || lineNumber < gapStart + region.fromStart || lineNumber >= hunkStart - region.fromEnd;
107
+ }
108
+ if (lineNumber < hunkEnd) return true;
109
+ }
110
+ const trailingRegion = getTrailingExpandedRegion({
111
+ fileDiff,
112
+ hunkIndex: fileDiff.hunks.length - 1,
113
+ expandedHunks,
114
+ collapsedContextThreshold,
115
+ errorPrefix: "isAdditionLineRenderable"
116
+ });
117
+ if (trailingRegion == null || trailingRegion.renderAll) return true;
118
+ const lastHunk = fileDiff.hunks[fileDiff.hunks.length - 1];
119
+ const [, trailingStart] = getHunkAdditionLineRange(lastHunk);
120
+ return lineNumber < trailingStart + trailingRegion.fromStart || lineNumber >= trailingStart + trailingRegion.rangeSize;
121
+ }
122
+ /**
123
+ * The nearest renderable new-file line at or beyond `lineNumber` in the
124
+ * given direction (one-based), or undefined when every line that way is
125
+ * hidden inside collapsed regions. Sequential caret motion uses this to skip
126
+ * over collapsed regions like code folds; it walks the hunk metadata once
127
+ * instead of probing line by line across a gap.
128
+ */
129
+ function getNearestRenderableAdditionLine({ fileDiff, lineNumber, direction, expandedHunks, collapsedContextThreshold }) {
130
+ if (expandedHunks === true || fileDiff.isPartial) return lineNumber;
131
+ const ranges = [];
132
+ let modeledEnd = 1;
133
+ for (const [hunkIndex, hunk] of fileDiff.hunks.entries()) {
134
+ const [hunkStart, hunkEnd] = getHunkAdditionLineRange(hunk);
135
+ const region = getExpandedRegion({
136
+ isPartial: fileDiff.isPartial,
137
+ rangeSize: hunk.collapsedBefore,
138
+ expandedHunks,
139
+ hunkIndex,
140
+ collapsedContextThreshold
141
+ });
142
+ const gapStart = hunkStart - region.rangeSize;
143
+ if (region.renderAll) ranges.push([gapStart, hunkStart]);
144
+ else {
145
+ if (region.fromStart > 0) ranges.push([gapStart, gapStart + region.fromStart]);
146
+ if (region.fromEnd > 0) ranges.push([hunkStart - region.fromEnd, hunkStart]);
147
+ }
148
+ ranges.push([hunkStart, hunkEnd]);
149
+ modeledEnd = hunkEnd;
150
+ }
151
+ const trailingRegion = getTrailingExpandedRegion({
152
+ fileDiff,
153
+ hunkIndex: fileDiff.hunks.length - 1,
154
+ expandedHunks,
155
+ collapsedContextThreshold,
156
+ errorPrefix: "getNearestRenderableAdditionLine"
157
+ });
158
+ if (trailingRegion != null) {
159
+ const trailingStart = modeledEnd;
160
+ modeledEnd = trailingStart + trailingRegion.rangeSize;
161
+ if (trailingRegion.renderAll) ranges.push([trailingStart, modeledEnd]);
162
+ else if (trailingRegion.fromStart > 0) ranges.push([trailingStart, trailingStart + trailingRegion.fromStart]);
163
+ }
164
+ if (lineNumber >= modeledEnd) return lineNumber;
165
+ if (direction === "down") {
166
+ for (const [start, end] of ranges) if (end > lineNumber) return Math.max(start, lineNumber);
167
+ return;
168
+ }
169
+ for (let index = ranges.length - 1; index >= 0; index--) {
170
+ const [start, end] = ranges[index];
171
+ if (start <= lineNumber) return Math.min(end - 1, lineNumber);
172
+ }
173
+ }
72
174
  function getHunkSeparatorHeight({ type, metrics }) {
73
175
  return metrics.hunkSeparatorHeight ?? getDefaultHunkSeparatorHeight(type);
74
176
  }
@@ -128,6 +230,6 @@ function getTrailingHunkSeparatorLayout({ type, metrics }) {
128
230
  };
129
231
  }
130
232
  //#endregion
131
- export { getExpandedRegion, getHunkSeparatorGap, getHunkSeparatorHeight, getLeadingHunkSeparatorLayout, getTrailingContextRangeSize, getTrailingExpandedRegion, getTrailingHunkSeparatorLayout, hasLeadingHunkSeparator, hasTrailingContext, hasTrailingHunkSeparator };
233
+ export { getExpandedRegion, getHunkAdditionLineRange, getHunkSeparatorGap, getHunkSeparatorHeight, getLeadingHunkSeparatorLayout, getNearestRenderableAdditionLine, getTrailingContextRangeSize, getTrailingExpandedRegion, getTrailingHunkSeparatorLayout, hasLeadingHunkSeparator, hasTrailingContext, hasTrailingContextMismatch, hasTrailingHunkSeparator, isAdditionLineRenderable };
132
234
 
133
235
  //# sourceMappingURL=virtualDiffLayout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"virtualDiffLayout.js","names":[],"sources":["../../src/utils/virtualDiffLayout.ts"],"sourcesContent":["import type {\n FileDiffMetadata,\n HunkExpansionRegion,\n HunkSeparators,\n VirtualFileMetrics,\n} from '../types';\nimport { getDefaultHunkSeparatorHeight } from './computeVirtualFileMetrics';\n\nexport interface ExpandedRegionResult {\n fromStart: number;\n fromEnd: number;\n rangeSize: number;\n collapsedLines: number;\n renderAll: boolean;\n}\n\nexport interface GetExpandedRegionProps {\n isPartial: boolean;\n rangeSize: number;\n expandedHunks: Map<number, HunkExpansionRegion> | true | undefined;\n hunkIndex: number;\n collapsedContextThreshold: number;\n}\n\nexport interface GetTrailingContextRangeSizeProps {\n fileDiff: FileDiffMetadata;\n errorPrefix: string;\n}\n\nexport interface GetTrailingExpandedRegionProps extends GetTrailingContextRangeSizeProps {\n hunkIndex: number;\n expandedHunks: GetExpandedRegionProps['expandedHunks'];\n collapsedContextThreshold: number;\n}\n\nexport interface HunkSeparatorLayout {\n height: number;\n gapBefore: number;\n gapAfter: number;\n totalHeight: number;\n}\n\ninterface HunkSeparatorBaseProps {\n type: HunkSeparators;\n metrics: VirtualFileMetrics;\n}\n\ninterface LeadingHunkSeparatorLayoutProps extends HunkSeparatorBaseProps {\n hunkIndex: number;\n hunkSpecs: string | undefined;\n}\n\n// Converts a collapsed unchanged range into the slices that should render near\n// the start and end of that range for the active hunk expansion state.\nexport function getExpandedRegion({\n isPartial,\n rangeSize,\n expandedHunks,\n hunkIndex,\n collapsedContextThreshold,\n}: GetExpandedRegionProps): ExpandedRegionResult {\n const normalizedRangeSize = Math.max(rangeSize, 0);\n if (normalizedRangeSize === 0 || isPartial) {\n return {\n fromStart: 0,\n fromEnd: 0,\n rangeSize: normalizedRangeSize,\n collapsedLines: normalizedRangeSize,\n renderAll: false,\n };\n }\n\n if (\n expandedHunks === true ||\n normalizedRangeSize <= collapsedContextThreshold\n ) {\n return {\n fromStart: normalizedRangeSize,\n fromEnd: 0,\n rangeSize: normalizedRangeSize,\n collapsedLines: 0,\n renderAll: true,\n };\n }\n\n const region = expandedHunks?.get(hunkIndex);\n const fromStart = Math.min(\n Math.max(region?.fromStart ?? 0, 0),\n normalizedRangeSize\n );\n const fromEnd = Math.min(\n Math.max(region?.fromEnd ?? 0, 0),\n normalizedRangeSize\n );\n const expandedCount = fromStart + fromEnd;\n const renderAll = expandedCount >= normalizedRangeSize;\n return {\n fromStart: renderAll ? normalizedRangeSize : fromStart,\n fromEnd: renderAll ? 0 : fromEnd,\n rangeSize: normalizedRangeSize,\n collapsedLines: Math.max(normalizedRangeSize - expandedCount, 0),\n renderAll,\n };\n}\n\nexport function hasTrailingContext(fileDiff: FileDiffMetadata): boolean {\n const lastHunk = fileDiff.hunks[fileDiff.hunks.length - 1];\n if (\n lastHunk == null ||\n fileDiff.isPartial ||\n fileDiff.additionLines.length === 0 ||\n fileDiff.deletionLines.length === 0\n ) {\n return false;\n }\n\n const additionRemaining =\n fileDiff.additionLines.length -\n (lastHunk.additionLineIndex + lastHunk.additionCount);\n const deletionRemaining =\n fileDiff.deletionLines.length -\n (lastHunk.deletionLineIndex + lastHunk.deletionCount);\n\n return additionRemaining > 0 || deletionRemaining > 0;\n}\n\n// Measures the unchanged tail after the final hunk. Both sides must have the\n// same remaining length because trailing context represents paired lines.\nexport function getTrailingContextRangeSize({\n fileDiff,\n errorPrefix,\n}: GetTrailingContextRangeSizeProps): number {\n const lastHunk = fileDiff.hunks[fileDiff.hunks.length - 1];\n if (\n lastHunk == null ||\n fileDiff.isPartial ||\n fileDiff.additionLines.length === 0 ||\n fileDiff.deletionLines.length === 0\n ) {\n return 0;\n }\n\n const additionRemaining =\n fileDiff.additionLines.length -\n (lastHunk.additionLineIndex + lastHunk.additionCount);\n const deletionRemaining =\n fileDiff.deletionLines.length -\n (lastHunk.deletionLineIndex + lastHunk.deletionCount);\n\n if (additionRemaining <= 0 && deletionRemaining <= 0) {\n return 0;\n }\n\n if (additionRemaining !== deletionRemaining) {\n throw new Error(\n `${errorPrefix}: trailing context mismatch (additions=${additionRemaining}, deletions=${deletionRemaining}) for ${fileDiff.name}`\n );\n }\n return Math.min(additionRemaining, deletionRemaining);\n}\n\nexport function getTrailingExpandedRegion({\n fileDiff,\n hunkIndex,\n expandedHunks,\n collapsedContextThreshold,\n errorPrefix,\n}: GetTrailingExpandedRegionProps): ExpandedRegionResult | undefined {\n if (hunkIndex !== fileDiff.hunks.length - 1) {\n return undefined;\n }\n\n const trailingRangeSize = getTrailingContextRangeSize({\n fileDiff,\n errorPrefix,\n });\n if (trailingRangeSize <= 0) {\n return undefined;\n }\n\n if (\n expandedHunks === true ||\n trailingRangeSize <= collapsedContextThreshold\n ) {\n return {\n fromStart: trailingRangeSize,\n fromEnd: 0,\n rangeSize: trailingRangeSize,\n collapsedLines: 0,\n renderAll: true,\n };\n }\n\n // The final trailing separator only exposes upward partial expansion. Treat it\n // as a bottom-only pseudo-hunk and ignore unsupported downward expansion.\n const region = expandedHunks?.get(fileDiff.hunks.length);\n const fromStart = Math.min(\n Math.max(region?.fromStart ?? 0, 0),\n trailingRangeSize\n );\n return {\n fromStart,\n fromEnd: 0,\n rangeSize: trailingRangeSize,\n collapsedLines: trailingRangeSize - fromStart,\n renderAll: fromStart >= trailingRangeSize,\n };\n}\n\nexport function getHunkSeparatorHeight({\n type,\n metrics,\n}: HunkSeparatorBaseProps): number {\n return metrics.hunkSeparatorHeight ?? getDefaultHunkSeparatorHeight(type);\n}\n\nexport function getHunkSeparatorGap({\n type,\n metrics,\n}: HunkSeparatorBaseProps): number {\n return type === 'simple' || type === 'metadata' || type === 'line-info-basic'\n ? 0\n : metrics.spacing;\n}\n\nexport function hasLeadingHunkSeparator({\n type,\n hunkIndex,\n hunkSpecs,\n}: Omit<LeadingHunkSeparatorLayoutProps, 'metrics'>): boolean {\n switch (type) {\n case 'simple':\n return hunkIndex > 0;\n case 'metadata':\n return hunkSpecs != null;\n case 'line-info':\n case 'line-info-basic':\n case 'custom':\n return true;\n }\n}\n\nexport function hasTrailingHunkSeparator(type: HunkSeparators): boolean {\n return type !== 'simple' && type !== 'metadata';\n}\n\n// Mirrors the renderer/CSS spacing rules for the separator shown before a hunk.\nexport function getLeadingHunkSeparatorLayout({\n type,\n metrics,\n hunkIndex,\n hunkSpecs,\n}: LeadingHunkSeparatorLayoutProps): HunkSeparatorLayout | undefined {\n if (!hasLeadingHunkSeparator({ type, hunkIndex, hunkSpecs })) {\n return undefined;\n }\n\n const height = getHunkSeparatorHeight({ type, metrics });\n const gap = getHunkSeparatorGap({ type, metrics });\n const gapBefore = hunkIndex > 0 ? gap : 0;\n const gapAfter = gap;\n return {\n height,\n gapBefore,\n gapAfter,\n totalHeight: gapBefore + height + gapAfter,\n };\n}\n\n// Mirrors the renderer/CSS spacing rules for the separator shown after the last\n// hunk when trailing unchanged context is collapsed.\nexport function getTrailingHunkSeparatorLayout({\n type,\n metrics,\n}: HunkSeparatorBaseProps): HunkSeparatorLayout | undefined {\n if (!hasTrailingHunkSeparator(type)) {\n return undefined;\n }\n\n const height = getHunkSeparatorHeight({ type, metrics });\n const gapBefore = getHunkSeparatorGap({ type, metrics });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AAgB,yBAAyB,MAA+B;CACtE,OAAO,SAAS,YAAY,SAAS;AACvC;AAGA,SAAgB,8BAA8B,EAC5C,MACA,SACA,WACA,aACmE;CACnE,IAAI,CAAC,wBAAwB;EAAE;EAAM;EAAW;CAAU,CAAC,GACzD;CAGF,MAAM,SAAS,uBAAuB;EAAE;EAAM;CAAQ,CAAC;CACvD,MAAM,MAAM,oBAAoB;EAAE;EAAM;CAAQ,CAAC;CACjD,MAAM,YAAY,YAAY,IAAI,MAAM;CACxC,MAAM,WAAW;CACjB,OAAO;EACL;EACA;EACA;EACA,aAAa,YAAY,SAAS;CACpC;AACF;AAIA,SAAgB,+BAA+B,EAC7C,MACA,WAC0D;CAC1D,IAAI,CAAC,yBAAyB,IAAI,GAChC;CAGF,MAAM,SAAS,uBAAuB;EAAE;EAAM;CAAQ,CAAC;CACvD,MAAM,YAAY,oBAAoB;EAAE;EAAM;CAAQ,CAAC;CACvD,OAAO;EACL;EACA;EACA,UAAU;EACV,aAAa,YAAY;CAC3B;AACF"}
1
+ {"version":3,"file":"virtualDiffLayout.js","names":[],"sources":["../../src/utils/virtualDiffLayout.ts"],"sourcesContent":["import type {\n FileDiffMetadata,\n Hunk,\n HunkExpansionRegion,\n HunkSeparators,\n VirtualFileMetrics,\n} from '../types';\nimport { getDefaultHunkSeparatorHeight } from './computeVirtualFileMetrics';\nimport {\n getHunkSideEndBoundary,\n getHunkSideStartBoundary,\n} from './getHunkSideBoundaries';\n\nexport interface ExpandedRegionResult {\n fromStart: number;\n fromEnd: number;\n rangeSize: number;\n collapsedLines: number;\n renderAll: boolean;\n}\n\nexport interface GetExpandedRegionProps {\n isPartial: boolean;\n rangeSize: number;\n expandedHunks: Map<number, HunkExpansionRegion> | true | undefined;\n hunkIndex: number;\n collapsedContextThreshold: number;\n}\n\nexport interface GetTrailingContextRangeSizeProps {\n fileDiff: FileDiffMetadata;\n errorPrefix: string;\n}\n\nexport interface GetTrailingExpandedRegionProps extends GetTrailingContextRangeSizeProps {\n hunkIndex: number;\n expandedHunks: GetExpandedRegionProps['expandedHunks'];\n collapsedContextThreshold: number;\n}\n\n/** One-based new-file line range covered by a hunk, as `[start, end)`. */\nexport function getHunkAdditionLineRange(hunk: Hunk): [number, number] {\n return [\n getHunkSideStartBoundary(hunk.additionStart, hunk.additionCount) + 1,\n getHunkSideEndBoundary(hunk.additionStart, hunk.additionCount) + 1,\n ];\n}\n\nexport interface HunkSeparatorLayout {\n height: number;\n gapBefore: number;\n gapAfter: number;\n totalHeight: number;\n}\n\ninterface HunkSeparatorBaseProps {\n type: HunkSeparators;\n metrics: VirtualFileMetrics;\n}\n\ninterface LeadingHunkSeparatorLayoutProps extends HunkSeparatorBaseProps {\n hunkIndex: number;\n hunkSpecs: string | undefined;\n}\n\n// Converts a collapsed unchanged range into the slices that should render near\n// the start and end of that range for the active hunk expansion state.\nexport function getExpandedRegion({\n isPartial,\n rangeSize,\n expandedHunks,\n hunkIndex,\n collapsedContextThreshold,\n}: GetExpandedRegionProps): ExpandedRegionResult {\n const normalizedRangeSize = Math.max(rangeSize, 0);\n if (normalizedRangeSize === 0 || isPartial) {\n return {\n fromStart: 0,\n fromEnd: 0,\n rangeSize: normalizedRangeSize,\n collapsedLines: normalizedRangeSize,\n renderAll: false,\n };\n }\n\n if (\n expandedHunks === true ||\n normalizedRangeSize <= collapsedContextThreshold\n ) {\n return {\n fromStart: normalizedRangeSize,\n fromEnd: 0,\n rangeSize: normalizedRangeSize,\n collapsedLines: 0,\n renderAll: true,\n };\n }\n\n const region = expandedHunks?.get(hunkIndex);\n const fromStart = Math.min(\n Math.max(region?.fromStart ?? 0, 0),\n normalizedRangeSize\n );\n const fromEnd = Math.min(\n Math.max(region?.fromEnd ?? 0, 0),\n normalizedRangeSize\n );\n const expandedCount = fromStart + fromEnd;\n const renderAll = expandedCount >= normalizedRangeSize;\n return {\n fromStart: renderAll ? normalizedRangeSize : fromStart,\n fromEnd: renderAll ? 0 : fromEnd,\n rangeSize: normalizedRangeSize,\n collapsedLines: Math.max(normalizedRangeSize - expandedCount, 0),\n renderAll,\n };\n}\n\nexport function hasTrailingContext(fileDiff: FileDiffMetadata): boolean {\n const lastHunk = fileDiff.hunks[fileDiff.hunks.length - 1];\n if (\n lastHunk == null ||\n fileDiff.isPartial ||\n fileDiff.additionLines.length === 0 ||\n fileDiff.deletionLines.length === 0\n ) {\n return false;\n }\n\n const additionRemaining =\n fileDiff.additionLines.length -\n getHunkSideEndBoundary(lastHunk.additionStart, lastHunk.additionCount);\n const deletionRemaining =\n fileDiff.deletionLines.length -\n getHunkSideEndBoundary(lastHunk.deletionStart, lastHunk.deletionCount);\n\n return additionRemaining > 0 || deletionRemaining > 0;\n}\n\n// Returns true when trailing-context line counts disagree between sides.\nexport function hasTrailingContextMismatch(\n fileDiff: FileDiffMetadata\n): boolean {\n const lastHunk = fileDiff.hunks[fileDiff.hunks.length - 1];\n if (\n lastHunk == null ||\n fileDiff.isPartial ||\n fileDiff.additionLines.length === 0 ||\n fileDiff.deletionLines.length === 0\n ) {\n return false;\n }\n\n const additionRemaining =\n fileDiff.additionLines.length -\n getHunkSideEndBoundary(lastHunk.additionStart, lastHunk.additionCount);\n const deletionRemaining =\n fileDiff.deletionLines.length -\n getHunkSideEndBoundary(lastHunk.deletionStart, lastHunk.deletionCount);\n\n if (additionRemaining <= 0 && deletionRemaining <= 0) {\n return false;\n }\n\n return additionRemaining !== deletionRemaining;\n}\n\n// Measures the unchanged tail after the final hunk. Both sides must have the\n// same remaining length because trailing context represents paired lines.\nexport function getTrailingContextRangeSize({\n fileDiff,\n errorPrefix,\n}: GetTrailingContextRangeSizeProps): number {\n const lastHunk = fileDiff.hunks[fileDiff.hunks.length - 1];\n if (\n lastHunk == null ||\n fileDiff.isPartial ||\n fileDiff.additionLines.length === 0 ||\n fileDiff.deletionLines.length === 0\n ) {\n return 0;\n }\n\n const additionRemaining =\n fileDiff.additionLines.length -\n getHunkSideEndBoundary(lastHunk.additionStart, lastHunk.additionCount);\n const deletionRemaining =\n fileDiff.deletionLines.length -\n getHunkSideEndBoundary(lastHunk.deletionStart, lastHunk.deletionCount);\n\n if (additionRemaining <= 0 && deletionRemaining <= 0) {\n return 0;\n }\n\n if (additionRemaining !== deletionRemaining) {\n throw new Error(\n `${errorPrefix}: trailing context mismatch (additions=${additionRemaining}, deletions=${deletionRemaining}) for ${fileDiff.name}`\n );\n }\n return Math.min(additionRemaining, deletionRemaining);\n}\n\nexport function getTrailingExpandedRegion({\n fileDiff,\n hunkIndex,\n expandedHunks,\n collapsedContextThreshold,\n errorPrefix,\n}: GetTrailingExpandedRegionProps): ExpandedRegionResult | undefined {\n if (hunkIndex !== fileDiff.hunks.length - 1) {\n return undefined;\n }\n\n const trailingRangeSize = getTrailingContextRangeSize({\n fileDiff,\n errorPrefix,\n });\n if (trailingRangeSize <= 0) {\n return undefined;\n }\n\n if (\n expandedHunks === true ||\n trailingRangeSize <= collapsedContextThreshold\n ) {\n return {\n fromStart: trailingRangeSize,\n fromEnd: 0,\n rangeSize: trailingRangeSize,\n collapsedLines: 0,\n renderAll: true,\n };\n }\n\n // The final trailing separator only exposes upward partial expansion. Treat it\n // as a bottom-only pseudo-hunk and ignore unsupported downward expansion.\n const region = expandedHunks?.get(fileDiff.hunks.length);\n const fromStart = Math.min(\n Math.max(region?.fromStart ?? 0, 0),\n trailingRangeSize\n );\n return {\n fromStart,\n fromEnd: 0,\n rangeSize: trailingRangeSize,\n collapsedLines: trailingRangeSize - fromStart,\n renderAll: fromStart >= trailingRangeSize,\n };\n}\n\nexport interface IsAdditionLineRenderableProps {\n fileDiff: FileDiffMetadata;\n /** One-based line number in the new file. */\n lineNumber: number;\n expandedHunks: Map<number, HunkExpansionRegion> | true | undefined;\n collapsedContextThreshold: number;\n}\n\n/**\n * Whether a one-based new-file line currently has (or will have on scroll) a\n * rendered row under the given expansion state — the editor-facing\n * visibility oracle. False only for lines hidden inside a collapsed\n * unchanged region; lines outside the diff's modeled range report true so\n * callers keep their existing missing-row handling. Computed from the same\n * inputs as `iterateOverDiff` so layout math and the oracle cannot diverge.\n */\nexport function isAdditionLineRenderable({\n fileDiff,\n lineNumber,\n expandedHunks,\n collapsedContextThreshold,\n}: IsAdditionLineRenderableProps): boolean {\n if (expandedHunks === true || fileDiff.isPartial) {\n return true;\n }\n\n for (const [hunkIndex, hunk] of fileDiff.hunks.entries()) {\n const [hunkStart, hunkEnd] = getHunkAdditionLineRange(hunk);\n if (lineNumber < hunkStart) {\n // Inside the collapsed gap before this hunk: renderable only within\n // the expanded slices at the gap's edges.\n const region = getExpandedRegion({\n isPartial: fileDiff.isPartial,\n rangeSize: hunk.collapsedBefore,\n expandedHunks,\n hunkIndex,\n collapsedContextThreshold,\n });\n const gapStart = hunkStart - region.rangeSize;\n return (\n region.renderAll ||\n lineNumber < gapStart + region.fromStart ||\n lineNumber >= hunkStart - region.fromEnd\n );\n }\n if (lineNumber < hunkEnd) {\n return true;\n }\n }\n\n const trailingRegion = getTrailingExpandedRegion({\n fileDiff,\n hunkIndex: fileDiff.hunks.length - 1,\n expandedHunks,\n collapsedContextThreshold,\n errorPrefix: 'isAdditionLineRenderable',\n });\n if (trailingRegion == null || trailingRegion.renderAll) {\n return true;\n }\n const lastHunk = fileDiff.hunks[fileDiff.hunks.length - 1];\n const [, trailingStart] = getHunkAdditionLineRange(lastHunk);\n return (\n lineNumber < trailingStart + trailingRegion.fromStart ||\n lineNumber >= trailingStart + trailingRegion.rangeSize\n );\n}\n\nexport interface GetNearestRenderableAdditionLineProps extends IsAdditionLineRenderableProps {\n direction: 'up' | 'down';\n}\n\n/**\n * The nearest renderable new-file line at or beyond `lineNumber` in the\n * given direction (one-based), or undefined when every line that way is\n * hidden inside collapsed regions. Sequential caret motion uses this to skip\n * over collapsed regions like code folds; it walks the hunk metadata once\n * instead of probing line by line across a gap.\n */\nexport function getNearestRenderableAdditionLine({\n fileDiff,\n lineNumber,\n direction,\n expandedHunks,\n collapsedContextThreshold,\n}: GetNearestRenderableAdditionLineProps): number | undefined {\n if (expandedHunks === true || fileDiff.isPartial) {\n return lineNumber;\n }\n\n // Renderable [start, end) line ranges in ascending order, plus the\n // exclusive end of the modeled range — anything past it (the editor's\n // phantom document-end line) counts as renderable.\n const ranges: Array<[start: number, end: number]> = [];\n let modeledEnd = 1;\n for (const [hunkIndex, hunk] of fileDiff.hunks.entries()) {\n const [hunkStart, hunkEnd] = getHunkAdditionLineRange(hunk);\n const region = getExpandedRegion({\n isPartial: fileDiff.isPartial,\n rangeSize: hunk.collapsedBefore,\n expandedHunks,\n hunkIndex,\n collapsedContextThreshold,\n });\n const gapStart = hunkStart - region.rangeSize;\n if (region.renderAll) {\n ranges.push([gapStart, hunkStart]);\n } else {\n if (region.fromStart > 0) {\n ranges.push([gapStart, gapStart + region.fromStart]);\n }\n if (region.fromEnd > 0) {\n ranges.push([hunkStart - region.fromEnd, hunkStart]);\n }\n }\n ranges.push([hunkStart, hunkEnd]);\n modeledEnd = hunkEnd;\n }\n const trailingRegion = getTrailingExpandedRegion({\n fileDiff,\n hunkIndex: fileDiff.hunks.length - 1,\n expandedHunks,\n collapsedContextThreshold,\n errorPrefix: 'getNearestRenderableAdditionLine',\n });\n if (trailingRegion != null) {\n const trailingStart = modeledEnd;\n modeledEnd = trailingStart + trailingRegion.rangeSize;\n if (trailingRegion.renderAll) {\n ranges.push([trailingStart, modeledEnd]);\n } else if (trailingRegion.fromStart > 0) {\n ranges.push([trailingStart, trailingStart + trailingRegion.fromStart]);\n }\n }\n\n if (lineNumber >= modeledEnd) {\n return lineNumber;\n }\n if (direction === 'down') {\n for (const [start, end] of ranges) {\n if (end > lineNumber) {\n return Math.max(start, lineNumber);\n }\n }\n return undefined;\n }\n for (let index = ranges.length - 1; index >= 0; index--) {\n const [start, end] = ranges[index];\n if (start <= lineNumber) {\n return Math.min(end - 1, lineNumber);\n }\n }\n return undefined;\n}\n\nexport function getHunkSeparatorHeight({\n type,\n metrics,\n}: HunkSeparatorBaseProps): number {\n return metrics.hunkSeparatorHeight ?? getDefaultHunkSeparatorHeight(type);\n}\n\nexport function getHunkSeparatorGap({\n type,\n metrics,\n}: HunkSeparatorBaseProps): number {\n return type === 'simple' || type === 'metadata' || type === 'line-info-basic'\n ? 0\n : metrics.spacing;\n}\n\nexport function hasLeadingHunkSeparator({\n type,\n hunkIndex,\n hunkSpecs,\n}: Omit<LeadingHunkSeparatorLayoutProps, 'metrics'>): boolean {\n switch (type) {\n case 'simple':\n return hunkIndex > 0;\n case 'metadata':\n return hunkSpecs != null;\n case 'line-info':\n case 'line-info-basic':\n case 'custom':\n return true;\n }\n}\n\nexport function hasTrailingHunkSeparator(type: HunkSeparators): boolean {\n return type !== 'simple' && type !== 'metadata';\n}\n\n// Mirrors the renderer/CSS spacing rules for the separator shown before a hunk.\nexport function getLeadingHunkSeparatorLayout({\n type,\n metrics,\n hunkIndex,\n hunkSpecs,\n}: LeadingHunkSeparatorLayoutProps): HunkSeparatorLayout | undefined {\n if (!hasLeadingHunkSeparator({ type, hunkIndex, hunkSpecs })) {\n return undefined;\n }\n\n const height = getHunkSeparatorHeight({ type, metrics });\n const gap = getHunkSeparatorGap({ type, metrics });\n const gapBefore = hunkIndex > 0 ? gap : 0;\n const gapAfter = gap;\n return {\n height,\n gapBefore,\n gapAfter,\n totalHeight: gapBefore + height + gapAfter,\n };\n}\n\n// Mirrors the renderer/CSS spacing rules for the separator shown after the last\n// hunk when trailing unchanged context is collapsed.\nexport function getTrailingHunkSeparatorLayout({\n type,\n metrics,\n}: HunkSeparatorBaseProps): HunkSeparatorLayout | undefined {\n if (!hasTrailingHunkSeparator(type)) {\n return undefined;\n }\n\n const height = getHunkSeparatorHeight({ type, metrics });\n const gapBefore = getHunkSeparatorGap({ type, metrics });\n return {\n height,\n gapBefore,\n gapAfter: 0,\n totalHeight: gapBefore + height,\n };\n}\n"],"mappings":";;;;AAyCA,SAAgB,yBAAyB,MAA8B;CACrE,OAAO,CACL,yBAAyB,KAAK,eAAe,KAAK,aAAa,IAAI,GACnE,uBAAuB,KAAK,eAAe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AyB,MAA+B;CACtE,OAAO,SAAS,YAAY,SAAS;AACvC;AAGA,SAAgB,8BAA8B,EAC5C,MACA,SACA,WACA,aACmE;CACnE,IAAI,CAAC,wBAAwB;EAAE;EAAM;EAAW;CAAU,CAAC,GACzD;CAGF,MAAM,SAAS,uBAAuB;EAAE;EAAM;CAAQ,CAAC;CACvD,MAAM,MAAM,oBAAoB;EAAE;EAAM;CAAQ,CAAC;CACjD,MAAM,YAAY,YAAY,IAAI,MAAM;CACxC,MAAM,WAAW;CACjB,OAAO;EACL;EACA;EACA;EACA,aAAa,YAAY,SAAS;CACpC;AACF;AAIA,SAAgB,+BAA+B,EAC7C,MACA,WAC0D;CAC1D,IAAI,CAAC,yBAAyB,IAAI,GAChC;CAGF,MAAM,SAAS,uBAAuB;EAAE;EAAM;CAAQ,CAAC;CACvD,MAAM,YAAY,oBAAoB;EAAE;EAAM;CAAQ,CAAC;CACvD,OAAO;EACL;EACA;EACA,UAAU;EACV,aAAa,YAAY;CAC3B;AACF"}
@@ -1,4 +1,4 @@
1
- import { FileContents, FileDiffMetadata, HunkExpansionRegion, RenderDiffOptions, RenderDiffResult, RenderFileOptions, RenderFileResult, SupportedLanguages, ThemedDiffResult, ThemedFileResult } from "../types.js";
1
+ import { FileContents, FileDiffMetadata, HighlighterTypes, HunkExpansionRegion, RenderDiffOptions, RenderDiffResult, RenderFileOptions, RenderFileResult, SupportedLanguages, ThemedDiffResult, ThemedFileResult } from "../types.js";
2
2
  import { DiffRendererInstance, FileRendererInstance, WorkerInitializationRenderOptions, WorkerPoolOptions, WorkerRenderingOptions, WorkerStats } from "./types.js";
3
3
  import LRUMapPkg from "lru_map";
4
4
 
@@ -55,6 +55,7 @@ declare class WorkerPoolManager {
55
55
  maxLineDiffLength,
56
56
  tokenizeMaxLineLength
57
57
  }: Partial<WorkerRenderingOptions>): Promise<void>;
58
+ getPreferredHighlighter(): HighlighterTypes;
58
59
  getFileRenderOptions(): RenderFileOptions;
59
60
  getDiffRenderOptions(): RenderDiffOptions;
60
61
  private setRenderOptionsOnWorkers;
@@ -69,10 +70,12 @@ declare class WorkerPoolManager {
69
70
  private initializeWorkers;
70
71
  private drainQueue;
71
72
  highlightFileAST(instance: FileRendererInstance, file: FileContents): void;
72
- primeFileHighlightCache(file: FileContents): void;
73
+ primeFileHighlightCache(file: FileContents): Promise<void>;
74
+ private getOrCreateFileHighlightCacheTask;
73
75
  getPlainFileAST(file: FileContents, startingLine: number, totalLines: number, lines?: string[]): ThemedFileResult | undefined;
74
76
  highlightDiffAST(instance: DiffRendererInstance, diff: FileDiffMetadata): void;
75
- primeDiffHighlightCache(diff: FileDiffMetadata): void;
77
+ primeDiffHighlightCache(diff: FileDiffMetadata): Promise<void>;
78
+ private getOrCreateDiffHighlightCacheTask;
76
79
  getPlainDiffAST(diff: FileDiffMetadata, startingLine: number, totalLines: number, expandedHunks?: Map<number, HunkExpansionRegion> | true, collapsedContextThreshold?: number): ThemedDiffResult | undefined;
77
80
  terminate(): void;
78
81
  private isCurrentLifecycle;
@@ -102,6 +105,9 @@ declare class WorkerPoolManager {
102
105
  private detachInstanceFromRenderTask;
103
106
  private removeQueuedTask;
104
107
  private removeActiveTask;
108
+ private createRenderTaskCallbacks;
109
+ private resolveRenderTaskCallbacks;
110
+ private rejectRenderTaskCallbacks;
105
111
  private invalidateRenderTasks;
106
112
  private clearQueuedInstanceRequests;
107
113
  private clearHighlightKey;
@@ -1 +1 @@
1
- {"version":3,"file":"WorkerPoolManager.d.ts","names":[],"sources":["../../src/worker/WorkerPoolManager.ts"],"mappings":";;;;;UAsEU,eAAA;EACR,SAAA,EAAW,SAAA,CAAU,MAAA,SAAe,gBAAA;EACpC,SAAA,EAAW,SAAA,CAAU,MAAA,SAAe,gBAAA;AAAA;AAAA,UAY5B,eAAA;EACR,aAAa;AAAA;AAAA,KAKV,kBAAA,GAAqB,oBAAA,GAAuB,oBAAoB;AAAA,cAExD,iBAAA;EAAA,QAkCD,OAAA;EAAA,QAjCF,WAAA;EAAA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