@git-diff-view/react 0.0.33 → 0.0.35

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.
@@ -215,11 +215,12 @@ const getElementRoot = (element) => {
215
215
  return document;
216
216
  };
217
217
  const getDiffIdFromElement = (element) => {
218
+ var _a, _b;
218
219
  if (element) {
219
220
  if (typeof element.closest === "function") {
220
221
  const diffRoot = element.closest('[data-component="git-diff-view"]');
221
- const ele = diffRoot.querySelector(".diff-view-wrapper");
222
- return ele.getAttribute("id");
222
+ const ele = (_a = diffRoot === null || diffRoot === void 0 ? void 0 : diffRoot.querySelector) === null || _a === void 0 ? void 0 : _a.call(diffRoot, ".diff-view-wrapper");
223
+ return (_b = ele === null || ele === void 0 ? void 0 : ele.getAttribute) === null || _b === void 0 ? void 0 : _b.call(ele, "id");
223
224
  }
224
225
  else {
225
226
  let el = element;
@@ -783,8 +784,8 @@ const InternalDiffSplitHunkLineGitLab = ({ index, diffFile, side, lineNumber, })
783
784
  const expandEnabled = diffFile.getExpandEnabled();
784
785
  useSyncHeight({
785
786
  selector: `tr[data-line="${lineNumber}-hunk"]`,
786
- side: core.SplitSide[side],
787
- enable: true,
787
+ side: core.SplitSide[core.SplitSide.old],
788
+ enable: side === core.SplitSide.new,
788
789
  });
789
790
  const couldExpand = expandEnabled && currentHunk && currentHunk.splitInfo;
790
791
  const isExpandAll = currentHunk &&
@@ -1583,7 +1584,7 @@ const InternalDiffUnifiedExtendLine = ({ index, diffFile, lineNumber, enableWrap
1583
1584
  // TODO use css variable to get width
1584
1585
  const width = useDomWidth({
1585
1586
  selector: ".unified-diff-table-wrapper",
1586
- enable: typeof renderExtendLine === "function" && !enableWrap,
1587
+ enable: typeof renderExtendLine === "function",
1587
1588
  });
1588
1589
  if (!renderExtendLine)
1589
1590
  return null;
@@ -1686,7 +1687,7 @@ const InternalDiffUnifiedWidgetLine = ({ index, diffFile, lineNumber, enableWrap
1686
1687
  const renderWidgetLine = useDiffContext.useShallowStableSelector((s) => s.renderWidgetLine);
1687
1688
  const width = useDomWidth({
1688
1689
  selector: ".unified-diff-table-wrapper",
1689
- enable: typeof renderWidgetLine === "function" && !enableWrap,
1690
+ enable: typeof renderWidgetLine === "function",
1690
1691
  });
1691
1692
  if (!renderWidgetLine)
1692
1693
  return null;
@@ -1886,7 +1887,7 @@ const InternalDiffView = (props) => {
1886
1887
  }, [useDiffContext, wrapperRef]);
1887
1888
  const value = React.useMemo(() => ({ useDiffContext }), [useDiffContext]);
1888
1889
  return (React__namespace.createElement(DiffViewContext.Provider, { value: value },
1889
- React__namespace.createElement("div", { className: "diff-tailwindcss-wrapper", "data-component": "git-diff-view", "data-theme": diffFile._getTheme() || "light", "data-version": "0.0.33", "data-highlighter": diffFile._getHighlighterName(), ref: wrapperRef },
1890
+ React__namespace.createElement("div", { className: "diff-tailwindcss-wrapper", "data-component": "git-diff-view", "data-theme": diffFile._getTheme() || "light", "data-version": "0.0.35", "data-highlighter": diffFile._getHighlighterName(), ref: wrapperRef },
1890
1891
  React__namespace.createElement("div", { className: "diff-style-root", style: {
1891
1892
  // @ts-ignore
1892
1893
  [diffFontSizeName]: diffViewFontSize + "px",
@@ -1965,7 +1966,7 @@ const DiffViewWithRef = (props, ref) => {
1965
1966
  const InnerDiffView = React.forwardRef(DiffViewWithRef);
1966
1967
  InnerDiffView.displayName = "DiffView";
1967
1968
  const DiffView = InnerDiffView;
1968
- const version = "0.0.33";
1969
+ const version = "0.0.35";
1969
1970
 
1970
1971
  Object.defineProperty(exports, "SplitSide", {
1971
1972
  enumerable: true,