@openclaw/diffs 2026.9.5 → 2026.9.6

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 (837) hide show
  1. package/README.md +2 -1
  2. package/dist/assets/viewer-runtime.js +37 -37
  3. package/dist/index.js +42 -16
  4. package/node_modules/@pierre/diffs/dist/components/CodeView.d.ts +4 -4
  5. package/node_modules/@pierre/diffs/dist/components/CodeView.d.ts.map +1 -1
  6. package/node_modules/@pierre/diffs/dist/components/CodeView.js +8 -6
  7. package/node_modules/@pierre/diffs/dist/components/CodeView.js.map +1 -1
  8. package/node_modules/@pierre/diffs/dist/components/File.d.ts +3 -15
  9. package/node_modules/@pierre/diffs/dist/components/File.d.ts.map +1 -1
  10. package/node_modules/@pierre/diffs/dist/components/FileDiff.d.ts +9 -37
  11. package/node_modules/@pierre/diffs/dist/components/FileDiff.d.ts.map +1 -1
  12. package/node_modules/@pierre/diffs/dist/components/FileDiff.js +15 -12
  13. package/node_modules/@pierre/diffs/dist/components/FileDiff.js.map +1 -1
  14. package/node_modules/@pierre/diffs/dist/components/FileStream.d.ts +1 -0
  15. package/node_modules/@pierre/diffs/dist/components/FileStream.d.ts.map +1 -1
  16. package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.d.ts +1 -1
  17. package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.d.ts.map +1 -1
  18. package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.js +2 -1
  19. package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.js.map +1 -1
  20. package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.d.ts +2 -8
  21. package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.d.ts.map +1 -1
  22. package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.js +11 -9
  23. package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.js.map +1 -1
  24. package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.d.ts +2 -8
  25. package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.d.ts.map +1 -1
  26. package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.js +11 -9
  27. package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.js.map +1 -1
  28. package/node_modules/@pierre/diffs/dist/components/Virtualizer.d.ts +1 -5
  29. package/node_modules/@pierre/diffs/dist/components/Virtualizer.d.ts.map +1 -1
  30. package/node_modules/@pierre/diffs/dist/components/Virtualizer.js.map +1 -1
  31. package/node_modules/@pierre/diffs/dist/components/VirtulizerDevelopment.d.ts +0 -1
  32. package/node_modules/@pierre/diffs/dist/components/VirtulizerDevelopment.d.ts.map +1 -1
  33. package/node_modules/@pierre/diffs/dist/components/web-components.d.ts.map +1 -1
  34. package/node_modules/@pierre/diffs/dist/components/web-components.js +2 -1
  35. package/node_modules/@pierre/diffs/dist/components/web-components.js.map +1 -1
  36. package/node_modules/@pierre/diffs/dist/constants.d.ts +0 -1
  37. package/node_modules/@pierre/diffs/dist/constants.d.ts.map +1 -1
  38. package/node_modules/@pierre/diffs/dist/editor/EditStateManager.d.ts +0 -1
  39. package/node_modules/@pierre/diffs/dist/editor/EditStateManager.d.ts.map +1 -1
  40. package/node_modules/@pierre/diffs/dist/editor/EditStateManager.js.map +1 -1
  41. package/node_modules/@pierre/diffs/dist/editor/cloneRetainedDiffSessionSnapshot.d.ts +0 -1
  42. package/node_modules/@pierre/diffs/dist/editor/cloneRetainedDiffSessionSnapshot.d.ts.map +1 -1
  43. package/node_modules/@pierre/diffs/dist/editor/command.d.ts +2 -1
  44. package/node_modules/@pierre/diffs/dist/editor/command.d.ts.map +1 -1
  45. package/node_modules/@pierre/diffs/dist/editor/editPrediction.d.ts +3 -2
  46. package/node_modules/@pierre/diffs/dist/editor/editPrediction.d.ts.map +1 -1
  47. package/node_modules/@pierre/diffs/dist/editor/editPrediction.js +11 -11
  48. package/node_modules/@pierre/diffs/dist/editor/editPrediction.js.map +1 -1
  49. package/node_modules/@pierre/diffs/dist/editor/editStack.d.ts +0 -1
  50. package/node_modules/@pierre/diffs/dist/editor/editStack.d.ts.map +1 -1
  51. package/node_modules/@pierre/diffs/dist/editor/editStack.js.map +1 -1
  52. package/node_modules/@pierre/diffs/dist/editor/editor.d.ts +1 -5
  53. package/node_modules/@pierre/diffs/dist/editor/editor.d.ts.map +1 -1
  54. package/node_modules/@pierre/diffs/dist/editor/editor.js +24 -19
  55. package/node_modules/@pierre/diffs/dist/editor/editor.js.map +1 -1
  56. package/node_modules/@pierre/diffs/dist/editor/editor2.js.map +1 -1
  57. package/node_modules/@pierre/diffs/dist/editor/languages.d.ts +0 -1
  58. package/node_modules/@pierre/diffs/dist/editor/languages.d.ts.map +1 -1
  59. package/node_modules/@pierre/diffs/dist/editor/languages.js +1 -1
  60. package/node_modules/@pierre/diffs/dist/editor/languages.js.map +1 -1
  61. package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.d.ts +0 -1
  62. package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.d.ts.map +1 -1
  63. package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.js +2 -1
  64. package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.js.map +1 -1
  65. package/node_modules/@pierre/diffs/dist/editor/marker.d.ts +0 -1
  66. package/node_modules/@pierre/diffs/dist/editor/marker.d.ts.map +1 -1
  67. package/node_modules/@pierre/diffs/dist/editor/marker.js +5 -3
  68. package/node_modules/@pierre/diffs/dist/editor/marker.js.map +1 -1
  69. package/node_modules/@pierre/diffs/dist/editor/matchBrackets.d.ts +0 -1
  70. package/node_modules/@pierre/diffs/dist/editor/matchBrackets.d.ts.map +1 -1
  71. package/node_modules/@pierre/diffs/dist/editor/pieceTable.d.ts +0 -1
  72. package/node_modules/@pierre/diffs/dist/editor/pieceTable.d.ts.map +1 -1
  73. package/node_modules/@pierre/diffs/dist/editor/pieceTable.js.map +1 -1
  74. package/node_modules/@pierre/diffs/dist/editor/platform.d.ts +1 -5
  75. package/node_modules/@pierre/diffs/dist/editor/platform.d.ts.map +1 -1
  76. package/node_modules/@pierre/diffs/dist/editor/platform.js.map +1 -1
  77. package/node_modules/@pierre/diffs/dist/editor/popover.d.ts +12 -12
  78. package/node_modules/@pierre/diffs/dist/editor/popover.d.ts.map +1 -1
  79. package/node_modules/@pierre/diffs/dist/editor/popover.js.map +1 -1
  80. package/node_modules/@pierre/diffs/dist/editor/searchPanel.d.ts +0 -1
  81. package/node_modules/@pierre/diffs/dist/editor/searchPanel.d.ts.map +1 -1
  82. package/node_modules/@pierre/diffs/dist/editor/searchPanel.js +16 -12
  83. package/node_modules/@pierre/diffs/dist/editor/searchPanel.js.map +1 -1
  84. package/node_modules/@pierre/diffs/dist/editor/selection.d.ts +0 -1
  85. package/node_modules/@pierre/diffs/dist/editor/selection.d.ts.map +1 -1
  86. package/node_modules/@pierre/diffs/dist/editor/selection.js.map +1 -1
  87. package/node_modules/@pierre/diffs/dist/editor/selectionAction.d.ts +0 -1
  88. package/node_modules/@pierre/diffs/dist/editor/selectionAction.d.ts.map +1 -1
  89. package/node_modules/@pierre/diffs/dist/editor/selectionAction.js.map +1 -1
  90. package/node_modules/@pierre/diffs/dist/editor/sprite.d.ts.map +1 -1
  91. package/node_modules/@pierre/diffs/dist/editor/textDocument.d.ts +0 -1
  92. package/node_modules/@pierre/diffs/dist/editor/textDocument.d.ts.map +1 -1
  93. package/node_modules/@pierre/diffs/dist/editor/textDocument.js.map +1 -1
  94. package/node_modules/@pierre/diffs/dist/editor/textDocumentChangeTransaction.d.ts +0 -1
  95. package/node_modules/@pierre/diffs/dist/editor/textDocumentChangeTransaction.d.ts.map +1 -1
  96. package/node_modules/@pierre/diffs/dist/editor/textMeasure.d.ts.map +1 -1
  97. package/node_modules/@pierre/diffs/dist/editor/textMeasure.js.map +1 -1
  98. package/node_modules/@pierre/diffs/dist/editor/tokenizer.d.ts +1 -11
  99. package/node_modules/@pierre/diffs/dist/editor/tokenizer.d.ts.map +1 -1
  100. package/node_modules/@pierre/diffs/dist/editor/tokenizer.js +8 -4
  101. package/node_modules/@pierre/diffs/dist/editor/tokenizer.js.map +1 -1
  102. package/node_modules/@pierre/diffs/dist/editor/types.d.ts +0 -1
  103. package/node_modules/@pierre/diffs/dist/editor/types.d.ts.map +1 -1
  104. package/node_modules/@pierre/diffs/dist/editor/utils.d.ts.map +1 -1
  105. package/node_modules/@pierre/diffs/dist/editor/utils.js +11 -7
  106. package/node_modules/@pierre/diffs/dist/editor/utils.js.map +1 -1
  107. package/node_modules/@pierre/diffs/dist/highlighter/languages/areLanguagesAttached.d.ts +0 -1
  108. package/node_modules/@pierre/diffs/dist/highlighter/languages/areLanguagesAttached.d.ts.map +1 -1
  109. package/node_modules/@pierre/diffs/dist/highlighter/languages/attachResolvedLanguages.d.ts +1 -0
  110. package/node_modules/@pierre/diffs/dist/highlighter/languages/attachResolvedLanguages.d.ts.map +1 -1
  111. package/node_modules/@pierre/diffs/dist/highlighter/languages/cleanUpResolvedLanguages.d.ts.map +1 -1
  112. package/node_modules/@pierre/diffs/dist/highlighter/languages/constants.d.ts +1 -1
  113. package/node_modules/@pierre/diffs/dist/highlighter/languages/constants.d.ts.map +1 -1
  114. package/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedLanguages.d.ts +1 -0
  115. package/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedLanguages.d.ts.map +1 -1
  116. package/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedOrResolveLanguage.d.ts +1 -0
  117. package/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedOrResolveLanguage.d.ts.map +1 -1
  118. package/node_modules/@pierre/diffs/dist/highlighter/languages/hasResolvedLanguages.d.ts +0 -1
  119. package/node_modules/@pierre/diffs/dist/highlighter/languages/hasResolvedLanguages.d.ts.map +1 -1
  120. package/node_modules/@pierre/diffs/dist/highlighter/languages/registerCustomLanguage.d.ts +0 -1
  121. package/node_modules/@pierre/diffs/dist/highlighter/languages/registerCustomLanguage.d.ts.map +1 -1
  122. package/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguage.d.ts +1 -0
  123. package/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguage.d.ts.map +1 -1
  124. package/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguages.d.ts +1 -0
  125. package/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguages.d.ts.map +1 -1
  126. package/node_modules/@pierre/diffs/dist/highlighter/shared_highlighter.d.ts +1 -6
  127. package/node_modules/@pierre/diffs/dist/highlighter/shared_highlighter.d.ts.map +1 -1
  128. package/node_modules/@pierre/diffs/dist/highlighter/themes/areThemesAttached.d.ts +0 -1
  129. package/node_modules/@pierre/diffs/dist/highlighter/themes/areThemesAttached.d.ts.map +1 -1
  130. package/node_modules/@pierre/diffs/dist/highlighter/themes/attachResolvedThemes.d.ts +0 -1
  131. package/node_modules/@pierre/diffs/dist/highlighter/themes/attachResolvedThemes.d.ts.map +1 -1
  132. package/node_modules/@pierre/diffs/dist/highlighter/themes/cleanUpResolvedThemes.d.ts.map +1 -1
  133. package/node_modules/@pierre/diffs/dist/highlighter/themes/constants.d.ts.map +1 -1
  134. package/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedOrResolveTheme.d.ts +0 -1
  135. package/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedOrResolveTheme.d.ts.map +1 -1
  136. package/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedThemes.d.ts +0 -1
  137. package/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedThemes.d.ts.map +1 -1
  138. package/node_modules/@pierre/diffs/dist/highlighter/themes/hasResolvedThemes.d.ts +0 -1
  139. package/node_modules/@pierre/diffs/dist/highlighter/themes/hasResolvedThemes.d.ts.map +1 -1
  140. package/node_modules/@pierre/diffs/dist/highlighter/themes/registerCustomCSSVariableTheme.d.ts.map +1 -1
  141. package/node_modules/@pierre/diffs/dist/highlighter/themes/registerCustomTheme.d.ts +0 -1
  142. package/node_modules/@pierre/diffs/dist/highlighter/themes/registerCustomTheme.d.ts.map +1 -1
  143. package/node_modules/@pierre/diffs/dist/highlighter/themes/resolveTheme.d.ts +0 -1
  144. package/node_modules/@pierre/diffs/dist/highlighter/themes/resolveTheme.d.ts.map +1 -1
  145. package/node_modules/@pierre/diffs/dist/highlighter/themes/resolveThemes.d.ts +0 -1
  146. package/node_modules/@pierre/diffs/dist/highlighter/themes/resolveThemes.d.ts.map +1 -1
  147. package/node_modules/@pierre/diffs/dist/highlighter/themes/themeResolution.d.ts +0 -1
  148. package/node_modules/@pierre/diffs/dist/highlighter/themes/themeResolution.d.ts.map +1 -1
  149. package/node_modules/@pierre/diffs/dist/highlighter/themes/themeResolver.d.ts +0 -1
  150. package/node_modules/@pierre/diffs/dist/highlighter/themes/themeResolver.d.ts.map +1 -1
  151. package/node_modules/@pierre/diffs/dist/index.d.ts +1 -0
  152. package/node_modules/@pierre/diffs/dist/managers/InteractionManager.d.ts +2 -26
  153. package/node_modules/@pierre/diffs/dist/managers/InteractionManager.d.ts.map +1 -1
  154. package/node_modules/@pierre/diffs/dist/managers/InteractionManager.js +1 -3
  155. package/node_modules/@pierre/diffs/dist/managers/InteractionManager.js.map +1 -1
  156. package/node_modules/@pierre/diffs/dist/managers/ResizeManager.d.ts +1 -4
  157. package/node_modules/@pierre/diffs/dist/managers/ResizeManager.d.ts.map +1 -1
  158. package/node_modules/@pierre/diffs/dist/managers/ScrollSyncManager.d.ts.map +1 -1
  159. package/node_modules/@pierre/diffs/dist/managers/UniversalRenderingManager.d.ts.map +1 -1
  160. package/node_modules/@pierre/diffs/dist/node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.d.ts +0 -1
  161. package/node_modules/@pierre/diffs/dist/node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.d.ts.map +1 -1
  162. package/node_modules/@pierre/diffs/dist/node_modules/.pnpm/@types_unist@3.0.3/node_modules/@types/unist/index.d.ts.map +1 -1
  163. package/node_modules/@pierre/diffs/dist/react/CodeView.d.ts +9 -1
  164. package/node_modules/@pierre/diffs/dist/react/CodeView.d.ts.map +1 -1
  165. package/node_modules/@pierre/diffs/dist/react/CodeView.js +39 -33
  166. package/node_modules/@pierre/diffs/dist/react/CodeView.js.map +1 -1
  167. package/node_modules/@pierre/diffs/dist/react/EditContext.d.ts +2 -5
  168. package/node_modules/@pierre/diffs/dist/react/EditContext.d.ts.map +1 -1
  169. package/node_modules/@pierre/diffs/dist/react/File.d.ts +1 -23
  170. package/node_modules/@pierre/diffs/dist/react/File.d.ts.map +1 -1
  171. package/node_modules/@pierre/diffs/dist/react/File.js +13 -12
  172. package/node_modules/@pierre/diffs/dist/react/File.js.map +1 -1
  173. package/node_modules/@pierre/diffs/dist/react/FileDiff.d.ts +1 -23
  174. package/node_modules/@pierre/diffs/dist/react/FileDiff.d.ts.map +1 -1
  175. package/node_modules/@pierre/diffs/dist/react/FileDiff.js +13 -12
  176. package/node_modules/@pierre/diffs/dist/react/FileDiff.js.map +1 -1
  177. package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.d.ts +1 -24
  178. package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.d.ts.map +1 -1
  179. package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.js +13 -12
  180. package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.js.map +1 -1
  181. package/node_modules/@pierre/diffs/dist/react/PatchDiff.d.ts +1 -23
  182. package/node_modules/@pierre/diffs/dist/react/PatchDiff.d.ts.map +1 -1
  183. package/node_modules/@pierre/diffs/dist/react/PatchDiff.js +13 -12
  184. package/node_modules/@pierre/diffs/dist/react/PatchDiff.js.map +1 -1
  185. package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.d.ts +1 -18
  186. package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.d.ts.map +1 -1
  187. package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.js +15 -14
  188. package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.js.map +1 -1
  189. package/node_modules/@pierre/diffs/dist/react/Virtualizer.d.ts +1 -9
  190. package/node_modules/@pierre/diffs/dist/react/Virtualizer.d.ts.map +1 -1
  191. package/node_modules/@pierre/diffs/dist/react/Virtualizer.js.map +1 -1
  192. package/node_modules/@pierre/diffs/dist/react/WorkerPoolContext.d.ts +2 -6
  193. package/node_modules/@pierre/diffs/dist/react/WorkerPoolContext.d.ts.map +1 -1
  194. package/node_modules/@pierre/diffs/dist/react/constants.d.ts +0 -1
  195. package/node_modules/@pierre/diffs/dist/react/constants.d.ts.map +1 -1
  196. package/node_modules/@pierre/diffs/dist/react/jsx.d.ts +1 -0
  197. package/node_modules/@pierre/diffs/dist/react/jsx.d.ts.map +1 -1
  198. package/node_modules/@pierre/diffs/dist/react/types.d.ts +1 -1
  199. package/node_modules/@pierre/diffs/dist/react/types.d.ts.map +1 -1
  200. package/node_modules/@pierre/diffs/dist/react/utils/assignRef.d.ts +6 -0
  201. package/node_modules/@pierre/diffs/dist/react/utils/assignRef.d.ts.map +1 -0
  202. package/node_modules/@pierre/diffs/dist/react/utils/assignRef.js +9 -0
  203. package/node_modules/@pierre/diffs/dist/react/utils/assignRef.js.map +1 -0
  204. package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.d.ts +1 -16
  205. package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.d.ts.map +1 -1
  206. package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.js.map +1 -1
  207. package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.d.ts +1 -13
  208. package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.d.ts.map +1 -1
  209. package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.js.map +1 -1
  210. package/node_modules/@pierre/diffs/dist/react/utils/templateRender.d.ts +0 -1
  211. package/node_modules/@pierre/diffs/dist/react/utils/templateRender.d.ts.map +1 -1
  212. package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.d.ts +2 -18
  213. package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.d.ts.map +1 -1
  214. package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.js +31 -17
  215. package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.js.map +1 -1
  216. package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.d.ts +2 -16
  217. package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.d.ts.map +1 -1
  218. package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.js +8 -4
  219. package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.js.map +1 -1
  220. package/node_modules/@pierre/diffs/dist/react/utils/useStableCallback.d.ts.map +1 -1
  221. package/node_modules/@pierre/diffs/dist/react/utils/useUnresolvedFileInstance.d.ts +1 -12
  222. package/node_modules/@pierre/diffs/dist/react/utils/useUnresolvedFileInstance.d.ts.map +1 -1
  223. package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.d.ts +4 -9
  224. package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.d.ts.map +1 -1
  225. package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.js +28 -21
  226. package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.js.map +1 -1
  227. package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.d.ts +1 -0
  228. package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.d.ts.map +1 -1
  229. package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.js.map +1 -1
  230. package/node_modules/@pierre/diffs/dist/renderers/UnresolvedFileHunksRenderer.d.ts +3 -9
  231. package/node_modules/@pierre/diffs/dist/renderers/UnresolvedFileHunksRenderer.d.ts.map +1 -1
  232. package/node_modules/@pierre/diffs/dist/shiki-stream/stream.d.ts +0 -1
  233. package/node_modules/@pierre/diffs/dist/shiki-stream/stream.d.ts.map +1 -1
  234. package/node_modules/@pierre/diffs/dist/shiki-stream/stream.js.map +1 -1
  235. package/node_modules/@pierre/diffs/dist/shiki-stream/tokenizer.d.ts +0 -1
  236. package/node_modules/@pierre/diffs/dist/shiki-stream/tokenizer.d.ts.map +1 -1
  237. package/node_modules/@pierre/diffs/dist/shiki-stream/types.d.ts +0 -1
  238. package/node_modules/@pierre/diffs/dist/shiki-stream/types.d.ts.map +1 -1
  239. package/node_modules/@pierre/diffs/dist/sprite.d.ts.map +1 -1
  240. package/node_modules/@pierre/diffs/dist/ssr/FileDiffReact.d.ts +1 -8
  241. package/node_modules/@pierre/diffs/dist/ssr/FileDiffReact.d.ts.map +1 -1
  242. package/node_modules/@pierre/diffs/dist/ssr/FileDiffReact.js +8 -3
  243. package/node_modules/@pierre/diffs/dist/ssr/FileDiffReact.js.map +1 -1
  244. package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.d.ts +6 -34
  245. package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.d.ts.map +1 -1
  246. package/node_modules/@pierre/diffs/dist/ssr/preloadFile.d.ts +1 -6
  247. package/node_modules/@pierre/diffs/dist/ssr/preloadFile.d.ts.map +1 -1
  248. package/node_modules/@pierre/diffs/dist/ssr/preloadPatchFile.d.ts +1 -5
  249. package/node_modules/@pierre/diffs/dist/ssr/preloadPatchFile.d.ts.map +1 -1
  250. package/node_modules/@pierre/diffs/dist/ssr/renderHTML.d.ts +0 -1
  251. package/node_modules/@pierre/diffs/dist/ssr/renderHTML.d.ts.map +1 -1
  252. package/node_modules/@pierre/diffs/dist/string-import.d.ts.map +1 -1
  253. package/node_modules/@pierre/diffs/dist/style.js.map +1 -1
  254. package/node_modules/@pierre/diffs/dist/types.d.ts +0 -1
  255. package/node_modules/@pierre/diffs/dist/types.d.ts.map +1 -1
  256. package/node_modules/@pierre/diffs/dist/utils/annotationHelpers.d.ts +0 -1
  257. package/node_modules/@pierre/diffs/dist/utils/annotationHelpers.d.ts.map +1 -1
  258. package/node_modules/@pierre/diffs/dist/utils/appendItems.d.ts.map +1 -1
  259. package/node_modules/@pierre/diffs/dist/utils/applyLineTextWithNewline.d.ts.map +1 -1
  260. package/node_modules/@pierre/diffs/dist/utils/areDiffLineAnnotationsEqual.d.ts +0 -1
  261. package/node_modules/@pierre/diffs/dist/utils/areDiffLineAnnotationsEqual.d.ts.map +1 -1
  262. package/node_modules/@pierre/diffs/dist/utils/areDiffRenderOptionsEqual.d.ts +0 -1
  263. package/node_modules/@pierre/diffs/dist/utils/areDiffRenderOptionsEqual.d.ts.map +1 -1
  264. package/node_modules/@pierre/diffs/dist/utils/areDiffTargetsEqual.d.ts +0 -1
  265. package/node_modules/@pierre/diffs/dist/utils/areDiffTargetsEqual.d.ts.map +1 -1
  266. package/node_modules/@pierre/diffs/dist/utils/areFileRenderOptionsEqual.d.ts +0 -1
  267. package/node_modules/@pierre/diffs/dist/utils/areFileRenderOptionsEqual.d.ts.map +1 -1
  268. package/node_modules/@pierre/diffs/dist/utils/areFileTargetsEqual.d.ts +0 -1
  269. package/node_modules/@pierre/diffs/dist/utils/areFileTargetsEqual.d.ts.map +1 -1
  270. package/node_modules/@pierre/diffs/dist/utils/areFilesEqual.d.ts +0 -1
  271. package/node_modules/@pierre/diffs/dist/utils/areFilesEqual.d.ts.map +1 -1
  272. package/node_modules/@pierre/diffs/dist/utils/areHunkDataEqual.d.ts +0 -1
  273. package/node_modules/@pierre/diffs/dist/utils/areHunkDataEqual.d.ts.map +1 -1
  274. package/node_modules/@pierre/diffs/dist/utils/areLineAnnotationsEqual.d.ts +0 -1
  275. package/node_modules/@pierre/diffs/dist/utils/areLineAnnotationsEqual.d.ts.map +1 -1
  276. package/node_modules/@pierre/diffs/dist/utils/areManagedSnapshotsEqual.d.ts +0 -1
  277. package/node_modules/@pierre/diffs/dist/utils/areManagedSnapshotsEqual.d.ts.map +1 -1
  278. package/node_modules/@pierre/diffs/dist/utils/areMergeConflictActionsEqual.d.ts +0 -1
  279. package/node_modules/@pierre/diffs/dist/utils/areMergeConflictActionsEqual.d.ts.map +1 -1
  280. package/node_modules/@pierre/diffs/dist/utils/areObjectsEqual.d.ts.map +1 -1
  281. package/node_modules/@pierre/diffs/dist/utils/areOptionsEqual.d.ts +1 -0
  282. package/node_modules/@pierre/diffs/dist/utils/areOptionsEqual.d.ts.map +1 -1
  283. package/node_modules/@pierre/diffs/dist/utils/arePrePropertiesEqual.d.ts +0 -1
  284. package/node_modules/@pierre/diffs/dist/utils/arePrePropertiesEqual.d.ts.map +1 -1
  285. package/node_modules/@pierre/diffs/dist/utils/areRenderRangesEqual.d.ts +0 -1
  286. package/node_modules/@pierre/diffs/dist/utils/areRenderRangesEqual.d.ts.map +1 -1
  287. package/node_modules/@pierre/diffs/dist/utils/areSelectionPointsEqual.d.ts +0 -1
  288. package/node_modules/@pierre/diffs/dist/utils/areSelectionPointsEqual.d.ts.map +1 -1
  289. package/node_modules/@pierre/diffs/dist/utils/areSelectionsEqual.d.ts +0 -1
  290. package/node_modules/@pierre/diffs/dist/utils/areSelectionsEqual.d.ts.map +1 -1
  291. package/node_modules/@pierre/diffs/dist/utils/areThemesEqual.d.ts +0 -1
  292. package/node_modules/@pierre/diffs/dist/utils/areThemesEqual.d.ts.map +1 -1
  293. package/node_modules/@pierre/diffs/dist/utils/areVirtualWindowSpecsEqual.d.ts +0 -1
  294. package/node_modules/@pierre/diffs/dist/utils/areVirtualWindowSpecsEqual.d.ts.map +1 -1
  295. package/node_modules/@pierre/diffs/dist/utils/areWorkerStatsEqual.d.ts +1 -0
  296. package/node_modules/@pierre/diffs/dist/utils/areWorkerStatsEqual.d.ts.map +1 -1
  297. package/node_modules/@pierre/diffs/dist/utils/awaitWithTimeout.d.ts.map +1 -1
  298. package/node_modules/@pierre/diffs/dist/utils/cleanLastNewline.d.ts.map +1 -1
  299. package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.d.ts +0 -1
  300. package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.d.ts.map +1 -1
  301. package/node_modules/@pierre/diffs/dist/utils/composeCacheKey.d.ts.map +1 -1
  302. package/node_modules/@pierre/diffs/dist/utils/computeEstimatedDiffHeights.d.ts +1 -11
  303. package/node_modules/@pierre/diffs/dist/utils/computeEstimatedDiffHeights.d.ts.map +1 -1
  304. package/node_modules/@pierre/diffs/dist/utils/computeFileOffsets.d.ts.map +1 -1
  305. package/node_modules/@pierre/diffs/dist/utils/computeFileOffsets.js +9 -8
  306. package/node_modules/@pierre/diffs/dist/utils/computeFileOffsets.js.map +1 -1
  307. package/node_modules/@pierre/diffs/dist/utils/computeVirtualFileMetrics.d.ts +0 -1
  308. package/node_modules/@pierre/diffs/dist/utils/computeVirtualFileMetrics.d.ts.map +1 -1
  309. package/node_modules/@pierre/diffs/dist/utils/createAnnotationElement.d.ts +0 -1
  310. package/node_modules/@pierre/diffs/dist/utils/createAnnotationElement.d.ts.map +1 -1
  311. package/node_modules/@pierre/diffs/dist/utils/createAnnotationWrapperNode.d.ts.map +1 -1
  312. package/node_modules/@pierre/diffs/dist/utils/createCodeViewHeaderFooterHostElement.d.ts.map +1 -1
  313. package/node_modules/@pierre/diffs/dist/utils/createContentColumn.d.ts +0 -1
  314. package/node_modules/@pierre/diffs/dist/utils/createContentColumn.d.ts.map +1 -1
  315. package/node_modules/@pierre/diffs/dist/utils/createEmptyRowBuffer.d.ts +0 -1
  316. package/node_modules/@pierre/diffs/dist/utils/createEmptyRowBuffer.d.ts.map +1 -1
  317. package/node_modules/@pierre/diffs/dist/utils/createFileHeaderElement.d.ts +1 -6
  318. package/node_modules/@pierre/diffs/dist/utils/createFileHeaderElement.d.ts.map +1 -1
  319. package/node_modules/@pierre/diffs/dist/utils/createGutterUtilityContentNode.d.ts.map +1 -1
  320. package/node_modules/@pierre/diffs/dist/utils/createGutterUtilityElement.d.ts +0 -1
  321. package/node_modules/@pierre/diffs/dist/utils/createGutterUtilityElement.d.ts.map +1 -1
  322. package/node_modules/@pierre/diffs/dist/utils/createNoNewlineElement.d.ts +0 -1
  323. package/node_modules/@pierre/diffs/dist/utils/createNoNewlineElement.d.ts.map +1 -1
  324. package/node_modules/@pierre/diffs/dist/utils/createPreElement.d.ts +1 -11
  325. package/node_modules/@pierre/diffs/dist/utils/createPreElement.d.ts.map +1 -1
  326. package/node_modules/@pierre/diffs/dist/utils/createRowNodes.d.ts.map +1 -1
  327. package/node_modules/@pierre/diffs/dist/utils/createSeparator.d.ts +1 -10
  328. package/node_modules/@pierre/diffs/dist/utils/createSeparator.d.ts.map +1 -1
  329. package/node_modules/@pierre/diffs/dist/utils/createSeparator.js +12 -10
  330. package/node_modules/@pierre/diffs/dist/utils/createSeparator.js.map +1 -1
  331. package/node_modules/@pierre/diffs/dist/utils/createSpanNodeFromToken.d.ts +0 -1
  332. package/node_modules/@pierre/diffs/dist/utils/createSpanNodeFromToken.d.ts.map +1 -1
  333. package/node_modules/@pierre/diffs/dist/utils/createSpanNodeFromToken.js +2 -1
  334. package/node_modules/@pierre/diffs/dist/utils/createSpanNodeFromToken.js.map +1 -1
  335. package/node_modules/@pierre/diffs/dist/utils/createStyleElement.d.ts +0 -1
  336. package/node_modules/@pierre/diffs/dist/utils/createStyleElement.d.ts.map +1 -1
  337. package/node_modules/@pierre/diffs/dist/utils/createTransformerWithState.d.ts +0 -1
  338. package/node_modules/@pierre/diffs/dist/utils/createTransformerWithState.d.ts.map +1 -1
  339. package/node_modules/@pierre/diffs/dist/utils/createUnsafeCSSStyleNode.d.ts.map +1 -1
  340. package/node_modules/@pierre/diffs/dist/utils/createWindowFromScrollPosition.d.ts +1 -9
  341. package/node_modules/@pierre/diffs/dist/utils/createWindowFromScrollPosition.d.ts.map +1 -1
  342. package/node_modules/@pierre/diffs/dist/utils/cssWrappers.d.ts +0 -1
  343. package/node_modules/@pierre/diffs/dist/utils/cssWrappers.d.ts.map +1 -1
  344. package/node_modules/@pierre/diffs/dist/utils/cssWrappers.js +5 -3
  345. package/node_modules/@pierre/diffs/dist/utils/cssWrappers.js.map +1 -1
  346. package/node_modules/@pierre/diffs/dist/utils/detachString.d.ts.map +1 -1
  347. package/node_modules/@pierre/diffs/dist/utils/diffAcceptRejectHunk.d.ts +0 -1
  348. package/node_modules/@pierre/diffs/dist/utils/diffAcceptRejectHunk.d.ts.map +1 -1
  349. package/node_modules/@pierre/diffs/dist/utils/editSessionAnnotations.d.ts +0 -1
  350. package/node_modules/@pierre/diffs/dist/utils/editSessionAnnotations.d.ts.map +1 -1
  351. package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.d.ts +0 -1
  352. package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.d.ts.map +1 -1
  353. package/node_modules/@pierre/diffs/dist/utils/formatCSSVariablePrefix.d.ts.map +1 -1
  354. package/node_modules/@pierre/diffs/dist/utils/getDiffFileInput.d.ts +1 -5
  355. package/node_modules/@pierre/diffs/dist/utils/getDiffFileInput.d.ts.map +1 -1
  356. package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.d.ts +0 -1
  357. package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.d.ts.map +1 -1
  358. package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.d.ts +0 -1
  359. package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.d.ts.map +1 -1
  360. package/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.d.ts +0 -1
  361. package/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.d.ts.map +1 -1
  362. package/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.js.map +1 -1
  363. package/node_modules/@pierre/diffs/dist/utils/getHighlighterOptions.d.ts +1 -5
  364. package/node_modules/@pierre/diffs/dist/utils/getHighlighterOptions.d.ts.map +1 -1
  365. package/node_modules/@pierre/diffs/dist/utils/getHighlighterOptions.js +1 -1
  366. package/node_modules/@pierre/diffs/dist/utils/getHighlighterOptions.js.map +1 -1
  367. package/node_modules/@pierre/diffs/dist/utils/getHighlighterThemeStyles.d.ts +1 -6
  368. package/node_modules/@pierre/diffs/dist/utils/getHighlighterThemeStyles.d.ts.map +1 -1
  369. package/node_modules/@pierre/diffs/dist/utils/getHunkSeparatorSlotName.d.ts +0 -1
  370. package/node_modules/@pierre/diffs/dist/utils/getHunkSeparatorSlotName.d.ts.map +1 -1
  371. package/node_modules/@pierre/diffs/dist/utils/getHunkSideBoundaries.d.ts.map +1 -1
  372. package/node_modules/@pierre/diffs/dist/utils/getIconForType.d.ts +0 -1
  373. package/node_modules/@pierre/diffs/dist/utils/getIconForType.d.ts.map +1 -1
  374. package/node_modules/@pierre/diffs/dist/utils/getLineAnnotationName.d.ts +0 -1
  375. package/node_modules/@pierre/diffs/dist/utils/getLineAnnotationName.d.ts.map +1 -1
  376. package/node_modules/@pierre/diffs/dist/utils/getLineEndingType.d.ts.map +1 -1
  377. package/node_modules/@pierre/diffs/dist/utils/getLineNodes.d.ts +0 -1
  378. package/node_modules/@pierre/diffs/dist/utils/getLineNodes.d.ts.map +1 -1
  379. package/node_modules/@pierre/diffs/dist/utils/getMergeConflictActionSlotName.d.ts +1 -5
  380. package/node_modules/@pierre/diffs/dist/utils/getMergeConflictActionSlotName.d.ts.map +1 -1
  381. package/node_modules/@pierre/diffs/dist/utils/getMergeConflictLineTypes.d.ts +0 -1
  382. package/node_modules/@pierre/diffs/dist/utils/getMergeConflictLineTypes.d.ts.map +1 -1
  383. package/node_modules/@pierre/diffs/dist/utils/getOrCreateCodeNode.d.ts +1 -7
  384. package/node_modules/@pierre/diffs/dist/utils/getOrCreateCodeNode.d.ts.map +1 -1
  385. package/node_modules/@pierre/diffs/dist/utils/getSingularPatch.d.ts +0 -1
  386. package/node_modules/@pierre/diffs/dist/utils/getSingularPatch.d.ts.map +1 -1
  387. package/node_modules/@pierre/diffs/dist/utils/getThemes.d.ts +0 -1
  388. package/node_modules/@pierre/diffs/dist/utils/getThemes.d.ts.map +1 -1
  389. package/node_modules/@pierre/diffs/dist/utils/getTotalLineCountFromHunks.d.ts +0 -1
  390. package/node_modules/@pierre/diffs/dist/utils/getTotalLineCountFromHunks.d.ts.map +1 -1
  391. package/node_modules/@pierre/diffs/dist/utils/guardWebKitScrollDuringRebuild.d.ts.map +1 -1
  392. package/node_modules/@pierre/diffs/dist/utils/hast_utils.d.ts +2 -12
  393. package/node_modules/@pierre/diffs/dist/utils/hast_utils.d.ts.map +1 -1
  394. package/node_modules/@pierre/diffs/dist/utils/hostTheme.d.ts +1 -5
  395. package/node_modules/@pierre/diffs/dist/utils/hostTheme.d.ts.map +1 -1
  396. package/node_modules/@pierre/diffs/dist/utils/hydratePartialDiff.d.ts +0 -1
  397. package/node_modules/@pierre/diffs/dist/utils/hydratePartialDiff.d.ts.map +1 -1
  398. package/node_modules/@pierre/diffs/dist/utils/includesFileAnnotations.d.ts +0 -1
  399. package/node_modules/@pierre/diffs/dist/utils/includesFileAnnotations.d.ts.map +1 -1
  400. package/node_modules/@pierre/diffs/dist/utils/isDefaultRenderRange.d.ts +0 -1
  401. package/node_modules/@pierre/diffs/dist/utils/isDefaultRenderRange.d.ts.map +1 -1
  402. package/node_modules/@pierre/diffs/dist/utils/isDiffPlainText.d.ts +0 -1
  403. package/node_modules/@pierre/diffs/dist/utils/isDiffPlainText.d.ts.map +1 -1
  404. package/node_modules/@pierre/diffs/dist/utils/isFilePlainText.d.ts +0 -1
  405. package/node_modules/@pierre/diffs/dist/utils/isFilePlainText.d.ts.map +1 -1
  406. package/node_modules/@pierre/diffs/dist/utils/isGutterUtilityPath.d.ts.map +1 -1
  407. package/node_modules/@pierre/diffs/dist/utils/isStyleNode.d.ts.map +1 -1
  408. package/node_modules/@pierre/diffs/dist/utils/isWorkerContext.d.ts.map +1 -1
  409. package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.d.ts +1 -10
  410. package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.d.ts.map +1 -1
  411. package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.js +5 -3
  412. package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.js.map +1 -1
  413. package/node_modules/@pierre/diffs/dist/utils/lineAnnotationIdentity.d.ts +0 -1
  414. package/node_modules/@pierre/diffs/dist/utils/lineAnnotationIdentity.d.ts.map +1 -1
  415. package/node_modules/@pierre/diffs/dist/utils/normalizeDiffResolution.d.ts +0 -1
  416. package/node_modules/@pierre/diffs/dist/utils/normalizeDiffResolution.d.ts.map +1 -1
  417. package/node_modules/@pierre/diffs/dist/utils/parseDiffDecorations.d.ts +2 -13
  418. package/node_modules/@pierre/diffs/dist/utils/parseDiffDecorations.d.ts.map +1 -1
  419. package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.d.ts +0 -1
  420. package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.d.ts.map +1 -1
  421. package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.js +2 -1
  422. package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.js.map +1 -1
  423. package/node_modules/@pierre/diffs/dist/utils/parseLineType.d.ts +0 -1
  424. package/node_modules/@pierre/diffs/dist/utils/parseLineType.d.ts.map +1 -1
  425. package/node_modules/@pierre/diffs/dist/utils/parseMergeConflictDiffFromFile.d.ts +0 -1
  426. package/node_modules/@pierre/diffs/dist/utils/parseMergeConflictDiffFromFile.d.ts.map +1 -1
  427. package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.d.ts +0 -1
  428. package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.d.ts.map +1 -1
  429. package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.js +8 -5
  430. package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.js.map +1 -1
  431. package/node_modules/@pierre/diffs/dist/utils/platform.d.ts.map +1 -1
  432. package/node_modules/@pierre/diffs/dist/utils/prefersReducedMotion.d.ts.map +1 -1
  433. package/node_modules/@pierre/diffs/dist/utils/prerenderHTMLIfNecessary.d.ts.map +1 -1
  434. package/node_modules/@pierre/diffs/dist/utils/processLine.d.ts +0 -1
  435. package/node_modules/@pierre/diffs/dist/utils/processLine.d.ts.map +1 -1
  436. package/node_modules/@pierre/diffs/dist/utils/realignChangeContent.d.ts +0 -1
  437. package/node_modules/@pierre/diffs/dist/utils/realignChangeContent.d.ts.map +1 -1
  438. package/node_modules/@pierre/diffs/dist/utils/renderDiffWithHighlighter.d.ts +1 -8
  439. package/node_modules/@pierre/diffs/dist/utils/renderDiffWithHighlighter.d.ts.map +1 -1
  440. package/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.d.ts +1 -11
  441. package/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.d.ts.map +1 -1
  442. package/node_modules/@pierre/diffs/dist/utils/resolveConflict.d.ts +0 -1
  443. package/node_modules/@pierre/diffs/dist/utils/resolveConflict.d.ts.map +1 -1
  444. package/node_modules/@pierre/diffs/dist/utils/resolveRegion.d.ts +0 -1
  445. package/node_modules/@pierre/diffs/dist/utils/resolveRegion.d.ts.map +1 -1
  446. package/node_modules/@pierre/diffs/dist/utils/roundToDevicePixel.d.ts.map +1 -1
  447. package/node_modules/@pierre/diffs/dist/utils/scrollbarGutter.d.ts.map +1 -1
  448. package/node_modules/@pierre/diffs/dist/utils/scrollbarGutter.js +2 -1
  449. package/node_modules/@pierre/diffs/dist/utils/scrollbarGutter.js.map +1 -1
  450. package/node_modules/@pierre/diffs/dist/utils/setLanguageOverride.d.ts +0 -1
  451. package/node_modules/@pierre/diffs/dist/utils/setLanguageOverride.d.ts.map +1 -1
  452. package/node_modules/@pierre/diffs/dist/utils/setWrapperNodeProps.d.ts +1 -11
  453. package/node_modules/@pierre/diffs/dist/utils/setWrapperNodeProps.d.ts.map +1 -1
  454. package/node_modules/@pierre/diffs/dist/utils/setWrapperNodeProps.js +1 -3
  455. package/node_modules/@pierre/diffs/dist/utils/setWrapperNodeProps.js.map +1 -1
  456. package/node_modules/@pierre/diffs/dist/utils/shouldUseTokenTransformer.d.ts +0 -1
  457. package/node_modules/@pierre/diffs/dist/utils/shouldUseTokenTransformer.d.ts.map +1 -1
  458. package/node_modules/@pierre/diffs/dist/utils/splitFileContents.d.ts.map +1 -1
  459. package/node_modules/@pierre/diffs/dist/utils/trimPatchContext.d.ts.map +1 -1
  460. package/node_modules/@pierre/diffs/dist/utils/updateDiffHunks.d.ts +0 -1
  461. package/node_modules/@pierre/diffs/dist/utils/updateDiffHunks.d.ts.map +1 -1
  462. package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.d.ts +10 -55
  463. package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.d.ts.map +1 -1
  464. package/node_modules/@pierre/diffs/dist/utils/wrapTokenFragments.d.ts +0 -1
  465. package/node_modules/@pierre/diffs/dist/utils/wrapTokenFragments.d.ts.map +1 -1
  466. package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.d.ts +2 -17
  467. package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.d.ts.map +1 -1
  468. package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.js +8 -5
  469. package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.js.map +1 -1
  470. package/node_modules/@pierre/diffs/dist/worker/getOrCreateWorkerPoolSingleton.d.ts +1 -5
  471. package/node_modules/@pierre/diffs/dist/worker/getOrCreateWorkerPoolSingleton.d.ts.map +1 -1
  472. package/node_modules/@pierre/diffs/dist/worker/types.d.ts +0 -1
  473. package/node_modules/@pierre/diffs/dist/worker/types.d.ts.map +1 -1
  474. package/node_modules/@pierre/diffs/dist/worker/worker-portable.d.ts +1 -1
  475. package/node_modules/@pierre/diffs/dist/worker/worker-portable.js +113 -354
  476. package/node_modules/@pierre/diffs/dist/worker/worker-portable.js.map +1 -1
  477. package/node_modules/@pierre/diffs/dist/worker/worker.d.ts +1 -1
  478. package/node_modules/@pierre/diffs/dist/worker/worker.js +14 -11
  479. package/node_modules/@pierre/diffs/dist/worker/worker.js.map +1 -1
  480. package/node_modules/@pierre/diffs/package.json +4 -5
  481. package/node_modules/zod/README.md +2 -2
  482. package/node_modules/zod/compile.cjs +19 -0
  483. package/node_modules/zod/index.cjs +19 -0
  484. package/node_modules/zod/locales/index.cjs +19 -0
  485. package/node_modules/zod/mini/index.cjs +19 -0
  486. package/node_modules/zod/package.json +8 -7
  487. package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
  488. package/node_modules/zod/src/v4/classic/external.ts +2 -0
  489. package/node_modules/zod/src/v4/classic/from-json-schema.ts +248 -25
  490. package/node_modules/zod/src/v4/classic/schemas.ts +243 -168
  491. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +60 -9
  492. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +6 -0
  493. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
  494. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +265 -0
  495. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +112 -6
  496. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +9 -0
  497. package/node_modules/zod/src/v4/classic/tests/error.test.ts +130 -1
  498. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +157 -0
  499. package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
  500. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +40 -2
  501. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +27 -7
  502. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +88 -56
  503. package/node_modules/zod/src/v4/classic/tests/number.test.ts +39 -0
  504. package/node_modules/zod/src/v4/classic/tests/object.test.ts +56 -0
  505. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +3 -2
  506. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
  507. package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
  508. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +46 -1
  509. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
  510. package/node_modules/zod/src/v4/classic/tests/string.test.ts +95 -1
  511. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +33 -1
  512. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +234 -38
  513. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +569 -0
  514. package/node_modules/zod/src/v4/core/api.ts +44 -28
  515. package/node_modules/zod/src/v4/core/checks.ts +62 -102
  516. package/node_modules/zod/src/v4/core/compile.ts +218 -93
  517. package/node_modules/zod/src/v4/core/core.ts +1 -3
  518. package/node_modules/zod/src/v4/core/doc.ts +6 -2
  519. package/node_modules/zod/src/v4/core/errors.ts +3 -6
  520. package/node_modules/zod/src/v4/core/json-schema-generator.ts +2 -2
  521. package/node_modules/zod/src/v4/core/json-schema-processors.ts +185 -81
  522. package/node_modules/zod/src/v4/core/memoizer.ts +75 -28
  523. package/node_modules/zod/src/v4/core/parse.ts +37 -16
  524. package/node_modules/zod/src/v4/core/regexes.ts +14 -4
  525. package/node_modules/zod/src/v4/core/schemas.ts +296 -132
  526. package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
  527. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +35 -0
  528. package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
  529. package/node_modules/zod/src/v4/core/tests/compile.test.ts +399 -2
  530. package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
  531. package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
  532. package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
  533. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +118 -16
  534. package/node_modules/zod/src/v4/core/to-json-schema.ts +9 -7
  535. package/node_modules/zod/src/v4/core/util.ts +218 -147
  536. package/node_modules/zod/src/v4/core/versions.ts +2 -2
  537. package/node_modules/zod/src/v4/locales/ar.ts +2 -0
  538. package/node_modules/zod/src/v4/locales/az.ts +2 -0
  539. package/node_modules/zod/src/v4/locales/be.ts +2 -0
  540. package/node_modules/zod/src/v4/locales/bg.ts +2 -0
  541. package/node_modules/zod/src/v4/locales/bn.ts +2 -0
  542. package/node_modules/zod/src/v4/locales/ca.ts +2 -0
  543. package/node_modules/zod/src/v4/locales/ckb.ts +2 -0
  544. package/node_modules/zod/src/v4/locales/cs.ts +2 -0
  545. package/node_modules/zod/src/v4/locales/da.ts +2 -0
  546. package/node_modules/zod/src/v4/locales/de.ts +2 -0
  547. package/node_modules/zod/src/v4/locales/el.ts +2 -0
  548. package/node_modules/zod/src/v4/locales/en.ts +2 -0
  549. package/node_modules/zod/src/v4/locales/eo.ts +2 -0
  550. package/node_modules/zod/src/v4/locales/es.ts +2 -0
  551. package/node_modules/zod/src/v4/locales/fa.ts +2 -0
  552. package/node_modules/zod/src/v4/locales/fi.ts +2 -0
  553. package/node_modules/zod/src/v4/locales/fr-CA.ts +2 -0
  554. package/node_modules/zod/src/v4/locales/fr.ts +2 -0
  555. package/node_modules/zod/src/v4/locales/gu.ts +2 -0
  556. package/node_modules/zod/src/v4/locales/he.ts +2 -0
  557. package/node_modules/zod/src/v4/locales/hi.ts +2 -0
  558. package/node_modules/zod/src/v4/locales/hr.ts +2 -0
  559. package/node_modules/zod/src/v4/locales/hu.ts +2 -0
  560. package/node_modules/zod/src/v4/locales/hy.ts +2 -0
  561. package/node_modules/zod/src/v4/locales/id.ts +2 -0
  562. package/node_modules/zod/src/v4/locales/index.ts +1 -0
  563. package/node_modules/zod/src/v4/locales/is.ts +2 -0
  564. package/node_modules/zod/src/v4/locales/it.ts +2 -0
  565. package/node_modules/zod/src/v4/locales/ja.ts +2 -0
  566. package/node_modules/zod/src/v4/locales/ka.ts +2 -0
  567. package/node_modules/zod/src/v4/locales/km.ts +2 -0
  568. package/node_modules/zod/src/v4/locales/kn.ts +2 -0
  569. package/node_modules/zod/src/v4/locales/ko.ts +2 -0
  570. package/node_modules/zod/src/v4/locales/lt.ts +2 -0
  571. package/node_modules/zod/src/v4/locales/mk.ts +2 -0
  572. package/node_modules/zod/src/v4/locales/ms.ts +2 -0
  573. package/node_modules/zod/src/v4/locales/ne.ts +2 -0
  574. package/node_modules/zod/src/v4/locales/nl.ts +2 -0
  575. package/node_modules/zod/src/v4/locales/nn.ts +2 -0
  576. package/node_modules/zod/src/v4/locales/no.ts +2 -0
  577. package/node_modules/zod/src/v4/locales/ota.ts +2 -0
  578. package/node_modules/zod/src/v4/locales/pl.ts +2 -0
  579. package/node_modules/zod/src/v4/locales/ps.ts +2 -0
  580. package/node_modules/zod/src/v4/locales/pt-BR.ts +2 -0
  581. package/node_modules/zod/src/v4/locales/pt.ts +2 -0
  582. package/node_modules/zod/src/v4/locales/ro.ts +2 -0
  583. package/node_modules/zod/src/v4/locales/ru.ts +2 -0
  584. package/node_modules/zod/src/v4/locales/sk.ts +2 -0
  585. package/node_modules/zod/src/v4/locales/sl.ts +2 -0
  586. package/node_modules/zod/src/v4/locales/sv.ts +2 -0
  587. package/node_modules/zod/src/v4/locales/ta.ts +2 -0
  588. package/node_modules/zod/src/v4/locales/tg.ts +135 -0
  589. package/node_modules/zod/src/v4/locales/th.ts +2 -0
  590. package/node_modules/zod/src/v4/locales/tk.ts +2 -0
  591. package/node_modules/zod/src/v4/locales/tr.ts +2 -0
  592. package/node_modules/zod/src/v4/locales/uk.ts +2 -0
  593. package/node_modules/zod/src/v4/locales/ur.ts +2 -0
  594. package/node_modules/zod/src/v4/locales/uz.ts +2 -0
  595. package/node_modules/zod/src/v4/locales/vi.ts +2 -0
  596. package/node_modules/zod/src/v4/locales/yo.ts +2 -0
  597. package/node_modules/zod/src/v4/locales/zh-CN.ts +2 -0
  598. package/node_modules/zod/src/v4/locales/zh-TW.ts +2 -0
  599. package/node_modules/zod/src/v4/mini/external.ts +2 -0
  600. package/node_modules/zod/src/v4/mini/schemas.ts +32 -7
  601. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +1 -1
  602. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
  603. package/node_modules/zod/src/v4/mini/tests/index.test.ts +86 -0
  604. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
  605. package/node_modules/zod/src/v4/mini/tests/string.test.ts +23 -0
  606. package/node_modules/zod/v3/ZodError.cjs +19 -0
  607. package/node_modules/zod/v3/errors.cjs +19 -0
  608. package/node_modules/zod/v3/external.cjs +19 -0
  609. package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
  610. package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
  611. package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
  612. package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
  613. package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
  614. package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
  615. package/node_modules/zod/v3/helpers/util.cjs +19 -0
  616. package/node_modules/zod/v3/index.cjs +19 -0
  617. package/node_modules/zod/v3/standard-schema.cjs +19 -0
  618. package/node_modules/zod/v3/types.cjs +19 -0
  619. package/node_modules/zod/v4/classic/checks.cjs +19 -0
  620. package/node_modules/zod/v4/classic/coerce.cjs +19 -0
  621. package/node_modules/zod/v4/classic/compat.cjs +19 -0
  622. package/node_modules/zod/v4/classic/deep-partial.cjs +19 -0
  623. package/node_modules/zod/v4/classic/errors.cjs +19 -0
  624. package/node_modules/zod/v4/classic/external.cjs +22 -1
  625. package/node_modules/zod/v4/classic/external.d.cts +1 -1
  626. package/node_modules/zod/v4/classic/external.d.ts +1 -1
  627. package/node_modules/zod/v4/classic/external.js +1 -1
  628. package/node_modules/zod/v4/classic/from-json-schema.cjs +264 -24
  629. package/node_modules/zod/v4/classic/from-json-schema.js +245 -24
  630. package/node_modules/zod/v4/classic/in-out.cjs +19 -0
  631. package/node_modules/zod/v4/classic/index.cjs +19 -0
  632. package/node_modules/zod/v4/classic/iso.cjs +19 -0
  633. package/node_modules/zod/v4/classic/parse.cjs +19 -0
  634. package/node_modules/zod/v4/classic/schemas.cjs +100 -35
  635. package/node_modules/zod/v4/classic/schemas.d.cts +15 -1
  636. package/node_modules/zod/v4/classic/schemas.d.ts +15 -1
  637. package/node_modules/zod/v4/classic/schemas.js +77 -33
  638. package/node_modules/zod/v4/core/api.cjs +45 -22
  639. package/node_modules/zod/v4/core/api.d.cts +12 -6
  640. package/node_modules/zod/v4/core/api.d.ts +12 -6
  641. package/node_modules/zod/v4/core/api.js +25 -22
  642. package/node_modules/zod/v4/core/checks.cjs +51 -97
  643. package/node_modules/zod/v4/core/checks.d.cts +17 -1
  644. package/node_modules/zod/v4/core/checks.d.ts +17 -1
  645. package/node_modules/zod/v4/core/checks.js +31 -96
  646. package/node_modules/zod/v4/core/compile.cjs +173 -78
  647. package/node_modules/zod/v4/core/compile.d.cts +18 -4
  648. package/node_modules/zod/v4/core/compile.d.ts +18 -4
  649. package/node_modules/zod/v4/core/compile.js +154 -79
  650. package/node_modules/zod/v4/core/core.cjs +20 -1
  651. package/node_modules/zod/v4/core/core.js +1 -1
  652. package/node_modules/zod/v4/core/doc.cjs +26 -2
  653. package/node_modules/zod/v4/core/doc.js +7 -2
  654. package/node_modules/zod/v4/core/errors.cjs +21 -5
  655. package/node_modules/zod/v4/core/errors.js +2 -5
  656. package/node_modules/zod/v4/core/index.cjs +19 -0
  657. package/node_modules/zod/v4/core/json-schema-generator.cjs +20 -1
  658. package/node_modules/zod/v4/core/json-schema-generator.js +2 -2
  659. package/node_modules/zod/v4/core/json-schema-processors.cjs +188 -72
  660. package/node_modules/zod/v4/core/json-schema-processors.d.cts +16 -0
  661. package/node_modules/zod/v4/core/json-schema-processors.d.ts +16 -0
  662. package/node_modules/zod/v4/core/json-schema-processors.js +170 -74
  663. package/node_modules/zod/v4/core/json-schema.cjs +19 -0
  664. package/node_modules/zod/v4/core/memoizer.cjs +111 -23
  665. package/node_modules/zod/v4/core/memoizer.js +69 -23
  666. package/node_modules/zod/v4/core/parse.cjs +56 -16
  667. package/node_modules/zod/v4/core/parse.js +37 -16
  668. package/node_modules/zod/v4/core/regexes.cjs +31 -6
  669. package/node_modules/zod/v4/core/regexes.d.cts +3 -0
  670. package/node_modules/zod/v4/core/regexes.d.ts +3 -0
  671. package/node_modules/zod/v4/core/regexes.js +10 -4
  672. package/node_modules/zod/v4/core/registries.cjs +19 -0
  673. package/node_modules/zod/v4/core/schemas.cjs +302 -114
  674. package/node_modules/zod/v4/core/schemas.d.cts +28 -8
  675. package/node_modules/zod/v4/core/schemas.d.ts +28 -8
  676. package/node_modules/zod/v4/core/schemas.js +279 -113
  677. package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
  678. package/node_modules/zod/v4/core/to-json-schema.cjs +28 -7
  679. package/node_modules/zod/v4/core/to-json-schema.d.cts +4 -3
  680. package/node_modules/zod/v4/core/to-json-schema.d.ts +4 -3
  681. package/node_modules/zod/v4/core/to-json-schema.js +7 -6
  682. package/node_modules/zod/v4/core/util.cjs +177 -143
  683. package/node_modules/zod/v4/core/util.d.cts +25 -4
  684. package/node_modules/zod/v4/core/util.d.ts +25 -4
  685. package/node_modules/zod/v4/core/util.js +156 -143
  686. package/node_modules/zod/v4/core/versions.cjs +21 -2
  687. package/node_modules/zod/v4/core/versions.d.cts +1 -1
  688. package/node_modules/zod/v4/core/versions.d.ts +1 -1
  689. package/node_modules/zod/v4/core/versions.js +2 -2
  690. package/node_modules/zod/v4/core/visit.cjs +19 -0
  691. package/node_modules/zod/v4/index.cjs +19 -0
  692. package/node_modules/zod/v4/locales/ar.cjs +2 -0
  693. package/node_modules/zod/v4/locales/ar.js +2 -0
  694. package/node_modules/zod/v4/locales/az.cjs +2 -0
  695. package/node_modules/zod/v4/locales/az.js +2 -0
  696. package/node_modules/zod/v4/locales/be.cjs +2 -0
  697. package/node_modules/zod/v4/locales/be.js +2 -0
  698. package/node_modules/zod/v4/locales/bg.cjs +2 -0
  699. package/node_modules/zod/v4/locales/bg.js +2 -0
  700. package/node_modules/zod/v4/locales/bn.cjs +2 -0
  701. package/node_modules/zod/v4/locales/bn.js +2 -0
  702. package/node_modules/zod/v4/locales/ca.cjs +2 -0
  703. package/node_modules/zod/v4/locales/ca.js +2 -0
  704. package/node_modules/zod/v4/locales/ckb.cjs +2 -0
  705. package/node_modules/zod/v4/locales/ckb.js +2 -0
  706. package/node_modules/zod/v4/locales/cs.cjs +2 -0
  707. package/node_modules/zod/v4/locales/cs.js +2 -0
  708. package/node_modules/zod/v4/locales/da.cjs +2 -0
  709. package/node_modules/zod/v4/locales/da.js +2 -0
  710. package/node_modules/zod/v4/locales/de.cjs +2 -0
  711. package/node_modules/zod/v4/locales/de.js +2 -0
  712. package/node_modules/zod/v4/locales/el.cjs +2 -0
  713. package/node_modules/zod/v4/locales/el.js +2 -0
  714. package/node_modules/zod/v4/locales/en.cjs +2 -0
  715. package/node_modules/zod/v4/locales/en.js +2 -0
  716. package/node_modules/zod/v4/locales/eo.cjs +2 -0
  717. package/node_modules/zod/v4/locales/eo.js +2 -0
  718. package/node_modules/zod/v4/locales/es.cjs +2 -0
  719. package/node_modules/zod/v4/locales/es.js +2 -0
  720. package/node_modules/zod/v4/locales/fa.cjs +2 -0
  721. package/node_modules/zod/v4/locales/fa.js +2 -0
  722. package/node_modules/zod/v4/locales/fi.cjs +2 -0
  723. package/node_modules/zod/v4/locales/fi.js +2 -0
  724. package/node_modules/zod/v4/locales/fr-CA.cjs +2 -0
  725. package/node_modules/zod/v4/locales/fr-CA.js +2 -0
  726. package/node_modules/zod/v4/locales/fr.cjs +2 -0
  727. package/node_modules/zod/v4/locales/fr.js +2 -0
  728. package/node_modules/zod/v4/locales/gu.cjs +2 -0
  729. package/node_modules/zod/v4/locales/gu.js +2 -0
  730. package/node_modules/zod/v4/locales/he.cjs +2 -0
  731. package/node_modules/zod/v4/locales/he.js +2 -0
  732. package/node_modules/zod/v4/locales/hi.cjs +2 -0
  733. package/node_modules/zod/v4/locales/hi.js +2 -0
  734. package/node_modules/zod/v4/locales/hr.cjs +2 -0
  735. package/node_modules/zod/v4/locales/hr.js +2 -0
  736. package/node_modules/zod/v4/locales/hu.cjs +2 -0
  737. package/node_modules/zod/v4/locales/hu.js +2 -0
  738. package/node_modules/zod/v4/locales/hy.cjs +2 -0
  739. package/node_modules/zod/v4/locales/hy.js +2 -0
  740. package/node_modules/zod/v4/locales/id.cjs +2 -0
  741. package/node_modules/zod/v4/locales/id.js +2 -0
  742. package/node_modules/zod/v4/locales/index.cjs +22 -1
  743. package/node_modules/zod/v4/locales/index.d.cts +1 -0
  744. package/node_modules/zod/v4/locales/index.d.ts +1 -0
  745. package/node_modules/zod/v4/locales/index.js +1 -0
  746. package/node_modules/zod/v4/locales/is.cjs +2 -0
  747. package/node_modules/zod/v4/locales/is.js +2 -0
  748. package/node_modules/zod/v4/locales/it.cjs +2 -0
  749. package/node_modules/zod/v4/locales/it.js +2 -0
  750. package/node_modules/zod/v4/locales/ja.cjs +2 -0
  751. package/node_modules/zod/v4/locales/ja.js +2 -0
  752. package/node_modules/zod/v4/locales/ka.cjs +2 -0
  753. package/node_modules/zod/v4/locales/ka.js +2 -0
  754. package/node_modules/zod/v4/locales/km.cjs +2 -0
  755. package/node_modules/zod/v4/locales/km.js +2 -0
  756. package/node_modules/zod/v4/locales/kn.cjs +2 -0
  757. package/node_modules/zod/v4/locales/kn.js +2 -0
  758. package/node_modules/zod/v4/locales/ko.cjs +2 -0
  759. package/node_modules/zod/v4/locales/ko.js +2 -0
  760. package/node_modules/zod/v4/locales/lt.cjs +2 -0
  761. package/node_modules/zod/v4/locales/lt.js +2 -0
  762. package/node_modules/zod/v4/locales/mk.cjs +2 -0
  763. package/node_modules/zod/v4/locales/mk.js +2 -0
  764. package/node_modules/zod/v4/locales/ms.cjs +2 -0
  765. package/node_modules/zod/v4/locales/ms.js +2 -0
  766. package/node_modules/zod/v4/locales/ne.cjs +2 -0
  767. package/node_modules/zod/v4/locales/ne.js +2 -0
  768. package/node_modules/zod/v4/locales/nl.cjs +2 -0
  769. package/node_modules/zod/v4/locales/nl.js +2 -0
  770. package/node_modules/zod/v4/locales/nn.cjs +2 -0
  771. package/node_modules/zod/v4/locales/nn.js +2 -0
  772. package/node_modules/zod/v4/locales/no.cjs +2 -0
  773. package/node_modules/zod/v4/locales/no.js +2 -0
  774. package/node_modules/zod/v4/locales/ota.cjs +2 -0
  775. package/node_modules/zod/v4/locales/ota.js +2 -0
  776. package/node_modules/zod/v4/locales/pl.cjs +2 -0
  777. package/node_modules/zod/v4/locales/pl.js +2 -0
  778. package/node_modules/zod/v4/locales/ps.cjs +2 -0
  779. package/node_modules/zod/v4/locales/ps.js +2 -0
  780. package/node_modules/zod/v4/locales/pt-BR.cjs +2 -0
  781. package/node_modules/zod/v4/locales/pt-BR.js +2 -0
  782. package/node_modules/zod/v4/locales/pt.cjs +2 -0
  783. package/node_modules/zod/v4/locales/pt.js +2 -0
  784. package/node_modules/zod/v4/locales/ro.cjs +2 -0
  785. package/node_modules/zod/v4/locales/ro.js +2 -0
  786. package/node_modules/zod/v4/locales/ru.cjs +2 -0
  787. package/node_modules/zod/v4/locales/ru.js +2 -0
  788. package/node_modules/zod/v4/locales/sk.cjs +2 -0
  789. package/node_modules/zod/v4/locales/sk.js +2 -0
  790. package/node_modules/zod/v4/locales/sl.cjs +2 -0
  791. package/node_modules/zod/v4/locales/sl.js +2 -0
  792. package/node_modules/zod/v4/locales/sv.cjs +2 -0
  793. package/node_modules/zod/v4/locales/sv.js +2 -0
  794. package/node_modules/zod/v4/locales/ta.cjs +2 -0
  795. package/node_modules/zod/v4/locales/ta.js +2 -0
  796. package/node_modules/zod/v4/locales/tg.cjs +144 -0
  797. package/node_modules/zod/v4/locales/tg.d.cts +5 -0
  798. package/node_modules/zod/v4/locales/tg.d.ts +4 -0
  799. package/node_modules/zod/v4/locales/tg.js +117 -0
  800. package/node_modules/zod/v4/locales/th.cjs +2 -0
  801. package/node_modules/zod/v4/locales/th.js +2 -0
  802. package/node_modules/zod/v4/locales/tk.cjs +2 -0
  803. package/node_modules/zod/v4/locales/tk.js +2 -0
  804. package/node_modules/zod/v4/locales/tr.cjs +2 -0
  805. package/node_modules/zod/v4/locales/tr.js +2 -0
  806. package/node_modules/zod/v4/locales/uk.cjs +2 -0
  807. package/node_modules/zod/v4/locales/uk.js +2 -0
  808. package/node_modules/zod/v4/locales/ur.cjs +2 -0
  809. package/node_modules/zod/v4/locales/ur.js +2 -0
  810. package/node_modules/zod/v4/locales/uz.cjs +2 -0
  811. package/node_modules/zod/v4/locales/uz.js +2 -0
  812. package/node_modules/zod/v4/locales/vi.cjs +2 -0
  813. package/node_modules/zod/v4/locales/vi.js +2 -0
  814. package/node_modules/zod/v4/locales/yo.cjs +2 -0
  815. package/node_modules/zod/v4/locales/yo.js +2 -0
  816. package/node_modules/zod/v4/locales/zh-CN.cjs +2 -0
  817. package/node_modules/zod/v4/locales/zh-CN.js +2 -0
  818. package/node_modules/zod/v4/locales/zh-TW.cjs +2 -0
  819. package/node_modules/zod/v4/locales/zh-TW.js +2 -0
  820. package/node_modules/zod/v4/mini/checks.cjs +19 -0
  821. package/node_modules/zod/v4/mini/coerce.cjs +19 -0
  822. package/node_modules/zod/v4/mini/deep-partial.cjs +19 -0
  823. package/node_modules/zod/v4/mini/external.cjs +22 -1
  824. package/node_modules/zod/v4/mini/external.d.cts +1 -1
  825. package/node_modules/zod/v4/mini/external.d.ts +1 -1
  826. package/node_modules/zod/v4/mini/external.js +1 -1
  827. package/node_modules/zod/v4/mini/in-out.cjs +19 -0
  828. package/node_modules/zod/v4/mini/index.cjs +19 -0
  829. package/node_modules/zod/v4/mini/iso.cjs +19 -0
  830. package/node_modules/zod/v4/mini/parse.cjs +19 -0
  831. package/node_modules/zod/v4/mini/schemas.cjs +44 -8
  832. package/node_modules/zod/v4/mini/schemas.d.cts +6 -1
  833. package/node_modules/zod/v4/mini/schemas.d.ts +6 -1
  834. package/node_modules/zod/v4/mini/schemas.js +21 -6
  835. package/node_modules/zod/v4-mini/index.cjs +19 -0
  836. package/openclaw.plugin.json +4 -2
  837. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"editor2.js","names":[],"sources":[],"mappings":""}
1
+ {"version":3,"file":"editor2.js","names":[],"sources":["../../src/editor/editor.css?inline"],"sourcesContent":["::selection {\n background-color: transparent;\n}\n\n/* Read-only deletion text sits outside the editor's selection overlay, so the\n global transparent ::selection above hides its selection by default. Reveal\n the native selection (so users can see what they select and copy) only while\n the user is actively selecting within deleted text: the editor sets\n data-deleted-text-selection on the diff while a pointer gesture starts there.\n Gating it this way means a normal selection of editable code that merely\n sweeps across an interleaved deleted line (unified view) does not highlight\n that line. Covers the whole deletions column in split view and individual\n deleted lines in unified view. */\n[data-deleted-text-selection] [data-deletions] ::selection,\n[data-deleted-text-selection] [data-line-type='change-deletion'] ::selection {\n background-color: var(--diffs-editor-selection-bg);\n}\n\n@keyframes blinking {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n:host, /* for scroll anchor */\n[data-code], /* for editor overlay */\n[data-content] /* for wrap line measurement */,\n[data-diff-type='split'][data-overflow='wrap'] {\n position: relative;\n}\n[data-code] {\n container-type: inline-size;\n}\n[data-content] {\n cursor: text;\n background-color: transparent;\n caret-color: var(--diffs-bg-caret);\n outline: none;\n}\n[data-line] {\n cursor: text;\n /* Transparent so the line's in-flow background can't hide the selection\n overlay (z-index -10); the line color moves to the ::after layer below it. */\n background-color: transparent;\n}\n/* Line background layer below the selection overlay (z-index -10) so the\n translucent selection composites over it. ::before is the +/- indicator. */\n[data-line]::after {\n content: '';\n position: absolute;\n inset: 0;\n z-index: -20;\n background-color: var(--diffs-line-bg);\n pointer-events: none;\n}\n/* The line-state pipeline resolves the active background. Keep the theme's\n border as an additional cue, including for border-only themes. */\n[data-line][data-editor-active-line]::after {\n box-shadow: inset 0 0 0 1px var(--diffs-editor-line-highlight-border);\n}\n\n[data-editor-overlay] {\n display: contents;\n}\n[data-caret],\n[data-edit-prediction],\n[data-selection-range],\n[data-match-range],\n[data-bracket-match-range],\n[data-edit-prediction-deletion-range],\n[data-edit-prediction-insertion-range],\n[data-edit-prediction-replacement-range],\n[data-marker-range],\n[data-remote-caret],\n[data-caret-highlight-range] {\n position: absolute;\n top: 0;\n left: 0;\n height: 1lh;\n line-height: var(--diffs-line-height);\n pointer-events: none;\n}\n[data-edit-prediction] {\n z-index: 1;\n height: auto;\n overflow: visible;\n width: max-content;\n user-select: none;\n color: var(\n --diffs-editor-edit-prediction-fg,\n color-mix(in lab, var(--diffs-fg) 45%, transparent)\n );\n}\n[data-edit-prediction-line] {\n box-sizing: border-box;\n display: block;\n min-height: 1lh;\n width: max-content;\n white-space: pre;\n}\n[data-edit-prediction][data-replacement] [data-edit-prediction-line],\n[data-edit-prediction-insertion-range],\n[data-edit-prediction-replacement-range] {\n background-color: var(--diffs-edit-prediction-bg, var(--diffs-bg));\n}\n[data-edit-prediction-suffix] {\n color: var(--diffs-fg);\n}\n[data-edit-prediction][data-wrap] [data-edit-prediction-line] {\n max-width: 100%;\n overflow-wrap: anywhere;\n white-space: pre-wrap;\n}\n[data-edit-prediction-line][data-empty]::after {\n content: '↵';\n}\n[data-edit-prediction-spacer] {\n margin-block-end: var(--diffs-edit-prediction-spacer-height);\n}\n/* The deletions column of a split diff shows no ghost text, so its reserved\n rows are padding: the row tint and the buffer hatch extend over them instead\n of leaving a blank strip. Buffers size themselves with a border-box\n min-height that would absorb the padding, hence content-box. */\n[data-code][data-deletions] [data-edit-prediction-spacer] {\n margin-block-end: 0;\n padding-block-end: var(--diffs-edit-prediction-spacer-height);\n box-sizing: content-box;\n}\n[data-edit-prediction-deletion-range] {\n --diffs-edit-prediction-deletion-color: var(\n --diffs-editor-edit-prediction-deletion-fg,\n color-mix(in lab, var(--diffs-deletion-base) 70%, transparent)\n );\n\n z-index: 1;\n background: linear-gradient(\n to bottom,\n transparent calc(50% - 0.5px),\n var(--diffs-edit-prediction-deletion-color) calc(50% - 0.5px),\n var(--diffs-edit-prediction-deletion-color) calc(50% + 0.5px),\n transparent calc(50% + 0.5px)\n );\n}\n[data-edit-prediction-insertion-range] {\n z-index: 0;\n}\n[data-edit-prediction-replacement-range] {\n z-index: 1;\n}\n[data-caret] {\n z-index: 2;\n width: 2px;\n background-color: var(\n --diffs-bg-caret-override,\n var(\n --diffs-editor-cursor-fg,\n light-dark(\n color-mix(in lab, var(--diffs-fg) 50%, var(--diffs-bg)),\n color-mix(in lab, var(--diffs-fg) 75%, var(--diffs-bg))\n )\n )\n );\n visibility: hidden;\n}\n/* Reduce motion only if user has set a preference */\n@media (prefers-reduced-motion: no-preference) {\n [data-caret] {\n animation: blinking 1.2s infinite;\n animation-delay: 0.8s;\n }\n}\n[data-selection-range] {\n z-index: -10;\n background-color: var(--diffs-editor-selection-bg);\n}\n[data-caret-highlight-range] {\n z-index: -10;\n background-color: var(\n --diffs-caret-highlight-bg,\n var(--diffs-editor-selection-bg)\n );\n}\n/* Masks the selection's square corner to fake rounding, so it must match the bg\n behind the selection: the line's diff color (passed in via\n --diffs-selection-corner-bg) or the editor base for context lines. */\n[data-selection-corner] {\n width: 100%;\n height: 100%;\n background-color: var(--diffs-selection-corner-bg, var(--diffs-bg));\n}\n[data-match-range] {\n z-index: -10;\n background-color: var(\n --diffs-editor-match-bg,\n var(--diffs-editor-selection-bg)\n );\n}\n[data-match-range]:not([data-focus]) {\n background-color: var(\n --diffs-editor-match-highlight-bg,\n light-dark(#ff963288, #ff963266)\n );\n}\n[data-bracket-match-range] {\n z-index: -9;\n box-sizing: border-box;\n border-bottom: 1px solid\n var(\n --diffs-editor-bracket-match-border,\n color-mix(in lab, var(--diffs-fg) 60%, transparent)\n );\n background-color: var(\n --diffs-editor-bracket-match-bg,\n color-mix(in lab, var(--diffs-fg) 5%, transparent)\n );\n}\n\n[data-rtl] {\n border-top-left-radius: 3px;\n}\n[data-rtr] {\n border-top-right-radius: 3px;\n}\n[data-rbl] {\n border-bottom-left-radius: 3px;\n}\n[data-rbr] {\n border-bottom-right-radius: 3px;\n}\n\n/* Markers\n *\n * Marker range applies a wavy underline. Severity attributes are used by both\n * `[data-marker-range]` and `[data-marker-popover]` alike.\n */\n\n[data-marker-range] {\n z-index: 1;\n background-color: var(--diffs-marker-bg);\n mask-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2IiBoZWlnaHQ9IjMiPjxwYXRoIGQ9Im0wIDIuNSBsMiAtMS41IGwxIDAgbDIgMS41IGwxIDAiIHN0cm9rZT0iI2ZmZiIgZmlsbD0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIi8+PC9zdmc+');\n mask-position: left bottom;\n mask-repeat: repeat-x;\n mask-size: 6px 3px;\n}\n\n[data-marker-error] {\n --diffs-marker-contrast: light-dark(#fff, #000);\n --diffs-marker-bg: var(--diffs-editor-error-fg, var(--diffs-deletion-base));\n}\n[data-marker-warning] {\n --diffs-marker-contrast: #000;\n --diffs-marker-bg: var(\n --diffs-editor-warning-fg,\n light-dark(var(--diffs-warning-light), var(--diffs-warning-dark))\n );\n}\n[data-marker-info] {\n --diffs-marker-contrast: #000;\n --diffs-marker-bg: var(--diffs-editor-info-fg, var(--diffs-modified-base));\n}\n[data-marker-hint] {\n --diffs-marker-contrast: light-dark(#fff, #000);\n --diffs-marker-bg: var(--diffs-editor-hint-fg, var(--diffs-fg-number));\n}\n\n@media (width >= 480px) {\n [data-content] {\n caret-color: transparent;\n }\n [data-content]:focus ~ [data-editor-overlay] [data-caret] {\n visibility: visible;\n }\n}\n\n/* Editor widgets\n *\n * Positioned popovers used across edit mode. Used by markers, search panel,\n * and selection action.\n */\n\n[data-editor-widget] {\n --diffs-widget-fg: var(--diffs-fg);\n --diffs-widget-bg: color-mix(in lab, var(--diffs-fg) 4%, var(--diffs-bg));\n --diffs-widget-border: color-mix(in lab, var(--diffs-fg) 20%, transparent);\n --diffs-widget-shadow:\n inset 0 0 0 1px var(--diffs-bg), 0 4px 8px rgb(0 0 0 / 0.075),\n 0 6px 18px rgb(0 0 0 / 0.075);\n position: absolute;\n top: 0;\n left: 0;\n z-index: 100;\n width: fit-content;\n max-width: calc(100% - 24px);\n font: 14px/20px var(--diffs-header-font-fallback);\n border: 1px solid var(--diffs-widget-border);\n border-radius: 9px;\n background-color: var(--diffs-widget-bg);\n background-clip: padding-box;\n box-shadow: var(--diffs-widget-shadow);\n}\n\n/* Shared geometry for the overlay popovers (marker hover popover and\n selection-action popover). Both are positioned in overlay coordinate space via\n --popover-x/--popover-y (set in JS). The left edge is clamped so the popover\n never slides under the line-number gutter (--gutter-width, also set in JS) or\n outside the visible scroll viewport, and the width is capped to match. Builds\n on [data-editor-widget]. */\n[data-marker-popover],\n[data-selection-action-popover] {\n --popover-gap: var(--diffs-popover-gap, var(--diffs-gap-fallback, 8px));\n --popover-viewport-left: 0px;\n --popover-viewport-right: 100cqw;\n /* Sentinels disable the vertical clamp until JS sets the real scrollport. */\n --popover-viewport-top: -99999px;\n --popover-viewport-bottom: 99999px;\n --popover-min-left: calc(\n var(--popover-viewport-left) + var(--gutter-width, 0px) + var(--popover-gap)\n );\n --popover-available-width: max(\n 0px,\n calc(\n var(--popover-viewport-right) - var(--popover-min-left) -\n var(--popover-gap)\n )\n );\n max-width: min(640px, var(--popover-available-width));\n translate: clamp(\n var(--popover-min-left),\n var(--popover-x, var(--popover-min-left)),\n calc(var(--popover-viewport-right) - var(--popover-gap) - 100%)\n )\n /* Clamp into the scrollport so a popover with no fitting side stays in view. */\n clamp(\n var(--popover-viewport-top),\n calc(var(--popover-y, 0px) + var(--popover-y-shift, 0px)),\n calc(var(--popover-viewport-bottom) - var(--popover-gap) - 100%)\n );\n}\n\n[data-marker-popover] {\n --diffs-widget-bg: var(--diffs-marker-bg);\n --diffs-widget-shadow:\n 0 4px 8px rgb(0 0 0 / 0.15), 0 6px 18px rgb(0 0 0 / 0.15);\n\n padding: 8px 12px;\n min-width: min(180px, var(--popover-available-width));\n overflow-wrap: anywhere;\n color: var(--diffs-marker-contrast);\n white-space: normal;\n border: 0;\n pointer-events: auto;\n\n @supports (color: contrast-color(red)) {\n color: contrast-color(var(--diffs-marker-bg, var(--diffs-bg)));\n }\n\n [data-marker-message] {\n white-space: normal;\n overflow-wrap: anywhere;\n\n code {\n display: inline;\n background-color: transparent;\n white-space: normal;\n color: inherit;\n }\n }\n}\n\n/* Selection Action Widget: a floating popover hosting the consumer's\n selection-action element. It reuses the shared [data-editor-widget] chrome and\n sits in the overlay layer (which is pointer-events: none), so it re-enables\n pointer events for its own actions. */\n[data-selection-action-popover] {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n align-items: center;\n width: max-content;\n padding: 4px;\n pointer-events: auto;\n}\n\n/* Search Panel Widget */\n[data-search-panel] {\n position: sticky;\n top: 16px;\n right: 16px;\n z-index: 100;\n display: flex;\n justify-content: right;\n flex-direction: column;\n width: 100%;\n /* Zero height ensures panel appears stickied immediately */\n height: 0;\n container: search-panel / inline-size;\n\n [data-editor-widget] {\n position: relative;\n z-index: 100;\n display: flex;\n flex-shrink: 0;\n align-items: stretch;\n gap: 8px;\n padding: 4px;\n max-width: 100%;\n min-width: 260px;\n margin-inline: auto 16px;\n }\n\n svg {\n display: block;\n fill: currentColor;\n width: 12px;\n height: 12px;\n }\n}\n\n[data-search-grid] {\n display: grid;\n grid-template-columns: auto auto auto;\n grid-template-areas:\n 'find matches nav'\n 'replace actions .';\n align-items: center;\n gap: 4px 6px;\n width: 100%;\n}\n[data-input-box][data-find] {\n grid-area: find;\n}\n[data-search-nav] {\n grid-area: nav;\n}\n[data-input-box][data-replace] {\n grid-area: replace;\n}\n[data-replace-actions] {\n grid-area: actions;\n}\n[data-search-grid][data-mode='find'] {\n grid-template-areas: 'find matches nav';\n}\n[data-search-grid][data-mode='find'] [data-replace-cell] {\n display: none;\n}\n\n@container search-panel (width < 400px) {\n [data-search-panel] [data-editor-widget] {\n padding: 10px;\n }\n [data-search-grid][data-mode='replace'] {\n grid-template-columns: auto 1fr auto;\n grid-template-areas:\n 'find find find'\n 'replace replace replace'\n 'nav matches actions';\n }\n [data-search-grid][data-mode='find'] {\n grid-template-columns: auto 1fr auto;\n grid-template-areas:\n 'find find find'\n 'nav matches matches';\n }\n [data-replace-actions] {\n justify-self: end;\n }\n [data-search-grid] [data-input-box] {\n width: auto;\n }\n}\n\n[data-input-box] {\n position: relative;\n display: flex;\n align-items: center;\n width: 200px;\n\n input {\n flex-grow: 1;\n width: 100%;\n min-width: 0;\n font-size: 13px;\n line-height: 24px;\n padding-inline: 6px;\n color: var(--diffs-fg);\n background-color: var(--diffs-bg);\n border: 1px solid color-mix(in lab, var(--diffs-fg) 12%, var(--diffs-bg));\n border-radius: 6px;\n outline: none;\n\n &::selection {\n background-color: color-mix(in lab, var(--diffs-fg) 8%, var(--diffs-bg));\n }\n\n &:focus-visible {\n outline: 1px solid var(--diffs-modified-base);\n }\n }\n\n &[data-find] input {\n /* Space for overlaid search icon toggles */\n padding-inline-end: 72px;\n }\n\n [data-search-icon] {\n --diffs-search-icon-size: 20px;\n }\n}\n\n[data-search-toggles] {\n position: absolute;\n top: 50%;\n right: 4px;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n gap: 1px;\n}\n\n[data-matches] {\n grid-area: matches;\n flex-shrink: 0;\n min-width: 50px;\n font-size: 12px;\n font-weight: 500;\n line-height: 20px;\n white-space: nowrap;\n color: color-mix(in lab, var(--diffs-fg) 50%, var(--diffs-bg));\n\n &[data-no-matches] {\n color: color-mix(in lab, var(--diffs-fg) 35%, var(--diffs-bg));\n }\n}\n\n[data-replace-actions],\n[data-search-nav] {\n display: flex;\n align-items: center;\n}\n\n/* Every clickable control is a real <button> tagged with data-search-icon;\n strip the UA chrome here so this single rule is the source of their\n appearance. */\n[data-search-icon] {\n display: flex;\n align-items: center;\n justify-content: center;\n appearance: none;\n flex-shrink: 0;\n width: var(--diffs-search-icon-size, 24px);\n height: var(--diffs-search-icon-size, 24px);\n margin: 0;\n padding: 0;\n color: color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg));\n border: 0;\n border-radius: var(--diffs-search-icon-radius, 4px);\n background: none;\n cursor: pointer;\n transition:\n background-color 0.1s ease-in-out,\n color 0.1s ease-in-out;\n\n &:disabled {\n opacity: 0.25;\n cursor: default;\n }\n &:not(:disabled):hover {\n color: var(--diffs-fg);\n }\n &:focus-visible {\n outline: 1px solid var(--diffs-modified-base);\n }\n &[aria-pressed='true'] {\n color: var(--diffs-modified-base);\n }\n}\n\n[data-search-close] {\n --diffs-search-icon-size: 20px;\n --diffs-search-icon-radius: 50%;\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n color: var(--diffs-widget-bg);\n background-color: color-mix(\n in lab,\n var(--diffs-widget-fg) 50%,\n var(--diffs-bg)\n );\n\n &:not(:disabled):hover {\n opacity: 1;\n color: var(--diffs-widget-bg);\n background-color: var(--diffs-widget-fg);\n }\n}\n"],"mappings":";AAAA,IAAA,iBAAe"}
@@ -1,6 +1,5 @@
1
1
  import { EditorSelection, TextEdit } from "./types.js";
2
2
  import { TextDocument } from "./textDocument.js";
3
-
4
3
  //#region src/editor/languages.d.ts
5
4
  interface LanguageConfig {
6
5
  lineComment?: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"languages.d.ts","names":[],"sources":["../../src/editor/languages.ts"],"mappings":";;;;UAMiB,cAAA;EACf,WAAA;EACA,YAAA,aAAyB,IAAA,UAAc,KAAA;AAAA;AAAA,KAG7B,iBAAA,GAAoB,QAAA,CAAS,MAAA,SAAe,cAAA;AAAA,UAE9C,sBAAA;EACR,WAAA;EACA,YAAA,YAAwB,IAAA,UAAc,KAAA;AAAA;;iBAwCxB,oBAAA,CACd,UAAA,UACA,SAAA,GAAY,iBAAA,GACX,sBAAsB;AAlDqB;AAAA,iBAyE9B,uBAAA,CACd,YAAA,EAAc,YAAA,EACd,UAAA,WAAqB,eAAA,IACrB,KAAA,WACC,QAAA;AAAA,UA+Fc,sBAAA;EACf,KAAA,EAAO,QAAA;EACP,oBAAA,EAAsB,KAAA,WAElB,KAAA,UACA,GAAA,UACA,SAAA,EAAW,eAAA;AAAA;;iBA+HD,wBAAA,CACd,YAAA,EAAc,YAAA,EACd,UAAA,WAAqB,eAAA,KACpB,IAAA,EAAM,KAAA,8BACP,QAAA,aACC,sBAAA"}
1
+ {"version":3,"file":"languages.d.ts","names":[],"sources":["../../src/editor/languages.ts"],"mappings":";;;UAMiB;EACf;EACA,yBAAyB,cAAc;;KAG7B,oBAAoB,SAAS,eAAe;UAE9C;EACR;EACA,wBAAwB,cAAc;;;iBAwCxB,qBACd,oBACA,YAAY,oBACX;;iBAuBa,wBACd,cAAc,cACd,qBAAqB,mBACrB,gBACC;UA+Fc;EACf,OAAO;EACP,sBAAsB,gBAElB,eACA,aACA,WAAW;;;iBA+HD,yBACd,cAAc,cACd,qBAAqB,oBACpB,MAAM,mCACP,qBACC"}
@@ -178,7 +178,7 @@ function findBlockComment(textDocument, open, close, from, to) {
178
178
  contentStart: from,
179
179
  contentEnd: to
180
180
  };
181
- const shortText = to - from <= BLOCK_COMMENT_SEARCH_MARGIN * 2 ? textDocument.getTextSlice(from, to) : void 0;
181
+ const shortText = to - from <= 100 ? textDocument.getTextSlice(from, to) : void 0;
182
182
  const startText = shortText ?? textDocument.getTextSlice(from, from + BLOCK_COMMENT_SEARCH_MARGIN);
183
183
  const endText = shortText ?? textDocument.getTextSlice(to - BLOCK_COMMENT_SEARCH_MARGIN, to);
184
184
  const startSpace = startText.length - startText.trimStart().length;
@@ -1 +1 @@
1
- {"version":3,"file":"languages.js","names":[],"sources":["../../src/editor/languages.ts"],"sourcesContent":["import type { TextDocument } from './textDocument';\nimport type { EditorSelection, TextEdit } from './types';\n\nconst DEFAULT_LINE_COMMENT = '//';\nconst DEFAULT_BLOCK_COMMENT = ['/*', '*/'] as const;\n\nexport interface LanguageConfig {\n lineComment?: string | null;\n blockComment?: readonly [open: string, close: string];\n}\n\nexport type LanguageConfigMap = Readonly<Record<string, LanguageConfig>>;\n\ninterface ResolvedLanguageConfig {\n lineComment: string | null;\n blockComment: readonly [open: string, close: string];\n}\n\n// Language comment configurations\n// Languages matching DEFAULT_LINE_COMMENT and DEFAULT_BLOCK_COMMENT are omitted.\nconst LANGUAGE_COMMENT_CONFIGS: LanguageConfigMap = {\n sql: { lineComment: '--' },\n ruby: { lineComment: '#', blockComment: ['=begin', '=end'] },\n rst: { lineComment: '..' },\n coffeescript: { lineComment: '#', blockComment: ['###', '###'] },\n cmd: { lineComment: '@REM' },\n julia: { lineComment: '#', blockComment: ['#=', '=#'] },\n yaml: { lineComment: '#' },\n yml: { lineComment: '#' },\n markdown: { lineComment: null, blockComment: ['<!--', '-->'] },\n zsh: { lineComment: '#' },\n makefile: { lineComment: '#' },\n handlebars: { lineComment: null, blockComment: ['{{!--', '--}}'] },\n ini: { lineComment: ';', blockComment: [';', ' '] },\n powershell: { lineComment: '#', blockComment: ['<#', '#>'] },\n vb: { lineComment: \"'\" },\n xml: { lineComment: null, blockComment: ['<!--', '-->'] },\n lua: { lineComment: '--', blockComment: ['--[[', ']]'] },\n html: { lineComment: null, blockComment: ['<!--', '-->'] },\n diff: { lineComment: '#', blockComment: ['#', ' '] },\n r: { lineComment: '#' },\n fsharp: { blockComment: ['(*', '*)'] },\n pug: { lineComment: '//-' },\n perl: { lineComment: '#' },\n tex: { lineComment: '%' },\n clojure: { lineComment: ';;' },\n css: { lineComment: null },\n python: { lineComment: '#', blockComment: ['\"\"\"', '\"\"\"'] },\n dotenv: { lineComment: '#' },\n dockerfile: { lineComment: '#' },\n razor: { lineComment: null, blockComment: ['<!--', '-->'] },\n prompt: { lineComment: null, blockComment: ['<!--', '-->'] },\n};\n\n/** Resolves language-specific comment tokens over the editor defaults. */\nexport function resolveCommentConfig(\n languageId: string,\n overrides?: LanguageConfigMap\n): ResolvedLanguageConfig {\n const config = {\n ...LANGUAGE_COMMENT_CONFIGS[languageId],\n ...overrides?.[languageId],\n };\n return {\n lineComment:\n config.lineComment === undefined\n ? DEFAULT_LINE_COMMENT\n : config.lineComment,\n blockComment: config.blockComment ?? DEFAULT_BLOCK_COMMENT,\n };\n}\n\ninterface LineCommentInfo {\n line: number;\n comment: number;\n empty: boolean;\n indent: number;\n single: boolean;\n}\n\n/** Builds one aligned batch of line-comment edits for all selected lines. */\nexport function resolveLineCommentEdits(\n textDocument: TextDocument,\n selections: readonly EditorSelection[],\n token: string\n): TextEdit[] {\n const lines: LineCommentInfo[] = [];\n const seenLines = new Set<number>();\n\n for (const selection of selections) {\n let endLine = selection.end.line;\n if (selection.start.line < endLine && selection.end.character === 0) {\n endLine--;\n }\n\n const startIndex = lines.length;\n let minIndent = Infinity;\n for (let line = selection.start.line; line <= endLine; line++) {\n if (seenLines.has(line)) {\n continue;\n }\n seenLines.add(line);\n const text = textDocument.getLineText(line);\n const indent = text.length - text.trimStart().length;\n const empty = indent === text.length;\n if (!empty) {\n minIndent = Math.min(minIndent, indent);\n }\n lines.push({\n line,\n comment:\n text.slice(indent, indent + token.length) === token ? indent : -1,\n empty,\n indent,\n single: false,\n });\n }\n\n if (minIndent !== Infinity) {\n for (let index = startIndex; index < lines.length; index++) {\n if (!lines[index].empty) {\n lines[index].indent = minIndent;\n }\n }\n }\n if (lines.length === startIndex + 1) {\n lines[startIndex].single = true;\n }\n }\n\n const shouldComment = lines.some(\n (line) => line.comment < 0 && (!line.empty || line.single)\n );\n const edits: TextEdit[] = [];\n if (shouldComment) {\n for (const line of lines) {\n if (line.empty && !line.single) {\n continue;\n }\n const position = { line: line.line, character: line.indent };\n edits.push({\n range: { start: position, end: position },\n newText: token + ' ',\n });\n }\n return edits;\n }\n\n for (const line of lines) {\n if (line.comment < 0) {\n continue;\n }\n const text = textDocument.getLineText(line.line);\n const start = line.comment;\n const end =\n start + token.length + (text[start + token.length] === ' ' ? 1 : 0);\n edits.push({\n range: {\n start: { line: line.line, character: start },\n end: { line: line.line, character: end },\n },\n newText: '',\n });\n }\n return edits;\n}\n\ninterface OffsetEdit {\n start: number;\n end: number;\n text: string;\n}\n\ninterface BlockCommentMatch {\n open: OffsetEdit;\n close: OffsetEdit;\n contentStart: number;\n contentEnd: number;\n}\n\nexport interface BlockCommentEditResult {\n edits: TextEdit[];\n nextSelectionOffsets: Array<\n readonly [\n start: number,\n end: number,\n direction: EditorSelection['direction'],\n ]\n >;\n}\n\nconst BLOCK_COMMENT_SEARCH_MARGIN = 50;\n\nfunction findBlockComment(\n textDocument: TextDocument,\n open: string,\n close: string,\n from: number,\n to: number\n): BlockCommentMatch | undefined {\n const beforeStart = Math.max(0, from - BLOCK_COMMENT_SEARCH_MARGIN);\n const textBefore = textDocument.getTextSlice(beforeStart, from);\n const textAfter = textDocument.getTextSlice(\n to,\n to + BLOCK_COMMENT_SEARCH_MARGIN\n );\n const spaceBefore = textBefore.length - textBefore.trimEnd().length;\n const spaceAfter = textAfter.length - textAfter.trimStart().length;\n const beforeOffset = textBefore.length - spaceBefore;\n if (\n textBefore.slice(beforeOffset - open.length, beforeOffset) === open &&\n textAfter.slice(spaceAfter, spaceAfter + close.length) === close\n ) {\n return {\n open: {\n start: from - spaceBefore - open.length,\n end: from - spaceBefore + (spaceBefore > 0 ? 1 : 0),\n text: '',\n },\n close: {\n start: to + spaceAfter - (spaceAfter > 0 ? 1 : 0),\n end: to + spaceAfter + close.length,\n text: '',\n },\n contentStart: from,\n contentEnd: to,\n };\n }\n\n const length = to - from;\n const shortText =\n length <= BLOCK_COMMENT_SEARCH_MARGIN * 2\n ? textDocument.getTextSlice(from, to)\n : undefined;\n const startText =\n shortText ??\n textDocument.getTextSlice(from, from + BLOCK_COMMENT_SEARCH_MARGIN);\n const endText =\n shortText ??\n textDocument.getTextSlice(to - BLOCK_COMMENT_SEARCH_MARGIN, to);\n const startSpace = startText.length - startText.trimStart().length;\n const endSpace = endText.length - endText.trimEnd().length;\n const closeStart = to - endSpace - close.length;\n if (\n startText.slice(startSpace, startSpace + open.length) !== open ||\n textDocument.getTextSlice(closeStart, closeStart + close.length) !== close\n ) {\n return undefined;\n }\n\n const openStart = from + startSpace;\n const openEnd =\n openStart +\n open.length +\n (/\\s/.test(startText[open.length + startSpace] ?? '') ? 1 : 0);\n const closeDeleteStart =\n closeStart -\n (/\\s/.test(textDocument.getTextSlice(closeStart - 1, closeStart)) ? 1 : 0);\n return {\n open: { start: openStart, end: openEnd, text: '' },\n close: {\n start: closeDeleteStart,\n end: closeStart + close.length,\n text: '',\n },\n contentStart: openEnd,\n contentEnd: closeDeleteStart,\n };\n}\n\nfunction mapOffset(\n offset: number,\n edits: readonly OffsetEdit[],\n cumulativeDeltas: readonly number[],\n association: -1 | 1\n): number {\n let low = 0;\n let high = edits.length;\n while (low < high) {\n const middle = (low + high) >>> 1;\n if (edits[middle].end < offset) {\n low = middle + 1;\n } else {\n high = middle;\n }\n }\n\n let delta = cumulativeDeltas[low];\n for (let index = low; index < edits.length; index++) {\n const edit = edits[index];\n if (offset < edit.start) {\n break;\n }\n if (edit.start === edit.end && offset === edit.start) {\n if (association < 0) {\n break;\n }\n delta += edit.text.length;\n continue;\n }\n if (offset > edit.end) {\n delta += edit.text.length - (edit.end - edit.start);\n continue;\n }\n if (offset === edit.end) {\n return edit.start + delta + edit.text.length;\n }\n return edit.start + delta + (association > 0 ? edit.text.length : 0);\n }\n return offset + delta;\n}\n\n/** Builds block-comment edits and content-preserving post-edit selections. */\nexport function resolveBlockCommentEdits(\n textDocument: TextDocument,\n selections: readonly EditorSelection[],\n [open, close]: readonly [string, string],\n linewise = false\n): BlockCommentEditResult | undefined {\n const ranges = selections.map((selection) => {\n let { start, end } = selection;\n if (linewise) {\n let endLine = end.line;\n if (start.line < endLine && end.character === 0) {\n endLine--;\n }\n const firstLine = textDocument.getLineText(start.line);\n const indent = firstLine.length - firstLine.trimStart().length;\n start = { line: start.line, character: indent };\n end = {\n line: endLine,\n character: textDocument.getLineLength(endLine),\n };\n }\n return {\n from: textDocument.offsetAt(start),\n to: textDocument.offsetAt(end),\n direction: selection.direction,\n comment: undefined as BlockCommentMatch | undefined,\n };\n });\n if (linewise && ranges.length > 1) {\n ranges.sort((a, b) => {\n const startOrder = a.from - b.from;\n return startOrder !== 0 ? startOrder : a.to - b.to;\n });\n let lastRangeIndex = 0;\n for (let index = 1; index < ranges.length; index++) {\n const previous = ranges[lastRangeIndex];\n const current = ranges[index];\n if (current.from <= previous.to) {\n previous.to = Math.max(previous.to, current.to);\n } else {\n ranges[++lastRangeIndex] = current;\n }\n }\n ranges.length = lastRangeIndex + 1;\n }\n for (const range of ranges) {\n range.comment = findBlockComment(\n textDocument,\n open,\n close,\n range.from,\n range.to\n );\n }\n\n const shouldUncomment = ranges.every((range) => range.comment !== undefined);\n const offsetEdits: OffsetEdit[] = [];\n for (const range of ranges) {\n const comment = range.comment;\n if (shouldUncomment && comment !== undefined) {\n offsetEdits.push(comment.open, comment.close);\n continue;\n }\n if (comment !== undefined) {\n continue;\n }\n if (range.from === range.to) {\n offsetEdits.push({\n start: range.from,\n end: range.to,\n text: open + ' ' + close,\n });\n continue;\n }\n offsetEdits.push(\n { start: range.from, end: range.from, text: open + ' ' },\n { start: range.to, end: range.to, text: ' ' + close }\n );\n }\n\n if (offsetEdits.length === 0) {\n return undefined;\n }\n offsetEdits.sort((a, b) => {\n const startOrder = a.start - b.start;\n return startOrder !== 0 ? startOrder : a.end - b.end;\n });\n const edits = offsetEdits.map((edit) => ({\n range: {\n start: textDocument.positionAt(edit.start),\n end: textDocument.positionAt(edit.end),\n },\n newText: edit.text,\n }));\n if (linewise) {\n return { edits, nextSelectionOffsets: [] };\n }\n\n const logicalRanges: Array<{\n start: number;\n end: number;\n startAssociation: -1 | 1;\n endAssociation: -1 | 1;\n collapsedInset?: number;\n }> = ranges.map((range) => {\n const comment = range.comment;\n if (shouldUncomment && comment !== undefined) {\n return {\n start: comment.contentStart,\n end: comment.contentEnd,\n startAssociation: 1,\n endAssociation: -1,\n };\n }\n if (comment !== undefined) {\n return {\n start: range.from,\n end: range.to,\n startAssociation: 1,\n endAssociation: 1,\n };\n }\n if (range.from === range.to) {\n return {\n start: range.from,\n end: range.to,\n startAssociation: -1,\n endAssociation: -1,\n collapsedInset: open.length + 1,\n };\n }\n return {\n start: range.from,\n end: range.to,\n startAssociation: 1,\n endAssociation: -1,\n };\n });\n const cumulativeDeltas = new Array<number>(offsetEdits.length + 1);\n cumulativeDeltas[0] = 0;\n for (let index = 0; index < offsetEdits.length; index++) {\n const edit = offsetEdits[index];\n cumulativeDeltas[index + 1] =\n cumulativeDeltas[index] + edit.text.length - (edit.end - edit.start);\n }\n const nextSelectionOffsets = logicalRanges.map((range, index) => {\n const start =\n mapOffset(\n range.start,\n offsetEdits,\n cumulativeDeltas,\n range.startAssociation\n ) + (range.collapsedInset ?? 0);\n const end =\n range.collapsedInset === undefined\n ? mapOffset(\n range.end,\n offsetEdits,\n cumulativeDeltas,\n range.endAssociation\n )\n : start;\n return [start, end, ranges[index].direction] as const;\n });\n\n return {\n edits,\n nextSelectionOffsets,\n };\n}\n"],"mappings":";AAGA,MAAM,uBAAuB;AAC7B,MAAM,wBAAwB,CAAC,MAAM,IAAI;AAgBzC,MAAM,2BAA8C;CAClD,KAAK,EAAE,aAAa,KAAK;CACzB,MAAM;EAAE,aAAa;EAAK,cAAc,CAAC,UAAU,MAAM;CAAE;CAC3D,KAAK,EAAE,aAAa,KAAK;CACzB,cAAc;EAAE,aAAa;EAAK,cAAc,CAAC,OAAO,KAAK;CAAE;CAC/D,KAAK,EAAE,aAAa,OAAO;CAC3B,OAAO;EAAE,aAAa;EAAK,cAAc,CAAC,MAAM,IAAI;CAAE;CACtD,MAAM,EAAE,aAAa,IAAI;CACzB,KAAK,EAAE,aAAa,IAAI;CACxB,UAAU;EAAE,aAAa;EAAM,cAAc,CAAC,QAAQ,KAAK;CAAE;CAC7D,KAAK,EAAE,aAAa,IAAI;CACxB,UAAU,EAAE,aAAa,IAAI;CAC7B,YAAY;EAAE,aAAa;EAAM,cAAc,CAAC,SAAS,MAAM;CAAE;CACjE,KAAK;EAAE,aAAa;EAAK,cAAc,CAAC,KAAK,GAAG;CAAE;CAClD,YAAY;EAAE,aAAa;EAAK,cAAc,CAAC,MAAM,IAAI;CAAE;CAC3D,IAAI,EAAE,aAAa,IAAI;CACvB,KAAK;EAAE,aAAa;EAAM,cAAc,CAAC,QAAQ,KAAK;CAAE;CACxD,KAAK;EAAE,aAAa;EAAM,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K;CAClE;CAqBA,OAAO;EACL;EACA,sBAtB2B,cAAc,KAAK,OAAO,UAAU;GAC/D,MAAM,QACJ,UACE,MAAM,OACN,aACA,kBACA,MAAM,gBACR,KAAK,MAAM,kBAAkB;GAU/B,OAAO;IAAC;IARN,MAAM,mBAAmB,KAAA,IACrB,UACE,MAAM,KACN,aACA,kBACA,MAAM,cACR,IACA;IACc,OAAO,MAAM,CAAC;GAAS;EAC7C,CAIqB;CACrB;AACF"}
1
+ {"version":3,"file":"languages.js","names":[],"sources":["../../src/editor/languages.ts"],"sourcesContent":["import type { TextDocument } from './textDocument';\nimport type { EditorSelection, TextEdit } from './types';\n\nconst DEFAULT_LINE_COMMENT = '//';\nconst DEFAULT_BLOCK_COMMENT = ['/*', '*/'] as const;\n\nexport interface LanguageConfig {\n lineComment?: string | null;\n blockComment?: readonly [open: string, close: string];\n}\n\nexport type LanguageConfigMap = Readonly<Record<string, LanguageConfig>>;\n\ninterface ResolvedLanguageConfig {\n lineComment: string | null;\n blockComment: readonly [open: string, close: string];\n}\n\n// Language comment configurations\n// Languages matching DEFAULT_LINE_COMMENT and DEFAULT_BLOCK_COMMENT are omitted.\nconst LANGUAGE_COMMENT_CONFIGS: LanguageConfigMap = {\n sql: { lineComment: '--' },\n ruby: { lineComment: '#', blockComment: ['=begin', '=end'] },\n rst: { lineComment: '..' },\n coffeescript: { lineComment: '#', blockComment: ['###', '###'] },\n cmd: { lineComment: '@REM' },\n julia: { lineComment: '#', blockComment: ['#=', '=#'] },\n yaml: { lineComment: '#' },\n yml: { lineComment: '#' },\n markdown: { lineComment: null, blockComment: ['<!--', '-->'] },\n zsh: { lineComment: '#' },\n makefile: { lineComment: '#' },\n handlebars: { lineComment: null, blockComment: ['{{!--', '--}}'] },\n ini: { lineComment: ';', blockComment: [';', ' '] },\n powershell: { lineComment: '#', blockComment: ['<#', '#>'] },\n vb: { lineComment: \"'\" },\n xml: { lineComment: null, blockComment: ['<!--', '-->'] },\n lua: { lineComment: '--', blockComment: ['--[[', ']]'] },\n html: { lineComment: null, blockComment: ['<!--', '-->'] },\n diff: { lineComment: '#', blockComment: ['#', ' '] },\n r: { lineComment: '#' },\n fsharp: { blockComment: ['(*', '*)'] },\n pug: { lineComment: '//-' },\n perl: { lineComment: '#' },\n tex: { lineComment: '%' },\n clojure: { lineComment: ';;' },\n css: { lineComment: null },\n python: { lineComment: '#', blockComment: ['\"\"\"', '\"\"\"'] },\n dotenv: { lineComment: '#' },\n dockerfile: { lineComment: '#' },\n razor: { lineComment: null, blockComment: ['<!--', '-->'] },\n prompt: { lineComment: null, blockComment: ['<!--', '-->'] },\n};\n\n/** Resolves language-specific comment tokens over the editor defaults. */\nexport function resolveCommentConfig(\n languageId: string,\n overrides?: LanguageConfigMap\n): ResolvedLanguageConfig {\n const config = {\n ...LANGUAGE_COMMENT_CONFIGS[languageId],\n ...overrides?.[languageId],\n };\n return {\n lineComment:\n config.lineComment === undefined\n ? DEFAULT_LINE_COMMENT\n : config.lineComment,\n blockComment: config.blockComment ?? DEFAULT_BLOCK_COMMENT,\n };\n}\n\ninterface LineCommentInfo {\n line: number;\n comment: number;\n empty: boolean;\n indent: number;\n single: boolean;\n}\n\n/** Builds one aligned batch of line-comment edits for all selected lines. */\nexport function resolveLineCommentEdits(\n textDocument: TextDocument,\n selections: readonly EditorSelection[],\n token: string\n): TextEdit[] {\n const lines: LineCommentInfo[] = [];\n const seenLines = new Set<number>();\n\n for (const selection of selections) {\n let endLine = selection.end.line;\n if (selection.start.line < endLine && selection.end.character === 0) {\n endLine--;\n }\n\n const startIndex = lines.length;\n let minIndent = Infinity;\n for (let line = selection.start.line; line <= endLine; line++) {\n if (seenLines.has(line)) {\n continue;\n }\n seenLines.add(line);\n const text = textDocument.getLineText(line);\n const indent = text.length - text.trimStart().length;\n const empty = indent === text.length;\n if (!empty) {\n minIndent = Math.min(minIndent, indent);\n }\n lines.push({\n line,\n comment:\n text.slice(indent, indent + token.length) === token ? indent : -1,\n empty,\n indent,\n single: false,\n });\n }\n\n if (minIndent !== Infinity) {\n for (let index = startIndex; index < lines.length; index++) {\n if (!lines[index].empty) {\n lines[index].indent = minIndent;\n }\n }\n }\n if (lines.length === startIndex + 1) {\n lines[startIndex].single = true;\n }\n }\n\n const shouldComment = lines.some(\n (line) => line.comment < 0 && (!line.empty || line.single)\n );\n const edits: TextEdit[] = [];\n if (shouldComment) {\n for (const line of lines) {\n if (line.empty && !line.single) {\n continue;\n }\n const position = { line: line.line, character: line.indent };\n edits.push({\n range: { start: position, end: position },\n newText: token + ' ',\n });\n }\n return edits;\n }\n\n for (const line of lines) {\n if (line.comment < 0) {\n continue;\n }\n const text = textDocument.getLineText(line.line);\n const start = line.comment;\n const end =\n start + token.length + (text[start + token.length] === ' ' ? 1 : 0);\n edits.push({\n range: {\n start: { line: line.line, character: start },\n end: { line: line.line, character: end },\n },\n newText: '',\n });\n }\n return edits;\n}\n\ninterface OffsetEdit {\n start: number;\n end: number;\n text: string;\n}\n\ninterface BlockCommentMatch {\n open: OffsetEdit;\n close: OffsetEdit;\n contentStart: number;\n contentEnd: number;\n}\n\nexport interface BlockCommentEditResult {\n edits: TextEdit[];\n nextSelectionOffsets: Array<\n readonly [\n start: number,\n end: number,\n direction: EditorSelection['direction'],\n ]\n >;\n}\n\nconst BLOCK_COMMENT_SEARCH_MARGIN = 50;\n\nfunction findBlockComment(\n textDocument: TextDocument,\n open: string,\n close: string,\n from: number,\n to: number\n): BlockCommentMatch | undefined {\n const beforeStart = Math.max(0, from - BLOCK_COMMENT_SEARCH_MARGIN);\n const textBefore = textDocument.getTextSlice(beforeStart, from);\n const textAfter = textDocument.getTextSlice(\n to,\n to + BLOCK_COMMENT_SEARCH_MARGIN\n );\n const spaceBefore = textBefore.length - textBefore.trimEnd().length;\n const spaceAfter = textAfter.length - textAfter.trimStart().length;\n const beforeOffset = textBefore.length - spaceBefore;\n if (\n textBefore.slice(beforeOffset - open.length, beforeOffset) === open &&\n textAfter.slice(spaceAfter, spaceAfter + close.length) === close\n ) {\n return {\n open: {\n start: from - spaceBefore - open.length,\n end: from - spaceBefore + (spaceBefore > 0 ? 1 : 0),\n text: '',\n },\n close: {\n start: to + spaceAfter - (spaceAfter > 0 ? 1 : 0),\n end: to + spaceAfter + close.length,\n text: '',\n },\n contentStart: from,\n contentEnd: to,\n };\n }\n\n const length = to - from;\n const shortText =\n length <= BLOCK_COMMENT_SEARCH_MARGIN * 2\n ? textDocument.getTextSlice(from, to)\n : undefined;\n const startText =\n shortText ??\n textDocument.getTextSlice(from, from + BLOCK_COMMENT_SEARCH_MARGIN);\n const endText =\n shortText ??\n textDocument.getTextSlice(to - BLOCK_COMMENT_SEARCH_MARGIN, to);\n const startSpace = startText.length - startText.trimStart().length;\n const endSpace = endText.length - endText.trimEnd().length;\n const closeStart = to - endSpace - close.length;\n if (\n startText.slice(startSpace, startSpace + open.length) !== open ||\n textDocument.getTextSlice(closeStart, closeStart + close.length) !== close\n ) {\n return undefined;\n }\n\n const openStart = from + startSpace;\n const openEnd =\n openStart +\n open.length +\n (/\\s/.test(startText[open.length + startSpace] ?? '') ? 1 : 0);\n const closeDeleteStart =\n closeStart -\n (/\\s/.test(textDocument.getTextSlice(closeStart - 1, closeStart)) ? 1 : 0);\n return {\n open: { start: openStart, end: openEnd, text: '' },\n close: {\n start: closeDeleteStart,\n end: closeStart + close.length,\n text: '',\n },\n contentStart: openEnd,\n contentEnd: closeDeleteStart,\n };\n}\n\nfunction mapOffset(\n offset: number,\n edits: readonly OffsetEdit[],\n cumulativeDeltas: readonly number[],\n association: -1 | 1\n): number {\n let low = 0;\n let high = edits.length;\n while (low < high) {\n const middle = (low + high) >>> 1;\n if (edits[middle].end < offset) {\n low = middle + 1;\n } else {\n high = middle;\n }\n }\n\n let delta = cumulativeDeltas[low];\n for (let index = low; index < edits.length; index++) {\n const edit = edits[index];\n if (offset < edit.start) {\n break;\n }\n if (edit.start === edit.end && offset === edit.start) {\n if (association < 0) {\n break;\n }\n delta += edit.text.length;\n continue;\n }\n if (offset > edit.end) {\n delta += edit.text.length - (edit.end - edit.start);\n continue;\n }\n if (offset === edit.end) {\n return edit.start + delta + edit.text.length;\n }\n return edit.start + delta + (association > 0 ? edit.text.length : 0);\n }\n return offset + delta;\n}\n\n/** Builds block-comment edits and content-preserving post-edit selections. */\nexport function resolveBlockCommentEdits(\n textDocument: TextDocument,\n selections: readonly EditorSelection[],\n [open, close]: readonly [string, string],\n linewise = false\n): BlockCommentEditResult | undefined {\n const ranges = selections.map((selection) => {\n let { start, end } = selection;\n if (linewise) {\n let endLine = end.line;\n if (start.line < endLine && end.character === 0) {\n endLine--;\n }\n const firstLine = textDocument.getLineText(start.line);\n const indent = firstLine.length - firstLine.trimStart().length;\n start = { line: start.line, character: indent };\n end = {\n line: endLine,\n character: textDocument.getLineLength(endLine),\n };\n }\n return {\n from: textDocument.offsetAt(start),\n to: textDocument.offsetAt(end),\n direction: selection.direction,\n comment: undefined as BlockCommentMatch | undefined,\n };\n });\n if (linewise && ranges.length > 1) {\n ranges.sort((a, b) => {\n const startOrder = a.from - b.from;\n return startOrder !== 0 ? startOrder : a.to - b.to;\n });\n let lastRangeIndex = 0;\n for (let index = 1; index < ranges.length; index++) {\n const previous = ranges[lastRangeIndex];\n const current = ranges[index];\n if (current.from <= previous.to) {\n previous.to = Math.max(previous.to, current.to);\n } else {\n ranges[++lastRangeIndex] = current;\n }\n }\n ranges.length = lastRangeIndex + 1;\n }\n for (const range of ranges) {\n range.comment = findBlockComment(\n textDocument,\n open,\n close,\n range.from,\n range.to\n );\n }\n\n const shouldUncomment = ranges.every((range) => range.comment !== undefined);\n const offsetEdits: OffsetEdit[] = [];\n for (const range of ranges) {\n const comment = range.comment;\n if (shouldUncomment && comment !== undefined) {\n offsetEdits.push(comment.open, comment.close);\n continue;\n }\n if (comment !== undefined) {\n continue;\n }\n if (range.from === range.to) {\n offsetEdits.push({\n start: range.from,\n end: range.to,\n text: open + ' ' + close,\n });\n continue;\n }\n offsetEdits.push(\n { start: range.from, end: range.from, text: open + ' ' },\n { start: range.to, end: range.to, text: ' ' + close }\n );\n }\n\n if (offsetEdits.length === 0) {\n return undefined;\n }\n offsetEdits.sort((a, b) => {\n const startOrder = a.start - b.start;\n return startOrder !== 0 ? startOrder : a.end - b.end;\n });\n const edits = offsetEdits.map((edit) => ({\n range: {\n start: textDocument.positionAt(edit.start),\n end: textDocument.positionAt(edit.end),\n },\n newText: edit.text,\n }));\n if (linewise) {\n return { edits, nextSelectionOffsets: [] };\n }\n\n const logicalRanges: Array<{\n start: number;\n end: number;\n startAssociation: -1 | 1;\n endAssociation: -1 | 1;\n collapsedInset?: number;\n }> = ranges.map((range) => {\n const comment = range.comment;\n if (shouldUncomment && comment !== undefined) {\n return {\n start: comment.contentStart,\n end: comment.contentEnd,\n startAssociation: 1,\n endAssociation: -1,\n };\n }\n if (comment !== undefined) {\n return {\n start: range.from,\n end: range.to,\n startAssociation: 1,\n endAssociation: 1,\n };\n }\n if (range.from === range.to) {\n return {\n start: range.from,\n end: range.to,\n startAssociation: -1,\n endAssociation: -1,\n collapsedInset: open.length + 1,\n };\n }\n return {\n start: range.from,\n end: range.to,\n startAssociation: 1,\n endAssociation: -1,\n };\n });\n const cumulativeDeltas = new Array<number>(offsetEdits.length + 1);\n cumulativeDeltas[0] = 0;\n for (let index = 0; index < offsetEdits.length; index++) {\n const edit = offsetEdits[index];\n cumulativeDeltas[index + 1] =\n cumulativeDeltas[index] + edit.text.length - (edit.end - edit.start);\n }\n const nextSelectionOffsets = logicalRanges.map((range, index) => {\n const start =\n mapOffset(\n range.start,\n offsetEdits,\n cumulativeDeltas,\n range.startAssociation\n ) + (range.collapsedInset ?? 0);\n const end =\n range.collapsedInset === undefined\n ? mapOffset(\n range.end,\n offsetEdits,\n cumulativeDeltas,\n range.endAssociation\n )\n : start;\n return [start, end, ranges[index].direction] as const;\n });\n\n return {\n edits,\n nextSelectionOffsets,\n };\n}\n"],"mappings":";AAGA,MAAM,uBAAuB;AAC7B,MAAM,wBAAwB,CAAC,MAA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E;CACF,IAAI,UACF,OAAO;EAAE;EAAO,sBAAsB,CAAC;CAAE;CAG3C,MAAM,gBAMD,OAAO,KAAK,UAAU;EACzB,MAAM,UAAU,MAAM;EACtB,IAAI,mBAAmB,YAAY,KAAA,GACjC,OAAO;GACL,OAAO,QAAQ;GACf,KAAK,QAAQ;GACb,kBAAkB;GAClB,gBAAgB;EAClB;EAEF,IAAI,YAAY,KAAA,GACd,OAAO;GACL,OAAO,MAAM;GACb,KAAK,MAAM;GACX,kBAAkB;GAClB,gBAAgB;EAClB;EAEF,IAAI,MAAM,SAAS,MAAM,IACvB,OAAO;GACL,OAAO,MAAM;GACb,KAAK,MAAM;GACX,kBAAkB;GAClB,gBAAgB;GAChB,gBAAgB,KAAK,SAAS;EAChC;EAEF,OAAO;GACL,OAAO,MAAM;GACb,KAAK,MAAM;GACX,kBAAkB;GAClB,gBAAgB;EAClB;CACF,CAAC;CACD,MAAM,mBAAmB,IAAI,MAAc,YAAY,SAAS,CAAC;CACjE,iBAAiB,KAAK;CACtB,KAAK,IAAI,QAAQ,GAAG,QAAQ,YAAY,QAAQ,SAAS;EACvD,MAAM,OAAO,YAAY;EACzB,iBAAiB,QAAQ,KACvB,iBAAiB,SAAS,KAAK,KAAK,UAAU,KAAK,MAAM,KAAK;CAClE;CAqBA,OAAO;EACL;EACA,sBAtB2B,cAAc,KAAK,OAAO,UAAU;GAC/D,MAAM,QACJ,UACE,MAAM,OACN,aACA,kBACA,MAAM,gBACR,KAAK,MAAM,kBAAkB;GAU/B,OAAO;IAAC;IARN,MAAM,mBAAmB,KAAA,IACrB,UACE,MAAM,KACN,aACA,kBACA,MAAM,cACR,IACA;IACc,OAAO,MAAM,CAAC;GAAS;EAC7C,CAIqB;CACrB;AACF"}
@@ -1,6 +1,5 @@
1
1
  import { TextDocumentChange } from "./textDocument.js";
2
2
  import { LineAnnotationPosition } from "../utils/lineAnnotationIdentity.js";
3
-
4
3
  //#region src/editor/lineAnnotations.d.ts
5
4
  declare function applyDocumentChangeToLineAnnotations<TLineAnnotation extends LineAnnotationPosition>(change: TextDocumentChange, lineAnnotations: TLineAnnotation[]): TLineAnnotation[] | undefined;
6
5
  declare function renderLineAnnotations<TLineAnnotation extends LineAnnotationPosition>(lineAnnotations: TLineAnnotation[], contentEl: HTMLElement, gutterEl?: HTMLElement, getName?: (annotation: TLineAnnotation) => string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"lineAnnotations.d.ts","names":[],"sources":["../../src/editor/lineAnnotations.ts"],"mappings":";;;;iBAwBgB,oCAAA,yBACU,sBAAA,EAExB,MAAA,EAAQ,kBAAA,EACR,eAAA,EAAiB,eAAA,KAChB,eAAA;AAAA,iBAmNa,qBAAA,yBACU,sBAAA,EAExB,eAAA,EAAiB,eAAA,IACjB,SAAA,EAAW,WAAA,EACX,QAAA,GAAW,WAAA,EACX,OAAA,IACE,UAAA,EAAY,eAAA"}
1
+ {"version":3,"file":"lineAnnotations.d.ts","names":[],"sources":["../../src/editor/lineAnnotations.ts"],"mappings":";;;iBAwBgB,qCACd,wBAAwB,wBAExB,QAAQ,oBACR,iBAAiB,oBAChB;iBAmNa,sBACd,wBAAwB,wBAExB,iBAAiB,mBACjB,WAAW,aACX,WAAW,aACX,WACE,YAAY"}
@@ -157,8 +157,9 @@ function createLineAnnotationElements(lineAnnotations, contentEl, gutterEl) {
157
157
  if (lineNumber !== void 0) {
158
158
  const annotations = lineAnnotations.get(lineNumber);
159
159
  if (annotations !== void 0) {
160
+ const lineIndex = lineNumber - 1;
160
161
  const annotationElement = h("div", {
161
- dataset: { lineAnnotation: "0," + (lineNumber - 1) },
162
+ dataset: { lineAnnotation: "0," + lineIndex },
162
163
  children: [h("div", {
163
164
  dataset: "annotationContent",
164
165
  children: annotations.map((name) => h("slot", { name }))
@@ -1 +1 @@
1
- {"version":3,"file":"lineAnnotations.js","names":[],"sources":["../../src/editor/lineAnnotations.ts"],"sourcesContent":["import { getLineAnnotationName } from '../utils/getLineAnnotationName';\nimport {\n getLineAnnotationSource,\n type LineAnnotationPosition,\n recordLineAnnotationSource,\n} from '../utils/lineAnnotationIdentity';\nimport type { TextDocumentChange } from './textDocument';\nimport { getLineNumberAttr, h } from './utils';\n\ninterface LineAnnotationChange {\n readonly startLine: number;\n readonly startCharacter: number;\n readonly endLine: number;\n readonly deletesEndLine: boolean;\n readonly insertedLineBreaks: number;\n readonly lineDelta: number;\n}\n\nfunction getDefaultLineAnnotationName(\n annotation: LineAnnotationPosition\n): string {\n return getLineAnnotationName(annotation);\n}\n\nexport function applyDocumentChangeToLineAnnotations<\n TLineAnnotation extends LineAnnotationPosition,\n>(\n change: TextDocumentChange,\n lineAnnotations: TLineAnnotation[]\n): TLineAnnotation[] | undefined {\n const annotationChanges = getLineAnnotationChanges(change);\n if (annotationChanges.length === 0) {\n return undefined;\n }\n\n const nextLineAnnotations: TLineAnnotation[] = [];\n let changed = false;\n for (const annotation of lineAnnotations) {\n if (\n ('side' in annotation && annotation.side === 'deletions') ||\n annotation.lineNumber <= 0\n ) {\n // Annotations that should not be repositioned\n nextLineAnnotations.push(annotation);\n continue;\n }\n\n let line: number | undefined = annotation.lineNumber - 1;\n let lineCount = change.previousLineCount;\n let annotationChanged = false;\n for (const lineChange of annotationChanges) {\n const nextLineCount = Math.max(1, lineCount + lineChange.lineDelta);\n const nextLine = mapLineThroughLineChange(\n line,\n lineChange,\n nextLineCount\n );\n if (nextLine === undefined) {\n annotationChanged = true;\n line = undefined;\n break;\n }\n if (\n nextLine !== line ||\n lineChangeTouchesAnnotationLine(line, lineChange)\n ) {\n annotationChanged = true;\n }\n line = nextLine;\n lineCount = nextLineCount;\n }\n\n if (line === undefined) {\n changed = true;\n continue;\n }\n\n const lineNumber = line + 1;\n if (annotationChanged) {\n if (lineNumber === annotation.lineNumber) {\n nextLineAnnotations.push(annotation);\n } else {\n const moved = { ...annotation, lineNumber };\n recordLineAnnotationSource(moved, getLineAnnotationSource(annotation));\n nextLineAnnotations.push(moved);\n }\n changed = true;\n continue;\n }\n\n nextLineAnnotations.push(annotation);\n }\n\n return changed ? nextLineAnnotations : undefined;\n}\n\nfunction getLineAnnotationChanges(\n change: TextDocumentChange\n): readonly LineAnnotationChange[] {\n if (change.changedLineChanges !== undefined) {\n return change.changedLineChanges.flatMap(\n ([\n startLine,\n changedEndLine,\n lineDelta,\n startCharacter = 0,\n _endCharacter = 0,\n endedAtDocumentEnd = false,\n ]) => {\n if (lineDelta === 0) {\n return [];\n }\n const insertedLineBreaks = Math.max(0, changedEndLine - startLine);\n const removedLineCount = Math.max(0, insertedLineBreaks - lineDelta);\n return [\n {\n startLine,\n startCharacter,\n endLine: startLine + removedLineCount,\n deletesEndLine: lineDelta < 0 && endedAtDocumentEnd,\n insertedLineBreaks,\n lineDelta,\n },\n ];\n }\n );\n }\n\n if (change.lineDelta === 0) {\n return change.changedLineRanges.flatMap(([startLine, endLine]) => {\n const insertedLineBreaks = endLine - startLine;\n if (insertedLineBreaks <= 0) {\n return [];\n }\n return [\n {\n startLine,\n startCharacter: 0,\n endLine: startLine,\n deletesEndLine: false,\n insertedLineBreaks,\n lineDelta: insertedLineBreaks,\n },\n ];\n });\n }\n const removedLineCount = Math.max(0, -change.lineDelta);\n const deletedToDocumentEnd =\n change.endedAtDocumentEnd &&\n change.startLine + removedLineCount === change.previousLineCount - 1;\n return [\n {\n startLine: change.startLine,\n startCharacter: change.startCharacter,\n endLine: change.startLine + removedLineCount,\n deletesEndLine: deletedToDocumentEnd,\n insertedLineBreaks: Math.max(0, change.lineDelta),\n lineDelta: change.lineDelta,\n },\n ];\n}\n\nfunction mapLineThroughLineChange(\n line: number,\n lineChange: LineAnnotationChange,\n nextLineCount: number\n): number | undefined {\n if (line < lineChange.startLine) {\n return line;\n }\n\n if (\n line > lineChange.endLine ||\n (lineChange.endLine > lineChange.startLine &&\n line === lineChange.endLine &&\n !lineChange.deletesEndLine)\n ) {\n return line + lineChange.lineDelta;\n }\n\n if (lineChange.startLine === lineChange.endLine) {\n if (lineChange.startCharacter === 0) {\n return line + lineChange.insertedLineBreaks;\n }\n return line;\n }\n\n if (lineChangeDeletesAnnotationLine(line, lineChange)) {\n return undefined;\n }\n\n const replacementLineOffset = Math.min(\n Math.max(0, line - lineChange.startLine),\n lineChange.insertedLineBreaks\n );\n return clampLine(lineChange.startLine + replacementLineOffset, nextLineCount);\n}\n\nfunction lineChangeDeletesAnnotationLine(\n line: number,\n lineChange: LineAnnotationChange\n): boolean {\n if (\n lineChange.lineDelta >= 0 ||\n line < lineChange.startLine ||\n line > lineChange.endLine\n ) {\n return false;\n }\n if (line === lineChange.startLine && lineChange.startCharacter > 0) {\n return false;\n }\n if (line === lineChange.endLine && !lineChange.deletesEndLine) {\n return false;\n }\n return true;\n}\n\nfunction lineChangeTouchesAnnotationLine(\n line: number,\n lineChange: LineAnnotationChange\n): boolean {\n if (\n lineChange.lineDelta === 0 ||\n line < lineChange.startLine ||\n line > lineChange.endLine\n ) {\n return false;\n }\n return !(\n lineChange.endLine > lineChange.startLine &&\n line === lineChange.endLine &&\n !lineChange.deletesEndLine\n );\n}\n\nfunction clampLine(line: number, lineCount: number): number {\n return Math.max(0, Math.min(line, Math.max(0, lineCount - 1)));\n}\n\nexport function renderLineAnnotations<\n TLineAnnotation extends LineAnnotationPosition,\n>(\n lineAnnotations: TLineAnnotation[],\n contentEl: HTMLElement,\n gutterEl?: HTMLElement,\n getName: (\n annotation: TLineAnnotation\n ) => string = getDefaultLineAnnotationName\n): void {\n const additionAnnotations = new Map<number, string[]>();\n const deletionAnnotations = new Map<number, string[]>();\n for (const annotation of lineAnnotations) {\n const lineNumber = annotation.lineNumber;\n if (!additionAnnotations.has(lineNumber)) {\n additionAnnotations.set(lineNumber, []);\n }\n if (!deletionAnnotations.has(lineNumber)) {\n deletionAnnotations.set(lineNumber, []);\n }\n const map =\n 'side' in annotation && annotation.side === 'deletions'\n ? deletionAnnotations\n : additionAnnotations;\n map.get(lineNumber)!.push(getName(annotation));\n }\n\n const leftCodeElement = contentEl.parentElement?.previousElementSibling;\n let leftGutterElement: HTMLElement | undefined;\n let leftContentElement: HTMLElement | undefined;\n if (\n leftCodeElement != null &&\n leftCodeElement instanceof HTMLElement &&\n leftCodeElement.dataset.deletions !== undefined\n ) {\n for (const child of leftCodeElement.children) {\n const el = child as HTMLElement;\n const { gutter, content } = el.dataset;\n if (gutter !== undefined) {\n leftGutterElement = el;\n } else if (content !== undefined) {\n leftContentElement = el;\n }\n }\n }\n\n cleanLineAnnotationElements(contentEl, gutterEl);\n if (leftContentElement !== undefined) {\n cleanLineAnnotationElements(leftContentElement, leftGutterElement);\n }\n\n const additionsAnnotationElements = createLineAnnotationElements(\n additionAnnotations,\n contentEl,\n gutterEl\n );\n if (leftContentElement === undefined) {\n return;\n }\n\n const deletionsAnnotationElements = createLineAnnotationElements(\n deletionAnnotations,\n leftContentElement,\n leftGutterElement\n );\n\n requestAnimationFrame(() => {\n syncPairedLineAnnotationHeights(\n additionAnnotations,\n deletionAnnotations,\n additionsAnnotationElements,\n deletionsAnnotationElements\n );\n });\n}\n\nfunction cleanLineAnnotationElements(\n contentEl: HTMLElement,\n gutterEl?: HTMLElement\n): void {\n const staleElements: HTMLElement[] = [];\n for (let i = 1; i < contentEl.childElementCount; i++) {\n const el = contentEl.children[i] as HTMLElement;\n if (el.dataset.lineAnnotation !== undefined) {\n staleElements.push(el);\n if (gutterEl !== undefined) {\n staleElements.push(gutterEl.children[i] as HTMLElement);\n }\n }\n }\n for (const el of staleElements) {\n el.remove();\n }\n}\n\nfunction createLineAnnotationElements(\n lineAnnotations: Map<number, string[]>,\n contentEl: HTMLElement,\n gutterEl?: HTMLElement\n): Map<number, HTMLElement> {\n const annotationElements = new Map<number, HTMLElement>();\n for (const el of contentEl.children) {\n const lineNumber = getLineNumberAttr(el as HTMLElement);\n if (lineNumber !== undefined) {\n const annotations = lineAnnotations.get(lineNumber);\n if (annotations !== undefined) {\n const lineIndex = lineNumber - 1;\n const annotationElement = h('div', {\n dataset: {\n lineAnnotation: '0,' + lineIndex,\n },\n children: [\n h('div', {\n dataset: 'annotationContent',\n children: annotations.map((name) => h('slot', { name })),\n }),\n ],\n });\n el.after(annotationElement);\n annotationElements.set(lineNumber, annotationElement);\n }\n }\n }\n\n if (gutterEl !== undefined) {\n for (const el of gutterEl.children) {\n const lineNumber = getLineNumberAttr(el as HTMLElement, 'columnNumber');\n if (lineNumber !== undefined && lineAnnotations.has(lineNumber)) {\n const bufferEl = h('div', {\n dataset: {\n gutterBuffer: 'annotation',\n bufferSize: '1',\n },\n style: {\n gridRow: 'span 1',\n },\n });\n el.after(bufferEl);\n }\n }\n }\n\n return annotationElements;\n}\n\nfunction syncPairedLineAnnotationHeights(\n additionAnnotations: Map<number, string[]>,\n deletionAnnotations: Map<number, string[]>,\n additionAnnotationElements: Map<number, HTMLElement>,\n deletionAnnotationElements: Map<number, HTMLElement>\n): void {\n const offsetHeights = new Map<number, number>();\n for (const [lineNumber, annotations] of additionAnnotations.entries()) {\n const annotationElement = deletionAnnotationElements.get(lineNumber);\n if (annotations.length === 0 && annotationElement !== undefined) {\n const height = measureAnnotationContentHeight(annotationElement);\n if (height > 0) {\n offsetHeights.set(lineNumber, height);\n }\n }\n }\n for (const [lineNumber, annotations] of deletionAnnotations.entries()) {\n const annotationElement = additionAnnotationElements.get(lineNumber);\n if (annotations.length === 0 && annotationElement !== undefined) {\n const height = measureAnnotationContentHeight(annotationElement);\n if (height > 0) {\n offsetHeights.set(lineNumber, height);\n }\n }\n }\n applyLineAnnotationMinHeights(\n additionAnnotations,\n additionAnnotationElements,\n offsetHeights\n );\n applyLineAnnotationMinHeights(\n deletionAnnotations,\n deletionAnnotationElements,\n offsetHeights\n );\n}\n\nfunction measureAnnotationContentHeight(lineAnnotationEl: HTMLElement): number {\n const content = lineAnnotationEl.firstElementChild;\n if (!(content instanceof HTMLElement)) {\n return 0;\n }\n return content.getBoundingClientRect().height;\n}\n\nfunction applyLineAnnotationMinHeights(\n lineAnnotations: Map<number, string[]>,\n annotationElements: Map<number, HTMLElement>,\n offsetHeights: Map<number, number>\n): void {\n for (const [lineNumber, annotationElement] of annotationElements.entries()) {\n const annotations = lineAnnotations.get(lineNumber);\n const offsetHeight = offsetHeights.get(lineNumber);\n if (annotations?.length === 0 && offsetHeight !== undefined) {\n annotationElement.style.setProperty(\n '--diffs-annotation-min-height',\n `${offsetHeight}px`\n );\n }\n }\n}\n"],"mappings":";;;;AAkBA,SAAS,6BACP,YACQ;CACR,OAAO,sBAAsB,UAAU;AACzC;AAEA,SAAgB,qCAGd,QACA,iBAC+B;CAC/B,MAAM,oBAAoB,yBAAyB,MAAM;CACzD,IAAI,kBAAkB,WAAW,GAC/B;CAGF,MAAM,sBAAyC,CAAC;CAChD,IAAI,UAAU;CACd,KAAK,MAAM,cAAc,iBAAiB;EACxC,IACG,UAAU,cAAc,WAAW,SAAS,eAC7C,WAAW,cAAc,GACzB;GAEA,oBAAoB,KAAK,UAAU;GACnC;EACF;EAEA,IAAI,OAA2B,WAAW,aAAa;EACvD,IAAI,YAAY,OAAO;EACvB,IAAI,oBAAoB;EACxB,KAAK,MAAM,cAAc,mBAAmB;GAC1C,MAAM,gBAAgB,KAAK,IAAI,GAAG,YAAY,WAAW,SAAS;GAClE,MAAM,WAAW,yBACf,MACA,YACA,aACF;GACA,IAAI,aAAa,KAAA,GAAW;IAC1B,oBAAoB;IACpB,OAAO,KAAA;IACP;GACF;GACA,IACE,aAAa,QACb,gCAAgC,MAAM,UAAU,GAEhD,oBAAoB;GAEtB,OAAO;GACP,YAAY;EACd;EAEA,IAAI,SAAS,KAAA,GAAW;GACtB,UAAU;GACV;EACF;EAEA,MAAM,aAAa,OAAO;EAC1B,IAAI,mBAAmB;GACrB,IAAI,eAAe,WAAW,YAC5B,oBAAoB,KAAK,UAAU;QAC9B;IACL,MAAM,QAAQ;KAAE,GAAG;KAAY;IAAW;IAC1C,2BAA2B,OAAO,wBAAwB,UAAU,CAAC;IACrE,oBAAoB,KAAK,KAAK;GAChC;GACA,UAAU;GACV;EACF;EAEA,oBAAo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,SAAS,8BACP,iBACA,oBACA,eACM;CACN,KAAK,MAAM,CAAC,YAAY,sBAAsB,mBAAmB,QAAQ,GAAG;EAC1E,MAAM,cAAc,gBAAgB,IAAI,UAAU;EAClD,MAAM,eAAe,cAAc,IAAI,UAAU;EACjD,IAAI,aAAa,WAAW,KAAK,iBAAiB,KAAA,GAChD,kBAAkB,MAAM,YACtB,iCACA,GAAG,aAAa,GAClB;CAEJ;AACF"}
1
+ {"version":3,"file":"lineAnnotations.js","names":[],"sources":["../../src/editor/lineAnnotations.ts"],"sourcesContent":["import { getLineAnnotationName } from '../utils/getLineAnnotationName';\nimport {\n getLineAnnotationSource,\n type LineAnnotationPosition,\n recordLineAnnotationSource,\n} from '../utils/lineAnnotationIdentity';\nimport type { TextDocumentChange } from './textDocument';\nimport { getLineNumberAttr, h } from './utils';\n\ninterface LineAnnotationChange {\n readonly startLine: number;\n readonly startCharacter: number;\n readonly endLine: number;\n readonly deletesEndLine: boolean;\n readonly insertedLineBreaks: number;\n readonly lineDelta: number;\n}\n\nfunction getDefaultLineAnnotationName(\n annotation: LineAnnotationPosition\n): string {\n return getLineAnnotationName(annotation);\n}\n\nexport function applyDocumentChangeToLineAnnotations<\n TLineAnnotation extends LineAnnotationPosition,\n>(\n change: TextDocumentChange,\n lineAnnotations: TLineAnnotation[]\n): TLineAnnotation[] | undefined {\n const annotationChanges = getLineAnnotationChanges(change);\n if (annotationChanges.length === 0) {\n return undefined;\n }\n\n const nextLineAnnotations: TLineAnnotation[] = [];\n let changed = false;\n for (const annotation of lineAnnotations) {\n if (\n ('side' in annotation && annotation.side === 'deletions') ||\n annotation.lineNumber <= 0\n ) {\n // Annotations that should not be repositioned\n nextLineAnnotations.push(annotation);\n continue;\n }\n\n let line: number | undefined = annotation.lineNumber - 1;\n let lineCount = change.previousLineCount;\n let annotationChanged = false;\n for (const lineChange of annotationChanges) {\n const nextLineCount = Math.max(1, lineCount + lineChange.lineDelta);\n const nextLine = mapLineThroughLineChange(\n line,\n lineChange,\n nextLineCount\n );\n if (nextLine === undefined) {\n annotationChanged = true;\n line = undefined;\n break;\n }\n if (\n nextLine !== line ||\n lineChangeTouchesAnnotationLine(line, lineChange)\n ) {\n annotationChanged = true;\n }\n line = nextLine;\n lineCount = nextLineCount;\n }\n\n if (line === undefined) {\n changed = true;\n continue;\n }\n\n const lineNumber = line + 1;\n if (annotationChanged) {\n if (lineNumber === annotation.lineNumber) {\n nextLineAnnotations.push(annotation);\n } else {\n const moved = { ...annotation, lineNumber };\n recordLineAnnotationSource(moved, getLineAnnotationSource(annotation));\n nextLineAnnotations.push(moved);\n }\n changed = true;\n continue;\n }\n\n nextLineAnnotations.push(annotation);\n }\n\n return changed ? nextLineAnnotations : undefined;\n}\n\nfunction getLineAnnotationChanges(\n change: TextDocumentChange\n): readonly LineAnnotationChange[] {\n if (change.changedLineChanges !== undefined) {\n return change.changedLineChanges.flatMap(\n ([\n startLine,\n changedEndLine,\n lineDelta,\n startCharacter = 0,\n _endCharacter = 0,\n endedAtDocumentEnd = false,\n ]) => {\n if (lineDelta === 0) {\n return [];\n }\n const insertedLineBreaks = Math.max(0, changedEndLine - startLine);\n const removedLineCount = Math.max(0, insertedLineBreaks - lineDelta);\n return [\n {\n startLine,\n startCharacter,\n endLine: startLine + removedLineCount,\n deletesEndLine: lineDelta < 0 && endedAtDocumentEnd,\n insertedLineBreaks,\n lineDelta,\n },\n ];\n }\n );\n }\n\n if (change.lineDelta === 0) {\n return change.changedLineRanges.flatMap(([startLine, endLine]) => {\n const insertedLineBreaks = endLine - startLine;\n if (insertedLineBreaks <= 0) {\n return [];\n }\n return [\n {\n startLine,\n startCharacter: 0,\n endLine: startLine,\n deletesEndLine: false,\n insertedLineBreaks,\n lineDelta: insertedLineBreaks,\n },\n ];\n });\n }\n const removedLineCount = Math.max(0, -change.lineDelta);\n const deletedToDocumentEnd =\n change.endedAtDocumentEnd &&\n change.startLine + removedLineCount === change.previousLineCount - 1;\n return [\n {\n startLine: change.startLine,\n startCharacter: change.startCharacter,\n endLine: change.startLine + removedLineCount,\n deletesEndLine: deletedToDocumentEnd,\n insertedLineBreaks: Math.max(0, change.lineDelta),\n lineDelta: change.lineDelta,\n },\n ];\n}\n\nfunction mapLineThroughLineChange(\n line: number,\n lineChange: LineAnnotationChange,\n nextLineCount: number\n): number | undefined {\n if (line < lineChange.startLine) {\n return line;\n }\n\n if (\n line > lineChange.endLine ||\n (lineChange.endLine > lineChange.startLine &&\n line === lineChange.endLine &&\n !lineChange.deletesEndLine)\n ) {\n return line + lineChange.lineDelta;\n }\n\n if (lineChange.startLine === lineChange.endLine) {\n if (lineChange.startCharacter === 0) {\n return line + lineChange.insertedLineBreaks;\n }\n return line;\n }\n\n if (lineChangeDeletesAnnotationLine(line, lineChange)) {\n return undefined;\n }\n\n const replacementLineOffset = Math.min(\n Math.max(0, line - lineChange.startLine),\n lineChange.insertedLineBreaks\n );\n return clampLine(lineChange.startLine + replacementLineOffset, nextLineCount);\n}\n\nfunction lineChangeDeletesAnnotationLine(\n line: number,\n lineChange: LineAnnotationChange\n): boolean {\n if (\n lineChange.lineDelta >= 0 ||\n line < lineChange.startLine ||\n line > lineChange.endLine\n ) {\n return false;\n }\n if (line === lineChange.startLine && lineChange.startCharacter > 0) {\n return false;\n }\n if (line === lineChange.endLine && !lineChange.deletesEndLine) {\n return false;\n }\n return true;\n}\n\nfunction lineChangeTouchesAnnotationLine(\n line: number,\n lineChange: LineAnnotationChange\n): boolean {\n if (\n lineChange.lineDelta === 0 ||\n line < lineChange.startLine ||\n line > lineChange.endLine\n ) {\n return false;\n }\n return !(\n lineChange.endLine > lineChange.startLine &&\n line === lineChange.endLine &&\n !lineChange.deletesEndLine\n );\n}\n\nfunction clampLine(line: number, lineCount: number): number {\n return Math.max(0, Math.min(line, Math.max(0, lineCount - 1)));\n}\n\nexport function renderLineAnnotations<\n TLineAnnotation extends LineAnnotationPosition,\n>(\n lineAnnotations: TLineAnnotation[],\n contentEl: HTMLElement,\n gutterEl?: HTMLElement,\n getName: (\n annotation: TLineAnnotation\n ) => string = getDefaultLineAnnotationName\n): void {\n const additionAnnotations = new Map<number, string[]>();\n const deletionAnnotations = new Map<number, string[]>();\n for (const annotation of lineAnnotations) {\n const lineNumber = annotation.lineNumber;\n if (!additionAnnotations.has(lineNumber)) {\n additionAnnotations.set(lineNumber, []);\n }\n if (!deletionAnnotations.has(lineNumber)) {\n deletionAnnotations.set(lineNumber, []);\n }\n const map =\n 'side' in annotation && annotation.side === 'deletions'\n ? deletionAnnotations\n : additionAnnotations;\n map.get(lineNumber)!.push(getName(annotation));\n }\n\n const leftCodeElement = contentEl.parentElement?.previousElementSibling;\n let leftGutterElement: HTMLElement | undefined;\n let leftContentElement: HTMLElement | undefined;\n if (\n leftCodeElement != null &&\n leftCodeElement instanceof HTMLElement &&\n leftCodeElement.dataset.deletions !== undefined\n ) {\n for (const child of leftCodeElement.children) {\n const el = child as HTMLElement;\n const { gutter, content } = el.dataset;\n if (gutter !== undefined) {\n leftGutterElement = el;\n } else if (content !== undefined) {\n leftContentElement = el;\n }\n }\n }\n\n cleanLineAnnotationElements(contentEl, gutterEl);\n if (leftContentElement !== undefined) {\n cleanLineAnnotationElements(leftContentElement, leftGutterElement);\n }\n\n const additionsAnnotationElements = createLineAnnotationElements(\n additionAnnotations,\n contentEl,\n gutterEl\n );\n if (leftContentElement === undefined) {\n return;\n }\n\n const deletionsAnnotationElements = createLineAnnotationElements(\n deletionAnnotations,\n leftContentElement,\n leftGutterElement\n );\n\n requestAnimationFrame(() => {\n syncPairedLineAnnotationHeights(\n additionAnnotations,\n deletionAnnotations,\n additionsAnnotationElements,\n deletionsAnnotationElements\n );\n });\n}\n\nfunction cleanLineAnnotationElements(\n contentEl: HTMLElement,\n gutterEl?: HTMLElement\n): void {\n const staleElements: HTMLElement[] = [];\n for (let i = 1; i < contentEl.childElementCount; i++) {\n const el = contentEl.children[i] as HTMLElement;\n if (el.dataset.lineAnnotation !== undefined) {\n staleElements.push(el);\n if (gutterEl !== undefined) {\n staleElements.push(gutterEl.children[i] as HTMLElement);\n }\n }\n }\n for (const el of staleElements) {\n el.remove();\n }\n}\n\nfunction createLineAnnotationElements(\n lineAnnotations: Map<number, string[]>,\n contentEl: HTMLElement,\n gutterEl?: HTMLElement\n): Map<number, HTMLElement> {\n const annotationElements = new Map<number, HTMLElement>();\n for (const el of contentEl.children) {\n const lineNumber = getLineNumberAttr(el as HTMLElement);\n if (lineNumber !== undefined) {\n const annotations = lineAnnotations.get(lineNumber);\n if (annotations !== undefined) {\n const lineIndex = lineNumber - 1;\n const annotationElement = h('div', {\n dataset: {\n lineAnnotation: '0,' + lineIndex,\n },\n children: [\n h('div', {\n dataset: 'annotationContent',\n children: annotations.map((name) => h('slot', { name })),\n }),\n ],\n });\n el.after(annotationElement);\n annotationElements.set(lineNumber, annotationElement);\n }\n }\n }\n\n if (gutterEl !== undefined) {\n for (const el of gutterEl.children) {\n const lineNumber = getLineNumberAttr(el as HTMLElement, 'columnNumber');\n if (lineNumber !== undefined && lineAnnotations.has(lineNumber)) {\n const bufferEl = h('div', {\n dataset: {\n gutterBuffer: 'annotation',\n bufferSize: '1',\n },\n style: {\n gridRow: 'span 1',\n },\n });\n el.after(bufferEl);\n }\n }\n }\n\n return annotationElements;\n}\n\nfunction syncPairedLineAnnotationHeights(\n additionAnnotations: Map<number, string[]>,\n deletionAnnotations: Map<number, string[]>,\n additionAnnotationElements: Map<number, HTMLElement>,\n deletionAnnotationElements: Map<number, HTMLElement>\n): void {\n const offsetHeights = new Map<number, number>();\n for (const [lineNumber, annotations] of additionAnnotations.entries()) {\n const annotationElement = deletionAnnotationElements.get(lineNumber);\n if (annotations.length === 0 && annotationElement !== undefined) {\n const height = measureAnnotationContentHeight(annotationElement);\n if (height > 0) {\n offsetHeights.set(lineNumber, height);\n }\n }\n }\n for (const [lineNumber, annotations] of deletionAnnotations.entries()) {\n const annotationElement = additionAnnotationElements.get(lineNumber);\n if (annotations.length === 0 && annotationElement !== undefined) {\n const height = measureAnnotationContentHeight(annotationElement);\n if (height > 0) {\n offsetHeights.set(lineNumber, height);\n }\n }\n }\n applyLineAnnotationMinHeights(\n additionAnnotations,\n additionAnnotationElements,\n offsetHeights\n );\n applyLineAnnotationMinHeights(\n deletionAnnotations,\n deletionAnnotationElements,\n offsetHeights\n );\n}\n\nfunction measureAnnotationContentHeight(lineAnnotationEl: HTMLElement): number {\n const content = lineAnnotationEl.firstElementChild;\n if (!(content instanceof HTMLElement)) {\n return 0;\n }\n return content.getBoundingClientRect().height;\n}\n\nfunction applyLineAnnotationMinHeights(\n lineAnnotations: Map<number, string[]>,\n annotationElements: Map<number, HTMLElement>,\n offsetHeights: Map<number, number>\n): void {\n for (const [lineNumber, annotationElement] of annotationElements.entries()) {\n const annotations = lineAnnotations.get(lineNumber);\n const offsetHeight = offsetHeights.get(lineNumber);\n if (annotations?.length === 0 && offsetHeight !== undefined) {\n annotationElement.style.setProperty(\n '--diffs-annotation-min-height',\n `${offsetHeight}px`\n );\n }\n }\n}\n"],"mappings":";;;;AAkBA,SAAS,6BACP,YACQ;CACR,OAAO,sBAAsB,UAAU;AACzC;AAEA,SAAgB,qCAGd,QACA,iBAC+B;CAC/B,MAAM,oBAAoB,yBAAyB,MAAM;CACzD,IAAI,kBAAkB,WAAW,GAC/B;CAGF,MAAM,sBAAyC,CAAC;CAChD,IAAI,UAAU;CACd,KAAK,MAAM,cAAc,iBAAiB;EACxC,IACG,UAAU,cAAc,WAAW,SAAS,eAC7C,WAAW,cAAc,GACzB;GAEA,oBAAoB,KAAK,UAAU;GACnC;EACF;EAEA,IAAI,OAA2B,WAAW,aAAa;EACvD,IAAI,YAAY,OAAO;EACvB,IAAI,oBAAoB;EACxB,KAAK,MAAM,cAAc,mBAAmB;GAC1C,MAAM,gBAAgB,KAAK,IAAI,GAAG,YAAY,WAAW,SAAS;GAClE,MAAM,WAAW,yBACf,MACA,YACA,aACF;GACA,IAAI,aAAa,KAAA,GAAW;IAC1B,oBAAoB;IACpB,OAAO,KAAA;IAC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gB,oBAAoB,QAAQ,GAAG;EACrE,MAAM,oBAAoB,2BAA2B,IAAI,UAAU;EACnE,IAAI,YAAY,WAAW,KAAK,sBAAsB,KAAA,GAAW;GAC/D,MAAM,SAAS,+BAA+B,iBAAiB;GAC/D,IAAI,SAAS,GACX,cAAc,IAAI,YAAY,MAAM;EAExC;CACF;CACA,8BACE,qBACA,4BACA,aACF;CACA,8BACE,qBACA,4BACA,aACF;AACF;AAEA,SAAS,+BAA+B,kBAAuC;CAC7E,MAAM,UAAU,iBAAiB;CACjC,IAAI,EAAE,mBAAmB,cACvB,OAAO;CAET,OAAO,QAAQ,sBAAsB,CAAC,CAAC;AACzC;AAEA,SAAS,8BACP,iBACA,oBACA,eACM;CACN,KAAK,MAAM,CAAC,YAAY,sBAAsB,mBAAmB,QAAQ,GAAG;EAC1E,MAAM,cAAc,gBAAgB,IAAI,UAAU;EAClD,MAAM,eAAe,cAAc,IAAI,UAAU;EACjD,IAAI,aAAa,WAAW,KAAK,iBAAiB,KAAA,GAChD,kBAAkB,MAAM,YACtB,iCACA,GAAG,aAAa,GAClB;CAEJ;AACF"}
@@ -1,7 +1,6 @@
1
1
  import { Range } from "./types.js";
2
2
  import { TextDocument } from "./textDocument.js";
3
3
  import { PopoverManager } from "./popover.js";
4
-
5
4
  //#region src/editor/marker.d.ts
6
5
  type MarkerSeverity = 'error' | 'warning' | 'info' | 'hint';
7
6
  interface Marker extends Range {
@@ -1 +1 @@
1
- {"version":3,"file":"marker.d.ts","names":[],"sources":["../../src/editor/marker.ts"],"mappings":";;;;;KAeY,cAAA;AAAA,UAEK,MAAA,SAAe,KAAA;EAC9B,QAAA,EAAU,cAAA;EACV,OAAA;IAAoB,IAAA;EAAA,IAAiB,WAAA;EACrC,MAAA;EACA,QAAA,GAAW,MAAA;AAAA;AAAA,UAGI,mBAAA;EACf,cAAA,EAAgB,cAAA;EAChB,aAAA;EACA,iBAAA,QAAyB,WAAW;EACpC,cAAA;EACA,QAAA,GAAW,IAAA,UAAc,SAAA;EACzB,QAAA,GAAW,IAAA;EACX,WAAA;AAAA;AAAA,cAGW,cAAA;EAAA;EAcX,WAAA,CAAY,MAAA,EAAQ,mBAAA;EAAA,IAIhB,OAAA,aAAoB,MAAA;EAIxB,gBAAA;EAIA,qBAAA;EAkBA,UAAA,CAAW,OAAA,EAAS,MAAA,IAAU,YAAA,EAAc,YAAA;EAU5C,WAAA,CAAY,SAAA,EAAW,WAAA;EAgCvB,aAAA;EAMA,OAAA;AAAA;AAAA,iBAyQc,wBAAA,CAAyB,QAAwB,EAAd,cAAc"}
1
+ {"version":3,"file":"marker.d.ts","names":[],"sources":["../../src/editor/marker.ts"],"mappings":";;;;KAeY;UAEK,eAAe;EAC9B,UAAU;EACV;IAAoB;MAAiB;EACrC;EACA,WAAW;;UAGI;EACf,gBAAgB;EAChB;EACA,yBAAyB;EACzB;EACA,WAAW,cAAc;EACzB,WAAW;EACX;;cAGW;;EAcX,YAAY,QAAQ;MAIhB,oBAAoB;EAIxB;EAIA;EAkBA,WAAW,SAAS,UAAU,cAAc;EAU5C,YAAY,WAAW;EAgCvB;EAMA;;iBAyQc,yBAAyB,UAAU"}
@@ -192,9 +192,11 @@ var MarkerRenderer = class {
192
192
  if (popover !== void 0) {
193
193
  setMarkerPopoverSeverity(popover, severity);
194
194
  const content = popover.firstElementChild;
195
- if (content?.dataset.markerMessage !== void 0) if (typeof message === "string") content.textContent = message;
196
- else if (message instanceof HTMLElement) content.replaceChildren(message);
197
- else content.innerHTML = message.html;
195
+ if (content?.dataset.markerMessage !== void 0) {
196
+ if (typeof message === "string") content.textContent = message;
197
+ else if (message instanceof HTMLElement) content.replaceChildren(message);
198
+ else content.innerHTML = message.html;
199
+ }
198
200
  this.#positionMarkerPopover(popover, line, character);
199
201
  this.#hoveredMarkerIndex = hoveredMarkerIndex;
200
202
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"marker.js","names":["#options","#markers","#hoveredMarkerIndex","#markerPopoverElement","#positionMarkerPopover","#lineCount","#markerEventDisposes","#findHoveredMarkerIndex","#scheduleMarkerPopover","#cancelMarkerPopoverShow","#scheduleMarkerPopoverHide","#cancelMarkerPopoverHide","#dismissMarkerPopover","#markerPopoverShowTimeout","#pendingMarkerPopoverIndex","#markerPopoverHideTimeout","#renderMarkerPopover","#isMarkerPopoverHovered","#setMarkerPopoverPosition","#markerPopoverEventDisposes"],"sources":["../../src/editor/marker.ts"],"sourcesContent":["import {\n POPOVER_BOUNDARY_LINES,\n type PopoverManager,\n type PopoverPlacementBounds,\n setPopoverPositionStyles,\n} from './popover';\nimport { selectionIntersects } from './selection';\nimport type { TextDocument } from './textDocument';\nimport type { Position, Range } from './types';\nimport { addEventListener, getLineNumberAttr, h } from './utils';\n\nconst MARKER_POPOVER_SHOW_DELAY_MS = 300;\nconst MARKER_POPOVER_HIDE_DELAY_MS = 100;\nconst MARKER_POPOVER_PLACEMENT_KEY = 'marker-popover';\n\nexport type MarkerSeverity = 'error' | 'warning' | 'info' | 'hint';\n\nexport interface Marker extends Range {\n severity: MarkerSeverity;\n message: string | { html: string } | HTMLElement;\n source?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface MarkerRenderOptions {\n popoverManager: PopoverManager;\n getLineHeight: () => number;\n getOverlayElement: () => HTMLElement | undefined;\n getGutterWidth: () => number;\n getCharX: (line: number, character: number) => [number, number];\n getLineY: (line: number) => number;\n isMouseDown: () => boolean;\n}\n\nexport class MarkerRenderer {\n #options: MarkerRenderOptions;\n #markers: Marker[] = [];\n // Document line count, used only by the no-viewport document-edge fallback.\n #lineCount = 0;\n #markerPopoverElement?: HTMLElement;\n #markerPopoverEventDisposes?: (() => void)[];\n #markerEventDisposes?: (() => void)[];\n #markerPopoverShowTimeout?: ReturnType<typeof setTimeout>;\n #markerPopoverHideTimeout?: ReturnType<typeof setTimeout>;\n #pendingMarkerPopoverIndex?: number;\n #hoveredMarkerIndex?: number;\n #isMarkerPopoverHovered = false;\n\n constructor(editor: MarkerRenderOptions) {\n this.#options = editor;\n }\n\n get markers(): readonly Marker[] {\n return this.#markers;\n }\n\n isPopoverVisible(): boolean {\n return this.#hoveredMarkerIndex !== undefined;\n }\n\n updatePopoverPosition(): void {\n const hoveredMarkerIndex = this.#hoveredMarkerIndex;\n const popover = this.#markerPopoverElement;\n if (hoveredMarkerIndex === undefined || popover === undefined) {\n return;\n }\n const marker = this.#markers[hoveredMarkerIndex];\n if (marker === undefined) {\n this.removePopover();\n return;\n }\n this.#positionMarkerPopover(\n popover,\n marker.start.line,\n marker.start.character\n );\n }\n\n setMarkers(markers: Marker[], textDocument: TextDocument): void {\n this.#lineCount = textDocument.lineCount;\n this.#markers = markers.map((marker) => ({\n ...marker,\n start: textDocument.normalizePosition(marker.start),\n end: textDocument.normalizePosition(marker.end),\n }));\n this.removePopover();\n }\n\n listenHover(contentEl: HTMLElement): void {\n this.#markerEventDisposes?.forEach((dispose) => dispose());\n this.#markerEventDisposes = undefined;\n if (this.#markers.length === 0) {\n return;\n }\n\n this.#markerEventDisposes = [\n addEventListener(contentEl, 'mouseover', (e) => {\n if (this.#options.isMouseDown()) {\n return;\n }\n const target = e.composedPath()[0] as HTMLElement | undefined;\n if (target === undefined) {\n return;\n }\n\n const hoverMarkerIndex = this.#findHoveredMarkerIndex(target);\n if (hoverMarkerIndex !== undefined) {\n this.#scheduleMarkerPopover(hoverMarkerIndex);\n } else {\n this.#cancelMarkerPopoverShow();\n this.#scheduleMarkerPopoverHide();\n }\n }),\n addEventListener(contentEl, 'mouseleave', () => {\n this.#cancelMarkerPopoverShow();\n this.#scheduleMarkerPopoverHide();\n }),\n ];\n }\n\n removePopover(): void {\n this.#cancelMarkerPopoverShow();\n this.#cancelMarkerPopoverHide();\n this.#dismissMarkerPopover();\n }\n\n cleanup(): void {\n this.#markerEventDisposes?.forEach((dispose) => dispose());\n this.#markerEventDisposes = undefined;\n this.removePopover();\n this.#markers = [];\n }\n\n #findHoveredMarkerIndex(target: HTMLElement): number | undefined {\n const lineElement = target.closest('[data-line]');\n if (lineElement == null) {\n return;\n }\n\n const lineNumber = getLineNumberAttr(lineElement as HTMLElement);\n if (lineNumber === undefined) {\n return;\n }\n\n let character: number | undefined;\n if (target.tagName === 'SPAN') {\n const char = target.dataset.char;\n if (char === undefined) {\n return;\n }\n character = parseInt(char, 10);\n if (Number.isNaN(character)) {\n return;\n }\n } else if (target.tagName === 'BR') {\n character = 0;\n } else {\n return;\n }\n\n const position: Position = { line: lineNumber - 1, character };\n for (let i = this.#markers.length - 1; i >= 0; i--) {\n if (\n selectionIntersects(\n { start: position, end: position },\n this.#markers[i]\n )\n ) {\n return i;\n }\n }\n return undefined;\n }\n\n #cancelMarkerPopoverShow(): void {\n if (this.#markerPopoverShowTimeout !== undefined) {\n clearTimeout(this.#markerPopoverShowTimeout);\n this.#markerPopoverShowTimeout = undefined;\n }\n this.#pendingMarkerPopoverIndex = undefined;\n }\n\n #cancelMarkerPopoverHide(): void {\n if (this.#markerPopoverHideTimeout !== undefined) {\n clearTimeout(this.#markerPopoverHideTimeout);\n this.#markerPopoverHideTimeout = undefined;\n }\n }\n\n #scheduleMarkerPopover(markerIndex: number): void {\n if (\n markerIndex === this.#hoveredMarkerIndex ||\n markerIndex === this.#pendingMarkerPopoverIndex\n ) {\n this.#cancelMarkerPopoverHide();\n return;\n }\n\n this.#cancelMarkerPopoverShow();\n this.#cancelMarkerPopoverHide();\n if (this.#markerPopoverElement !== undefined) {\n this.#renderMarkerPopover(markerIndex);\n return;\n }\n\n this.#pendingMarkerPopoverIndex = markerIndex;\n this.#markerPopoverShowTimeout = setTimeout(() => {\n this.#markerPopoverShowTimeout = undefined;\n this.#pendingMarkerPopoverIndex = undefined;\n this.#renderMarkerPopover(markerIndex);\n }, MARKER_POPOVER_SHOW_DELAY_MS);\n }\n\n #scheduleMarkerPopoverHide(): void {\n if (this.#isMarkerPopoverHovered) {\n return;\n }\n\n this.#cancelMarkerPopoverHide();\n this.#markerPopoverHideTimeout = setTimeout(() => {\n this.#markerPopoverHideTimeout = undefined;\n if (!this.#isMarkerPopoverHovered) {\n this.removePopover();\n }\n }, MARKER_POPOVER_HIDE_DELAY_MS);\n }\n\n // Positions the popover in overlay coordinate space (see [data-marker-popover]\n // in editor.css). When `placeAbove` is true, `y` is the top edge of the\n // marker's row and the popover is shifted up by its own height.\n #setMarkerPopoverPosition(\n popover: HTMLElement,\n x: number,\n y: number,\n placeAbove: boolean,\n viewport = this.#options.popoverManager.getPlacementBounds()\n ): void {\n setPopoverPositionStyles(popover, {\n gutterWidth: this.#options.getGutterWidth(),\n placeAbove,\n viewport,\n x,\n y,\n });\n }\n\n // Positions the popover for a marker at `(line, character)`: prefers below\n // (the default), flipping above when below would be clipped by the visible\n // scrollport. Must run after the popover's content is final, since it reads\n // the popover's rendered height to decide whether either side fits.\n #positionMarkerPopover(\n popover: HTMLElement,\n line: number,\n character: number\n ): void {\n const { getCharX, getLineY, getLineHeight, popoverManager } = this.#options;\n const [left, wrapLine] = getCharX(line, character);\n const lineHeight = getLineHeight();\n const rowTop = getLineY(line) + wrapLine * lineHeight;\n const popoverHeight = popover.offsetHeight;\n\n const preferred: PopoverPlacementBounds = {\n top: rowTop + lineHeight,\n bottom: rowTop + lineHeight + popoverHeight,\n };\n const fallback: PopoverPlacementBounds = {\n top: rowTop - popoverHeight,\n bottom: rowTop,\n };\n const atDocumentEdge = line >= this.#lineCount - POPOVER_BOUNDARY_LINES;\n const viewport = popoverManager.getPlacementBounds();\n const placeAbove =\n popoverManager.choosePlacement({\n preferred,\n fallback,\n viewport,\n popoverHeight,\n atDocumentEdge,\n placementKey: MARKER_POPOVER_PLACEMENT_KEY,\n }) === 'fallback';\n\n this.#setMarkerPopoverPosition(\n popover,\n left,\n placeAbove ? rowTop : rowTop + lineHeight,\n placeAbove,\n viewport\n );\n }\n\n #dismissMarkerPopover(): void {\n this.#markerPopoverEventDisposes?.forEach((dispose) => dispose());\n this.#markerPopoverEventDisposes = undefined;\n this.#markerPopoverElement?.remove();\n this.#markerPopoverElement = undefined;\n this.#hoveredMarkerIndex = undefined;\n this.#isMarkerPopoverHovered = false;\n this.#options.popoverManager.resetPlacement(MARKER_POPOVER_PLACEMENT_KEY);\n }\n\n #renderMarkerPopover(hoveredMarkerIndex: number): void {\n if (hoveredMarkerIndex === this.#hoveredMarkerIndex) {\n return;\n }\n\n const overlayElement = this.#options.getOverlayElement();\n if (hoveredMarkerIndex >= this.#markers.length || overlayElement == null) {\n return;\n }\n\n const { start, message, severity } = this.#markers[hoveredMarkerIndex];\n const { line, character } = start;\n const popover = this.#markerPopoverElement;\n this.#options.popoverManager.resetPlacement(MARKER_POPOVER_PLACEMENT_KEY);\n\n if (popover !== undefined) {\n setMarkerPopoverSeverity(popover, severity);\n const content = popover.firstElementChild as HTMLElement | null;\n if (content?.dataset.markerMessage !== undefined) {\n if (typeof message === 'string') {\n content.textContent = message;\n } else if (message instanceof HTMLElement) {\n content.replaceChildren(message);\n } else {\n content.innerHTML = message.html;\n }\n }\n // Position after updating content: a different message size changes\n // the offsetHeight #positionMarkerPopover reads to decide placement.\n this.#positionMarkerPopover(popover, line, character);\n this.#hoveredMarkerIndex = hoveredMarkerIndex;\n return;\n }\n\n this.#markerPopoverElement = h(\n 'div',\n {\n dataset: {\n editorWidget: '',\n markerPopover: '',\n [markerSeverityDatasetKey(severity)]: '',\n },\n children: [\n h('div', {\n dataset: 'markerMessage',\n ...(typeof message === 'string'\n ? { textContent: message }\n : message instanceof HTMLElement\n ? { children: [message] }\n : { innerHTML: message.html }),\n }),\n ],\n },\n overlayElement\n );\n this.#positionMarkerPopover(this.#markerPopoverElement, line, character);\n this.#hoveredMarkerIndex = hoveredMarkerIndex;\n this.#markerPopoverEventDisposes = [\n addEventListener(this.#markerPopoverElement, 'mouseenter', () => {\n this.#isMarkerPopoverHovered = true;\n this.#cancelMarkerPopoverHide();\n }),\n addEventListener(this.#markerPopoverElement, 'mouseleave', () => {\n this.#isMarkerPopoverHovered = false;\n this.#scheduleMarkerPopoverHide();\n }),\n ];\n }\n}\n\nconst MARKER_SEVERITIES: readonly MarkerSeverity[] = [\n 'error',\n 'warning',\n 'info',\n 'hint',\n];\n\n// Marks the popover with data-marker-<severity> (the same boolean attribute the\n// squiggle range element uses) so the CSS severity palette can target both with\n// a single selector. The popover element is reused across hovers, so any\n// previously applied severity attribute is cleared first.\nfunction setMarkerPopoverSeverity(\n popover: HTMLElement,\n severity: MarkerSeverity\n): void {\n for (const candidate of MARKER_SEVERITIES) {\n delete popover.dataset[markerSeverityDatasetKey(candidate)];\n }\n popover.dataset[markerSeverityDatasetKey(severity)] = '';\n}\n\nexport function markerSeverityDatasetKey(severity: MarkerSeverity): string {\n switch (severity) {\n case 'error':\n return 'markerError';\n case 'warning':\n return 'markerWarning';\n case 'info':\n return 'markerInfo';\n case 'hint':\n return 'markerHint';\n }\n}\n"],"mappings":";;;;AAWA,MAAM,+BAA+B;AACrC,MAAM,+BAA+B;AACrC,MAAM,+BAA+B;AAqBrC,IAAa,iBAAb,MAA4B;CAC1B;CACA,WAAqB,CAAC;CAEtB,aAAa;CACb;CACA;CACA;CACA;CACA;CACA;CACA;CACA,0BAA0B;CAE1B,YAAY,QAA6B;EACvC,KAAKA,WAAW;CAClB;CAEA,IAAI,UAA6B;EAC/B,OAAO,KAAKC;CACd;CAEA,mBAA4B;EAC1B,OAAO,KAAKC,wBAAwB,KAAA;CACtC;CAEA,wBAA8B;EAC5B,MAAM,qBAAqB,KAAKA;EAChC,MAAM,UAAU,KAAKC;EACrB,IAAI,uBAAuB,KAAA,KAAa,YAAY,KAAA,GAClD;EAEF,MAAM,SAAS,KAAKF,SAAS;EAC7B,IAAI,WAAW,KAAA,GAAW;GACxB,KAAK,cAAc;GACnB;EACF;EACA,KAAKG,uBACH,SACA,OAAO,MAAM,MACb,OAAO,MAAM,SACf;CACF;CAEA,WAAW,SAAmB,cAAkC;EAC9D,KAAKC,aAAa,aAAa;EAC/B,KAAKJ,WAAW,QAAQ,KAAK,YAAY;GACvC,GAAG;GACH,OAAO,aAAa,kBAAkB,OA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,kBAAkB,KAAA,GACrC,IAAI,OAAO,YAAY,UACrB,QAAQ,cAAc;QACjB,IAAI,mBAAmB,aAC5B,QAAQ,gBAAgB,OAAO;QAE/B,QAAQ,YAAY,QAAQ;GAKhC,KAAKI,uBAAuB,SAAS,MAAM,SAAS;GACpD,KAAKF,sBAAsB;GAC3B;EACF;EAEA,KAAKC,wBAAwB,EAC3B,OACA;GACE,SAAS;IACP,cAAc;IACd,eAAe;KACd,yBAAyB,QAAQ,IAAI;GACxC;GACA,UAAU,CACR,EAAE,OAAO;IACP,SAAS;IACT,GAAI,OAAO,YAAY,WACnB,EAAE,aAAa,QAAQ,IACvB,mBAAmB,cACjB,EAAE,UAAU,CAAC,OAAO,EAAE,IACtB,EAAE,WAAW,QAAQ,KAAK;GAClC,CAAC,CACH;EACF,GACA,cACF;EACA,KAAKC,uBAAuB,KAAKD,uBAAuB,MAAM,SAAS;EACvE,KAAKD,sBAAsB;EAC3B,KAAKiB,8BAA8B,CACjC,iBAAiB,KAAKhB,uBAAuB,oBAAoB;GAC/D,KAAKc,0BAA0B;GAC/B,KAAKN,yBAAyB;EAChC,CAAC,GACD,iBAAiB,KAAKR,uBAAuB,oBAAoB;GAC/D,KAAKc,0BAA0B;GAC/B,KAAKP,2BAA2B;EAClC,CAAC,CACH;CACF;AACF;AAEA,MAAM,oBAA+C;CACnD;CACA;CACA;CACA;AACF;AAMA,SAAS,yBACP,SACA,UACM;CACN,KAAK,MAAM,aAAa,mBACtB,OAAO,QAAQ,QAAQ,yBAAyB,SAAS;CAE3D,QAAQ,QAAQ,yBAAyB,QAAQ,KAAK;AACxD;AAEA,SAAgB,yBAAyB,UAAkC;CACzE,QAAQ,UAAR;EACE,KAAK,SACH,OAAO;EACT,KAAK,WACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,KAAK,QACH,OAAO;CACX;AACF"}
1
+ {"version":3,"file":"marker.js","names":[],"sources":["../../src/editor/marker.ts"],"sourcesContent":["import {\n POPOVER_BOUNDARY_LINES,\n type PopoverManager,\n type PopoverPlacementBounds,\n setPopoverPositionStyles,\n} from './popover';\nimport { selectionIntersects } from './selection';\nimport type { TextDocument } from './textDocument';\nimport type { Position, Range } from './types';\nimport { addEventListener, getLineNumberAttr, h } from './utils';\n\nconst MARKER_POPOVER_SHOW_DELAY_MS = 300;\nconst MARKER_POPOVER_HIDE_DELAY_MS = 100;\nconst MARKER_POPOVER_PLACEMENT_KEY = 'marker-popover';\n\nexport type MarkerSeverity = 'error' | 'warning' | 'info' | 'hint';\n\nexport interface Marker extends Range {\n severity: MarkerSeverity;\n message: string | { html: string } | HTMLElement;\n source?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface MarkerRenderOptions {\n popoverManager: PopoverManager;\n getLineHeight: () => number;\n getOverlayElement: () => HTMLElement | undefined;\n getGutterWidth: () => number;\n getCharX: (line: number, character: number) => [number, number];\n getLineY: (line: number) => number;\n isMouseDown: () => boolean;\n}\n\nexport class MarkerRenderer {\n #options: MarkerRenderOptions;\n #markers: Marker[] = [];\n // Document line count, used only by the no-viewport document-edge fallback.\n #lineCount = 0;\n #markerPopoverElement?: HTMLElement;\n #markerPopoverEventDisposes?: (() => void)[];\n #markerEventDisposes?: (() => void)[];\n #markerPopoverShowTimeout?: ReturnType<typeof setTimeout>;\n #markerPopoverHideTimeout?: ReturnType<typeof setTimeout>;\n #pendingMarkerPopoverIndex?: number;\n #hoveredMarkerIndex?: number;\n #isMarkerPopoverHovered = false;\n\n constructor(editor: MarkerRenderOptions) {\n this.#options = editor;\n }\n\n get markers(): readonly Marker[] {\n return this.#markers;\n }\n\n isPopoverVisible(): boolean {\n return this.#hoveredMarkerIndex !== undefined;\n }\n\n updatePopoverPosition(): void {\n const hoveredMarkerIndex = this.#hoveredMarkerIndex;\n const popover = this.#markerPopoverElement;\n if (hoveredMarkerIndex === undefined || popover === undefined) {\n return;\n }\n const marker = this.#markers[hoveredMarkerIndex];\n if (marker === undefined) {\n this.removePopover();\n return;\n }\n this.#positionMarkerPopover(\n popover,\n marker.start.line,\n marker.start.character\n );\n }\n\n setMarkers(markers: Marker[], textDocument: TextDocument): void {\n this.#lineCount = textDocument.lineCount;\n this.#markers = markers.map((marker) => ({\n ...marker,\n start: textDocument.normalizePosition(marker.start),\n end: textDocument.normalizePosition(marker.end),\n }));\n this.removePopover();\n }\n\n listenHover(contentEl: HTMLElement): void {\n this.#markerEventDisposes?.forEach((dispose) => dispose());\n this.#markerEventDisposes = undefined;\n if (this.#markers.length === 0) {\n return;\n }\n\n this.#markerEventDisposes = [\n addEventListener(contentEl, 'mouseover', (e) => {\n if (this.#options.isMouseDown()) {\n return;\n }\n const target = e.composedPath()[0] as HTMLElement | undefined;\n if (target === undefined) {\n return;\n }\n\n const hoverMarkerIndex = this.#findHoveredMarkerIndex(target);\n if (hoverMarkerIndex !== undefined) {\n this.#scheduleMarkerPopover(hoverMarkerIndex);\n } else {\n this.#cancelMarkerPopoverShow();\n this.#scheduleMarkerPopoverHide();\n }\n }),\n addEventListener(contentEl, 'mouseleave', () => {\n this.#cancelMarkerPopoverShow();\n this.#scheduleMarkerPopoverHide();\n }),\n ];\n }\n\n removePopover(): void {\n this.#cancelMarkerPopoverShow();\n this.#cancelMarkerPopoverHide();\n this.#dismissMarkerPopover();\n }\n\n cleanup(): void {\n this.#markerEventDisposes?.forEach((dispose) => dispose());\n this.#markerEventDisposes = undefined;\n this.removePopover();\n this.#markers = [];\n }\n\n #findHoveredMarkerIndex(target: HTMLElement): number | undefined {\n const lineElement = target.closest('[data-line]');\n if (lineElement == null) {\n return;\n }\n\n const lineNumber = getLineNumberAttr(lineElement as HTMLElement);\n if (lineNumber === undefined) {\n return;\n }\n\n let character: number | undefined;\n if (target.tagName === 'SPAN') {\n const char = target.dataset.char;\n if (char === undefined) {\n return;\n }\n character = parseInt(char, 10);\n if (Number.isNaN(character)) {\n return;\n }\n } else if (target.tagName === 'BR') {\n character = 0;\n } else {\n return;\n }\n\n const position: Position = { line: lineNumber - 1, character };\n for (let i = this.#markers.length - 1; i >= 0; i--) {\n if (\n selectionIntersects(\n { start: position, end: position },\n this.#markers[i]\n )\n ) {\n return i;\n }\n }\n return undefined;\n }\n\n #cancelMarkerPopoverShow(): void {\n if (this.#markerPopoverShowTimeout !== undefined) {\n clearTimeout(this.#markerPopoverShowTimeout);\n this.#markerPopoverShowTimeout = undefined;\n }\n this.#pendingMarkerPopoverIndex = undefined;\n }\n\n #cancelMarkerPopoverHide(): void {\n if (this.#markerPopoverHideTimeout !== undefined) {\n clearTimeout(this.#markerPopoverHideTimeout);\n this.#markerPopoverHideTimeout = undefined;\n }\n }\n\n #scheduleMarkerPopover(markerIndex: number): void {\n if (\n markerIndex === this.#hoveredMarkerIndex ||\n markerIndex === this.#pendingMarkerPopoverIndex\n ) {\n this.#cancelMarkerPopoverHide();\n return;\n }\n\n this.#cancelMarkerPopoverShow();\n this.#cancelMarkerPopoverHide();\n if (this.#markerPopoverElement !== undefined) {\n this.#renderMarkerPopover(markerIndex);\n return;\n }\n\n this.#pendingMarkerPopoverIndex = markerIndex;\n this.#markerPopoverShowTimeout = setTimeout(() => {\n this.#markerPopoverShowTimeout = undefined;\n this.#pendingMarkerPopoverIndex = undefined;\n this.#renderMarkerPopover(markerIndex);\n }, MARKER_POPOVER_SHOW_DELAY_MS);\n }\n\n #scheduleMarkerPopoverHide(): void {\n if (this.#isMarkerPopoverHovered) {\n return;\n }\n\n this.#cancelMarkerPopoverHide();\n this.#markerPopoverHideTimeout = setTimeout(() => {\n this.#markerPopoverHideTimeout = undefined;\n if (!this.#isMarkerPopoverHovered) {\n this.removePopover();\n }\n }, MARKER_POPOVER_HIDE_DELAY_MS);\n }\n\n // Positions the popover in overlay coordinate space (see [data-marker-popover]\n // in editor.css). When `placeAbove` is true, `y` is the top edge of the\n // marker's row and the popover is shifted up by its own height.\n #setMarkerPopoverPosition(\n popover: HTMLElement,\n x: number,\n y: number,\n placeAbove: boolean,\n viewport = this.#options.popoverManager.getPlacementBounds()\n ): void {\n setPopoverPositionStyles(popover, {\n gutterWidth: this.#options.getGutterWidth(),\n placeAbove,\n viewport,\n x,\n y,\n });\n }\n\n // Positions the popover for a marker at `(line, character)`: prefers below\n // (the default), flipping above when below would be clipped by the visible\n // scrollport. Must run after the popover's content is final, since it reads\n // the popover's rendered height to decide whether either side fits.\n #positionMarkerPopover(\n popover: HTMLElement,\n line: number,\n character: number\n ): void {\n const { getCharX, getLineY, getLineHeight, popoverManager } = this.#options;\n const [left, wrapLine] = getCharX(line, character);\n const lineHeight = getLineHeight();\n const rowTop = getLineY(line) + wrapLine * lineHeight;\n const popoverHeight = popover.offsetHeight;\n\n const preferred: PopoverPlacementBounds = {\n top: rowTop + lineHeight,\n bottom: rowTop + lineHeight + popoverHeight,\n };\n const fallback: PopoverPlacementBounds = {\n top: rowTop - popoverHeight,\n bottom: rowTop,\n };\n const atDocumentEdge = line >= this.#lineCount - POPOVER_BOUNDARY_LINES;\n const viewport = popoverManager.getPlacementBounds();\n const placeAbove =\n popoverManager.choosePlacement({\n preferred,\n fallback,\n viewport,\n popoverHeight,\n atDocumentEdge,\n placementKey: MARKER_POPOVER_PLACEMENT_KEY,\n }) === 'fallback';\n\n this.#setMarkerPopoverPosition(\n popover,\n left,\n placeAbove ? rowTop : rowTop + lineHeight,\n placeAbove,\n viewport\n );\n }\n\n #dismissMarkerPopover(): void {\n this.#markerPopoverEventDisposes?.forEach((dispose) => dispose());\n this.#markerPopoverEventDisposes = undefined;\n this.#markerPopoverElement?.remove();\n this.#markerPopoverElement = undefined;\n this.#hoveredMarkerIndex = undefined;\n this.#isMarkerPopoverHovered = false;\n this.#options.popoverManager.resetPlacement(MARKER_POPOVER_PLACEMENT_KEY);\n }\n\n #renderMarkerPopover(hoveredMarkerIndex: number): void {\n if (hoveredMarkerIndex === this.#hoveredMarkerIndex) {\n return;\n }\n\n const overlayElement = this.#options.getOverlayElement();\n if (hoveredMarkerIndex >= this.#markers.length || overlayElement == null) {\n return;\n }\n\n const { start, message, severity } = this.#markers[hoveredMarkerIndex];\n const { line, character } = start;\n const popover = this.#markerPopoverElement;\n this.#options.popoverManager.resetPlacement(MARKER_POPOVER_PLACEMENT_KEY);\n\n if (popover !== undefined) {\n setMarkerPopoverSeverity(popover, severity);\n const content = popover.firstElementChild as HTMLElement | null;\n if (content?.dataset.markerMessage !== undefined) {\n if (typeof message === 'string') {\n content.textContent = message;\n } else if (message instanceof HTMLElement) {\n content.replaceChildren(message);\n } else {\n content.innerHTML = message.html;\n }\n }\n // Position after updating content: a different message size changes\n // the offsetHeight #positionMarkerPopover reads to decide placement.\n this.#positionMarkerPopover(popover, line, character);\n this.#hoveredMarkerIndex = hoveredMarkerIndex;\n return;\n }\n\n this.#markerPopoverElement = h(\n 'div',\n {\n dataset: {\n editorWidget: '',\n markerPopover: '',\n [markerSeverityDatasetKey(severity)]: '',\n },\n children: [\n h('div', {\n dataset: 'markerMessage',\n ...(typeof message === 'string'\n ? { textContent: message }\n : message instanceof HTMLElement\n ? { children: [message] }\n : { innerHTML: message.html }),\n }),\n ],\n },\n overlayElement\n );\n this.#positionMarkerPopover(this.#markerPopoverElement, line, character);\n this.#hoveredMarkerIndex = hoveredMarkerIndex;\n this.#markerPopoverEventDisposes = [\n addEventListener(this.#markerPopoverElement, 'mouseenter', () => {\n this.#isMarkerPopoverHovered = true;\n this.#cancelMarkerPopoverHide();\n }),\n addEventListener(this.#markerPopoverElement, 'mouseleave', () => {\n this.#isMarkerPopoverHovered = false;\n this.#scheduleMarkerPopoverHide();\n }),\n ];\n }\n}\n\nconst MARKER_SEVERITIES: readonly MarkerSeverity[] = [\n 'error',\n 'warning',\n 'info',\n 'hint',\n];\n\n// Marks the popover with data-marker-<severity> (the same boolean attribute the\n// squiggle range element uses) so the CSS severity palette can target both with\n// a single selector. The popover element is reused across hovers, so any\n// previously applied severity attribute is cleared first.\nfunction setMarkerPopoverSeverity(\n popover: HTMLElement,\n severity: MarkerSeverity\n): void {\n for (const candidate of MARKER_SEVERITIES) {\n delete popover.dataset[markerSeverityDatasetKey(candidate)];\n }\n popover.dataset[markerSeverityDatasetKey(severity)] = '';\n}\n\nexport function markerSeverityDatasetKey(severity: MarkerSeverity): string {\n switch (severity) {\n case 'error':\n return 'markerError';\n case 'warning':\n return 'markerWarning';\n case 'info':\n return 'markerInfo';\n case 'hint':\n return 'markerHint';\n }\n}\n"],"mappings":";;;;AAWA,MAAM,+BAA+B;AACrC,MAAM,+BAA+B;AACrC,MAAM,+BAA+B;AAqBrC,IAAa,iBAAb,MAA4B;CAC1B;CACA,WAAqB,CAAC;CAEtB,aAAa;CACb;CACA;CACA;CACA;CACA;CACA;CACA;CACA,0BAA0B;CAE1B,YAAY,QAA6B;EACvC,KAAK,WAAW;CAClB;CAEA,IAAI,UAA6B;EAC/B,OAAO,KAAK;CACd;CAEA,mBAA4B;EAC1B,OAAO,KAAK,wBAAwB,KAAA;CACtC;CAEA,wBAA8B;EAC5B,MAAM,qBAAqB,KAAK;EAChC,MAAM,UAAU,KAAK;EACrB,IAAI,uBAAuB,KAAA,KAAa,YAAY,KAAA,GAClD;EAEF,MAAM,SAAS,KAAK,SAAS;EAC7B,IAAI,WAAW,KAAA,GAAW;GACxB,KAAK,cAAc;GACnB;EACF;EACA,KAAK,uBACH,SACA,OAAO,MAAM,MACb,OAAO,MAAM,SACf;CACF;CAEA,WAAW,SAAmB,cAAkC;EAC9D,KAAK,aAAa,aAAa;EAC/B,KAAK,WAAW,QAAQ,KAAK,YAAY;GACvC,GAAG;GACH,OAAO,aAAa,kBAAkB,OAAO,KAAK;GAClD,KAAK,aAAa,kBAAkB,OAAO,GAAG;EAChD,EAAE;EACF,KAAK,cAAc;CACrB;CAEA,YAAY,WAA8B;EACxC,KAAK,sBAAsB,SAAS,YAAY,QAAQ,CAAC;EACzD,KAAK,uBAAuB,KAAA;EAC5B,IAAI,KAAK,SAAS,WAAW,GAC3B;EAGF,KAAK,uBAAuB,CAC1B,iBAAiB,WAAW,cAAc,MAAM;GAC9C,IAAI,KAAK,SAAS,YAAY,GAC5B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B,EAAE,aAAa,QAAQ,IACvB,mBAAmB,cACjB,EAAE,UAAU,CAAC,OAAO,EAAE,IACtB,EAAE,WAAW,QAAQ,KAAK;GAClC,CAAC,CACH;EACF,GACA,cACF;EACA,KAAK,uBAAuB,KAAK,uBAAuB,MAAM,SAAS;EACvE,KAAK,sBAAsB;EAC3B,KAAK,8BAA8B,CACjC,iBAAiB,KAAK,uBAAuB,oBAAoB;GAC/D,KAAK,0BAA0B;GAC/B,KAAK,yBAAyB;EAChC,CAAC,GACD,iBAAiB,KAAK,uBAAuB,oBAAoB;GAC/D,KAAK,0BAA0B;GAC/B,KAAK,2BAA2B;EAClC,CAAC,CACH;CACF;AACF;AAEA,MAAM,oBAA+C;CACnD;CACA;CACA;CACA;AACF;AAMA,SAAS,yBACP,SACA,UACM;CACN,KAAK,MAAM,aAAa,mBACtB,OAAO,QAAQ,QAAQ,yBAAyB,SAAS;CAE3D,QAAQ,QAAQ,yBAAyB,QAAQ,KAAK;AACxD;AAEA,SAAgB,yBAAyB,UAAkC;CACzE,QAAQ,UAAR;EACE,KAAK,SACH,OAAO;EACT,KAAK,WACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,KAAK,QACH,OAAO;CACX;AACF"}
@@ -1,7 +1,6 @@
1
1
  import { Position, Range } from "./types.js";
2
2
  import { TextDocument } from "./textDocument.js";
3
3
  import { EditorTokenizer } from "./tokenizer.js";
4
-
5
4
  //#region src/editor/matchBrackets.d.ts
6
5
  declare function findBracketMatchRanges(textDocument: TextDocument, tokenizer: EditorTokenizer, position: Position): [open: Range, close: Range] | undefined;
7
6
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"matchBrackets.d.ts","names":[],"sources":["../../src/editor/matchBrackets.ts"],"mappings":";;;;;iBAqBgB,sBAAA,CACd,YAAA,EAAc,YAAA,EACd,SAAA,EAAW,eAAA,EACX,QAAA,EAAU,QAAA,IACR,IAAA,EAAM,KAAA,EAAO,KAAA,EAAO,KAAA"}
1
+ {"version":3,"file":"matchBrackets.d.ts","names":[],"sources":["../../src/editor/matchBrackets.ts"],"mappings":";;;;iBAqBgB,uBACd,cAAc,cACd,WAAW,iBACX,UAAU,YACR,MAAM,OAAO,OAAO"}
@@ -1,6 +1,5 @@
1
1
  import { Position, Range, ResolvedTextEdit } from "./types.js";
2
2
  import { SearchParams } from "./searchPanel.js";
3
-
4
3
  //#region src/editor/pieceTable.d.ts
5
4
  /**
6
5
  * A piece table is a data structure that allows for efficient insertion and deletion of text.
@@ -1 +1 @@
1
- {"version":3,"file":"pieceTable.d.ts","names":[],"sources":["../../src/editor/pieceTable.ts"],"mappings":";;;;;;AAqHA;;;;;;;cAAa,UAAA;EAAA;EAiBX,WAAA,CAAY,YAAA;EAAA,IAQR,SAAA;EAIJ,OAAA,CAAQ,KAAA,GAAQ,KAAA;EAShB,WAAA,CAAY,IAAA,UAAc,gBAAA;EAkB1B,aAAA,CAAc,IAAA,UAAc,gBAAA;EAqC5B,YAAA,CAAa,KAAA,UAAe,GAAA,UAAa,OAAA;EAsCzC,MAAA,CAAO,MAAA;EAWP,QAAA,CAAS,MAAA;EA2BT,+BAAA,CACE,MAAA,UACA,QAAA,YAAoB,KAAA,UAAe,GAAA;EA0CrC,MAAA,CAAO,YAAA,EAAc,YAAA,IAAgB,KAAA,UAAe,GAAA;EAsFpD,MAAA,CAAO,IAAA,UAAc,MAAA;EASrB,MAAA,CAAO,MAAA,UAAgB,MAAA;EAavB,UAAA,CAAW,KAAA,WAAgB,gBAAA;EAiB3B,UAAA,CAAW,MAAA,WAAiB,QAAA;EAY5B,WAAA,CAAY,OAAA,sBAA6B,QAAA;EAgBzC,QAAA,CAAS,QAAA,EAAU,QAAA;AAAA;;;;;iBA6qBL,0BAAA,CACd,UAAA,GAAa,MAAA,aAAmB,QAAA,EAChC,QAAA,GAAW,QAAA,EAAU,QAAA,aACrB,WAAA,GAAc,IAAA,qBACd,YAAA,EAAc,YAAA,EACd,UAAA,UACA,QAAA"}
1
+ {"version":3,"file":"pieceTable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