@git-diff-view/react 0.0.25 → 0.0.26

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/index.d.ts CHANGED
@@ -61,8 +61,6 @@ export declare class DiffFile {
61
61
  fileLineLength: number;
62
62
  additionLength: number;
63
63
  deletionLength: number;
64
- hasExpandSplitAll: boolean;
65
- hasExpandUnifiedAll: boolean;
66
64
  hasSomeLineCollapsed: boolean;
67
65
  static createInstance(data: FileData_1, bundle?: ReturnType<DiffFile["getBundle"] | DiffFile["_getFullBundle"]>): DiffFile;
68
66
  static createInstance(data: FileData_2, bundle?: ReturnType<DiffFile["getBundle"] | DiffFile["_getFullBundle"]>): DiffFile;
@@ -87,7 +85,11 @@ export declare class DiffFile {
87
85
  getUnifiedHunkLine: (index: number) => DiffHunkItem;
88
86
  onUnifiedHunkExpand: (dir: "up" | "down" | "all", index: number, needTrigger?: boolean) => void;
89
87
  onAllExpand: (mode: "split" | "unified") => void;
88
+ get hasExpandSplitAll(): boolean;
89
+ get hasExpandUnifiedAll(): boolean;
90
90
  onAllCollapse: (mode: "split" | "unified") => void;
91
+ getOldFileContent: () => string;
92
+ getNewFileContent: () => string;
91
93
  getOldSyntaxLine: (lineNumber: number) => SyntaxLine;
92
94
  getNewSyntaxLine: (lineNumber: number) => SyntaxLine;
93
95
  subscribe: (listener: (() => void) & {
@@ -123,6 +125,12 @@ export declare class DiffFile {
123
125
  highlighterType: string;
124
126
  composeByDiff: boolean;
125
127
  hasSomeLineCollapsed: boolean;
128
+ hasExpandSplitAll: {
129
+ state: boolean;
130
+ };
131
+ hasExpandUnifiedAll: {
132
+ state: boolean;
133
+ };
126
134
  version: string;
127
135
  theme: "light" | "dark";
128
136
  isFullMerge: boolean;
@@ -166,6 +174,12 @@ export declare class DiffFile {
166
174
  highlighterType: string;
167
175
  composeByDiff: boolean;
168
176
  hasSomeLineCollapsed: boolean;
177
+ hasExpandSplitAll: {
178
+ state: boolean;
179
+ };
180
+ hasExpandUnifiedAll: {
181
+ state: boolean;
182
+ };
169
183
  version: string;
170
184
  theme: "light" | "dark";
171
185
  };
@@ -726,17 +740,17 @@ export type DiffViewProps_2<T> = Omit<DiffViewProps<T>, "data"> & {
726
740
  hunks: string[];
727
741
  };
728
742
  };
729
- declare function _DiffView<T>(props: DiffViewProps_1<T> & {
743
+ declare function ReactDiffView<T>(props: DiffViewProps_1<T> & {
730
744
  ref?: ForwardedRef<{
731
745
  getDiffFileInstance: () => DiffFile;
732
746
  }>;
733
- }): ReactNode;
734
- declare function _DiffView<T>(props: DiffViewProps_2<T> & {
747
+ }): JSX.Element;
748
+ declare function ReactDiffView<T>(props: DiffViewProps_2<T> & {
735
749
  ref?: ForwardedRef<{
736
750
  getDiffFileInstance: () => DiffFile;
737
751
  }>;
738
- }): ReactNode;
739
- export declare const DiffView: typeof _DiffView;
752
+ }): JSX.Element;
753
+ export declare const DiffView: typeof ReactDiffView;
740
754
  export declare const version: string;
741
755
 
742
756
  export {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "@git-diff-view/react",
4
4
  "author": "MrWangJustToDo",
5
5
  "license": "MIT",
6
- "version": "0.0.25",
6
+ "version": "0.0.26",
7
7
  "main": "index.js",
8
8
  "types": "index.d.ts",
9
9
  "files": [
@@ -60,7 +60,7 @@
60
60
  "react diff component"
61
61
  ],
62
62
  "dependencies": {
63
- "@git-diff-view/core": "^0.0.25",
63
+ "@git-diff-view/core": "^0.0.26",
64
64
  "@types/hast": "^3.0.0",
65
65
  "fast-diff": "^1.3.0",
66
66
  "highlight.js": "^11.11.0",
@@ -71,13 +71,13 @@
71
71
  "devDependencies": {
72
72
  "@types/use-sync-external-store": "^0.0.6",
73
73
  "autoprefixer": "^10.4.20",
74
- "postcss": "^8.4.47",
74
+ "postcss": "^8.5.1",
75
75
  "react": "^18.0.0",
76
- "tailwindcss": "^3.4.14"
76
+ "tailwindcss": "^3.4.17"
77
77
  },
78
78
  "peerDependencies": {
79
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
80
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
79
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
80
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
81
81
  },
82
82
  "scripts": {
83
83
  "gen:type": "dts-bundle-generator -o index.d.ts dist/types/index.d.ts",
@@ -255,7 +255,7 @@
255
255
  }
256
256
  .diff-tailwindcss-wrapper .\!text-red-500 {
257
257
  --tw-text-opacity: 1 !important;
258
- color: rgb(239 68 68 / var(--tw-text-opacity)) !important;
258
+ color: rgb(239 68 68 / var(--tw-text-opacity, 1)) !important;
259
259
  }
260
260
  .diff-tailwindcss-wrapper .opacity-\[0\.5\] {
261
261
  opacity: 0.5;
@@ -105,7 +105,7 @@
105
105
  --tw-contain-paint: ;
106
106
  --tw-contain-style: ;
107
107
  }/*
108
- ! tailwindcss v3.4.14 | MIT License | https://tailwindcss.com
108
+ ! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com
109
109
  *//*
110
110
  1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
111
111
  2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
@@ -761,7 +761,7 @@ video {
761
761
  }
762
762
  .diff-tailwindcss-wrapper .\!text-red-500 {
763
763
  --tw-text-opacity: 1 !important;
764
- color: rgb(239 68 68 / var(--tw-text-opacity)) !important;
764
+ color: rgb(239 68 68 / var(--tw-text-opacity, 1)) !important;
765
765
  }
766
766
  .diff-tailwindcss-wrapper .opacity-\[0\.5\] {
767
767
  opacity: 0.5;