react-diff-viewer-continued 4.1.3 → 4.2.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.2.0 (2026-03-10)
4
+
5
+ ### Features
6
+
7
+ - export computeStyles and add missing style override properties
8
+
9
+ ### Bug Fixes
10
+
11
+ - add .js extensions to relative imports for Node.js ESM compatibility
12
+
3
13
  ## 4.1.3 (2026-02-07)
4
14
 
5
15
  ### Bug Fixes
@@ -1,4 +1,4 @@
1
- import { type LineInformation } from "./compute-lines";
1
+ import { type LineInformation } from "./compute-lines.js";
2
2
  export interface Block {
3
3
  index: number;
4
4
  startLine: number;
@@ -503,7 +503,7 @@ const computeLineInformation = (oldString, newString, disableWordDiff = false, l
503
503
  * @returns Promise<ComputedLineInformation> - Resolves with line-by-line diff data from the worker.
504
504
  */
505
505
  // Import the bundled worker code (generated by scripts/build-worker.js)
506
- import { WORKER_CODE } from './workerBundle';
506
+ import { WORKER_CODE } from './workerBundle.js';
507
507
  // Cached Blob URL for the worker - created once and reused
508
508
  let workerBlobUrl = null;
509
509
  let workerAvailable = null;
@@ -1,4 +1,4 @@
1
- import { computeLineInformation } from "./compute-lines";
1
+ import { computeLineInformation } from "./compute-lines.js";
2
2
  /**
3
3
  * This sets up a message handler inside the Web Worker.
4
4
  * When the main thread sends a message to this worker (via postMessage), this function is triggered.
@@ -248,4 +248,5 @@ declare class DiffViewer extends React.Component<ReactDiffViewerProps, ReactDiff
248
248
  }
249
249
  export default DiffViewer;
250
250
  export { DiffMethod };
251
- export type { ReactDiffViewerStylesOverride };
251
+ export { default as computeStyles } from "./styles.js";
252
+ export type { ReactDiffViewerStylesOverride, ReactDiffViewerStyles };
@@ -1004,3 +1004,4 @@ DiffViewer.defaultProps = {
1004
1004
  DiffViewer.ESTIMATED_ROW_HEIGHT = 19;
1005
1005
  export default DiffViewer;
1006
1006
  export { DiffMethod };
1007
+ export { default as computeStyles } from "./styles.js";
@@ -76,12 +76,14 @@ export interface ReactDiffViewerStylesOverride {
76
76
  highlightedGutter?: Interpolation;
77
77
  contentText?: Interpolation;
78
78
  gutter?: Interpolation;
79
+ lineContent?: Interpolation;
79
80
  line?: Interpolation;
80
81
  wordDiff?: Interpolation;
81
82
  wordAdded?: Interpolation;
82
83
  wordRemoved?: Interpolation;
83
84
  codeFoldGutter?: Interpolation;
84
85
  codeFoldExpandButton?: Interpolation;
86
+ summary?: Interpolation;
85
87
  codeFoldContentContainer?: Interpolation;
86
88
  codeFold?: Interpolation;
87
89
  emptyLine?: Interpolation;
@@ -503,7 +503,7 @@ const computeLineInformation = (oldString, newString, disableWordDiff = false, l
503
503
  * @returns Promise<ComputedLineInformation> - Resolves with line-by-line diff data from the worker.
504
504
  */
505
505
  // Import the bundled worker code (generated by scripts/build-worker.js)
506
- import { WORKER_CODE } from './workerBundle';
506
+ import { WORKER_CODE } from './workerBundle.js';
507
507
  // Cached Blob URL for the worker - created once and reused
508
508
  let workerBlobUrl = null;
509
509
  let workerAvailable = null;
@@ -1,4 +1,4 @@
1
- import { computeLineInformation } from "./compute-lines";
1
+ import { computeLineInformation } from "./compute-lines.js";
2
2
  /**
3
3
  * This sets up a message handler inside the Web Worker.
4
4
  * When the main thread sends a message to this worker (via postMessage), this function is triggered.
@@ -1003,3 +1003,4 @@ class DiffViewer extends React.Component {
1003
1003
  }
1004
1004
  export default DiffViewer;
1005
1005
  export { DiffMethod };
1006
+ export { default as computeStyles } from "./styles.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-diff-viewer-continued",
3
- "version": "4.1.3",
3
+ "version": "4.2.0",
4
4
  "private": false,
5
5
  "description": "Continuation of a simple and beautiful text diff viewer component made with diff and React",
6
6
  "keywords": [
@@ -18,7 +18,7 @@ const srcDir = path.join(__dirname, '..', 'src');
18
18
  const stubWorkerBundlePlugin = {
19
19
  name: 'stub-worker-bundle',
20
20
  setup(build) {
21
- build.onResolve({ filter: /\.\/workerBundle$/ }, () => ({
21
+ build.onResolve({ filter: /\.\/workerBundle(\.js)?$/ }, () => ({
22
22
  path: 'workerBundle-stub',
23
23
  namespace: 'stub',
24
24
  }));