@pierre/diffs 1.3.0-beta.1 → 1.3.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (701) hide show
  1. package/README.md +15 -15
  2. package/dist/components/CodeView.d.ts +103 -15
  3. package/dist/components/CodeView.d.ts.map +1 -1
  4. package/dist/components/CodeView.js +349 -50
  5. package/dist/components/CodeView.js.map +1 -1
  6. package/dist/components/File.d.ts +10 -7
  7. package/dist/components/File.d.ts.map +1 -1
  8. package/dist/components/File.js +99 -40
  9. package/dist/components/File.js.map +1 -1
  10. package/dist/components/FileDiff.d.ts +76 -36
  11. package/dist/components/FileDiff.d.ts.map +1 -1
  12. package/dist/components/FileDiff.js +364 -96
  13. package/dist/components/FileDiff.js.map +1 -1
  14. package/dist/components/FileStream.d.ts +0 -1
  15. package/dist/components/FileStream.d.ts.map +1 -1
  16. package/dist/components/FileStream.js +10 -7
  17. package/dist/components/FileStream.js.map +1 -1
  18. package/dist/components/UnresolvedFile.d.ts +3 -3
  19. package/dist/components/UnresolvedFile.d.ts.map +1 -1
  20. package/dist/components/UnresolvedFile.js +8 -6
  21. package/dist/components/UnresolvedFile.js.map +1 -1
  22. package/dist/components/VirtualizedFile.d.ts +8 -4
  23. package/dist/components/VirtualizedFile.d.ts.map +1 -1
  24. package/dist/components/VirtualizedFile.js +118 -44
  25. package/dist/components/VirtualizedFile.js.map +1 -1
  26. package/dist/components/VirtualizedFileDiff.d.ts +35 -9
  27. package/dist/components/VirtualizedFileDiff.d.ts.map +1 -1
  28. package/dist/components/VirtualizedFileDiff.js +367 -120
  29. package/dist/components/VirtualizedFileDiff.js.map +1 -1
  30. package/dist/components/Virtualizer.d.ts +4 -1
  31. package/dist/components/Virtualizer.d.ts.map +1 -1
  32. package/dist/components/Virtualizer.js +47 -29
  33. package/dist/components/Virtualizer.js.map +1 -1
  34. package/dist/components/VirtulizerDevelopment.d.ts.map +1 -1
  35. package/dist/components/web-components.d.ts.map +1 -1
  36. package/dist/components/web-components.js +2 -3
  37. package/dist/components/web-components.js.map +1 -1
  38. package/dist/constants.d.ts +5 -2
  39. package/dist/constants.d.ts.map +1 -1
  40. package/dist/constants.js +5 -2
  41. package/dist/constants.js.map +1 -1
  42. package/dist/editor/command.d.ts +3 -2
  43. package/dist/editor/command.d.ts.map +1 -1
  44. package/dist/editor/command.js +29 -6
  45. package/dist/editor/command.js.map +1 -1
  46. package/dist/editor/editStack.d.ts +7 -2
  47. package/dist/editor/editStack.d.ts.map +1 -1
  48. package/dist/editor/editStack.js +4 -4
  49. package/dist/editor/editStack.js.map +1 -1
  50. package/dist/editor/editor.d.ts +91 -8
  51. package/dist/editor/editor.d.ts.map +1 -1
  52. package/dist/editor/editor.js +1926 -704
  53. package/dist/editor/editor.js.map +1 -1
  54. package/dist/editor/editor2.js +6 -0
  55. package/dist/editor/editor2.js.map +1 -0
  56. package/dist/editor/index.d.ts +4 -2
  57. package/dist/editor/index.js +1 -2
  58. package/dist/editor/languages.d.ts +26 -0
  59. package/dist/editor/languages.d.ts.map +1 -0
  60. package/dist/editor/languages.js +363 -0
  61. package/dist/editor/languages.js.map +1 -0
  62. package/dist/editor/lineAnnotations.d.ts +2 -1
  63. package/dist/editor/lineAnnotations.d.ts.map +1 -1
  64. package/dist/editor/lineAnnotations.js +193 -13
  65. package/dist/editor/lineAnnotations.js.map +1 -1
  66. package/dist/editor/marker.d.ts +38 -0
  67. package/dist/editor/marker.d.ts.map +1 -0
  68. package/dist/editor/marker.js +245 -0
  69. package/dist/editor/marker.js.map +1 -0
  70. package/dist/editor/matchBrackets.d.ts +9 -0
  71. package/dist/editor/matchBrackets.d.ts.map +1 -0
  72. package/dist/editor/matchBrackets.js +138 -0
  73. package/dist/editor/matchBrackets.js.map +1 -0
  74. package/dist/editor/pieceTable.d.ts +15 -7
  75. package/dist/editor/pieceTable.d.ts.map +1 -1
  76. package/dist/editor/pieceTable.js +252 -171
  77. package/dist/editor/pieceTable.js.map +1 -1
  78. package/dist/editor/platform.d.ts +8 -1
  79. package/dist/editor/platform.d.ts.map +1 -1
  80. package/dist/editor/platform.js +18 -5
  81. package/dist/editor/platform.js.map +1 -1
  82. package/dist/editor/popover.d.ts +65 -0
  83. package/dist/editor/popover.d.ts.map +1 -0
  84. package/dist/editor/popover.js +187 -0
  85. package/dist/editor/popover.js.map +1 -0
  86. package/dist/editor/searchPanel.d.ts +17 -7
  87. package/dist/editor/searchPanel.d.ts.map +1 -1
  88. package/dist/editor/searchPanel.js +268 -169
  89. package/dist/editor/searchPanel.js.map +1 -1
  90. package/dist/editor/selection.d.ts +100 -15
  91. package/dist/editor/selection.d.ts.map +1 -1
  92. package/dist/editor/selection.js +862 -136
  93. package/dist/editor/selection.js.map +1 -1
  94. package/dist/editor/selectionAction.d.ts +46 -0
  95. package/dist/editor/selectionAction.d.ts.map +1 -0
  96. package/dist/editor/selectionAction.js +64 -0
  97. package/dist/editor/selectionAction.js.map +1 -0
  98. package/dist/editor/sprite.d.ts +8 -0
  99. package/dist/editor/sprite.d.ts.map +1 -0
  100. package/dist/editor/sprite.js +45 -0
  101. package/dist/editor/sprite.js.map +1 -0
  102. package/dist/editor/stateStorage.d.ts +15 -0
  103. package/dist/editor/stateStorage.d.ts.map +1 -0
  104. package/dist/editor/stateStorage.js +65 -0
  105. package/dist/editor/stateStorage.js.map +1 -0
  106. package/dist/editor/textDocument.d.ts +21 -83
  107. package/dist/editor/textDocument.d.ts.map +1 -1
  108. package/dist/editor/textDocument.js +117 -48
  109. package/dist/editor/textDocument.js.map +1 -1
  110. package/dist/editor/textMeasure.d.ts +31 -2
  111. package/dist/editor/textMeasure.d.ts.map +1 -1
  112. package/dist/editor/textMeasure.js +122 -21
  113. package/dist/editor/textMeasure.js.map +1 -1
  114. package/dist/editor/{tokenzier.d.ts → tokenizer.d.ts} +16 -12
  115. package/dist/editor/tokenizer.d.ts.map +1 -0
  116. package/dist/editor/tokenizer.js +513 -0
  117. package/dist/editor/tokenizer.js.map +1 -0
  118. package/dist/editor/utils.d.ts +6 -1
  119. package/dist/editor/utils.d.ts.map +1 -1
  120. package/dist/editor/utils.js +34 -3
  121. package/dist/editor/utils.js.map +1 -1
  122. package/dist/highlighter/languages/areLanguagesAttached.d.ts.map +1 -1
  123. package/dist/highlighter/languages/areLanguagesAttached.js +1 -2
  124. package/dist/highlighter/languages/areLanguagesAttached.js.map +1 -1
  125. package/dist/highlighter/languages/attachResolvedLanguages.d.ts +0 -2
  126. package/dist/highlighter/languages/attachResolvedLanguages.d.ts.map +1 -1
  127. package/dist/highlighter/languages/attachResolvedLanguages.js +1 -2
  128. package/dist/highlighter/languages/attachResolvedLanguages.js.map +1 -1
  129. package/dist/highlighter/languages/cleanUpResolvedLanguages.d.ts.map +1 -1
  130. package/dist/highlighter/languages/cleanUpResolvedLanguages.js +1 -2
  131. package/dist/highlighter/languages/cleanUpResolvedLanguages.js.map +1 -1
  132. package/dist/highlighter/languages/constants.d.ts +0 -1
  133. package/dist/highlighter/languages/constants.d.ts.map +1 -1
  134. package/dist/highlighter/languages/constants.js +1 -1
  135. package/dist/highlighter/languages/constants.js.map +1 -1
  136. package/dist/highlighter/languages/getResolvedLanguages.d.ts +0 -2
  137. package/dist/highlighter/languages/getResolvedLanguages.d.ts.map +1 -1
  138. package/dist/highlighter/languages/getResolvedLanguages.js +1 -2
  139. package/dist/highlighter/languages/getResolvedLanguages.js.map +1 -1
  140. package/dist/highlighter/languages/getResolvedOrResolveLanguage.d.ts +0 -2
  141. package/dist/highlighter/languages/getResolvedOrResolveLanguage.d.ts.map +1 -1
  142. package/dist/highlighter/languages/getResolvedOrResolveLanguage.js +1 -2
  143. package/dist/highlighter/languages/getResolvedOrResolveLanguage.js.map +1 -1
  144. package/dist/highlighter/languages/hasResolvedLanguages.d.ts.map +1 -1
  145. package/dist/highlighter/languages/hasResolvedLanguages.js +1 -2
  146. package/dist/highlighter/languages/hasResolvedLanguages.js.map +1 -1
  147. package/dist/highlighter/languages/registerCustomLanguage.d.ts +0 -1
  148. package/dist/highlighter/languages/registerCustomLanguage.d.ts.map +1 -1
  149. package/dist/highlighter/languages/registerCustomLanguage.js +1 -2
  150. package/dist/highlighter/languages/registerCustomLanguage.js.map +1 -1
  151. package/dist/highlighter/languages/resolveLanguage.d.ts +0 -2
  152. package/dist/highlighter/languages/resolveLanguage.d.ts.map +1 -1
  153. package/dist/highlighter/languages/resolveLanguage.js +4 -5
  154. package/dist/highlighter/languages/resolveLanguage.js.map +1 -1
  155. package/dist/highlighter/languages/resolveLanguages.d.ts +0 -2
  156. package/dist/highlighter/languages/resolveLanguages.d.ts.map +1 -1
  157. package/dist/highlighter/languages/resolveLanguages.js +1 -2
  158. package/dist/highlighter/languages/resolveLanguages.js.map +1 -1
  159. package/dist/highlighter/shared_highlighter.d.ts.map +1 -1
  160. package/dist/highlighter/shared_highlighter.js +6 -33
  161. package/dist/highlighter/shared_highlighter.js.map +1 -1
  162. package/dist/highlighter/themes/areThemesAttached.d.ts.map +1 -1
  163. package/dist/highlighter/themes/areThemesAttached.js +1 -2
  164. package/dist/highlighter/themes/areThemesAttached.js.map +1 -1
  165. package/dist/highlighter/themes/attachResolvedThemes.d.ts.map +1 -1
  166. package/dist/highlighter/themes/attachResolvedThemes.js +5 -5
  167. package/dist/highlighter/themes/attachResolvedThemes.js.map +1 -1
  168. package/dist/highlighter/themes/cleanUpResolvedThemes.d.ts.map +1 -1
  169. package/dist/highlighter/themes/cleanUpResolvedThemes.js +4 -4
  170. package/dist/highlighter/themes/cleanUpResolvedThemes.js.map +1 -1
  171. package/dist/highlighter/themes/constants.d.ts +1 -7
  172. package/dist/highlighter/themes/constants.d.ts.map +1 -1
  173. package/dist/highlighter/themes/constants.js +2 -5
  174. package/dist/highlighter/themes/constants.js.map +1 -1
  175. package/dist/highlighter/themes/getResolvedOrResolveTheme.d.ts.map +1 -1
  176. package/dist/highlighter/themes/getResolvedOrResolveTheme.js +3 -4
  177. package/dist/highlighter/themes/getResolvedOrResolveTheme.js.map +1 -1
  178. package/dist/highlighter/themes/getResolvedThemes.d.ts.map +1 -1
  179. package/dist/highlighter/themes/getResolvedThemes.js +3 -10
  180. package/dist/highlighter/themes/getResolvedThemes.js.map +1 -1
  181. package/dist/highlighter/themes/hasResolvedThemes.d.ts.map +1 -1
  182. package/dist/highlighter/themes/hasResolvedThemes.js +3 -5
  183. package/dist/highlighter/themes/hasResolvedThemes.js.map +1 -1
  184. package/dist/highlighter/themes/registerCustomCSSVariableTheme.d.ts.map +1 -1
  185. package/dist/highlighter/themes/registerCustomCSSVariableTheme.js +2 -3
  186. package/dist/highlighter/themes/registerCustomCSSVariableTheme.js.map +1 -1
  187. package/dist/highlighter/themes/registerCustomTheme.d.ts +5 -3
  188. package/dist/highlighter/themes/registerCustomTheme.d.ts.map +1 -1
  189. package/dist/highlighter/themes/registerCustomTheme.js +16 -7
  190. package/dist/highlighter/themes/registerCustomTheme.js.map +1 -1
  191. package/dist/highlighter/themes/resolveTheme.d.ts.map +1 -1
  192. package/dist/highlighter/themes/resolveTheme.js +7 -29
  193. package/dist/highlighter/themes/resolveTheme.js.map +1 -1
  194. package/dist/highlighter/themes/resolveThemes.d.ts.map +1 -1
  195. package/dist/highlighter/themes/resolveThemes.js +6 -14
  196. package/dist/highlighter/themes/resolveThemes.js.map +1 -1
  197. package/dist/highlighter/themes/themeResolution.d.ts +8 -0
  198. package/dist/highlighter/themes/themeResolution.d.ts.map +1 -0
  199. package/dist/highlighter/themes/themeResolution.js +21 -0
  200. package/dist/highlighter/themes/themeResolution.js.map +1 -0
  201. package/dist/highlighter/themes/themeResolver.d.ts +8 -0
  202. package/dist/highlighter/themes/themeResolver.d.ts.map +1 -0
  203. package/dist/highlighter/themes/themeResolver.js +7 -0
  204. package/dist/highlighter/themes/themeResolver.js.map +1 -0
  205. package/dist/index.d.ts +16 -14
  206. package/dist/index.js +13 -12
  207. package/dist/managers/InteractionManager.d.ts +7 -0
  208. package/dist/managers/InteractionManager.d.ts.map +1 -1
  209. package/dist/managers/InteractionManager.js +26 -5
  210. package/dist/managers/InteractionManager.js.map +1 -1
  211. package/dist/managers/ResizeManager.d.ts +10 -2
  212. package/dist/managers/ResizeManager.d.ts.map +1 -1
  213. package/dist/managers/ResizeManager.js +35 -15
  214. package/dist/managers/ResizeManager.js.map +1 -1
  215. package/dist/managers/ScrollSyncManager.d.ts.map +1 -1
  216. package/dist/managers/ScrollSyncManager.js +1 -1
  217. package/dist/managers/ScrollSyncManager.js.map +1 -1
  218. package/dist/managers/UniversalRenderingManager.d.ts +2 -1
  219. package/dist/managers/UniversalRenderingManager.d.ts.map +1 -1
  220. package/dist/managers/UniversalRenderingManager.js +8 -3
  221. package/dist/managers/UniversalRenderingManager.js.map +1 -1
  222. package/dist/node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.d.ts +228 -0
  223. package/dist/node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.d.ts.map +1 -0
  224. package/dist/node_modules/.pnpm/@types_unist@3.0.3/node_modules/@types/unist/index.d.ts +84 -0
  225. package/dist/node_modules/.pnpm/@types_unist@3.0.3/node_modules/@types/unist/index.d.ts.map +1 -0
  226. package/dist/react/CodeView.d.ts +26 -2
  227. package/dist/react/CodeView.d.ts.map +1 -1
  228. package/dist/react/CodeView.js +90 -30
  229. package/dist/react/CodeView.js.map +1 -1
  230. package/dist/react/EditContext.d.ts +15 -0
  231. package/dist/react/EditContext.d.ts.map +1 -0
  232. package/dist/react/EditContext.js +23 -0
  233. package/dist/react/EditContext.js.map +1 -0
  234. package/dist/react/File.d.ts +1 -0
  235. package/dist/react/File.d.ts.map +1 -1
  236. package/dist/react/File.js +4 -6
  237. package/dist/react/File.js.map +1 -1
  238. package/dist/react/FileDiff.d.ts +1 -0
  239. package/dist/react/FileDiff.d.ts.map +1 -1
  240. package/dist/react/FileDiff.js +4 -6
  241. package/dist/react/FileDiff.js.map +1 -1
  242. package/dist/react/MultiFileDiff.d.ts +4 -4
  243. package/dist/react/MultiFileDiff.d.ts.map +1 -1
  244. package/dist/react/MultiFileDiff.js +4 -6
  245. package/dist/react/MultiFileDiff.js.map +1 -1
  246. package/dist/react/PatchDiff.d.ts +1 -0
  247. package/dist/react/PatchDiff.d.ts.map +1 -1
  248. package/dist/react/PatchDiff.js +4 -6
  249. package/dist/react/PatchDiff.js.map +1 -1
  250. package/dist/react/UnresolvedFile.d.ts +2 -1
  251. package/dist/react/UnresolvedFile.d.ts.map +1 -1
  252. package/dist/react/UnresolvedFile.js +4 -6
  253. package/dist/react/UnresolvedFile.js.map +1 -1
  254. package/dist/react/Virtualizer.d.ts.map +1 -1
  255. package/dist/react/Virtualizer.js +2 -5
  256. package/dist/react/Virtualizer.js.map +1 -1
  257. package/dist/react/WorkerPoolContext.d.ts +0 -1
  258. package/dist/react/WorkerPoolContext.d.ts.map +1 -1
  259. package/dist/react/WorkerPoolContext.js +2 -5
  260. package/dist/react/WorkerPoolContext.js.map +1 -1
  261. package/dist/react/constants.d.ts.map +1 -1
  262. package/dist/react/constants.js +1 -1
  263. package/dist/react/constants.js.map +1 -1
  264. package/dist/react/index.d.ts +3 -3
  265. package/dist/react/index.js +2 -3
  266. package/dist/react/jsx.d.ts +0 -1
  267. package/dist/react/jsx.d.ts.map +1 -1
  268. package/dist/react/types.d.ts +2 -0
  269. package/dist/react/types.d.ts.map +1 -1
  270. package/dist/react/types.js +1 -0
  271. package/dist/react/utils/renderDiffChildren.d.ts +2 -0
  272. package/dist/react/utils/renderDiffChildren.d.ts.map +1 -1
  273. package/dist/react/utils/renderDiffChildren.js +18 -11
  274. package/dist/react/utils/renderDiffChildren.js.map +1 -1
  275. package/dist/react/utils/renderFileChildren.d.ts +2 -0
  276. package/dist/react/utils/renderFileChildren.d.ts.map +1 -1
  277. package/dist/react/utils/renderFileChildren.js +18 -11
  278. package/dist/react/utils/renderFileChildren.js.map +1 -1
  279. package/dist/react/utils/templateRender.d.ts.map +1 -1
  280. package/dist/react/utils/templateRender.js +1 -2
  281. package/dist/react/utils/templateRender.js.map +1 -1
  282. package/dist/react/utils/useFileDiffInstance.d.ts.map +1 -1
  283. package/dist/react/utils/useFileDiffInstance.js +15 -18
  284. package/dist/react/utils/useFileDiffInstance.js.map +1 -1
  285. package/dist/react/utils/useFileInstance.d.ts.map +1 -1
  286. package/dist/react/utils/useFileInstance.js +2 -3
  287. package/dist/react/utils/useFileInstance.js.map +1 -1
  288. package/dist/react/utils/useStableCallback.d.ts.map +1 -1
  289. package/dist/react/utils/useStableCallback.js +1 -2
  290. package/dist/react/utils/useStableCallback.js.map +1 -1
  291. package/dist/react/utils/useUnresolvedFileInstance.d.ts.map +1 -1
  292. package/dist/react/utils/useUnresolvedFileInstance.js +10 -11
  293. package/dist/react/utils/useUnresolvedFileInstance.js.map +1 -1
  294. package/dist/renderers/DiffHunksRenderer.d.ts +30 -4
  295. package/dist/renderers/DiffHunksRenderer.d.ts.map +1 -1
  296. package/dist/renderers/DiffHunksRenderer.js +313 -45
  297. package/dist/renderers/DiffHunksRenderer.js.map +1 -1
  298. package/dist/renderers/FileRenderer.d.ts +7 -6
  299. package/dist/renderers/FileRenderer.d.ts.map +1 -1
  300. package/dist/renderers/FileRenderer.js +113 -56
  301. package/dist/renderers/FileRenderer.js.map +1 -1
  302. package/dist/renderers/UnresolvedFileHunksRenderer.d.ts +1 -2
  303. package/dist/renderers/UnresolvedFileHunksRenderer.d.ts.map +1 -1
  304. package/dist/renderers/UnresolvedFileHunksRenderer.js +1 -2
  305. package/dist/renderers/UnresolvedFileHunksRenderer.js.map +1 -1
  306. package/dist/shiki-stream/index.js +1 -2
  307. package/dist/shiki-stream/stream.d.ts +0 -1
  308. package/dist/shiki-stream/stream.d.ts.map +1 -1
  309. package/dist/shiki-stream/stream.js +1 -2
  310. package/dist/shiki-stream/stream.js.map +1 -1
  311. package/dist/shiki-stream/tokenizer.d.ts.map +1 -1
  312. package/dist/shiki-stream/tokenizer.js +1 -1
  313. package/dist/shiki-stream/tokenizer.js.map +1 -1
  314. package/dist/shiki-stream/types.d.ts +0 -1
  315. package/dist/shiki-stream/types.d.ts.map +1 -1
  316. package/dist/sprite.d.ts.map +1 -1
  317. package/dist/sprite.js +1 -1
  318. package/dist/ssr/FileDiffReact.d.ts.map +1 -1
  319. package/dist/ssr/FileDiffReact.js +4 -7
  320. package/dist/ssr/FileDiffReact.js.map +1 -1
  321. package/dist/ssr/index.d.ts +2 -2
  322. package/dist/ssr/index.js +1 -2
  323. package/dist/ssr/preloadDiffs.d.ts +12 -11
  324. package/dist/ssr/preloadDiffs.d.ts.map +1 -1
  325. package/dist/ssr/preloadDiffs.js +16 -9
  326. package/dist/ssr/preloadDiffs.js.map +1 -1
  327. package/dist/ssr/preloadFile.d.ts.map +1 -1
  328. package/dist/ssr/preloadFile.js +1 -2
  329. package/dist/ssr/preloadFile.js.map +1 -1
  330. package/dist/ssr/preloadPatchFile.d.ts.map +1 -1
  331. package/dist/ssr/preloadPatchFile.js +2 -3
  332. package/dist/ssr/preloadPatchFile.js.map +1 -1
  333. package/dist/ssr/renderHTML.d.ts +1 -1
  334. package/dist/ssr/renderHTML.d.ts.map +1 -1
  335. package/dist/ssr/renderHTML.js +1 -2
  336. package/dist/ssr/renderHTML.js.map +1 -1
  337. package/dist/string-import.d.ts +4 -0
  338. package/dist/string-import.d.ts.map +1 -1
  339. package/dist/style.js +3 -3
  340. package/dist/style.js.map +1 -1
  341. package/dist/types.d.ts +272 -31
  342. package/dist/types.d.ts.map +1 -1
  343. package/dist/utils/applyLineTextWithNewline.d.ts +5 -0
  344. package/dist/utils/applyLineTextWithNewline.d.ts.map +1 -0
  345. package/dist/utils/applyLineTextWithNewline.js +11 -0
  346. package/dist/utils/applyLineTextWithNewline.js.map +1 -0
  347. package/dist/utils/areDiffLineAnnotationsEqual.d.ts.map +1 -1
  348. package/dist/utils/areDiffLineAnnotationsEqual.js +1 -1
  349. package/dist/utils/areDiffLineAnnotationsEqual.js.map +1 -1
  350. package/dist/utils/areDiffRenderOptionsEqual.d.ts.map +1 -1
  351. package/dist/utils/areDiffRenderOptionsEqual.js +1 -2
  352. package/dist/utils/areDiffRenderOptionsEqual.js.map +1 -1
  353. package/dist/utils/areDiffTargetsEqual.d.ts.map +1 -1
  354. package/dist/utils/areDiffTargetsEqual.js +1 -1
  355. package/dist/utils/areDiffTargetsEqual.js.map +1 -1
  356. package/dist/utils/areFileRenderOptionsEqual.d.ts.map +1 -1
  357. package/dist/utils/areFileRenderOptionsEqual.js +1 -2
  358. package/dist/utils/areFileRenderOptionsEqual.js.map +1 -1
  359. package/dist/utils/areFilesEqual.d.ts.map +1 -1
  360. package/dist/utils/areFilesEqual.js +1 -1
  361. package/dist/utils/areFilesEqual.js.map +1 -1
  362. package/dist/utils/areHunkDataEqual.d.ts.map +1 -1
  363. package/dist/utils/areHunkDataEqual.js +2 -2
  364. package/dist/utils/areHunkDataEqual.js.map +1 -1
  365. package/dist/utils/areLineAnnotationsEqual.d.ts.map +1 -1
  366. package/dist/utils/areLineAnnotationsEqual.js +1 -1
  367. package/dist/utils/areLineAnnotationsEqual.js.map +1 -1
  368. package/dist/utils/areManagedSnapshotsEqual.d.ts +2 -2
  369. package/dist/utils/areManagedSnapshotsEqual.d.ts.map +1 -1
  370. package/dist/utils/areManagedSnapshotsEqual.js +6 -1
  371. package/dist/utils/areManagedSnapshotsEqual.js.map +1 -1
  372. package/dist/utils/areMergeConflictActionsEqual.d.ts.map +1 -1
  373. package/dist/utils/areMergeConflictActionsEqual.js +1 -1
  374. package/dist/utils/areMergeConflictActionsEqual.js.map +1 -1
  375. package/dist/utils/areObjectsEqual.d.ts.map +1 -1
  376. package/dist/utils/areObjectsEqual.js +1 -1
  377. package/dist/utils/areObjectsEqual.js.map +1 -1
  378. package/dist/utils/areOptionsEqual.d.ts +0 -2
  379. package/dist/utils/areOptionsEqual.d.ts.map +1 -1
  380. package/dist/utils/areOptionsEqual.js +1 -2
  381. package/dist/utils/areOptionsEqual.js.map +1 -1
  382. package/dist/utils/arePrePropertiesEqual.d.ts.map +1 -1
  383. package/dist/utils/arePrePropertiesEqual.js +1 -1
  384. package/dist/utils/arePrePropertiesEqual.js.map +1 -1
  385. package/dist/utils/areRenderRangesEqual.d.ts.map +1 -1
  386. package/dist/utils/areRenderRangesEqual.js +1 -1
  387. package/dist/utils/areRenderRangesEqual.js.map +1 -1
  388. package/dist/utils/areSelectionPointsEqual.d.ts.map +1 -1
  389. package/dist/utils/areSelectionPointsEqual.js +1 -1
  390. package/dist/utils/areSelectionPointsEqual.js.map +1 -1
  391. package/dist/utils/areSelectionsEqual.d.ts.map +1 -1
  392. package/dist/utils/areSelectionsEqual.js +1 -1
  393. package/dist/utils/areSelectionsEqual.js.map +1 -1
  394. package/dist/utils/areThemesEqual.d.ts.map +1 -1
  395. package/dist/utils/areThemesEqual.js +1 -1
  396. package/dist/utils/areThemesEqual.js.map +1 -1
  397. package/dist/utils/areVirtualWindowSpecsEqual.d.ts.map +1 -1
  398. package/dist/utils/areVirtualWindowSpecsEqual.js +1 -1
  399. package/dist/utils/areVirtualWindowSpecsEqual.js.map +1 -1
  400. package/dist/utils/areWorkerStatsEqual.d.ts +0 -2
  401. package/dist/utils/areWorkerStatsEqual.d.ts.map +1 -1
  402. package/dist/utils/areWorkerStatsEqual.js +1 -1
  403. package/dist/utils/areWorkerStatsEqual.js.map +1 -1
  404. package/dist/utils/awaitWithTimeout.d.ts +5 -0
  405. package/dist/utils/awaitWithTimeout.d.ts.map +1 -0
  406. package/dist/utils/awaitWithTimeout.js +15 -0
  407. package/dist/utils/awaitWithTimeout.js.map +1 -0
  408. package/dist/utils/cleanLastNewline.d.ts.map +1 -1
  409. package/dist/utils/cleanLastNewline.js +1 -1
  410. package/dist/utils/cleanLastNewline.js.map +1 -1
  411. package/dist/utils/cloneFileDiffMetadata.d.ts +7 -0
  412. package/dist/utils/cloneFileDiffMetadata.d.ts.map +1 -0
  413. package/dist/utils/cloneFileDiffMetadata.js +16 -0
  414. package/dist/utils/cloneFileDiffMetadata.js.map +1 -0
  415. package/dist/utils/computeEstimatedDiffHeights.d.ts +3 -1
  416. package/dist/utils/computeEstimatedDiffHeights.d.ts.map +1 -1
  417. package/dist/utils/computeEstimatedDiffHeights.js +18 -23
  418. package/dist/utils/computeEstimatedDiffHeights.js.map +1 -1
  419. package/dist/utils/computeFileOffsets.d.ts +9 -1
  420. package/dist/utils/computeFileOffsets.d.ts.map +1 -1
  421. package/dist/utils/computeFileOffsets.js +20 -2
  422. package/dist/utils/computeFileOffsets.js.map +1 -1
  423. package/dist/utils/computeVirtualFileMetrics.d.ts.map +1 -1
  424. package/dist/utils/computeVirtualFileMetrics.js +1 -2
  425. package/dist/utils/computeVirtualFileMetrics.js.map +1 -1
  426. package/dist/utils/createAnnotationElement.d.ts +1 -1
  427. package/dist/utils/createAnnotationElement.d.ts.map +1 -1
  428. package/dist/utils/createAnnotationElement.js +1 -2
  429. package/dist/utils/createAnnotationElement.js.map +1 -1
  430. package/dist/utils/createAnnotationWrapperNode.d.ts.map +1 -1
  431. package/dist/utils/createAnnotationWrapperNode.js +1 -1
  432. package/dist/utils/createAnnotationWrapperNode.js.map +1 -1
  433. package/dist/utils/createCodeViewHeaderFooterHostElement.d.ts +5 -0
  434. package/dist/utils/createCodeViewHeaderFooterHostElement.d.ts.map +1 -0
  435. package/dist/utils/createCodeViewHeaderFooterHostElement.js +19 -0
  436. package/dist/utils/createCodeViewHeaderFooterHostElement.js.map +1 -0
  437. package/dist/utils/createContentColumn.d.ts +1 -1
  438. package/dist/utils/createContentColumn.d.ts.map +1 -1
  439. package/dist/utils/createContentColumn.js +1 -2
  440. package/dist/utils/createContentColumn.js.map +1 -1
  441. package/dist/utils/createEmptyRowBuffer.d.ts +1 -1
  442. package/dist/utils/createEmptyRowBuffer.d.ts.map +1 -1
  443. package/dist/utils/createEmptyRowBuffer.js +1 -2
  444. package/dist/utils/createEmptyRowBuffer.js.map +1 -1
  445. package/dist/utils/createFileHeaderElement.d.ts +1 -1
  446. package/dist/utils/createFileHeaderElement.d.ts.map +1 -1
  447. package/dist/utils/createFileHeaderElement.js +6 -3
  448. package/dist/utils/createFileHeaderElement.js.map +1 -1
  449. package/dist/utils/createGutterUtilityContentNode.d.ts.map +1 -1
  450. package/dist/utils/createGutterUtilityContentNode.js +1 -1
  451. package/dist/utils/createGutterUtilityContentNode.js.map +1 -1
  452. package/dist/utils/createGutterUtilityElement.d.ts +1 -1
  453. package/dist/utils/createGutterUtilityElement.d.ts.map +1 -1
  454. package/dist/utils/createGutterUtilityElement.js +1 -2
  455. package/dist/utils/createGutterUtilityElement.js.map +1 -1
  456. package/dist/utils/createNoNewlineElement.d.ts +1 -1
  457. package/dist/utils/createNoNewlineElement.d.ts.map +1 -1
  458. package/dist/utils/createNoNewlineElement.js +1 -2
  459. package/dist/utils/createNoNewlineElement.js.map +1 -1
  460. package/dist/utils/createPreElement.d.ts +1 -1
  461. package/dist/utils/createPreElement.d.ts.map +1 -1
  462. package/dist/utils/createPreElement.js +1 -3
  463. package/dist/utils/createPreElement.js.map +1 -1
  464. package/dist/utils/createRowNodes.d.ts.map +1 -1
  465. package/dist/utils/createRowNodes.js +1 -1
  466. package/dist/utils/createRowNodes.js.map +1 -1
  467. package/dist/utils/createSeparator.d.ts +1 -1
  468. package/dist/utils/createSeparator.d.ts.map +1 -1
  469. package/dist/utils/createSeparator.js +1 -2
  470. package/dist/utils/createSeparator.js.map +1 -1
  471. package/dist/utils/createSpanNodeFromToken.d.ts.map +1 -1
  472. package/dist/utils/createSpanNodeFromToken.js +1 -2
  473. package/dist/utils/createSpanNodeFromToken.js.map +1 -1
  474. package/dist/utils/createStyleElement.d.ts +1 -1
  475. package/dist/utils/createStyleElement.d.ts.map +1 -1
  476. package/dist/utils/createStyleElement.js +1 -2
  477. package/dist/utils/createStyleElement.js.map +1 -1
  478. package/dist/utils/createTransformerWithState.d.ts.map +1 -1
  479. package/dist/utils/createTransformerWithState.js +1 -2
  480. package/dist/utils/createTransformerWithState.js.map +1 -1
  481. package/dist/utils/createUnsafeCSSStyleNode.d.ts.map +1 -1
  482. package/dist/utils/createUnsafeCSSStyleNode.js +1 -2
  483. package/dist/utils/createUnsafeCSSStyleNode.js.map +1 -1
  484. package/dist/utils/createWindowFromScrollPosition.d.ts.map +1 -1
  485. package/dist/utils/createWindowFromScrollPosition.js +5 -5
  486. package/dist/utils/createWindowFromScrollPosition.js.map +1 -1
  487. package/dist/utils/cssWrappers.d.ts.map +1 -1
  488. package/dist/utils/cssWrappers.js +2 -3
  489. package/dist/utils/cssWrappers.js.map +1 -1
  490. package/dist/utils/detachString.d.ts.map +1 -1
  491. package/dist/utils/detachString.js +1 -1
  492. package/dist/utils/detachString.js.map +1 -1
  493. package/dist/utils/diffAcceptRejectHunk.d.ts.map +1 -1
  494. package/dist/utils/diffAcceptRejectHunk.js +1 -2
  495. package/dist/utils/diffAcceptRejectHunk.js.map +1 -1
  496. package/dist/utils/editSessionHunks.d.ts +84 -0
  497. package/dist/utils/editSessionHunks.d.ts.map +1 -0
  498. package/dist/utils/editSessionHunks.js +366 -0
  499. package/dist/utils/editSessionHunks.js.map +1 -0
  500. package/dist/utils/formatCSSVariablePrefix.d.ts.map +1 -1
  501. package/dist/utils/formatCSSVariablePrefix.js +1 -1
  502. package/dist/utils/formatCSSVariablePrefix.js.map +1 -1
  503. package/dist/utils/getDiffFileInput.d.ts +14 -0
  504. package/dist/utils/getDiffFileInput.d.ts.map +1 -0
  505. package/dist/utils/getDiffFileInput.js +24 -0
  506. package/dist/utils/getDiffFileInput.js.map +1 -0
  507. package/dist/utils/getDiffHunksRendererOptions.d.ts.map +1 -1
  508. package/dist/utils/getDiffHunksRendererOptions.js +2 -1
  509. package/dist/utils/getDiffHunksRendererOptions.js.map +1 -1
  510. package/dist/utils/getFileRendererOptions.d.ts.map +1 -1
  511. package/dist/utils/getFileRendererOptions.js +1 -1
  512. package/dist/utils/getFileRendererOptions.js.map +1 -1
  513. package/dist/utils/getFiletypeFromFileName.d.ts.map +1 -1
  514. package/dist/utils/getFiletypeFromFileName.js +3 -1
  515. package/dist/utils/getFiletypeFromFileName.js.map +1 -1
  516. package/dist/utils/getHighlighterOptions.d.ts.map +1 -1
  517. package/dist/utils/getHighlighterOptions.js +1 -2
  518. package/dist/utils/getHighlighterOptions.js.map +1 -1
  519. package/dist/utils/getHighlighterThemeStyles.d.ts.map +1 -1
  520. package/dist/utils/getHighlighterThemeStyles.js +17 -14
  521. package/dist/utils/getHighlighterThemeStyles.js.map +1 -1
  522. package/dist/utils/getHunkSeparatorSlotName.d.ts.map +1 -1
  523. package/dist/utils/getHunkSeparatorSlotName.js +1 -1
  524. package/dist/utils/getHunkSeparatorSlotName.js.map +1 -1
  525. package/dist/utils/getIconForType.d.ts.map +1 -1
  526. package/dist/utils/getIconForType.js +1 -1
  527. package/dist/utils/getIconForType.js.map +1 -1
  528. package/dist/utils/getLineAnnotationName.d.ts.map +1 -1
  529. package/dist/utils/getLineAnnotationName.js +1 -1
  530. package/dist/utils/getLineAnnotationName.js.map +1 -1
  531. package/dist/utils/getLineEndingType.d.ts.map +1 -1
  532. package/dist/utils/getLineEndingType.js +1 -1
  533. package/dist/utils/getLineEndingType.js.map +1 -1
  534. package/dist/utils/getLineNodes.d.ts +1 -1
  535. package/dist/utils/getLineNodes.d.ts.map +1 -1
  536. package/dist/utils/getLineNodes.js +1 -1
  537. package/dist/utils/getLineNodes.js.map +1 -1
  538. package/dist/utils/getMergeConflictActionSlotName.d.ts.map +1 -1
  539. package/dist/utils/getMergeConflictActionSlotName.js +1 -1
  540. package/dist/utils/getMergeConflictActionSlotName.js.map +1 -1
  541. package/dist/utils/getMergeConflictLineTypes.d.ts.map +1 -1
  542. package/dist/utils/getMergeConflictLineTypes.js +1 -2
  543. package/dist/utils/getMergeConflictLineTypes.js.map +1 -1
  544. package/dist/utils/getOrCreateCodeNode.d.ts.map +1 -1
  545. package/dist/utils/getOrCreateCodeNode.js +1 -1
  546. package/dist/utils/getOrCreateCodeNode.js.map +1 -1
  547. package/dist/utils/getSingularPatch.d.ts.map +1 -1
  548. package/dist/utils/getSingularPatch.js +1 -2
  549. package/dist/utils/getSingularPatch.js.map +1 -1
  550. package/dist/utils/getThemes.d.ts.map +1 -1
  551. package/dist/utils/getThemes.js +1 -2
  552. package/dist/utils/getThemes.js.map +1 -1
  553. package/dist/utils/getTotalLineCountFromHunks.d.ts.map +1 -1
  554. package/dist/utils/getTotalLineCountFromHunks.js +1 -1
  555. package/dist/utils/getTotalLineCountFromHunks.js.map +1 -1
  556. package/dist/utils/hast_utils.d.ts +1 -1
  557. package/dist/utils/hast_utils.d.ts.map +1 -1
  558. package/dist/utils/hast_utils.js +1 -1
  559. package/dist/utils/hast_utils.js.map +1 -1
  560. package/dist/utils/hostTheme.d.ts.map +1 -1
  561. package/dist/utils/hostTheme.js +1 -2
  562. package/dist/utils/hostTheme.js.map +1 -1
  563. package/dist/utils/hydratePartialDiff.d.ts +10 -0
  564. package/dist/utils/hydratePartialDiff.d.ts.map +1 -0
  565. package/dist/utils/hydratePartialDiff.js +140 -0
  566. package/dist/utils/hydratePartialDiff.js.map +1 -0
  567. package/dist/utils/includesFileAnnotations.d.ts +17 -0
  568. package/dist/utils/includesFileAnnotations.d.ts.map +1 -0
  569. package/dist/utils/includesFileAnnotations.js +19 -0
  570. package/dist/utils/includesFileAnnotations.js.map +1 -0
  571. package/dist/utils/isDefaultRenderRange.d.ts.map +1 -1
  572. package/dist/utils/isDefaultRenderRange.js +1 -1
  573. package/dist/utils/isDefaultRenderRange.js.map +1 -1
  574. package/dist/utils/isDiffPlainText.d.ts.map +1 -1
  575. package/dist/utils/isDiffPlainText.js +1 -2
  576. package/dist/utils/isDiffPlainText.js.map +1 -1
  577. package/dist/utils/isFilePlainText.d.ts.map +1 -1
  578. package/dist/utils/isFilePlainText.js +1 -2
  579. package/dist/utils/isFilePlainText.js.map +1 -1
  580. package/dist/utils/isStyleNode.d.ts.map +1 -1
  581. package/dist/utils/isStyleNode.js +1 -1
  582. package/dist/utils/isStyleNode.js.map +1 -1
  583. package/dist/utils/isWorkerContext.d.ts.map +1 -1
  584. package/dist/utils/isWorkerContext.js +1 -1
  585. package/dist/utils/isWorkerContext.js.map +1 -1
  586. package/dist/utils/iterateOverDiff.d.ts.map +1 -1
  587. package/dist/utils/iterateOverDiff.js +178 -214
  588. package/dist/utils/iterateOverDiff.js.map +1 -1
  589. package/dist/utils/normalizeDiffResolution.d.ts.map +1 -1
  590. package/dist/utils/normalizeDiffResolution.js +1 -1
  591. package/dist/utils/normalizeDiffResolution.js.map +1 -1
  592. package/dist/utils/parseDiffDecorations.d.ts.map +1 -1
  593. package/dist/utils/parseDiffDecorations.js +1 -2
  594. package/dist/utils/parseDiffDecorations.js.map +1 -1
  595. package/dist/utils/parseDiffFromFile.d.ts +1 -2
  596. package/dist/utils/parseDiffFromFile.d.ts.map +1 -1
  597. package/dist/utils/parseDiffFromFile.js +27 -7
  598. package/dist/utils/parseDiffFromFile.js.map +1 -1
  599. package/dist/utils/parseLineType.d.ts.map +1 -1
  600. package/dist/utils/parseLineType.js +1 -1
  601. package/dist/utils/parseLineType.js.map +1 -1
  602. package/dist/utils/parseMergeConflictDiffFromFile.d.ts.map +1 -1
  603. package/dist/utils/parseMergeConflictDiffFromFile.js +5 -5
  604. package/dist/utils/parseMergeConflictDiffFromFile.js.map +1 -1
  605. package/dist/utils/parsePatchFiles.d.ts.map +1 -1
  606. package/dist/utils/parsePatchFiles.js +101 -11
  607. package/dist/utils/parsePatchFiles.js.map +1 -1
  608. package/dist/utils/prefersReducedMotion.d.ts.map +1 -1
  609. package/dist/utils/prefersReducedMotion.js +1 -1
  610. package/dist/utils/prefersReducedMotion.js.map +1 -1
  611. package/dist/utils/prerenderHTMLIfNecessary.d.ts.map +1 -1
  612. package/dist/utils/prerenderHTMLIfNecessary.js +1 -1
  613. package/dist/utils/prerenderHTMLIfNecessary.js.map +1 -1
  614. package/dist/utils/processLine.d.ts +1 -1
  615. package/dist/utils/processLine.d.ts.map +1 -1
  616. package/dist/utils/processLine.js +1 -2
  617. package/dist/utils/processLine.js.map +1 -1
  618. package/dist/utils/realignChangeContent.d.ts +28 -0
  619. package/dist/utils/realignChangeContent.d.ts.map +1 -0
  620. package/dist/utils/realignChangeContent.js +142 -0
  621. package/dist/utils/realignChangeContent.js.map +1 -0
  622. package/dist/utils/renderDiffWithHighlighter.d.ts.map +1 -1
  623. package/dist/utils/renderDiffWithHighlighter.js +9 -8
  624. package/dist/utils/renderDiffWithHighlighter.js.map +1 -1
  625. package/dist/utils/renderFileWithHighlighter.d.ts.map +1 -1
  626. package/dist/utils/renderFileWithHighlighter.js +5 -4
  627. package/dist/utils/renderFileWithHighlighter.js.map +1 -1
  628. package/dist/utils/resolveConflict.d.ts.map +1 -1
  629. package/dist/utils/resolveConflict.js +1 -2
  630. package/dist/utils/resolveConflict.js.map +1 -1
  631. package/dist/utils/resolveRegion.d.ts.map +1 -1
  632. package/dist/utils/resolveRegion.js +1 -1
  633. package/dist/utils/resolveRegion.js.map +1 -1
  634. package/dist/utils/roundToDevicePixel.d.ts.map +1 -1
  635. package/dist/utils/roundToDevicePixel.js +1 -1
  636. package/dist/utils/roundToDevicePixel.js.map +1 -1
  637. package/dist/utils/scrollbarGutter.d.ts.map +1 -1
  638. package/dist/utils/scrollbarGutter.js +1 -2
  639. package/dist/utils/scrollbarGutter.js.map +1 -1
  640. package/dist/utils/setLanguageOverride.d.ts.map +1 -1
  641. package/dist/utils/setLanguageOverride.js +1 -1
  642. package/dist/utils/setLanguageOverride.js.map +1 -1
  643. package/dist/utils/setWrapperNodeProps.d.ts.map +1 -1
  644. package/dist/utils/setWrapperNodeProps.js +1 -2
  645. package/dist/utils/setWrapperNodeProps.js.map +1 -1
  646. package/dist/utils/shouldUseTokenTransformer.d.ts.map +1 -1
  647. package/dist/utils/shouldUseTokenTransformer.js +1 -1
  648. package/dist/utils/shouldUseTokenTransformer.js.map +1 -1
  649. package/dist/utils/splitFileContents.d.ts.map +1 -1
  650. package/dist/utils/splitFileContents.js +1 -2
  651. package/dist/utils/splitFileContents.js.map +1 -1
  652. package/dist/utils/trimPatchContext.d.ts.map +1 -1
  653. package/dist/utils/trimPatchContext.js +1 -2
  654. package/dist/utils/trimPatchContext.js.map +1 -1
  655. package/dist/utils/updateDiffHunks.d.ts +24 -0
  656. package/dist/utils/updateDiffHunks.d.ts.map +1 -0
  657. package/dist/utils/updateDiffHunks.js +235 -0
  658. package/dist/utils/updateDiffHunks.js.map +1 -0
  659. package/dist/utils/virtualDiffLayout.d.ts +62 -2
  660. package/dist/utils/virtualDiffLayout.d.ts.map +1 -1
  661. package/dist/utils/virtualDiffLayout.js +137 -3
  662. package/dist/utils/virtualDiffLayout.js.map +1 -1
  663. package/dist/utils/wrapTokenFragments.d.ts +1 -1
  664. package/dist/utils/wrapTokenFragments.d.ts.map +1 -1
  665. package/dist/utils/wrapTokenFragments.js +1 -2
  666. package/dist/utils/wrapTokenFragments.js.map +1 -1
  667. package/dist/worker/WorkerPoolManager.d.ts +7 -2
  668. package/dist/worker/WorkerPoolManager.d.ts.map +1 -1
  669. package/dist/worker/WorkerPoolManager.js +88 -23
  670. package/dist/worker/WorkerPoolManager.js.map +1 -1
  671. package/dist/worker/getOrCreateWorkerPoolSingleton.d.ts.map +1 -1
  672. package/dist/worker/getOrCreateWorkerPoolSingleton.js +1 -2
  673. package/dist/worker/getOrCreateWorkerPoolSingleton.js.map +1 -1
  674. package/dist/worker/index.d.ts +2 -2
  675. package/dist/worker/index.js +1 -2
  676. package/dist/worker/types.d.ts +11 -1
  677. package/dist/worker/types.d.ts.map +1 -1
  678. package/dist/worker/wasm-B9ZqxnKj.js +8 -0
  679. package/dist/worker/wasm-B9ZqxnKj.js.map +1 -0
  680. package/dist/worker/worker-portable.js +3335 -6214
  681. package/dist/worker/worker-portable.js.map +1 -1
  682. package/dist/worker/worker.js +287 -309
  683. package/dist/worker/worker.js.map +1 -1
  684. package/package.json +29 -32
  685. package/dist/editor/css.d.ts +0 -6
  686. package/dist/editor/css.d.ts.map +0 -1
  687. package/dist/editor/css.js +0 -218
  688. package/dist/editor/css.js.map +0 -1
  689. package/dist/editor/quickEdit.d.ts +0 -29
  690. package/dist/editor/quickEdit.d.ts.map +0 -1
  691. package/dist/editor/quickEdit.js +0 -81
  692. package/dist/editor/quickEdit.js.map +0 -1
  693. package/dist/editor/tokenzier.d.ts.map +0 -1
  694. package/dist/editor/tokenzier.js +0 -348
  695. package/dist/editor/tokenzier.js.map +0 -1
  696. package/dist/react/EditorContext.d.ts +0 -16
  697. package/dist/react/EditorContext.d.ts.map +0 -1
  698. package/dist/react/EditorContext.js +0 -26
  699. package/dist/react/EditorContext.js.map +0 -1
  700. package/dist/worker/wasm-D4DU5jgR.js +0 -10
  701. package/dist/worker/wasm-D4DU5jgR.js.map +0 -1
@@ -1,8 +1,7 @@
1
1
  import { getVirtualFileHeaderRegion, getVirtualFilePaddingBottom } from "./computeVirtualFileMetrics.js";
2
- import { getExpandedRegion, getLeadingHunkSeparatorLayout, getTrailingHunkSeparatorLayout } from "./virtualDiffLayout.js";
3
-
2
+ import { getExpandedRegion, getLeadingHunkSeparatorLayout, getTrailingExpandedRegion, getTrailingHunkSeparatorLayout } from "./virtualDiffLayout.js";
4
3
  //#region src/utils/computeEstimatedDiffHeights.ts
5
- function computeEstimatedDiffHeights({ fileDiff, metrics, disableFileHeader, hunkSeparators, expandUnchanged, expandedHunks: configuredExpandedHunks, collapsedContextThreshold }) {
4
+ function computeEstimatedDiffHeights({ fileDiff, metrics, disableFileHeader, hunkSeparators, expandUnchanged, expandedHunks: configuredExpandedHunks, collapsedContextThreshold, canHydratePartialDiff }) {
6
5
  let splitHeight = getVirtualFileHeaderRegion(metrics, disableFileHeader);
7
6
  let unifiedHeight = splitHeight;
8
7
  const expandedHunks = expandUnchanged ? true : configuredExpandedHunks;
@@ -35,14 +34,14 @@ function computeEstimatedDiffHeights({ fileDiff, metrics, disableFileHeader, hun
35
34
  const metadataLineCounts = getNoNewlineMetadataLineCounts(hunk);
36
35
  splitHeight += metadataLineCounts.split * metrics.lineHeight;
37
36
  unifiedHeight += metadataLineCounts.unified * metrics.lineHeight;
38
- if (hunkIndex === finalHunkIndex && hasFinalCollapsedHunk(fileDiff)) {
39
- const trailingRegion = getExpandedRegion({
40
- isPartial: fileDiff.isPartial,
41
- rangeSize: getTrailingRangeSize(fileDiff, hunk),
42
- expandedHunks,
43
- hunkIndex: fileDiff.hunks.length,
44
- collapsedContextThreshold
45
- });
37
+ const trailingRegion = hunkIndex === finalHunkIndex ? getTrailingExpandedRegion({
38
+ fileDiff,
39
+ hunkIndex,
40
+ expandedHunks,
41
+ collapsedContextThreshold,
42
+ errorPrefix: "computeEstimatedDiffHeights"
43
+ }) : void 0;
44
+ if (trailingRegion != null) {
46
45
  const trailingExpandedHeight = (trailingRegion.fromStart + trailingRegion.fromEnd) * metrics.lineHeight;
47
46
  splitHeight += trailingExpandedHeight;
48
47
  unifiedHeight += trailingExpandedHeight;
@@ -54,6 +53,13 @@ function computeEstimatedDiffHeights({ fileDiff, metrics, disableFileHeader, hun
54
53
  splitHeight += separatorHeight;
55
54
  unifiedHeight += separatorHeight;
56
55
  }
56
+ } else if (hunkIndex === finalHunkIndex && fileDiff.isPartial && canHydratePartialDiff) {
57
+ const separatorHeight = getTrailingHunkSeparatorLayout({
58
+ type: hunkSeparators,
59
+ metrics
60
+ })?.totalHeight ?? 0;
61
+ splitHeight += separatorHeight;
62
+ unifiedHeight += separatorHeight;
57
63
  }
58
64
  }
59
65
  if (fileDiff.hunks.length > 0) {
@@ -94,18 +100,7 @@ function getChangeNoNewlineMetadataLineCounts(hunk, content) {
94
100
  unified
95
101
  };
96
102
  }
97
- function hasFinalCollapsedHunk(fileDiff) {
98
- const lastHunk = fileDiff.hunks.at(-1);
99
- if (lastHunk == null || fileDiff.isPartial || fileDiff.additionLines.length === 0 || fileDiff.deletionLines.length === 0) return false;
100
- return lastHunk.additionLineIndex + lastHunk.additionCount < fileDiff.additionLines.length || lastHunk.deletionLineIndex + lastHunk.deletionCount < fileDiff.deletionLines.length;
101
- }
102
- function getTrailingRangeSize(fileDiff, hunk) {
103
- const additionRemaining = fileDiff.additionLines.length - (hunk.additionLineIndex + hunk.additionCount);
104
- const deletionRemaining = fileDiff.deletionLines.length - (hunk.deletionLineIndex + hunk.deletionCount);
105
- if (additionRemaining !== deletionRemaining) throw new Error(`computeEstimatedDiffHeights: trailing context mismatch (additions=${additionRemaining}, deletions=${deletionRemaining}) for ${fileDiff.name}`);
106
- return Math.min(additionRemaining, deletionRemaining);
107
- }
108
-
109
103
  //#endregion
110
104
  export { computeEstimatedDiffHeights };
105
+
111
106
  //# sourceMappingURL=computeEstimatedDiffHeights.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"computeEstimatedDiffHeights.js","names":[],"sources":["../../src/utils/computeEstimatedDiffHeights.ts"],"sourcesContent":["import type {\n ChangeContent,\n FileDiffMetadata,\n Hunk,\n HunkExpansionRegion,\n HunkSeparators,\n VirtualFileMetrics,\n} from '../types';\nimport {\n getVirtualFileHeaderRegion,\n getVirtualFilePaddingBottom,\n} from './computeVirtualFileMetrics';\nimport {\n getExpandedRegion,\n getLeadingHunkSeparatorLayout,\n getTrailingHunkSeparatorLayout,\n} from './virtualDiffLayout';\n\nexport interface ComputeEstimatedDiffHeightsOptions {\n fileDiff: FileDiffMetadata;\n metrics: VirtualFileMetrics;\n disableFileHeader: boolean;\n hunkSeparators: HunkSeparators;\n expandUnchanged: boolean;\n expandedHunks: Map<number, HunkExpansionRegion> | true | undefined;\n collapsedContextThreshold: number;\n}\n\nexport interface EstimatedDiffHeights {\n splitHeight: number;\n unifiedHeight: number;\n}\n\n// Computes both split and unified baseline heights from hunk-level metadata so\n// callers can avoid replaying the detailed rendered-line iterator.\nexport function computeEstimatedDiffHeights({\n fileDiff,\n metrics,\n disableFileHeader,\n hunkSeparators,\n expandUnchanged,\n expandedHunks: configuredExpandedHunks,\n collapsedContextThreshold,\n}: ComputeEstimatedDiffHeightsOptions): EstimatedDiffHeights {\n let splitHeight = getVirtualFileHeaderRegion(metrics, disableFileHeader);\n let unifiedHeight = splitHeight;\n const expandedHunks = expandUnchanged ? true : configuredExpandedHunks;\n const finalHunkIndex = fileDiff.hunks.length - 1;\n\n for (let hunkIndex = 0; hunkIndex < fileDiff.hunks.length; hunkIndex++) {\n const hunk = fileDiff.hunks[hunkIndex];\n if (hunk == null) {\n throw new Error('computeEstimatedDiffHeights: invalid hunk index');\n }\n\n const leadingRegion = getExpandedRegion({\n isPartial: fileDiff.isPartial,\n rangeSize: hunk.collapsedBefore,\n expandedHunks,\n hunkIndex,\n collapsedContextThreshold,\n });\n const leadingExpandedHeight =\n (leadingRegion.fromStart + leadingRegion.fromEnd) * metrics.lineHeight;\n splitHeight += leadingExpandedHeight;\n unifiedHeight += leadingExpandedHeight;\n\n if (leadingRegion.collapsedLines > 0) {\n const separatorHeight =\n getLeadingHunkSeparatorLayout({\n type: hunkSeparators,\n metrics,\n hunkIndex,\n hunkSpecs: hunk.hunkSpecs,\n })?.totalHeight ?? 0;\n splitHeight += separatorHeight;\n unifiedHeight += separatorHeight;\n }\n\n splitHeight += hunk.splitLineCount * metrics.lineHeight;\n unifiedHeight += hunk.unifiedLineCount * metrics.lineHeight;\n\n const metadataLineCounts = getNoNewlineMetadataLineCounts(hunk);\n splitHeight += metadataLineCounts.split * metrics.lineHeight;\n unifiedHeight += metadataLineCounts.unified * metrics.lineHeight;\n\n if (hunkIndex === finalHunkIndex && hasFinalCollapsedHunk(fileDiff)) {\n const trailingRegion = getExpandedRegion({\n isPartial: fileDiff.isPartial,\n rangeSize: getTrailingRangeSize(fileDiff, hunk),\n expandedHunks,\n hunkIndex: fileDiff.hunks.length,\n collapsedContextThreshold,\n });\n const trailingExpandedHeight =\n (trailingRegion.fromStart + trailingRegion.fromEnd) *\n metrics.lineHeight;\n splitHeight += trailingExpandedHeight;\n unifiedHeight += trailingExpandedHeight;\n\n if (trailingRegion.collapsedLines > 0) {\n const separatorHeight =\n getTrailingHunkSeparatorLayout({\n type: hunkSeparators,\n metrics,\n })?.totalHeight ?? 0;\n splitHeight += separatorHeight;\n unifiedHeight += separatorHeight;\n }\n }\n }\n\n if (fileDiff.hunks.length > 0) {\n const paddingBottom = getVirtualFilePaddingBottom(metrics);\n splitHeight += paddingBottom;\n unifiedHeight += paddingBottom;\n }\n\n return { splitHeight, unifiedHeight };\n}\n\nfunction getNoNewlineMetadataLineCounts(hunk: Hunk): {\n split: number;\n unified: number;\n} {\n if (!hunk.noEOFCRAdditions && !hunk.noEOFCRDeletions) {\n return { split: 0, unified: 0 };\n }\n\n const lastContent = hunk.hunkContent.at(-1);\n if (lastContent == null) {\n return { split: 0, unified: 0 };\n }\n\n if (lastContent.type === 'context') {\n const metadataRows = lastContent.lines > 0 ? 1 : 0;\n return { split: metadataRows, unified: metadataRows };\n }\n\n return getChangeNoNewlineMetadataLineCounts(hunk, lastContent);\n}\n\nfunction getChangeNoNewlineMetadataLineCounts(\n hunk: Hunk,\n content: ChangeContent\n): { split: number; unified: number } {\n const unified =\n (content.deletions > 0 && hunk.noEOFCRDeletions ? 1 : 0) +\n (content.additions > 0 && hunk.noEOFCRAdditions ? 1 : 0);\n const splitDeletionHasMetadata =\n content.deletions > 0 && hunk.noEOFCRDeletions;\n const splitAdditionHasMetadata =\n content.additions > 0 && hunk.noEOFCRAdditions;\n const split = splitDeletionHasMetadata || splitAdditionHasMetadata ? 1 : 0;\n\n return { split, unified };\n}\n\nfunction hasFinalCollapsedHunk(fileDiff: FileDiffMetadata): boolean {\n const lastHunk = fileDiff.hunks.at(-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 return (\n lastHunk.additionLineIndex + lastHunk.additionCount <\n fileDiff.additionLines.length ||\n lastHunk.deletionLineIndex + lastHunk.deletionCount <\n fileDiff.deletionLines.length\n );\n}\n\nfunction getTrailingRangeSize(fileDiff: FileDiffMetadata, hunk: Hunk): number {\n const additionRemaining =\n fileDiff.additionLines.length -\n (hunk.additionLineIndex + hunk.additionCount);\n const deletionRemaining =\n fileDiff.deletionLines.length -\n (hunk.deletionLineIndex + hunk.deletionCount);\n\n if (additionRemaining !== deletionRemaining) {\n throw new Error(\n `computeEstimatedDiffHeights: trailing context mismatch (additions=${additionRemaining}, deletions=${deletionRemaining}) for ${fileDiff.name}`\n );\n }\n return Math.min(additionRemaining, deletionRemaining);\n}\n"],"mappings":";;;;AAmCA,SAAgB,4BAA4B,EAC1C,UACA,SACA,mBACA,gBACA,iBACA,eAAe,yBACf,6BAC2D;CAC3D,IAAI,cAAc,2BAA2B,SAAS,kBAAkB;CACxE,IAAI,gBAAgB;CACpB,MAAM,gBAAgB,kBAAkB,OAAO;CAC/C,MAAM,iBAAiB,SAAS,MAAM,SAAS;AAE/C,MAAK,IAAI,YAAY,GAAG,YAAY,SAAS,MAAM,QAAQ,aAAa;EACtE,MAAM,OAAO,SAAS,MAAM;AAC5B,MAAI,QAAQ,KACV,OAAM,IAAI,MAAM,kDAAkD;EAGpE,MAAM,gBAAgB,kBAAkB;GACtC,WAAW,SAAS;GACpB,WAAW,KAAK;GAChB;GACA;GACA;GACD,CAAC;EACF,MAAM,yBACH,cAAc,YAAY,cAAc,WAAW,QAAQ;AAC9D,iBAAe;AACf,mBAAiB;AAEjB,MAAI,cAAc,iBAAiB,GAAG;GACpC,MAAM,kBACJ,8BAA8B;IAC5B,MAAM;IACN;IACA;IACA,WAAW,KAAK;IACjB,CAAC,EAAE,eAAe;AACrB,kBAAe;AACf,oBAAiB;;AAGnB,iBAAe,KAAK,iBAAiB,QAAQ;AAC7C,mBAAiB,KAAK,mBAAmB,QAAQ;EAEjD,MAAM,qBAAqB,+BAA+B,KAAK;AAC/D,iBAAe,mBAAmB,QAAQ,QAAQ;AAClD,mBAAiB,mBAAmB,UAAU,QAAQ;AAEtD,MAAI,cAAc,kBAAkB,sBAAsB,SAAS,EAAE;GACnE,MAAM,iBAAiB,kBAAkB;IACvC,WAAW,SAAS;IACpB,WAAW,qBAAqB,UAAU,KAAK;IAC/C;IACA,WAAW,SAAS,MAAM;IAC1B;IACD,CAAC;GACF,MAAM,0BACH,eAAe,YAAY,eAAe,WAC3C,QAAQ;AACV,kBAAe;AACf,oBAAiB;AAEjB,OAAI,eAAe,iBAAiB,GAAG;IACrC,MAAM,kBACJ,+BAA+B;KAC7B,MAAM;KACN;KACD,CAAC,EAAE,eAAe;AACrB,mBAAe;AACf,qBAAiB;;;;AAKvB,KAAI,SAAS,MAAM,SAAS,GAAG;EAC7B,MAAM,gBAAgB,4BAA4B,QAAQ;AAC1D,iBAAe;AACf,mBAAiB;;AAGnB,QAAO;EAAE;EAAa;EAAe;;AAGvC,SAAS,+BAA+B,MAGtC;AACA,KAAI,CAAC,KAAK,oBAAoB,CAAC,KAAK,iBAClC,QAAO;EAAE,OAAO;EAAG,SAAS;EAAG;CAGjC,MAAM,cAAc,KAAK,YAAY,GAAG,GAAG;AAC3C,KAAI,eAAe,KACjB,QAAO;EAAE,OAAO;EAAG,SAAS;EAAG;AAGjC,KAAI,YAAY,SAAS,WAAW;EAClC,MAAM,eAAe,YAAY,QAAQ,IAAI,IAAI;AACjD,SAAO;GAAE,OAAO;GAAc,SAAS;GAAc;;AAGvD,QAAO,qCAAqC,MAAM,YAAY;;AAGhE,SAAS,qCACP,MACA,SACoC;CACpC,MAAM,WACH,QAAQ,YAAY,KAAK,KAAK,mBAAmB,IAAI,MACrD,QAAQ,YAAY,KAAK,KAAK,mBAAmB,IAAI;CACxD,MAAM,2BACJ,QAAQ,YAAY,KAAK,KAAK;CAChC,MAAM,2BACJ,QAAQ,YAAY,KAAK,KAAK;AAGhC,QAAO;EAAE,OAFK,4BAA4B,2BAA2B,IAAI;EAEzD;EAAS;;AAG3B,SAAS,sBAAsB,UAAqC;CAClE,MAAM,WAAW,SAAS,MAAM,GAAG,GAAG;AACtC,KACE,YAAY,QACZ,SAAS,aACT,SAAS,cAAc,WAAW,KAClC,SAAS,cAAc,WAAW,EAElC,QAAO;AAGT,QACE,SAAS,oBAAoB,SAAS,gBACpC,SAAS,cAAc,UACzB,SAAS,oBAAoB,SAAS,gBACpC,SAAS,cAAc;;AAI7B,SAAS,qBAAqB,UAA4B,MAAoB;CAC5E,MAAM,oBACJ,SAAS,cAAc,UACtB,KAAK,oBAAoB,KAAK;CACjC,MAAM,oBACJ,SAAS,cAAc,UACtB,KAAK,oBAAoB,KAAK;AAEjC,KAAI,sBAAsB,kBACxB,OAAM,IAAI,MACR,qEAAqE,kBAAkB,cAAc,kBAAkB,QAAQ,SAAS,OACzI;AAEH,QAAO,KAAK,IAAI,mBAAmB,kBAAkB"}
1
+ {"version":3,"file":"computeEstimatedDiffHeights.js","names":[],"sources":["../../src/utils/computeEstimatedDiffHeights.ts"],"sourcesContent":["import type {\n ChangeContent,\n FileDiffMetadata,\n Hunk,\n HunkExpansionRegion,\n HunkSeparators,\n VirtualFileMetrics,\n} from '../types';\nimport {\n getVirtualFileHeaderRegion,\n getVirtualFilePaddingBottom,\n} from './computeVirtualFileMetrics';\nimport {\n getExpandedRegion,\n getLeadingHunkSeparatorLayout,\n getTrailingExpandedRegion,\n getTrailingHunkSeparatorLayout,\n} from './virtualDiffLayout';\n\nexport interface ComputeEstimatedDiffHeightsOptions {\n fileDiff: FileDiffMetadata;\n metrics: VirtualFileMetrics;\n disableFileHeader: boolean;\n hunkSeparators: HunkSeparators;\n expandUnchanged: boolean;\n expandedHunks: Map<number, HunkExpansionRegion> | true | undefined;\n collapsedContextThreshold: number;\n canHydratePartialDiff: boolean;\n}\n\nexport interface EstimatedDiffHeights {\n splitHeight: number;\n unifiedHeight: number;\n}\n\n// Computes both split and unified baseline heights from hunk-level metadata so\n// callers can avoid replaying the detailed rendered-line iterator.\nexport function computeEstimatedDiffHeights({\n fileDiff,\n metrics,\n disableFileHeader,\n hunkSeparators,\n expandUnchanged,\n expandedHunks: configuredExpandedHunks,\n collapsedContextThreshold,\n canHydratePartialDiff,\n}: ComputeEstimatedDiffHeightsOptions): EstimatedDiffHeights {\n let splitHeight = getVirtualFileHeaderRegion(metrics, disableFileHeader);\n let unifiedHeight = splitHeight;\n const expandedHunks = expandUnchanged ? true : configuredExpandedHunks;\n const finalHunkIndex = fileDiff.hunks.length - 1;\n\n for (let hunkIndex = 0; hunkIndex < fileDiff.hunks.length; hunkIndex++) {\n const hunk = fileDiff.hunks[hunkIndex];\n if (hunk == null) {\n throw new Error('computeEstimatedDiffHeights: invalid hunk index');\n }\n\n const leadingRegion = getExpandedRegion({\n isPartial: fileDiff.isPartial,\n rangeSize: hunk.collapsedBefore,\n expandedHunks,\n hunkIndex,\n collapsedContextThreshold,\n });\n const leadingExpandedHeight =\n (leadingRegion.fromStart + leadingRegion.fromEnd) * metrics.lineHeight;\n splitHeight += leadingExpandedHeight;\n unifiedHeight += leadingExpandedHeight;\n\n if (leadingRegion.collapsedLines > 0) {\n const separatorHeight =\n getLeadingHunkSeparatorLayout({\n type: hunkSeparators,\n metrics,\n hunkIndex,\n hunkSpecs: hunk.hunkSpecs,\n })?.totalHeight ?? 0;\n splitHeight += separatorHeight;\n unifiedHeight += separatorHeight;\n }\n\n splitHeight += hunk.splitLineCount * metrics.lineHeight;\n unifiedHeight += hunk.unifiedLineCount * metrics.lineHeight;\n\n const metadataLineCounts = getNoNewlineMetadataLineCounts(hunk);\n splitHeight += metadataLineCounts.split * metrics.lineHeight;\n unifiedHeight += metadataLineCounts.unified * metrics.lineHeight;\n\n const trailingRegion =\n hunkIndex === finalHunkIndex\n ? getTrailingExpandedRegion({\n fileDiff,\n hunkIndex,\n expandedHunks,\n collapsedContextThreshold,\n errorPrefix: 'computeEstimatedDiffHeights',\n })\n : undefined;\n if (trailingRegion != null) {\n const trailingExpandedHeight =\n (trailingRegion.fromStart + trailingRegion.fromEnd) *\n metrics.lineHeight;\n splitHeight += trailingExpandedHeight;\n unifiedHeight += trailingExpandedHeight;\n\n if (trailingRegion.collapsedLines > 0) {\n const separatorHeight =\n getTrailingHunkSeparatorLayout({\n type: hunkSeparators,\n metrics,\n })?.totalHeight ?? 0;\n splitHeight += separatorHeight;\n unifiedHeight += separatorHeight;\n }\n } else if (\n hunkIndex === finalHunkIndex &&\n fileDiff.isPartial &&\n canHydratePartialDiff\n ) {\n const separatorHeight =\n getTrailingHunkSeparatorLayout({\n type: hunkSeparators,\n metrics,\n })?.totalHeight ?? 0;\n splitHeight += separatorHeight;\n unifiedHeight += separatorHeight;\n }\n }\n\n if (fileDiff.hunks.length > 0) {\n const paddingBottom = getVirtualFilePaddingBottom(metrics);\n splitHeight += paddingBottom;\n unifiedHeight += paddingBottom;\n }\n\n return { splitHeight, unifiedHeight };\n}\n\nfunction getNoNewlineMetadataLineCounts(hunk: Hunk): {\n split: number;\n unified: number;\n} {\n if (!hunk.noEOFCRAdditions && !hunk.noEOFCRDeletions) {\n return { split: 0, unified: 0 };\n }\n\n const lastContent = hunk.hunkContent.at(-1);\n if (lastContent == null) {\n return { split: 0, unified: 0 };\n }\n\n if (lastContent.type === 'context') {\n const metadataRows = lastContent.lines > 0 ? 1 : 0;\n return { split: metadataRows, unified: metadataRows };\n }\n\n return getChangeNoNewlineMetadataLineCounts(hunk, lastContent);\n}\nfunction getChangeNoNewlineMetadataLineCounts(\n hunk: Hunk,\n content: ChangeContent\n): { split: number; unified: number } {\n const unified =\n (content.deletions > 0 && hunk.noEOFCRDeletions ? 1 : 0) +\n (content.additions > 0 && hunk.noEOFCRAdditions ? 1 : 0);\n const splitDeletionHasMetadata =\n content.deletions > 0 && hunk.noEOFCRDeletions;\n const splitAdditionHasMetadata =\n content.additions > 0 && hunk.noEOFCRAdditions;\n const split = splitDeletionHasMetadata || splitAdditionHasMetadata ? 1 : 0;\n\n return { split, unified };\n}\n"],"mappings":";;;AAqCA,SAAgB,4BAA4B,EAC1C,UACA,SACA,mBACA,gBACA,iBACA,eAAe,yBACf,2BACA,yBAC2D;CAC3D,IAAI,cAAc,2BAA2B,SAAS,iBAAiB;CACvE,IAAI,gBAAgB;CACpB,MAAM,gBAAgB,kBAAkB,OAAO;CAC/C,MAAM,iBAAiB,SAAS,MAAM,SAAS;CAE/C,KAAK,IAAI,YAAY,GAAG,YAAY,SAAS,MAAM,QAAQ,aAAa;EACtE,MAAM,OAAO,SAAS,MAAM;EAC5B,IAAI,QAAQ,MACV,MAAM,IAAI,MAAM,iDAAiD;EAGnE,MAAM,gBAAgB,kBAAkB;GACtC,WAAW,SAAS;GACpB,WAAW,KAAK;GAChB;GACA;GACA;EACF,CAAC;EACD,MAAM,yBACH,cAAc,YAAY,cAAc,WAAW,QAAQ;EAC9D,eAAe;EACf,iBAAiB;EAEjB,IAAI,cAAc,iBAAiB,GAAG;GACpC,MAAM,kBACJ,8BAA8B;IAC5B,MAAM;IACN;IACA;IACA,WAAW,KAAK;GAClB,CAAC,CAAC,EAAE,eAAe;GACrB,eAAe;GACf,iBAAiB;EACnB;EAEA,eAAe,KAAK,iBAAiB,QAAQ;EAC7C,iBAAiB,KAAK,mBAAmB,QAAQ;EAEjD,MAAM,qBAAqB,+BAA+B,IAAI;EAC9D,eAAe,mBAAmB,QAAQ,QAAQ;EAClD,iBAAiB,mBAAmB,UAAU,QAAQ;EAEtD,MAAM,iBACJ,cAAc,iBACV,0BAA0B;GACxB;GACA;GACA;GACA;GACA,aAAa;EACf,CAAC,IACD,KAAA;EACN,IAAI,kBAAkB,MAAM;GAC1B,MAAM,0BACH,eAAe,YAAY,eAAe,WAC3C,QAAQ;GACV,eAAe;GACf,iBAAiB;GAEjB,IAAI,eAAe,iBAAiB,GAAG;IACrC,MAAM,kBACJ,+BAA+B;KAC7B,MAAM;KACN;IACF,CAAC,CAAC,EAAE,eAAe;IACrB,eAAe;IACf,iBAAiB;GACnB;EACF,OAAO,IACL,cAAc,kBACd,SAAS,aACT,uBACA;GACA,MAAM,kBACJ,+BAA+B;IAC7B,MAAM;IACN;GACF,CAAC,CAAC,EAAE,eAAe;GACrB,eAAe;GACf,iBAAiB;EACnB;CACF;CAEA,IAAI,SAAS,MAAM,SAAS,GAAG;EAC7B,MAAM,gBAAgB,4BAA4B,OAAO;EACzD,eAAe;EACf,iBAAiB;CACnB;CAEA,OAAO;EAAE;EAAa;CAAc;AACtC;AAEA,SAAS,+BAA+B,MAGtC;CACA,IAAI,CAAC,KAAK,oBAAoB,CAAC,KAAK,kBAClC,OAAO;EAAE,OAAO;EAAG,SAAS;CAAE;CAGhC,MAAM,cAAc,KAAK,YAAY,GAAG,EAAE;CAC1C,IAAI,eAAe,MACjB,OAAO;EAAE,OAAO;EAAG,SAAS;CAAE;CAGhC,IAAI,YAAY,SAAS,WAAW;EAClC,MAAM,eAAe,YAAY,QAAQ,IAAI,IAAI;EACjD,OAAO;GAAE,OAAO;GAAc,SAAS;EAAa;CACtD;CAEA,OAAO,qCAAqC,MAAM,WAAW;AAC/D;AACA,SAAS,qCACP,MACA,SACoC;CACpC,MAAM,WACH,QAAQ,YAAY,KAAK,KAAK,mBAAmB,IAAI,MACrD,QAAQ,YAAY,KAAK,KAAK,mBAAmB,IAAI;CACxD,MAAM,2BACJ,QAAQ,YAAY,KAAK,KAAK;CAChC,MAAM,2BACJ,QAAQ,YAAY,KAAK,KAAK;CAGhC,OAAO;EAAE,OAFK,4BAA4B,2BAA2B,IAAI;EAEzD;CAAQ;AAC1B"}
@@ -3,11 +3,19 @@
3
3
  * Computes line start offsets for a string.
4
4
  */
5
5
  declare function computeLineOffsets(contents: string): number[];
6
+ /**
7
+ * Counts line breaks in a string, treating `\n`, `\r`, and `\r\n` the same way
8
+ * {@link computeLineOffsets} does (a `\r\n` pair is one break). Mirrors that
9
+ * scan but counts in a single pass instead of building and discarding an
10
+ * offsets array, so sizing the changed-line range for large edits stays cheap.
11
+ * A unit test asserts it stays in lockstep with `computeLineOffsets`.
12
+ */
13
+ declare function countLineBreaks(contents: string): number;
6
14
  /**
7
15
  * Splits file contents into lines aligned with {@link computeLineOffsets}.
8
16
  * Unlike splitFileContents, a trailing newline produces a final empty line.
9
17
  */
10
18
  declare function linesFromFileContents(contents: string): string[];
11
19
  //#endregion
12
- export { computeLineOffsets, linesFromFileContents };
20
+ export { computeLineOffsets, countLineBreaks, linesFromFileContents };
13
21
  //# sourceMappingURL=computeFileOffsets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"computeFileOffsets.d.ts","names":["computeLineOffsets","linesFromFileContents"],"sources":["../../src/utils/computeFileOffsets.d.ts"],"sourcesContent":["/**\n * Computes line start offsets for a string.\n */\nexport declare function computeLineOffsets(contents: string): number[];\n/**\n * Splits file contents into lines aligned with {@link computeLineOffsets}.\n * Unlike splitFileContents, a trailing newline produces a final empty line.\n */\nexport declare function linesFromFileContents(contents: string): string[];\n//# sourceMappingURL=computeFileOffsets.d.ts.map"],"mappings":";;AAGA;AAKA;iBALwBA,kBAAAA;;;;;iBAKAC,qBAAAA"}
1
+ {"version":3,"file":"computeFileOffsets.d.ts","names":[],"sources":["../../src/utils/computeFileOffsets.ts"],"mappings":";;AAMA;;iBAAgB,kBAAA,CAAmB,QAAgB;;AAAA;AAyBnD;;;;AAAgD;iBAAhC,eAAA,CAAgB,QAAgB;;;;AAuBM;iBAAtC,qBAAA,CAAsB,QAAgB"}
@@ -16,6 +16,24 @@ function computeLineOffsets(contents) {
16
16
  return offsets;
17
17
  }
18
18
  /**
19
+ * Counts line breaks in a string, treating `\n`, `\r`, and `\r\n` the same way
20
+ * {@link computeLineOffsets} does (a `\r\n` pair is one break). Mirrors that
21
+ * scan but counts in a single pass instead of building and discarding an
22
+ * offsets array, so sizing the changed-line range for large edits stays cheap.
23
+ * A unit test asserts it stays in lockstep with `computeLineOffsets`.
24
+ */
25
+ function countLineBreaks(contents) {
26
+ let count = 0;
27
+ for (let i = 0; i < contents.length; i++) {
28
+ const char = contents.charCodeAt(i);
29
+ if (char === LINE_FEED || char === CARRIAGE_RETURN) {
30
+ if (char === CARRIAGE_RETURN && i + 1 < contents.length && contents.charCodeAt(i + 1) === LINE_FEED) i++;
31
+ count++;
32
+ }
33
+ }
34
+ return count;
35
+ }
36
+ /**
19
37
  * Splits file contents into lines aligned with {@link computeLineOffsets}.
20
38
  * Unlike splitFileContents, a trailing newline produces a final empty line.
21
39
  */
@@ -27,7 +45,7 @@ function linesFromFileContents(contents) {
27
45
  return contents.slice(start, end);
28
46
  });
29
47
  }
30
-
31
48
  //#endregion
32
- export { computeLineOffsets, linesFromFileContents };
49
+ export { computeLineOffsets, countLineBreaks, linesFromFileContents };
50
+
33
51
  //# sourceMappingURL=computeFileOffsets.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"computeFileOffsets.js","names":["offsets: number[]"],"sources":["../../src/utils/computeFileOffsets.ts"],"sourcesContent":["const LINE_FEED = 10; // \\n\nconst CARRIAGE_RETURN = 13; // \\r\n\n/**\n * Computes line start offsets for a string.\n */\nexport function computeLineOffsets(contents: string): number[] {\n const offsets: number[] = [0];\n for (let i = 0; i < contents.length; i++) {\n const char = contents.charCodeAt(i);\n if (char === LINE_FEED || char === CARRIAGE_RETURN) {\n if (\n char === CARRIAGE_RETURN &&\n i + 1 < contents.length &&\n contents.charCodeAt(i + 1) === LINE_FEED\n ) {\n i++;\n }\n offsets.push(i + 1);\n }\n }\n return offsets;\n}\n\n/**\n * Splits file contents into lines aligned with {@link computeLineOffsets}.\n * Unlike splitFileContents, a trailing newline produces a final empty line.\n */\nexport function linesFromFileContents(contents: string): string[] {\n const offsets = computeLineOffsets(contents);\n const lines = Array.from({ length: offsets.length }, (_, i) => {\n const start = offsets[i];\n const end = offsets[i + 1] ?? contents.length;\n return contents.slice(start, end);\n });\n return lines;\n}\n"],"mappings":";AAAA,MAAM,YAAY;AAClB,MAAM,kBAAkB;;;;AAKxB,SAAgB,mBAAmB,UAA4B;CAC7D,MAAMA,UAAoB,CAAC,EAAE;AAC7B,MAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;EACxC,MAAM,OAAO,SAAS,WAAW,EAAE;AACnC,MAAI,SAAS,aAAa,SAAS,iBAAiB;AAClD,OACE,SAAS,mBACT,IAAI,IAAI,SAAS,UACjB,SAAS,WAAW,IAAI,EAAE,KAAK,UAE/B;AAEF,WAAQ,KAAK,IAAI,EAAE;;;AAGvB,QAAO;;;;;;AAOT,SAAgB,sBAAsB,UAA4B;CAChE,MAAM,UAAU,mBAAmB,SAAS;AAM5C,QALc,MAAM,KAAK,EAAE,QAAQ,QAAQ,QAAQ,GAAG,GAAG,MAAM;EAC7D,MAAM,QAAQ,QAAQ;EACtB,MAAM,MAAM,QAAQ,IAAI,MAAM,SAAS;AACvC,SAAO,SAAS,MAAM,OAAO,IAAI;GACjC"}
1
+ {"version":3,"file":"computeFileOffsets.js","names":[],"sources":["../../src/utils/computeFileOffsets.ts"],"sourcesContent":["const LINE_FEED = 10; // \\n\nconst CARRIAGE_RETURN = 13; // \\r\n\n/**\n * Computes line start offsets for a string.\n */\nexport function computeLineOffsets(contents: string): number[] {\n const offsets: number[] = [0];\n for (let i = 0; i < contents.length; i++) {\n const char = contents.charCodeAt(i);\n if (char === LINE_FEED || char === CARRIAGE_RETURN) {\n if (\n char === CARRIAGE_RETURN &&\n i + 1 < contents.length &&\n contents.charCodeAt(i + 1) === LINE_FEED\n ) {\n i++;\n }\n offsets.push(i + 1);\n }\n }\n return offsets;\n}\n\n/**\n * Counts line breaks in a string, treating `\\n`, `\\r`, and `\\r\\n` the same way\n * {@link computeLineOffsets} does (a `\\r\\n` pair is one break). Mirrors that\n * scan but counts in a single pass instead of building and discarding an\n * offsets array, so sizing the changed-line range for large edits stays cheap.\n * A unit test asserts it stays in lockstep with `computeLineOffsets`.\n */\nexport function countLineBreaks(contents: string): number {\n let count = 0;\n for (let i = 0; i < contents.length; i++) {\n const char = contents.charCodeAt(i);\n if (char === LINE_FEED || char === CARRIAGE_RETURN) {\n // Skip the `\\n` of a `\\r\\n` pair so it counts as one break, not two.\n if (\n char === CARRIAGE_RETURN &&\n i + 1 < contents.length &&\n contents.charCodeAt(i + 1) === LINE_FEED\n ) {\n i++;\n }\n count++;\n }\n }\n return count;\n}\n\n/**\n * Splits file contents into lines aligned with {@link computeLineOffsets}.\n * Unlike splitFileContents, a trailing newline produces a final empty line.\n */\nexport function linesFromFileContents(contents: string): string[] {\n const offsets = computeLineOffsets(contents);\n const lines = Array.from({ length: offsets.length }, (_, i) => {\n const start = offsets[i];\n const end = offsets[i + 1] ?? contents.length;\n return contents.slice(start, end);\n });\n return lines;\n}\n"],"mappings":";AAAA,MAAM,YAAY;AAClB,MAAM,kBAAkB;;;;AAKxB,SAAgB,mBAAmB,UAA4B;CAC7D,MAAM,UAAoB,CAAC,CAAC;CAC5B,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;EACxC,MAAM,OAAO,SAAS,WAAW,CAAC;EAClC,IAAI,SAAS,aAAa,SAAS,iBAAiB;GAClD,IACE,SAAS,mBACT,IAAI,IAAI,SAAS,UACjB,SAAS,WAAW,IAAI,CAAC,MAAM,WAE/B;GAEF,QAAQ,KAAK,IAAI,CAAC;EACpB;CACF;CACA,OAAO;AACT;;;;;;;;AASA,SAAgB,gBAAgB,UAA0B;CACxD,IAAI,QAAQ;CACZ,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;EACxC,MAAM,OAAO,SAAS,WAAW,CAAC;EAClC,IAAI,SAAS,aAAa,SAAS,iBAAiB;GAElD,IACE,SAAS,mBACT,IAAI,IAAI,SAAS,UACjB,SAAS,WAAW,IAAI,CAAC,MAAM,WAE/B;GAEF;EACF;CACF;CACA,OAAO;AACT;;;;;AAMA,SAAgB,sBAAsB,UAA4B;CAChE,MAAM,UAAU,mBAAmB,QAAQ;CAM3C,OALc,MAAM,KAAK,EAAE,QAAQ,QAAQ,OAAO,IAAI,GAAG,MAAM;EAC7D,MAAM,QAAQ,QAAQ;EACtB,MAAM,MAAM,QAAQ,IAAI,MAAM,SAAS;EACvC,OAAO,SAAS,MAAM,OAAO,GAAG;CAClC,CACW;AACb"}
@@ -1 +1 @@
1
- {"version":3,"file":"computeVirtualFileMetrics.d.ts","names":["HunkSeparators","VirtualFileMetrics","computeVirtualFileMetrics","Partial","getVirtualFileHeaderRegion","getVirtualFilePaddingTop","getVirtualFilePaddingBottom","getDefaultHunkSeparatorHeight"],"sources":["../../src/utils/computeVirtualFileMetrics.d.ts"],"sourcesContent":["import type { HunkSeparators, VirtualFileMetrics } from '../types';\nexport declare function computeVirtualFileMetrics(metrics?: Partial<VirtualFileMetrics>): VirtualFileMetrics;\nexport declare function getVirtualFileHeaderRegion(metrics: VirtualFileMetrics, disableFileHeader: boolean): number;\nexport declare function getVirtualFilePaddingTop(metrics: VirtualFileMetrics, disableFileHeader: boolean): number;\nexport declare function getVirtualFilePaddingBottom(metrics: VirtualFileMetrics): number;\nexport declare function getDefaultHunkSeparatorHeight(type: HunkSeparators): number;\n//# sourceMappingURL=computeVirtualFileMetrics.d.ts.map"],"mappings":";;;iBACwBE,yBAAAA,WAAoCC,QAAQF,sBAAsBA;iBAClEG,0BAAAA,UAAoCH;AADpCC,iBAEAG,wBAAAA,CAFyB,OAAA,EAESJ,kBAFT,EAAA,iBAAA,EAAA,OAAA,CAAA,EAAA,MAAA;AAAmBA,iBAG5CK,2BAAAA,CAH4CL,OAAAA,EAGPA,kBAHOA,CAAAA,EAAAA,MAAAA;AAARE,iBAIpCI,6BAAAA,CAJoCJ,IAAAA,EAIAH,cAJAG,CAAAA,EAAAA,MAAAA"}
1
+ {"version":3,"file":"computeVirtualFileMetrics.d.ts","names":[],"sources":["../../src/utils/computeVirtualFileMetrics.ts"],"mappings":";;;iBAGgB,yBAAA,CACd,OAAA,GAAU,OAAA,CAAQ,kBAAA,IACjB,kBAAA;AAAA,iBAOa,0BAAA,CACd,OAAA,EAAS,kBAAkB,EAC3B,iBAAA;AAAA,iBAMc,wBAAA,CACd,OAAA,EAAS,kBAAkB,EAC3B,iBAAA;AAAA,iBAKc,2BAAA,CACd,OAA2B,EAAlB,kBAAkB;AAAA,iBAKb,6BAAA,CAA8B,IAAoB,EAAd,cAAc"}
@@ -1,5 +1,4 @@
1
1
  import { DEFAULT_VIRTUAL_FILE_METRICS } from "../constants.js";
2
-
3
2
  //#region src/utils/computeVirtualFileMetrics.ts
4
3
  function computeVirtualFileMetrics(metrics) {
5
4
  return {
@@ -26,7 +25,7 @@ function getDefaultHunkSeparatorHeight(type) {
26
25
  case "custom": return 32;
27
26
  }
28
27
  }
29
-
30
28
  //#endregion
31
29
  export { computeVirtualFileMetrics, getDefaultHunkSeparatorHeight, getVirtualFileHeaderRegion, getVirtualFilePaddingBottom, getVirtualFilePaddingTop };
30
+
32
31
  //# sourceMappingURL=computeVirtualFileMetrics.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"computeVirtualFileMetrics.js","names":[],"sources":["../../src/utils/computeVirtualFileMetrics.ts"],"sourcesContent":["import { DEFAULT_VIRTUAL_FILE_METRICS } from '../constants';\nimport type { HunkSeparators, VirtualFileMetrics } from '../types';\n\nexport function computeVirtualFileMetrics(\n metrics?: Partial<VirtualFileMetrics>\n): VirtualFileMetrics {\n return {\n ...DEFAULT_VIRTUAL_FILE_METRICS,\n ...metrics,\n };\n}\n\nexport function getVirtualFileHeaderRegion(\n metrics: VirtualFileMetrics,\n disableFileHeader: boolean\n): number {\n const paddingTop = getVirtualFilePaddingTop(metrics, disableFileHeader);\n return disableFileHeader ? paddingTop : metrics.diffHeaderHeight + paddingTop;\n}\n\nexport function getVirtualFilePaddingTop(\n metrics: VirtualFileMetrics,\n disableFileHeader: boolean\n): number {\n return metrics.paddingTop ?? (disableFileHeader ? metrics.spacing : 0);\n}\n\nexport function getVirtualFilePaddingBottom(\n metrics: VirtualFileMetrics\n): number {\n return metrics.paddingBottom ?? metrics.spacing;\n}\n\nexport function getDefaultHunkSeparatorHeight(type: HunkSeparators): number {\n switch (type) {\n case 'simple':\n return 4;\n case 'metadata':\n case 'line-info':\n case 'line-info-basic':\n case 'custom':\n return 32;\n }\n}\n"],"mappings":";;;AAGA,SAAgB,0BACd,SACoB;AACpB,QAAO;EACL,GAAG;EACH,GAAG;EACJ;;AAGH,SAAgB,2BACd,SACA,mBACQ;CACR,MAAM,aAAa,yBAAyB,SAAS,kBAAkB;AACvE,QAAO,oBAAoB,aAAa,QAAQ,mBAAmB;;AAGrE,SAAgB,yBACd,SACA,mBACQ;AACR,QAAO,QAAQ,eAAe,oBAAoB,QAAQ,UAAU;;AAGtE,SAAgB,4BACd,SACQ;AACR,QAAO,QAAQ,iBAAiB,QAAQ;;AAG1C,SAAgB,8BAA8B,MAA8B;AAC1E,SAAQ,MAAR;EACE,KAAK,SACH,QAAO;EACT,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,SACH,QAAO"}
1
+ {"version":3,"file":"computeVirtualFileMetrics.js","names":[],"sources":["../../src/utils/computeVirtualFileMetrics.ts"],"sourcesContent":["import { DEFAULT_VIRTUAL_FILE_METRICS } from '../constants';\nimport type { HunkSeparators, VirtualFileMetrics } from '../types';\n\nexport function computeVirtualFileMetrics(\n metrics?: Partial<VirtualFileMetrics>\n): VirtualFileMetrics {\n return {\n ...DEFAULT_VIRTUAL_FILE_METRICS,\n ...metrics,\n };\n}\n\nexport function getVirtualFileHeaderRegion(\n metrics: VirtualFileMetrics,\n disableFileHeader: boolean\n): number {\n const paddingTop = getVirtualFilePaddingTop(metrics, disableFileHeader);\n return disableFileHeader ? paddingTop : metrics.diffHeaderHeight + paddingTop;\n}\n\nexport function getVirtualFilePaddingTop(\n metrics: VirtualFileMetrics,\n disableFileHeader: boolean\n): number {\n return metrics.paddingTop ?? (disableFileHeader ? metrics.spacing : 0);\n}\n\nexport function getVirtualFilePaddingBottom(\n metrics: VirtualFileMetrics\n): number {\n return metrics.paddingBottom ?? metrics.spacing;\n}\n\nexport function getDefaultHunkSeparatorHeight(type: HunkSeparators): number {\n switch (type) {\n case 'simple':\n return 4;\n case 'metadata':\n case 'line-info':\n case 'line-info-basic':\n case 'custom':\n return 32;\n }\n}\n"],"mappings":";;AAGA,SAAgB,0BACd,SACoB;CACpB,OAAO;EACL,GAAG;EACH,GAAG;CACL;AACF;AAEA,SAAgB,2BACd,SACA,mBACQ;CACR,MAAM,aAAa,yBAAyB,SAAS,iBAAiB;CACtE,OAAO,oBAAoB,aAAa,QAAQ,mBAAmB;AACrE;AAEA,SAAgB,yBACd,SACA,mBACQ;CACR,OAAO,QAAQ,eAAe,oBAAoB,QAAQ,UAAU;AACtE;AAEA,SAAgB,4BACd,SACQ;CACR,OAAO,QAAQ,iBAAiB,QAAQ;AAC1C;AAEA,SAAgB,8BAA8B,MAA8B;CAC1E,QAAQ,MAAR;EACE,KAAK,UACH,OAAO;EACT,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,UACH,OAAO;CACX;AACF"}
@@ -1,5 +1,5 @@
1
+ import { Element } from "../node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.js";
1
2
  import { AnnotationSpan } from "../types.js";
2
- import { Element } from "hast";
3
3
 
4
4
  //#region src/utils/createAnnotationElement.d.ts
5
5
  declare function createAnnotationElement(span: AnnotationSpan): Element;
@@ -1 +1 @@
1
- {"version":3,"file":"createAnnotationElement.d.ts","names":["Element","HASTElement","AnnotationSpan","createAnnotationElement"],"sources":["../../src/utils/createAnnotationElement.d.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\nimport type { AnnotationSpan } from '../types';\nexport declare function createAnnotationElement(span: AnnotationSpan): HASTElement;\n//# sourceMappingURL=createAnnotationElement.d.ts.map"],"mappings":";;;;iBAEwBG,uBAAAA,OAA8BD,iBAAiBD"}
1
+ {"version":3,"file":"createAnnotationElement.d.ts","names":[],"sources":["../../src/utils/createAnnotationElement.ts"],"mappings":";;;;iBAKgB,uBAAA,CAAwB,IAAA,EAAM,cAAA,GAAiB,OAAW"}
@@ -1,5 +1,4 @@
1
1
  import { createHastElement } from "./hast_utils.js";
2
-
3
2
  //#region src/utils/createAnnotationElement.ts
4
3
  function createAnnotationElement(span) {
5
4
  return createHastElement({
@@ -15,7 +14,7 @@ function createAnnotationElement(span) {
15
14
  properties: { "data-line-annotation": `${span.hunkIndex},${span.lineIndex}` }
16
15
  });
17
16
  }
18
-
19
17
  //#endregion
20
18
  export { createAnnotationElement };
19
+
21
20
  //# sourceMappingURL=createAnnotationElement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createAnnotationElement.js","names":[],"sources":["../../src/utils/createAnnotationElement.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport type { AnnotationSpan } from '../types';\nimport { createHastElement } from './hast_utils';\n\nexport function createAnnotationElement(span: AnnotationSpan): HASTElement {\n return createHastElement({\n tagName: 'div',\n children: [\n createHastElement({\n tagName: 'div',\n children: span.annotations?.map((slotId) =>\n createHastElement({ tagName: 'slot', properties: { name: slotId } })\n ),\n properties: { 'data-annotation-content': '' },\n }),\n ],\n properties: {\n 'data-line-annotation': `${span.hunkIndex},${span.lineIndex}`,\n },\n });\n}\n"],"mappings":";;;AAKA,SAAgB,wBAAwB,MAAmC;AACzE,QAAO,kBAAkB;EACvB,SAAS;EACT,UAAU,CACR,kBAAkB;GAChB,SAAS;GACT,UAAU,KAAK,aAAa,KAAK,WAC/B,kBAAkB;IAAE,SAAS;IAAQ,YAAY,EAAE,MAAM,QAAQ;IAAE,CAAC,CACrE;GACD,YAAY,EAAE,2BAA2B,IAAI;GAC9C,CAAC,CACH;EACD,YAAY,EACV,wBAAwB,GAAG,KAAK,UAAU,GAAG,KAAK,aACnD;EACF,CAAC"}
1
+ {"version":3,"file":"createAnnotationElement.js","names":[],"sources":["../../src/utils/createAnnotationElement.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport type { AnnotationSpan } from '../types';\nimport { createHastElement } from './hast_utils';\n\nexport function createAnnotationElement(span: AnnotationSpan): HASTElement {\n return createHastElement({\n tagName: 'div',\n children: [\n createHastElement({\n tagName: 'div',\n children: span.annotations?.map((slotId) =>\n createHastElement({ tagName: 'slot', properties: { name: slotId } })\n ),\n properties: { 'data-annotation-content': '' },\n }),\n ],\n properties: {\n 'data-line-annotation': `${span.hunkIndex},${span.lineIndex}`,\n },\n });\n}\n"],"mappings":";;AAKA,SAAgB,wBAAwB,MAAmC;CACzE,OAAO,kBAAkB;EACvB,SAAS;EACT,UAAU,CACR,kBAAkB;GAChB,SAAS;GACT,UAAU,KAAK,aAAa,KAAK,WAC/B,kBAAkB;IAAE,SAAS;IAAQ,YAAY,EAAE,MAAM,OAAO;GAAE,CAAC,CACrE;GACA,YAAY,EAAE,2BAA2B,GAAG;EAC9C,CAAC,CACH;EACA,YAAY,EACV,wBAAwB,GAAG,KAAK,UAAU,GAAG,KAAK,YACpD;CACF,CAAC;AACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"createAnnotationWrapperNode.d.ts","names":["createAnnotationWrapperNode","HTMLElement"],"sources":["../../src/utils/createAnnotationWrapperNode.d.ts"],"sourcesContent":["export declare function createAnnotationWrapperNode(slot: string): HTMLElement;\n//# sourceMappingURL=createAnnotationWrapperNode.d.ts.map"],"mappings":";iBAAwBA,2BAAAA,gBAA2CC"}
1
+ {"version":3,"file":"createAnnotationWrapperNode.d.ts","names":[],"sources":["../../src/utils/createAnnotationWrapperNode.ts"],"mappings":";iBAAgB,2BAAA,CAA4B,IAAA,WAAe,WAAW"}
@@ -6,7 +6,7 @@ function createAnnotationWrapperNode(slot) {
6
6
  wrapper.style.whiteSpace = "normal";
7
7
  return wrapper;
8
8
  }
9
-
10
9
  //#endregion
11
10
  export { createAnnotationWrapperNode };
11
+
12
12
  //# sourceMappingURL=createAnnotationWrapperNode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createAnnotationWrapperNode.js","names":[],"sources":["../../src/utils/createAnnotationWrapperNode.ts"],"sourcesContent":["export function createAnnotationWrapperNode(slot: string): HTMLElement {\n const wrapper = document.createElement('div');\n wrapper.dataset.annotationSlot = '';\n wrapper.slot = slot;\n wrapper.style.whiteSpace = 'normal';\n return wrapper;\n}\n"],"mappings":";AAAA,SAAgB,4BAA4B,MAA2B;CACrE,MAAM,UAAU,SAAS,cAAc,MAAM;AAC7C,SAAQ,QAAQ,iBAAiB;AACjC,SAAQ,OAAO;AACf,SAAQ,MAAM,aAAa;AAC3B,QAAO"}
1
+ {"version":3,"file":"createAnnotationWrapperNode.js","names":[],"sources":["../../src/utils/createAnnotationWrapperNode.ts"],"sourcesContent":["export function createAnnotationWrapperNode(slot: string): HTMLElement {\n const wrapper = document.createElement('div');\n wrapper.dataset.annotationSlot = '';\n wrapper.slot = slot;\n wrapper.style.whiteSpace = 'normal';\n return wrapper;\n}\n"],"mappings":";AAAA,SAAgB,4BAA4B,MAA2B;CACrE,MAAM,UAAU,SAAS,cAAc,KAAK;CAC5C,QAAQ,QAAQ,iBAAiB;CACjC,QAAQ,OAAO;CACf,QAAQ,MAAM,aAAa;CAC3B,OAAO;AACT"}
@@ -0,0 +1,5 @@
1
+ //#region src/utils/createCodeViewHeaderFooterHostElement.d.ts
2
+ declare function createCodeViewHeaderFooterHostElement(type: 'header' | 'footer', container: HTMLDivElement, resizeObserver?: ResizeObserver): HTMLDivElement;
3
+ //#endregion
4
+ export { createCodeViewHeaderFooterHostElement };
5
+ //# sourceMappingURL=createCodeViewHeaderFooterHostElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createCodeViewHeaderFooterHostElement.d.ts","names":[],"sources":["../../src/utils/createCodeViewHeaderFooterHostElement.ts"],"mappings":";iBAQgB,qCAAA,CACd,IAAA,uBACA,SAAA,EAAW,cAAA,EACX,cAAA,GAAiB,cAAA,GAChB,cAAA"}
@@ -0,0 +1,19 @@
1
+ import { CODE_VIEW_FOOTER_ATTRIBUTE, CODE_VIEW_HEADER_ATTRIBUTE } from "../constants.js";
2
+ //#region src/utils/createCodeViewHeaderFooterHostElement.ts
3
+ function createCodeViewHeaderFooterHostElement(type, container, resizeObserver) {
4
+ const element = document.createElement("div");
5
+ element.style.display = "flow-root";
6
+ if (type === "header") {
7
+ element.setAttribute(CODE_VIEW_HEADER_ATTRIBUTE, "");
8
+ container.before(element);
9
+ } else {
10
+ element.setAttribute(CODE_VIEW_FOOTER_ATTRIBUTE, "");
11
+ container.after(element);
12
+ }
13
+ resizeObserver?.observe(element);
14
+ return element;
15
+ }
16
+ //#endregion
17
+ export { createCodeViewHeaderFooterHostElement };
18
+
19
+ //# sourceMappingURL=createCodeViewHeaderFooterHostElement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createCodeViewHeaderFooterHostElement.js","names":[],"sources":["../../src/utils/createCodeViewHeaderFooterHostElement.ts"],"sourcesContent":["import {\n CODE_VIEW_FOOTER_ATTRIBUTE,\n CODE_VIEW_HEADER_ATTRIBUTE,\n} from '../constants';\n\n// Create, style, position, and observe a header/footer host element. `flow-root`\n// gives it a block formatting context so the caller's content margins stay\n// inside it, keeping measurement / ResizeObserver heights accurate.\nexport function createCodeViewHeaderFooterHostElement(\n type: 'header' | 'footer',\n container: HTMLDivElement,\n resizeObserver?: ResizeObserver\n): HTMLDivElement {\n const element = document.createElement('div');\n element.style.display = 'flow-root';\n if (type === 'header') {\n element.setAttribute(CODE_VIEW_HEADER_ATTRIBUTE, '');\n container.before(element);\n } else {\n element.setAttribute(CODE_VIEW_FOOTER_ATTRIBUTE, '');\n container.after(element);\n }\n resizeObserver?.observe(element);\n return element;\n}\n"],"mappings":";;AAQA,SAAgB,sCACd,MACA,WACA,gBACgB;CAChB,MAAM,UAAU,SAAS,cAAc,KAAK;CAC5C,QAAQ,MAAM,UAAU;CACxB,IAAI,SAAS,UAAU;EACrB,QAAQ,aAAa,4BAA4B,EAAE;EACnD,UAAU,OAAO,OAAO;CAC1B,OAAO;EACL,QAAQ,aAAa,4BAA4B,EAAE;EACnD,UAAU,MAAM,OAAO;CACzB;CACA,gBAAgB,QAAQ,OAAO;CAC/B,OAAO;AACT"}
@@ -1,4 +1,4 @@
1
- import { Element, ElementContent } from "hast";
1
+ import { Element, ElementContent } from "../node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.js";
2
2
 
3
3
  //#region src/utils/createContentColumn.d.ts
4
4
  declare function createContentColumn(children: ElementContent[], rowCount: number): Element;
@@ -1 +1 @@
1
- {"version":3,"file":"createContentColumn.d.ts","names":["ElementContent","Element","HASTElement","createContentColumn"],"sources":["../../src/utils/createContentColumn.d.ts"],"sourcesContent":["import type { ElementContent, Element as HASTElement } from 'hast';\nexport declare function createContentColumn(children: ElementContent[], rowCount: number): HASTElement;\n//# sourceMappingURL=createContentColumn.d.ts.map"],"mappings":";;;iBACwBG,mBAAAA,WAA8BH,qCAAqCE"}
1
+ {"version":3,"file":"createContentColumn.d.ts","names":[],"sources":["../../src/utils/createContentColumn.ts"],"mappings":";;;iBAIgB,mBAAA,CACd,QAAA,EAAU,cAAA,IACV,QAAA,WACC,OAAW"}
@@ -1,5 +1,4 @@
1
1
  import { createHastElement } from "./hast_utils.js";
2
-
3
2
  //#region src/utils/createContentColumn.ts
4
3
  function createContentColumn(children, rowCount) {
5
4
  return createHastElement({
@@ -11,7 +10,7 @@ function createContentColumn(children, rowCount) {
11
10
  }
12
11
  });
13
12
  }
14
-
15
13
  //#endregion
16
14
  export { createContentColumn };
15
+
17
16
  //# sourceMappingURL=createContentColumn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createContentColumn.js","names":[],"sources":["../../src/utils/createContentColumn.ts"],"sourcesContent":["import type { ElementContent, Element as HASTElement } from 'hast';\n\nimport { createHastElement } from './hast_utils';\n\nexport function createContentColumn(\n children: ElementContent[],\n rowCount: number\n): HASTElement {\n return createHastElement({\n tagName: 'div',\n children,\n properties: {\n 'data-content': '',\n style: `grid-row: span ${rowCount}`,\n },\n });\n}\n"],"mappings":";;;AAIA,SAAgB,oBACd,UACA,UACa;AACb,QAAO,kBAAkB;EACvB,SAAS;EACT;EACA,YAAY;GACV,gBAAgB;GAChB,OAAO,kBAAkB;GAC1B;EACF,CAAC"}
1
+ {"version":3,"file":"createContentColumn.js","names":[],"sources":["../../src/utils/createContentColumn.ts"],"sourcesContent":["import type { ElementContent, Element as HASTElement } from 'hast';\n\nimport { createHastElement } from './hast_utils';\n\nexport function createContentColumn(\n children: ElementContent[],\n rowCount: number\n): HASTElement {\n return createHastElement({\n tagName: 'div',\n children,\n properties: {\n 'data-content': '',\n style: `grid-row: span ${rowCount}`,\n },\n });\n}\n"],"mappings":";;AAIA,SAAgB,oBACd,UACA,UACa;CACb,OAAO,kBAAkB;EACvB,SAAS;EACT;EACA,YAAY;GACV,gBAAgB;GAChB,OAAO,kBAAkB;EAC3B;CACF,CAAC;AACH"}
@@ -1,4 +1,4 @@
1
- import { Element } from "hast";
1
+ import { Element } from "../node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.js";
2
2
 
3
3
  //#region src/utils/createEmptyRowBuffer.d.ts
4
4
  declare function createEmptyRowBuffer(size: number): Element;
@@ -1 +1 @@
1
- {"version":3,"file":"createEmptyRowBuffer.d.ts","names":["Element","HASTElement","createEmptyRowBuffer"],"sources":["../../src/utils/createEmptyRowBuffer.d.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\nexport declare function createEmptyRowBuffer(size: number): HASTElement;\n//# sourceMappingURL=createEmptyRowBuffer.d.ts.map"],"mappings":";;;iBACwBE,oBAAAA,gBAAoCD"}
1
+ {"version":3,"file":"createEmptyRowBuffer.d.ts","names":[],"sources":["../../src/utils/createEmptyRowBuffer.ts"],"mappings":";;;iBAIgB,oBAAA,CAAqB,IAAA,WAAe,OAAW"}
@@ -1,5 +1,4 @@
1
1
  import { createHastElement } from "./hast_utils.js";
2
-
3
2
  //#region src/utils/createEmptyRowBuffer.ts
4
3
  function createEmptyRowBuffer(size) {
5
4
  return createHastElement({
@@ -11,7 +10,7 @@ function createEmptyRowBuffer(size) {
11
10
  }
12
11
  });
13
12
  }
14
-
15
13
  //#endregion
16
14
  export { createEmptyRowBuffer };
15
+
17
16
  //# sourceMappingURL=createEmptyRowBuffer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createEmptyRowBuffer.js","names":[],"sources":["../../src/utils/createEmptyRowBuffer.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport { createHastElement } from './hast_utils';\n\nexport function createEmptyRowBuffer(size: number): HASTElement {\n return createHastElement({\n tagName: 'div',\n properties: {\n 'data-content-buffer': '',\n 'data-buffer-size': size,\n style: `grid-row: span ${size};min-height:calc(${size} * 1lh)`,\n },\n });\n}\n"],"mappings":";;;AAIA,SAAgB,qBAAqB,MAA2B;AAC9D,QAAO,kBAAkB;EACvB,SAAS;EACT,YAAY;GACV,uBAAuB;GACvB,oBAAoB;GACpB,OAAO,kBAAkB,KAAK,mBAAmB,KAAK;GACvD;EACF,CAAC"}
1
+ {"version":3,"file":"createEmptyRowBuffer.js","names":[],"sources":["../../src/utils/createEmptyRowBuffer.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport { createHastElement } from './hast_utils';\n\nexport function createEmptyRowBuffer(size: number): HASTElement {\n return createHastElement({\n tagName: 'div',\n properties: {\n 'data-content-buffer': '',\n 'data-buffer-size': size,\n style: `grid-row: span ${size};min-height:calc(${size} * 1lh)`,\n },\n });\n}\n"],"mappings":";;AAIA,SAAgB,qBAAqB,MAA2B;CAC9D,OAAO,kBAAkB;EACvB,SAAS;EACT,YAAY;GACV,uBAAuB;GACvB,oBAAoB;GACpB,OAAO,kBAAkB,KAAK,mBAAmB,KAAK;EACxD;CACF,CAAC;AACH"}
@@ -1,5 +1,5 @@
1
+ import { Element } from "../node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.js";
1
2
  import { FileContents, FileDiffMetadata, FileHeaderRenderMode } from "../types.js";
2
- import { Element } from "hast";
3
3
 
4
4
  //#region src/utils/createFileHeaderElement.d.ts
5
5
  interface CreateFileHeaderElementProps {
@@ -1 +1 @@
1
- {"version":3,"file":"createFileHeaderElement.d.ts","names":["Element","HASTElement","FileContents","FileDiffMetadata","FileHeaderRenderMode","CreateFileHeaderElementProps","createFileHeaderElement","fileOrDiff","mode","stickyHeader"],"sources":["../../src/utils/createFileHeaderElement.d.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\nimport type { FileContents, FileDiffMetadata, FileHeaderRenderMode } from '../types';\nexport interface CreateFileHeaderElementProps {\n fileOrDiff: FileDiffMetadata | FileContents;\n mode: FileHeaderRenderMode;\n stickyHeader: boolean;\n}\nexport declare function createFileHeaderElement({ fileOrDiff, mode, stickyHeader }: CreateFileHeaderElementProps): HASTElement;\n//# sourceMappingURL=createFileHeaderElement.d.ts.map"],"mappings":";;;;UAEiBK,4BAAAA;cACDF,mBAAmBD;EADlBG,IAAAA,EAEPD,oBAFOC;EACDF,YAAAA,EAAAA,OAAAA;;AACNC,iBAGcE,uBAAAA,CAHdF;EAAAA,UAAAA;EAAAA,IAAAA;EAAAA;AAAAA,CAAAA,EAG0EC,4BAH1ED,CAAAA,EAGyGH,OAHzGG"}
1
+ {"version":3,"file":"createFileHeaderElement.d.ts","names":[],"sources":["../../src/utils/createFileHeaderElement.ts"],"mappings":";;;;UAqBiB,4BAAA;EACf,UAAA,EAAY,gBAAA,GAAmB,YAAA;EAC/B,IAAA,EAAM,oBAAA;EACN,YAAA;AAAA;AAAA,iBAGc,uBAAA;EACd,UAAA;EACA,IAAA;EACA;AAAA,GACC,4BAAA,GAA+B,OAAA"}
@@ -1,7 +1,6 @@
1
- import { CUSTOM_HEADER_SLOT_ID, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID } from "../constants.js";
1
+ import { CUSTOM_HEADER_SLOT_ID, HEADER_FILENAME_SUFFIX_SLOT_ID, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID } from "../constants.js";
2
2
  import { createHastElement, createIconElement, createTextNodeElement } from "./hast_utils.js";
3
3
  import { getIconForType } from "./getIconForType.js";
4
-
5
4
  //#region src/utils/createFileHeaderElement.ts
6
5
  function createFileHeaderElement({ fileOrDiff, mode, stickyHeader }) {
7
6
  const fileDiff = "type" in fileOrDiff ? fileOrDiff : void 0;
@@ -53,6 +52,10 @@ function createHeaderElement({ name, prevName, iconType }) {
53
52
  })],
54
53
  properties: { "data-title": "" }
55
54
  }));
55
+ children.push(createHastElement({
56
+ tagName: "slot",
57
+ properties: { name: HEADER_FILENAME_SUFFIX_SLOT_ID }
58
+ }));
56
59
  return createHastElement({
57
60
  tagName: "div",
58
61
  children,
@@ -89,7 +92,7 @@ function createMetadataElement(fileDiff) {
89
92
  properties: { "data-metadata": "" }
90
93
  });
91
94
  }
92
-
93
95
  //#endregion
94
96
  export { createFileHeaderElement };
97
+
95
98
  //# sourceMappingURL=createFileHeaderElement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createFileHeaderElement.js","names":["properties: Properties","children: ElementContent[]"],"sources":["../../src/utils/createFileHeaderElement.ts"],"sourcesContent":["import type { ElementContent, Element as HASTElement, Properties } from 'hast';\n\nimport {\n CUSTOM_HEADER_SLOT_ID,\n HEADER_METADATA_SLOT_ID,\n HEADER_PREFIX_SLOT_ID,\n} from '../constants';\nimport type {\n ChangeTypes,\n FileContents,\n FileDiffMetadata,\n FileHeaderRenderMode,\n} from '../types';\nimport { getIconForType } from './getIconForType';\nimport {\n createHastElement,\n createIconElement,\n createTextNodeElement,\n} from './hast_utils';\n\nexport interface CreateFileHeaderElementProps {\n fileOrDiff: FileDiffMetadata | FileContents;\n mode: FileHeaderRenderMode;\n stickyHeader: boolean;\n}\n\nexport function createFileHeaderElement({\n fileOrDiff,\n mode,\n stickyHeader,\n}: CreateFileHeaderElementProps): HASTElement {\n const fileDiff = 'type' in fileOrDiff ? fileOrDiff : undefined;\n const properties: Properties = {\n 'data-diffs-header': mode,\n 'data-change-type': fileDiff?.type,\n 'data-sticky': stickyHeader ? '' : undefined,\n };\n\n return createHastElement({\n tagName: 'div',\n children: [\n mode === 'custom'\n ? createHastElement({\n tagName: 'slot',\n properties: { name: CUSTOM_HEADER_SLOT_ID },\n })\n : createHeaderElement({\n name: fileOrDiff.name,\n prevName:\n 'prevName' in fileOrDiff ? fileOrDiff.prevName : undefined,\n iconType: fileDiff?.type ?? 'file',\n }),\n ...(mode === 'custom' ? [] : [createMetadataElement(fileDiff)]),\n ],\n properties,\n });\n}\n\ninterface CreateHeaderElementOptions {\n name: string;\n prevName?: string;\n iconType: ChangeTypes | 'file';\n}\n\nfunction createHeaderElement({\n name,\n prevName,\n iconType,\n}: CreateHeaderElementOptions): HASTElement {\n const children: ElementContent[] = [\n createHastElement({\n tagName: 'slot',\n properties: { name: HEADER_PREFIX_SLOT_ID },\n }),\n createIconElement({\n name: getIconForType(iconType),\n properties: { 'data-change-icon': iconType },\n }),\n ];\n if (prevName != null) {\n children.push(\n createHastElement({\n tagName: 'div',\n children: [\n createHastElement({\n tagName: 'bdi',\n children: [createTextNodeElement(prevName)],\n }),\n ],\n properties: {\n 'data-prev-name': '',\n },\n })\n );\n children.push(\n createIconElement({\n name: 'diffs-icon-arrow-right-short',\n properties: {\n 'data-rename-icon': '',\n },\n })\n );\n }\n children.push(\n createHastElement({\n tagName: 'div',\n children: [\n createHastElement({\n tagName: 'bdi',\n children: [createTextNodeElement(name)],\n }),\n ],\n properties: { 'data-title': '' },\n })\n );\n return createHastElement({\n tagName: 'div',\n children,\n properties: { 'data-header-content': '' },\n });\n}\n\nfunction createMetadataElement(\n fileDiff: FileDiffMetadata | undefined\n): HASTElement {\n const children: ElementContent[] = [];\n if (fileDiff != null) {\n let additions = 0;\n let deletions = 0;\n for (const hunk of fileDiff.hunks) {\n additions += hunk.additionLines;\n deletions += hunk.deletionLines;\n }\n if (deletions > 0 || additions === 0) {\n children.push(\n createHastElement({\n tagName: 'span',\n children: [createTextNodeElement(`-${deletions}`)],\n properties: { 'data-deletions-count': '' },\n })\n );\n }\n if (additions > 0 || deletions === 0) {\n children.push(\n createHastElement({\n tagName: 'span',\n children: [createTextNodeElement(`+${additions}`)],\n properties: { 'data-additions-count': '' },\n })\n );\n }\n }\n children.push(\n createHastElement({\n tagName: 'slot',\n properties: { name: HEADER_METADATA_SLOT_ID },\n })\n );\n return createHastElement({\n tagName: 'div',\n children,\n properties: { 'data-metadata': '' },\n });\n}\n"],"mappings":";;;;;AA0BA,SAAgB,wBAAwB,EACtC,YACA,MACA,gBAC4C;CAC5C,MAAM,WAAW,UAAU,aAAa,aAAa;CACrD,MAAMA,aAAyB;EAC7B,qBAAqB;EACrB,oBAAoB,UAAU;EAC9B,eAAe,eAAe,KAAK;EACpC;AAED,QAAO,kBAAkB;EACvB,SAAS;EACT,UAAU,CACR,SAAS,WACL,kBAAkB;GAChB,SAAS;GACT,YAAY,EAAE,MAAM,uBAAuB;GAC5C,CAAC,GACF,oBAAoB;GAClB,MAAM,WAAW;GACjB,UACE,cAAc,aAAa,WAAW,WAAW;GACnD,UAAU,UAAU,QAAQ;GAC7B,CAAC,EACN,GAAI,SAAS,WAAW,EAAE,GAAG,CAAC,sBAAsB,SAAS,CAAC,CAC/D;EACD;EACD,CAAC;;AASJ,SAAS,oBAAoB,EAC3B,MACA,UACA,YAC0C;CAC1C,MAAMC,WAA6B,CACjC,kBAAkB;EAChB,SAAS;EACT,YAAY,EAAE,MAAM,uBAAuB;EAC5C,CAAC,EACF,kBAAkB;EAChB,MAAM,eAAe,SAAS;EAC9B,YAAY,EAAE,oBAAoB,UAAU;EAC7C,CAAC,CACH;AACD,KAAI,YAAY,MAAM;AACpB,WAAS,KACP,kBAAkB;GAChB,SAAS;GACT,UAAU,CACR,kBAAkB;IAChB,SAAS;IACT,UAAU,CAAC,sBAAsB,SAAS,CAAC;IAC5C,CAAC,CACH;GACD,YAAY,EACV,kBAAkB,IACnB;GACF,CAAC,CACH;AACD,WAAS,KACP,kBAAkB;GAChB,MAAM;GACN,YAAY,EACV,oBAAoB,IACrB;GACF,CAAC,CACH;;AAEH,UAAS,KACP,kBAAkB;EAChB,SAAS;EACT,UAAU,CACR,kBAAkB;GAChB,SAAS;GACT,UAAU,CAAC,sBAAsB,KAAK,CAAC;GACxC,CAAC,CACH;EACD,YAAY,EAAE,cAAc,IAAI;EACjC,CAAC,CACH;AACD,QAAO,kBAAkB;EACvB,SAAS;EACT;EACA,YAAY,EAAE,uBAAuB,IAAI;EAC1C,CAAC;;AAGJ,SAAS,sBACP,UACa;CACb,MAAMA,WAA6B,EAAE;AACrC,KAAI,YAAY,MAAM;EACpB,IAAI,YAAY;EAChB,IAAI,YAAY;AAChB,OAAK,MAAM,QAAQ,SAAS,OAAO;AACjC,gBAAa,KAAK;AAClB,gBAAa,KAAK;;AAEpB,MAAI,YAAY,KAAK,cAAc,EACjC,UAAS,KACP,kBAAkB;GAChB,SAAS;GACT,UAAU,CAAC,sBAAsB,IAAI,YAAY,CAAC;GAClD,YAAY,EAAE,wBAAwB,IAAI;GAC3C,CAAC,CACH;AAEH,MAAI,YAAY,KAAK,cAAc,EACjC,UAAS,KACP,kBAAkB;GAChB,SAAS;GACT,UAAU,CAAC,sBAAsB,IAAI,YAAY,CAAC;GAClD,YAAY,EAAE,wBAAwB,IAAI;GAC3C,CAAC,CACH;;AAGL,UAAS,KACP,kBAAkB;EAChB,SAAS;EACT,YAAY,EAAE,MAAM,yBAAyB;EAC9C,CAAC,CACH;AACD,QAAO,kBAAkB;EACvB,SAAS;EACT;EACA,YAAY,EAAE,iBAAiB,IAAI;EACpC,CAAC"}
1
+ {"version":3,"file":"createFileHeaderElement.js","names":[],"sources":["../../src/utils/createFileHeaderElement.ts"],"sourcesContent":["import type { ElementContent, Element as HASTElement, Properties } from 'hast';\n\nimport {\n CUSTOM_HEADER_SLOT_ID,\n HEADER_FILENAME_SUFFIX_SLOT_ID,\n HEADER_METADATA_SLOT_ID,\n HEADER_PREFIX_SLOT_ID,\n} from '../constants';\nimport type {\n ChangeTypes,\n FileContents,\n FileDiffMetadata,\n FileHeaderRenderMode,\n} from '../types';\nimport { getIconForType } from './getIconForType';\nimport {\n createHastElement,\n createIconElement,\n createTextNodeElement,\n} from './hast_utils';\n\nexport interface CreateFileHeaderElementProps {\n fileOrDiff: FileDiffMetadata | FileContents;\n mode: FileHeaderRenderMode;\n stickyHeader: boolean;\n}\n\nexport function createFileHeaderElement({\n fileOrDiff,\n mode,\n stickyHeader,\n}: CreateFileHeaderElementProps): HASTElement {\n const fileDiff = 'type' in fileOrDiff ? fileOrDiff : undefined;\n const properties: Properties = {\n 'data-diffs-header': mode,\n 'data-change-type': fileDiff?.type,\n 'data-sticky': stickyHeader ? '' : undefined,\n };\n\n return createHastElement({\n tagName: 'div',\n children: [\n mode === 'custom'\n ? createHastElement({\n tagName: 'slot',\n properties: { name: CUSTOM_HEADER_SLOT_ID },\n })\n : createHeaderElement({\n name: fileOrDiff.name,\n prevName:\n 'prevName' in fileOrDiff ? fileOrDiff.prevName : undefined,\n iconType: fileDiff?.type ?? 'file',\n }),\n ...(mode === 'custom' ? [] : [createMetadataElement(fileDiff)]),\n ],\n properties,\n });\n}\n\ninterface CreateHeaderElementOptions {\n name: string;\n prevName?: string;\n iconType: ChangeTypes | 'file';\n}\n\nfunction createHeaderElement({\n name,\n prevName,\n iconType,\n}: CreateHeaderElementOptions): HASTElement {\n const children: ElementContent[] = [\n createHastElement({\n tagName: 'slot',\n properties: { name: HEADER_PREFIX_SLOT_ID },\n }),\n createIconElement({\n name: getIconForType(iconType),\n properties: { 'data-change-icon': iconType },\n }),\n ];\n if (prevName != null) {\n children.push(\n createHastElement({\n tagName: 'div',\n children: [\n createHastElement({\n tagName: 'bdi',\n children: [createTextNodeElement(prevName)],\n }),\n ],\n properties: {\n 'data-prev-name': '',\n },\n })\n );\n children.push(\n createIconElement({\n name: 'diffs-icon-arrow-right-short',\n properties: {\n 'data-rename-icon': '',\n },\n })\n );\n }\n children.push(\n createHastElement({\n tagName: 'div',\n children: [\n createHastElement({\n tagName: 'bdi',\n children: [createTextNodeElement(name)],\n }),\n ],\n properties: { 'data-title': '' },\n })\n );\n children.push(\n createHastElement({\n tagName: 'slot',\n properties: { name: HEADER_FILENAME_SUFFIX_SLOT_ID },\n })\n );\n return createHastElement({\n tagName: 'div',\n children,\n properties: { 'data-header-content': '' },\n });\n}\n\nfunction createMetadataElement(\n fileDiff: FileDiffMetadata | undefined\n): HASTElement {\n const children: ElementContent[] = [];\n if (fileDiff != null) {\n let additions = 0;\n let deletions = 0;\n for (const hunk of fileDiff.hunks) {\n additions += hunk.additionLines;\n deletions += hunk.deletionLines;\n }\n if (deletions > 0 || additions === 0) {\n children.push(\n createHastElement({\n tagName: 'span',\n children: [createTextNodeElement(`-${deletions}`)],\n properties: { 'data-deletions-count': '' },\n })\n );\n }\n if (additions > 0 || deletions === 0) {\n children.push(\n createHastElement({\n tagName: 'span',\n children: [createTextNodeElement(`+${additions}`)],\n properties: { 'data-additions-count': '' },\n })\n );\n }\n }\n children.push(\n createHastElement({\n tagName: 'slot',\n properties: { name: HEADER_METADATA_SLOT_ID },\n })\n );\n return createHastElement({\n tagName: 'div',\n children,\n properties: { 'data-metadata': '' },\n });\n}\n"],"mappings":";;;;AA2BA,SAAgB,wBAAwB,EACtC,YACA,MACA,gBAC4C;CAC5C,MAAM,WAAW,UAAU,aAAa,aAAa,KAAA;CACrD,MAAM,aAAyB;EAC7B,qBAAqB;EACrB,oBAAoB,UAAU;EAC9B,eAAe,eAAe,KAAK,KAAA;CACrC;CAEA,OAAO,kBAAkB;EACvB,SAAS;EACT,UAAU,CACR,SAAS,WACL,kBAAkB;GAChB,SAAS;GACT,YAAY,EAAE,MAAM,sBAAsB;EAC5C,CAAC,IACD,oBAAoB;GAClB,MAAM,WAAW;GACjB,UACE,cAAc,aAAa,WAAW,WAAW,KAAA;GACnD,UAAU,UAAU,QAAQ;EAC9B,CAAC,GACL,GAAI,SAAS,WAAW,CAAC,IAAI,CAAC,sBAAsB,QAAQ,CAAC,CAC/D;EACA;CACF,CAAC;AACH;AAQA,SAAS,oBAAoB,EAC3B,MACA,UACA,YAC0C;CAC1C,MAAM,WAA6B,CACjC,kBAAkB;EAChB,SAAS;EACT,YAAY,EAAE,MAAM,sBAAsB;CAC5C,CAAC,GACD,kBAAkB;EAChB,MAAM,eAAe,QAAQ;EAC7B,YAAY,EAAE,oBAAoB,SAAS;CAC7C,CAAC,CACH;CACA,IAAI,YAAY,MAAM;EACpB,SAAS,KACP,kBAAkB;GAChB,SAAS;GACT,UAAU,CACR,kBAAkB;IAChB,SAAS;IACT,UAAU,CAAC,sBAAsB,QAAQ,CAAC;GAC5C,CAAC,CACH;GACA,YAAY,EACV,kBAAkB,GACpB;EACF,CAAC,CACH;EACA,SAAS,KACP,kBAAkB;GAChB,MAAM;GACN,YAAY,EACV,oBAAoB,GACtB;EACF,CAAC,CACH;CACF;CACA,SAAS,KACP,kBAAkB;EAChB,SAAS;EACT,UAAU,CACR,kBAAkB;GAChB,SAAS;GACT,UAAU,CAAC,sBAAsB,IAAI,CAAC;EACxC,CAAC,CACH;EACA,YAAY,EAAE,cAAc,GAAG;CACjC,CAAC,CACH;CACA,SAAS,KACP,kBAAkB;EAChB,SAAS;EACT,YAAY,EAAE,MAAM,+BAA+B;CACrD,CAAC,CACH;CACA,OAAO,kBAAkB;EACvB,SAAS;EACT;EACA,YAAY,EAAE,uBAAuB,GAAG;CAC1C,CAAC;AACH;AAEA,SAAS,sBACP,UACa;CACb,MAAM,WAA6B,CAAC;CACpC,IAAI,YAAY,MAAM;EACpB,IAAI,YAAY;EAChB,IAAI,YAAY;EAChB,KAAK,MAAM,QAAQ,SAAS,OAAO;GACjC,aAAa,KAAK;GAClB,aAAa,KAAK;EACpB;EACA,IAAI,YAAY,KAAK,cAAc,GACjC,SAAS,KACP,kBAAkB;GAChB,SAAS;GACT,UAAU,CAAC,sBAAsB,IAAI,WAAW,CAAC;GACjD,YAAY,EAAE,wBAAwB,GAAG;EAC3C,CAAC,CACH;EAEF,IAAI,YAAY,KAAK,cAAc,GACjC,SAAS,KACP,kBAAkB;GAChB,SAAS;GACT,UAAU,CAAC,sBAAsB,IAAI,WAAW,CAAC;GACjD,YAAY,EAAE,wBAAwB,GAAG;EAC3C,CAAC,CACH;CAEJ;CACA,SAAS,KACP,kBAAkB;EAChB,SAAS;EACT,YAAY,EAAE,MAAM,wBAAwB;CAC9C,CAAC,CACH;CACA,OAAO,kBAAkB;EACvB,SAAS;EACT;EACA,YAAY,EAAE,iBAAiB,GAAG;CACpC,CAAC;AACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"createGutterUtilityContentNode.d.ts","names":["createGutterUtilityContentNode","HTMLElement"],"sources":["../../src/utils/createGutterUtilityContentNode.d.ts"],"sourcesContent":["export declare function createGutterUtilityContentNode(): HTMLElement;\n//# sourceMappingURL=createGutterUtilityContentNode.d.ts.map"],"mappings":";iBAAwBA,8BAAAA,CAAAA,GAAkCC"}
1
+ {"version":3,"file":"createGutterUtilityContentNode.d.ts","names":[],"sources":["../../src/utils/createGutterUtilityContentNode.ts"],"mappings":";iBAAgB,8BAAA,IAAkC,WAAW"}
@@ -10,7 +10,7 @@ function createGutterUtilityContentNode() {
10
10
  gutterUtilityContent.style.touchAction = "none";
11
11
  return gutterUtilityContent;
12
12
  }
13
-
14
13
  //#endregion
15
14
  export { createGutterUtilityContentNode };
15
+
16
16
  //# sourceMappingURL=createGutterUtilityContentNode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createGutterUtilityContentNode.js","names":[],"sources":["../../src/utils/createGutterUtilityContentNode.ts"],"sourcesContent":["export function createGutterUtilityContentNode(): HTMLElement {\n const gutterUtilityContent = document.createElement('div');\n gutterUtilityContent.slot = 'gutter-utility-slot';\n gutterUtilityContent.style.position = 'absolute';\n gutterUtilityContent.style.top = '0';\n gutterUtilityContent.style.bottom = '0';\n gutterUtilityContent.style.textAlign = 'center';\n gutterUtilityContent.style.whiteSpace = 'normal';\n gutterUtilityContent.style.touchAction = 'none';\n return gutterUtilityContent;\n}\n"],"mappings":";AAAA,SAAgB,iCAA8C;CAC5D,MAAM,uBAAuB,SAAS,cAAc,MAAM;AAC1D,sBAAqB,OAAO;AAC5B,sBAAqB,MAAM,WAAW;AACtC,sBAAqB,MAAM,MAAM;AACjC,sBAAqB,MAAM,SAAS;AACpC,sBAAqB,MAAM,YAAY;AACvC,sBAAqB,MAAM,aAAa;AACxC,sBAAqB,MAAM,cAAc;AACzC,QAAO"}
1
+ {"version":3,"file":"createGutterUtilityContentNode.js","names":[],"sources":["../../src/utils/createGutterUtilityContentNode.ts"],"sourcesContent":["export function createGutterUtilityContentNode(): HTMLElement {\n const gutterUtilityContent = document.createElement('div');\n gutterUtilityContent.slot = 'gutter-utility-slot';\n gutterUtilityContent.style.position = 'absolute';\n gutterUtilityContent.style.top = '0';\n gutterUtilityContent.style.bottom = '0';\n gutterUtilityContent.style.textAlign = 'center';\n gutterUtilityContent.style.whiteSpace = 'normal';\n gutterUtilityContent.style.touchAction = 'none';\n return gutterUtilityContent;\n}\n"],"mappings":";AAAA,SAAgB,iCAA8C;CAC5D,MAAM,uBAAuB,SAAS,cAAc,KAAK;CACzD,qBAAqB,OAAO;CAC5B,qBAAqB,MAAM,WAAW;CACtC,qBAAqB,MAAM,MAAM;CACjC,qBAAqB,MAAM,SAAS;CACpC,qBAAqB,MAAM,YAAY;CACvC,qBAAqB,MAAM,aAAa;CACxC,qBAAqB,MAAM,cAAc;CACzC,OAAO;AACT"}
@@ -1,4 +1,4 @@
1
- import { Element } from "hast";
1
+ import { Element } from "../node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.js";
2
2
 
3
3
  //#region src/utils/createGutterUtilityElement.d.ts
4
4
  declare function createGutterUtilityElement(): Element;
@@ -1 +1 @@
1
- {"version":3,"file":"createGutterUtilityElement.d.ts","names":["Element","HASTElement","createGutterUtilityElement"],"sources":["../../src/utils/createGutterUtilityElement.d.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\nexport declare function createGutterUtilityElement(): HASTElement;\n//# sourceMappingURL=createGutterUtilityElement.d.ts.map"],"mappings":";;;iBACwBE,0BAAAA,CAAAA,GAA8BD"}
1
+ {"version":3,"file":"createGutterUtilityElement.d.ts","names":[],"sources":["../../src/utils/createGutterUtilityElement.ts"],"mappings":";;;iBAIgB,0BAAA,IAA8B,OAAW"}
@@ -1,5 +1,4 @@
1
1
  import { createHastElement, createIconElement } from "./hast_utils.js";
2
-
3
2
  //#region src/utils/createGutterUtilityElement.ts
4
3
  function createGutterUtilityElement() {
5
4
  return createHastElement({
@@ -14,7 +13,7 @@ function createGutterUtilityElement() {
14
13
  })]
15
14
  });
16
15
  }
17
-
18
16
  //#endregion
19
17
  export { createGutterUtilityElement };
18
+
20
19
  //# sourceMappingURL=createGutterUtilityElement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createGutterUtilityElement.js","names":[],"sources":["../../src/utils/createGutterUtilityElement.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport { createHastElement, createIconElement } from './hast_utils';\n\nexport function createGutterUtilityElement(): HASTElement {\n return createHastElement({\n tagName: 'button',\n properties: { 'data-utility-button': '', type: 'button' },\n children: [\n createIconElement({\n name: 'diffs-icon-plus',\n properties: { 'data-icon': '' },\n }),\n ],\n });\n}\n"],"mappings":";;;AAIA,SAAgB,6BAA0C;AACxD,QAAO,kBAAkB;EACvB,SAAS;EACT,YAAY;GAAE,uBAAuB;GAAI,MAAM;GAAU;EACzD,UAAU,CACR,kBAAkB;GAChB,MAAM;GACN,YAAY,EAAE,aAAa,IAAI;GAChC,CAAC,CACH;EACF,CAAC"}
1
+ {"version":3,"file":"createGutterUtilityElement.js","names":[],"sources":["../../src/utils/createGutterUtilityElement.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport { createHastElement, createIconElement } from './hast_utils';\n\nexport function createGutterUtilityElement(): HASTElement {\n return createHastElement({\n tagName: 'button',\n properties: { 'data-utility-button': '', type: 'button' },\n children: [\n createIconElement({\n name: 'diffs-icon-plus',\n properties: { 'data-icon': '' },\n }),\n ],\n });\n}\n"],"mappings":";;AAIA,SAAgB,6BAA0C;CACxD,OAAO,kBAAkB;EACvB,SAAS;EACT,YAAY;GAAE,uBAAuB;GAAI,MAAM;EAAS;EACxD,UAAU,CACR,kBAAkB;GAChB,MAAM;GACN,YAAY,EAAE,aAAa,GAAG;EAChC,CAAC,CACH;CACF,CAAC;AACH"}
@@ -1,5 +1,5 @@
1
+ import { Element } from "../node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.js";
1
2
  import { LineTypes } from "../types.js";
2
- import { Element } from "hast";
3
3
 
4
4
  //#region src/utils/createNoNewlineElement.d.ts
5
5
  declare function createNoNewlineElement(type: LineTypes): Element;
@@ -1 +1 @@
1
- {"version":3,"file":"createNoNewlineElement.d.ts","names":["Element","HASTElement","LineTypes","createNoNewlineElement"],"sources":["../../src/utils/createNoNewlineElement.d.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\nimport type { LineTypes } from '../types';\nexport declare function createNoNewlineElement(type: LineTypes): HASTElement;\n//# sourceMappingURL=createNoNewlineElement.d.ts.map"],"mappings":";;;;iBAEwBG,sBAAAA,OAA6BD,YAAYD"}
1
+ {"version":3,"file":"createNoNewlineElement.d.ts","names":[],"sources":["../../src/utils/createNoNewlineElement.ts"],"mappings":";;;;iBAKgB,sBAAA,CAAuB,IAAA,EAAM,SAAA,GAAY,OAAW"}
@@ -1,5 +1,4 @@
1
1
  import { createHastElement, createTextNodeElement } from "./hast_utils.js";
2
-
3
2
  //#region src/utils/createNoNewlineElement.ts
4
3
  function createNoNewlineElement(type) {
5
4
  return createHastElement({
@@ -15,7 +14,7 @@ function createNoNewlineElement(type) {
15
14
  }
16
15
  });
17
16
  }
18
-
19
17
  //#endregion
20
18
  export { createNoNewlineElement };
19
+
21
20
  //# sourceMappingURL=createNoNewlineElement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createNoNewlineElement.js","names":[],"sources":["../../src/utils/createNoNewlineElement.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport type { LineTypes } from '../types';\nimport { createHastElement, createTextNodeElement } from './hast_utils';\n\nexport function createNoNewlineElement(type: LineTypes): HASTElement {\n return createHastElement({\n tagName: 'div',\n children: [\n createHastElement({\n tagName: 'span',\n children: [createTextNodeElement('No newline at end of file')],\n }),\n ],\n properties: {\n 'data-no-newline': '',\n 'data-line-type': type,\n 'data-column-content': '',\n },\n });\n}\n"],"mappings":";;;AAKA,SAAgB,uBAAuB,MAA8B;AACnE,QAAO,kBAAkB;EACvB,SAAS;EACT,UAAU,CACR,kBAAkB;GAChB,SAAS;GACT,UAAU,CAAC,sBAAsB,4BAA4B,CAAC;GAC/D,CAAC,CACH;EACD,YAAY;GACV,mBAAmB;GACnB,kBAAkB;GAClB,uBAAuB;GACxB;EACF,CAAC"}
1
+ {"version":3,"file":"createNoNewlineElement.js","names":[],"sources":["../../src/utils/createNoNewlineElement.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport type { LineTypes } from '../types';\nimport { createHastElement, createTextNodeElement } from './hast_utils';\n\nexport function createNoNewlineElement(type: LineTypes): HASTElement {\n return createHastElement({\n tagName: 'div',\n children: [\n createHastElement({\n tagName: 'span',\n children: [createTextNodeElement('No newline at end of file')],\n }),\n ],\n properties: {\n 'data-no-newline': '',\n 'data-line-type': type,\n 'data-column-content': '',\n },\n });\n}\n"],"mappings":";;AAKA,SAAgB,uBAAuB,MAA8B;CACnE,OAAO,kBAAkB;EACvB,SAAS;EACT,UAAU,CACR,kBAAkB;GAChB,SAAS;GACT,UAAU,CAAC,sBAAsB,2BAA2B,CAAC;EAC/D,CAAC,CACH;EACA,YAAY;GACV,mBAAmB;GACnB,kBAAkB;GAClB,uBAAuB;EACzB;CACF,CAAC;AACH"}
@@ -1,5 +1,5 @@
1
+ import { Element, Properties } from "../node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.js";
1
2
  import { PrePropertiesConfig } from "../types.js";
2
- import { Element, Properties } from "hast";
3
3
 
4
4
  //#region src/utils/createPreElement.d.ts
5
5
  declare function createPreElement(options: PrePropertiesConfig): Element;