Socket
Socket
Sign inDemoInstall

react-diff-viewer-continued

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-diff-viewer-continued - npm Package Compare versions

Comparing version 3.3.2 to 3.4.0

7

CHANGELOG.md

@@ -0,1 +1,8 @@

# [3.4.0](https://github.com/aeolun/react-diff-viewer-continued/compare/v3.3.2...v3.4.0) (2024-01-31)
### Features
* add `hideMarkers` ([#37](https://github.com/aeolun/react-diff-viewer-continued/issues/37)) ([c004629](https://github.com/aeolun/react-diff-viewer-continued/commit/c00462912344d441a1d491313230064eb096a6a7))
## [3.3.2](https://github.com/aeolun/react-diff-viewer-continued/compare/v3.3.1...v3.3.2) (2024-01-31)

@@ -2,0 +9,0 @@

1

lib/src/index.d.ts

@@ -18,2 +18,3 @@ import * as React from 'react';

hideLineNumbers?: boolean;
hideMarkers?: boolean;
/**

@@ -20,0 +21,0 @@ * Show the lines indicated here. Specified as L20 or R18 for respectively line 20 on the left or line 18 on the right.

17

lib/src/index.js

@@ -158,3 +158,3 @@ "use strict";

})
: null, (0, jsx_runtime_1.jsx)("td", { className: (0, classnames_1.default)(this.styles.marker, {
: null, !this.props.hideMarkers && ((0, jsx_runtime_1.jsx)("td", { className: (0, classnames_1.default)(this.styles.marker, {
[this.styles.emptyLine]: !content,

@@ -165,3 +165,3 @@ [this.styles.diffAdded]: added,

[this.styles.highlightedLine]: highlightLine,
}), children: (0, jsx_runtime_1.jsxs)("pre", { children: [added && '+', removed && '-'] }) }), (0, jsx_runtime_1.jsx)("td", { className: (0, classnames_1.default)(this.styles.content, {
}), children: (0, jsx_runtime_1.jsxs)("pre", { children: [added && '+', removed && '-'] }) })), (0, jsx_runtime_1.jsx)("td", { className: (0, classnames_1.default)(this.styles.content, {
[this.styles.emptyLine]: !content,

@@ -263,3 +263,3 @@ [this.styles.diffAdded]: added,

this.render = () => {
const { oldValue, newValue, useDarkTheme, leftTitle, rightTitle, splitView, hideLineNumbers, nonce, } = this.props;
const { oldValue, newValue, useDarkTheme, leftTitle, rightTitle, splitView, hideLineNumbers, hideMarkers, nonce, } = this.props;
if (this.props.compareMethod !== compute_lines_1.DiffMethod.JSON) {

@@ -272,5 +272,9 @@ if (typeof oldValue !== 'string' || typeof newValue !== 'string') {

const nodes = this.renderDiff();
const colSpanOnSplitView = hideLineNumbers ? 2 : 3;
const colSpanOnInlineView = hideLineNumbers ? 2 : 4;
let columnExtension = this.props.renderGutter ? 1 : 0;
let colSpanOnSplitView = hideLineNumbers ? 2 : 3;
let colSpanOnInlineView = hideLineNumbers ? 2 : 4;
if (hideMarkers) {
colSpanOnSplitView -= 1;
colSpanOnInlineView -= 1;
}
const columnExtension = this.props.renderGutter ? 1 : 0;
const title = (leftTitle || rightTitle) && ((0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("td", { colSpan: (splitView ? colSpanOnSplitView : colSpanOnInlineView) +

@@ -296,2 +300,3 @@ columnExtension, className: this.styles.titleBlock, children: (0, jsx_runtime_1.jsx)("pre", { className: this.styles.contentText, children: leftTitle }) }), splitView && ((0, jsx_runtime_1.jsx)("td", { colSpan: colSpanOnSplitView + columnExtension, className: this.styles.titleBlock, children: (0, jsx_runtime_1.jsx)("pre", { className: this.styles.contentText, children: rightTitle }) }))] }));

hideLineNumbers: false,
hideMarkers: false,
extraLinesSurroundingDiff: 3,

@@ -298,0 +303,0 @@ showDiffOnly: true,

{
"name": "react-diff-viewer-continued",
"version": "3.3.2",
"version": "3.4.0",
"private": false,

@@ -5,0 +5,0 @@ "description": "Continuation of a simple and beautiful text diff viewer component made with diff and React",

@@ -79,3 +79,4 @@ <img src='https://github.com/Aeolun/react-diff-viewer-continued/raw/master/logo_dark.png' width="100%" alt='React Diff Viewer' />

| hideLineNumbers | `boolean` | `false` | Show and hide line numbers. |
| alwaysShowLines | `string[]` | `[]` | List of lines to always be shown, regardless of diff status. Line number are prefixed with `L` and `R` for the left and right section of the diff viewer, respectively. For example, `L-20` means 20th line in the left pane. `extraLinesSurroundingDiff` applies to these lines as well. |
| hideMarkers | `boolean` | `false` | Show and hide `+`/`-` markers. |
| alwaysShowLines | `string[]` | `[]` | List of lines to always be shown, regardless of diff status. Line number are prefixed with `L` and `R` for the left and right section of the diff viewer, respectively. For example, `L-20` means 20th line in the left pane. `extraLinesSurroundingDiff` applies to these lines as well. |
| renderContent | `function` | `undefined` | Render Prop API to render code in the diff viewer. Helpful for [syntax highlighting](#syntax-highlighting) |

@@ -82,0 +83,0 @@ | onLineNumberClick | `function` | `undefined` | Event handler for line number click. `(lineId: string) => void` |

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc