@pierre/diffs 1.0.6 → 1.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/dist/components/File.d.ts +4 -2
  2. package/dist/components/File.d.ts.map +1 -1
  3. package/dist/components/File.js +80 -34
  4. package/dist/components/File.js.map +1 -1
  5. package/dist/components/FileDiff.d.ts +50 -28
  6. package/dist/components/FileDiff.d.ts.map +1 -1
  7. package/dist/components/FileDiff.js +222 -80
  8. package/dist/components/FileDiff.js.map +1 -1
  9. package/dist/components/FileStream.d.ts +1 -0
  10. package/dist/components/FileStream.d.ts.map +1 -1
  11. package/dist/components/FileStream.js +10 -6
  12. package/dist/components/FileStream.js.map +1 -1
  13. package/dist/components/web-components.d.ts.map +1 -1
  14. package/dist/components/web-components.js +1 -1
  15. package/dist/components/web-components.js.map +1 -1
  16. package/dist/constants.d.ts +8 -2
  17. package/dist/constants.d.ts.map +1 -1
  18. package/dist/constants.js +10 -1
  19. package/dist/constants.js.map +1 -1
  20. package/dist/highlighter/languages/getResolvedOrResolveLanguage.d.ts +1 -1
  21. package/dist/highlighter/languages/getResolvedOrResolveLanguage.d.ts.map +1 -1
  22. package/dist/highlighter/languages/getResolvedOrResolveLanguage.js.map +1 -1
  23. package/dist/highlighter/languages/resolveLanguage.d.ts +1 -1
  24. package/dist/highlighter/languages/resolveLanguage.d.ts.map +1 -1
  25. package/dist/highlighter/languages/resolveLanguage.js.map +1 -1
  26. package/dist/highlighter/languages/resolveLanguages.js +1 -1
  27. package/dist/highlighter/languages/resolveLanguages.js.map +1 -1
  28. package/dist/highlighter/shared_highlighter.js +1 -1
  29. package/dist/highlighter/shared_highlighter.js.map +1 -1
  30. package/dist/highlighter/themes/registerCustomCSSVariableTheme.js +1 -1
  31. package/dist/highlighter/themes/registerCustomCSSVariableTheme.js.map +1 -1
  32. package/dist/index.d.ts +19 -10
  33. package/dist/index.js +14 -5
  34. package/dist/managers/LineSelectionManager.d.ts.map +1 -1
  35. package/dist/managers/LineSelectionManager.js +8 -9
  36. package/dist/managers/LineSelectionManager.js.map +1 -1
  37. package/dist/managers/ScrollSyncManager.d.ts +1 -0
  38. package/dist/managers/ScrollSyncManager.d.ts.map +1 -1
  39. package/dist/managers/ScrollSyncManager.js +14 -6
  40. package/dist/managers/ScrollSyncManager.js.map +1 -1
  41. package/dist/react/MultiFileDiff.js +2 -2
  42. package/dist/react/MultiFileDiff.js.map +1 -1
  43. package/dist/react/index.d.ts +2 -2
  44. package/dist/react/utils/renderDiffChildren.d.ts +4 -4
  45. package/dist/react/utils/renderDiffChildren.d.ts.map +1 -1
  46. package/dist/react/utils/renderDiffChildren.js +3 -3
  47. package/dist/react/utils/renderDiffChildren.js.map +1 -1
  48. package/dist/react/utils/useFileDiffInstance.js.map +1 -1
  49. package/dist/renderers/DiffHunksRenderer.d.ts +7 -6
  50. package/dist/renderers/DiffHunksRenderer.d.ts.map +1 -1
  51. package/dist/renderers/DiffHunksRenderer.js +263 -337
  52. package/dist/renderers/DiffHunksRenderer.js.map +1 -1
  53. package/dist/renderers/FileRenderer.d.ts +1 -0
  54. package/dist/renderers/FileRenderer.d.ts.map +1 -1
  55. package/dist/renderers/FileRenderer.js +11 -4
  56. package/dist/renderers/FileRenderer.js.map +1 -1
  57. package/dist/ssr/index.d.ts +2 -2
  58. package/dist/style.js +1 -1
  59. package/dist/style.js.map +1 -1
  60. package/dist/types.d.ts +247 -43
  61. package/dist/types.d.ts.map +1 -1
  62. package/dist/utils/areDiffLineAnnotationsEqual.d.ts +7 -0
  63. package/dist/utils/areDiffLineAnnotationsEqual.d.ts.map +1 -0
  64. package/dist/utils/areDiffLineAnnotationsEqual.js +8 -0
  65. package/dist/utils/areDiffLineAnnotationsEqual.js.map +1 -0
  66. package/dist/utils/areHunkDataEqual.d.ts +7 -0
  67. package/dist/utils/areHunkDataEqual.d.ts.map +1 -0
  68. package/dist/utils/areHunkDataEqual.js +8 -0
  69. package/dist/utils/areHunkDataEqual.js.map +1 -0
  70. package/dist/utils/areLineAnnotationsEqual.d.ts +7 -0
  71. package/dist/utils/areLineAnnotationsEqual.d.ts.map +1 -0
  72. package/dist/utils/areLineAnnotationsEqual.js +8 -0
  73. package/dist/utils/areLineAnnotationsEqual.js.map +1 -0
  74. package/dist/utils/arePrePropertiesEqual.d.ts +7 -0
  75. package/dist/utils/arePrePropertiesEqual.d.ts.map +1 -0
  76. package/dist/utils/arePrePropertiesEqual.js +9 -0
  77. package/dist/utils/arePrePropertiesEqual.js.map +1 -0
  78. package/dist/utils/areRenderRangesEqual.d.ts +7 -0
  79. package/dist/utils/areRenderRangesEqual.d.ts.map +1 -0
  80. package/dist/utils/areRenderRangesEqual.js +9 -0
  81. package/dist/utils/areRenderRangesEqual.js.map +1 -0
  82. package/dist/utils/areVirtualWindowSpecsEqual.d.ts +7 -0
  83. package/dist/utils/areVirtualWindowSpecsEqual.d.ts.map +1 -0
  84. package/dist/utils/areVirtualWindowSpecsEqual.js +9 -0
  85. package/dist/utils/areVirtualWindowSpecsEqual.js.map +1 -0
  86. package/dist/utils/areWorkerStatsEqual.d.ts +8 -0
  87. package/dist/utils/areWorkerStatsEqual.d.ts.map +1 -0
  88. package/dist/utils/areWorkerStatsEqual.js +9 -0
  89. package/dist/utils/areWorkerStatsEqual.js.map +1 -0
  90. package/dist/utils/createTransformerWithState.js +1 -1
  91. package/dist/utils/createTransformerWithState.js.map +1 -1
  92. package/dist/utils/createWindowFromScrollPosition.d.ts +22 -0
  93. package/dist/utils/createWindowFromScrollPosition.d.ts.map +1 -0
  94. package/dist/utils/createWindowFromScrollPosition.js +26 -0
  95. package/dist/utils/createWindowFromScrollPosition.js.map +1 -0
  96. package/dist/utils/diffAcceptRejectHunk.js +36 -21
  97. package/dist/utils/diffAcceptRejectHunk.js.map +1 -1
  98. package/dist/utils/formatCSSVariablePrefix.d.ts +1 -1
  99. package/dist/utils/formatCSSVariablePrefix.js +2 -2
  100. package/dist/utils/formatCSSVariablePrefix.js.map +1 -1
  101. package/dist/utils/getHighlighterThemeStyles.js +12 -12
  102. package/dist/utils/getHighlighterThemeStyles.js.map +1 -1
  103. package/dist/utils/getOrCreateCodeNode.d.ts +14 -0
  104. package/dist/utils/getOrCreateCodeNode.d.ts.map +1 -0
  105. package/dist/utils/getOrCreateCodeNode.js +13 -0
  106. package/dist/utils/getOrCreateCodeNode.js.map +1 -0
  107. package/dist/utils/getTotalLineCountFromHunks.js +1 -1
  108. package/dist/utils/getTotalLineCountFromHunks.js.map +1 -1
  109. package/dist/utils/hast_utils.d.ts +2 -1
  110. package/dist/utils/hast_utils.d.ts.map +1 -1
  111. package/dist/utils/hast_utils.js +10 -1
  112. package/dist/utils/hast_utils.js.map +1 -1
  113. package/dist/utils/isDefaultRenderRange.d.ts +7 -0
  114. package/dist/utils/isDefaultRenderRange.d.ts.map +1 -0
  115. package/dist/utils/isDefaultRenderRange.js +8 -0
  116. package/dist/utils/isDefaultRenderRange.js.map +1 -0
  117. package/dist/utils/iterateOverDiff.d.ts +39 -0
  118. package/dist/utils/iterateOverDiff.d.ts.map +1 -0
  119. package/dist/utils/iterateOverDiff.js +356 -0
  120. package/dist/utils/iterateOverDiff.js.map +1 -0
  121. package/dist/utils/parseDiffFromFile.d.ts.map +1 -1
  122. package/dist/utils/parseDiffFromFile.js +8 -6
  123. package/dist/utils/parseDiffFromFile.js.map +1 -1
  124. package/dist/utils/parsePatchFiles.d.ts +15 -3
  125. package/dist/utils/parsePatchFiles.d.ts.map +1 -1
  126. package/dist/utils/parsePatchFiles.js +207 -158
  127. package/dist/utils/parsePatchFiles.js.map +1 -1
  128. package/dist/utils/processLine.js +4 -3
  129. package/dist/utils/processLine.js.map +1 -1
  130. package/dist/utils/renderDiffWithHighlighter.d.ts +7 -2
  131. package/dist/utils/renderDiffWithHighlighter.d.ts.map +1 -1
  132. package/dist/utils/renderDiffWithHighlighter.js +151 -229
  133. package/dist/utils/renderDiffWithHighlighter.js.map +1 -1
  134. package/dist/utils/renderFileWithHighlighter.js +2 -2
  135. package/dist/utils/renderFileWithHighlighter.js.map +1 -1
  136. package/dist/utils/setWrapperNodeProps.d.ts +3 -7
  137. package/dist/utils/setWrapperNodeProps.d.ts.map +1 -1
  138. package/dist/utils/setWrapperNodeProps.js +1 -1
  139. package/dist/utils/setWrapperNodeProps.js.map +1 -1
  140. package/dist/worker/WorkerPoolManager.d.ts +9 -2
  141. package/dist/worker/WorkerPoolManager.d.ts.map +1 -1
  142. package/dist/worker/WorkerPoolManager.js +124 -45
  143. package/dist/worker/WorkerPoolManager.js.map +1 -1
  144. package/dist/worker/types.d.ts +7 -0
  145. package/dist/worker/types.d.ts.map +1 -1
  146. package/dist/worker/worker-portable.js +652 -260
  147. package/dist/worker/worker-portable.js.map +1 -1
  148. package/dist/worker/worker.js +529 -249
  149. package/dist/worker/worker.js.map +1 -1
  150. package/package.json +21 -2
  151. package/dist/utils/createCodeNode.d.ts +0 -12
  152. package/dist/utils/createCodeNode.d.ts.map +0 -1
  153. package/dist/utils/createCodeNode.js +0 -12
  154. package/dist/utils/createCodeNode.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arePrePropertiesEqual.d.ts","names":[],"sources":["../../src/utils/arePrePropertiesEqual.ts"],"sourcesContent":[],"mappings":";;;iBAEgB,qBAAA,SACN,yCACA"}
@@ -0,0 +1,9 @@
1
+ //#region src/utils/arePrePropertiesEqual.ts
2
+ function arePrePropertiesEqual(propsA, propsB) {
3
+ if (propsA == null || propsB == null) return propsA === propsB;
4
+ return propsA.diffIndicators === propsB.diffIndicators && propsA.disableBackground === propsB.disableBackground && propsA.disableLineNumbers === propsB.disableLineNumbers && propsA.overflow === propsB.overflow && propsA.split === propsB.split && propsA.themeStyles === propsB.themeStyles && propsA.themeType === propsB.themeType && propsA.totalLines === propsB.totalLines;
5
+ }
6
+
7
+ //#endregion
8
+ export { arePrePropertiesEqual };
9
+ //# sourceMappingURL=arePrePropertiesEqual.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arePrePropertiesEqual.js","names":[],"sources":["../../src/utils/arePrePropertiesEqual.ts"],"sourcesContent":["import type { PrePropertiesConfig } from '../types';\n\nexport function arePrePropertiesEqual(\n propsA: PrePropertiesConfig | undefined,\n propsB: PrePropertiesConfig | undefined\n): boolean {\n if (propsA == null || propsB == null) {\n return propsA === propsB;\n }\n return (\n propsA.diffIndicators === propsB.diffIndicators &&\n propsA.disableBackground === propsB.disableBackground &&\n propsA.disableLineNumbers === propsB.disableLineNumbers &&\n propsA.overflow === propsB.overflow &&\n propsA.split === propsB.split &&\n propsA.themeStyles === propsB.themeStyles &&\n propsA.themeType === propsB.themeType &&\n propsA.totalLines === propsB.totalLines\n );\n}\n"],"mappings":";AAEA,SAAgB,sBACd,QACA,QACS;AACT,KAAI,UAAU,QAAQ,UAAU,KAC9B,QAAO,WAAW;AAEpB,QACE,OAAO,mBAAmB,OAAO,kBACjC,OAAO,sBAAsB,OAAO,qBACpC,OAAO,uBAAuB,OAAO,sBACrC,OAAO,aAAa,OAAO,YAC3B,OAAO,UAAU,OAAO,SACxB,OAAO,gBAAgB,OAAO,eAC9B,OAAO,cAAc,OAAO,aAC5B,OAAO,eAAe,OAAO"}
@@ -0,0 +1,7 @@
1
+ import { RenderRange } from "../types.js";
2
+
3
+ //#region src/utils/areRenderRangesEqual.d.ts
4
+ declare function areRenderRangesEqual(renderRangeA: RenderRange | undefined, renderRangeB: RenderRange | undefined): boolean;
5
+ //#endregion
6
+ export { areRenderRangesEqual };
7
+ //# sourceMappingURL=areRenderRangesEqual.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"areRenderRangesEqual.d.ts","names":[],"sources":["../../src/utils/areRenderRangesEqual.ts"],"sourcesContent":[],"mappings":";;;iBAEgB,oBAAA,eACA,uCACA"}
@@ -0,0 +1,9 @@
1
+ //#region src/utils/areRenderRangesEqual.ts
2
+ function areRenderRangesEqual(renderRangeA, renderRangeB) {
3
+ if (renderRangeA == null || renderRangeB == null) return renderRangeA === renderRangeB;
4
+ return renderRangeA.startingLine === renderRangeB.startingLine && renderRangeA.totalLines === renderRangeB.totalLines && renderRangeA.bufferBefore === renderRangeB.bufferBefore && renderRangeA.bufferAfter === renderRangeB.bufferAfter;
5
+ }
6
+
7
+ //#endregion
8
+ export { areRenderRangesEqual };
9
+ //# sourceMappingURL=areRenderRangesEqual.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"areRenderRangesEqual.js","names":[],"sources":["../../src/utils/areRenderRangesEqual.ts"],"sourcesContent":["import type { RenderRange } from '../types';\n\nexport function areRenderRangesEqual(\n renderRangeA: RenderRange | undefined,\n renderRangeB: RenderRange | undefined\n): boolean {\n if (renderRangeA == null || renderRangeB == null) {\n return renderRangeA === renderRangeB;\n }\n return (\n renderRangeA.startingLine === renderRangeB.startingLine &&\n renderRangeA.totalLines === renderRangeB.totalLines &&\n renderRangeA.bufferBefore === renderRangeB.bufferBefore &&\n renderRangeA.bufferAfter === renderRangeB.bufferAfter\n );\n}\n"],"mappings":";AAEA,SAAgB,qBACd,cACA,cACS;AACT,KAAI,gBAAgB,QAAQ,gBAAgB,KAC1C,QAAO,iBAAiB;AAE1B,QACE,aAAa,iBAAiB,aAAa,gBAC3C,aAAa,eAAe,aAAa,cACzC,aAAa,iBAAiB,aAAa,gBAC3C,aAAa,gBAAgB,aAAa"}
@@ -0,0 +1,7 @@
1
+ import { VirtualWindowSpecs } from "../types.js";
2
+
3
+ //#region src/utils/areVirtualWindowSpecsEqual.d.ts
4
+ declare function areVirtualWindowSpecsEqual(windowSpecsA: VirtualWindowSpecs | undefined, windowSpecsB: VirtualWindowSpecs | undefined): boolean;
5
+ //#endregion
6
+ export { areVirtualWindowSpecsEqual };
7
+ //# sourceMappingURL=areVirtualWindowSpecsEqual.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"areVirtualWindowSpecsEqual.d.ts","names":[],"sources":["../../src/utils/areVirtualWindowSpecsEqual.ts"],"sourcesContent":[],"mappings":";;;iBAEgB,0BAAA,eACA,8CACA"}
@@ -0,0 +1,9 @@
1
+ //#region src/utils/areVirtualWindowSpecsEqual.ts
2
+ function areVirtualWindowSpecsEqual(windowSpecsA, windowSpecsB) {
3
+ if (windowSpecsA == null || windowSpecsB == null) return windowSpecsA === windowSpecsB;
4
+ return windowSpecsA.top === windowSpecsB.top && windowSpecsA.bottom === windowSpecsB.bottom;
5
+ }
6
+
7
+ //#endregion
8
+ export { areVirtualWindowSpecsEqual };
9
+ //# sourceMappingURL=areVirtualWindowSpecsEqual.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"areVirtualWindowSpecsEqual.js","names":[],"sources":["../../src/utils/areVirtualWindowSpecsEqual.ts"],"sourcesContent":["import type { VirtualWindowSpecs } from '../types';\n\nexport function areVirtualWindowSpecsEqual(\n windowSpecsA: VirtualWindowSpecs | undefined,\n windowSpecsB: VirtualWindowSpecs | undefined\n): boolean {\n if (windowSpecsA == null || windowSpecsB == null) {\n return windowSpecsA === windowSpecsB;\n }\n return (\n windowSpecsA.top === windowSpecsB.top &&\n windowSpecsA.bottom === windowSpecsB.bottom\n );\n}\n"],"mappings":";AAEA,SAAgB,2BACd,cACA,cACS;AACT,KAAI,gBAAgB,QAAQ,gBAAgB,KAC1C,QAAO,iBAAiB;AAE1B,QACE,aAAa,QAAQ,aAAa,OAClC,aAAa,WAAW,aAAa"}
@@ -0,0 +1,8 @@
1
+ import { WorkerStats } from "../worker/types.js";
2
+ import "../worker/index.js";
3
+
4
+ //#region src/utils/areWorkerStatsEqual.d.ts
5
+ declare function areWorkerStatsEqual(statsA: WorkerStats | undefined, statsB: WorkerStats | undefined): boolean;
6
+ //#endregion
7
+ export { areWorkerStatsEqual };
8
+ //# sourceMappingURL=areWorkerStatsEqual.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"areWorkerStatsEqual.d.ts","names":[],"sources":["../../src/utils/areWorkerStatsEqual.ts"],"sourcesContent":[],"mappings":";;;;iBAEgB,mBAAA,SACN,iCACA"}
@@ -0,0 +1,9 @@
1
+ //#region src/utils/areWorkerStatsEqual.ts
2
+ function areWorkerStatsEqual(statsA, statsB) {
3
+ if (statsA == null || statsB == null) return statsA === statsB;
4
+ return statsA.busyWorkers === statsB.busyWorkers && statsA.diffCacheSize === statsB.diffCacheSize && statsA.fileCacheSize === statsB.fileCacheSize && statsA.managerState === statsB.managerState && statsA.pendingTasks === statsB.pendingTasks && statsA.queuedTasks === statsB.queuedTasks && statsA.themeSubscribers === statsB.themeSubscribers && statsA.totalWorkers === statsB.totalWorkers && statsA.workersFailed === statsB.workersFailed;
5
+ }
6
+
7
+ //#endregion
8
+ export { areWorkerStatsEqual };
9
+ //# sourceMappingURL=areWorkerStatsEqual.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"areWorkerStatsEqual.js","names":[],"sources":["../../src/utils/areWorkerStatsEqual.ts"],"sourcesContent":["import type { WorkerStats } from '../worker';\n\nexport function areWorkerStatsEqual(\n statsA: WorkerStats | undefined,\n statsB: WorkerStats | undefined\n): boolean {\n if (statsA == null || statsB == null) {\n return statsA === statsB;\n }\n return (\n statsA.busyWorkers === statsB.busyWorkers &&\n statsA.diffCacheSize === statsB.diffCacheSize &&\n statsA.fileCacheSize === statsB.fileCacheSize &&\n statsA.managerState === statsB.managerState &&\n statsA.pendingTasks === statsB.pendingTasks &&\n statsA.queuedTasks === statsB.queuedTasks &&\n statsA.themeSubscribers === statsB.themeSubscribers &&\n statsA.totalWorkers === statsB.totalWorkers &&\n statsA.workersFailed === statsB.workersFailed\n );\n}\n"],"mappings":";AAEA,SAAgB,oBACd,QACA,QACS;AACT,KAAI,UAAU,QAAQ,UAAU,KAC9B,QAAO,WAAW;AAEpB,QACE,OAAO,gBAAgB,OAAO,eAC9B,OAAO,kBAAkB,OAAO,iBAChC,OAAO,kBAAkB,OAAO,iBAChC,OAAO,iBAAiB,OAAO,gBAC/B,OAAO,iBAAiB,OAAO,gBAC/B,OAAO,gBAAgB,OAAO,eAC9B,OAAO,qBAAqB,OAAO,oBACnC,OAAO,iBAAiB,OAAO,gBAC/B,OAAO,kBAAkB,OAAO"}
@@ -4,7 +4,7 @@ import { transformerStyleToClass } from "@shikijs/transformers";
4
4
 
5
5
  //#region src/utils/createTransformerWithState.ts
6
6
  function createTransformerWithState(useCSSClasses = false) {
7
- const state = { lineInfo: {} };
7
+ const state = { lineInfo: [] };
8
8
  const transformers = [{
9
9
  line(node) {
10
10
  delete node.properties.class;
@@ -1 +1 @@
1
- {"version":3,"file":"createTransformerWithState.js","names":["state: SharedRenderState","transformers: ShikiTransformer[]","children: ElementContent[]","tokenStyleNormalizer: ShikiTransformer","style: Record<string, string>"],"sources":["../../src/utils/createTransformerWithState.ts"],"sourcesContent":["import {\n type ShikiTransformerStyleToClass,\n transformerStyleToClass,\n} from '@shikijs/transformers';\nimport type { ElementContent } from 'hast';\n\nimport type { SharedRenderState, ShikiTransformer } from '../types';\nimport { findCodeElement } from './hast_utils';\nimport { processLine } from './processLine';\n\ninterface CreateTransformerWithStateReturn {\n state: SharedRenderState;\n transformers: ShikiTransformer[];\n toClass: ShikiTransformerStyleToClass;\n}\n\nexport function createTransformerWithState(\n useCSSClasses = false\n): CreateTransformerWithStateReturn {\n const state: SharedRenderState = {\n lineInfo: {},\n };\n const transformers: ShikiTransformer[] = [\n {\n line(node) {\n // Remove the default class\n delete node.properties.class;\n return node;\n },\n pre(pre) {\n const code = findCodeElement(pre);\n const children: ElementContent[] = [];\n if (code != null) {\n let index = 1;\n for (const node of code.children) {\n if (node.type !== 'element') continue;\n children.push(processLine(node, index, state));\n index++;\n }\n code.children = children;\n }\n return pre;\n },\n },\n ];\n if (useCSSClasses) {\n transformers.push(tokenStyleNormalizer, toClass);\n }\n return { state, transformers, toClass };\n}\n\nconst toClass = transformerStyleToClass({ classPrefix: 'hl-' });\n\n// Create a transformer that converts token color/fontStyle to htmlStyle\n// This needs to run BEFORE transformerStyleToClass\nconst tokenStyleNormalizer: ShikiTransformer = {\n name: 'token-style-normalizer',\n tokens(lines) {\n for (const line of lines) {\n for (const token of line) {\n // Skip if htmlStyle is already set\n if (token.htmlStyle != null) continue;\n\n const style: Record<string, string> = {};\n\n if (token.color != null) {\n style.color = token.color;\n }\n if (token.bgColor != null) {\n style['background-color'] = token.bgColor;\n }\n if (token.fontStyle != null && token.fontStyle !== 0) {\n // FontStyle is a bitmask: 1 = italic, 2 = bold, 4 = underline\n if ((token.fontStyle & 1) !== 0) {\n style['font-style'] = 'italic';\n }\n if ((token.fontStyle & 2) !== 0) {\n style['font-weight'] = 'bold';\n }\n if ((token.fontStyle & 4) !== 0) {\n style['text-decoration'] = 'underline';\n }\n }\n\n // Only set htmlStyle if we have any styles\n if (Object.keys(style).length > 0) {\n token.htmlStyle = style;\n }\n }\n }\n },\n};\n"],"mappings":";;;;;AAgBA,SAAgB,2BACd,gBAAgB,OACkB;CAClC,MAAMA,QAA2B,EAC/B,UAAU,EAAE,EACb;CACD,MAAMC,eAAmC,CACvC;EACE,KAAK,MAAM;AAET,UAAO,KAAK,WAAW;AACvB,UAAO;;EAET,IAAI,KAAK;GACP,MAAM,OAAO,gBAAgB,IAAI;GACjC,MAAMC,WAA6B,EAAE;AACrC,OAAI,QAAQ,MAAM;IAChB,IAAI,QAAQ;AACZ,SAAK,MAAM,QAAQ,KAAK,UAAU;AAChC,SAAI,KAAK,SAAS,UAAW;AAC7B,cAAS,KAAK,YAAY,MAAM,OAAO,MAAM,CAAC;AAC9C;;AAEF,SAAK,WAAW;;AAElB,UAAO;;EAEV,CACF;AACD,KAAI,cACF,cAAa,KAAK,sBAAsB,QAAQ;AAElD,QAAO;EAAE;EAAO;EAAc;EAAS;;AAGzC,MAAM,UAAU,wBAAwB,EAAE,aAAa,OAAO,CAAC;AAI/D,MAAMC,uBAAyC;CAC7C,MAAM;CACN,OAAO,OAAO;AACZ,OAAK,MAAM,QAAQ,MACjB,MAAK,MAAM,SAAS,MAAM;AAExB,OAAI,MAAM,aAAa,KAAM;GAE7B,MAAMC,QAAgC,EAAE;AAExC,OAAI,MAAM,SAAS,KACjB,OAAM,QAAQ,MAAM;AAEtB,OAAI,MAAM,WAAW,KACnB,OAAM,sBAAsB,MAAM;AAEpC,OAAI,MAAM,aAAa,QAAQ,MAAM,cAAc,GAAG;AAEpD,SAAK,MAAM,YAAY,OAAO,EAC5B,OAAM,gBAAgB;AAExB,SAAK,MAAM,YAAY,OAAO,EAC5B,OAAM,iBAAiB;AAEzB,SAAK,MAAM,YAAY,OAAO,EAC5B,OAAM,qBAAqB;;AAK/B,OAAI,OAAO,KAAK,MAAM,CAAC,SAAS,EAC9B,OAAM,YAAY;;;CAK3B"}
1
+ {"version":3,"file":"createTransformerWithState.js","names":["state: SharedRenderState","transformers: ShikiTransformer[]","children: ElementContent[]","tokenStyleNormalizer: ShikiTransformer","style: Record<string, string>"],"sources":["../../src/utils/createTransformerWithState.ts"],"sourcesContent":["import {\n type ShikiTransformerStyleToClass,\n transformerStyleToClass,\n} from '@shikijs/transformers';\nimport type { ElementContent } from 'hast';\n\nimport type { SharedRenderState, ShikiTransformer } from '../types';\nimport { findCodeElement } from './hast_utils';\nimport { processLine } from './processLine';\n\ninterface CreateTransformerWithStateReturn {\n state: SharedRenderState;\n transformers: ShikiTransformer[];\n toClass: ShikiTransformerStyleToClass;\n}\n\nexport function createTransformerWithState(\n useCSSClasses = false\n): CreateTransformerWithStateReturn {\n const state: SharedRenderState = { lineInfo: [] };\n const transformers: ShikiTransformer[] = [\n {\n line(node) {\n // Remove the default class\n delete node.properties.class;\n return node;\n },\n pre(pre) {\n const code = findCodeElement(pre);\n const children: ElementContent[] = [];\n if (code != null) {\n let index = 1;\n for (const node of code.children) {\n if (node.type !== 'element') continue;\n children.push(processLine(node, index, state));\n index++;\n }\n code.children = children;\n }\n return pre;\n },\n },\n ];\n if (useCSSClasses) {\n transformers.push(tokenStyleNormalizer, toClass);\n }\n return { state, transformers, toClass };\n}\n\nconst toClass = transformerStyleToClass({ classPrefix: 'hl-' });\n\n// Create a transformer that converts token color/fontStyle to htmlStyle\n// This needs to run BEFORE transformerStyleToClass\nconst tokenStyleNormalizer: ShikiTransformer = {\n name: 'token-style-normalizer',\n tokens(lines) {\n for (const line of lines) {\n for (const token of line) {\n // Skip if htmlStyle is already set\n if (token.htmlStyle != null) continue;\n\n const style: Record<string, string> = {};\n\n if (token.color != null) {\n style.color = token.color;\n }\n if (token.bgColor != null) {\n style['background-color'] = token.bgColor;\n }\n if (token.fontStyle != null && token.fontStyle !== 0) {\n // FontStyle is a bitmask: 1 = italic, 2 = bold, 4 = underline\n if ((token.fontStyle & 1) !== 0) {\n style['font-style'] = 'italic';\n }\n if ((token.fontStyle & 2) !== 0) {\n style['font-weight'] = 'bold';\n }\n if ((token.fontStyle & 4) !== 0) {\n style['text-decoration'] = 'underline';\n }\n }\n\n // Only set htmlStyle if we have any styles\n if (Object.keys(style).length > 0) {\n token.htmlStyle = style;\n }\n }\n }\n },\n};\n"],"mappings":";;;;;AAgBA,SAAgB,2BACd,gBAAgB,OACkB;CAClC,MAAMA,QAA2B,EAAE,UAAU,EAAE,EAAE;CACjD,MAAMC,eAAmC,CACvC;EACE,KAAK,MAAM;AAET,UAAO,KAAK,WAAW;AACvB,UAAO;;EAET,IAAI,KAAK;GACP,MAAM,OAAO,gBAAgB,IAAI;GACjC,MAAMC,WAA6B,EAAE;AACrC,OAAI,QAAQ,MAAM;IAChB,IAAI,QAAQ;AACZ,SAAK,MAAM,QAAQ,KAAK,UAAU;AAChC,SAAI,KAAK,SAAS,UAAW;AAC7B,cAAS,KAAK,YAAY,MAAM,OAAO,MAAM,CAAC;AAC9C;;AAEF,SAAK,WAAW;;AAElB,UAAO;;EAEV,CACF;AACD,KAAI,cACF,cAAa,KAAK,sBAAsB,QAAQ;AAElD,QAAO;EAAE;EAAO;EAAc;EAAS;;AAGzC,MAAM,UAAU,wBAAwB,EAAE,aAAa,OAAO,CAAC;AAI/D,MAAMC,uBAAyC;CAC7C,MAAM;CACN,OAAO,OAAO;AACZ,OAAK,MAAM,QAAQ,MACjB,MAAK,MAAM,SAAS,MAAM;AAExB,OAAI,MAAM,aAAa,KAAM;GAE7B,MAAMC,QAAgC,EAAE;AAExC,OAAI,MAAM,SAAS,KACjB,OAAM,QAAQ,MAAM;AAEtB,OAAI,MAAM,WAAW,KACnB,OAAM,sBAAsB,MAAM;AAEpC,OAAI,MAAM,aAAa,QAAQ,MAAM,cAAc,GAAG;AAEpD,SAAK,MAAM,YAAY,OAAO,EAC5B,OAAM,gBAAgB;AAExB,SAAK,MAAM,YAAY,OAAO,EAC5B,OAAM,iBAAiB;AAEzB,SAAK,MAAM,YAAY,OAAO,EAC5B,OAAM,qBAAqB;;AAK/B,OAAI,OAAO,KAAK,MAAM,CAAC,SAAS,EAC9B,OAAM,YAAY;;;CAK3B"}
@@ -0,0 +1,22 @@
1
+ import { VirtualWindowSpecs } from "../types.js";
2
+
3
+ //#region src/utils/createWindowFromScrollPosition.d.ts
4
+ interface WindowFromScrollPositionProps {
5
+ scrollTop: number;
6
+ height: number;
7
+ scrollHeight: number;
8
+ containerOffset?: number;
9
+ fitPerfectly: boolean;
10
+ overscrollSize: number;
11
+ }
12
+ declare function createWindowFromScrollPosition({
13
+ scrollTop,
14
+ scrollHeight,
15
+ height,
16
+ containerOffset,
17
+ fitPerfectly,
18
+ overscrollSize
19
+ }: WindowFromScrollPositionProps): VirtualWindowSpecs;
20
+ //#endregion
21
+ export { createWindowFromScrollPosition };
22
+ //# sourceMappingURL=createWindowFromScrollPosition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createWindowFromScrollPosition.d.ts","names":[],"sources":["../../src/utils/createWindowFromScrollPosition.ts"],"sourcesContent":[],"mappings":";;;UAEU,6BAAA;;EAF8B,MAE9B,EAAA,MAAA;EASV,YAAgB,EAAA,MAAA;EACd,eAAA,CAAA,EAAA,MAAA;EACA,YAAA,EAAA,OAAA;EACA,cAAA,EAAA,MAAA;;AAEA,iBALc,8BAAA,CAKd;EAAA,SAAA;EAAA,YAAA;EAAA,MAAA;EAAA,eAAA;EAAA,YAAA;EAAA;AAAA,CAAA,EAEC,6BAFD,CAAA,EAEiC,kBAFjC"}
@@ -0,0 +1,26 @@
1
+ //#region src/utils/createWindowFromScrollPosition.ts
2
+ function createWindowFromScrollPosition({ scrollTop, scrollHeight, height, containerOffset = 0, fitPerfectly, overscrollSize }) {
3
+ const windowHeight = height + overscrollSize * 2;
4
+ if (windowHeight > scrollHeight || fitPerfectly) return {
5
+ top: Math.max(scrollTop - containerOffset, 0),
6
+ bottom: scrollTop + (fitPerfectly ? height : windowHeight) - containerOffset
7
+ };
8
+ let top = scrollTop + height / 2 - windowHeight / 2;
9
+ let bottom = top + windowHeight;
10
+ if (top < 0) {
11
+ top = 0;
12
+ bottom = Math.min(windowHeight, scrollHeight);
13
+ } else if (bottom > scrollHeight) {
14
+ bottom = scrollHeight;
15
+ top = Math.max(bottom - windowHeight, 0);
16
+ }
17
+ top = Math.floor(Math.max(top - containerOffset, 0));
18
+ return {
19
+ top,
20
+ bottom: Math.ceil(Math.max(Math.min(bottom, scrollHeight) - containerOffset, top))
21
+ };
22
+ }
23
+
24
+ //#endregion
25
+ export { createWindowFromScrollPosition };
26
+ //# sourceMappingURL=createWindowFromScrollPosition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createWindowFromScrollPosition.js","names":[],"sources":["../../src/utils/createWindowFromScrollPosition.ts"],"sourcesContent":["import type { VirtualWindowSpecs } from '../types';\n\ninterface WindowFromScrollPositionProps {\n scrollTop: number;\n height: number;\n scrollHeight: number;\n containerOffset?: number;\n fitPerfectly: boolean;\n overscrollSize: number;\n}\n\nexport function createWindowFromScrollPosition({\n scrollTop,\n scrollHeight,\n height,\n containerOffset = 0,\n fitPerfectly,\n overscrollSize,\n}: WindowFromScrollPositionProps): VirtualWindowSpecs {\n const windowHeight = height + overscrollSize * 2;\n if (windowHeight > scrollHeight || fitPerfectly) {\n return {\n top: Math.max(scrollTop - containerOffset, 0),\n bottom:\n scrollTop + (fitPerfectly ? height : windowHeight) - containerOffset,\n };\n }\n const scrollCenter = scrollTop + height / 2;\n let top = scrollCenter - windowHeight / 2;\n let bottom = top + windowHeight;\n if (top < 0) {\n top = 0;\n bottom = Math.min(windowHeight, scrollHeight);\n } else if (bottom > scrollHeight) {\n bottom = scrollHeight;\n top = Math.max(bottom - windowHeight, 0);\n }\n top = Math.floor(Math.max(top - containerOffset, 0));\n return {\n top,\n bottom: Math.ceil(\n Math.max(Math.min(bottom, scrollHeight) - containerOffset, top)\n ),\n };\n}\n"],"mappings":";AAWA,SAAgB,+BAA+B,EAC7C,WACA,cACA,QACA,kBAAkB,GAClB,cACA,kBACoD;CACpD,MAAM,eAAe,SAAS,iBAAiB;AAC/C,KAAI,eAAe,gBAAgB,aACjC,QAAO;EACL,KAAK,KAAK,IAAI,YAAY,iBAAiB,EAAE;EAC7C,QACE,aAAa,eAAe,SAAS,gBAAgB;EACxD;CAGH,IAAI,MADiB,YAAY,SAAS,IACjB,eAAe;CACxC,IAAI,SAAS,MAAM;AACnB,KAAI,MAAM,GAAG;AACX,QAAM;AACN,WAAS,KAAK,IAAI,cAAc,aAAa;YACpC,SAAS,cAAc;AAChC,WAAS;AACT,QAAM,KAAK,IAAI,SAAS,cAAc,EAAE;;AAE1C,OAAM,KAAK,MAAM,KAAK,IAAI,MAAM,iBAAiB,EAAE,CAAC;AACpD,QAAO;EACL;EACA,QAAQ,KAAK,KACX,KAAK,IAAI,KAAK,IAAI,QAAQ,aAAa,GAAG,iBAAiB,IAAI,CAChE;EACF"}
@@ -3,12 +3,12 @@ function diffAcceptRejectHunk(diff, hunkIndex, type) {
3
3
  diff = {
4
4
  ...diff,
5
5
  hunks: [...diff.hunks],
6
- oldLines: diff.oldLines != null ? [...diff.oldLines] : void 0,
7
- newLines: diff.newLines != null ? [...diff.newLines] : void 0,
6
+ deletionLines: type === "accept" ? [...diff.deletionLines] : diff.deletionLines,
7
+ additionLines: type === "reject" ? [...diff.additionLines] : diff.additionLines,
8
8
  cacheKey: diff.cacheKey != null ? `${diff.cacheKey}:${type[0]}-${hunkIndex}` : void 0
9
9
  };
10
- const { newLines, oldLines } = diff;
11
- if (newLines != null && oldLines != null) {
10
+ const { additionLines, deletionLines } = diff;
11
+ if (additionLines != null && deletionLines != null) {
12
12
  const hunk = diff.hunks[hunkIndex];
13
13
  if (hunk == null) {
14
14
  console.error({
@@ -17,8 +17,8 @@ function diffAcceptRejectHunk(diff, hunkIndex, type) {
17
17
  });
18
18
  throw new Error(`diffResolveRejectHunk: Invalid hunk index: ${hunkIndex}`);
19
19
  }
20
- if (type === "reject") newLines.splice(hunk.additionStart - 1, hunk.additionCount, ...oldLines.slice(hunk.deletionStart - 1, hunk.deletionStart - 1 + hunk.deletionCount));
21
- else oldLines.splice(hunk.deletionStart - 1, hunk.deletionCount, ...newLines.slice(hunk.additionStart - 1, hunk.additionStart - 1 + hunk.additionCount));
20
+ if (type === "reject") additionLines.splice(hunk.additionLineIndex, hunk.additionCount, ...deletionLines.slice(hunk.deletionLineIndex, hunk.deletionLineIndex + hunk.deletionCount));
21
+ else deletionLines.splice(hunk.deletionLineIndex, hunk.deletionCount, ...additionLines.slice(hunk.additionLineIndex, hunk.additionLineIndex + hunk.additionCount));
22
22
  }
23
23
  let deletionOffset = 0;
24
24
  let additionOffset = 0;
@@ -35,25 +35,25 @@ function diffAcceptRejectHunk(diff, hunkIndex, type) {
35
35
  });
36
36
  throw new Error("diffResolveRejectHunk: iterating through hunks, hunk doesnt exist...");
37
37
  }
38
- hunk = { ...hunk };
39
- diff.hunks[i] = hunk;
38
+ const { noEOFCRAdditions, noEOFCRDeletions } = hunk;
39
+ diff.hunks[i] = hunk = { ...hunk };
40
40
  if (i === hunkIndex) {
41
+ hunk.noEOFCRDeletions = false;
42
+ hunk.noEOFCRAdditions = false;
43
+ if (type === "accept" && noEOFCRAdditions || type === "reject" && noEOFCRDeletions) {
44
+ hunk.noEOFCRAdditions = true;
45
+ hunk.noEOFCRDeletions = true;
46
+ }
41
47
  const newContent = {
42
48
  type: "context",
43
- lines: [],
44
- noEOFCR: false
49
+ lines: 0,
50
+ additionLineIndex: hunk.additionLineIndex,
51
+ deletionLineIndex: hunk.deletionLineIndex
45
52
  };
46
- for (const content of hunk.hunkContent) if (content.type === "context") {
47
- newContent.lines.push(...content.lines);
48
- newContent.noEOFCR = content.noEOFCR;
49
- } else if (type === "accept") {
50
- newContent.lines.push(...content.additions);
51
- newContent.noEOFCR = content.noEOFCRAdditions;
52
- } else if (type === "reject") {
53
- newContent.lines.push(...content.deletions);
54
- newContent.noEOFCR = content.noEOFCRDeletions;
55
- }
56
- const lineCount = newContent.lines.length;
53
+ for (const content of hunk.hunkContent) if (content.type === "context") newContent.lines += content.lines;
54
+ else if (type === "accept") newContent.lines += content.additions;
55
+ else if (type === "reject") newContent.lines += content.deletions;
56
+ const lineCount = newContent.lines;
57
57
  hunk.hunkContent = [newContent];
58
58
  splitOffset = lineCount - hunk.splitLineCount;
59
59
  hunk.splitLineCount = lineCount;
@@ -67,11 +67,26 @@ function diffAcceptRejectHunk(diff, hunkIndex, type) {
67
67
  hunk.additionLines = 0;
68
68
  diff.splitLineCount += splitOffset;
69
69
  diff.unifiedLineCount += unifiedOffset;
70
+ if (splitOffset === 0 && unifiedOffset === 0 && additionOffset === 0 && deletionOffset === 0) break;
70
71
  } else {
71
72
  hunk.splitLineStart += splitOffset;
72
73
  hunk.unifiedLineStart += unifiedOffset;
73
74
  hunk.additionStart += additionOffset;
75
+ hunk.additionLineIndex += additionOffset;
76
+ hunk.deletionLineIndex += deletionOffset;
74
77
  hunk.deletionStart += deletionOffset;
78
+ if (deletionOffset !== 0 || additionOffset !== 0) {
79
+ let i$1 = 0;
80
+ while (i$1 < hunk.hunkContent.length) {
81
+ const content = hunk.hunkContent[i$1];
82
+ hunk.hunkContent[i$1] = {
83
+ ...content,
84
+ additionLineIndex: content.additionLineIndex + additionOffset,
85
+ deletionLineIndex: content.deletionLineIndex + deletionOffset
86
+ };
87
+ i$1++;
88
+ }
89
+ }
75
90
  }
76
91
  }
77
92
  return diff;
@@ -1 +1 @@
1
- {"version":3,"file":"diffAcceptRejectHunk.js","names":["newContent: ContextContent"],"sources":["../../src/utils/diffAcceptRejectHunk.ts"],"sourcesContent":["import type { ContextContent, FileDiffMetadata } from '../types';\n\nexport function diffAcceptRejectHunk(\n diff: FileDiffMetadata,\n hunkIndex: number,\n type: 'accept' | 'reject'\n): FileDiffMetadata {\n diff = {\n ...diff,\n hunks: [...diff.hunks],\n oldLines: diff.oldLines != null ? [...diff.oldLines] : undefined,\n newLines: diff.newLines != null ? [...diff.newLines] : undefined,\n // Automatically update cacheKey if it exists, since content is changing\n cacheKey:\n diff.cacheKey != null\n ? `${diff.cacheKey}:${type[0]}-${hunkIndex}`\n : undefined,\n };\n // Fix the content lines\n const { newLines, oldLines } = diff;\n if (newLines != null && oldLines != null) {\n const hunk = diff.hunks[hunkIndex];\n if (hunk == null) {\n console.error({ diff, hunkIndex });\n throw new Error(\n `diffResolveRejectHunk: Invalid hunk index: ${hunkIndex}`\n );\n }\n if (type === 'reject') {\n newLines.splice(\n hunk.additionStart - 1,\n hunk.additionCount,\n ...oldLines.slice(\n hunk.deletionStart - 1,\n hunk.deletionStart - 1 + hunk.deletionCount\n )\n );\n } else {\n oldLines.splice(\n hunk.deletionStart - 1,\n hunk.deletionCount,\n ...newLines.slice(\n hunk.additionStart - 1,\n hunk.additionStart - 1 + hunk.additionCount\n )\n );\n }\n }\n let deletionOffset = 0;\n let additionOffset = 0;\n let splitOffset = 0;\n let unifiedOffset = 0;\n for (let i = hunkIndex; i < diff.hunks.length; i++) {\n let hunk = diff.hunks[i];\n if (hunk == null) {\n console.error({ hunk, i, hunkIndex, diff });\n throw new Error(\n 'diffResolveRejectHunk: iterating through hunks, hunk doesnt exist...'\n );\n }\n hunk = { ...hunk };\n diff.hunks[i] = hunk;\n if (i === hunkIndex) {\n const newContent: ContextContent = {\n type: 'context',\n lines: [],\n noEOFCR: false,\n };\n for (const content of hunk.hunkContent) {\n if (content.type === 'context') {\n newContent.lines.push(...content.lines);\n newContent.noEOFCR = content.noEOFCR;\n } else if (type === 'accept') {\n newContent.lines.push(...content.additions);\n newContent.noEOFCR = content.noEOFCRAdditions;\n } else if (type === 'reject') {\n newContent.lines.push(...content.deletions);\n newContent.noEOFCR = content.noEOFCRDeletions;\n }\n }\n const lineCount = newContent.lines.length;\n hunk.hunkContent = [newContent];\n splitOffset = lineCount - hunk.splitLineCount;\n hunk.splitLineCount = lineCount;\n unifiedOffset = lineCount - hunk.unifiedLineCount;\n hunk.unifiedLineCount = lineCount;\n deletionOffset = lineCount - hunk.deletionCount;\n hunk.deletionCount = lineCount;\n hunk.deletionLines = 0;\n additionOffset = lineCount - hunk.additionCount;\n hunk.additionCount = lineCount;\n hunk.additionLines = 0;\n diff.splitLineCount += splitOffset;\n diff.unifiedLineCount += unifiedOffset;\n } else {\n hunk.splitLineStart += splitOffset;\n hunk.unifiedLineStart += unifiedOffset;\n hunk.additionStart += additionOffset;\n hunk.deletionStart += deletionOffset;\n }\n }\n return diff;\n}\n"],"mappings":";AAEA,SAAgB,qBACd,MACA,WACA,MACkB;AAClB,QAAO;EACL,GAAG;EACH,OAAO,CAAC,GAAG,KAAK,MAAM;EACtB,UAAU,KAAK,YAAY,OAAO,CAAC,GAAG,KAAK,SAAS,GAAG;EACvD,UAAU,KAAK,YAAY,OAAO,CAAC,GAAG,KAAK,SAAS,GAAG;EAEvD,UACE,KAAK,YAAY,OACb,GAAG,KAAK,SAAS,GAAG,KAAK,GAAG,GAAG,cAC/B;EACP;CAED,MAAM,EAAE,UAAU,aAAa;AAC/B,KAAI,YAAY,QAAQ,YAAY,MAAM;EACxC,MAAM,OAAO,KAAK,MAAM;AACxB,MAAI,QAAQ,MAAM;AAChB,WAAQ,MAAM;IAAE;IAAM;IAAW,CAAC;AAClC,SAAM,IAAI,MACR,8CAA8C,YAC/C;;AAEH,MAAI,SAAS,SACX,UAAS,OACP,KAAK,gBAAgB,GACrB,KAAK,eACL,GAAG,SAAS,MACV,KAAK,gBAAgB,GACrB,KAAK,gBAAgB,IAAI,KAAK,cAC/B,CACF;MAED,UAAS,OACP,KAAK,gBAAgB,GACrB,KAAK,eACL,GAAG,SAAS,MACV,KAAK,gBAAgB,GACrB,KAAK,gBAAgB,IAAI,KAAK,cAC/B,CACF;;CAGL,IAAI,iBAAiB;CACrB,IAAI,iBAAiB;CACrB,IAAI,cAAc;CAClB,IAAI,gBAAgB;AACpB,MAAK,IAAI,IAAI,WAAW,IAAI,KAAK,MAAM,QAAQ,KAAK;EAClD,IAAI,OAAO,KAAK,MAAM;AACtB,MAAI,QAAQ,MAAM;AAChB,WAAQ,MAAM;IAAE;IAAM;IAAG;IAAW;IAAM,CAAC;AAC3C,SAAM,IAAI,MACR,uEACD;;AAEH,SAAO,EAAE,GAAG,MAAM;AAClB,OAAK,MAAM,KAAK;AAChB,MAAI,MAAM,WAAW;GACnB,MAAMA,aAA6B;IACjC,MAAM;IACN,OAAO,EAAE;IACT,SAAS;IACV;AACD,QAAK,MAAM,WAAW,KAAK,YACzB,KAAI,QAAQ,SAAS,WAAW;AAC9B,eAAW,MAAM,KAAK,GAAG,QAAQ,MAAM;AACvC,eAAW,UAAU,QAAQ;cACpB,SAAS,UAAU;AAC5B,eAAW,MAAM,KAAK,GAAG,QAAQ,UAAU;AAC3C,eAAW,UAAU,QAAQ;cACpB,SAAS,UAAU;AAC5B,eAAW,MAAM,KAAK,GAAG,QAAQ,UAAU;AAC3C,eAAW,UAAU,QAAQ;;GAGjC,MAAM,YAAY,WAAW,MAAM;AACnC,QAAK,cAAc,CAAC,WAAW;AAC/B,iBAAc,YAAY,KAAK;AAC/B,QAAK,iBAAiB;AACtB,mBAAgB,YAAY,KAAK;AACjC,QAAK,mBAAmB;AACxB,oBAAiB,YAAY,KAAK;AAClC,QAAK,gBAAgB;AACrB,QAAK,gBAAgB;AACrB,oBAAiB,YAAY,KAAK;AAClC,QAAK,gBAAgB;AACrB,QAAK,gBAAgB;AACrB,QAAK,kBAAkB;AACvB,QAAK,oBAAoB;SACpB;AACL,QAAK,kBAAkB;AACvB,QAAK,oBAAoB;AACzB,QAAK,iBAAiB;AACtB,QAAK,iBAAiB;;;AAG1B,QAAO"}
1
+ {"version":3,"file":"diffAcceptRejectHunk.js","names":["newContent: ContextContent","i"],"sources":["../../src/utils/diffAcceptRejectHunk.ts"],"sourcesContent":["import type { ContextContent, FileDiffMetadata } from '../types';\n\nexport function diffAcceptRejectHunk(\n diff: FileDiffMetadata,\n hunkIndex: number,\n type: 'accept' | 'reject'\n): FileDiffMetadata {\n diff = {\n ...diff,\n hunks: [...diff.hunks],\n deletionLines:\n type === 'accept' ? [...diff.deletionLines] : diff.deletionLines,\n additionLines:\n type === 'reject' ? [...diff.additionLines] : diff.additionLines,\n // Automatically update cacheKey if it exists, since content is changing\n cacheKey:\n diff.cacheKey != null\n ? `${diff.cacheKey}:${type[0]}-${hunkIndex}`\n : undefined,\n };\n // Fix the content lines\n const { additionLines, deletionLines } = diff;\n if (additionLines != null && deletionLines != null) {\n const hunk = diff.hunks[hunkIndex];\n if (hunk == null) {\n console.error({ diff, hunkIndex });\n throw new Error(\n `diffResolveRejectHunk: Invalid hunk index: ${hunkIndex}`\n );\n }\n if (type === 'reject') {\n additionLines.splice(\n hunk.additionLineIndex,\n hunk.additionCount,\n ...deletionLines.slice(\n hunk.deletionLineIndex,\n hunk.deletionLineIndex + hunk.deletionCount\n )\n );\n } else {\n deletionLines.splice(\n hunk.deletionLineIndex,\n hunk.deletionCount,\n ...additionLines.slice(\n hunk.additionLineIndex,\n hunk.additionLineIndex + hunk.additionCount\n )\n );\n }\n }\n let deletionOffset = 0;\n let additionOffset = 0;\n let splitOffset = 0;\n let unifiedOffset = 0;\n for (let i = hunkIndex; i < diff.hunks.length; i++) {\n let hunk = diff.hunks[i];\n if (hunk == null) {\n console.error({ hunk, i, hunkIndex, diff });\n throw new Error(\n 'diffResolveRejectHunk: iterating through hunks, hunk doesnt exist...'\n );\n }\n const { noEOFCRAdditions, noEOFCRDeletions } = hunk;\n diff.hunks[i] = hunk = { ...hunk };\n\n if (i === hunkIndex) {\n hunk.noEOFCRDeletions = false;\n hunk.noEOFCRAdditions = false;\n if (\n (type === 'accept' && noEOFCRAdditions) ||\n (type === 'reject' && noEOFCRDeletions)\n ) {\n hunk.noEOFCRAdditions = true;\n hunk.noEOFCRDeletions = true;\n }\n const newContent: ContextContent = {\n type: 'context',\n lines: 0,\n additionLineIndex: hunk.additionLineIndex,\n deletionLineIndex: hunk.deletionLineIndex,\n };\n for (const content of hunk.hunkContent) {\n if (content.type === 'context') {\n newContent.lines += content.lines;\n } else if (type === 'accept') {\n newContent.lines += content.additions;\n } else if (type === 'reject') {\n newContent.lines += content.deletions;\n }\n }\n const lineCount = newContent.lines;\n hunk.hunkContent = [newContent];\n splitOffset = lineCount - hunk.splitLineCount;\n hunk.splitLineCount = lineCount;\n unifiedOffset = lineCount - hunk.unifiedLineCount;\n hunk.unifiedLineCount = lineCount;\n deletionOffset = lineCount - hunk.deletionCount;\n hunk.deletionCount = lineCount;\n hunk.deletionLines = 0;\n additionOffset = lineCount - hunk.additionCount;\n hunk.additionCount = lineCount;\n hunk.additionLines = 0;\n diff.splitLineCount += splitOffset;\n diff.unifiedLineCount += unifiedOffset;\n // If we don't need to make any value offset differences for the rest of\n // the hunks, we done\n if (\n splitOffset === 0 &&\n unifiedOffset === 0 &&\n additionOffset === 0 &&\n deletionOffset === 0\n ) {\n break;\n }\n } else {\n hunk.splitLineStart += splitOffset;\n hunk.unifiedLineStart += unifiedOffset;\n\n hunk.additionStart += additionOffset;\n hunk.additionLineIndex += additionOffset;\n\n hunk.deletionLineIndex += deletionOffset;\n hunk.deletionStart += deletionOffset;\n\n if (deletionOffset !== 0 || additionOffset !== 0) {\n let i = 0;\n while (i < hunk.hunkContent.length) {\n const content = hunk.hunkContent[i];\n hunk.hunkContent[i] = {\n ...content,\n additionLineIndex: content.additionLineIndex + additionOffset,\n deletionLineIndex: content.deletionLineIndex + deletionOffset,\n };\n i++;\n }\n }\n }\n }\n return diff;\n}\n"],"mappings":";AAEA,SAAgB,qBACd,MACA,WACA,MACkB;AAClB,QAAO;EACL,GAAG;EACH,OAAO,CAAC,GAAG,KAAK,MAAM;EACtB,eACE,SAAS,WAAW,CAAC,GAAG,KAAK,cAAc,GAAG,KAAK;EACrD,eACE,SAAS,WAAW,CAAC,GAAG,KAAK,cAAc,GAAG,KAAK;EAErD,UACE,KAAK,YAAY,OACb,GAAG,KAAK,SAAS,GAAG,KAAK,GAAG,GAAG,cAC/B;EACP;CAED,MAAM,EAAE,eAAe,kBAAkB;AACzC,KAAI,iBAAiB,QAAQ,iBAAiB,MAAM;EAClD,MAAM,OAAO,KAAK,MAAM;AACxB,MAAI,QAAQ,MAAM;AAChB,WAAQ,MAAM;IAAE;IAAM;IAAW,CAAC;AAClC,SAAM,IAAI,MACR,8CAA8C,YAC/C;;AAEH,MAAI,SAAS,SACX,eAAc,OACZ,KAAK,mBACL,KAAK,eACL,GAAG,cAAc,MACf,KAAK,mBACL,KAAK,oBAAoB,KAAK,cAC/B,CACF;MAED,eAAc,OACZ,KAAK,mBACL,KAAK,eACL,GAAG,cAAc,MACf,KAAK,mBACL,KAAK,oBAAoB,KAAK,cAC/B,CACF;;CAGL,IAAI,iBAAiB;CACrB,IAAI,iBAAiB;CACrB,IAAI,cAAc;CAClB,IAAI,gBAAgB;AACpB,MAAK,IAAI,IAAI,WAAW,IAAI,KAAK,MAAM,QAAQ,KAAK;EAClD,IAAI,OAAO,KAAK,MAAM;AACtB,MAAI,QAAQ,MAAM;AAChB,WAAQ,MAAM;IAAE;IAAM;IAAG;IAAW;IAAM,CAAC;AAC3C,SAAM,IAAI,MACR,uEACD;;EAEH,MAAM,EAAE,kBAAkB,qBAAqB;AAC/C,OAAK,MAAM,KAAK,OAAO,EAAE,GAAG,MAAM;AAElC,MAAI,MAAM,WAAW;AACnB,QAAK,mBAAmB;AACxB,QAAK,mBAAmB;AACxB,OACG,SAAS,YAAY,oBACrB,SAAS,YAAY,kBACtB;AACA,SAAK,mBAAmB;AACxB,SAAK,mBAAmB;;GAE1B,MAAMA,aAA6B;IACjC,MAAM;IACN,OAAO;IACP,mBAAmB,KAAK;IACxB,mBAAmB,KAAK;IACzB;AACD,QAAK,MAAM,WAAW,KAAK,YACzB,KAAI,QAAQ,SAAS,UACnB,YAAW,SAAS,QAAQ;YACnB,SAAS,SAClB,YAAW,SAAS,QAAQ;YACnB,SAAS,SAClB,YAAW,SAAS,QAAQ;GAGhC,MAAM,YAAY,WAAW;AAC7B,QAAK,cAAc,CAAC,WAAW;AAC/B,iBAAc,YAAY,KAAK;AAC/B,QAAK,iBAAiB;AACtB,mBAAgB,YAAY,KAAK;AACjC,QAAK,mBAAmB;AACxB,oBAAiB,YAAY,KAAK;AAClC,QAAK,gBAAgB;AACrB,QAAK,gBAAgB;AACrB,oBAAiB,YAAY,KAAK;AAClC,QAAK,gBAAgB;AACrB,QAAK,gBAAgB;AACrB,QAAK,kBAAkB;AACvB,QAAK,oBAAoB;AAGzB,OACE,gBAAgB,KAChB,kBAAkB,KAClB,mBAAmB,KACnB,mBAAmB,EAEnB;SAEG;AACL,QAAK,kBAAkB;AACvB,QAAK,oBAAoB;AAEzB,QAAK,iBAAiB;AACtB,QAAK,qBAAqB;AAE1B,QAAK,qBAAqB;AAC1B,QAAK,iBAAiB;AAEtB,OAAI,mBAAmB,KAAK,mBAAmB,GAAG;IAChD,IAAIC,MAAI;AACR,WAAOA,MAAI,KAAK,YAAY,QAAQ;KAClC,MAAM,UAAU,KAAK,YAAYA;AACjC,UAAK,YAAYA,OAAK;MACpB,GAAG;MACH,mBAAmB,QAAQ,oBAAoB;MAC/C,mBAAmB,QAAQ,oBAAoB;MAChD;AACD;;;;;AAKR,QAAO"}
@@ -1,5 +1,5 @@
1
1
  //#region src/utils/formatCSSVariablePrefix.d.ts
2
- declare function formatCSSVariablePrefix(prefix?: string): string;
2
+ declare function formatCSSVariablePrefix(type: "global" | "token"): string;
3
3
  //#endregion
4
4
  export { formatCSSVariablePrefix };
5
5
  //# sourceMappingURL=formatCSSVariablePrefix.d.ts.map
@@ -1,6 +1,6 @@
1
1
  //#region src/utils/formatCSSVariablePrefix.ts
2
- function formatCSSVariablePrefix(prefix = "diffs") {
3
- return `--${prefix}-`;
2
+ function formatCSSVariablePrefix(type) {
3
+ return `--${type === "token" ? "diffs-token" : "diffs"}-`;
4
4
  }
5
5
 
6
6
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"formatCSSVariablePrefix.js","names":[],"sources":["../../src/utils/formatCSSVariablePrefix.ts"],"sourcesContent":["export function formatCSSVariablePrefix(prefix: string = 'diffs') {\n return `--${prefix}-`;\n}\n"],"mappings":";AAAA,SAAgB,wBAAwB,SAAiB,SAAS;AAChE,QAAO,KAAK,OAAO"}
1
+ {"version":3,"file":"formatCSSVariablePrefix.js","names":[],"sources":["../../src/utils/formatCSSVariablePrefix.ts"],"sourcesContent":["export function formatCSSVariablePrefix(type: 'global' | 'token') {\n return `--${type === 'token' ? 'diffs-token' : 'diffs'}-`;\n}\n"],"mappings":";AAAA,SAAgB,wBAAwB,MAA0B;AAChE,QAAO,KAAK,SAAS,UAAU,gBAAgB,QAAQ"}
@@ -8,30 +8,30 @@ function getHighlighterThemeStyles({ theme = DEFAULT_THEMES, highlighter, prefix
8
8
  const themeData = highlighter.getTheme(theme);
9
9
  styles += `color:${themeData.fg};`;
10
10
  styles += `background-color:${themeData.bg};`;
11
- styles += `${formatCSSVariablePrefix(prefix)}fg:${themeData.fg};`;
12
- styles += `${formatCSSVariablePrefix(prefix)}bg:${themeData.bg};`;
11
+ styles += `${formatCSSVariablePrefix("global")}fg:${themeData.fg};`;
12
+ styles += `${formatCSSVariablePrefix("global")}bg:${themeData.bg};`;
13
13
  styles += getThemeVariables(themeData, prefix);
14
14
  } else {
15
15
  let themeData = highlighter.getTheme(theme.dark);
16
- styles += `${formatCSSVariablePrefix(prefix)}dark:${themeData.fg};`;
17
- styles += `${formatCSSVariablePrefix(prefix)}dark-bg:${themeData.bg};`;
18
- styles += getThemeVariables(themeData, prefix, "dark");
16
+ styles += `${formatCSSVariablePrefix("global")}dark:${themeData.fg};`;
17
+ styles += `${formatCSSVariablePrefix("global")}dark-bg:${themeData.bg};`;
18
+ styles += getThemeVariables(themeData, "dark");
19
19
  themeData = highlighter.getTheme(theme.light);
20
- styles += `${formatCSSVariablePrefix(prefix)}light:${themeData.fg};`;
21
- styles += `${formatCSSVariablePrefix(prefix)}light-bg:${themeData.bg};`;
22
- styles += getThemeVariables(themeData, prefix, "light");
20
+ styles += `${formatCSSVariablePrefix("global")}light:${themeData.fg};`;
21
+ styles += `${formatCSSVariablePrefix("global")}light-bg:${themeData.bg};`;
22
+ styles += getThemeVariables(themeData, "light");
23
23
  }
24
24
  return styles;
25
25
  }
26
- function getThemeVariables(themeData, prefix, modePrefix) {
26
+ function getThemeVariables(themeData, modePrefix) {
27
27
  modePrefix = modePrefix != null ? `${modePrefix}-` : "";
28
28
  let styles = "";
29
29
  const additionGreen = themeData.colors?.["gitDecoration.addedResourceForeground"] ?? themeData.colors?.["terminal.ansiGreen"];
30
- if (additionGreen != null) styles += `${formatCSSVariablePrefix(prefix)}${modePrefix}addition-color:${additionGreen};`;
30
+ if (additionGreen != null) styles += `${formatCSSVariablePrefix("global")}${modePrefix}addition-color:${additionGreen};`;
31
31
  const deletionRed = themeData.colors?.["gitDecoration.deletedResourceForeground"] ?? themeData.colors?.["terminal.ansiRed"];
32
- if (deletionRed != null) styles += `${formatCSSVariablePrefix(prefix)}${modePrefix}deletion-color:${deletionRed};`;
32
+ if (deletionRed != null) styles += `${formatCSSVariablePrefix("global")}${modePrefix}deletion-color:${deletionRed};`;
33
33
  const modifiedBlue = themeData.colors?.["gitDecoration.modifiedResourceForeground"] ?? themeData.colors?.["terminal.ansiBlue"];
34
- if (modifiedBlue != null) styles += `${formatCSSVariablePrefix(prefix)}${modePrefix}modified-color:${modifiedBlue};`;
34
+ if (modifiedBlue != null) styles += `${formatCSSVariablePrefix("global")}${modePrefix}modified-color:${modifiedBlue};`;
35
35
  return styles;
36
36
  }
37
37
 
@@ -1 +1 @@
1
- {"version":3,"file":"getHighlighterThemeStyles.js","names":[],"sources":["../../src/utils/getHighlighterThemeStyles.ts"],"sourcesContent":["import { DEFAULT_THEMES } from '../constants';\nimport type {\n DiffsHighlighter,\n DiffsThemeNames,\n ThemeRegistrationResolved,\n ThemesType,\n} from '../types';\nimport { formatCSSVariablePrefix } from './formatCSSVariablePrefix';\n\ninterface GetHighlighterThemeStylesProps {\n theme?: DiffsThemeNames | ThemesType;\n highlighter: DiffsHighlighter;\n prefix?: string;\n}\n\n// FIXME(amadeus): We'll probably need to\n// re-think this when it comes to removing inline\n// styles\nexport function getHighlighterThemeStyles({\n theme = DEFAULT_THEMES,\n highlighter,\n prefix,\n}: GetHighlighterThemeStylesProps): string {\n let styles = '';\n if (typeof theme === 'string') {\n const themeData = highlighter.getTheme(theme);\n styles += `color:${themeData.fg};`;\n styles += `background-color:${themeData.bg};`;\n styles += `${formatCSSVariablePrefix(prefix)}fg:${themeData.fg};`;\n styles += `${formatCSSVariablePrefix(prefix)}bg:${themeData.bg};`;\n styles += getThemeVariables(themeData, prefix);\n } else {\n let themeData = highlighter.getTheme(theme.dark);\n styles += `${formatCSSVariablePrefix(prefix)}dark:${themeData.fg};`;\n styles += `${formatCSSVariablePrefix(prefix)}dark-bg:${themeData.bg};`;\n styles += getThemeVariables(themeData, prefix, 'dark');\n\n themeData = highlighter.getTheme(theme.light);\n styles += `${formatCSSVariablePrefix(prefix)}light:${themeData.fg};`;\n styles += `${formatCSSVariablePrefix(prefix)}light-bg:${themeData.bg};`;\n styles += getThemeVariables(themeData, prefix, 'light');\n }\n return styles;\n}\n\nfunction getThemeVariables(\n themeData: ThemeRegistrationResolved,\n prefix?: string,\n modePrefix?: string\n) {\n modePrefix = modePrefix != null ? `${modePrefix}-` : '';\n let styles = '';\n const additionGreen =\n themeData.colors?.['gitDecoration.addedResourceForeground'] ??\n themeData.colors?.['terminal.ansiGreen'];\n if (additionGreen != null) {\n styles += `${formatCSSVariablePrefix(prefix)}${modePrefix}addition-color:${additionGreen};`;\n }\n const deletionRed =\n themeData.colors?.['gitDecoration.deletedResourceForeground'] ??\n themeData.colors?.['terminal.ansiRed'];\n if (deletionRed != null) {\n styles += `${formatCSSVariablePrefix(prefix)}${modePrefix}deletion-color:${deletionRed};`;\n }\n const modifiedBlue =\n themeData.colors?.['gitDecoration.modifiedResourceForeground'] ??\n themeData.colors?.['terminal.ansiBlue'];\n if (modifiedBlue != null) {\n styles += `${formatCSSVariablePrefix(prefix)}${modePrefix}modified-color:${modifiedBlue};`;\n }\n return styles;\n}\n"],"mappings":";;;;AAkBA,SAAgB,0BAA0B,EACxC,QAAQ,gBACR,aACA,UACyC;CACzC,IAAI,SAAS;AACb,KAAI,OAAO,UAAU,UAAU;EAC7B,MAAM,YAAY,YAAY,SAAS,MAAM;AAC7C,YAAU,SAAS,UAAU,GAAG;AAChC,YAAU,oBAAoB,UAAU,GAAG;AAC3C,YAAU,GAAG,wBAAwB,OAAO,CAAC,KAAK,UAAU,GAAG;AAC/D,YAAU,GAAG,wBAAwB,OAAO,CAAC,KAAK,UAAU,GAAG;AAC/D,YAAU,kBAAkB,WAAW,OAAO;QACzC;EACL,IAAI,YAAY,YAAY,SAAS,MAAM,KAAK;AAChD,YAAU,GAAG,wBAAwB,OAAO,CAAC,OAAO,UAAU,GAAG;AACjE,YAAU,GAAG,wBAAwB,OAAO,CAAC,UAAU,UAAU,GAAG;AACpE,YAAU,kBAAkB,WAAW,QAAQ,OAAO;AAEtD,cAAY,YAAY,SAAS,MAAM,MAAM;AAC7C,YAAU,GAAG,wBAAwB,OAAO,CAAC,QAAQ,UAAU,GAAG;AAClE,YAAU,GAAG,wBAAwB,OAAO,CAAC,WAAW,UAAU,GAAG;AACrE,YAAU,kBAAkB,WAAW,QAAQ,QAAQ;;AAEzD,QAAO;;AAGT,SAAS,kBACP,WACA,QACA,YACA;AACA,cAAa,cAAc,OAAO,GAAG,WAAW,KAAK;CACrD,IAAI,SAAS;CACb,MAAM,gBACJ,UAAU,SAAS,4CACnB,UAAU,SAAS;AACrB,KAAI,iBAAiB,KACnB,WAAU,GAAG,wBAAwB,OAAO,GAAG,WAAW,iBAAiB,cAAc;CAE3F,MAAM,cACJ,UAAU,SAAS,8CACnB,UAAU,SAAS;AACrB,KAAI,eAAe,KACjB,WAAU,GAAG,wBAAwB,OAAO,GAAG,WAAW,iBAAiB,YAAY;CAEzF,MAAM,eACJ,UAAU,SAAS,+CACnB,UAAU,SAAS;AACrB,KAAI,gBAAgB,KAClB,WAAU,GAAG,wBAAwB,OAAO,GAAG,WAAW,iBAAiB,aAAa;AAE1F,QAAO"}
1
+ {"version":3,"file":"getHighlighterThemeStyles.js","names":[],"sources":["../../src/utils/getHighlighterThemeStyles.ts"],"sourcesContent":["import { DEFAULT_THEMES } from '../constants';\nimport type {\n DiffsHighlighter,\n DiffsThemeNames,\n ThemeRegistrationResolved,\n ThemesType,\n} from '../types';\nimport { formatCSSVariablePrefix } from './formatCSSVariablePrefix';\n\ninterface GetHighlighterThemeStylesProps {\n theme?: DiffsThemeNames | ThemesType;\n highlighter: DiffsHighlighter;\n prefix?: string;\n}\n\n// FIXME(amadeus): We'll probably need to\n// re-think this when it comes to removing inline\n// styles\nexport function getHighlighterThemeStyles({\n theme = DEFAULT_THEMES,\n highlighter,\n prefix,\n}: GetHighlighterThemeStylesProps): string {\n let styles = '';\n if (typeof theme === 'string') {\n const themeData = highlighter.getTheme(theme);\n styles += `color:${themeData.fg};`;\n styles += `background-color:${themeData.bg};`;\n styles += `${formatCSSVariablePrefix('global')}fg:${themeData.fg};`;\n styles += `${formatCSSVariablePrefix('global')}bg:${themeData.bg};`;\n styles += getThemeVariables(themeData, prefix);\n } else {\n let themeData = highlighter.getTheme(theme.dark);\n styles += `${formatCSSVariablePrefix('global')}dark:${themeData.fg};`;\n styles += `${formatCSSVariablePrefix('global')}dark-bg:${themeData.bg};`;\n styles += getThemeVariables(themeData, 'dark');\n\n themeData = highlighter.getTheme(theme.light);\n styles += `${formatCSSVariablePrefix('global')}light:${themeData.fg};`;\n styles += `${formatCSSVariablePrefix('global')}light-bg:${themeData.bg};`;\n styles += getThemeVariables(themeData, 'light');\n }\n return styles;\n}\n\nfunction getThemeVariables(\n themeData: ThemeRegistrationResolved,\n modePrefix?: string\n) {\n modePrefix = modePrefix != null ? `${modePrefix}-` : '';\n let styles = '';\n const additionGreen =\n themeData.colors?.['gitDecoration.addedResourceForeground'] ??\n themeData.colors?.['terminal.ansiGreen'];\n if (additionGreen != null) {\n styles += `${formatCSSVariablePrefix('global')}${modePrefix}addition-color:${additionGreen};`;\n }\n const deletionRed =\n themeData.colors?.['gitDecoration.deletedResourceForeground'] ??\n themeData.colors?.['terminal.ansiRed'];\n if (deletionRed != null) {\n styles += `${formatCSSVariablePrefix('global')}${modePrefix}deletion-color:${deletionRed};`;\n }\n const modifiedBlue =\n themeData.colors?.['gitDecoration.modifiedResourceForeground'] ??\n themeData.colors?.['terminal.ansiBlue'];\n if (modifiedBlue != null) {\n styles += `${formatCSSVariablePrefix('global')}${modePrefix}modified-color:${modifiedBlue};`;\n }\n return styles;\n}\n"],"mappings":";;;;AAkBA,SAAgB,0BAA0B,EACxC,QAAQ,gBACR,aACA,UACyC;CACzC,IAAI,SAAS;AACb,KAAI,OAAO,UAAU,UAAU;EAC7B,MAAM,YAAY,YAAY,SAAS,MAAM;AAC7C,YAAU,SAAS,UAAU,GAAG;AAChC,YAAU,oBAAoB,UAAU,GAAG;AAC3C,YAAU,GAAG,wBAAwB,SAAS,CAAC,KAAK,UAAU,GAAG;AACjE,YAAU,GAAG,wBAAwB,SAAS,CAAC,KAAK,UAAU,GAAG;AACjE,YAAU,kBAAkB,WAAW,OAAO;QACzC;EACL,IAAI,YAAY,YAAY,SAAS,MAAM,KAAK;AAChD,YAAU,GAAG,wBAAwB,SAAS,CAAC,OAAO,UAAU,GAAG;AACnE,YAAU,GAAG,wBAAwB,SAAS,CAAC,UAAU,UAAU,GAAG;AACtE,YAAU,kBAAkB,WAAW,OAAO;AAE9C,cAAY,YAAY,SAAS,MAAM,MAAM;AAC7C,YAAU,GAAG,wBAAwB,SAAS,CAAC,QAAQ,UAAU,GAAG;AACpE,YAAU,GAAG,wBAAwB,SAAS,CAAC,WAAW,UAAU,GAAG;AACvE,YAAU,kBAAkB,WAAW,QAAQ;;AAEjD,QAAO;;AAGT,SAAS,kBACP,WACA,YACA;AACA,cAAa,cAAc,OAAO,GAAG,WAAW,KAAK;CACrD,IAAI,SAAS;CACb,MAAM,gBACJ,UAAU,SAAS,4CACnB,UAAU,SAAS;AACrB,KAAI,iBAAiB,KACnB,WAAU,GAAG,wBAAwB,SAAS,GAAG,WAAW,iBAAiB,cAAc;CAE7F,MAAM,cACJ,UAAU,SAAS,8CACnB,UAAU,SAAS;AACrB,KAAI,eAAe,KACjB,WAAU,GAAG,wBAAwB,SAAS,GAAG,WAAW,iBAAiB,YAAY;CAE3F,MAAM,eACJ,UAAU,SAAS,+CACnB,UAAU,SAAS;AACrB,KAAI,gBAAgB,KAClB,WAAU,GAAG,wBAAwB,SAAS,GAAG,WAAW,iBAAiB,aAAa;AAE5F,QAAO"}
@@ -0,0 +1,14 @@
1
+ //#region src/utils/getOrCreateCodeNode.d.ts
2
+ interface CreateCodeNodeProps {
3
+ pre?: HTMLPreElement;
4
+ code?: HTMLElement;
5
+ columnType?: "additions" | "deletions" | "unified";
6
+ }
7
+ declare function getOrCreateCodeNode({
8
+ code,
9
+ pre,
10
+ columnType
11
+ }?: CreateCodeNodeProps): HTMLElement;
12
+ //#endregion
13
+ export { getOrCreateCodeNode };
14
+ //# sourceMappingURL=getOrCreateCodeNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getOrCreateCodeNode.d.ts","names":[],"sources":["../../src/utils/getOrCreateCodeNode.ts"],"sourcesContent":[],"mappings":";UAAU,mBAAA;KAAA,CAAA,EACF,cADE;EAMV,IAAgB,CAAA,EAJP,WAIO;EACd,UAAA,CAAA,EAAA,WAAA,GAAA,WAAA,GAAA,SAAA;;AAEA,iBAHc,mBAAA,CAGd;EAAA,IAAA;EAAA,GAAA;EAAA;AAAA,CAAA,CAAA,EACC,mBADD,CAAA,EAC4B,WAD5B"}
@@ -0,0 +1,13 @@
1
+ //#region src/utils/getOrCreateCodeNode.ts
2
+ function getOrCreateCodeNode({ code, pre, columnType } = {}) {
3
+ if (code != null) return code;
4
+ code = document.createElement("code");
5
+ code.dataset.code = "";
6
+ if (columnType != null) code.dataset[columnType] = "";
7
+ pre?.appendChild(code);
8
+ return code;
9
+ }
10
+
11
+ //#endregion
12
+ export { getOrCreateCodeNode };
13
+ //# sourceMappingURL=getOrCreateCodeNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getOrCreateCodeNode.js","names":[],"sources":["../../src/utils/getOrCreateCodeNode.ts"],"sourcesContent":["interface CreateCodeNodeProps {\n pre?: HTMLPreElement;\n code?: HTMLElement;\n columnType?: 'additions' | 'deletions' | 'unified';\n}\n\nexport function getOrCreateCodeNode({\n code,\n pre,\n columnType,\n}: CreateCodeNodeProps = {}): HTMLElement {\n if (code != null) {\n return code;\n }\n code = document.createElement('code');\n code.dataset.code = '';\n if (columnType != null) {\n code.dataset[columnType] = '';\n }\n pre?.appendChild(code);\n return code;\n}\n"],"mappings":";AAMA,SAAgB,oBAAoB,EAClC,MACA,KACA,eACuB,EAAE,EAAe;AACxC,KAAI,QAAQ,KACV,QAAO;AAET,QAAO,SAAS,cAAc,OAAO;AACrC,MAAK,QAAQ,OAAO;AACpB,KAAI,cAAc,KAChB,MAAK,QAAQ,cAAc;AAE7B,MAAK,YAAY,KAAK;AACtB,QAAO"}
@@ -1,6 +1,6 @@
1
1
  //#region src/utils/getTotalLineCountFromHunks.ts
2
2
  function getTotalLineCountFromHunks(hunks) {
3
- const lastHunk = hunks[hunks.length - 1];
3
+ const lastHunk = hunks.at(-1);
4
4
  if (lastHunk == null) return 0;
5
5
  return Math.max(lastHunk.additionStart + lastHunk.additionCount, lastHunk.deletionStart + lastHunk.deletionCount);
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getTotalLineCountFromHunks.js","names":[],"sources":["../../src/utils/getTotalLineCountFromHunks.ts"],"sourcesContent":["import type { Hunk } from '../types';\n\nexport function getTotalLineCountFromHunks(hunks: Hunk[]): number {\n const lastHunk = hunks[hunks.length - 1];\n if (lastHunk == null) {\n return 0;\n }\n return Math.max(\n lastHunk.additionStart + lastHunk.additionCount,\n lastHunk.deletionStart + lastHunk.deletionCount\n );\n}\n"],"mappings":";AAEA,SAAgB,2BAA2B,OAAuB;CAChE,MAAM,WAAW,MAAM,MAAM,SAAS;AACtC,KAAI,YAAY,KACd,QAAO;AAET,QAAO,KAAK,IACV,SAAS,gBAAgB,SAAS,eAClC,SAAS,gBAAgB,SAAS,cACnC"}
1
+ {"version":3,"file":"getTotalLineCountFromHunks.js","names":[],"sources":["../../src/utils/getTotalLineCountFromHunks.ts"],"sourcesContent":["import type { Hunk } from '../types';\n\nexport function getTotalLineCountFromHunks(hunks: Hunk[]): number {\n const lastHunk = hunks.at(-1);\n if (lastHunk == null) {\n return 0;\n }\n return Math.max(\n lastHunk.additionStart + lastHunk.additionCount,\n lastHunk.deletionStart + lastHunk.deletionCount\n );\n}\n"],"mappings":";AAEA,SAAgB,2BAA2B,OAAuB;CAChE,MAAM,WAAW,MAAM,GAAG,GAAG;AAC7B,KAAI,YAAY,KACd,QAAO;AAET,QAAO,KAAK,IACV,SAAS,gBAAgB,SAAS,eAClC,SAAS,gBAAgB,SAAS,cACnC"}
@@ -26,6 +26,7 @@ declare function createIconElement({
26
26
  properties
27
27
  }: CreateIconProps): Element;
28
28
  declare function findCodeElement(nodes: Root | Element): Element | undefined;
29
+ declare function createBufferElement(type: "before" | "after", height: number): Element;
29
30
  //#endregion
30
- export { createHastElement, createIconElement, createTextNodeElement, findCodeElement };
31
+ export { createBufferElement, createHastElement, createIconElement, createTextNodeElement, findCodeElement };
31
32
  //# sourceMappingURL=hast_utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hast_utils.d.ts","names":[],"sources":["../../src/utils/hast_utils.ts"],"sourcesContent":[],"mappings":";;;;iBAWgB,qBAAA,iBAAsC;UAI5C,sBAAA;EAJV,OAAgB,EAAA,MAAA,GAAA,KAAA,GAAA,MAAA,GAAA,KAAsC,GAAA,MAAA,GAAA,KAAA,GAAA,KAAA,GAAA,OAAA,GAAA,UAAA;EAAA,QAI5C,CAAA,EAWG,cAXH,EAAA;EAeV,UAAgB,CAAA,EAHD,UAGC;;AAEd,iBAFc,iBAAA,CAEd;EAAA,OAAA;EAAA,QAAA;EAAA;AAAA,CAAA,EAEC,sBAFD,CAAA,EAE0B,OAF1B;UAWQ,eAAA,CAVR;EACC,IAAA,EAUK,cAVL;EAAyB,KAAA,CAAA,EAAA,MAAA;EAAA,MAAA,CAAA,EAAA,MAAA;EAAA,UASlB,CAAA,EAIK,UAJL;AAOV;AACE,iBADc,iBAAA,CACd;EAAA,IAAA;EAAA,KAAA;EAAA,MAAA;EAAA;AAAA,CAAA,EAIC,eAJD,CAAA,EAImB,OAJnB;AACA,iBAgBc,eAAA,CAhBd,KAAA,EAiBO,IAjBP,GAiBc,OAjBd,CAAA,EAkBC,OAlBD,GAAA,SAAA"}
1
+ {"version":3,"file":"hast_utils.d.ts","names":[],"sources":["../../src/utils/hast_utils.ts"],"sourcesContent":[],"mappings":";;;;iBAWgB,qBAAA,iBAAsC;UAI5C,sBAAA;EAJV,OAAgB,EAAA,MAAA,GAAA,KAAA,GAAA,MAAA,GAAA,KAAsC,GAAA,MAAA,GAAA,KAAA,GAAA,KAAA,GAAA,OAAA,GAAA,UAAA;EAAA,QAI5C,CAAA,EAWG,cAXH,EAAA;EAeV,UAAgB,CAAA,EAHD,UAGC;;AAEd,iBAFc,iBAAA,CAEd;EAAA,OAAA;EAAA,QAAA;EAAA;AAAA,CAAA,EAEC,sBAFD,CAAA,EAE0B,OAF1B;UAWQ,eAAA,CAVR;EACC,IAAA,EAUK,cAVL;EAAyB,KAAA,CAAA,EAAA,MAAA;EAAA,MAAA,CAAA,EAAA,MAAA;EAAA,UASlB,CAAA,EAIK,UAJL;AAOV;AACE,iBADc,iBAAA,CACd;EAAA,IAAA;EAAA,KAAA;EAAA,MAAA;EAAA;AAAA,CAAA,EAIC,eAJD,CAAA,EAImB,OAJnB;AACA,iBAgBc,eAAA,CAhBd,KAAA,EAiBO,IAjBP,GAiBc,OAjBd,CAAA,EAkBC,OAlBD,GAAA,SAAA;AACA,iBAgCc,mBAAA,CAhCd,IAAA,EAAA,QAAA,GAAA,OAAA,EAAA,MAAA,EAAA,MAAA,CAAA,EAmCC,OAnCD"}
@@ -36,7 +36,16 @@ function findCodeElement(nodes) {
36
36
  else firstChild = null;
37
37
  }
38
38
  }
39
+ function createBufferElement(type, height) {
40
+ return createHastElement({
41
+ tagName: "div",
42
+ properties: {
43
+ "data-virtualized-buffer": type,
44
+ style: `height: ${height}px`
45
+ }
46
+ });
47
+ }
39
48
 
40
49
  //#endregion
41
- export { createHastElement, createIconElement, createTextNodeElement, findCodeElement };
50
+ export { createBufferElement, createHastElement, createIconElement, createTextNodeElement, findCodeElement };
42
51
  //# sourceMappingURL=hast_utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hast_utils.js","names":["firstChild: RootContent | HASTElement | Root | null"],"sources":["../../src/utils/hast_utils.ts"],"sourcesContent":["import type {\n ElementContent,\n Element as HASTElement,\n Properties,\n Root,\n RootContent,\n Text,\n} from 'hast';\n\nimport type { SVGSpriteNames } from '../sprite';\n\nexport function createTextNodeElement(value: string): Text {\n return { type: 'text', value };\n}\n\ninterface CreateHastElementProps {\n tagName:\n | 'span'\n | 'div'\n | 'code'\n | 'pre'\n | 'slot'\n | 'svg'\n | 'use'\n | 'style'\n | 'template';\n children?: ElementContent[];\n properties?: Properties;\n}\n\nexport function createHastElement({\n tagName,\n children = [],\n properties = {},\n}: CreateHastElementProps): HASTElement {\n return {\n type: 'element',\n tagName,\n properties,\n children,\n };\n}\n\ninterface CreateIconProps {\n name: SVGSpriteNames;\n width?: number;\n height?: number;\n properties?: Properties;\n}\n\nexport function createIconElement({\n name,\n width = 16,\n height = 16,\n properties,\n}: CreateIconProps): HASTElement {\n return createHastElement({\n tagName: 'svg',\n properties: { width, height, viewBox: '0 0 16 16', ...properties },\n children: [\n createHastElement({\n tagName: 'use',\n properties: { href: `#${name.replace(/^#/, '')}` },\n }),\n ],\n });\n}\n\nexport function findCodeElement(\n nodes: Root | HASTElement\n): HASTElement | undefined {\n let firstChild: RootContent | HASTElement | Root | null = nodes.children[0];\n while (firstChild != null) {\n if (firstChild.type === 'element' && firstChild.tagName === 'code') {\n return firstChild;\n }\n if ('children' in firstChild) {\n firstChild = firstChild.children[0];\n } else {\n firstChild = null;\n }\n }\n return undefined;\n}\n"],"mappings":";AAWA,SAAgB,sBAAsB,OAAqB;AACzD,QAAO;EAAE,MAAM;EAAQ;EAAO;;AAkBhC,SAAgB,kBAAkB,EAChC,SACA,WAAW,EAAE,EACb,aAAa,EAAE,IACuB;AACtC,QAAO;EACL,MAAM;EACN;EACA;EACA;EACD;;AAUH,SAAgB,kBAAkB,EAChC,MACA,QAAQ,IACR,SAAS,IACT,cAC+B;AAC/B,QAAO,kBAAkB;EACvB,SAAS;EACT,YAAY;GAAE;GAAO;GAAQ,SAAS;GAAa,GAAG;GAAY;EAClE,UAAU,CACR,kBAAkB;GAChB,SAAS;GACT,YAAY,EAAE,MAAM,IAAI,KAAK,QAAQ,MAAM,GAAG,IAAI;GACnD,CAAC,CACH;EACF,CAAC;;AAGJ,SAAgB,gBACd,OACyB;CACzB,IAAIA,aAAsD,MAAM,SAAS;AACzE,QAAO,cAAc,MAAM;AACzB,MAAI,WAAW,SAAS,aAAa,WAAW,YAAY,OAC1D,QAAO;AAET,MAAI,cAAc,WAChB,cAAa,WAAW,SAAS;MAEjC,cAAa"}
1
+ {"version":3,"file":"hast_utils.js","names":["firstChild: RootContent | HASTElement | Root | null"],"sources":["../../src/utils/hast_utils.ts"],"sourcesContent":["import type {\n ElementContent,\n Element as HASTElement,\n Properties,\n Root,\n RootContent,\n Text,\n} from 'hast';\n\nimport type { SVGSpriteNames } from '../sprite';\n\nexport function createTextNodeElement(value: string): Text {\n return { type: 'text', value };\n}\n\ninterface CreateHastElementProps {\n tagName:\n | 'span'\n | 'div'\n | 'code'\n | 'pre'\n | 'slot'\n | 'svg'\n | 'use'\n | 'style'\n | 'template';\n children?: ElementContent[];\n properties?: Properties;\n}\n\nexport function createHastElement({\n tagName,\n children = [],\n properties = {},\n}: CreateHastElementProps): HASTElement {\n return {\n type: 'element',\n tagName,\n properties,\n children,\n };\n}\n\ninterface CreateIconProps {\n name: SVGSpriteNames;\n width?: number;\n height?: number;\n properties?: Properties;\n}\n\nexport function createIconElement({\n name,\n width = 16,\n height = 16,\n properties,\n}: CreateIconProps): HASTElement {\n return createHastElement({\n tagName: 'svg',\n properties: { width, height, viewBox: '0 0 16 16', ...properties },\n children: [\n createHastElement({\n tagName: 'use',\n properties: { href: `#${name.replace(/^#/, '')}` },\n }),\n ],\n });\n}\n\nexport function findCodeElement(\n nodes: Root | HASTElement\n): HASTElement | undefined {\n let firstChild: RootContent | HASTElement | Root | null = nodes.children[0];\n while (firstChild != null) {\n if (firstChild.type === 'element' && firstChild.tagName === 'code') {\n return firstChild;\n }\n if ('children' in firstChild) {\n firstChild = firstChild.children[0];\n } else {\n firstChild = null;\n }\n }\n return undefined;\n}\n\nexport function createBufferElement(\n type: 'before' | 'after',\n height: number\n): HASTElement {\n return createHastElement({\n tagName: 'div',\n properties: {\n 'data-virtualized-buffer': type,\n style: `height: ${height}px`,\n },\n });\n}\n"],"mappings":";AAWA,SAAgB,sBAAsB,OAAqB;AACzD,QAAO;EAAE,MAAM;EAAQ;EAAO;;AAkBhC,SAAgB,kBAAkB,EAChC,SACA,WAAW,EAAE,EACb,aAAa,EAAE,IACuB;AACtC,QAAO;EACL,MAAM;EACN;EACA;EACA;EACD;;AAUH,SAAgB,kBAAkB,EAChC,MACA,QAAQ,IACR,SAAS,IACT,cAC+B;AAC/B,QAAO,kBAAkB;EACvB,SAAS;EACT,YAAY;GAAE;GAAO;GAAQ,SAAS;GAAa,GAAG;GAAY;EAClE,UAAU,CACR,kBAAkB;GAChB,SAAS;GACT,YAAY,EAAE,MAAM,IAAI,KAAK,QAAQ,MAAM,GAAG,IAAI;GACnD,CAAC,CACH;EACF,CAAC;;AAGJ,SAAgB,gBACd,OACyB;CACzB,IAAIA,aAAsD,MAAM,SAAS;AACzE,QAAO,cAAc,MAAM;AACzB,MAAI,WAAW,SAAS,aAAa,WAAW,YAAY,OAC1D,QAAO;AAET,MAAI,cAAc,WAChB,cAAa,WAAW,SAAS;MAEjC,cAAa;;;AAMnB,SAAgB,oBACd,MACA,QACa;AACb,QAAO,kBAAkB;EACvB,SAAS;EACT,YAAY;GACV,2BAA2B;GAC3B,OAAO,WAAW,OAAO;GAC1B;EACF,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { RenderRange } from "../types.js";
2
+
3
+ //#region src/utils/isDefaultRenderRange.d.ts
4
+ declare function isDefaultRenderRange(renderRange: RenderRange): boolean;
5
+ //#endregion
6
+ export { isDefaultRenderRange };
7
+ //# sourceMappingURL=isDefaultRenderRange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isDefaultRenderRange.d.ts","names":[],"sources":["../../src/utils/isDefaultRenderRange.ts"],"sourcesContent":[],"mappings":";;;iBAEgB,oBAAA,cAAkC"}
@@ -0,0 +1,8 @@
1
+ //#region src/utils/isDefaultRenderRange.ts
2
+ function isDefaultRenderRange(renderRange) {
3
+ return renderRange.startingLine === 0 && renderRange.totalLines === Infinity && renderRange.bufferBefore === 0 && renderRange.bufferAfter === 0;
4
+ }
5
+
6
+ //#endregion
7
+ export { isDefaultRenderRange };
8
+ //# sourceMappingURL=isDefaultRenderRange.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isDefaultRenderRange.js","names":[],"sources":["../../src/utils/isDefaultRenderRange.ts"],"sourcesContent":["import type { RenderRange } from '../types';\n\nexport function isDefaultRenderRange(renderRange: RenderRange): boolean {\n return (\n renderRange.startingLine === 0 &&\n renderRange.totalLines === Infinity &&\n renderRange.bufferBefore === 0 &&\n renderRange.bufferAfter === 0\n );\n}\n"],"mappings":";AAEA,SAAgB,qBAAqB,aAAmC;AACtE,QACE,YAAY,iBAAiB,KAC7B,YAAY,eAAe,YAC3B,YAAY,iBAAiB,KAC7B,YAAY,gBAAgB"}
@@ -0,0 +1,39 @@
1
+ import { FileDiffMetadata, Hunk, HunkExpansionRegion } from "../types.js";
2
+
3
+ //#region src/utils/iterateOverDiff.d.ts
4
+ interface DiffLineCallbackProps {
5
+ hunkIndex: number;
6
+ hunk: Hunk | undefined;
7
+ collapsedBefore: number;
8
+ collapsedAfter: number;
9
+ unifiedDeletionLineIndex: number | undefined;
10
+ unifiedAdditionLineIndex: number | undefined;
11
+ splitLineIndex: number;
12
+ additionLineIndex: number | undefined;
13
+ deletionLineIndex: number | undefined;
14
+ additionLineNumber: number | undefined;
15
+ deletionLineNumber: number | undefined;
16
+ type: "context" | "context-expanded" | "change";
17
+ noEOFCRAddition: boolean;
18
+ noEOFCRDeletion: boolean;
19
+ }
20
+ type DiffLineCallback = (props: DiffLineCallbackProps) => boolean | void;
21
+ interface IterateOverDiffProps {
22
+ diff: FileDiffMetadata;
23
+ diffStyle: "unified" | "split" | "both";
24
+ startingLine?: number;
25
+ totalLines?: number;
26
+ expandedHunks?: Map<number, HunkExpansionRegion> | true;
27
+ callback: DiffLineCallback;
28
+ }
29
+ declare function iterateOverDiff({
30
+ diff,
31
+ diffStyle,
32
+ startingLine,
33
+ totalLines,
34
+ expandedHunks,
35
+ callback
36
+ }: IterateOverDiffProps): void;
37
+ //#endregion
38
+ export { DiffLineCallback, DiffLineCallbackProps, IterateOverDiffProps, iterateOverDiff };
39
+ //# sourceMappingURL=iterateOverDiff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iterateOverDiff.d.ts","names":[],"sources":["../../src/utils/iterateOverDiff.ts"],"sourcesContent":[],"mappings":";;;UAOiB,qBAAA;;EAAjB,IAAiB,EAET,IAFS,GAAA,SAAA;EAkCjB,eAAY,EAAA,MAAA;EAEZ,cAAiB,EAAA,MAAA;EACT,wBAAA,EAAA,MAAA,GAAA,SAAA;EAIsB,wBAAA,EAAA,MAAA,GAAA,SAAA;EAAZ,cAAA,EAAA,MAAA;EACN,iBAAA,EAAA,MAAA,GAAA,SAAA;EAAA,iBAAA,EAAA,MAAA,GAAA,SAAA;EAGZ,kBAAgB,EAAA,MAAA,GAAA,SAAA;EACd,kBAAA,EAAA,MAAA,GAAA,SAAA;EACA,IAAA,EAAA,SAAA,GAAA,kBAAA,GAAA,QAAA;EACA,eAAA,EAAA,OAAA;EACA,eAAA,EAAA,OAAA;;AAEA,KAjBU,gBAAA,GAiBV,CAAA,KAAA,EAjBqC,qBAiBrC,EAAA,GAAA,OAAA,GAAA,IAAA;AACC,UAhBc,oBAAA,CAgBd;EAAA,IAAA,EAfK,gBAeL;;;;kBAXe,YAAY;YAClB;;iBAGI,eAAA;;;;;;;GAOb"}