@pierre/diffs 1.2.9 → 1.2.11

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 (52) 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.map +1 -1
  5. package/dist/components/File.js +6 -1
  6. package/dist/components/File.js.map +1 -1
  7. package/dist/components/FileDiff.js +1 -1
  8. package/dist/components/FileDiff.js.map +1 -1
  9. package/dist/components/FileStream.js +4 -2
  10. package/dist/components/FileStream.js.map +1 -1
  11. package/dist/components/UnresolvedFile.d.ts.map +1 -1
  12. package/dist/components/VirtualizedFile.d.ts +6 -2
  13. package/dist/components/VirtualizedFile.d.ts.map +1 -1
  14. package/dist/components/VirtualizedFile.js +82 -21
  15. package/dist/components/VirtualizedFile.js.map +1 -1
  16. package/dist/components/VirtualizedFileDiff.d.ts +7 -2
  17. package/dist/components/VirtualizedFileDiff.d.ts.map +1 -1
  18. package/dist/components/VirtualizedFileDiff.js +77 -15
  19. package/dist/components/VirtualizedFileDiff.js.map +1 -1
  20. package/dist/components/VirtulizerDevelopment.d.ts.map +1 -1
  21. package/dist/constants.d.ts.map +1 -1
  22. package/dist/highlighter/themes/themeResolver.d.ts +4 -1
  23. package/dist/highlighter/themes/themeResolver.d.ts.map +1 -1
  24. package/dist/managers/InteractionManager.js +1 -1
  25. package/dist/managers/InteractionManager.js.map +1 -1
  26. package/dist/managers/ResizeManager.js +1 -1
  27. package/dist/managers/ResizeManager.js.map +1 -1
  28. package/dist/react/jsx.d.ts.map +1 -1
  29. package/dist/renderers/DiffHunksRenderer.d.ts +3 -2
  30. package/dist/renderers/DiffHunksRenderer.d.ts.map +1 -1
  31. package/dist/renderers/DiffHunksRenderer.js +49 -2
  32. package/dist/renderers/DiffHunksRenderer.js.map +1 -1
  33. package/dist/renderers/FileRenderer.js +12 -0
  34. package/dist/renderers/FileRenderer.js.map +1 -1
  35. package/dist/types.d.ts +8 -0
  36. package/dist/types.d.ts.map +1 -1
  37. package/dist/utils/includesFileAnnotations.d.ts +17 -0
  38. package/dist/utils/includesFileAnnotations.d.ts.map +1 -0
  39. package/dist/utils/includesFileAnnotations.js +19 -0
  40. package/dist/utils/includesFileAnnotations.js.map +1 -0
  41. package/dist/utils/parseMergeConflictDiffFromFile.js.map +1 -1
  42. package/dist/utils/renderDiffWithHighlighter.js +4 -2
  43. package/dist/utils/renderDiffWithHighlighter.js.map +1 -1
  44. package/dist/utils/renderFileWithHighlighter.js +4 -2
  45. package/dist/utils/renderFileWithHighlighter.js.map +1 -1
  46. package/dist/worker/{wasm-BaDzIkIn.js → wasm-qE0LgnY3.js} +2 -2
  47. package/dist/worker/{wasm-BaDzIkIn.js.map → wasm-qE0LgnY3.js.map} +1 -1
  48. package/dist/worker/worker-portable.js +991 -266
  49. package/dist/worker/worker-portable.js.map +1 -1
  50. package/dist/worker/worker.js +8 -4
  51. package/dist/worker/worker.js.map +1 -1
  52. package/package.json +4 -10
package/README.md CHANGED
@@ -36,11 +36,11 @@ Technically you can use the package manager of your choice, but we use
36
36
  # From the root of the mono repo: setup dependencies
37
37
  bun install
38
38
 
39
- # Start the demo vite test server from root
40
- bun run demo:dev
39
+ # Start the demo vite test server
40
+ moonx demo:dev
41
41
 
42
- # To run the docs from root
43
- bun run docs:dev
42
+ # To run the docs (diffs site)
43
+ moonx docs:dev-diffs
44
44
  ```
45
45
 
46
46
  ### Testing
@@ -53,7 +53,7 @@ bun test
53
53
  bun test --update-snapshots
54
54
 
55
55
  # Type checking
56
- bun run tsc
56
+ moonx diffs:typecheck
57
57
  ```
58
58
 
59
59
  Tests are located in the `test/` folder and use Bun's native testing framework
@@ -78,7 +78,7 @@ The diff UI uses an SVG sprite built from `@pierre/icons`. From the monorepo
78
78
  root:
79
79
 
80
80
  ```bash
81
- bun run icons:sprite
81
+ moonx root:icons
82
82
  ```
83
83
 
84
84
  This reads SVGs from `node_modules/@pierre/icons/svg` and writes
@@ -1618,8 +1618,8 @@ var CodeView = class CodeView {
1618
1618
  const item = this.items[index];
1619
1619
  if (item == null) throw new Error("CodeView.recomputeLayout: invalid item index");
1620
1620
  item.top = runningTop;
1621
- if (item.type === "diff") item.height = item.instance.prepareCodeViewItem(item.item.fileDiff, runningTop, reset);
1622
- else item.height = item.instance.prepareCodeViewItem(item.item.file, runningTop, reset);
1621
+ if (item.type === "diff") item.height = item.instance.prepareCodeViewItem(item.item.fileDiff, runningTop, reset, item.item.annotations ?? []);
1622
+ else item.height = item.instance.prepareCodeViewItem(item.item.file, runningTop, reset, item.item.annotations ?? []);
1623
1623
  runningTop += item.height;
1624
1624
  if (index < this.items.length - 1) runningTop += layout.gap;
1625
1625
  }
@@ -1640,8 +1640,8 @@ var CodeView = class CodeView {
1640
1640
  };
1641
1641
  function prepareItemInstance(item) {
1642
1642
  item.instance.cleanUp(true);
1643
- if (item.type === "diff") return item.instance.prepareCodeViewItem(item.item.fileDiff, item.top);
1644
- else return item.instance.prepareCodeViewItem(item.item.file, item.top);
1643
+ if (item.type === "diff") return item.instance.prepareCodeViewItem(item.item.fileDiff, item.top, void 0, item.item.annotations ?? []);
1644
+ else return item.instance.prepareCodeViewItem(item.item.file, item.top, void 0, item.item.annotations ?? []);
1645
1645
  }
1646
1646
  function shouldClearPool(previousOptions, nextOptions) {
1647
1647
  return !areThemesEqual(previousOptions.theme ?? DEFAULT_THEMES, nextOptions.theme ?? DEFAULT_THEMES) || (previousOptions.themeType ?? "system") !== (nextOptions.themeType ?? "system") || previousOptions.unsafeCSS !== nextOptions.unsafeCSS;
@@ -1671,14 +1671,14 @@ function renderItem(item, fileContainer, forceRender = false) {
1671
1671
  fileContainer,
1672
1672
  fileDiff: item.item.fileDiff,
1673
1673
  forceRender,
1674
- lineAnnotations: item.item.annotations
1674
+ lineAnnotations: item.item.annotations ?? []
1675
1675
  });
1676
1676
  else return item.instance.render({
1677
1677
  deferManagers: true,
1678
1678
  fileContainer,
1679
1679
  file: item.item.file,
1680
1680
  forceRender,
1681
- lineAnnotations: item.item.annotations
1681
+ lineAnnotations: item.item.annotations ?? []
1682
1682
  });
1683
1683
  }
1684
1684
  /**