@git-diff-view/react 0.0.37 → 0.0.39
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/dist/cjs/index.development.js +12 -11
- package/dist/cjs/index.development.js.map +1 -1
- package/dist/cjs/index.production.js +12 -11
- package/dist/cjs/index.production.js.map +1 -1
- package/dist/esm/index.mjs +13 -12
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/DiffView.tsx +12 -11
package/dist/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { SplitSide, DiffLineType, getSyntaxDiffTemplate, getSyntaxLineTemplate, getPlainDiffTemplate, getPlainLineTemplate, checkDiffLineIncludeChange, composeLen, getSplitContentLines, getUnifiedContentLine, _cacheMap, DiffFile
|
|
2
|
+
import { SplitSide, DiffLineType, getSyntaxDiffTemplate, getSyntaxLineTemplate, getPlainDiffTemplate, getPlainLineTemplate, checkDiffLineIncludeChange, composeLen, getSplitContentLines, getUnifiedContentLine, _cacheMap, DiffFile } from '@git-diff-view/core';
|
|
3
3
|
export * from '@git-diff-view/core';
|
|
4
4
|
export { SplitSide } from '@git-diff-view/core';
|
|
5
5
|
import * as React from 'react';
|
|
@@ -1787,7 +1787,7 @@ const InternalDiffView = (props) => {
|
|
|
1787
1787
|
}, [useDiffContext, wrapperRef]);
|
|
1788
1788
|
const value = useMemo(() => ({ useDiffContext }), [useDiffContext]);
|
|
1789
1789
|
return (React.createElement(DiffViewContext.Provider, { value: value },
|
|
1790
|
-
React.createElement("div", { className: "diff-tailwindcss-wrapper", "data-component": "git-diff-view", "data-theme": diffFile._getTheme() || "light", "data-version": "0.0.
|
|
1790
|
+
React.createElement("div", { className: "diff-tailwindcss-wrapper", "data-component": "git-diff-view", "data-theme": diffFile._getTheme() || "light", "data-version": "0.0.39", "data-highlighter": diffFile._getHighlighterName(), ref: wrapperRef },
|
|
1791
1791
|
React.createElement("div", { className: "diff-style-root", style: {
|
|
1792
1792
|
// @ts-ignore
|
|
1793
1793
|
[diffFontSizeName]: diffViewFontSize + "px",
|
|
@@ -1840,16 +1840,17 @@ const DiffViewWithRef = (props, ref) => {
|
|
|
1840
1840
|
if (!diffFile)
|
|
1841
1841
|
return;
|
|
1842
1842
|
if (props.diffViewHighlight) {
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
}
|
|
1849
|
-
else {
|
|
1850
|
-
diffFile.initSyntax({ registerHighlighter: finalHighlighter });
|
|
1851
|
-
if (finalHighlighter.type !== "class")
|
|
1843
|
+
if (registerHighlighter) {
|
|
1844
|
+
if (registerHighlighter.name !== diffFile._getHighlighterName() ||
|
|
1845
|
+
registerHighlighter.type !== diffFile._getHighlighterType() ||
|
|
1846
|
+
registerHighlighter.type !== "class") {
|
|
1847
|
+
diffFile.initSyntax({ registerHighlighter: registerHighlighter });
|
|
1852
1848
|
diffFile.notifyAll();
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
else if (diffFile._getHighlighterType() !== "class") {
|
|
1852
|
+
diffFile.initSyntax();
|
|
1853
|
+
diffFile.notifyAll();
|
|
1853
1854
|
}
|
|
1854
1855
|
}
|
|
1855
1856
|
}, [diffFile, props.diffViewHighlight, registerHighlighter, diffViewTheme]);
|
|
@@ -1875,7 +1876,7 @@ const DiffViewWithRef = (props, ref) => {
|
|
|
1875
1876
|
const InnerDiffView = forwardRef(DiffViewWithRef);
|
|
1876
1877
|
InnerDiffView.displayName = "DiffView";
|
|
1877
1878
|
const DiffView = InnerDiffView;
|
|
1878
|
-
const version = "0.0.
|
|
1879
|
+
const version = "0.0.39";
|
|
1879
1880
|
|
|
1880
1881
|
export { DiffModeEnum, DiffView, version };
|
|
1881
1882
|
//# sourceMappingURL=index.mjs.map
|