@pierre/diffs 1.3.0-beta.3 → 1.3.0-beta.5

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 (161) hide show
  1. package/README.md +6 -6
  2. package/dist/components/CodeView.js +6 -6
  3. package/dist/components/CodeView.js.map +1 -1
  4. package/dist/components/File.d.ts +3 -2
  5. package/dist/components/File.d.ts.map +1 -1
  6. package/dist/components/File.js +35 -21
  7. package/dist/components/File.js.map +1 -1
  8. package/dist/components/FileDiff.d.ts +8 -4
  9. package/dist/components/FileDiff.d.ts.map +1 -1
  10. package/dist/components/FileDiff.js +66 -56
  11. package/dist/components/FileDiff.js.map +1 -1
  12. package/dist/components/FileStream.js +4 -2
  13. package/dist/components/FileStream.js.map +1 -1
  14. package/dist/components/UnresolvedFile.js +1 -1
  15. package/dist/components/VirtualizedFile.d.ts +6 -2
  16. package/dist/components/VirtualizedFile.d.ts.map +1 -1
  17. package/dist/components/VirtualizedFile.js +89 -24
  18. package/dist/components/VirtualizedFile.js.map +1 -1
  19. package/dist/components/VirtualizedFileDiff.d.ts +8 -2
  20. package/dist/components/VirtualizedFileDiff.d.ts.map +1 -1
  21. package/dist/components/VirtualizedFileDiff.js +91 -15
  22. package/dist/components/VirtualizedFileDiff.js.map +1 -1
  23. package/dist/editor/command.d.ts +1 -1
  24. package/dist/editor/command.d.ts.map +1 -1
  25. package/dist/editor/command.js +3 -3
  26. package/dist/editor/command.js.map +1 -1
  27. package/dist/editor/editStack.d.ts +1 -1
  28. package/dist/editor/editor.d.ts +37 -9
  29. package/dist/editor/editor.d.ts.map +1 -1
  30. package/dist/editor/editor.js +558 -449
  31. package/dist/editor/editor.js.map +1 -1
  32. package/dist/editor/editor2.js +1 -1
  33. package/dist/editor/editor2.js.map +1 -1
  34. package/dist/editor/index.d.ts +2 -2
  35. package/dist/editor/lineAnnotations.d.ts +2 -1
  36. package/dist/editor/lineAnnotations.d.ts.map +1 -1
  37. package/dist/editor/lineAnnotations.js +111 -1
  38. package/dist/editor/lineAnnotations.js.map +1 -1
  39. package/dist/editor/marker.d.ts +33 -0
  40. package/dist/editor/marker.d.ts.map +1 -0
  41. package/dist/editor/marker.js +185 -0
  42. package/dist/editor/marker.js.map +1 -0
  43. package/dist/editor/pieceTable.d.ts +8 -3
  44. package/dist/editor/pieceTable.d.ts.map +1 -1
  45. package/dist/editor/pieceTable.js +74 -12
  46. package/dist/editor/pieceTable.js.map +1 -1
  47. package/dist/editor/searchPanel.d.ts +12 -3
  48. package/dist/editor/searchPanel.d.ts.map +1 -1
  49. package/dist/editor/searchPanel.js +168 -54
  50. package/dist/editor/searchPanel.js.map +1 -1
  51. package/dist/editor/selection.d.ts +19 -3
  52. package/dist/editor/selection.d.ts.map +1 -1
  53. package/dist/editor/selection.js +188 -37
  54. package/dist/editor/selection.js.map +1 -1
  55. package/dist/editor/{quickEdit.d.ts → selectionAction.d.ts} +8 -8
  56. package/dist/editor/selectionAction.d.ts.map +1 -0
  57. package/dist/editor/{quickEdit.js → selectionAction.js} +18 -18
  58. package/dist/editor/selectionAction.js.map +1 -0
  59. package/dist/editor/sprite.d.ts +4 -3
  60. package/dist/editor/sprite.d.ts.map +1 -1
  61. package/dist/editor/sprite.js +19 -5
  62. package/dist/editor/sprite.js.map +1 -1
  63. package/dist/editor/textDocument.d.ts +4 -4
  64. package/dist/editor/textDocument.d.ts.map +1 -1
  65. package/dist/editor/textDocument.js +7 -7
  66. package/dist/editor/textDocument.js.map +1 -1
  67. package/dist/editor/textMeasure.d.ts +1 -0
  68. package/dist/editor/textMeasure.d.ts.map +1 -1
  69. package/dist/editor/textMeasure.js +6 -0
  70. package/dist/editor/textMeasure.js.map +1 -1
  71. package/dist/editor/tokenzier.js +20 -9
  72. package/dist/editor/tokenzier.js.map +1 -1
  73. package/dist/editor/utils.d.ts +3 -1
  74. package/dist/editor/utils.d.ts.map +1 -1
  75. package/dist/editor/utils.js +16 -1
  76. package/dist/editor/utils.js.map +1 -1
  77. package/dist/highlighter/shared_highlighter.js +3 -29
  78. package/dist/highlighter/shared_highlighter.js.map +1 -1
  79. package/dist/highlighter/themes/attachResolvedThemes.js +4 -3
  80. package/dist/highlighter/themes/attachResolvedThemes.js.map +1 -1
  81. package/dist/highlighter/themes/cleanUpResolvedThemes.js +3 -2
  82. package/dist/highlighter/themes/cleanUpResolvedThemes.js.map +1 -1
  83. package/dist/highlighter/themes/constants.d.ts +1 -7
  84. package/dist/highlighter/themes/constants.d.ts.map +1 -1
  85. package/dist/highlighter/themes/constants.js +1 -4
  86. package/dist/highlighter/themes/constants.js.map +1 -1
  87. package/dist/highlighter/themes/getResolvedOrResolveTheme.js +2 -2
  88. package/dist/highlighter/themes/getResolvedOrResolveTheme.js.map +1 -1
  89. package/dist/highlighter/themes/getResolvedThemes.js +2 -8
  90. package/dist/highlighter/themes/getResolvedThemes.js.map +1 -1
  91. package/dist/highlighter/themes/hasResolvedThemes.js +2 -3
  92. package/dist/highlighter/themes/hasResolvedThemes.js.map +1 -1
  93. package/dist/highlighter/themes/registerCustomCSSVariableTheme.js +1 -1
  94. package/dist/highlighter/themes/registerCustomTheme.d.ts +5 -3
  95. package/dist/highlighter/themes/registerCustomTheme.d.ts.map +1 -1
  96. package/dist/highlighter/themes/registerCustomTheme.js +15 -5
  97. package/dist/highlighter/themes/registerCustomTheme.js.map +1 -1
  98. package/dist/highlighter/themes/resolveTheme.js +6 -27
  99. package/dist/highlighter/themes/resolveTheme.js.map +1 -1
  100. package/dist/highlighter/themes/resolveThemes.js +5 -12
  101. package/dist/highlighter/themes/resolveThemes.js.map +1 -1
  102. package/dist/highlighter/themes/themeResolution.d.ts +8 -0
  103. package/dist/highlighter/themes/themeResolution.d.ts.map +1 -0
  104. package/dist/highlighter/themes/themeResolution.js +22 -0
  105. package/dist/highlighter/themes/themeResolution.js.map +1 -0
  106. package/dist/highlighter/themes/themeResolver.d.ts +8 -0
  107. package/dist/highlighter/themes/themeResolver.d.ts.map +1 -0
  108. package/dist/highlighter/themes/themeResolver.js +8 -0
  109. package/dist/highlighter/themes/themeResolver.js.map +1 -0
  110. package/dist/index.d.ts +4 -4
  111. package/dist/index.js +3 -3
  112. package/dist/managers/InteractionManager.js +1 -1
  113. package/dist/managers/InteractionManager.js.map +1 -1
  114. package/dist/managers/ResizeManager.js +1 -1
  115. package/dist/managers/ResizeManager.js.map +1 -1
  116. package/dist/react/CodeView.js +1 -1
  117. package/dist/react/index.d.ts +2 -2
  118. package/dist/react/utils/useFileDiffInstance.js +1 -0
  119. package/dist/react/utils/useFileDiffInstance.js.map +1 -1
  120. package/dist/renderers/DiffHunksRenderer.d.ts +6 -2
  121. package/dist/renderers/DiffHunksRenderer.d.ts.map +1 -1
  122. package/dist/renderers/DiffHunksRenderer.js +183 -12
  123. package/dist/renderers/DiffHunksRenderer.js.map +1 -1
  124. package/dist/renderers/FileRenderer.d.ts +2 -2
  125. package/dist/renderers/FileRenderer.d.ts.map +1 -1
  126. package/dist/renderers/FileRenderer.js +17 -5
  127. package/dist/renderers/FileRenderer.js.map +1 -1
  128. package/dist/ssr/FileDiffReact.js +1 -1
  129. package/dist/ssr/index.d.ts +2 -2
  130. package/dist/types.d.ts +25 -8
  131. package/dist/types.d.ts.map +1 -1
  132. package/dist/utils/getHighlighterThemeStyles.js +16 -12
  133. package/dist/utils/getHighlighterThemeStyles.js.map +1 -1
  134. package/dist/utils/includesFileAnnotations.d.ts +17 -0
  135. package/dist/utils/includesFileAnnotations.d.ts.map +1 -0
  136. package/dist/utils/includesFileAnnotations.js +19 -0
  137. package/dist/utils/includesFileAnnotations.js.map +1 -0
  138. package/dist/utils/parseMergeConflictDiffFromFile.js.map +1 -1
  139. package/dist/utils/parsePatchFiles.js +93 -4
  140. package/dist/utils/parsePatchFiles.js.map +1 -1
  141. package/dist/utils/renderDiffWithHighlighter.js +4 -2
  142. package/dist/utils/renderDiffWithHighlighter.js.map +1 -1
  143. package/dist/utils/renderFileWithHighlighter.js +4 -2
  144. package/dist/utils/renderFileWithHighlighter.js.map +1 -1
  145. package/dist/utils/updateDiffHunks.d.ts +13 -0
  146. package/dist/utils/updateDiffHunks.d.ts.map +1 -0
  147. package/dist/utils/updateDiffHunks.js +171 -0
  148. package/dist/utils/updateDiffHunks.js.map +1 -0
  149. package/dist/utils/virtualDiffLayout.d.ts +2 -1
  150. package/dist/utils/virtualDiffLayout.d.ts.map +1 -1
  151. package/dist/utils/virtualDiffLayout.js +9 -1
  152. package/dist/utils/virtualDiffLayout.js.map +1 -1
  153. package/dist/worker/{wasm-BaDzIkIn.js → wasm-qE0LgnY3.js} +2 -2
  154. package/dist/worker/{wasm-BaDzIkIn.js.map → wasm-qE0LgnY3.js.map} +1 -1
  155. package/dist/worker/worker-portable.js +1016 -275
  156. package/dist/worker/worker-portable.js.map +1 -1
  157. package/dist/worker/worker.js +31 -19
  158. package/dist/worker/worker.js.map +1 -1
  159. package/package.json +5 -10
  160. package/dist/editor/quickEdit.d.ts.map +0 -1
  161. package/dist/editor/quickEdit.js.map +0 -1
@@ -1,14 +1,8 @@
1
- import { ResolvedThemes } from "./constants.js";
1
+ import { themeResolver } from "./themeResolver.js";
2
2
 
3
3
  //#region src/highlighter/themes/getResolvedThemes.ts
4
4
  function getResolvedThemes(themeNames) {
5
- const resolvedThemes = [];
6
- for (const themeName of themeNames) {
7
- const theme = ResolvedThemes.get(themeName);
8
- if (theme == null) throw new Error(`getAllResolvedThemes: ${themeName} is unresolved, you must resolve all necessary themes before calling this function`);
9
- resolvedThemes.push(theme);
10
- }
11
- return resolvedThemes;
5
+ return themeResolver.getResolvedThemes(themeNames);
12
6
  }
13
7
 
14
8
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"getResolvedThemes.js","names":["resolvedThemes: ThemeRegistrationResolved[]"],"sources":["../../../src/highlighter/themes/getResolvedThemes.ts"],"sourcesContent":["import type { DiffsThemeNames, ThemeRegistrationResolved } from '../../types';\nimport { ResolvedThemes } from './constants';\n\n// This method should only be called if you know all themes are resolved,\n// otherwise it will fail. The main intention is a helper to avoid an async\n// tick if we don't actually need it\nexport function getResolvedThemes(\n themeNames: DiffsThemeNames[]\n): ThemeRegistrationResolved[] {\n const resolvedThemes: ThemeRegistrationResolved[] = [];\n for (const themeName of themeNames) {\n const theme = ResolvedThemes.get(themeName);\n if (theme == null) {\n throw new Error(\n `getAllResolvedThemes: ${themeName} is unresolved, you must resolve all necessary themes before calling this function`\n );\n }\n resolvedThemes.push(theme);\n }\n return resolvedThemes;\n}\n"],"mappings":";;;AAMA,SAAgB,kBACd,YAC6B;CAC7B,MAAMA,iBAA8C,EAAE;AACtD,MAAK,MAAM,aAAa,YAAY;EAClC,MAAM,QAAQ,eAAe,IAAI,UAAU;AAC3C,MAAI,SAAS,KACX,OAAM,IAAI,MACR,yBAAyB,UAAU,oFACpC;AAEH,iBAAe,KAAK,MAAM;;AAE5B,QAAO"}
1
+ {"version":3,"file":"getResolvedThemes.js","names":[],"sources":["../../../src/highlighter/themes/getResolvedThemes.ts"],"sourcesContent":["import type { DiffsThemeNames, ThemeRegistrationResolved } from '../../types';\nimport { themeResolver } from './themeResolver';\n\n// This method should only be called if you know all themes are resolved,\n// otherwise it will fail. The main intention is a helper to avoid an async\n// tick if we don't actually need it\nexport function getResolvedThemes(\n themeNames: DiffsThemeNames[]\n): ThemeRegistrationResolved[] {\n return themeResolver.getResolvedThemes(themeNames);\n}\n"],"mappings":";;;AAMA,SAAgB,kBACd,YAC6B;AAC7B,QAAO,cAAc,kBAAkB,WAAW"}
@@ -1,9 +1,8 @@
1
- import { ResolvedThemes } from "./constants.js";
1
+ import { themeResolver } from "./themeResolver.js";
2
2
 
3
3
  //#region src/highlighter/themes/hasResolvedThemes.ts
4
4
  function hasResolvedThemes(themeNames) {
5
- for (const themeName of themeNames) if (!ResolvedThemes.has(themeName)) return false;
6
- return true;
5
+ return themeResolver.hasResolvedThemes(themeNames);
7
6
  }
8
7
 
9
8
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"hasResolvedThemes.js","names":[],"sources":["../../../src/highlighter/themes/hasResolvedThemes.ts"],"sourcesContent":["import type { DiffsThemeNames } from '../../types';\nimport { ResolvedThemes } from './constants';\n\nexport function hasResolvedThemes(themeNames: DiffsThemeNames[]): boolean {\n for (const themeName of themeNames) {\n if (!ResolvedThemes.has(themeName)) {\n return false;\n }\n }\n return true;\n}\n"],"mappings":";;;AAGA,SAAgB,kBAAkB,YAAwC;AACxE,MAAK,MAAM,aAAa,WACtB,KAAI,CAAC,eAAe,IAAI,UAAU,CAChC,QAAO;AAGX,QAAO"}
1
+ {"version":3,"file":"hasResolvedThemes.js","names":[],"sources":["../../../src/highlighter/themes/hasResolvedThemes.ts"],"sourcesContent":["import type { DiffsThemeNames } from '../../types';\nimport { themeResolver } from './themeResolver';\n\nexport function hasResolvedThemes(themeNames: DiffsThemeNames[]): boolean {\n return themeResolver.hasResolvedThemes(themeNames);\n}\n"],"mappings":";;;AAGA,SAAgB,kBAAkB,YAAwC;AACxE,QAAO,cAAc,kBAAkB,WAAW"}
@@ -1,5 +1,5 @@
1
- import { registerCustomTheme } from "./registerCustomTheme.js";
2
1
  import { formatCSSVariablePrefix } from "../../utils/formatCSSVariablePrefix.js";
2
+ import { registerCustomTheme } from "./registerCustomTheme.js";
3
3
  import { createCssVariablesTheme } from "shiki";
4
4
 
5
5
  //#region src/highlighter/themes/registerCustomCSSVariableTheme.ts
@@ -1,7 +1,9 @@
1
- import { ThemeRegistration, ThemeRegistrationResolved } from "shiki";
1
+ import { ThemeRegistration, ThemeRegistrationResolved } from "../../types.js";
2
+ import { ThemeLoader } from "@pierre/theming";
2
3
 
3
4
  //#region src/highlighter/themes/registerCustomTheme.d.ts
4
- declare function registerCustomTheme(themeName: string, loader: () => Promise<ThemeRegistrationResolved | ThemeRegistration>): void;
5
+ type CustomThemeLoader = ThemeLoader<ThemeRegistration | ThemeRegistrationResolved>;
6
+ declare function registerCustomTheme(themeName: string, loader: CustomThemeLoader): void;
5
7
  //#endregion
6
- export { registerCustomTheme };
8
+ export { CustomThemeLoader, registerCustomTheme };
7
9
  //# sourceMappingURL=registerCustomTheme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"registerCustomTheme.d.ts","names":["ThemeRegistration","ThemeRegistrationResolved","registerCustomTheme","Promise"],"sources":["../../../src/highlighter/themes/registerCustomTheme.d.ts"],"sourcesContent":["import type { ThemeRegistration, ThemeRegistrationResolved } from 'shiki';\nexport declare function registerCustomTheme(themeName: string, loader: () => Promise<ThemeRegistrationResolved | ThemeRegistration>): void;\n//# sourceMappingURL=registerCustomTheme.d.ts.map"],"mappings":";;;iBACwBE,mBAAAA,kCAAqDC,QAAQF,4BAA4BD"}
1
+ {"version":3,"file":"registerCustomTheme.d.ts","names":["ThemeLoader","ThemeRegistration","ThemeRegistrationResolved","CustomThemeLoader","registerCustomTheme"],"sources":["../../../src/highlighter/themes/registerCustomTheme.d.ts"],"sourcesContent":["import { type ThemeLoader } from '@pierre/theming';\nimport type { ThemeRegistration, ThemeRegistrationResolved } from '../../types';\nexport type CustomThemeLoader = ThemeLoader<ThemeRegistration | ThemeRegistrationResolved>;\nexport declare function registerCustomTheme(themeName: string, loader: CustomThemeLoader): void;\n//# sourceMappingURL=registerCustomTheme.d.ts.map"],"mappings":";;;;KAEYG,iBAAAA,GAAoBH,YAAYC,oBAAoBC;iBACxCE,mBAAAA,4BAA+CD"}
@@ -1,12 +1,22 @@
1
- import { RegisteredCustomThemes } from "./constants.js";
1
+ import { themeResolver } from "./themeResolver.js";
2
+ import { createTheme } from "@pierre/theming/themes";
3
+ import { DuplicateThemeError } from "@pierre/theming";
2
4
 
3
5
  //#region src/highlighter/themes/registerCustomTheme.ts
4
6
  function registerCustomTheme(themeName, loader) {
5
- if (RegisteredCustomThemes.has(themeName)) {
6
- console.error("SharedHighlight.registerCustomTheme: theme name already registered", themeName);
7
- return;
7
+ try {
8
+ const descriptor = createTheme({
9
+ name: themeName,
10
+ load: loader
11
+ });
12
+ themeResolver.registerTheme(descriptor.name, descriptor.load);
13
+ } catch (error) {
14
+ if (error instanceof DuplicateThemeError) {
15
+ console.error("SharedHighlight.registerCustomTheme: theme name already registered", themeName);
16
+ return;
17
+ }
18
+ throw error;
8
19
  }
9
- RegisteredCustomThemes.set(themeName, loader);
10
20
  }
11
21
 
12
22
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"registerCustomTheme.js","names":[],"sources":["../../../src/highlighter/themes/registerCustomTheme.ts"],"sourcesContent":["import type { ThemeRegistration, ThemeRegistrationResolved } from 'shiki';\n\nimport { RegisteredCustomThemes } from './constants';\n\nexport function registerCustomTheme(\n themeName: string,\n loader: () => Promise<ThemeRegistrationResolved | ThemeRegistration>\n): void {\n if (RegisteredCustomThemes.has(themeName)) {\n console.error(\n 'SharedHighlight.registerCustomTheme: theme name already registered',\n themeName\n );\n return;\n }\n RegisteredCustomThemes.set(themeName, loader);\n}\n"],"mappings":";;;AAIA,SAAgB,oBACd,WACA,QACM;AACN,KAAI,uBAAuB,IAAI,UAAU,EAAE;AACzC,UAAQ,MACN,sEACA,UACD;AACD;;AAEF,wBAAuB,IAAI,WAAW,OAAO"}
1
+ {"version":3,"file":"registerCustomTheme.js","names":[],"sources":["../../../src/highlighter/themes/registerCustomTheme.ts"],"sourcesContent":["import { DuplicateThemeError, type ThemeLoader } from '@pierre/theming';\nimport { createTheme } from '@pierre/theming/themes';\n\nimport type { ThemeRegistration, ThemeRegistrationResolved } from '../../types';\nimport { themeResolver } from './themeResolver';\n\nexport type CustomThemeLoader = ThemeLoader<\n ThemeRegistration | ThemeRegistrationResolved\n>;\n\n// Registers a named custom theme loader on the diffs resolver. The loader is\n// wrapped by createTheme so its result is run through Shiki's\n// normalizeTheme before caching — this preserves the legacy behavior where\n// every resolved theme (custom, Pierre, or Shiki-provided) was normalized, so\n// its fg/bg are derived from the colors map. Re-registering an existing name is\n// a no-op that logs, matching the previous contract (the generic resolver throws\n// DuplicateThemeError, which we translate back into the log-and-return shape).\nexport function registerCustomTheme(\n themeName: string,\n loader: CustomThemeLoader\n): void {\n try {\n const descriptor = createTheme<ThemeRegistrationResolved>({\n name: themeName,\n load: loader,\n });\n themeResolver.registerTheme(descriptor.name, descriptor.load);\n } catch (error) {\n if (error instanceof DuplicateThemeError) {\n console.error(\n 'SharedHighlight.registerCustomTheme: theme name already registered',\n themeName\n );\n return;\n }\n throw error;\n }\n}\n"],"mappings":";;;;;AAiBA,SAAgB,oBACd,WACA,QACM;AACN,KAAI;EACF,MAAM,aAAa,YAAuC;GACxD,MAAM;GACN,MAAM;GACP,CAAC;AACF,gBAAc,cAAc,WAAW,MAAM,WAAW,KAAK;UACtD,OAAO;AACd,MAAI,iBAAiB,qBAAqB;AACxC,WAAQ,MACN,sEACA,UACD;AACD;;AAEF,QAAM"}
@@ -1,33 +1,12 @@
1
- import { isWorkerContext } from "../../utils/isWorkerContext.js";
2
- import { RegisteredCustomThemes, ResolvedThemes, ResolvingThemes } from "./constants.js";
3
- import { bundledThemes, normalizeTheme } from "shiki";
1
+ import { themeResolver } from "./themeResolver.js";
2
+ import { prepareThemeResolution, validateResolvedThemeName } from "./themeResolution.js";
4
3
 
5
4
  //#region src/highlighter/themes/resolveTheme.ts
6
5
  async function resolveTheme(themeName) {
7
- if (isWorkerContext()) throw new Error(`resolveTheme("${themeName}") cannot be called from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);
8
- const resolver = ResolvingThemes.get(themeName);
9
- if (resolver != null) return resolver;
10
- try {
11
- const loader = RegisteredCustomThemes.get(themeName) ?? bundledThemes[themeName];
12
- if (loader == null) throw new Error(`resolveTheme: No valid loader for ${themeName}`);
13
- const resolver$1 = loader().then((result) => {
14
- return normalizeAndCacheResolvedTheme(themeName, "default" in result ? result.default : result);
15
- });
16
- ResolvingThemes.set(themeName, resolver$1);
17
- const theme = await resolver$1;
18
- if (theme.name !== themeName) throw new Error(`resolvedTheme: themeName: ${themeName} does not match theme.name: ${theme.name}`);
19
- ResolvedThemes.set(theme.name, theme);
20
- return theme;
21
- } finally {
22
- ResolvingThemes.delete(themeName);
23
- }
24
- }
25
- function normalizeAndCacheResolvedTheme(themeName, themeData) {
26
- const resolvedTheme = ResolvedThemes.get(themeName);
27
- if (resolvedTheme != null) return resolvedTheme;
28
- themeData = normalizeTheme(themeData);
29
- ResolvedThemes.set(themeName, themeData);
30
- return themeData;
6
+ prepareThemeResolution(themeName);
7
+ const theme = await themeResolver.resolveTheme(themeName);
8
+ validateResolvedThemeName(themeName, theme);
9
+ return theme;
31
10
  }
32
11
 
33
12
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"resolveTheme.js","names":["resolver"],"sources":["../../../src/highlighter/themes/resolveTheme.ts"],"sourcesContent":["import { bundledThemes, normalizeTheme } from 'shiki';\n\nimport type { DiffsThemeNames, ThemeRegistrationResolved } from '../../types';\nimport { isWorkerContext } from '../../utils/isWorkerContext';\nimport {\n RegisteredCustomThemes,\n ResolvedThemes,\n ResolvingThemes,\n} from './constants';\n\nexport async function resolveTheme(\n themeName: DiffsThemeNames\n): Promise<ThemeRegistrationResolved> {\n if (isWorkerContext()) {\n throw new Error(\n `resolveTheme(\"${themeName}\") cannot be called from a worker context. ` +\n 'Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.'\n );\n }\n\n const resolver = ResolvingThemes.get(themeName);\n if (resolver != null) {\n return resolver;\n }\n\n try {\n const loader =\n RegisteredCustomThemes.get(themeName) ??\n bundledThemes[themeName as keyof typeof bundledThemes];\n\n if (loader == null) {\n throw new Error(`resolveTheme: No valid loader for ${themeName}`);\n }\n\n const resolver = loader().then((result) => {\n return normalizeAndCacheResolvedTheme(\n themeName,\n ('default' in result\n ? result.default\n : result) as ThemeRegistrationResolved\n );\n });\n\n ResolvingThemes.set(themeName, resolver);\n const theme = await resolver;\n if (theme.name !== themeName) {\n throw new Error(\n `resolvedTheme: themeName: ${themeName} does not match theme.name: ${theme.name}`\n );\n }\n ResolvedThemes.set(theme.name, theme);\n return theme;\n } finally {\n ResolvingThemes.delete(themeName);\n }\n}\n\nfunction normalizeAndCacheResolvedTheme(\n themeName: string,\n themeData: ThemeRegistrationResolved\n): ThemeRegistrationResolved {\n const resolvedTheme = ResolvedThemes.get(themeName);\n if (resolvedTheme != null) {\n return resolvedTheme;\n }\n themeData = normalizeTheme(themeData);\n ResolvedThemes.set(themeName, themeData);\n return themeData;\n}\n"],"mappings":";;;;;AAUA,eAAsB,aACpB,WACoC;AACpC,KAAI,iBAAiB,CACnB,OAAM,IAAI,MACR,iBAAiB,UAAU,yJAE5B;CAGH,MAAM,WAAW,gBAAgB,IAAI,UAAU;AAC/C,KAAI,YAAY,KACd,QAAO;AAGT,KAAI;EACF,MAAM,SACJ,uBAAuB,IAAI,UAAU,IACrC,cAAc;AAEhB,MAAI,UAAU,KACZ,OAAM,IAAI,MAAM,qCAAqC,YAAY;EAGnE,MAAMA,aAAW,QAAQ,CAAC,MAAM,WAAW;AACzC,UAAO,+BACL,WACC,aAAa,SACV,OAAO,UACP,OACL;IACD;AAEF,kBAAgB,IAAI,WAAWA,WAAS;EACxC,MAAM,QAAQ,MAAMA;AACpB,MAAI,MAAM,SAAS,UACjB,OAAM,IAAI,MACR,6BAA6B,UAAU,8BAA8B,MAAM,OAC5E;AAEH,iBAAe,IAAI,MAAM,MAAM,MAAM;AACrC,SAAO;WACC;AACR,kBAAgB,OAAO,UAAU;;;AAIrC,SAAS,+BACP,WACA,WAC2B;CAC3B,MAAM,gBAAgB,eAAe,IAAI,UAAU;AACnD,KAAI,iBAAiB,KACnB,QAAO;AAET,aAAY,eAAe,UAAU;AACrC,gBAAe,IAAI,WAAW,UAAU;AACxC,QAAO"}
1
+ {"version":3,"file":"resolveTheme.js","names":[],"sources":["../../../src/highlighter/themes/resolveTheme.ts"],"sourcesContent":["import type { DiffsThemeNames, ThemeRegistrationResolved } from '../../types';\nimport {\n prepareThemeResolution,\n validateResolvedThemeName,\n} from './themeResolution';\nimport { themeResolver } from './themeResolver';\n\n// Resolves a theme by name to a normalized Shiki theme, delegating the cache,\n// concurrent-load dedupe, normalization, and registry to the shared\n// @pierre/theming resolver. The diffs-specific behavior layered on top:\n// 1. Worker-context guard — themes must be pre-resolved on the main thread\n// and handed to the worker, which seeds them via attachResolvedThemes.\n// 2. Bundled-theme fallback a name with no registered loader that matches a\n// Shiki bundled theme is registered on demand (per-name dynamic import),\n// so callers never have to pre-register the full Shiki theme set.\n// 3. theme.name validation the resolved theme's own name must match the\n// requested name, catching mismatched registrations early.\nexport async function resolveTheme(\n themeName: DiffsThemeNames\n): Promise<ThemeRegistrationResolved> {\n prepareThemeResolution(themeName);\n\n const theme = await themeResolver.resolveTheme(themeName);\n\n validateResolvedThemeName(themeName, theme);\n\n return theme;\n}\n"],"mappings":";;;;AAiBA,eAAsB,aACpB,WACoC;AACpC,wBAAuB,UAAU;CAEjC,MAAM,QAAQ,MAAM,cAAc,aAAa,UAAU;AAEzD,2BAA0B,WAAW,MAAM;AAE3C,QAAO"}
@@ -1,18 +1,11 @@
1
- import { resolveTheme } from "./resolveTheme.js";
2
- import { getResolvedOrResolveTheme } from "./getResolvedOrResolveTheme.js";
1
+ import { themeResolver } from "./themeResolver.js";
2
+ import { prepareThemeResolution, validateResolvedThemeName } from "./themeResolution.js";
3
3
 
4
4
  //#region src/highlighter/themes/resolveThemes.ts
5
5
  async function resolveThemes(themes) {
6
- const resolvedThemes = [];
7
- const themesToResolve = [];
8
- for (const themeName of themes) {
9
- const themeData = getResolvedOrResolveTheme(themeName) ?? resolveTheme(themeName);
10
- if ("then" in themeData) themesToResolve.push(themeData);
11
- else resolvedThemes.push(themeData);
12
- }
13
- if (themesToResolve.length > 0) await Promise.all(themesToResolve).then((resolved) => {
14
- for (const theme of resolved) if (theme != null) resolvedThemes.push(theme);
15
- });
6
+ for (const themeName of themes) prepareThemeResolution(themeName);
7
+ const resolvedThemes = await themeResolver.resolveThemes(themes);
8
+ for (let i = 0; i < themes.length; i++) validateResolvedThemeName(themes[i], resolvedThemes[i]);
16
9
  return resolvedThemes;
17
10
  }
18
11
 
@@ -1 +1 @@
1
- {"version":3,"file":"resolveThemes.js","names":["resolvedThemes: ThemeRegistrationResolved[]","themesToResolve: Promise<ThemeRegistrationResolved | undefined>[]"],"sources":["../../../src/highlighter/themes/resolveThemes.ts"],"sourcesContent":["import type { DiffsThemeNames, ThemeRegistrationResolved } from '../../types';\nimport { getResolvedOrResolveTheme } from './getResolvedOrResolveTheme';\nimport { resolveTheme } from './resolveTheme';\n\nexport async function resolveThemes(\n themes: DiffsThemeNames[]\n): Promise<ThemeRegistrationResolved[]> {\n const resolvedThemes: ThemeRegistrationResolved[] = [];\n const themesToResolve: Promise<ThemeRegistrationResolved | undefined>[] = [];\n for (const themeName of themes) {\n const themeData =\n getResolvedOrResolveTheme(themeName) ?? resolveTheme(themeName);\n if ('then' in themeData) {\n themesToResolve.push(themeData);\n } else {\n resolvedThemes.push(themeData);\n }\n }\n\n if (themesToResolve.length > 0) {\n await Promise.all(themesToResolve).then((resolved) => {\n for (const theme of resolved) {\n if (theme != null) {\n resolvedThemes.push(theme);\n }\n }\n });\n }\n\n return resolvedThemes;\n}\n"],"mappings":";;;;AAIA,eAAsB,cACpB,QACsC;CACtC,MAAMA,iBAA8C,EAAE;CACtD,MAAMC,kBAAoE,EAAE;AAC5E,MAAK,MAAM,aAAa,QAAQ;EAC9B,MAAM,YACJ,0BAA0B,UAAU,IAAI,aAAa,UAAU;AACjE,MAAI,UAAU,UACZ,iBAAgB,KAAK,UAAU;MAE/B,gBAAe,KAAK,UAAU;;AAIlC,KAAI,gBAAgB,SAAS,EAC3B,OAAM,QAAQ,IAAI,gBAAgB,CAAC,MAAM,aAAa;AACpD,OAAK,MAAM,SAAS,SAClB,KAAI,SAAS,KACX,gBAAe,KAAK,MAAM;GAG9B;AAGJ,QAAO"}
1
+ {"version":3,"file":"resolveThemes.js","names":[],"sources":["../../../src/highlighter/themes/resolveThemes.ts"],"sourcesContent":["import type { DiffsThemeNames, ThemeRegistrationResolved } from '../../types';\nimport {\n prepareThemeResolution,\n validateResolvedThemeName,\n} from './themeResolution';\nimport { themeResolver } from './themeResolver';\n\nexport async function resolveThemes(\n themes: DiffsThemeNames[]\n): Promise<ThemeRegistrationResolved[]> {\n for (const themeName of themes) {\n prepareThemeResolution(themeName);\n }\n\n const resolvedThemes = await themeResolver.resolveThemes(themes);\n for (let i = 0; i < themes.length; i++) {\n validateResolvedThemeName(themes[i], resolvedThemes[i]);\n }\n\n return resolvedThemes;\n}\n"],"mappings":";;;;AAOA,eAAsB,cACpB,QACsC;AACtC,MAAK,MAAM,aAAa,OACtB,wBAAuB,UAAU;CAGnC,MAAM,iBAAiB,MAAM,cAAc,cAAc,OAAO;AAChE,MAAK,IAAI,IAAI,GAAG,IAAI,OAAO,QAAQ,IACjC,2BAA0B,OAAO,IAAI,eAAe,GAAG;AAGzD,QAAO"}
@@ -0,0 +1,8 @@
1
+ import { DiffsThemeNames, ThemeRegistrationResolved } from "../../types.js";
2
+
3
+ //#region src/highlighter/themes/themeResolution.d.ts
4
+ declare function prepareThemeResolution(themeName: DiffsThemeNames): void;
5
+ declare function validateResolvedThemeName(themeName: DiffsThemeNames, theme: ThemeRegistrationResolved): void;
6
+ //#endregion
7
+ export { prepareThemeResolution, validateResolvedThemeName };
8
+ //# sourceMappingURL=themeResolution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeResolution.d.ts","names":["DiffsThemeNames","ThemeRegistrationResolved","prepareThemeResolution","validateResolvedThemeName"],"sources":["../../../src/highlighter/themes/themeResolution.d.ts"],"sourcesContent":["import type { DiffsThemeNames, ThemeRegistrationResolved } from '../../types';\nexport declare function prepareThemeResolution(themeName: DiffsThemeNames): void;\nexport declare function validateResolvedThemeName(themeName: DiffsThemeNames, theme: ThemeRegistrationResolved): void;\n//# sourceMappingURL=themeResolution.d.ts.map"],"mappings":";;;iBACwBE,sBAAAA,YAAkCF;iBAClCG,yBAAAA,YAAqCH,wBAAwBC"}
@@ -0,0 +1,22 @@
1
+ import { isWorkerContext } from "../../utils/isWorkerContext.js";
2
+ import { themeResolver } from "./themeResolver.js";
3
+ import { shikiThemes } from "@pierre/theming/themes";
4
+
5
+ //#region src/highlighter/themes/themeResolution.ts
6
+ function prepareThemeResolution(themeName) {
7
+ if (isWorkerContext()) throw new Error(`Theme "${themeName}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);
8
+ if (themeResolver.hasRegisteredTheme(themeName)) return;
9
+ const descriptor = shikiThemes.getTheme(themeName);
10
+ if (descriptor != null) {
11
+ themeResolver.registerThemeIfAbsent(descriptor.name, descriptor.load);
12
+ return;
13
+ }
14
+ throw new Error(`No valid theme loader registered for "${themeName}"`);
15
+ }
16
+ function validateResolvedThemeName(themeName, theme) {
17
+ if (theme.name !== themeName) throw new Error(`resolvedTheme: themeName: ${themeName} does not match theme.name: ${theme.name}`);
18
+ }
19
+
20
+ //#endregion
21
+ export { prepareThemeResolution, validateResolvedThemeName };
22
+ //# sourceMappingURL=themeResolution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeResolution.js","names":[],"sources":["../../../src/highlighter/themes/themeResolution.ts"],"sourcesContent":["import type { ThemeLoader } from '@pierre/theming';\nimport { shikiThemes } from '@pierre/theming/themes';\n\nimport type { DiffsThemeNames, ThemeRegistrationResolved } from '../../types';\nimport { isWorkerContext } from '../../utils/isWorkerContext';\nimport { themeResolver } from './themeResolver';\n\n// Shared diffs-specific checks for resolving themes. The generic theming\n// resolver owns cache/registry mechanics; diffs still owns worker restrictions,\n// Shiki fallback registration, and validating theme.name against the requested\n// registry key.\nexport function prepareThemeResolution(themeName: DiffsThemeNames): void {\n if (isWorkerContext()) {\n throw new Error(\n `Theme \"${themeName}\" cannot be resolved from a worker context. ` +\n 'Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.'\n );\n }\n\n if (themeResolver.hasRegisteredTheme(themeName)) {\n return;\n }\n const descriptor = shikiThemes.getTheme(themeName);\n if (descriptor != null) {\n themeResolver.registerThemeIfAbsent(\n descriptor.name,\n descriptor.load as ThemeLoader<ThemeRegistrationResolved>\n );\n return;\n }\n throw new Error(`No valid theme loader registered for \"${themeName}\"`);\n}\n\nexport function validateResolvedThemeName(\n themeName: DiffsThemeNames,\n theme: ThemeRegistrationResolved\n): void {\n if (theme.name !== themeName) {\n throw new Error(\n `resolvedTheme: themeName: ${themeName} does not match theme.name: ${theme.name}`\n );\n }\n}\n"],"mappings":";;;;;AAWA,SAAgB,uBAAuB,WAAkC;AACvE,KAAI,iBAAiB,CACnB,OAAM,IAAI,MACR,UAAU,UAAU,0JAErB;AAGH,KAAI,cAAc,mBAAmB,UAAU,CAC7C;CAEF,MAAM,aAAa,YAAY,SAAS,UAAU;AAClD,KAAI,cAAc,MAAM;AACtB,gBAAc,sBACZ,WAAW,MACX,WAAW,KACZ;AACD;;AAEF,OAAM,IAAI,MAAM,yCAAyC,UAAU,GAAG;;AAGxE,SAAgB,0BACd,WACA,OACM;AACN,KAAI,MAAM,SAAS,UACjB,OAAM,IAAI,MACR,6BAA6B,UAAU,8BAA8B,MAAM,OAC5E"}
@@ -0,0 +1,8 @@
1
+ import { ThemeRegistrationResolved } from "../../types.js";
2
+ import * as _pierre_theming0 from "@pierre/theming";
3
+
4
+ //#region src/highlighter/themes/themeResolver.d.ts
5
+ declare const themeResolver: _pierre_theming0.ThemeResolver<ThemeRegistrationResolved>;
6
+ //#endregion
7
+ export { themeResolver };
8
+ //# sourceMappingURL=themeResolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeResolver.d.ts","names":["ThemeRegistrationResolved","themeResolver","_pierre_theming0","ThemeResolver"],"sources":["../../../src/highlighter/themes/themeResolver.d.ts"],"sourcesContent":["import type { ThemeRegistrationResolved } from '../../types';\nexport declare const themeResolver: import(\"@pierre/theming\").ThemeResolver<ThemeRegistrationResolved>;\n//# sourceMappingURL=themeResolver.d.ts.map"],"mappings":";;;;cACqBC,eAAgFC,gBAAAA,CAAvCC,cAAcH"}
@@ -0,0 +1,8 @@
1
+ import { createThemeResolver } from "@pierre/theming";
2
+
3
+ //#region src/highlighter/themes/themeResolver.ts
4
+ const themeResolver = createThemeResolver();
5
+
6
+ //#endregion
7
+ export { themeResolver };
8
+ //# sourceMappingURL=themeResolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeResolver.js","names":[],"sources":["../../../src/highlighter/themes/themeResolver.ts"],"sourcesContent":["import { createThemeResolver } from '@pierre/theming';\n\nimport type { ThemeRegistrationResolved } from '../../types';\n\n// The single diffs-owned theme resolver. It replaces the former hand-rolled\n// ResolvedThemes (sync cache) + ResolvingThemes (in-flight dedupe) +\n// RegisteredCustomThemes (loader registry) trio with one shared\n// @pierre/theming resolver: the resolver owns the cache, the concurrent-load\n// dedupe, and the name→loader registry internally.\n//\n// This module is intentionally NOT re-exported from the package index — the\n// resolver and the registered-name set are diffs internals. Public callers go\n// through the wrapper functions (resolveTheme, getResolvedThemes, etc.) that\n// add the diffs-specific behavior the generic resolver knows nothing about:\n// the worker-context guard, Shiki normalization, the bundled-theme fallback,\n// and the theme.name validation.\nexport const themeResolver = createThemeResolver<ThemeRegistrationResolved>();\n"],"mappings":";;;AAgBA,MAAa,gBAAgB,qBAAgD"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AnnotationLineMap, AnnotationSide, AnnotationSpan, AppliedThemeStyleCache, BaseCodeOptions, BaseDiffOptions, BaseDiffOptionsWithDefaults, BundledLanguage, ChangeContent, ChangeTypes, CodeColumnType, CodeToHastOptions, CodeViewDiffItem, CodeViewFileItem, CodeViewItem, CodeViewItemScrollTarget, CodeViewLayout, CodeViewLineScrollTarget, CodeViewPositionScrollTarget, CodeViewRangeScrollTarget, CodeViewScrollBehavior, CodeViewScrollTarget, ConflictResolverTypes, ContextContent, CreatePatchOptionsNonabortable, CustomPreProperties, DecorationItem, DiffAcceptRejectHunkConfig, DiffAcceptRejectHunkType, DiffIndicators, DiffLineAnnotation, DiffLineEventBaseProps, DiffTokenEventBaseProps, DiffsBaseComponent, DiffsComponentOptions, DiffsEditableComponent, DiffsEditor, DiffsEditorSelection, DiffsHighlighter, DiffsTextDocument, DiffsThemeNames, ExpansionDirections, ExtensionFormatMap, FileContents, FileDiffMetadata, FileHeaderRenderMode, ForceDiffPlainTextOptions, ForceFilePlainTextOptions, GapSpan, HighlightedToken, HighlighterTypes, Hunk, HunkData, HunkExpansionRegion, HunkLineType, HunkSeparators, LanguageRegistration, LineAnnotation, LineDiffTypes, LineEventBaseProps, LineInfo, LineSpans, LineTypes, MergeConflictActionPayload, MergeConflictMarkerRow, MergeConflictMarkerRowType, MergeConflictRegion, MergeConflictResolution, NumericScrollLineAnchor, ObservedAnnotationNodes, ObservedGridNodes, ParsedPatch, PendingCodeViewLayoutReset, PostRenderPhase, PrePropertiesConfig, ProcessFileConflictData, RenderDiffFilesResult, RenderDiffOptions, RenderDiffResult, RenderFileMetadata, RenderFileOptions, RenderFileResult, RenderHeaderMetadataCallback, RenderHeaderPrefixCallback, RenderRange, RenderWindow, RenderedDiffASTCache, RenderedFileASTCache, SelectedLineRange, SelectionPoint, SelectionSide, SharedRenderState, ShikiTransformer, SmoothScrollSettings, StickySpecs, SupportedLanguages, ThemeRegistrationResolved, ThemeTypes, ThemedDiffResult, ThemedFileResult, ThemedToken, ThemesType, TokenEventBase, VirtualFileMetrics, VirtualWindowSpecs } from "./types.js";
1
+ import { AnnotationLineMap, AnnotationSide, AnnotationSpan, AppliedThemeStyleCache, BaseCodeOptions, BaseDiffOptions, BaseDiffOptionsWithDefaults, BundledLanguage, ChangeContent, ChangeTypes, CodeColumnType, CodeToHastOptions, CodeViewDiffItem, CodeViewFileItem, CodeViewItem, CodeViewItemScrollTarget, CodeViewLayout, CodeViewLineScrollTarget, CodeViewPositionScrollTarget, CodeViewRangeScrollTarget, CodeViewScrollBehavior, CodeViewScrollTarget, ConflictResolverTypes, ContextContent, CreatePatchOptionsNonabortable, CustomPreProperties, DecorationItem, DiffAcceptRejectHunkConfig, DiffAcceptRejectHunkType, DiffIndicators, DiffLineAnnotation, DiffLineEventBaseProps, DiffTokenEventBaseProps, DiffsBaseComponent, DiffsComponentOptions, DiffsEditableComponent, DiffsEditor, DiffsEditorSelection, DiffsHighlighter, DiffsTextDocument, DiffsThemeNames, ExpansionDirections, ExtensionFormatMap, FileContents, FileDiffMetadata, FileHeaderRenderMode, ForceDiffPlainTextOptions, ForceFilePlainTextOptions, GapSpan, HighlightedToken, HighlighterTypes, Hunk, HunkData, HunkExpansionRegion, HunkLineType, HunkSeparators, LanguageRegistration, LineAnnotation, LineDiffTypes, LineEventBaseProps, LineInfo, LineSpans, LineTypes, MergeConflictActionPayload, MergeConflictMarkerRow, MergeConflictMarkerRowType, MergeConflictRegion, MergeConflictResolution, NumericScrollLineAnchor, ObservedAnnotationNodes, ObservedGridNodes, ParsedPatch, PendingCodeViewLayoutReset, PostRenderPhase, PrePropertiesConfig, ProcessFileConflictData, RenderDiffFilesResult, RenderDiffOptions, RenderDiffResult, RenderFileMetadata, RenderFileOptions, RenderFileResult, RenderHeaderMetadataCallback, RenderHeaderPrefixCallback, RenderRange, RenderWindow, RenderedDiffASTCache, RenderedFileASTCache, SelectedLineRange, SelectionPoint, SelectionSide, SharedRenderState, ShikiTransformer, SmoothScrollSettings, StickySpecs, SupportedLanguages, ThemeRegistration, ThemeRegistrationResolved, ThemeTypes, ThemedDiffResult, ThemedFileResult, ThemedToken, ThemesType, TokenEventBase, VirtualFileMetrics, VirtualWindowSpecs } from "./types.js";
2
2
  import { GetHoveredLineResult, GetLineIndexUtility, InteractionManager, InteractionManagerBaseOptions, InteractionManagerMode, InteractionManagerOptions, LogTypes, MergeConflictActionTarget, OnDiffLineClickProps, OnDiffLineEnterLeaveProps, OnLineClickProps, OnLineEnterLeaveProps, OnTokenEventProps, SelectionWriteOptions, pluckInteractionOptions } from "./managers/InteractionManager.js";
3
3
  import { ResizeManager } from "./managers/ResizeManager.js";
4
4
  import { FileRenderResult, FileRenderer, FileRendererOptions } from "./renderers/FileRenderer.js";
@@ -27,12 +27,12 @@ import { disposeHighlighter, getHighlighterIfLoaded, getSharedHighlighter, isHig
27
27
  import { areThemesAttached } from "./highlighter/themes/areThemesAttached.js";
28
28
  import { attachResolvedThemes } from "./highlighter/themes/attachResolvedThemes.js";
29
29
  import { cleanUpResolvedThemes } from "./highlighter/themes/cleanUpResolvedThemes.js";
30
- import { AttachedThemes, RegisteredCustomThemes, ResolvedThemes, ResolvingThemes } from "./highlighter/themes/constants.js";
30
+ import { AttachedThemes } from "./highlighter/themes/constants.js";
31
31
  import { getResolvedOrResolveTheme } from "./highlighter/themes/getResolvedOrResolveTheme.js";
32
32
  import { getResolvedThemes } from "./highlighter/themes/getResolvedThemes.js";
33
33
  import { hasResolvedThemes } from "./highlighter/themes/hasResolvedThemes.js";
34
34
  import { registerCustomCSSVariableTheme } from "./highlighter/themes/registerCustomCSSVariableTheme.js";
35
- import { registerCustomTheme } from "./highlighter/themes/registerCustomTheme.js";
35
+ import { CustomThemeLoader, registerCustomTheme } from "./highlighter/themes/registerCustomTheme.js";
36
36
  import { resolveTheme } from "./highlighter/themes/resolveTheme.js";
37
37
  import { resolveThemes } from "./highlighter/themes/resolveThemes.js";
38
38
  import { ScrollSyncManager } from "./managers/ScrollSyncManager.js";
@@ -105,4 +105,4 @@ import { trimPatchContext } from "./utils/trimPatchContext.js";
105
105
  import { FileDiff, FileDiffHydrationProps, FileDiffOptions, FileDiffRenderProps, FileDiffType } from "./components/FileDiff.js";
106
106
  import { CodeView, CodeViewCoordinator, CodeViewLineSelection, CodeViewOptions, CodeViewRenderedDiffItem, CodeViewRenderedFileItem, CodeViewRenderedItem, CodeViewScrollListener } from "./components/CodeView.js";
107
107
  import { codeToHtml, createCssVariablesTheme as createCSSVariablesTheme } from "shiki";
108
- export { ALTERNATE_FILE_NAMES_GIT, AnnotationLineMap, AnnotationSide, AnnotationSpan, AppliedThemeStyleCache, AttachedLanguages, AttachedThemes, BaseCodeOptions, BaseDiffOptions, BaseDiffOptionsWithDefaults, BundledLanguage, COMMIT_METADATA_SPLIT, CORE_CSS_ATTRIBUTE, CUSTOM_HEADER_SLOT_ID, ChangeContent, ChangeTypes, CodeColumnType, CodeToHastOptions, CodeToTokenTransformStream, CodeToTokenTransformStreamOptions, CodeView, CodeViewCoordinator, CodeViewDiffItem, CodeViewFileItem, CodeViewItem, CodeViewItemScrollTarget, CodeViewLayout, CodeViewLineScrollTarget, CodeViewLineSelection, CodeViewOptions, CodeViewPositionScrollTarget, CodeViewRangeScrollTarget, CodeViewRenderedDiffItem, CodeViewRenderedFileItem, CodeViewRenderedItem, CodeViewScrollBehavior, CodeViewScrollListener, CodeViewScrollTarget, ConflictResolverTypes, ContextContent, CreateFileHeaderElementProps, CreatePatchOptionsNonabortable, CustomPreProperties, DEFAULT_CODE_VIEW_FILE_METRICS, DEFAULT_CODE_VIEW_LAYOUT, DEFAULT_COLLAPSED_CONTEXT_THRESHOLD, DEFAULT_EXPANDED_REGION, DEFAULT_RENDER_RANGE, DEFAULT_SMOOTH_SCROLL_SETTINGS, DEFAULT_THEMES, DEFAULT_TOKENIZE_MAX_LENGTH, DEFAULT_VIRTUAL_FILE_METRICS, DIFFS_DEVELOPMENT_BUILD, DIFFS_SCROLLBAR_GUTTER_MEASURED_PROPERTY, DIFFS_SCROLLBAR_MEASURE_ATTRIBUTE, DIFFS_TAG_NAME, DecorationItem, DiffAcceptRejectHunkConfig, DiffAcceptRejectHunkType, DiffHunksRenderer, DiffHunksRendererOptions, DiffHunksRendererOptionsWithDefaults, DiffIndicators, DiffLineAnnotation, DiffLineEventBaseProps, DiffTokenEventBaseProps, DiffsBaseComponent, DiffsComponentOptions, DiffsEditableComponent, DiffsEditor, DiffsEditorSelection, DiffsHighlighter, DiffsTextDocument, DiffsThemeNames, EMPTY_RENDER_RANGE, EXTENSION_TO_FILE_FORMAT, ExpansionDirections, ExtensionFormatMap, FILENAME_HEADER_REGEX, FILENAME_HEADER_REGEX_GIT, FILE_CONTEXT_BLOB, File, FileContents, FileDiff, FileDiffHydrationProps, FileDiffMetadata, FileDiffOptions, FileDiffRenderProps, FileDiffType, FileHeaderRenderMode, FileHydrateProps, FileOptions, FileRenderProps, FileRenderResult, FileRenderer, FileRendererOptions, FileStream, FileStreamOptions, ForceDiffPlainTextOptions, ForceFilePlainTextOptions, GIT_DIFF_FILE_BREAK_REGEX, GapSpan, GetHoveredLineResult, GetLineIndexUtility, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID, HUNK_HEADER, HighlightedToken, HighlighterTypes, Hunk, HunkData, HunkExpansionRegion, HunkLineType, HunkSeparators, HunksRenderResult, INDEX_LINE_METADATA, InjectedRow, InteractionManager, InteractionManagerBaseOptions, InteractionManagerMode, InteractionManagerOptions, LanguageRegistration, LineAnnotation, LineDecoration, LineDiffTypes, LineEventBaseProps, LineInfo, LineSpans, LineTypes, LogTypes, MERGE_CONFLICT_BASE_MARKER_REGEX, MERGE_CONFLICT_END_MARKER_REGEX, MERGE_CONFLICT_SEPARATOR_MARKER_REGEX, MERGE_CONFLICT_START_MARKER_REGEX, MergeConflictActionPayload, MergeConflictActionTarget, MergeConflictActionsTypeOption, MergeConflictMarkerRow, MergeConflictMarkerRowType, MergeConflictRegion, MergeConflictResolution, NumericScrollLineAnchor, ObservedAnnotationNodes, ObservedGridNodes, OnDiffLineClickProps, OnDiffLineEnterLeaveProps, OnLineClickProps, OnLineEnterLeaveProps, OnTokenEventProps, ParsedLine, ParsedPatch, PendingCodeViewLayoutReset, PostRenderPhase, PrePropertiesConfig, ProcessFileConflictData, RecallToken, RegisteredCustomLanguages, RegisteredCustomThemes, RenderDiffFilesResult, RenderDiffOptions, RenderDiffResult, RenderFileMetadata, RenderFileOptions, RenderFileResult, RenderHeaderMetadataCallback, RenderHeaderPrefixCallback, RenderMergeConflictActions, RenderRange, RenderWindow, RenderedDiffASTCache, RenderedFileASTCache, RenderedLineContext, ResizeManager, ResolvedLanguages, ResolvedThemes, ResolvingLanguages, ResolvingThemes, SPLIT_WITH_NEWLINES, SVGSpriteNames, SVGSpriteSheet, ScrollSyncManager, SelectedLineRange, SelectionPoint, SelectionSide, SelectionWriteOptions, SharedRenderState, ShikiStreamTokenizer, ShikiStreamTokenizerEnqueueResult, ShikiStreamTokenizerOptions, ShikiTransformer, SmoothScrollSettings, SplitInjectedRow, SplitInjectedRowPlacement, SplitLineDecorationProps, StickySpecs, SupportedLanguages, THEME_CSS_ATTRIBUTE, ThemeRegistrationResolved, ThemeTypes, ThemedDiffResult, ThemedFileResult, ThemedToken, ThemesType, TokenEventBase, UNIFIED_DIFF_FILE_BREAK_REGEX, UNSAFE_CSS_ATTRIBUTE, UnifiedInjectedRowPlacement, UnifiedLineDecorationProps, UnresolvedFile, UnresolvedFileHydrationProps, UnresolvedFileOptions, UnresolvedFileRenderProps, VirtualFileMetrics, VirtualWindowSpecs, VirtualizedFile, VirtualizedFileDiff, Virtualizer, VirtualizerConfig, areDiffLineAnnotationsEqual, areDiffRenderOptionsEqual, areDiffTargetsEqual, areFileRenderOptionsEqual, areFilesEqual, areHunkDataEqual, areLanguagesAttached, areLineAnnotationsEqual, areObjectsEqual, areOptionsEqual, arePrePropertiesEqual, areRenderRangesEqual, areSelectionsEqual, areThemesAttached, areThemesEqual, areVirtualWindowSpecsEqual, areWorkerStatsEqual, attachResolvedLanguages, attachResolvedThemes, cleanLastNewline, cleanUpResolvedLanguages, cleanUpResolvedThemes, codeToHtml, createAnnotationElement, createAnnotationWrapperNode, createCSSVariablesTheme, createDiffSpanDecoration, createEmptyRowBuffer, createFileHeaderElement, createGutterGap, createGutterItem, createGutterUtilityContentNode, createGutterUtilityElement, createGutterWrapper, createHastElement, createIconElement, createNoNewlineElement, createPreElement, createPreWrapperProperties, createRowNodes, createSeparator, createSpanFromToken, createStyleElement, createTextNodeElement, createThemeStyleElement, createTransformerWithState, createUnsafeCSSStyleNode, createWindowFromScrollPosition, dequeueRender, detachString, diffAcceptRejectHunk, disposeHighlighter, findCodeElement, formatCSSVariablePrefix, getCustomExtensionsMap, getCustomExtensionsVersion, getFiletypeFromFileName, getHighlighterIfLoaded, getHighlighterOptions, getHighlighterThemeStyles, getHunkSeparatorSlotName, getIconForType, getLineAnnotationName, getLineEndingType, getLineNodes, getOrCreateCodeNode, getResolvedLanguages, getResolvedOrResolveLanguage, getResolvedOrResolveTheme, getResolvedThemes, getSharedHighlighter, getSingularPatch, getThemes, getTotalLineCountFromHunks, getUnresolvedDiffHunksRendererOptions, hasResolvedLanguages, hasResolvedThemes, isDefaultRenderRange, isHighlighterLoaded, isHighlighterLoading, isHighlighterNull, isWorkerContext, parseDiffFromFile, parseLineType, parsePatchFiles, patchScrollbarGutterSize, pluckInteractionOptions, prefersReducedMotion, preloadHighlighter, prerenderHTMLIfNecessary, processFile, processLine, processPatch, pushOrJoinSpan, queueRender, registerCustomCSSVariableTheme, registerCustomLanguage, registerCustomTheme, releaseStringDetachBuffer, renderDiffWithHighlighter, renderFileWithHighlighter, replaceCustomExtensions, resolveConflict, resolveLanguage, resolveLanguages, resolveRegion, resolveTheme, resolveThemes, setCustomExtension, setLanguageOverride, setPreNodeProperties, trimPatchContext, wrapCoreCSS, wrapThemeCSS, wrapUnsafeCSS };
108
+ export { ALTERNATE_FILE_NAMES_GIT, AnnotationLineMap, AnnotationSide, AnnotationSpan, AppliedThemeStyleCache, AttachedLanguages, AttachedThemes, BaseCodeOptions, BaseDiffOptions, BaseDiffOptionsWithDefaults, BundledLanguage, COMMIT_METADATA_SPLIT, CORE_CSS_ATTRIBUTE, CUSTOM_HEADER_SLOT_ID, ChangeContent, ChangeTypes, CodeColumnType, CodeToHastOptions, CodeToTokenTransformStream, CodeToTokenTransformStreamOptions, CodeView, CodeViewCoordinator, CodeViewDiffItem, CodeViewFileItem, CodeViewItem, CodeViewItemScrollTarget, CodeViewLayout, CodeViewLineScrollTarget, CodeViewLineSelection, CodeViewOptions, CodeViewPositionScrollTarget, CodeViewRangeScrollTarget, CodeViewRenderedDiffItem, CodeViewRenderedFileItem, CodeViewRenderedItem, CodeViewScrollBehavior, CodeViewScrollListener, CodeViewScrollTarget, ConflictResolverTypes, ContextContent, CreateFileHeaderElementProps, CreatePatchOptionsNonabortable, CustomPreProperties, CustomThemeLoader, DEFAULT_CODE_VIEW_FILE_METRICS, DEFAULT_CODE_VIEW_LAYOUT, DEFAULT_COLLAPSED_CONTEXT_THRESHOLD, DEFAULT_EXPANDED_REGION, DEFAULT_RENDER_RANGE, DEFAULT_SMOOTH_SCROLL_SETTINGS, DEFAULT_THEMES, DEFAULT_TOKENIZE_MAX_LENGTH, DEFAULT_VIRTUAL_FILE_METRICS, DIFFS_DEVELOPMENT_BUILD, DIFFS_SCROLLBAR_GUTTER_MEASURED_PROPERTY, DIFFS_SCROLLBAR_MEASURE_ATTRIBUTE, DIFFS_TAG_NAME, DecorationItem, DiffAcceptRejectHunkConfig, DiffAcceptRejectHunkType, DiffHunksRenderer, DiffHunksRendererOptions, DiffHunksRendererOptionsWithDefaults, DiffIndicators, DiffLineAnnotation, DiffLineEventBaseProps, DiffTokenEventBaseProps, DiffsBaseComponent, DiffsComponentOptions, DiffsEditableComponent, DiffsEditor, DiffsEditorSelection, DiffsHighlighter, DiffsTextDocument, DiffsThemeNames, EMPTY_RENDER_RANGE, EXTENSION_TO_FILE_FORMAT, ExpansionDirections, ExtensionFormatMap, FILENAME_HEADER_REGEX, FILENAME_HEADER_REGEX_GIT, FILE_CONTEXT_BLOB, File, FileContents, FileDiff, FileDiffHydrationProps, FileDiffMetadata, FileDiffOptions, FileDiffRenderProps, FileDiffType, FileHeaderRenderMode, FileHydrateProps, FileOptions, FileRenderProps, FileRenderResult, FileRenderer, FileRendererOptions, FileStream, FileStreamOptions, ForceDiffPlainTextOptions, ForceFilePlainTextOptions, GIT_DIFF_FILE_BREAK_REGEX, GapSpan, GetHoveredLineResult, GetLineIndexUtility, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID, HUNK_HEADER, HighlightedToken, HighlighterTypes, Hunk, HunkData, HunkExpansionRegion, HunkLineType, HunkSeparators, HunksRenderResult, INDEX_LINE_METADATA, InjectedRow, InteractionManager, InteractionManagerBaseOptions, InteractionManagerMode, InteractionManagerOptions, LanguageRegistration, LineAnnotation, LineDecoration, LineDiffTypes, LineEventBaseProps, LineInfo, LineSpans, LineTypes, LogTypes, MERGE_CONFLICT_BASE_MARKER_REGEX, MERGE_CONFLICT_END_MARKER_REGEX, MERGE_CONFLICT_SEPARATOR_MARKER_REGEX, MERGE_CONFLICT_START_MARKER_REGEX, MergeConflictActionPayload, MergeConflictActionTarget, MergeConflictActionsTypeOption, MergeConflictMarkerRow, MergeConflictMarkerRowType, MergeConflictRegion, MergeConflictResolution, NumericScrollLineAnchor, ObservedAnnotationNodes, ObservedGridNodes, OnDiffLineClickProps, OnDiffLineEnterLeaveProps, OnLineClickProps, OnLineEnterLeaveProps, OnTokenEventProps, ParsedLine, ParsedPatch, PendingCodeViewLayoutReset, PostRenderPhase, PrePropertiesConfig, ProcessFileConflictData, RecallToken, RegisteredCustomLanguages, RenderDiffFilesResult, RenderDiffOptions, RenderDiffResult, RenderFileMetadata, RenderFileOptions, RenderFileResult, RenderHeaderMetadataCallback, RenderHeaderPrefixCallback, RenderMergeConflictActions, RenderRange, RenderWindow, RenderedDiffASTCache, RenderedFileASTCache, RenderedLineContext, ResizeManager, ResolvedLanguages, ResolvingLanguages, SPLIT_WITH_NEWLINES, SVGSpriteNames, SVGSpriteSheet, ScrollSyncManager, SelectedLineRange, SelectionPoint, SelectionSide, SelectionWriteOptions, SharedRenderState, ShikiStreamTokenizer, ShikiStreamTokenizerEnqueueResult, ShikiStreamTokenizerOptions, ShikiTransformer, SmoothScrollSettings, SplitInjectedRow, SplitInjectedRowPlacement, SplitLineDecorationProps, StickySpecs, SupportedLanguages, THEME_CSS_ATTRIBUTE, ThemeRegistration, ThemeRegistrationResolved, ThemeTypes, ThemedDiffResult, ThemedFileResult, ThemedToken, ThemesType, TokenEventBase, UNIFIED_DIFF_FILE_BREAK_REGEX, UNSAFE_CSS_ATTRIBUTE, UnifiedInjectedRowPlacement, UnifiedLineDecorationProps, UnresolvedFile, UnresolvedFileHydrationProps, UnresolvedFileOptions, UnresolvedFileRenderProps, VirtualFileMetrics, VirtualWindowSpecs, VirtualizedFile, VirtualizedFileDiff, Virtualizer, VirtualizerConfig, areDiffLineAnnotationsEqual, areDiffRenderOptionsEqual, areDiffTargetsEqual, areFileRenderOptionsEqual, areFilesEqual, areHunkDataEqual, areLanguagesAttached, areLineAnnotationsEqual, areObjectsEqual, areOptionsEqual, arePrePropertiesEqual, areRenderRangesEqual, areSelectionsEqual, areThemesAttached, areThemesEqual, areVirtualWindowSpecsEqual, areWorkerStatsEqual, attachResolvedLanguages, attachResolvedThemes, cleanLastNewline, cleanUpResolvedLanguages, cleanUpResolvedThemes, codeToHtml, createAnnotationElement, createAnnotationWrapperNode, createCSSVariablesTheme, createDiffSpanDecoration, createEmptyRowBuffer, createFileHeaderElement, createGutterGap, createGutterItem, createGutterUtilityContentNode, createGutterUtilityElement, createGutterWrapper, createHastElement, createIconElement, createNoNewlineElement, createPreElement, createPreWrapperProperties, createRowNodes, createSeparator, createSpanFromToken, createStyleElement, createTextNodeElement, createThemeStyleElement, createTransformerWithState, createUnsafeCSSStyleNode, createWindowFromScrollPosition, dequeueRender, detachString, diffAcceptRejectHunk, disposeHighlighter, findCodeElement, formatCSSVariablePrefix, getCustomExtensionsMap, getCustomExtensionsVersion, getFiletypeFromFileName, getHighlighterIfLoaded, getHighlighterOptions, getHighlighterThemeStyles, getHunkSeparatorSlotName, getIconForType, getLineAnnotationName, getLineEndingType, getLineNodes, getOrCreateCodeNode, getResolvedLanguages, getResolvedOrResolveLanguage, getResolvedOrResolveTheme, getResolvedThemes, getSharedHighlighter, getSingularPatch, getThemes, getTotalLineCountFromHunks, getUnresolvedDiffHunksRendererOptions, hasResolvedLanguages, hasResolvedThemes, isDefaultRenderRange, isHighlighterLoaded, isHighlighterLoading, isHighlighterNull, isWorkerContext, parseDiffFromFile, parseLineType, parsePatchFiles, patchScrollbarGutterSize, pluckInteractionOptions, prefersReducedMotion, preloadHighlighter, prerenderHTMLIfNecessary, processFile, processLine, processPatch, pushOrJoinSpan, queueRender, registerCustomCSSVariableTheme, registerCustomLanguage, registerCustomTheme, releaseStringDetachBuffer, renderDiffWithHighlighter, renderFileWithHighlighter, replaceCustomExtensions, resolveConflict, resolveLanguage, resolveLanguages, resolveRegion, resolveTheme, resolveThemes, setCustomExtension, setLanguageOverride, setPreNodeProperties, trimPatchContext, wrapCoreCSS, wrapThemeCSS, wrapUnsafeCSS };
package/dist/index.js CHANGED
@@ -18,12 +18,11 @@ import { cleanUpResolvedLanguages } from "./highlighter/languages/cleanUpResolve
18
18
  import { isWorkerContext } from "./utils/isWorkerContext.js";
19
19
  import { resolveLanguage } from "./highlighter/languages/resolveLanguage.js";
20
20
  import { getResolvedOrResolveLanguage } from "./highlighter/languages/getResolvedOrResolveLanguage.js";
21
- import { AttachedThemes, RegisteredCustomThemes, ResolvedThemes, ResolvingThemes } from "./highlighter/themes/constants.js";
21
+ import { AttachedThemes } from "./highlighter/themes/constants.js";
22
22
  import { attachResolvedThemes } from "./highlighter/themes/attachResolvedThemes.js";
23
23
  import { cleanUpResolvedThemes } from "./highlighter/themes/cleanUpResolvedThemes.js";
24
24
  import { resolveTheme } from "./highlighter/themes/resolveTheme.js";
25
25
  import { getResolvedOrResolveTheme } from "./highlighter/themes/getResolvedOrResolveTheme.js";
26
- import { registerCustomTheme } from "./highlighter/themes/registerCustomTheme.js";
27
26
  import { disposeHighlighter, getHighlighterIfLoaded, getSharedHighlighter, isHighlighterLoaded, isHighlighterLoading, isHighlighterNull, preloadHighlighter } from "./highlighter/shared_highlighter.js";
28
27
  import { getThemes } from "./utils/getThemes.js";
29
28
  import { areThemesAttached } from "./highlighter/themes/areThemesAttached.js";
@@ -91,6 +90,7 @@ import { hasResolvedLanguages } from "./highlighter/languages/hasResolvedLanguag
91
90
  import { registerCustomLanguage } from "./highlighter/languages/registerCustomLanguage.js";
92
91
  import { resolveLanguages } from "./highlighter/languages/resolveLanguages.js";
93
92
  import { getResolvedThemes } from "./highlighter/themes/getResolvedThemes.js";
93
+ import { registerCustomTheme } from "./highlighter/themes/registerCustomTheme.js";
94
94
  import { registerCustomCSSVariableTheme } from "./highlighter/themes/registerCustomCSSVariableTheme.js";
95
95
  import { resolveThemes } from "./highlighter/themes/resolveThemes.js";
96
96
  import { areWorkerStatsEqual } from "./utils/areWorkerStatsEqual.js";
@@ -104,4 +104,4 @@ import { setLanguageOverride } from "./utils/setLanguageOverride.js";
104
104
  import { trimPatchContext } from "./utils/trimPatchContext.js";
105
105
  import { codeToHtml, createCssVariablesTheme as createCSSVariablesTheme } from "shiki";
106
106
 
107
- export { ALTERNATE_FILE_NAMES_GIT, AttachedLanguages, AttachedThemes, COMMIT_METADATA_SPLIT, CORE_CSS_ATTRIBUTE, CUSTOM_HEADER_SLOT_ID, CodeToTokenTransformStream, CodeView, DEFAULT_CODE_VIEW_FILE_METRICS, DEFAULT_CODE_VIEW_LAYOUT, DEFAULT_COLLAPSED_CONTEXT_THRESHOLD, DEFAULT_EXPANDED_REGION, DEFAULT_RENDER_RANGE, DEFAULT_SMOOTH_SCROLL_SETTINGS, DEFAULT_THEMES, DEFAULT_TOKENIZE_MAX_LENGTH, DEFAULT_VIRTUAL_FILE_METRICS, DIFFS_DEVELOPMENT_BUILD, DIFFS_SCROLLBAR_GUTTER_MEASURED_PROPERTY, DIFFS_SCROLLBAR_MEASURE_ATTRIBUTE, DIFFS_TAG_NAME, DiffHunksRenderer, EMPTY_RENDER_RANGE, EXTENSION_TO_FILE_FORMAT, FILENAME_HEADER_REGEX, FILENAME_HEADER_REGEX_GIT, FILE_CONTEXT_BLOB, File, FileDiff, FileRenderer, FileStream, GIT_DIFF_FILE_BREAK_REGEX, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID, HUNK_HEADER, INDEX_LINE_METADATA, InteractionManager, MERGE_CONFLICT_BASE_MARKER_REGEX, MERGE_CONFLICT_END_MARKER_REGEX, MERGE_CONFLICT_SEPARATOR_MARKER_REGEX, MERGE_CONFLICT_START_MARKER_REGEX, RegisteredCustomLanguages, RegisteredCustomThemes, ResizeManager, ResolvedLanguages, ResolvedThemes, ResolvingLanguages, ResolvingThemes, SPLIT_WITH_NEWLINES, SVGSpriteSheet, ScrollSyncManager, ShikiStreamTokenizer, THEME_CSS_ATTRIBUTE, UNIFIED_DIFF_FILE_BREAK_REGEX, UNSAFE_CSS_ATTRIBUTE, UnresolvedFile, VirtualizedFile, VirtualizedFileDiff, Virtualizer, areDiffLineAnnotationsEqual, areDiffRenderOptionsEqual, areDiffTargetsEqual, areFileRenderOptionsEqual, areFilesEqual, areHunkDataEqual, areLanguagesAttached, areLineAnnotationsEqual, areObjectsEqual, areOptionsEqual, arePrePropertiesEqual, areRenderRangesEqual, areSelectionsEqual, areThemesAttached, areThemesEqual, areVirtualWindowSpecsEqual, areWorkerStatsEqual, attachResolvedLanguages, attachResolvedThemes, cleanLastNewline, cleanUpResolvedLanguages, cleanUpResolvedThemes, codeToHtml, createAnnotationElement, createAnnotationWrapperNode, createCSSVariablesTheme, createDiffSpanDecoration, createEmptyRowBuffer, createFileHeaderElement, createGutterGap, createGutterItem, createGutterUtilityContentNode, createGutterUtilityElement, createGutterWrapper, createHastElement, createIconElement, createNoNewlineElement, createPreElement, createPreWrapperProperties, createRowNodes, createSeparator, createSpanFromToken, createStyleElement, createTextNodeElement, createThemeStyleElement, createTransformerWithState, createUnsafeCSSStyleNode, createWindowFromScrollPosition, dequeueRender, detachString, diffAcceptRejectHunk, disposeHighlighter, findCodeElement, formatCSSVariablePrefix, getCustomExtensionsMap, getCustomExtensionsVersion, getFiletypeFromFileName, getHighlighterIfLoaded, getHighlighterOptions, getHighlighterThemeStyles, getHunkSeparatorSlotName, getIconForType, getLineAnnotationName, getLineEndingType, getLineNodes, getOrCreateCodeNode, getResolvedLanguages, getResolvedOrResolveLanguage, getResolvedOrResolveTheme, getResolvedThemes, getSharedHighlighter, getSingularPatch, getThemes, getTotalLineCountFromHunks, getUnresolvedDiffHunksRendererOptions, hasResolvedLanguages, hasResolvedThemes, isDefaultRenderRange, isHighlighterLoaded, isHighlighterLoading, isHighlighterNull, isWorkerContext, parseDiffFromFile, parseLineType, parsePatchFiles, patchScrollbarGutterSize, pluckInteractionOptions, prefersReducedMotion, preloadHighlighter, prerenderHTMLIfNecessary, processFile, processLine, processPatch, pushOrJoinSpan, queueRender, registerCustomCSSVariableTheme, registerCustomLanguage, registerCustomTheme, releaseStringDetachBuffer, renderDiffWithHighlighter, renderFileWithHighlighter, replaceCustomExtensions, resolveConflict, resolveLanguage, resolveLanguages, resolveRegion, resolveTheme, resolveThemes, setCustomExtension, setLanguageOverride, setPreNodeProperties, trimPatchContext, wrapCoreCSS, wrapThemeCSS, wrapUnsafeCSS };
107
+ export { ALTERNATE_FILE_NAMES_GIT, AttachedLanguages, AttachedThemes, COMMIT_METADATA_SPLIT, CORE_CSS_ATTRIBUTE, CUSTOM_HEADER_SLOT_ID, CodeToTokenTransformStream, CodeView, DEFAULT_CODE_VIEW_FILE_METRICS, DEFAULT_CODE_VIEW_LAYOUT, DEFAULT_COLLAPSED_CONTEXT_THRESHOLD, DEFAULT_EXPANDED_REGION, DEFAULT_RENDER_RANGE, DEFAULT_SMOOTH_SCROLL_SETTINGS, DEFAULT_THEMES, DEFAULT_TOKENIZE_MAX_LENGTH, DEFAULT_VIRTUAL_FILE_METRICS, DIFFS_DEVELOPMENT_BUILD, DIFFS_SCROLLBAR_GUTTER_MEASURED_PROPERTY, DIFFS_SCROLLBAR_MEASURE_ATTRIBUTE, DIFFS_TAG_NAME, DiffHunksRenderer, EMPTY_RENDER_RANGE, EXTENSION_TO_FILE_FORMAT, FILENAME_HEADER_REGEX, FILENAME_HEADER_REGEX_GIT, FILE_CONTEXT_BLOB, File, FileDiff, FileRenderer, FileStream, GIT_DIFF_FILE_BREAK_REGEX, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID, HUNK_HEADER, INDEX_LINE_METADATA, InteractionManager, MERGE_CONFLICT_BASE_MARKER_REGEX, MERGE_CONFLICT_END_MARKER_REGEX, MERGE_CONFLICT_SEPARATOR_MARKER_REGEX, MERGE_CONFLICT_START_MARKER_REGEX, RegisteredCustomLanguages, ResizeManager, ResolvedLanguages, ResolvingLanguages, SPLIT_WITH_NEWLINES, SVGSpriteSheet, ScrollSyncManager, ShikiStreamTokenizer, THEME_CSS_ATTRIBUTE, UNIFIED_DIFF_FILE_BREAK_REGEX, UNSAFE_CSS_ATTRIBUTE, UnresolvedFile, VirtualizedFile, VirtualizedFileDiff, Virtualizer, areDiffLineAnnotationsEqual, areDiffRenderOptionsEqual, areDiffTargetsEqual, areFileRenderOptionsEqual, areFilesEqual, areHunkDataEqual, areLanguagesAttached, areLineAnnotationsEqual, areObjectsEqual, areOptionsEqual, arePrePropertiesEqual, areRenderRangesEqual, areSelectionsEqual, areThemesAttached, areThemesEqual, areVirtualWindowSpecsEqual, areWorkerStatsEqual, attachResolvedLanguages, attachResolvedThemes, cleanLastNewline, cleanUpResolvedLanguages, cleanUpResolvedThemes, codeToHtml, createAnnotationElement, createAnnotationWrapperNode, createCSSVariablesTheme, createDiffSpanDecoration, createEmptyRowBuffer, createFileHeaderElement, createGutterGap, createGutterItem, createGutterUtilityContentNode, createGutterUtilityElement, createGutterWrapper, createHastElement, createIconElement, createNoNewlineElement, createPreElement, createPreWrapperProperties, createRowNodes, createSeparator, createSpanFromToken, createStyleElement, createTextNodeElement, createThemeStyleElement, createTransformerWithState, createUnsafeCSSStyleNode, createWindowFromScrollPosition, dequeueRender, detachString, diffAcceptRejectHunk, disposeHighlighter, findCodeElement, formatCSSVariablePrefix, getCustomExtensionsMap, getCustomExtensionsVersion, getFiletypeFromFileName, getHighlighterIfLoaded, getHighlighterOptions, getHighlighterThemeStyles, getHunkSeparatorSlotName, getIconForType, getLineAnnotationName, getLineEndingType, getLineNodes, getOrCreateCodeNode, getResolvedLanguages, getResolvedOrResolveLanguage, getResolvedOrResolveTheme, getResolvedThemes, getSharedHighlighter, getSingularPatch, getThemes, getTotalLineCountFromHunks, getUnresolvedDiffHunksRendererOptions, hasResolvedLanguages, hasResolvedThemes, isDefaultRenderRange, isHighlighterLoaded, isHighlighterLoading, isHighlighterNull, isWorkerContext, parseDiffFromFile, parseLineType, parsePatchFiles, patchScrollbarGutterSize, pluckInteractionOptions, prefersReducedMotion, preloadHighlighter, prerenderHTMLIfNecessary, processFile, processLine, processPatch, pushOrJoinSpan, queueRender, registerCustomCSSVariableTheme, registerCustomLanguage, registerCustomTheme, releaseStringDetachBuffer, renderDiffWithHighlighter, renderFileWithHighlighter, replaceCustomExtensions, resolveConflict, resolveLanguage, resolveLanguages, resolveRegion, resolveTheme, resolveThemes, setCustomExtension, setLanguageOverride, setPreNodeProperties, trimPatchContext, wrapCoreCSS, wrapThemeCSS, wrapUnsafeCSS };
@@ -1073,7 +1073,7 @@ function selectionPointFromAnnotationSlotName(slotName) {
1073
1073
  const match = /^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(slotName);
1074
1074
  if (match == null) return;
1075
1075
  const lineNumber = Number.parseInt(match[2], 10);
1076
- if (!Number.isFinite(lineNumber)) return;
1076
+ if (!Number.isFinite(lineNumber) || lineNumber <= 0) return;
1077
1077
  return {
1078
1078
  lineNumber,
1079
1079
  side: match[1]