@openclaw/diffs 2026.8.1-beta.3 → 2026.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (620) hide show
  1. package/dist/assets/viewer-runtime.js +129 -156
  2. package/dist/{browser.runtime-_hkQDewM.js → browser.runtime-DTKAejqd.js} +1 -1
  3. package/dist/index.js +18 -16
  4. package/dist/{viewer-assets-DKR8WLAI.js → viewer-assets-D3qrnaxI.js} +11 -23
  5. package/node_modules/@pierre/diffs/README.md +9 -0
  6. package/node_modules/@pierre/diffs/dist/components/CodeView.d.ts +94 -7
  7. package/node_modules/@pierre/diffs/dist/components/CodeView.d.ts.map +1 -1
  8. package/node_modules/@pierre/diffs/dist/components/CodeView.js +333 -47
  9. package/node_modules/@pierre/diffs/dist/components/CodeView.js.map +1 -1
  10. package/node_modules/@pierre/diffs/dist/components/File.d.ts +22 -4
  11. package/node_modules/@pierre/diffs/dist/components/File.d.ts.map +1 -1
  12. package/node_modules/@pierre/diffs/dist/components/File.js +143 -23
  13. package/node_modules/@pierre/diffs/dist/components/File.js.map +1 -1
  14. package/node_modules/@pierre/diffs/dist/components/FileDiff.d.ts +83 -19
  15. package/node_modules/@pierre/diffs/dist/components/FileDiff.d.ts.map +1 -1
  16. package/node_modules/@pierre/diffs/dist/components/FileDiff.js +461 -46
  17. package/node_modules/@pierre/diffs/dist/components/FileDiff.js.map +1 -1
  18. package/node_modules/@pierre/diffs/dist/components/FileStream.d.ts.map +1 -1
  19. package/node_modules/@pierre/diffs/dist/components/FileStream.js +2 -1
  20. package/node_modules/@pierre/diffs/dist/components/FileStream.js.map +1 -1
  21. package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.d.ts +2 -2
  22. package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.d.ts.map +1 -1
  23. package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.js +9 -4
  24. package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.js.map +1 -1
  25. package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.d.ts +7 -3
  26. package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.d.ts.map +1 -1
  27. package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.js +87 -60
  28. package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.js.map +1 -1
  29. package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.d.ts +30 -5
  30. package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.d.ts.map +1 -1
  31. package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.js +277 -56
  32. package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.js.map +1 -1
  33. package/node_modules/@pierre/diffs/dist/components/Virtualizer.d.ts +17 -3
  34. package/node_modules/@pierre/diffs/dist/components/Virtualizer.d.ts.map +1 -1
  35. package/node_modules/@pierre/diffs/dist/components/Virtualizer.js +44 -5
  36. package/node_modules/@pierre/diffs/dist/components/Virtualizer.js.map +1 -1
  37. package/node_modules/@pierre/diffs/dist/constants.d.ts +4 -1
  38. package/node_modules/@pierre/diffs/dist/constants.d.ts.map +1 -1
  39. package/node_modules/@pierre/diffs/dist/constants.js +4 -1
  40. package/node_modules/@pierre/diffs/dist/constants.js.map +1 -1
  41. package/node_modules/@pierre/diffs/dist/edit/index.d.ts +6 -0
  42. package/node_modules/@pierre/diffs/dist/edit/index.js +3 -0
  43. package/node_modules/@pierre/diffs/dist/editor/command.d.ts +15 -0
  44. package/node_modules/@pierre/diffs/dist/editor/command.d.ts.map +1 -0
  45. package/node_modules/@pierre/diffs/dist/editor/command.js +128 -0
  46. package/node_modules/@pierre/diffs/dist/editor/command.js.map +1 -0
  47. package/node_modules/@pierre/diffs/dist/editor/editStack.d.ts +76 -0
  48. package/node_modules/@pierre/diffs/dist/editor/editStack.d.ts.map +1 -0
  49. package/node_modules/@pierre/diffs/dist/editor/editStack.js +259 -0
  50. package/node_modules/@pierre/diffs/dist/editor/editStack.js.map +1 -0
  51. package/node_modules/@pierre/diffs/dist/editor/editor.d.ts +118 -0
  52. package/node_modules/@pierre/diffs/dist/editor/editor.d.ts.map +1 -0
  53. package/node_modules/@pierre/diffs/dist/editor/editor.js +2880 -0
  54. package/node_modules/@pierre/diffs/dist/editor/editor.js.map +1 -0
  55. package/node_modules/@pierre/diffs/dist/editor/editor2.js +6 -0
  56. package/node_modules/@pierre/diffs/dist/editor/editor2.js.map +1 -0
  57. package/node_modules/@pierre/diffs/dist/editor/languages.d.ts +26 -0
  58. package/node_modules/@pierre/diffs/dist/editor/languages.d.ts.map +1 -0
  59. package/node_modules/@pierre/diffs/dist/editor/languages.js +363 -0
  60. package/node_modules/@pierre/diffs/dist/editor/languages.js.map +1 -0
  61. package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.d.ts +9 -0
  62. package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.d.ts.map +1 -0
  63. package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.js +212 -0
  64. package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.js.map +1 -0
  65. package/node_modules/@pierre/diffs/dist/editor/marker.d.ts +38 -0
  66. package/node_modules/@pierre/diffs/dist/editor/marker.d.ts.map +1 -0
  67. package/node_modules/@pierre/diffs/dist/editor/marker.js +245 -0
  68. package/node_modules/@pierre/diffs/dist/editor/marker.js.map +1 -0
  69. package/node_modules/@pierre/diffs/dist/editor/matchBrackets.d.ts +9 -0
  70. package/node_modules/@pierre/diffs/dist/editor/matchBrackets.d.ts.map +1 -0
  71. package/node_modules/@pierre/diffs/dist/editor/matchBrackets.js +138 -0
  72. package/node_modules/@pierre/diffs/dist/editor/matchBrackets.js.map +1 -0
  73. package/node_modules/@pierre/diffs/dist/editor/pieceTable.d.ts +40 -0
  74. package/node_modules/@pierre/diffs/dist/editor/pieceTable.d.ts.map +1 -0
  75. package/node_modules/@pierre/diffs/dist/editor/pieceTable.js +706 -0
  76. package/node_modules/@pierre/diffs/dist/editor/pieceTable.js.map +1 -0
  77. package/node_modules/@pierre/diffs/dist/editor/platform.d.ts +11 -0
  78. package/node_modules/@pierre/diffs/dist/editor/platform.d.ts.map +1 -0
  79. package/node_modules/@pierre/diffs/dist/editor/platform.js +31 -0
  80. package/node_modules/@pierre/diffs/dist/editor/platform.js.map +1 -0
  81. package/node_modules/@pierre/diffs/dist/editor/popover.d.ts +65 -0
  82. package/node_modules/@pierre/diffs/dist/editor/popover.d.ts.map +1 -0
  83. package/node_modules/@pierre/diffs/dist/editor/popover.js +191 -0
  84. package/node_modules/@pierre/diffs/dist/editor/popover.js.map +1 -0
  85. package/node_modules/@pierre/diffs/dist/editor/searchPanel.d.ts +41 -0
  86. package/node_modules/@pierre/diffs/dist/editor/searchPanel.d.ts.map +1 -0
  87. package/node_modules/@pierre/diffs/dist/editor/searchPanel.js +318 -0
  88. package/node_modules/@pierre/diffs/dist/editor/searchPanel.js.map +1 -0
  89. package/node_modules/@pierre/diffs/dist/editor/selection.d.ts +211 -0
  90. package/node_modules/@pierre/diffs/dist/editor/selection.d.ts.map +1 -0
  91. package/node_modules/@pierre/diffs/dist/editor/selection.js +1626 -0
  92. package/node_modules/@pierre/diffs/dist/editor/selection.js.map +1 -0
  93. package/node_modules/@pierre/diffs/dist/editor/selectionAction.d.ts +47 -0
  94. package/node_modules/@pierre/diffs/dist/editor/selectionAction.d.ts.map +1 -0
  95. package/node_modules/@pierre/diffs/dist/editor/selectionAction.js +66 -0
  96. package/node_modules/@pierre/diffs/dist/editor/selectionAction.js.map +1 -0
  97. package/node_modules/@pierre/diffs/dist/editor/sprite.d.ts +8 -0
  98. package/node_modules/@pierre/diffs/dist/editor/sprite.d.ts.map +1 -0
  99. package/node_modules/@pierre/diffs/dist/editor/sprite.js +45 -0
  100. package/node_modules/@pierre/diffs/dist/editor/sprite.js.map +1 -0
  101. package/node_modules/@pierre/diffs/dist/editor/stateStorage.d.ts +15 -0
  102. package/node_modules/@pierre/diffs/dist/editor/stateStorage.d.ts.map +1 -0
  103. package/node_modules/@pierre/diffs/dist/editor/stateStorage.js +65 -0
  104. package/node_modules/@pierre/diffs/dist/editor/stateStorage.js.map +1 -0
  105. package/node_modules/@pierre/diffs/dist/editor/textDocument.d.ts +67 -0
  106. package/node_modules/@pierre/diffs/dist/editor/textDocument.d.ts.map +1 -0
  107. package/node_modules/@pierre/diffs/dist/editor/textDocument.js +278 -0
  108. package/node_modules/@pierre/diffs/dist/editor/textDocument.js.map +1 -0
  109. package/node_modules/@pierre/diffs/dist/editor/textMeasure.d.ts +61 -0
  110. package/node_modules/@pierre/diffs/dist/editor/textMeasure.d.ts.map +1 -0
  111. package/node_modules/@pierre/diffs/dist/editor/textMeasure.js +209 -0
  112. package/node_modules/@pierre/diffs/dist/editor/textMeasure.js.map +1 -0
  113. package/node_modules/@pierre/diffs/dist/editor/tokenizer.d.ts +41 -0
  114. package/node_modules/@pierre/diffs/dist/editor/tokenizer.d.ts.map +1 -0
  115. package/node_modules/@pierre/diffs/dist/editor/tokenizer.js +596 -0
  116. package/node_modules/@pierre/diffs/dist/editor/tokenizer.js.map +1 -0
  117. package/node_modules/@pierre/diffs/dist/editor/utils.d.ts +22 -0
  118. package/node_modules/@pierre/diffs/dist/editor/utils.d.ts.map +1 -0
  119. package/node_modules/@pierre/diffs/dist/editor/utils.js +78 -0
  120. package/node_modules/@pierre/diffs/dist/editor/utils.js.map +1 -0
  121. package/node_modules/@pierre/diffs/dist/index.d.ts +12 -9
  122. package/node_modules/@pierre/diffs/dist/index.js +13 -10
  123. package/node_modules/@pierre/diffs/dist/managers/InteractionManager.d.ts +20 -2
  124. package/node_modules/@pierre/diffs/dist/managers/InteractionManager.d.ts.map +1 -1
  125. package/node_modules/@pierre/diffs/dist/managers/InteractionManager.js +155 -79
  126. package/node_modules/@pierre/diffs/dist/managers/InteractionManager.js.map +1 -1
  127. package/node_modules/@pierre/diffs/dist/managers/ResizeManager.d.ts +10 -2
  128. package/node_modules/@pierre/diffs/dist/managers/ResizeManager.d.ts.map +1 -1
  129. package/node_modules/@pierre/diffs/dist/managers/ResizeManager.js +33 -13
  130. package/node_modules/@pierre/diffs/dist/managers/ResizeManager.js.map +1 -1
  131. package/node_modules/@pierre/diffs/dist/managers/UniversalRenderingManager.d.ts +2 -1
  132. package/node_modules/@pierre/diffs/dist/managers/UniversalRenderingManager.d.ts.map +1 -1
  133. package/node_modules/@pierre/diffs/dist/managers/UniversalRenderingManager.js +7 -3
  134. package/node_modules/@pierre/diffs/dist/managers/UniversalRenderingManager.js.map +1 -1
  135. package/node_modules/@pierre/diffs/dist/react/CodeView.d.ts +29 -3
  136. package/node_modules/@pierre/diffs/dist/react/CodeView.d.ts.map +1 -1
  137. package/node_modules/@pierre/diffs/dist/react/CodeView.js +111 -30
  138. package/node_modules/@pierre/diffs/dist/react/CodeView.js.map +1 -1
  139. package/node_modules/@pierre/diffs/dist/react/EditContext.d.ts +20 -0
  140. package/node_modules/@pierre/diffs/dist/react/EditContext.d.ts.map +1 -0
  141. package/node_modules/@pierre/diffs/dist/react/EditContext.js +27 -0
  142. package/node_modules/@pierre/diffs/dist/react/EditContext.js.map +1 -0
  143. package/node_modules/@pierre/diffs/dist/react/File.d.ts +4 -1
  144. package/node_modules/@pierre/diffs/dist/react/File.d.ts.map +1 -1
  145. package/node_modules/@pierre/diffs/dist/react/File.js +5 -2
  146. package/node_modules/@pierre/diffs/dist/react/File.js.map +1 -1
  147. package/node_modules/@pierre/diffs/dist/react/FileDiff.d.ts +4 -1
  148. package/node_modules/@pierre/diffs/dist/react/FileDiff.d.ts.map +1 -1
  149. package/node_modules/@pierre/diffs/dist/react/FileDiff.js +5 -2
  150. package/node_modules/@pierre/diffs/dist/react/FileDiff.js.map +1 -1
  151. package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.d.ts +7 -5
  152. package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.d.ts.map +1 -1
  153. package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.js +5 -2
  154. package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.js.map +1 -1
  155. package/node_modules/@pierre/diffs/dist/react/PatchDiff.d.ts +4 -1
  156. package/node_modules/@pierre/diffs/dist/react/PatchDiff.d.ts.map +1 -1
  157. package/node_modules/@pierre/diffs/dist/react/PatchDiff.js +5 -2
  158. package/node_modules/@pierre/diffs/dist/react/PatchDiff.js.map +1 -1
  159. package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.d.ts +2 -1
  160. package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.d.ts.map +1 -1
  161. package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.js +2 -1
  162. package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.js.map +1 -1
  163. package/node_modules/@pierre/diffs/dist/react/index.d.ts +4 -3
  164. package/node_modules/@pierre/diffs/dist/react/index.js +3 -2
  165. package/node_modules/@pierre/diffs/dist/react/types.d.ts +11 -0
  166. package/node_modules/@pierre/diffs/dist/react/types.d.ts.map +1 -1
  167. package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.d.ts +2 -0
  168. package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.d.ts.map +1 -1
  169. package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.js +16 -8
  170. package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.js.map +1 -1
  171. package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.d.ts +2 -0
  172. package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.d.ts.map +1 -1
  173. package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.js +16 -8
  174. package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.js.map +1 -1
  175. package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.d.ts +6 -2
  176. package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.d.ts.map +1 -1
  177. package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.js +21 -6
  178. package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.js.map +1 -1
  179. package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.d.ts +7 -2
  180. package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.d.ts.map +1 -1
  181. package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.js +21 -6
  182. package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.js.map +1 -1
  183. package/node_modules/@pierre/diffs/dist/react/utils/useUnresolvedFileInstance.js +4 -4
  184. package/node_modules/@pierre/diffs/dist/react/utils/useUnresolvedFileInstance.js.map +1 -1
  185. package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.d.ts +47 -2
  186. package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.d.ts.map +1 -1
  187. package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.js +361 -37
  188. package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.js.map +1 -1
  189. package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.d.ts +26 -1
  190. package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.d.ts.map +1 -1
  191. package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.js +240 -55
  192. package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.js.map +1 -1
  193. package/node_modules/@pierre/diffs/dist/ssr/index.d.ts +2 -2
  194. package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.d.ts +11 -10
  195. package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.d.ts.map +1 -1
  196. package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.js +17 -7
  197. package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.js.map +1 -1
  198. package/node_modules/@pierre/diffs/dist/ssr/preloadFile.d.ts.map +1 -1
  199. package/node_modules/@pierre/diffs/dist/ssr/preloadFile.js +2 -0
  200. package/node_modules/@pierre/diffs/dist/ssr/preloadFile.js.map +1 -1
  201. package/node_modules/@pierre/diffs/dist/style.js +1 -1
  202. package/node_modules/@pierre/diffs/dist/types.d.ts +336 -5
  203. package/node_modules/@pierre/diffs/dist/types.d.ts.map +1 -1
  204. package/node_modules/@pierre/diffs/dist/utils/annotationHelpers.d.ts +20 -0
  205. package/node_modules/@pierre/diffs/dist/utils/annotationHelpers.d.ts.map +1 -0
  206. package/node_modules/@pierre/diffs/dist/utils/annotationHelpers.js +29 -0
  207. package/node_modules/@pierre/diffs/dist/utils/annotationHelpers.js.map +1 -0
  208. package/node_modules/@pierre/diffs/dist/utils/applyLineTextWithNewline.d.ts +5 -0
  209. package/node_modules/@pierre/diffs/dist/utils/applyLineTextWithNewline.d.ts.map +1 -0
  210. package/node_modules/@pierre/diffs/dist/utils/applyLineTextWithNewline.js +11 -0
  211. package/node_modules/@pierre/diffs/dist/utils/applyLineTextWithNewline.js.map +1 -0
  212. package/node_modules/@pierre/diffs/dist/utils/areHunkDataEqual.js +1 -1
  213. package/node_modules/@pierre/diffs/dist/utils/areHunkDataEqual.js.map +1 -1
  214. package/node_modules/@pierre/diffs/dist/utils/areManagedSnapshotsEqual.d.ts +2 -2
  215. package/node_modules/@pierre/diffs/dist/utils/areManagedSnapshotsEqual.d.ts.map +1 -1
  216. package/node_modules/@pierre/diffs/dist/utils/areManagedSnapshotsEqual.js +6 -1
  217. package/node_modules/@pierre/diffs/dist/utils/areManagedSnapshotsEqual.js.map +1 -1
  218. package/node_modules/@pierre/diffs/dist/utils/awaitWithTimeout.d.ts +5 -0
  219. package/node_modules/@pierre/diffs/dist/utils/awaitWithTimeout.d.ts.map +1 -0
  220. package/node_modules/@pierre/diffs/dist/utils/awaitWithTimeout.js +15 -0
  221. package/node_modules/@pierre/diffs/dist/utils/awaitWithTimeout.js.map +1 -0
  222. package/node_modules/@pierre/diffs/dist/utils/cleanLastNewline.js +6 -1
  223. package/node_modules/@pierre/diffs/dist/utils/cleanLastNewline.js.map +1 -1
  224. package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.d.ts +7 -0
  225. package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.d.ts.map +1 -0
  226. package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.js +16 -0
  227. package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.js.map +1 -0
  228. package/node_modules/@pierre/diffs/dist/utils/computeEstimatedDiffHeights.d.ts +3 -1
  229. package/node_modules/@pierre/diffs/dist/utils/computeEstimatedDiffHeights.d.ts.map +1 -1
  230. package/node_modules/@pierre/diffs/dist/utils/computeEstimatedDiffHeights.js +8 -1
  231. package/node_modules/@pierre/diffs/dist/utils/computeEstimatedDiffHeights.js.map +1 -1
  232. package/node_modules/@pierre/diffs/dist/utils/computeFileOffsets.d.ts +21 -0
  233. package/node_modules/@pierre/diffs/dist/utils/computeFileOffsets.d.ts.map +1 -0
  234. package/node_modules/@pierre/diffs/dist/utils/computeFileOffsets.js +80 -0
  235. package/node_modules/@pierre/diffs/dist/utils/computeFileOffsets.js.map +1 -0
  236. package/node_modules/@pierre/diffs/dist/utils/createCodeViewHeaderFooterHostElement.d.ts +5 -0
  237. package/node_modules/@pierre/diffs/dist/utils/createCodeViewHeaderFooterHostElement.d.ts.map +1 -0
  238. package/node_modules/@pierre/diffs/dist/utils/createCodeViewHeaderFooterHostElement.js +19 -0
  239. package/node_modules/@pierre/diffs/dist/utils/createCodeViewHeaderFooterHostElement.js.map +1 -0
  240. package/node_modules/@pierre/diffs/dist/utils/createFileHeaderElement.d.ts.map +1 -1
  241. package/node_modules/@pierre/diffs/dist/utils/createFileHeaderElement.js +5 -1
  242. package/node_modules/@pierre/diffs/dist/utils/createFileHeaderElement.js.map +1 -1
  243. package/node_modules/@pierre/diffs/dist/utils/createTransformerWithState.js +9 -0
  244. package/node_modules/@pierre/diffs/dist/utils/createTransformerWithState.js.map +1 -1
  245. package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.d.ts +66 -0
  246. package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.d.ts.map +1 -0
  247. package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.js +437 -0
  248. package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.js.map +1 -0
  249. package/node_modules/@pierre/diffs/dist/utils/getDiffFileInput.d.ts +14 -0
  250. package/node_modules/@pierre/diffs/dist/utils/getDiffFileInput.d.ts.map +1 -0
  251. package/node_modules/@pierre/diffs/dist/utils/getDiffFileInput.js +24 -0
  252. package/node_modules/@pierre/diffs/dist/utils/getDiffFileInput.js.map +1 -0
  253. package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.d.ts.map +1 -1
  254. package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.js +3 -1
  255. package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.js.map +1 -1
  256. package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.d.ts.map +1 -1
  257. package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.js +2 -1
  258. package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.js.map +1 -1
  259. package/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.d.ts.map +1 -1
  260. package/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.js +2 -0
  261. package/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.js.map +1 -1
  262. package/node_modules/@pierre/diffs/dist/utils/getHunkSideBoundaries.d.ts +7 -0
  263. package/node_modules/@pierre/diffs/dist/utils/getHunkSideBoundaries.d.ts.map +1 -0
  264. package/node_modules/@pierre/diffs/dist/utils/getHunkSideBoundaries.js +12 -0
  265. package/node_modules/@pierre/diffs/dist/utils/getHunkSideBoundaries.js.map +1 -0
  266. package/node_modules/@pierre/diffs/dist/utils/getTotalLineCountFromHunks.d.ts.map +1 -1
  267. package/node_modules/@pierre/diffs/dist/utils/getTotalLineCountFromHunks.js +2 -1
  268. package/node_modules/@pierre/diffs/dist/utils/getTotalLineCountFromHunks.js.map +1 -1
  269. package/node_modules/@pierre/diffs/dist/utils/guardWebKitScrollDuringRebuild.d.ts +20 -0
  270. package/node_modules/@pierre/diffs/dist/utils/guardWebKitScrollDuringRebuild.d.ts.map +1 -0
  271. package/node_modules/@pierre/diffs/dist/utils/guardWebKitScrollDuringRebuild.js +34 -0
  272. package/node_modules/@pierre/diffs/dist/utils/guardWebKitScrollDuringRebuild.js.map +1 -0
  273. package/node_modules/@pierre/diffs/dist/utils/hydratePartialDiff.d.ts +10 -0
  274. package/node_modules/@pierre/diffs/dist/utils/hydratePartialDiff.d.ts.map +1 -0
  275. package/node_modules/@pierre/diffs/dist/utils/hydratePartialDiff.js +141 -0
  276. package/node_modules/@pierre/diffs/dist/utils/hydratePartialDiff.js.map +1 -0
  277. package/node_modules/@pierre/diffs/dist/utils/isGutterUtilityPath.d.ts +5 -0
  278. package/node_modules/@pierre/diffs/dist/utils/isGutterUtilityPath.d.ts.map +1 -0
  279. package/node_modules/@pierre/diffs/dist/utils/isGutterUtilityPath.js +12 -0
  280. package/node_modules/@pierre/diffs/dist/utils/isGutterUtilityPath.js.map +1 -0
  281. package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.d.ts.map +1 -1
  282. package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.js +20 -15
  283. package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.js.map +1 -1
  284. package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.d.ts +1 -1
  285. package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.d.ts.map +1 -1
  286. package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.js +26 -5
  287. package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.js.map +1 -1
  288. package/node_modules/@pierre/diffs/dist/utils/parseMergeConflictDiffFromFile.d.ts.map +1 -1
  289. package/node_modules/@pierre/diffs/dist/utils/parseMergeConflictDiffFromFile.js +9 -6
  290. package/node_modules/@pierre/diffs/dist/utils/parseMergeConflictDiffFromFile.js.map +1 -1
  291. package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.d.ts.map +1 -1
  292. package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.js +6 -3
  293. package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.js.map +1 -1
  294. package/node_modules/@pierre/diffs/dist/utils/platform.d.ts +14 -0
  295. package/node_modules/@pierre/diffs/dist/utils/platform.d.ts.map +1 -0
  296. package/node_modules/@pierre/diffs/dist/utils/platform.js +32 -0
  297. package/node_modules/@pierre/diffs/dist/utils/platform.js.map +1 -0
  298. package/node_modules/@pierre/diffs/dist/utils/realignChangeContent.d.ts +33 -0
  299. package/node_modules/@pierre/diffs/dist/utils/realignChangeContent.d.ts.map +1 -0
  300. package/node_modules/@pierre/diffs/dist/utils/realignChangeContent.js +148 -0
  301. package/node_modules/@pierre/diffs/dist/utils/realignChangeContent.js.map +1 -0
  302. package/node_modules/@pierre/diffs/dist/utils/renderDiffWithHighlighter.js +1 -1
  303. package/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.d.ts.map +1 -1
  304. package/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.js +5 -14
  305. package/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.js.map +1 -1
  306. package/node_modules/@pierre/diffs/dist/utils/resolveRegion.d.ts.map +1 -1
  307. package/node_modules/@pierre/diffs/dist/utils/resolveRegion.js +18 -2
  308. package/node_modules/@pierre/diffs/dist/utils/resolveRegion.js.map +1 -1
  309. package/node_modules/@pierre/diffs/dist/utils/shouldUseTokenTransformer.d.ts +7 -3
  310. package/node_modules/@pierre/diffs/dist/utils/shouldUseTokenTransformer.d.ts.map +1 -1
  311. package/node_modules/@pierre/diffs/dist/utils/shouldUseTokenTransformer.js +1 -1
  312. package/node_modules/@pierre/diffs/dist/utils/shouldUseTokenTransformer.js.map +1 -1
  313. package/node_modules/@pierre/diffs/dist/utils/updateDiffHunks.d.ts +24 -0
  314. package/node_modules/@pierre/diffs/dist/utils/updateDiffHunks.d.ts.map +1 -0
  315. package/node_modules/@pierre/diffs/dist/utils/updateDiffHunks.js +236 -0
  316. package/node_modules/@pierre/diffs/dist/utils/updateDiffHunks.js.map +1 -0
  317. package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.d.ts +43 -2
  318. package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.d.ts.map +1 -1
  319. package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.js +107 -5
  320. package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.js.map +1 -1
  321. package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.d.ts +9 -3
  322. package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.d.ts.map +1 -1
  323. package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.js +86 -18
  324. package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.js.map +1 -1
  325. package/node_modules/@pierre/diffs/dist/worker/index.d.ts +2 -2
  326. package/node_modules/@pierre/diffs/dist/worker/types.d.ts +11 -1
  327. package/node_modules/@pierre/diffs/dist/worker/types.d.ts.map +1 -1
  328. package/node_modules/@pierre/diffs/dist/worker/wasm-B9ZqxnKj.js.map +1 -1
  329. package/node_modules/@pierre/diffs/dist/worker/worker-portable.js +116 -95
  330. package/node_modules/@pierre/diffs/dist/worker/worker-portable.js.map +1 -1
  331. package/node_modules/@pierre/diffs/dist/worker/worker.js +102 -80
  332. package/node_modules/@pierre/diffs/dist/worker/worker.js.map +1 -1
  333. package/node_modules/@pierre/diffs/node_modules/@pierre/theme/LICENSE +189 -21
  334. package/node_modules/@pierre/diffs/node_modules/@pierre/theme/NOTICE.md +32 -0
  335. package/node_modules/@pierre/diffs/node_modules/@pierre/theme/package.json +3 -2
  336. package/node_modules/@pierre/diffs/node_modules/@pierre/theming/LICENSE.md +189 -0
  337. package/node_modules/@pierre/diffs/node_modules/@pierre/theming/README.md +9 -0
  338. package/node_modules/@pierre/diffs/node_modules/@pierre/theming/package.json +5 -5
  339. package/node_modules/@pierre/diffs/node_modules/@shikijs/core/dist/index.d.mts +0 -1
  340. package/node_modules/@pierre/diffs/node_modules/@shikijs/core/dist/index.mjs +22 -3
  341. package/node_modules/@pierre/diffs/node_modules/@shikijs/core/package.json +4 -4
  342. package/node_modules/@pierre/diffs/node_modules/@shikijs/engine-javascript/dist/{engine-compile-CMRQUZTL.d.mts → engine-compile-Bdn9ihA2.d.mts} +0 -1
  343. package/node_modules/@pierre/diffs/node_modules/@shikijs/engine-javascript/dist/engine-compile.d.mts +1 -1
  344. package/node_modules/@pierre/diffs/node_modules/@shikijs/engine-javascript/dist/engine-raw.d.mts +0 -1
  345. package/node_modules/@pierre/diffs/node_modules/@shikijs/engine-javascript/dist/index.d.mts +1 -1
  346. package/node_modules/@pierre/diffs/node_modules/@shikijs/engine-javascript/package.json +2 -2
  347. package/node_modules/@pierre/diffs/node_modules/@shikijs/engine-oniguruma/package.json +2 -2
  348. package/node_modules/@pierre/diffs/node_modules/@shikijs/primitive/dist/index.d.mts +0 -1
  349. package/node_modules/@pierre/diffs/node_modules/@shikijs/primitive/package.json +3 -3
  350. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/catppuccin-frappe.mjs +1 -1
  351. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/catppuccin-latte.mjs +1 -1
  352. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/catppuccin-macchiato.mjs +1 -1
  353. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/catppuccin-mocha.mjs +1 -1
  354. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/kanagawa-dragon.mjs +1 -1
  355. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/kanagawa-lotus.mjs +1 -1
  356. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/kanagawa-wave.mjs +1 -1
  357. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/monokai.mjs +1 -1
  358. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/red.mjs +1 -1
  359. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/rose-pine-dawn.mjs +1 -1
  360. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/rose-pine-moon.mjs +1 -1
  361. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/rose-pine.mjs +1 -1
  362. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/solarized-dark.mjs +1 -1
  363. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/dist/solarized-light.mjs +1 -1
  364. package/node_modules/@pierre/diffs/node_modules/@shikijs/themes/package.json +3 -3
  365. package/node_modules/@pierre/diffs/node_modules/@shikijs/transformers/dist/index.d.mts +0 -1
  366. package/node_modules/@pierre/diffs/node_modules/@shikijs/transformers/dist/index.mjs +2 -1
  367. package/node_modules/@pierre/diffs/node_modules/@shikijs/transformers/package.json +3 -3
  368. package/node_modules/@pierre/diffs/node_modules/@shikijs/types/dist/index.d.mts +0 -1
  369. package/node_modules/@pierre/diffs/node_modules/@shikijs/types/package.json +2 -2
  370. package/node_modules/@pierre/diffs/node_modules/shiki/dist/bundle-full.d.mts +4 -7
  371. package/node_modules/@pierre/diffs/node_modules/shiki/dist/bundle-full.mjs +3 -19
  372. package/node_modules/@pierre/diffs/node_modules/shiki/dist/bundle-web.d.mts +5 -6
  373. package/node_modules/@pierre/diffs/node_modules/shiki/dist/bundle-web.mjs +7 -0
  374. package/node_modules/@pierre/diffs/node_modules/shiki/dist/core-CaxrMD1A.d.mts +1 -0
  375. package/node_modules/@pierre/diffs/node_modules/shiki/dist/core.d.mts +1 -0
  376. package/node_modules/@pierre/diffs/node_modules/shiki/dist/index.d.mts +3 -9
  377. package/node_modules/@pierre/diffs/node_modules/shiki/dist/index.mjs +3 -24
  378. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/actionscript.d.mts +1 -0
  379. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/actionscript.mjs +1 -0
  380. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/ahk.d.mts +1 -0
  381. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/ahk.mjs +1 -0
  382. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/ahk1.d.mts +1 -0
  383. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/ahk1.mjs +1 -0
  384. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/ahk2.d.mts +1 -0
  385. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/ahk2.mjs +1 -0
  386. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/as3.d.mts +1 -0
  387. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/as3.mjs +1 -0
  388. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/chapel.d.mts +1 -0
  389. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/chapel.mjs +1 -0
  390. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/chpl.d.mts +1 -0
  391. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/chpl.mjs +1 -0
  392. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/justfile.d.mts +1 -0
  393. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/justfile.mjs +1 -0
  394. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/nsis.d.mts +1 -0
  395. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/nsis.mjs +1 -0
  396. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/org.d.mts +1 -0
  397. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/org.mjs +1 -0
  398. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/pwsh.d.mts +1 -0
  399. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/pwsh.mjs +1 -0
  400. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/rbs.d.mts +1 -0
  401. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/rbs.mjs +1 -0
  402. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/ruby-signature.d.mts +1 -0
  403. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/ruby-signature.mjs +1 -0
  404. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/smithy.d.mts +1 -0
  405. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs/smithy.mjs +1 -0
  406. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs-B38xGbib.d.mts +1 -0
  407. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs-bundle-full-B4n9xYHw.d.mts +13 -0
  408. package/node_modules/@pierre/diffs/node_modules/shiki/dist/{langs-bundle-full-4noeO3oH.mjs → langs-bundle-full-xQVO1Cek.mjs} +48 -5
  409. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs.d.mts +2 -1
  410. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs.mjs +1 -1
  411. package/node_modules/@pierre/diffs/node_modules/shiki/dist/{themes-NeZbxnKu.d.mts → themes-BKdFAJ1v.d.mts} +0 -1
  412. package/node_modules/@pierre/diffs/node_modules/shiki/dist/themes.d.mts +1 -1
  413. package/node_modules/@pierre/diffs/node_modules/shiki/dist/types.d.mts +3 -3
  414. package/node_modules/@pierre/diffs/node_modules/shiki/package.json +10 -10
  415. package/node_modules/@pierre/diffs/package.json +13 -4
  416. package/node_modules/@shikijs/langs/dist/actionscript-3.mjs +1 -1
  417. package/node_modules/@shikijs/langs/dist/actionscript.d.mts +3 -0
  418. package/node_modules/@shikijs/langs/dist/actionscript.mjs +2 -0
  419. package/node_modules/@shikijs/langs/dist/ahk.d.mts +3 -0
  420. package/node_modules/@shikijs/langs/dist/ahk.mjs +5 -0
  421. package/node_modules/@shikijs/langs/dist/ahk1.d.mts +3 -0
  422. package/node_modules/@shikijs/langs/dist/ahk1.mjs +2 -0
  423. package/node_modules/@shikijs/langs/dist/ahk2.d.mts +3 -0
  424. package/node_modules/@shikijs/langs/dist/ahk2.mjs +5 -0
  425. package/node_modules/@shikijs/langs/dist/apex.mjs +1 -1
  426. package/node_modules/@shikijs/langs/dist/as3.d.mts +3 -0
  427. package/node_modules/@shikijs/langs/dist/as3.mjs +2 -0
  428. package/node_modules/@shikijs/langs/dist/asciidoc.mjs +1 -1
  429. package/node_modules/@shikijs/langs/dist/bat.mjs +1 -1
  430. package/node_modules/@shikijs/langs/dist/bird2.mjs +1 -1
  431. package/node_modules/@shikijs/langs/dist/bsl.mjs +1 -1
  432. package/node_modules/@shikijs/langs/dist/c3.mjs +1 -1
  433. package/node_modules/@shikijs/langs/dist/chapel.d.mts +3 -0
  434. package/node_modules/@shikijs/langs/dist/chapel.mjs +8 -0
  435. package/node_modules/@shikijs/langs/dist/chpl.d.mts +3 -0
  436. package/node_modules/@shikijs/langs/dist/chpl.mjs +2 -0
  437. package/node_modules/@shikijs/langs/dist/clarity.mjs +1 -1
  438. package/node_modules/@shikijs/langs/dist/cmd.mjs +2 -2
  439. package/node_modules/@shikijs/langs/dist/coq.mjs +1 -1
  440. package/node_modules/@shikijs/langs/dist/cpp-macro.mjs +1 -3
  441. package/node_modules/@shikijs/langs/dist/cpp.mjs +1 -3
  442. package/node_modules/@shikijs/langs/dist/emacs-lisp.mjs +1 -1
  443. package/node_modules/@shikijs/langs/dist/gdscript.mjs +1 -1
  444. package/node_modules/@shikijs/langs/dist/hack.mjs +1 -1
  445. package/node_modules/@shikijs/langs/dist/haxe.mjs +1 -1
  446. package/node_modules/@shikijs/langs/dist/hxml.mjs +1 -1
  447. package/node_modules/@shikijs/langs/dist/index.mjs +14 -0
  448. package/node_modules/@shikijs/langs/dist/just.mjs +1 -1
  449. package/node_modules/@shikijs/langs/dist/justfile.d.mts +3 -0
  450. package/node_modules/@shikijs/langs/dist/justfile.mjs +2 -0
  451. package/node_modules/@shikijs/langs/dist/llvm.mjs +1 -1
  452. package/node_modules/@shikijs/langs/dist/luau.mjs +1 -1
  453. package/node_modules/@shikijs/langs/dist/mdc.mjs +1 -1
  454. package/node_modules/@shikijs/langs/dist/mermaid.mjs +1 -1
  455. package/node_modules/@shikijs/langs/dist/mojo.mjs +1 -1
  456. package/node_modules/@shikijs/langs/dist/moonbit.mjs +1 -1
  457. package/node_modules/@shikijs/langs/dist/move.mjs +1 -1
  458. package/node_modules/@shikijs/langs/dist/nsis.d.mts +3 -0
  459. package/node_modules/@shikijs/langs/dist/nsis.mjs +5 -0
  460. package/node_modules/@shikijs/langs/dist/nushell.mjs +1 -1
  461. package/node_modules/@shikijs/langs/dist/org.d.mts +3 -0
  462. package/node_modules/@shikijs/langs/dist/org.mjs +100 -0
  463. package/node_modules/@shikijs/langs/dist/powershell.mjs +1 -1
  464. package/node_modules/@shikijs/langs/dist/prisma.mjs +1 -1
  465. package/node_modules/@shikijs/langs/dist/pwsh.d.mts +3 -0
  466. package/node_modules/@shikijs/langs/dist/pwsh.mjs +2 -0
  467. package/node_modules/@shikijs/langs/dist/r.mjs +1 -1
  468. package/node_modules/@shikijs/langs/dist/rbs.d.mts +3 -0
  469. package/node_modules/@shikijs/langs/dist/rbs.mjs +5 -0
  470. package/node_modules/@shikijs/langs/dist/ruby-signature.d.mts +3 -0
  471. package/node_modules/@shikijs/langs/dist/ruby-signature.mjs +2 -0
  472. package/node_modules/@shikijs/langs/dist/scala.mjs +1 -1
  473. package/node_modules/@shikijs/langs/dist/smalltalk.mjs +1 -1
  474. package/node_modules/@shikijs/langs/dist/smithy.d.mts +3 -0
  475. package/node_modules/@shikijs/langs/dist/smithy.mjs +5 -0
  476. package/node_modules/@shikijs/langs/dist/solidity.mjs +1 -1
  477. package/node_modules/@shikijs/langs/dist/surrealql.mjs +1 -1
  478. package/node_modules/@shikijs/langs/dist/swift.mjs +1 -1
  479. package/node_modules/@shikijs/langs/dist/system-verilog.mjs +1 -1
  480. package/node_modules/@shikijs/langs/dist/twig.mjs +1 -1
  481. package/node_modules/@shikijs/langs/dist/typst.mjs +116 -1
  482. package/node_modules/@shikijs/langs/dist/v.mjs +1 -1
  483. package/node_modules/@shikijs/langs/dist/vb.mjs +1 -1
  484. package/node_modules/@shikijs/langs/dist/verilog.mjs +1 -1
  485. package/node_modules/@shikijs/langs/dist/vue.mjs +1 -1
  486. package/node_modules/@shikijs/langs/node_modules/@shikijs/types/dist/index.d.mts +0 -1
  487. package/node_modules/@shikijs/langs/node_modules/@shikijs/types/package.json +2 -2
  488. package/node_modules/@shikijs/langs/package.json +18 -4
  489. package/node_modules/typebox/build/format/date.d.mts +1 -1
  490. package/node_modules/typebox/build/format/date.mjs +1 -1
  491. package/node_modules/typebox/build/format/date_time.d.mts +2 -2
  492. package/node_modules/typebox/build/format/date_time.mjs +3 -3
  493. package/node_modules/typebox/build/format/email.d.mts +1 -1
  494. package/node_modules/typebox/build/format/email.mjs +2 -2
  495. package/node_modules/typebox/build/format/hostname.mjs +2 -10
  496. package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
  497. package/node_modules/typebox/build/format/idn_email.mjs +3 -3
  498. package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
  499. package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
  500. package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
  501. package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
  502. package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
  503. package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
  504. package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
  505. package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
  506. package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
  507. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +41 -0
  508. package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
  509. package/node_modules/typebox/build/format/idna/index.mjs +2 -0
  510. package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
  511. package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
  512. package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
  513. package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
  514. package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
  515. package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
  516. package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
  517. package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
  518. package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
  519. package/node_modules/typebox/build/format/ipv4.mjs +2 -32
  520. package/node_modules/typebox/build/format/ipv6.mjs +2 -61
  521. package/node_modules/typebox/build/format/iri.d.mts +2 -2
  522. package/node_modules/typebox/build/format/iri.mjs +26 -8
  523. package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
  524. package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
  525. package/node_modules/typebox/build/format/regex.d.mts +1 -2
  526. package/node_modules/typebox/build/format/regex.mjs +2 -6
  527. package/node_modules/typebox/build/format/time.d.mts +2 -2
  528. package/node_modules/typebox/build/format/time.mjs +19 -14
  529. package/node_modules/typebox/build/format/uri.d.mts +1 -1
  530. package/node_modules/typebox/build/format/uri.mjs +3 -130
  531. package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
  532. package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
  533. package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
  534. package/node_modules/typebox/build/format/uri_template.mjs +4 -5
  535. package/node_modules/typebox/build/format/url.d.mts +3 -3
  536. package/node_modules/typebox/build/format/url.mjs +4 -5
  537. package/node_modules/typebox/build/guard/emit.d.mts +3 -1
  538. package/node_modules/typebox/build/guard/emit.mjs +12 -5
  539. package/node_modules/typebox/build/guard/guard.d.mts +8 -2
  540. package/node_modules/typebox/build/guard/guard.mjs +25 -4
  541. package/node_modules/typebox/build/guard/string.d.mts +2 -2
  542. package/node_modules/typebox/build/guard/string.mjs +7 -7
  543. package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
  544. package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
  545. package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
  546. package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
  547. package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
  548. package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
  549. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
  550. package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
  551. package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
  552. package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
  553. package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
  554. package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
  555. package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
  556. package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
  557. package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
  558. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
  559. package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
  560. package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
  561. package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
  562. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
  563. package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
  564. package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
  565. package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
  566. package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
  567. package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
  568. package/node_modules/typebox/build/schema/types/index.mjs +0 -2
  569. package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
  570. package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
  571. package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
  572. package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
  573. package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
  574. package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
  575. package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
  576. package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
  577. package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
  578. package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
  579. package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
  580. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
  581. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
  582. package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
  583. package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
  584. package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
  585. package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
  586. package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
  587. package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
  588. package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
  589. package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
  590. package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
  591. package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
  592. package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
  593. package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
  594. package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
  595. package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
  596. package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
  597. package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
  598. package/node_modules/typebox/build/type/script/parser.mjs +27 -23
  599. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
  600. package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
  601. package/node_modules/typebox/package.json +27 -27
  602. package/node_modules/typebox/readme.md +79 -82
  603. package/package.json +9 -8
  604. package/node_modules/@pierre/diffs/dist/utils/iterateOverFile.d.ts +0 -50
  605. package/node_modules/@pierre/diffs/dist/utils/iterateOverFile.d.ts.map +0 -1
  606. package/node_modules/@pierre/diffs/dist/utils/iterateOverFile.js +0 -49
  607. package/node_modules/@pierre/diffs/dist/utils/iterateOverFile.js.map +0 -1
  608. package/node_modules/@pierre/diffs/node_modules/shiki/dist/core-BVVgDSdq.d.mts +0 -1
  609. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs-BVVgDSdq.d.mts +0 -1
  610. package/node_modules/@pierre/diffs/node_modules/shiki/dist/langs-bundle-full-WSWgUeqW.d.mts +0 -14
  611. package/node_modules/typebox/build/format/_idna.d.mts +0 -2
  612. package/node_modules/typebox/build/format/_idna.mjs +0 -246
  613. package/node_modules/typebox/build/format/_puny.d.mts +0 -1
  614. package/node_modules/typebox/build/format/_puny.mjs +0 -77
  615. package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
  616. package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
  617. package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
  618. package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
  619. package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
  620. package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
@@ -310,6 +310,8 @@ const EXTENSION_TO_FILE_FORMAT = {
310
310
  tfvars: "tfvars",
311
311
  toml: "toml",
312
312
  ts: "typescript",
313
+ mts: "typescript",
314
+ cts: "typescript",
313
315
  tsp: "typespec",
314
316
  tsv: "tsv",
315
317
  tsx: "tsx",
@@ -1 +1 @@
1
- {"version":3,"file":"getFiletypeFromFileName.js","names":[],"sources":["../../src/utils/getFiletypeFromFileName.ts"],"sourcesContent":["import type { ExtensionFormatMap, SupportedLanguages } from '../types';\n\nconst CUSTOM_EXTENSION_TO_FILE_FORMAT: Map<string, SupportedLanguages> =\n new Map();\n\nlet customExtensionsVersion = 0;\n\nexport const EXTENSION_TO_FILE_FORMAT: ExtensionFormatMap = {\n '1c': '1c',\n abap: 'abap',\n as: 'actionscript-3',\n ada: 'ada',\n adb: 'ada',\n ads: 'ada',\n adoc: 'asciidoc',\n asciidoc: 'asciidoc',\n 'component.html': 'angular-html',\n 'component.ts': 'angular-ts',\n conf: 'nginx',\n htaccess: 'apache',\n cls: 'tex',\n trigger: 'apex',\n apl: 'apl',\n applescript: 'applescript',\n scpt: 'applescript',\n ara: 'ara',\n asm: 'asm',\n s: 'riscv',\n astro: 'astro',\n awk: 'awk',\n bal: 'ballerina',\n sh: 'zsh',\n bash: 'zsh',\n bat: 'cmd',\n cmd: 'cmd',\n be: 'berry',\n beancount: 'beancount',\n bib: 'bibtex',\n bicep: 'bicep',\n 'blade.php': 'blade',\n bsl: 'bsl',\n c: 'c',\n h: 'objective-cpp',\n cs: 'csharp',\n cpp: 'cpp',\n hpp: 'cpp',\n cc: 'cpp',\n cxx: 'cpp',\n hh: 'cpp',\n cdc: 'cdc',\n cairo: 'cairo',\n clar: 'clarity',\n clj: 'clojure',\n cljs: 'clojure',\n cljc: 'clojure',\n soy: 'soy',\n cmake: 'cmake',\n 'CMakeLists.txt': 'cmake',\n cob: 'cobol',\n cbl: 'cobol',\n cobol: 'cobol',\n CODEOWNERS: 'codeowners',\n ql: 'ql',\n coffee: 'coffeescript',\n lisp: 'lisp',\n cl: 'lisp',\n lsp: 'lisp',\n log: 'log',\n v: 'verilog',\n cql: 'cql',\n cr: 'crystal',\n css: 'css',\n csv: 'csv',\n cue: 'cue',\n cypher: 'cypher',\n cyp: 'cypher',\n d: 'd',\n dart: 'dart',\n dax: 'dax',\n desktop: 'desktop',\n diff: 'diff',\n patch: 'diff',\n Dockerfile: 'dockerfile',\n dockerfile: 'dockerfile',\n env: 'dotenv',\n dm: 'dream-maker',\n edge: 'edge',\n el: 'emacs-lisp',\n ex: 'elixir',\n exs: 'elixir',\n elm: 'elm',\n erb: 'erb',\n erl: 'erlang',\n hrl: 'erlang',\n f: 'fortran-fixed-form',\n for: 'fortran-fixed-form',\n fs: 'fsharp',\n fsi: 'fsharp',\n fsx: 'fsharp',\n f03: 'f03',\n f08: 'f08',\n f18: 'f18',\n f77: 'f77',\n f90: 'fortran-free-form',\n f95: 'fortran-free-form',\n fnl: 'fennel',\n fish: 'fish',\n ftl: 'ftl',\n tres: 'gdresource',\n res: 'gdresource',\n gd: 'gdscript',\n gdshader: 'gdshader',\n gs: 'genie',\n feature: 'gherkin',\n COMMIT_EDITMSG: 'git-commit',\n 'git-rebase-todo': 'git-rebase',\n gjs: 'glimmer-js',\n gleam: 'gleam',\n gts: 'glimmer-ts',\n glsl: 'glsl',\n vert: 'glsl',\n frag: 'glsl',\n shader: 'shaderlab',\n gp: 'gnuplot',\n plt: 'gnuplot',\n gnuplot: 'gnuplot',\n go: 'go',\n graphql: 'graphql',\n gql: 'graphql',\n groovy: 'groovy',\n gvy: 'groovy',\n hack: 'hack',\n haml: 'haml',\n hbs: 'handlebars',\n handlebars: 'handlebars',\n hs: 'haskell',\n lhs: 'haskell',\n hx: 'haxe',\n hcl: 'hcl',\n hjson: 'hjson',\n hlsl: 'hlsl',\n fx: 'hlsl',\n html: 'html',\n htm: 'html',\n http: 'http',\n rest: 'http',\n hxml: 'hxml',\n hy: 'hy',\n imba: 'imba',\n ini: 'ini',\n cfg: 'ini',\n jade: 'pug',\n pug: 'pug',\n java: 'java',\n js: 'javascript',\n mjs: 'javascript',\n cjs: 'javascript',\n jinja: 'jinja',\n jinja2: 'jinja',\n j2: 'jinja',\n jison: 'jison',\n jl: 'julia',\n json: 'json',\n json5: 'json5',\n jsonc: 'jsonc',\n jsonl: 'jsonl',\n jsonnet: 'jsonnet',\n libsonnet: 'jsonnet',\n jssm: 'jssm',\n jsx: 'jsx',\n kt: 'kotlin',\n kts: 'kts',\n kql: 'kusto',\n tex: 'tex',\n ltx: 'tex',\n lean: 'lean4',\n less: 'less',\n liquid: 'liquid',\n lit: 'lit',\n ll: 'llvm',\n logo: 'logo',\n lua: 'lua',\n luau: 'luau',\n Makefile: 'makefile',\n mk: 'makefile',\n makefile: 'makefile',\n md: 'markdown',\n markdown: 'markdown',\n marko: 'marko',\n m: 'wolfram',\n mat: 'matlab',\n mdc: 'mdc',\n mdx: 'mdx',\n wiki: 'wikitext',\n mediawiki: 'wikitext',\n mmd: 'mermaid',\n mermaid: 'mermaid',\n mips: 'mipsasm',\n mojo: 'mojo',\n '🔥': 'mojo',\n move: 'move',\n nar: 'narrat',\n nf: 'nextflow',\n nim: 'nim',\n nims: 'nim',\n nimble: 'nim',\n nix: 'nix',\n nu: 'nushell',\n mm: 'objective-cpp',\n ml: 'ocaml',\n mli: 'ocaml',\n mll: 'ocaml',\n mly: 'ocaml',\n pas: 'pascal',\n p: 'pascal',\n pl: 'prolog',\n pm: 'perl',\n t: 'perl',\n raku: 'raku',\n p6: 'raku',\n pl6: 'raku',\n php: 'php',\n phtml: 'php',\n pls: 'plsql',\n sql: 'sql',\n po: 'po',\n polar: 'polar',\n pcss: 'postcss',\n pot: 'pot',\n potx: 'potx',\n pq: 'powerquery',\n pqm: 'powerquery',\n ps1: 'powershell',\n psm1: 'powershell',\n psd1: 'powershell',\n prisma: 'prisma',\n pro: 'prolog',\n P: 'prolog',\n properties: 'properties',\n proto: 'protobuf',\n pp: 'puppet',\n purs: 'purescript',\n py: 'python',\n pyw: 'python',\n pyi: 'python',\n qml: 'qml',\n qmldir: 'qmldir',\n qss: 'qss',\n r: 'r',\n R: 'r',\n rkt: 'racket',\n rktl: 'racket',\n razor: 'razor',\n cshtml: 'razor',\n rb: 'ruby',\n rbw: 'ruby',\n reg: 'reg',\n regex: 'regexp',\n rel: 'rel',\n rs: 'rust',\n rst: 'rst',\n rake: 'ruby',\n gemspec: 'ruby',\n jbuilder: 'ruby',\n builder: 'ruby',\n rabl: 'ruby',\n arb: 'ruby',\n ru: 'ruby',\n podspec: 'ruby',\n Gemfile: 'ruby',\n Rakefile: 'ruby',\n Guardfile: 'ruby',\n Capfile: 'ruby',\n Berksfile: 'ruby',\n Brewfile: 'ruby',\n Vagrantfile: 'ruby',\n Thorfile: 'ruby',\n Appraisals: 'ruby',\n Dangerfile: 'ruby',\n sas: 'sas',\n sass: 'sass',\n scala: 'scala',\n sc: 'scala',\n scm: 'scheme',\n ss: 'scheme',\n sld: 'scheme',\n scss: 'scss',\n sdbl: 'sdbl',\n shadergraph: 'shader',\n st: 'smalltalk',\n sol: 'solidity',\n sparql: 'sparql',\n rq: 'sparql',\n spl: 'splunk',\n config: 'ssh-config',\n do: 'stata',\n ado: 'stata',\n dta: 'stata',\n styl: 'stylus',\n stylus: 'stylus',\n svelte: 'svelte',\n swift: 'swift',\n sv: 'system-verilog',\n svh: 'system-verilog',\n service: 'systemd',\n socket: 'systemd',\n device: 'systemd',\n timer: 'systemd',\n talon: 'talonscript',\n tasl: 'tasl',\n tcl: 'tcl',\n templ: 'templ',\n tf: 'tf',\n tfvars: 'tfvars',\n toml: 'toml',\n ts: 'typescript',\n tsp: 'typespec',\n tsv: 'tsv',\n tsx: 'tsx',\n ttl: 'turtle',\n twig: 'twig',\n typ: 'typst',\n vv: 'v',\n vala: 'vala',\n vapi: 'vala',\n vb: 'vb',\n vbs: 'vb',\n bas: 'vb',\n vh: 'verilog',\n vhd: 'vhdl',\n vhdl: 'vhdl',\n vim: 'vimscript',\n vue: 'vue',\n 'vine.ts': 'vue-vine',\n vy: 'vyper',\n wasm: 'wasm',\n wat: 'wasm',\n wy: '文言',\n wgsl: 'wgsl',\n wit: 'wit',\n wl: 'wolfram',\n nb: 'wolfram',\n xml: 'xml',\n xsl: 'xsl',\n xslt: 'xsl',\n yaml: 'yaml',\n yml: 'yml',\n zs: 'zenscript',\n zig: 'zig',\n zsh: 'zsh',\n sty: 'tex',\n};\n\nexport function getFiletypeFromFileName(fileName: string): SupportedLanguages {\n if (CUSTOM_EXTENSION_TO_FILE_FORMAT.has(fileName)) {\n return CUSTOM_EXTENSION_TO_FILE_FORMAT.get(fileName) ?? 'text';\n }\n // Handle special files without extensions first\n if (EXTENSION_TO_FILE_FORMAT[fileName] != null) {\n return EXTENSION_TO_FILE_FORMAT[fileName];\n }\n\n // Try compound extensions first (e.g., .blade.php, .component.ts)\n const compoundMatch = fileName.match(/\\.([^/\\\\]+\\.[^/\\\\]+)$/);\n if (compoundMatch != null) {\n if (CUSTOM_EXTENSION_TO_FILE_FORMAT.has(compoundMatch[1])) {\n return CUSTOM_EXTENSION_TO_FILE_FORMAT.get(compoundMatch[1]) ?? 'text';\n }\n if (EXTENSION_TO_FILE_FORMAT[compoundMatch[1]] != null) {\n return EXTENSION_TO_FILE_FORMAT[compoundMatch[1]] ?? 'text';\n }\n }\n\n // Fall back to simple extension\n const simpleMatch = fileName.match(/\\.([^.]+)$/)?.[1] ?? '';\n if (CUSTOM_EXTENSION_TO_FILE_FORMAT.has(simpleMatch)) {\n return CUSTOM_EXTENSION_TO_FILE_FORMAT.get(simpleMatch) ?? 'text';\n }\n return EXTENSION_TO_FILE_FORMAT[simpleMatch] ?? 'text';\n}\n\nexport function replaceCustomExtensions(\n version: number,\n map: ExtensionFormatMap\n): boolean {\n if (version <= customExtensionsVersion) {\n return false;\n }\n CUSTOM_EXTENSION_TO_FILE_FORMAT.clear();\n for (const key in map) {\n const lang = map[key];\n if (lang != null) {\n CUSTOM_EXTENSION_TO_FILE_FORMAT.set(key, lang);\n }\n }\n customExtensionsVersion = version;\n return true;\n}\n\nexport function getCustomExtensionsVersion(): number {\n return customExtensionsVersion;\n}\n\nexport function setCustomExtension(\n key: string,\n lang: SupportedLanguages\n): boolean {\n const existing = CUSTOM_EXTENSION_TO_FILE_FORMAT.get(key);\n if (existing === lang) {\n return false;\n }\n if (existing != null) {\n console.warn(\n `setCustomExtension: overriding custom mapping for \"${key}\" from \"${existing}\" to \"${lang}\"`\n );\n }\n CUSTOM_EXTENSION_TO_FILE_FORMAT.set(key, lang);\n customExtensionsVersion++;\n return true;\n}\n\nexport function getCustomExtensionsMap(): ExtensionFormatMap {\n return Object.fromEntries(\n CUSTOM_EXTENSION_TO_FILE_FORMAT\n ) as ExtensionFormatMap;\n}\n"],"mappings":";AAEA,MAAM,kDACJ,IAAI,IAAI;AAEV,IAAI,0BAA0B;AAE9B,MAAa,2BAA+C;CAC1D,MAAM;CACN,MAAM;CACN,IAAI;CACJ,KAAK;CACL,KAAK;CACL,KAAK;CACL,MAAM;CACN,UAAU;CACV,kBAAkB;CAClB,gBAAgB;CAChB,MAAM;CACN,UAAU;CACV,KAAK;CACL,SAAS;CACT,KAAK;CACL,aAAa;CACb,MAAM;CACN,KAAK;CACL,KAAK;CACL,GAAG;CACH,OAAO;CACP,KAAK;CACL,KAAK;CACL,IAAI;CACJ,MAAM;CACN,KAAK;CACL,KAAK;CACL,IAAI;CACJ,WAAW;CACX,KAAK;CACL,OAAO;CACP,aAAa;CACb,KAAK;CACL,GAAG;CACH,GAAG;CACH,IAAI;CACJ,KAAK;CACL,KAAK;CACL,IAAI;CACJ,KAAK;CACL,IAAI;CACJ,KAAK;CACL,OAAO;CACP,MAAM;CACN,KAAK;CACL,MAAM;CACN,MAAM;CACN,KAAK;CACL,OAAO;CACP,kBAAkB;CAClB,KAAK;CACL,KAAK;CACL,OAAO;CACP,YAAY;CACZ,IAAI;CACJ,QAAQ;CACR,MAAM;CACN,IAAI;CACJ,KAAK;CACL,KAAK;CACL,GAAG;CACH,KAAK;CACL,IAAI;CACJ,KAAK;CACL,KAAK;CACL,KAAK;CACL,QAAQ;CACR,KAAK;CACL,GAAG;CACH,MAAM;CACN,KAAK;CACL,SAAS;CACT,MAAM;CACN,OAAO;CACP,YAAY;CACZ,YAAY;CACZ,KAAK;CACL,IAAI;CACJ,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,GAAG;CACH,KAAK;CACL,IAAI;CACJ,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,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sDAAsD,IAAI,UAAU,SAAS,QAAQ,KAAK,EAC5F;CAEF,gCAAgC,IAAI,KAAK,IAAI;CAC7C;CACA,OAAO;AACT;AAEA,SAAgB,yBAA6C;CAC3D,OAAO,OAAO,YACZ,+BACF;AACF"}
1
+ {"version":3,"file":"getFiletypeFromFileName.js","names":[],"sources":["../../src/utils/getFiletypeFromFileName.ts"],"sourcesContent":["import type { ExtensionFormatMap, SupportedLanguages } from '../types';\n\nconst CUSTOM_EXTENSION_TO_FILE_FORMAT: Map<string, SupportedLanguages> =\n new Map();\n\nlet customExtensionsVersion = 0;\n\nexport const EXTENSION_TO_FILE_FORMAT: ExtensionFormatMap = {\n '1c': '1c',\n abap: 'abap',\n as: 'actionscript-3',\n ada: 'ada',\n adb: 'ada',\n ads: 'ada',\n adoc: 'asciidoc',\n asciidoc: 'asciidoc',\n 'component.html': 'angular-html',\n 'component.ts': 'angular-ts',\n conf: 'nginx',\n htaccess: 'apache',\n cls: 'tex',\n trigger: 'apex',\n apl: 'apl',\n applescript: 'applescript',\n scpt: 'applescript',\n ara: 'ara',\n asm: 'asm',\n s: 'riscv',\n astro: 'astro',\n awk: 'awk',\n bal: 'ballerina',\n sh: 'zsh',\n bash: 'zsh',\n bat: 'cmd',\n cmd: 'cmd',\n be: 'berry',\n beancount: 'beancount',\n bib: 'bibtex',\n bicep: 'bicep',\n 'blade.php': 'blade',\n bsl: 'bsl',\n c: 'c',\n h: 'objective-cpp',\n cs: 'csharp',\n cpp: 'cpp',\n hpp: 'cpp',\n cc: 'cpp',\n cxx: 'cpp',\n hh: 'cpp',\n cdc: 'cdc',\n cairo: 'cairo',\n clar: 'clarity',\n clj: 'clojure',\n cljs: 'clojure',\n cljc: 'clojure',\n soy: 'soy',\n cmake: 'cmake',\n 'CMakeLists.txt': 'cmake',\n cob: 'cobol',\n cbl: 'cobol',\n cobol: 'cobol',\n CODEOWNERS: 'codeowners',\n ql: 'ql',\n coffee: 'coffeescript',\n lisp: 'lisp',\n cl: 'lisp',\n lsp: 'lisp',\n log: 'log',\n v: 'verilog',\n cql: 'cql',\n cr: 'crystal',\n css: 'css',\n csv: 'csv',\n cue: 'cue',\n cypher: 'cypher',\n cyp: 'cypher',\n d: 'd',\n dart: 'dart',\n dax: 'dax',\n desktop: 'desktop',\n diff: 'diff',\n patch: 'diff',\n Dockerfile: 'dockerfile',\n dockerfile: 'dockerfile',\n env: 'dotenv',\n dm: 'dream-maker',\n edge: 'edge',\n el: 'emacs-lisp',\n ex: 'elixir',\n exs: 'elixir',\n elm: 'elm',\n erb: 'erb',\n erl: 'erlang',\n hrl: 'erlang',\n f: 'fortran-fixed-form',\n for: 'fortran-fixed-form',\n fs: 'fsharp',\n fsi: 'fsharp',\n fsx: 'fsharp',\n f03: 'f03',\n f08: 'f08',\n f18: 'f18',\n f77: 'f77',\n f90: 'fortran-free-form',\n f95: 'fortran-free-form',\n fnl: 'fennel',\n fish: 'fish',\n ftl: 'ftl',\n tres: 'gdresource',\n res: 'gdresource',\n gd: 'gdscript',\n gdshader: 'gdshader',\n gs: 'genie',\n feature: 'gherkin',\n COMMIT_EDITMSG: 'git-commit',\n 'git-rebase-todo': 'git-rebase',\n gjs: 'glimmer-js',\n gleam: 'gleam',\n gts: 'glimmer-ts',\n glsl: 'glsl',\n vert: 'glsl',\n frag: 'glsl',\n shader: 'shaderlab',\n gp: 'gnuplot',\n plt: 'gnuplot',\n gnuplot: 'gnuplot',\n go: 'go',\n graphql: 'graphql',\n gql: 'graphql',\n groovy: 'groovy',\n gvy: 'groovy',\n hack: 'hack',\n haml: 'haml',\n hbs: 'handlebars',\n handlebars: 'handlebars',\n hs: 'haskell',\n lhs: 'haskell',\n hx: 'haxe',\n hcl: 'hcl',\n hjson: 'hjson',\n hlsl: 'hlsl',\n fx: 'hlsl',\n html: 'html',\n htm: 'html',\n http: 'http',\n rest: 'http',\n hxml: 'hxml',\n hy: 'hy',\n imba: 'imba',\n ini: 'ini',\n cfg: 'ini',\n jade: 'pug',\n pug: 'pug',\n java: 'java',\n js: 'javascript',\n mjs: 'javascript',\n cjs: 'javascript',\n jinja: 'jinja',\n jinja2: 'jinja',\n j2: 'jinja',\n jison: 'jison',\n jl: 'julia',\n json: 'json',\n json5: 'json5',\n jsonc: 'jsonc',\n jsonl: 'jsonl',\n jsonnet: 'jsonnet',\n libsonnet: 'jsonnet',\n jssm: 'jssm',\n jsx: 'jsx',\n kt: 'kotlin',\n kts: 'kts',\n kql: 'kusto',\n tex: 'tex',\n ltx: 'tex',\n lean: 'lean4',\n less: 'less',\n liquid: 'liquid',\n lit: 'lit',\n ll: 'llvm',\n logo: 'logo',\n lua: 'lua',\n luau: 'luau',\n Makefile: 'makefile',\n mk: 'makefile',\n makefile: 'makefile',\n md: 'markdown',\n markdown: 'markdown',\n marko: 'marko',\n m: 'wolfram',\n mat: 'matlab',\n mdc: 'mdc',\n mdx: 'mdx',\n wiki: 'wikitext',\n mediawiki: 'wikitext',\n mmd: 'mermaid',\n mermaid: 'mermaid',\n mips: 'mipsasm',\n mojo: 'mojo',\n '🔥': 'mojo',\n move: 'move',\n nar: 'narrat',\n nf: 'nextflow',\n nim: 'nim',\n nims: 'nim',\n nimble: 'nim',\n nix: 'nix',\n nu: 'nushell',\n mm: 'objective-cpp',\n ml: 'ocaml',\n mli: 'ocaml',\n mll: 'ocaml',\n mly: 'ocaml',\n pas: 'pascal',\n p: 'pascal',\n pl: 'prolog',\n pm: 'perl',\n t: 'perl',\n raku: 'raku',\n p6: 'raku',\n pl6: 'raku',\n php: 'php',\n phtml: 'php',\n pls: 'plsql',\n sql: 'sql',\n po: 'po',\n polar: 'polar',\n pcss: 'postcss',\n pot: 'pot',\n potx: 'potx',\n pq: 'powerquery',\n pqm: 'powerquery',\n ps1: 'powershell',\n psm1: 'powershell',\n psd1: 'powershell',\n prisma: 'prisma',\n pro: 'prolog',\n P: 'prolog',\n properties: 'properties',\n proto: 'protobuf',\n pp: 'puppet',\n purs: 'purescript',\n py: 'python',\n pyw: 'python',\n pyi: 'python',\n qml: 'qml',\n qmldir: 'qmldir',\n qss: 'qss',\n r: 'r',\n R: 'r',\n rkt: 'racket',\n rktl: 'racket',\n razor: 'razor',\n cshtml: 'razor',\n rb: 'ruby',\n rbw: 'ruby',\n reg: 'reg',\n regex: 'regexp',\n rel: 'rel',\n rs: 'rust',\n rst: 'rst',\n rake: 'ruby',\n gemspec: 'ruby',\n jbuilder: 'ruby',\n builder: 'ruby',\n rabl: 'ruby',\n arb: 'ruby',\n ru: 'ruby',\n podspec: 'ruby',\n Gemfile: 'ruby',\n Rakefile: 'ruby',\n Guardfile: 'ruby',\n Capfile: 'ruby',\n Berksfile: 'ruby',\n Brewfile: 'ruby',\n Vagrantfile: 'ruby',\n Thorfile: 'ruby',\n Appraisals: 'ruby',\n Dangerfile: 'ruby',\n sas: 'sas',\n sass: 'sass',\n scala: 'scala',\n sc: 'scala',\n scm: 'scheme',\n ss: 'scheme',\n sld: 'scheme',\n scss: 'scss',\n sdbl: 'sdbl',\n shadergraph: 'shader',\n st: 'smalltalk',\n sol: 'solidity',\n sparql: 'sparql',\n rq: 'sparql',\n spl: 'splunk',\n config: 'ssh-config',\n do: 'stata',\n ado: 'stata',\n dta: 'stata',\n styl: 'stylus',\n stylus: 'stylus',\n svelte: 'svelte',\n swift: 'swift',\n sv: 'system-verilog',\n svh: 'system-verilog',\n service: 'systemd',\n socket: 'systemd',\n device: 'systemd',\n timer: 'systemd',\n talon: 'talonscript',\n tasl: 'tasl',\n tcl: 'tcl',\n templ: 'templ',\n tf: 'tf',\n tfvars: 'tfvars',\n toml: 'toml',\n ts: 'typescript',\n mts: 'typescript',\n cts: 'typescript',\n tsp: 'typespec',\n tsv: 'tsv',\n tsx: 'tsx',\n ttl: 'turtle',\n twig: 'twig',\n typ: 'typst',\n vv: 'v',\n vala: 'vala',\n vapi: 'vala',\n vb: 'vb',\n vbs: 'vb',\n bas: 'vb',\n vh: 'verilog',\n vhd: 'vhdl',\n vhdl: 'vhdl',\n vim: 'vimscript',\n vue: 'vue',\n 'vine.ts': 'vue-vine',\n vy: 'vyper',\n wasm: 'wasm',\n wat: 'wasm',\n wy: '文言',\n wgsl: 'wgsl',\n wit: 'wit',\n wl: 'wolfram',\n nb: 'wolfram',\n xml: 'xml',\n xsl: 'xsl',\n xslt: 'xsl',\n yaml: 'yaml',\n yml: 'yml',\n zs: 'zenscript',\n zig: 'zig',\n zsh: 'zsh',\n sty: 'tex',\n};\n\nexport function getFiletypeFromFileName(fileName: string): SupportedLanguages {\n if (CUSTOM_EXTENSION_TO_FILE_FORMAT.has(fileName)) {\n return CUSTOM_EXTENSION_TO_FILE_FORMAT.get(fileName) ?? 'text';\n }\n // Handle special files without extensions first\n if (EXTENSION_TO_FILE_FORMAT[fileName] != null) {\n return EXTENSION_TO_FILE_FORMAT[fileName];\n }\n\n // Try compound extensions first (e.g., .blade.php, .component.ts)\n const compoundMatch = fileName.match(/\\.([^/\\\\]+\\.[^/\\\\]+)$/);\n if (compoundMatch != null) {\n if (CUSTOM_EXTENSION_TO_FILE_FORMAT.has(compoundMatch[1])) {\n return CUSTOM_EXTENSION_TO_FILE_FORMAT.get(compoundMatch[1]) ?? 'text';\n }\n if (EXTENSION_TO_FILE_FORMAT[compoundMatch[1]] != null) {\n return EXTENSION_TO_FILE_FORMAT[compoundMatch[1]] ?? 'text';\n }\n }\n\n // Fall back to simple extension\n const simpleMatch = fileName.match(/\\.([^.]+)$/)?.[1] ?? '';\n if (CUSTOM_EXTENSION_TO_FILE_FORMAT.has(simpleMatch)) {\n return CUSTOM_EXTENSION_TO_FILE_FORMAT.get(simpleMatch) ?? 'text';\n }\n return EXTENSION_TO_FILE_FORMAT[simpleMatch] ?? 'text';\n}\n\nexport function replaceCustomExtensions(\n version: number,\n map: ExtensionFormatMap\n): boolean {\n if (version <= customExtensionsVersion) {\n return false;\n }\n CUSTOM_EXTENSION_TO_FILE_FORMAT.clear();\n for (const key in map) {\n const lang = map[key];\n if (lang != null) {\n CUSTOM_EXTENSION_TO_FILE_FORMAT.set(key, lang);\n }\n }\n customExtensionsVersion = version;\n return true;\n}\n\nexport function getCustomExtensionsVersion(): number {\n return customExtensionsVersion;\n}\n\nexport function setCustomExtension(\n key: string,\n lang: SupportedLanguages\n): boolean {\n const existing = CUSTOM_EXTENSION_TO_FILE_FORMAT.get(key);\n if (existing === lang) {\n return false;\n }\n if (existing != null) {\n console.warn(\n `setCustomExtension: overriding custom mapping for \"${key}\" from \"${existing}\" to \"${lang}\"`\n );\n }\n CUSTOM_EXTENSION_TO_FILE_FORMAT.set(key, lang);\n customExtensionsVersion++;\n return true;\n}\n\nexport function getCustomExtensionsMap(): ExtensionFormatMap {\n return Object.fromEntries(\n CUSTOM_EXTENSION_TO_FILE_FORMAT\n ) as ExtensionFormatMap;\n}\n"],"mappings":";AAEA,MAAM,kDACJ,IAAI,IAAI;AAEV,IAAI,0BAA0B;AAE9B,MAAa,2BAA+C;CAC1D,MAAM;CACN,MAAM;CACN,IAAI;CACJ,KAAK;CACL,KAAK;CACL,KAAK;CACL,MAAM;CACN,UAAU;CACV,kBAAkB;CAClB,gBAAgB;CAChB,MAAM;CACN,UAAU;CACV,KAAK;CACL,SAAS;CACT,KAAK;CACL,aAAa;CACb,MAAM;CACN,KAAK;CACL,KAAK;CACL,GAAG;CACH,OAAO;CACP,KAAK;CACL,KAAK;CACL,IAAI;CACJ,MAAM;CACN,KAAK;CACL,KAAK;CACL,IAAI;CACJ,WAAW;CACX,KAAK;CACL,OAAO;CACP,aAAa;CACb,KAAK;CACL,GAAG;CACH,GAAG;CACH,IAAI;CACJ,KAAK;CACL,KAAK;CACL,IAAI;CACJ,KAAK;CACL,IAAI;CACJ,KAAK;CACL,OAAO;CACP,MAAM;CACN,KAAK;CACL,MAAM;CACN,MAAM;CACN,KAAK;CACL,OAAO;CACP,kBAAkB;CAClB,KAAK;CACL,KAAK;CACL,OAAO;CACP,YAAY;CACZ,IAAI;CACJ,QAAQ;CACR,MAAM;CACN,IAAI;CACJ,KAAK;CACL,KAAK;CACL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,yBAAyB,gBAAgB;AAClD;AAEA,SAAgB,wBACd,SACA,KACS;CACT,IAAI,WAAW,yBACb,OAAO;CAET,gCAAgC,MAAM;CACtC,KAAK,MAAM,OAAO,KAAK;EACrB,MAAM,OAAO,IAAI;EACjB,IAAI,QAAQ,MACV,gCAAgC,IAAI,KAAK,IAAI;CAEjD;CACA,0BAA0B;CAC1B,OAAO;AACT;AAEA,SAAgB,6BAAqC;CACnD,OAAO;AACT;AAEA,SAAgB,mBACd,KACA,MACS;CACT,MAAM,WAAW,gCAAgC,IAAI,GAAG;CACxD,IAAI,aAAa,MACf,OAAO;CAET,IAAI,YAAY,MACd,QAAQ,KACN,sDAAsD,IAAI,UAAU,SAAS,QAAQ,KAAK,EAC5F;CAEF,gCAAgC,IAAI,KAAK,IAAI;CAC7C;CACA,OAAO;AACT;AAEA,SAAgB,yBAA6C;CAC3D,OAAO,OAAO,YACZ,+BACF;AACF"}
@@ -0,0 +1,7 @@
1
+ //#region src/utils/getHunkSideBoundaries.d.ts
2
+ /** Converts a unified hunk side's start/count into its consumed-file range. */
3
+ declare function getHunkSideStartBoundary(start: number, count: number): number;
4
+ declare function getHunkSideEndBoundary(start: number, count: number): number;
5
+ //#endregion
6
+ export { getHunkSideEndBoundary, getHunkSideStartBoundary };
7
+ //# sourceMappingURL=getHunkSideBoundaries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getHunkSideBoundaries.d.ts","names":[],"sources":["../../src/utils/getHunkSideBoundaries.ts"],"mappings":";;iBACgB,wBAAA,CAAyB,KAAA,UAAe,KAAa;AAAA,iBAIrD,sBAAA,CAAuB,KAAA,UAAe,KAAa"}
@@ -0,0 +1,12 @@
1
+ //#region src/utils/getHunkSideBoundaries.ts
2
+ /** Converts a unified hunk side's start/count into its consumed-file range. */
3
+ function getHunkSideStartBoundary(start, count) {
4
+ return start - (count === 0 ? 0 : 1);
5
+ }
6
+ function getHunkSideEndBoundary(start, count) {
7
+ return getHunkSideStartBoundary(start, count) + count;
8
+ }
9
+ //#endregion
10
+ export { getHunkSideEndBoundary, getHunkSideStartBoundary };
11
+
12
+ //# sourceMappingURL=getHunkSideBoundaries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getHunkSideBoundaries.js","names":[],"sources":["../../src/utils/getHunkSideBoundaries.ts"],"sourcesContent":["/** Converts a unified hunk side's start/count into its consumed-file range. */\nexport function getHunkSideStartBoundary(start: number, count: number): number {\n return start - (count === 0 ? 0 : 1);\n}\n\nexport function getHunkSideEndBoundary(start: number, count: number): number {\n return getHunkSideStartBoundary(start, count) + count;\n}\n"],"mappings":";;AACA,SAAgB,yBAAyB,OAAe,OAAuB;CAC7E,OAAO,SAAS,UAAU,IAAI,IAAI;AACpC;AAEA,SAAgB,uBAAuB,OAAe,OAAuB;CAC3E,OAAO,yBAAyB,OAAO,KAAK,IAAI;AAClD"}
@@ -1 +1 @@
1
- {"version":3,"file":"getTotalLineCountFromHunks.d.ts","names":[],"sources":["../../src/utils/getTotalLineCountFromHunks.ts"],"mappings":";;;iBAEgB,0BAAA,CAA2B,KAAa,EAAN,IAAI"}
1
+ {"version":3,"file":"getTotalLineCountFromHunks.d.ts","names":[],"sources":["../../src/utils/getTotalLineCountFromHunks.ts"],"mappings":";;;iBAGgB,0BAAA,CAA2B,KAAa,EAAN,IAAI"}
@@ -1,8 +1,9 @@
1
+ import { getHunkSideEndBoundary } from "./getHunkSideBoundaries.js";
1
2
  //#region src/utils/getTotalLineCountFromHunks.ts
2
3
  function getTotalLineCountFromHunks(hunks) {
3
4
  const lastHunk = hunks.at(-1);
4
5
  if (lastHunk == null) return 0;
5
- return Math.max(lastHunk.additionStart + lastHunk.additionCount, lastHunk.deletionStart + lastHunk.deletionCount);
6
+ return Math.max(getHunkSideEndBoundary(lastHunk.additionStart, lastHunk.additionCount), getHunkSideEndBoundary(lastHunk.deletionStart, lastHunk.deletionCount));
6
7
  }
7
8
  //#endregion
8
9
  export { getTotalLineCountFromHunks };
@@ -1 +1 @@
1
- {"version":3,"file":"getTotalLineCountFromHunks.js","names":[],"sources":["../../src/utils/getTotalLineCountFromHunks.ts"],"sourcesContent":["import type { Hunk } from '../types';\n\nexport function getTotalLineCountFromHunks(hunks: Hunk[]): number {\n const lastHunk = hunks.at(-1);\n if (lastHunk == null) {\n return 0;\n }\n return Math.max(\n lastHunk.additionStart + lastHunk.additionCount,\n lastHunk.deletionStart + lastHunk.deletionCount\n );\n}\n"],"mappings":";AAEA,SAAgB,2BAA2B,OAAuB;CAChE,MAAM,WAAW,MAAM,GAAG,EAAE;CAC5B,IAAI,YAAY,MACd,OAAO;CAET,OAAO,KAAK,IACV,SAAS,gBAAgB,SAAS,eAClC,SAAS,gBAAgB,SAAS,aACpC;AACF"}
1
+ {"version":3,"file":"getTotalLineCountFromHunks.js","names":[],"sources":["../../src/utils/getTotalLineCountFromHunks.ts"],"sourcesContent":["import type { Hunk } from '../types';\nimport { getHunkSideEndBoundary } from './getHunkSideBoundaries';\n\nexport function getTotalLineCountFromHunks(hunks: Hunk[]): number {\n const lastHunk = hunks.at(-1);\n if (lastHunk == null) {\n return 0;\n }\n return Math.max(\n getHunkSideEndBoundary(lastHunk.additionStart, lastHunk.additionCount),\n getHunkSideEndBoundary(lastHunk.deletionStart, lastHunk.deletionCount)\n );\n}\n"],"mappings":";;AAGA,SAAgB,2BAA2B,OAAuB;CAChE,MAAM,WAAW,MAAM,GAAG,EAAE;CAC5B,IAAI,YAAY,MACd,OAAO;CAET,OAAO,KAAK,IACV,uBAAuB,SAAS,eAAe,SAAS,aAAa,GACrE,uBAAuB,SAAS,eAAe,SAAS,aAAa,CACvE;AACF"}
@@ -0,0 +1,20 @@
1
+ //#region src/utils/guardWebKitScrollDuringRebuild.d.ts
2
+ /**
3
+ * Runs a wholesale code-column rebuild with the pre element's height pinned,
4
+ * working around a WebKit bug (https://bugs.webkit.org/show_bug.cgi?id=308027):
5
+ * when the subtree of a `container-type: inline-size` element is rewritten in
6
+ * bulk (column innerHTML swaps, grid-row span rewrites), WebKit resolves the
7
+ * ancestor scroller's offset against a transiently collapsed interim layout
8
+ * and clamps scrollTop to 0 — the scroller visibly jumps to the top on every
9
+ * edit. Pinning `min-height` keeps that interim layout at full height so the
10
+ * scroll offset survives; the layout read before unpinning is required, since
11
+ * it materializes the interim layout while the pin is active.
12
+ *
13
+ * Both the pin height read and the pinned-layout read force a synchronous
14
+ * layout, so callers own the gating via shouldGuardRebuildScroll: Safari-only,
15
+ * edit-mode-only, and never inside CodeView's batched read/write render pass.
16
+ */
17
+ declare function guardWebKitScrollDuringRebuild(pre: HTMLElement | undefined, rebuild: () => void): void;
18
+ //#endregion
19
+ export { guardWebKitScrollDuringRebuild };
20
+ //# sourceMappingURL=guardWebKitScrollDuringRebuild.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guardWebKitScrollDuringRebuild.d.ts","names":[],"sources":["../../src/utils/guardWebKitScrollDuringRebuild.ts"],"mappings":";;AAeA;;;;;;;;AAEqB;;;;;;iBAFL,8BAAA,CACd,GAAA,EAAK,WAAW,cAChB,OAAA"}
@@ -0,0 +1,34 @@
1
+ //#region src/utils/guardWebKitScrollDuringRebuild.ts
2
+ /**
3
+ * Runs a wholesale code-column rebuild with the pre element's height pinned,
4
+ * working around a WebKit bug (https://bugs.webkit.org/show_bug.cgi?id=308027):
5
+ * when the subtree of a `container-type: inline-size` element is rewritten in
6
+ * bulk (column innerHTML swaps, grid-row span rewrites), WebKit resolves the
7
+ * ancestor scroller's offset against a transiently collapsed interim layout
8
+ * and clamps scrollTop to 0 — the scroller visibly jumps to the top on every
9
+ * edit. Pinning `min-height` keeps that interim layout at full height so the
10
+ * scroll offset survives; the layout read before unpinning is required, since
11
+ * it materializes the interim layout while the pin is active.
12
+ *
13
+ * Both the pin height read and the pinned-layout read force a synchronous
14
+ * layout, so callers own the gating via shouldGuardRebuildScroll: Safari-only,
15
+ * edit-mode-only, and never inside CodeView's batched read/write render pass.
16
+ */
17
+ function guardWebKitScrollDuringRebuild(pre, rebuild) {
18
+ const height = pre?.offsetHeight ?? 0;
19
+ if (pre == null || height === 0) {
20
+ rebuild();
21
+ return;
22
+ }
23
+ pre.style.minHeight = `${height}px`;
24
+ try {
25
+ rebuild();
26
+ pre.offsetHeight;
27
+ } finally {
28
+ pre.style.minHeight = "";
29
+ }
30
+ }
31
+ //#endregion
32
+ export { guardWebKitScrollDuringRebuild };
33
+
34
+ //# sourceMappingURL=guardWebKitScrollDuringRebuild.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guardWebKitScrollDuringRebuild.js","names":[],"sources":["../../src/utils/guardWebKitScrollDuringRebuild.ts"],"sourcesContent":["/**\n * Runs a wholesale code-column rebuild with the pre element's height pinned,\n * working around a WebKit bug (https://bugs.webkit.org/show_bug.cgi?id=308027):\n * when the subtree of a `container-type: inline-size` element is rewritten in\n * bulk (column innerHTML swaps, grid-row span rewrites), WebKit resolves the\n * ancestor scroller's offset against a transiently collapsed interim layout\n * and clamps scrollTop to 0 — the scroller visibly jumps to the top on every\n * edit. Pinning `min-height` keeps that interim layout at full height so the\n * scroll offset survives; the layout read before unpinning is required, since\n * it materializes the interim layout while the pin is active.\n *\n * Both the pin height read and the pinned-layout read force a synchronous\n * layout, so callers own the gating via shouldGuardRebuildScroll: Safari-only,\n * edit-mode-only, and never inside CodeView's batched read/write render pass.\n */\nexport function guardWebKitScrollDuringRebuild(\n pre: HTMLElement | undefined,\n rebuild: () => void\n): void {\n const height = pre?.offsetHeight ?? 0;\n if (pre == null || height === 0) {\n rebuild();\n return;\n }\n pre.style.minHeight = `${height}px`;\n try {\n rebuild();\n void pre.offsetHeight;\n } finally {\n pre.style.minHeight = '';\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,SAAgB,+BACd,KACA,SACM;CACN,MAAM,SAAS,KAAK,gBAAgB;CACpC,IAAI,OAAO,QAAQ,WAAW,GAAG;EAC/B,QAAQ;EACR;CACF;CACA,IAAI,MAAM,YAAY,GAAG,OAAO;CAChC,IAAI;EACF,QAAQ;EACR,IAAS;CACX,UAAU;EACR,IAAI,MAAM,YAAY;CACxB;AACF"}
@@ -0,0 +1,10 @@
1
+ import { FileDiffLoadedFiles, FileDiffMetadata } from "../types.js";
2
+
3
+ //#region src/utils/hydratePartialDiff.d.ts
4
+ /**
5
+ * Hydrates a partial diff in place with full file line arrays.
6
+ */
7
+ declare function hydratePartialDiff(type: 'clone' | 'merge', fileDiff: FileDiffMetadata, files: FileDiffLoadedFiles): FileDiffMetadata;
8
+ //#endregion
9
+ export { hydratePartialDiff };
10
+ //# sourceMappingURL=hydratePartialDiff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hydratePartialDiff.d.ts","names":[],"sources":["../../src/utils/hydratePartialDiff.ts"],"mappings":";;;;;AAsBA;iBAAgB,kBAAA,CACd,IAAA,qBACA,QAAA,EAAU,gBAAA,EACV,KAAA,EAAO,mBAAA,GACN,gBAAA"}
@@ -0,0 +1,141 @@
1
+ import { getHunkSideEndBoundary, getHunkSideStartBoundary } from "./getHunkSideBoundaries.js";
2
+ import { cloneFileDiffMetadata } from "./cloneFileDiffMetadata.js";
3
+ import { splitFileContents } from "./splitFileContents.js";
4
+ //#region src/utils/hydratePartialDiff.ts
5
+ /**
6
+ * Hydrates a partial diff in place with full file line arrays.
7
+ */
8
+ function hydratePartialDiff(type, fileDiff, files) {
9
+ const targetFileDiff = type === "clone" ? cloneFileDiffMetadata(fileDiff) : fileDiff;
10
+ if (!targetFileDiff.isPartial) throw new Error("hydratePartialDiff: fileDiff must be partial");
11
+ switch (targetFileDiff.type) {
12
+ case "change":
13
+ case "rename-changed": return hydrateTwoSidedFileDiff(targetFileDiff, requireOldFile(targetFileDiff, files), requireNewFile(targetFileDiff, files));
14
+ case "rename-pure": {
15
+ const newFile = requireNewFile(targetFileDiff, files);
16
+ requireMissingOldFile(targetFileDiff, files);
17
+ const lines = splitFileContents(newFile.contents);
18
+ targetFileDiff.isPartial = false;
19
+ targetFileDiff.deletionLines = lines;
20
+ targetFileDiff.additionLines = lines;
21
+ setHydratedCacheKey(targetFileDiff, null, newFile);
22
+ return targetFileDiff;
23
+ }
24
+ }
25
+ throw new Error(`hydratePartialDiff: ${targetFileDiff.type} diffs cannot be hydrated from loaded files`);
26
+ }
27
+ function hydrateTwoSidedFileDiff(fileDiff, oldFile, newFile) {
28
+ const deletionLines = splitFileContents(oldFile.contents);
29
+ const additionLines = splitFileContents(newFile.contents);
30
+ const { hunks, splitLineCount, unifiedLineCount } = hydrateHunks(fileDiff.hunks, additionLines.length);
31
+ fileDiff.hunks = hunks;
32
+ fileDiff.splitLineCount = splitLineCount;
33
+ fileDiff.unifiedLineCount = unifiedLineCount;
34
+ fileDiff.isPartial = false;
35
+ fileDiff.deletionLines = deletionLines;
36
+ fileDiff.additionLines = additionLines;
37
+ setHydratedCacheKey(fileDiff, oldFile, newFile);
38
+ return fileDiff;
39
+ }
40
+ function hydrateHunks(hunks, totalAdditionLines) {
41
+ let splitLineCount = 0;
42
+ let unifiedLineCount = 0;
43
+ let lastHunkAdditionEnd = 0;
44
+ const hydratedHunks = [];
45
+ for (const hunk of hunks) {
46
+ const additionLineIndex = Math.max(hunk.additionStart - 1, 0);
47
+ const deletionLineIndex = Math.max(hunk.deletionStart - 1, 0);
48
+ let contentAdditionLineIndex = additionLineIndex;
49
+ let contentDeletionLineIndex = deletionLineIndex;
50
+ let hunkAdditionLines = 0;
51
+ let hunkDeletionLines = 0;
52
+ let hunkSplitLineCount = 0;
53
+ let hunkUnifiedLineCount = 0;
54
+ const hunkContent = [];
55
+ for (const content of hunk.hunkContent) {
56
+ if (content.type === "context") {
57
+ hunkContent.push({
58
+ ...content,
59
+ additionLineIndex: contentAdditionLineIndex,
60
+ deletionLineIndex: contentDeletionLineIndex
61
+ });
62
+ contentAdditionLineIndex += content.lines;
63
+ contentDeletionLineIndex += content.lines;
64
+ hunkSplitLineCount += content.lines;
65
+ hunkUnifiedLineCount += content.lines;
66
+ continue;
67
+ }
68
+ hunkContent.push({
69
+ ...content,
70
+ additionLineIndex: contentAdditionLineIndex,
71
+ deletionLineIndex: contentDeletionLineIndex
72
+ });
73
+ contentAdditionLineIndex += content.additions;
74
+ contentDeletionLineIndex += content.deletions;
75
+ hunkAdditionLines += content.additions;
76
+ hunkDeletionLines += content.deletions;
77
+ hunkSplitLineCount += Math.max(content.additions, content.deletions);
78
+ hunkUnifiedLineCount += content.additions + content.deletions;
79
+ }
80
+ const collapsedBefore = Math.max(getHunkSideStartBoundary(hunk.additionStart, hunk.additionCount) - lastHunkAdditionEnd, 0);
81
+ hydratedHunks.push({
82
+ ...hunk,
83
+ collapsedBefore,
84
+ additionLineIndex,
85
+ deletionLineIndex,
86
+ additionLines: hunkAdditionLines,
87
+ deletionLines: hunkDeletionLines,
88
+ hunkContent,
89
+ splitLineStart: splitLineCount + collapsedBefore,
90
+ unifiedLineStart: unifiedLineCount + collapsedBefore,
91
+ splitLineCount: hunkSplitLineCount,
92
+ unifiedLineCount: hunkUnifiedLineCount
93
+ });
94
+ splitLineCount += collapsedBefore + hunkSplitLineCount;
95
+ unifiedLineCount += collapsedBefore + hunkUnifiedLineCount;
96
+ lastHunkAdditionEnd = getHunkSideEndBoundary(hunk.additionStart, hunk.additionCount);
97
+ }
98
+ if (hydratedHunks.length > 0) {
99
+ const lastHunk = hydratedHunks[hydratedHunks.length - 1];
100
+ const lastHunkEnd = getHunkSideEndBoundary(lastHunk.additionStart, lastHunk.additionCount);
101
+ const collapsedAfter = Math.max(totalAdditionLines - lastHunkEnd, 0);
102
+ splitLineCount += collapsedAfter;
103
+ unifiedLineCount += collapsedAfter;
104
+ }
105
+ return {
106
+ hunks: hydratedHunks,
107
+ splitLineCount,
108
+ unifiedLineCount
109
+ };
110
+ }
111
+ function requireOldFile(fileDiff, files) {
112
+ if (files.oldFile == null) throw new Error(`hydratePartialDiff: ${fileDiff.type} diff for ${fileDiff.name} requires oldFile`);
113
+ return files.oldFile;
114
+ }
115
+ function requireNewFile(fileDiff, files) {
116
+ if (files.newFile == null) throw new Error(`hydratePartialDiff: ${fileDiff.type} diff for ${fileDiff.name} requires newFile`);
117
+ return files.newFile;
118
+ }
119
+ function requireMissingOldFile(fileDiff, files) {
120
+ if (files.oldFile !== null) throw new Error(`hydratePartialDiff: ${fileDiff.type} diff for ${fileDiff.name} requires oldFile to be null`);
121
+ }
122
+ function getHydratedCacheKey(fileDiff, oldFile, newFile) {
123
+ if (fileDiff.cacheKey != null) return `${fileDiff.cacheKey}:hydrated`;
124
+ return getLoadedFileCacheKey(oldFile, newFile);
125
+ }
126
+ function setHydratedCacheKey(fileDiff, oldFile, newFile) {
127
+ const cacheKey = getHydratedCacheKey(fileDiff, oldFile, newFile);
128
+ if (cacheKey == null) {
129
+ delete fileDiff.cacheKey;
130
+ return;
131
+ }
132
+ fileDiff.cacheKey = cacheKey;
133
+ }
134
+ function getLoadedFileCacheKey(oldFile, newFile) {
135
+ if (oldFile != null && newFile != null) return oldFile.cacheKey != null && newFile.cacheKey != null ? `${oldFile.cacheKey}:${newFile.cacheKey}` : void 0;
136
+ return oldFile?.cacheKey ?? newFile?.cacheKey;
137
+ }
138
+ //#endregion
139
+ export { hydratePartialDiff };
140
+
141
+ //# sourceMappingURL=hydratePartialDiff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hydratePartialDiff.js","names":[],"sources":["../../src/utils/hydratePartialDiff.ts"],"sourcesContent":["import type {\n FileContents,\n FileDiffLoadedFiles,\n FileDiffMetadata,\n Hunk,\n} from '../types';\nimport { cloneFileDiffMetadata } from './cloneFileDiffMetadata';\nimport {\n getHunkSideEndBoundary,\n getHunkSideStartBoundary,\n} from './getHunkSideBoundaries';\nimport { splitFileContents } from './splitFileContents';\n\ninterface HydratedHunksResult {\n hunks: Hunk[];\n splitLineCount: number;\n unifiedLineCount: number;\n}\n\n/**\n * Hydrates a partial diff in place with full file line arrays.\n */\nexport function hydratePartialDiff(\n type: 'clone' | 'merge',\n fileDiff: FileDiffMetadata,\n files: FileDiffLoadedFiles\n): FileDiffMetadata {\n const targetFileDiff =\n type === 'clone' ? cloneFileDiffMetadata(fileDiff) : fileDiff;\n\n if (!targetFileDiff.isPartial) {\n throw new Error('hydratePartialDiff: fileDiff must be partial');\n }\n\n switch (targetFileDiff.type) {\n case 'change':\n case 'rename-changed': {\n const oldFile = requireOldFile(targetFileDiff, files);\n const newFile = requireNewFile(targetFileDiff, files);\n return hydrateTwoSidedFileDiff(targetFileDiff, oldFile, newFile);\n }\n case 'rename-pure': {\n const newFile = requireNewFile(targetFileDiff, files);\n requireMissingOldFile(targetFileDiff, files);\n const lines = splitFileContents(newFile.contents);\n targetFileDiff.isPartial = false;\n targetFileDiff.deletionLines = lines;\n targetFileDiff.additionLines = lines;\n setHydratedCacheKey(targetFileDiff, null, newFile);\n return targetFileDiff;\n }\n }\n throw new Error(\n `hydratePartialDiff: ${targetFileDiff.type} diffs cannot be hydrated from loaded files`\n );\n}\n\nfunction hydrateTwoSidedFileDiff(\n fileDiff: FileDiffMetadata,\n oldFile: FileContents,\n newFile: FileContents\n): FileDiffMetadata {\n const deletionLines = splitFileContents(oldFile.contents);\n const additionLines = splitFileContents(newFile.contents);\n const { hunks, splitLineCount, unifiedLineCount } = hydrateHunks(\n fileDiff.hunks,\n additionLines.length\n );\n\n fileDiff.hunks = hunks;\n fileDiff.splitLineCount = splitLineCount;\n fileDiff.unifiedLineCount = unifiedLineCount;\n fileDiff.isPartial = false;\n fileDiff.deletionLines = deletionLines;\n fileDiff.additionLines = additionLines;\n setHydratedCacheKey(fileDiff, oldFile, newFile);\n return fileDiff;\n}\n\nfunction hydrateHunks(\n hunks: Hunk[],\n totalAdditionLines: number\n): HydratedHunksResult {\n let splitLineCount = 0;\n let unifiedLineCount = 0;\n let lastHunkAdditionEnd = 0;\n\n const hydratedHunks: Hunk[] = [];\n\n for (const hunk of hunks) {\n const additionLineIndex = Math.max(hunk.additionStart - 1, 0);\n const deletionLineIndex = Math.max(hunk.deletionStart - 1, 0);\n let contentAdditionLineIndex = additionLineIndex;\n let contentDeletionLineIndex = deletionLineIndex;\n let hunkAdditionLines = 0;\n let hunkDeletionLines = 0;\n let hunkSplitLineCount = 0;\n let hunkUnifiedLineCount = 0;\n const hunkContent: Hunk['hunkContent'] = [];\n\n for (const content of hunk.hunkContent) {\n if (content.type === 'context') {\n hunkContent.push({\n ...content,\n additionLineIndex: contentAdditionLineIndex,\n deletionLineIndex: contentDeletionLineIndex,\n });\n contentAdditionLineIndex += content.lines;\n contentDeletionLineIndex += content.lines;\n hunkSplitLineCount += content.lines;\n hunkUnifiedLineCount += content.lines;\n continue;\n }\n\n hunkContent.push({\n ...content,\n additionLineIndex: contentAdditionLineIndex,\n deletionLineIndex: contentDeletionLineIndex,\n });\n contentAdditionLineIndex += content.additions;\n contentDeletionLineIndex += content.deletions;\n hunkAdditionLines += content.additions;\n hunkDeletionLines += content.deletions;\n hunkSplitLineCount += Math.max(content.additions, content.deletions);\n hunkUnifiedLineCount += content.additions + content.deletions;\n }\n\n const collapsedBefore = Math.max(\n getHunkSideStartBoundary(hunk.additionStart, hunk.additionCount) -\n lastHunkAdditionEnd,\n 0\n );\n hydratedHunks.push({\n ...hunk,\n collapsedBefore,\n additionLineIndex,\n deletionLineIndex,\n additionLines: hunkAdditionLines,\n deletionLines: hunkDeletionLines,\n hunkContent,\n splitLineStart: splitLineCount + collapsedBefore,\n unifiedLineStart: unifiedLineCount + collapsedBefore,\n splitLineCount: hunkSplitLineCount,\n unifiedLineCount: hunkUnifiedLineCount,\n });\n\n splitLineCount += collapsedBefore + hunkSplitLineCount;\n unifiedLineCount += collapsedBefore + hunkUnifiedLineCount;\n lastHunkAdditionEnd = getHunkSideEndBoundary(\n hunk.additionStart,\n hunk.additionCount\n );\n }\n\n if (hydratedHunks.length > 0) {\n const lastHunk = hydratedHunks[hydratedHunks.length - 1];\n const lastHunkEnd = getHunkSideEndBoundary(\n lastHunk.additionStart,\n lastHunk.additionCount\n );\n const collapsedAfter = Math.max(totalAdditionLines - lastHunkEnd, 0);\n splitLineCount += collapsedAfter;\n unifiedLineCount += collapsedAfter;\n }\n\n return { hunks: hydratedHunks, splitLineCount, unifiedLineCount };\n}\n\nfunction requireOldFile(\n fileDiff: FileDiffMetadata,\n files: FileDiffLoadedFiles\n): FileContents {\n if (files.oldFile == null) {\n throw new Error(\n `hydratePartialDiff: ${fileDiff.type} diff for ${fileDiff.name} requires oldFile`\n );\n }\n return files.oldFile;\n}\n\nfunction requireNewFile(\n fileDiff: FileDiffMetadata,\n files: FileDiffLoadedFiles\n): FileContents {\n if (files.newFile == null) {\n throw new Error(\n `hydratePartialDiff: ${fileDiff.type} diff for ${fileDiff.name} requires newFile`\n );\n }\n return files.newFile;\n}\n\nfunction requireMissingOldFile(\n fileDiff: FileDiffMetadata,\n files: FileDiffLoadedFiles\n): void {\n if (files.oldFile !== null) {\n throw new Error(\n `hydratePartialDiff: ${fileDiff.type} diff for ${fileDiff.name} requires oldFile to be null`\n );\n }\n}\n\nfunction getHydratedCacheKey(\n fileDiff: FileDiffMetadata,\n oldFile: FileContents | null,\n newFile: FileContents | null\n): string | undefined {\n if (fileDiff.cacheKey != null) {\n return `${fileDiff.cacheKey}:hydrated`;\n }\n return getLoadedFileCacheKey(oldFile, newFile);\n}\n\nfunction setHydratedCacheKey(\n fileDiff: FileDiffMetadata,\n oldFile: FileContents | null,\n newFile: FileContents | null\n): void {\n const cacheKey = getHydratedCacheKey(fileDiff, oldFile, newFile);\n if (cacheKey == null) {\n delete fileDiff.cacheKey;\n return;\n }\n fileDiff.cacheKey = cacheKey;\n}\n\nfunction getLoadedFileCacheKey(\n oldFile: FileContents | null,\n newFile: FileContents | null\n): string | undefined {\n if (oldFile != null && newFile != null) {\n return oldFile.cacheKey != null && newFile.cacheKey != null\n ? `${oldFile.cacheKey}:${newFile.cacheKey}`\n : undefined;\n }\n return oldFile?.cacheKey ?? newFile?.cacheKey;\n}\n"],"mappings":";;;;;;;AAsBA,SAAgB,mBACd,MACA,UACA,OACkB;CAClB,MAAM,iBACJ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AS,KAAK,YAAY,SAAS,KAAK,kBACjE;CAEF,OAAO,MAAM;AACf;AAEA,SAAS,eACP,UACA,OACc;CACd,IAAI,MAAM,WAAW,MACnB,MAAM,IAAI,MACR,uBAAuB,SAAS,KAAK,YAAY,SAAS,KAAK,kBACjE;CAEF,OAAO,MAAM;AACf;AAEA,SAAS,sBACP,UACA,OACM;CACN,IAAI,MAAM,YAAY,MACpB,MAAM,IAAI,MACR,uBAAuB,SAAS,KAAK,YAAY,SAAS,KAAK,6BACjE;AAEJ;AAEA,SAAS,oBACP,UACA,SACA,SACoB;CACpB,IAAI,SAAS,YAAY,MACvB,OAAO,GAAG,SAAS,SAAS;CAE9B,OAAO,sBAAsB,SAAS,OAAO;AAC/C;AAEA,SAAS,oBACP,UACA,SACA,SACM;CACN,MAAM,WAAW,oBAAoB,UAAU,SAAS,OAAO;CAC/D,IAAI,YAAY,MAAM;EACpB,OAAO,SAAS;EAChB;CACF;CACA,SAAS,WAAW;AACtB;AAEA,SAAS,sBACP,SACA,SACoB;CACpB,IAAI,WAAW,QAAQ,WAAW,MAChC,OAAO,QAAQ,YAAY,QAAQ,QAAQ,YAAY,OACnD,GAAG,QAAQ,SAAS,GAAG,QAAQ,aAC/B,KAAA;CAEN,OAAO,SAAS,YAAY,SAAS;AACvC"}
@@ -0,0 +1,5 @@
1
+ //#region src/utils/isGutterUtilityPath.d.ts
2
+ declare function isGutterUtilityPath(path: readonly (EventTarget | undefined)[]): boolean;
3
+ //#endregion
4
+ export { isGutterUtilityPath };
5
+ //# sourceMappingURL=isGutterUtilityPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isGutterUtilityPath.d.ts","names":[],"sources":["../../src/utils/isGutterUtilityPath.ts"],"mappings":";iBAEgB,mBAAA,CACd,IAA0C,YAA1B,WAAW"}
@@ -0,0 +1,12 @@
1
+ //#region src/utils/isGutterUtilityPath.ts
2
+ function isGutterUtilityPath(path) {
3
+ for (const element of path) {
4
+ if (!(element instanceof HTMLElement)) continue;
5
+ if (element.hasAttribute("data-utility-button") || element.hasAttribute("data-gutter-utility-slot") || element.getAttribute("slot") === "gutter-utility-slot" || element.getAttribute("name") === "gutter-utility-slot") return true;
6
+ }
7
+ return false;
8
+ }
9
+ //#endregion
10
+ export { isGutterUtilityPath };
11
+
12
+ //# sourceMappingURL=isGutterUtilityPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isGutterUtilityPath.js","names":[],"sources":["../../src/utils/isGutterUtilityPath.ts"],"sourcesContent":["// Recognize both the built-in utility button and custom content assigned to the\n// gutter utility slot so other pointer handlers leave the gesture untouched.\nexport function isGutterUtilityPath(\n path: readonly (EventTarget | undefined)[]\n): boolean {\n for (const element of path) {\n if (!(element instanceof HTMLElement)) {\n continue;\n }\n if (\n element.hasAttribute('data-utility-button') ||\n element.hasAttribute('data-gutter-utility-slot') ||\n element.getAttribute('slot') === 'gutter-utility-slot' ||\n element.getAttribute('name') === 'gutter-utility-slot'\n ) {\n return true;\n }\n }\n return false;\n}\n"],"mappings":";AAEA,SAAgB,oBACd,MACS;CACT,KAAK,MAAM,WAAW,MAAM;EAC1B,IAAI,EAAE,mBAAmB,cACvB;EAEF,IACE,QAAQ,aAAa,qBAAqB,KAC1C,QAAQ,aAAa,0BAA0B,KAC/C,QAAQ,aAAa,MAAM,MAAM,yBACjC,QAAQ,aAAa,MAAM,MAAM,uBAEjC,OAAO;CAEX;CACA,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"iterateOverDiff.d.ts","names":[],"sources":["../../src/utils/iterateOverDiff.ts"],"mappings":";;;UAYiB,gBAAA;EACf,gBAAA;EACA,cAAA;EACA,SAAA;EACA,UAAA;EACA,OAAA;AAAA;AAAA,UAGe,oBAAA;EACf,SAAA;EACA,IAAA,EAAM,IAAI;EACV,eAAA;EACA,cAAA;AAAA;AAAA,UAGQ,6BAAA,SAAsC,oBAAA;EAC9C,IAAA;EACA,YAAA,EAAc,gBAAA;EACd,YAAA,EAAc,gBA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AA,UAE3C,oBAAA;EACf,IAAA,EAAM,gBAAA;EACN,SAAA,EAAW,SAAA;EACX,YAAA;EACA,UAAA;EACA,aAAA,GAAgB,GAAA,SAAY,mBAAA;EAC5B,yBAAA;EACA,QAAA,EAAU,gBAAA;AAAA;AAAA,iBAGI,eAAA;EACd,IAAA;EACA,SAAA;EACA,YAAA;EACA,UAAA;EACA,aAAA;EACA,yBAAA;EACA;AAAA,GACC,oBAAA"}
@@ -1,4 +1,5 @@
1
1
  import "../constants.js";
2
+ import { getHunkSideStartBoundary } from "./getHunkSideBoundaries.js";
2
3
  import { getExpandedRegion, getTrailingExpandedRegion } from "./virtualDiffLayout.js";
3
4
  //#region src/utils/iterateOverDiff.ts
4
5
  function iterateOverDiff({ diff, diffStyle, startingLine = 0, totalLines = Infinity, expandedHunks, collapsedContextThreshold = 1, callback }) {
@@ -24,10 +25,10 @@ function iterateOverDiff({ diff, diffStyle, startingLine = 0, totalLines = Infin
24
25
  else if (diffStyle === "split") return breakSplit;
25
26
  else return breakUnified && breakSplit;
26
27
  },
27
- shouldSkip(unifiedHeight, splitHeight) {
28
+ shouldSkip(unifiedCount, splitCount) {
28
29
  if (!state.isWindowedHighlight) return false;
29
- const skipUnified = state.unifiedCount + unifiedHeight < startingLine;
30
- const skipSplit = state.splitCount + splitHeight < startingLine;
30
+ const skipUnified = unifiedCount > 0 && state.unifiedCount + unifiedCount <= startingLine;
31
+ const skipSplit = splitCount > 0 && state.splitCount + splitCount <= startingLine;
31
32
  if (diffStyle === "unified") return skipUnified;
32
33
  else if (diffStyle === "split") return skipSplit;
33
34
  else return skipUnified && skipSplit;
@@ -61,6 +62,10 @@ function iterateOverDiff({ diff, diffStyle, startingLine = 0, totalLines = Infin
61
62
  const hunk = diff.hunks[hunkIndex];
62
63
  if (hunk == null) throw new Error("iterateOverDiff: invalid hunk index");
63
64
  if (state.shouldBreak()) break;
65
+ const deletionBoundary = getHunkSideStartBoundary(hunk.deletionStart, hunk.deletionCount);
66
+ const additionBoundary = getHunkSideStartBoundary(hunk.additionStart, hunk.additionCount);
67
+ const deletionStartIndex = !diff.isPartial && hunk.deletionCount === 0 ? deletionBoundary : hunk.deletionLineIndex;
68
+ const additionStartIndex = !diff.isPartial && hunk.additionCount === 0 ? additionBoundary : hunk.additionLineIndex;
64
69
  const leadingRegion = getExpandedRegion({
65
70
  isPartial: diff.isPartial,
66
71
  rangeSize: hunk.collapsedBefore,
@@ -90,10 +95,10 @@ function iterateOverDiff({ diff, diffStyle, startingLine = 0, totalLines = Infin
90
95
  if (!state.shouldSkip(expandedLineCount, expandedLineCount)) {
91
96
  let unifiedLineIndex = hunk.unifiedLineStart - leadingRegion.rangeSize;
92
97
  let splitLineIndex = hunk.splitLineStart - leadingRegion.rangeSize;
93
- let deletionLineIndex = hunk.deletionLineIndex - leadingRegion.rangeSize;
94
- let additionLineIndex = hunk.additionLineIndex - leadingRegion.rangeSize;
95
- let deletionLineNumber = hunk.deletionStart - leadingRegion.rangeSize;
96
- let additionLineNumber = hunk.additionStart - leadingRegion.rangeSize;
98
+ let deletionLineIndex = deletionStartIndex - leadingRegion.rangeSize;
99
+ let additionLineIndex = additionStartIndex - leadingRegion.rangeSize;
100
+ let deletionLineNumber = deletionBoundary + 1 - leadingRegion.rangeSize;
101
+ let additionLineNumber = additionBoundary + 1 - leadingRegion.rangeSize;
97
102
  if (walkContextLines(state, leadingRegion.fromStart, diffStyle, (index) => {
98
103
  return state.emit({
99
104
  hunkIndex,
@@ -119,10 +124,10 @@ function iterateOverDiff({ diff, diffStyle, startingLine = 0, totalLines = Infin
119
124
  })) break hunkIterator;
120
125
  unifiedLineIndex = hunk.unifiedLineStart - leadingRegion.fromEnd;
121
126
  splitLineIndex = hunk.splitLineStart - leadingRegion.fromEnd;
122
- deletionLineIndex = hunk.deletionLineIndex - leadingRegion.fromEnd;
123
- additionLineIndex = hunk.additionLineIndex - leadingRegion.fromEnd;
124
- deletionLineNumber = hunk.deletionStart - leadingRegion.fromEnd;
125
- additionLineNumber = hunk.additionStart - leadingRegion.fromEnd;
127
+ deletionLineIndex = deletionStartIndex - leadingRegion.fromEnd;
128
+ additionLineIndex = additionStartIndex - leadingRegion.fromEnd;
129
+ deletionLineNumber = deletionBoundary + 1 - leadingRegion.fromEnd;
130
+ additionLineNumber = additionBoundary + 1 - leadingRegion.fromEnd;
126
131
  if (walkContextLines(state, leadingRegion.fromEnd, diffStyle, (index) => {
127
132
  return state.emit({
128
133
  hunkIndex,
@@ -154,10 +159,10 @@ function iterateOverDiff({ diff, diffStyle, startingLine = 0, totalLines = Infin
154
159
  }
155
160
  let unifiedLineIndex = hunk.unifiedLineStart;
156
161
  let splitLineIndex = hunk.splitLineStart;
157
- let deletionLineIndex = hunk.deletionLineIndex;
158
- let additionLineIndex = hunk.additionLineIndex;
159
- let deletionLineNumber = hunk.deletionStart;
160
- let additionLineNumber = hunk.additionStart;
162
+ let deletionLineIndex = deletionStartIndex;
163
+ let additionLineIndex = additionStartIndex;
164
+ let deletionLineNumber = deletionBoundary + 1;
165
+ let additionLineNumber = additionBoundary + 1;
161
166
  const lastContent = hunk.hunkContent.at(-1);
162
167
  for (const content of hunk.hunkContent) {
163
168
  if (state.shouldBreak()) break hunkIterator;