@pierre/diffs 1.1.0-beta.15 → 1.1.0-beta.17
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/components/AdvancedVirtualizedFileDiff.js +2 -7
- package/dist/components/AdvancedVirtualizedFileDiff.js.map +1 -1
- package/dist/components/File.d.ts +14 -2
- package/dist/components/File.d.ts.map +1 -1
- package/dist/components/File.js +89 -23
- package/dist/components/File.js.map +1 -1
- package/dist/components/FileDiff.d.ts +15 -3
- package/dist/components/FileDiff.d.ts.map +1 -1
- package/dist/components/FileDiff.js +101 -23
- package/dist/components/FileDiff.js.map +1 -1
- package/dist/components/VirtualizedFile.js +4 -2
- package/dist/components/VirtualizedFile.js.map +1 -1
- package/dist/components/VirtualizedFileDiff.js +4 -2
- package/dist/components/VirtualizedFileDiff.js.map +1 -1
- package/dist/components/Virtualizer.js +2 -1
- package/dist/components/Virtualizer.js.map +1 -1
- package/dist/components/VirtulizerDevelopment.d.ts.map +1 -1
- package/dist/constants.d.ts +3 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +8 -1
- package/dist/constants.js.map +1 -1
- package/dist/highlighter/shared_highlighter.js +12 -4
- package/dist/highlighter/shared_highlighter.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +5 -4
- package/dist/managers/MouseEventManager.d.ts +20 -5
- package/dist/managers/MouseEventManager.d.ts.map +1 -1
- package/dist/managers/MouseEventManager.js +91 -25
- package/dist/managers/MouseEventManager.js.map +1 -1
- package/dist/react/File.d.ts +2 -0
- package/dist/react/File.d.ts.map +1 -1
- package/dist/react/File.js +3 -1
- package/dist/react/File.js.map +1 -1
- package/dist/react/FileDiff.d.ts +2 -0
- package/dist/react/FileDiff.d.ts.map +1 -1
- package/dist/react/FileDiff.js +3 -1
- package/dist/react/FileDiff.js.map +1 -1
- package/dist/react/MultiFileDiff.d.ts +2 -0
- package/dist/react/MultiFileDiff.d.ts.map +1 -1
- package/dist/react/MultiFileDiff.js +3 -1
- package/dist/react/MultiFileDiff.js.map +1 -1
- package/dist/react/PatchDiff.d.ts +2 -0
- package/dist/react/PatchDiff.d.ts.map +1 -1
- package/dist/react/PatchDiff.js +3 -1
- package/dist/react/PatchDiff.js.map +1 -1
- package/dist/react/constants.d.ts +2 -2
- package/dist/react/constants.d.ts.map +1 -1
- package/dist/react/constants.js +2 -2
- package/dist/react/constants.js.map +1 -1
- package/dist/react/index.d.ts +3 -3
- package/dist/react/index.js +2 -2
- package/dist/react/jsx.d.ts +1 -0
- package/dist/react/jsx.d.ts.map +1 -1
- package/dist/react/types.d.ts +10 -0
- package/dist/react/types.d.ts.map +1 -1
- package/dist/react/types.js +1 -0
- package/dist/react/utils/renderDiffChildren.d.ts +4 -0
- package/dist/react/utils/renderDiffChildren.d.ts.map +1 -1
- package/dist/react/utils/renderDiffChildren.js +17 -7
- package/dist/react/utils/renderDiffChildren.js.map +1 -1
- package/dist/react/utils/renderFileChildren.d.ts +4 -0
- package/dist/react/utils/renderFileChildren.d.ts.map +1 -1
- package/dist/react/utils/renderFileChildren.js +13 -7
- package/dist/react/utils/renderFileChildren.js.map +1 -1
- package/dist/renderers/DiffHunksRenderer.js +3 -2
- package/dist/renderers/DiffHunksRenderer.js.map +1 -1
- package/dist/renderers/FileRenderer.js +1 -1
- package/dist/sprite.d.ts +2 -2
- package/dist/sprite.d.ts.map +1 -1
- package/dist/sprite.js +3 -0
- package/dist/sprite.js.map +1 -1
- package/dist/ssr/index.d.ts +2 -2
- package/dist/style.js +1 -1
- package/dist/style.js.map +1 -1
- package/dist/types.d.ts +3 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/createFileHeaderElement.js +5 -2
- package/dist/utils/createFileHeaderElement.js.map +1 -1
- package/dist/utils/createGutterUtilityContentNode.d.ts +5 -0
- package/dist/utils/createGutterUtilityContentNode.d.ts.map +1 -0
- package/dist/utils/createGutterUtilityContentNode.js +15 -0
- package/dist/utils/createGutterUtilityContentNode.js.map +1 -0
- package/dist/utils/createGutterUtilityElement.d.ts +7 -0
- package/dist/utils/createGutterUtilityElement.d.ts.map +1 -0
- package/dist/utils/createGutterUtilityElement.js +20 -0
- package/dist/utils/createGutterUtilityElement.js.map +1 -0
- package/dist/utils/hast_utils.d.ts +1 -1
- package/dist/utils/hast_utils.d.ts.map +1 -1
- package/dist/utils/hast_utils.js.map +1 -1
- package/dist/worker/WorkerPoolManager.d.ts +1 -1
- package/dist/worker/WorkerPoolManager.d.ts.map +1 -1
- package/dist/worker/WorkerPoolManager.js +8 -6
- package/dist/worker/WorkerPoolManager.js.map +1 -1
- package/dist/worker/worker-portable.js +7 -0
- package/dist/worker/worker-portable.js.map +1 -1
- package/dist/worker/worker.js.map +1 -1
- package/package.json +2 -1
- package/dist/themes/pierre-dark.js +0 -1328
- package/dist/themes/pierre-dark.js.map +0 -1
- package/dist/themes/pierre-light.js +0 -1328
- package/dist/themes/pierre-light.js.map +0 -1
- package/dist/utils/createHoverContentNode.d.ts +0 -5
- package/dist/utils/createHoverContentNode.d.ts.map +0 -1
- package/dist/utils/createHoverContentNode.js +0 -15
- package/dist/utils/createHoverContentNode.js.map +0 -1
|
@@ -8,7 +8,7 @@ import { useFileDiffInstance } from "./utils/useFileDiffInstance.js";
|
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
|
|
10
10
|
//#region src/react/MultiFileDiff.tsx
|
|
11
|
-
function MultiFileDiff({ oldFile, newFile, options, metrics, lineAnnotations, selectedLines, className, style, prerenderedHTML, renderAnnotation, renderHeaderMetadata, renderHoverUtility }) {
|
|
11
|
+
function MultiFileDiff({ oldFile, newFile, options, metrics, lineAnnotations, selectedLines, className, style, prerenderedHTML, renderAnnotation, renderHeaderPrefix, renderHeaderMetadata, renderGutterUtility, renderHoverUtility }) {
|
|
12
12
|
const { ref, getHoveredLine } = useFileDiffInstance({
|
|
13
13
|
oldFile,
|
|
14
14
|
newFile,
|
|
@@ -25,9 +25,11 @@ function MultiFileDiff({ oldFile, newFile, options, metrics, lineAnnotations, se
|
|
|
25
25
|
children: templateRender(renderDiffChildren({
|
|
26
26
|
deletionFile: oldFile,
|
|
27
27
|
additionFile: newFile,
|
|
28
|
+
renderHeaderPrefix,
|
|
28
29
|
renderHeaderMetadata,
|
|
29
30
|
renderAnnotation,
|
|
30
31
|
lineAnnotations,
|
|
32
|
+
renderGutterUtility,
|
|
31
33
|
renderHoverUtility,
|
|
32
34
|
getHoveredLine
|
|
33
35
|
}), prerenderedHTML)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiFileDiff.js","names":[],"sources":["../../src/react/MultiFileDiff.tsx"],"sourcesContent":["'use client';\n\nimport { DIFFS_TAG_NAME } from '../constants';\nimport type { FileContents } from '../types';\nimport type { DiffBasePropsReact } from './types';\nimport { renderDiffChildren } from './utils/renderDiffChildren';\nimport { templateRender } from './utils/templateRender';\nimport { useFileDiffInstance } from './utils/useFileDiffInstance';\n\nexport type { FileContents };\n\nexport interface MultiFileDiffProps<\n LAnnotation,\n> extends DiffBasePropsReact<LAnnotation> {\n oldFile: FileContents;\n newFile: FileContents;\n}\n\nexport function MultiFileDiff<LAnnotation = undefined>({\n oldFile,\n newFile,\n options,\n metrics,\n lineAnnotations,\n selectedLines,\n className,\n style,\n prerenderedHTML,\n renderAnnotation,\n renderHeaderMetadata,\n renderHoverUtility,\n}: MultiFileDiffProps<LAnnotation>): React.JSX.Element {\n const { ref, getHoveredLine } = useFileDiffInstance({\n oldFile,\n newFile,\n options,\n metrics,\n lineAnnotations,\n selectedLines,\n prerenderedHTML,\n });\n const children = renderDiffChildren({\n deletionFile: oldFile,\n additionFile: newFile,\n renderHeaderMetadata,\n renderAnnotation,\n lineAnnotations,\n renderHoverUtility,\n getHoveredLine,\n });\n return (\n <DIFFS_TAG_NAME ref={ref} className={className} style={style}>\n {templateRender(children, prerenderedHTML)}\n </DIFFS_TAG_NAME>\n );\n}\n"],"mappings":";;;;;;;;;;AAkBA,SAAgB,cAAuC,EACrD,SACA,SACA,SACA,SACA,iBACA,eACA,WACA,OACA,iBACA,kBACA,sBACA,sBACqD;CACrD,MAAM,EAAE,KAAK,mBAAmB,oBAAoB;EAClD;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;
|
|
1
|
+
{"version":3,"file":"MultiFileDiff.js","names":[],"sources":["../../src/react/MultiFileDiff.tsx"],"sourcesContent":["'use client';\n\nimport { DIFFS_TAG_NAME } from '../constants';\nimport type { FileContents } from '../types';\nimport type { DiffBasePropsReact } from './types';\nimport { renderDiffChildren } from './utils/renderDiffChildren';\nimport { templateRender } from './utils/templateRender';\nimport { useFileDiffInstance } from './utils/useFileDiffInstance';\n\nexport type { FileContents };\n\nexport interface MultiFileDiffProps<\n LAnnotation,\n> extends DiffBasePropsReact<LAnnotation> {\n oldFile: FileContents;\n newFile: FileContents;\n}\n\nexport function MultiFileDiff<LAnnotation = undefined>({\n oldFile,\n newFile,\n options,\n metrics,\n lineAnnotations,\n selectedLines,\n className,\n style,\n prerenderedHTML,\n renderAnnotation,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderGutterUtility,\n renderHoverUtility,\n}: MultiFileDiffProps<LAnnotation>): React.JSX.Element {\n const { ref, getHoveredLine } = useFileDiffInstance({\n oldFile,\n newFile,\n options,\n metrics,\n lineAnnotations,\n selectedLines,\n prerenderedHTML,\n });\n const children = renderDiffChildren({\n deletionFile: oldFile,\n additionFile: newFile,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderAnnotation,\n lineAnnotations,\n renderGutterUtility,\n renderHoverUtility,\n getHoveredLine,\n });\n return (\n <DIFFS_TAG_NAME ref={ref} className={className} style={style}>\n {templateRender(children, prerenderedHTML)}\n </DIFFS_TAG_NAME>\n );\n}\n"],"mappings":";;;;;;;;;;AAkBA,SAAgB,cAAuC,EACrD,SACA,SACA,SACA,SACA,iBACA,eACA,WACA,OACA,iBACA,kBACA,oBACA,sBACA,qBACA,sBACqD;CACrD,MAAM,EAAE,KAAK,mBAAmB,oBAAoB;EAClD;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAYF,QACE,oBAAC;EAAoB;EAAgB;EAAkB;YACpD,eAbY,mBAAmB;GAClC,cAAc;GACd,cAAc;GACd;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC,EAG4B,gBAAgB;GAC3B"}
|
|
@@ -14,7 +14,9 @@ declare function PatchDiff<LAnnotation = undefined>({
|
|
|
14
14
|
style,
|
|
15
15
|
prerenderedHTML,
|
|
16
16
|
renderAnnotation,
|
|
17
|
+
renderHeaderPrefix,
|
|
17
18
|
renderHeaderMetadata,
|
|
19
|
+
renderGutterUtility,
|
|
18
20
|
renderHoverUtility
|
|
19
21
|
}: PatchDiffProps<LAnnotation>): React.JSX.Element;
|
|
20
22
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PatchDiff.d.ts","names":["DiffBasePropsReact","PatchDiffProps","LAnnotation","PatchDiff","patch","options","metrics","lineAnnotations","selectedLines","className","style","prerenderedHTML","renderAnnotation","renderHeaderMetadata","renderHoverUtility","React","JSX","Element"],"sources":["../../src/react/PatchDiff.d.ts"],"sourcesContent":["import type { DiffBasePropsReact } from './types';\nexport interface PatchDiffProps<LAnnotation> extends DiffBasePropsReact<LAnnotation> {\n patch: string;\n}\nexport declare function PatchDiff<LAnnotation = undefined>({ patch, options, metrics, lineAnnotations, selectedLines, className, style, prerenderedHTML, renderAnnotation, renderHeaderMetadata, renderHoverUtility }: PatchDiffProps<LAnnotation>): React.JSX.Element;\n//# sourceMappingURL=PatchDiff.d.ts.map"],"mappings":";;;UACiBC,oCAAoCD,mBAAmBE;;AAAxE;AAGwBC,iBAAAA,SAASD,CAAAA,cAAA,SAAA,CAAA,CAAA;EAAA,KAAA;EAAA,OAAA;EAAA,OAAA;EAAA,eAAA;EAAA,aAAA;EAAA,SAAA;EAAA,KAAA;EAAA,eAAA;EAAA,gBAAA;EAAA,oBAAA;EAAA;AAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"PatchDiff.d.ts","names":["DiffBasePropsReact","PatchDiffProps","LAnnotation","PatchDiff","patch","options","metrics","lineAnnotations","selectedLines","className","style","prerenderedHTML","renderAnnotation","renderHeaderPrefix","renderHeaderMetadata","renderGutterUtility","renderHoverUtility","React","JSX","Element"],"sources":["../../src/react/PatchDiff.d.ts"],"sourcesContent":["import type { DiffBasePropsReact } from './types';\nexport interface PatchDiffProps<LAnnotation> extends DiffBasePropsReact<LAnnotation> {\n patch: string;\n}\nexport declare function PatchDiff<LAnnotation = undefined>({ patch, options, metrics, lineAnnotations, selectedLines, className, style, prerenderedHTML, renderAnnotation, renderHeaderPrefix, renderHeaderMetadata, renderGutterUtility, renderHoverUtility }: PatchDiffProps<LAnnotation>): React.JSX.Element;\n//# sourceMappingURL=PatchDiff.d.ts.map"],"mappings":";;;UACiBC,oCAAoCD,mBAAmBE;;AAAxE;AAGwBC,iBAAAA,SAASD,CAAAA,cAAA,SAAA,CAAA,CAAA;EAAA,KAAA;EAAA,OAAA;EAAA,OAAA;EAAA,eAAA;EAAA,aAAA;EAAA,SAAA;EAAA,KAAA;EAAA,eAAA;EAAA,gBAAA;EAAA,kBAAA;EAAA,oBAAA;EAAA,mBAAA;EAAA;AAAA,CAAA,EAA+ND,cAA/N,CAA8OC,WAA9O,CAAA,CAAA,EAA6Pe,KAAAA,CAAMC,GAAAA,CAAIC,OAAvQ"}
|
package/dist/react/PatchDiff.js
CHANGED
|
@@ -10,7 +10,7 @@ import { useMemo } from "react";
|
|
|
10
10
|
import { jsx } from "react/jsx-runtime";
|
|
11
11
|
|
|
12
12
|
//#region src/react/PatchDiff.tsx
|
|
13
|
-
function PatchDiff({ patch, options, metrics, lineAnnotations, selectedLines, className, style, prerenderedHTML, renderAnnotation, renderHeaderMetadata, renderHoverUtility }) {
|
|
13
|
+
function PatchDiff({ patch, options, metrics, lineAnnotations, selectedLines, className, style, prerenderedHTML, renderAnnotation, renderHeaderPrefix, renderHeaderMetadata, renderGutterUtility, renderHoverUtility }) {
|
|
14
14
|
const fileDiff = usePatch(patch);
|
|
15
15
|
const { ref, getHoveredLine } = useFileDiffInstance({
|
|
16
16
|
fileDiff,
|
|
@@ -26,9 +26,11 @@ function PatchDiff({ patch, options, metrics, lineAnnotations, selectedLines, cl
|
|
|
26
26
|
style,
|
|
27
27
|
children: templateRender(renderDiffChildren({
|
|
28
28
|
fileDiff,
|
|
29
|
+
renderHeaderPrefix,
|
|
29
30
|
renderHeaderMetadata,
|
|
30
31
|
renderAnnotation,
|
|
31
32
|
lineAnnotations,
|
|
33
|
+
renderGutterUtility,
|
|
32
34
|
renderHoverUtility,
|
|
33
35
|
getHoveredLine
|
|
34
36
|
}), prerenderedHTML)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PatchDiff.js","names":[],"sources":["../../src/react/PatchDiff.tsx"],"sourcesContent":["'use client';\n\nimport { useMemo } from 'react';\n\nimport { DIFFS_TAG_NAME } from '../constants';\nimport type { FileDiffMetadata } from '../types';\nimport { getSingularPatch } from '../utils/getSingularPatch';\nimport type { DiffBasePropsReact } from './types';\nimport { renderDiffChildren } from './utils/renderDiffChildren';\nimport { templateRender } from './utils/templateRender';\nimport { useFileDiffInstance } from './utils/useFileDiffInstance';\n\nexport interface PatchDiffProps<\n LAnnotation,\n> extends DiffBasePropsReact<LAnnotation> {\n patch: string;\n}\n\nexport function PatchDiff<LAnnotation = undefined>({\n patch,\n options,\n metrics,\n lineAnnotations,\n selectedLines,\n className,\n style,\n prerenderedHTML,\n renderAnnotation,\n renderHeaderMetadata,\n renderHoverUtility,\n}: PatchDiffProps<LAnnotation>): React.JSX.Element {\n const fileDiff = usePatch(patch);\n const { ref, getHoveredLine } = useFileDiffInstance({\n fileDiff,\n options,\n metrics,\n lineAnnotations,\n selectedLines,\n prerenderedHTML,\n });\n const children = renderDiffChildren({\n fileDiff,\n renderHeaderMetadata,\n renderAnnotation,\n lineAnnotations,\n renderHoverUtility,\n getHoveredLine,\n });\n return (\n <DIFFS_TAG_NAME ref={ref} className={className} style={style}>\n {templateRender(children, prerenderedHTML)}\n </DIFFS_TAG_NAME>\n );\n}\n\nfunction usePatch(patch: string): FileDiffMetadata {\n return useMemo<FileDiffMetadata>(() => getSingularPatch(patch), [patch]);\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,SAAgB,UAAmC,EACjD,OACA,SACA,SACA,iBACA,eACA,WACA,OACA,iBACA,kBACA,sBACA,sBACiD;CACjD,MAAM,WAAW,SAAS,MAAM;CAChC,MAAM,EAAE,KAAK,mBAAmB,oBAAoB;EAClD;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;
|
|
1
|
+
{"version":3,"file":"PatchDiff.js","names":[],"sources":["../../src/react/PatchDiff.tsx"],"sourcesContent":["'use client';\n\nimport { useMemo } from 'react';\n\nimport { DIFFS_TAG_NAME } from '../constants';\nimport type { FileDiffMetadata } from '../types';\nimport { getSingularPatch } from '../utils/getSingularPatch';\nimport type { DiffBasePropsReact } from './types';\nimport { renderDiffChildren } from './utils/renderDiffChildren';\nimport { templateRender } from './utils/templateRender';\nimport { useFileDiffInstance } from './utils/useFileDiffInstance';\n\nexport interface PatchDiffProps<\n LAnnotation,\n> extends DiffBasePropsReact<LAnnotation> {\n patch: string;\n}\n\nexport function PatchDiff<LAnnotation = undefined>({\n patch,\n options,\n metrics,\n lineAnnotations,\n selectedLines,\n className,\n style,\n prerenderedHTML,\n renderAnnotation,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderGutterUtility,\n renderHoverUtility,\n}: PatchDiffProps<LAnnotation>): React.JSX.Element {\n const fileDiff = usePatch(patch);\n const { ref, getHoveredLine } = useFileDiffInstance({\n fileDiff,\n options,\n metrics,\n lineAnnotations,\n selectedLines,\n prerenderedHTML,\n });\n const children = renderDiffChildren({\n fileDiff,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderAnnotation,\n lineAnnotations,\n renderGutterUtility,\n renderHoverUtility,\n getHoveredLine,\n });\n return (\n <DIFFS_TAG_NAME ref={ref} className={className} style={style}>\n {templateRender(children, prerenderedHTML)}\n </DIFFS_TAG_NAME>\n );\n}\n\nfunction usePatch(patch: string): FileDiffMetadata {\n return useMemo<FileDiffMetadata>(() => getSingularPatch(patch), [patch]);\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,SAAgB,UAAmC,EACjD,OACA,SACA,SACA,iBACA,eACA,WACA,OACA,iBACA,kBACA,oBACA,sBACA,qBACA,sBACiD;CACjD,MAAM,WAAW,SAAS,MAAM;CAChC,MAAM,EAAE,KAAK,mBAAmB,oBAAoB;EAClD;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAWF,QACE,oBAAC;EAAoB;EAAgB;EAAkB;YACpD,eAZY,mBAAmB;GAClC;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC,EAG4B,gBAAgB;GAC3B;;AAIrB,SAAS,SAAS,OAAiC;AACjD,QAAO,cAAgC,iBAAiB,MAAM,EAAE,CAAC,MAAM,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSProperties } from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/react/constants.d.ts
|
|
4
|
-
declare const
|
|
4
|
+
declare const GutterUtilitySlotStyles: CSSProperties;
|
|
5
5
|
//#endregion
|
|
6
|
-
export {
|
|
6
|
+
export { GutterUtilitySlotStyles };
|
|
7
7
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","names":["CSSProperties","
|
|
1
|
+
{"version":3,"file":"constants.d.ts","names":["CSSProperties","GutterUtilitySlotStyles"],"sources":["../../src/react/constants.d.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\nexport declare const GutterUtilitySlotStyles: CSSProperties;\n//# sourceMappingURL=constants.d.ts.map"],"mappings":";;;cACqBC,yBAAyBD"}
|
package/dist/react/constants.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/react/constants.ts
|
|
2
|
-
const
|
|
2
|
+
const GutterUtilitySlotStyles = {
|
|
3
3
|
position: "absolute",
|
|
4
4
|
top: 0,
|
|
5
5
|
bottom: 0,
|
|
@@ -7,5 +7,5 @@ const HoverSlotStyles = {
|
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
//#endregion
|
|
10
|
-
export {
|
|
10
|
+
export { GutterUtilitySlotStyles };
|
|
11
11
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":["
|
|
1
|
+
{"version":3,"file":"constants.js","names":["GutterUtilitySlotStyles: CSSProperties"],"sources":["../../src/react/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\n\nexport const GutterUtilitySlotStyles: CSSProperties = {\n position: 'absolute',\n top: 0,\n bottom: 0,\n textAlign: 'center',\n};\n"],"mappings":";AAEA,MAAaA,0BAAyC;CACpD,UAAU;CACV,KAAK;CACL,QAAQ;CACR,WAAW;CACZ"}
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnnotationLineMap, AnnotationSide, AnnotationSpan, BaseCodeOptions, BaseDiffOptions, BundledLanguage, ChangeContent, ChangeTypes, CodeColumnType, CodeToHastOptions, ContextContent, DecorationItem, DiffLineAnnotation, DiffLineEventBaseProps, DiffsHighlighter, DiffsThemeNames, ExpansionDirections, ExtensionFormatMap, FileContents, FileDiffMetadata, ForceDiffPlainTextOptions, ForceFilePlainTextOptions, GapSpan, HighlighterTypes, Hunk, HunkData, HunkExpansionRegion, HunkLineType, HunkSeparators, LanguageRegistration, LineAnnotation, LineDiffTypes, LineEventBaseProps, LineInfo, LineSpans, LineTypes, ObservedAnnotationNodes, ObservedGridNodes, ParsedPatch, PrePropertiesConfig, RenderDiffFilesResult, RenderDiffOptions, RenderDiffResult, RenderFileMetadata, RenderFileOptions, RenderFileResult, RenderHeaderMetadataCallback, RenderHeaderMetadataProps, RenderRange, RenderWindow, RenderedDiffASTCache, RenderedFileASTCache, SelectionSide, SharedRenderState, ShikiTransformer, SupportedLanguages, ThemeRegistrationResolved, ThemeTypes, ThemedDiffResult, ThemedFileResult, ThemedToken, ThemesType, VirtualFileMetrics, VirtualWindowSpecs } from "../types.js";
|
|
1
|
+
import { AnnotationLineMap, AnnotationSide, AnnotationSpan, BaseCodeOptions, BaseDiffOptions, BundledLanguage, ChangeContent, ChangeTypes, CodeColumnType, CodeToHastOptions, ContextContent, DecorationItem, DiffLineAnnotation, DiffLineEventBaseProps, DiffsHighlighter, DiffsThemeNames, ExpansionDirections, ExtensionFormatMap, FileContents, FileDiffMetadata, ForceDiffPlainTextOptions, ForceFilePlainTextOptions, GapSpan, HighlighterTypes, Hunk, HunkData, HunkExpansionRegion, HunkLineType, HunkSeparators, LanguageRegistration, LineAnnotation, LineDiffTypes, LineEventBaseProps, LineInfo, LineSpans, LineTypes, ObservedAnnotationNodes, ObservedGridNodes, ParsedPatch, PrePropertiesConfig, RenderDiffFilesResult, RenderDiffOptions, RenderDiffResult, RenderFileMetadata, RenderFileOptions, RenderFileResult, RenderHeaderMetadataCallback, RenderHeaderMetadataProps, RenderHeaderPrefixCallback, RenderRange, RenderWindow, RenderedDiffASTCache, RenderedFileASTCache, SelectionSide, SharedRenderState, ShikiTransformer, SupportedLanguages, ThemeRegistrationResolved, ThemeTypes, ThemedDiffResult, ThemedFileResult, ThemedToken, ThemesType, VirtualFileMetrics, VirtualWindowSpecs } from "../types.js";
|
|
2
2
|
import { WorkerInitializationRenderOptions, WorkerPoolOptions } from "../worker/types.js";
|
|
3
3
|
import { FileOptions } from "../components/File.js";
|
|
4
4
|
import { DiffBasePropsReact, FileProps } from "./types.js";
|
|
@@ -8,11 +8,11 @@ import { MultiFileDiff, MultiFileDiffProps } from "./MultiFileDiff.js";
|
|
|
8
8
|
import { PatchDiff, PatchDiffProps } from "./PatchDiff.js";
|
|
9
9
|
import { Virtualizer, VirtualizerContext, useVirtualizer } from "./Virtualizer.js";
|
|
10
10
|
import { WorkerPoolContext, WorkerPoolContextProvider, useWorkerPool } from "./WorkerPoolContext.js";
|
|
11
|
-
import {
|
|
11
|
+
import { GutterUtilitySlotStyles } from "./constants.js";
|
|
12
12
|
import { renderDiffChildren } from "./utils/renderDiffChildren.js";
|
|
13
13
|
import { renderFileChildren } from "./utils/renderFileChildren.js";
|
|
14
14
|
import { templateRender } from "./utils/templateRender.js";
|
|
15
15
|
import { useFileDiffInstance } from "./utils/useFileDiffInstance.js";
|
|
16
16
|
import { useFileInstance } from "./utils/useFileInstance.js";
|
|
17
17
|
import { useStableCallback } from "./utils/useStableCallback.js";
|
|
18
|
-
export { AnnotationLineMap, AnnotationSide, AnnotationSpan, BaseCodeOptions, BaseDiffOptions, BundledLanguage, ChangeContent, ChangeTypes, CodeColumnType, CodeToHastOptions, ContextContent, DecorationItem, DiffBasePropsReact, DiffLineAnnotation, DiffLineEventBaseProps, DiffsHighlighter, DiffsThemeNames, ExpansionDirections, ExtensionFormatMap, File, FileContents, FileDiff, FileDiffMetadata, FileDiffProps, FileOptions, FileProps, ForceDiffPlainTextOptions, ForceFilePlainTextOptions, GapSpan,
|
|
18
|
+
export { AnnotationLineMap, AnnotationSide, AnnotationSpan, BaseCodeOptions, BaseDiffOptions, BundledLanguage, ChangeContent, ChangeTypes, CodeColumnType, CodeToHastOptions, ContextContent, DecorationItem, DiffBasePropsReact, DiffLineAnnotation, DiffLineEventBaseProps, DiffsHighlighter, DiffsThemeNames, ExpansionDirections, ExtensionFormatMap, File, FileContents, FileDiff, FileDiffMetadata, FileDiffProps, FileOptions, FileProps, ForceDiffPlainTextOptions, ForceFilePlainTextOptions, GapSpan, GutterUtilitySlotStyles, HighlighterTypes, Hunk, HunkData, HunkExpansionRegion, HunkLineType, HunkSeparators, LanguageRegistration, LineAnnotation, LineDiffTypes, LineEventBaseProps, LineInfo, LineSpans, LineTypes, MultiFileDiff, MultiFileDiffProps, ObservedAnnotationNodes, ObservedGridNodes, ParsedPatch, PatchDiff, PatchDiffProps, PrePropertiesConfig, RenderDiffFilesResult, RenderDiffOptions, RenderDiffResult, RenderFileMetadata, RenderFileOptions, RenderFileResult, RenderHeaderMetadataCallback, RenderHeaderMetadataProps, RenderHeaderPrefixCallback, RenderRange, RenderWindow, RenderedDiffASTCache, RenderedFileASTCache, SelectionSide, SharedRenderState, ShikiTransformer, SupportedLanguages, ThemeRegistrationResolved, ThemeTypes, ThemedDiffResult, ThemedFileResult, ThemedToken, ThemesType, VirtualFileMetrics, VirtualWindowSpecs, Virtualizer, VirtualizerContext, WorkerInitializationRenderOptions, WorkerPoolContext, WorkerPoolContextProvider, WorkerPoolOptions, renderDiffChildren, renderFileChildren, templateRender, useFileDiffInstance, useFileInstance, useStableCallback, useVirtualizer, useWorkerPool };
|
package/dist/react/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GutterUtilitySlotStyles } from "./constants.js";
|
|
2
2
|
import { renderFileChildren } from "./utils/renderFileChildren.js";
|
|
3
3
|
import { templateRender } from "./utils/templateRender.js";
|
|
4
4
|
import { Virtualizer, VirtualizerContext, useVirtualizer } from "./Virtualizer.js";
|
|
@@ -12,4 +12,4 @@ import { FileDiff } from "./FileDiff.js";
|
|
|
12
12
|
import { MultiFileDiff } from "./MultiFileDiff.js";
|
|
13
13
|
import { PatchDiff } from "./PatchDiff.js";
|
|
14
14
|
|
|
15
|
-
export { File, FileDiff,
|
|
15
|
+
export { File, FileDiff, GutterUtilitySlotStyles, MultiFileDiff, PatchDiff, Virtualizer, VirtualizerContext, WorkerPoolContext, WorkerPoolContextProvider, renderDiffChildren, renderFileChildren, templateRender, useFileDiffInstance, useFileInstance, useStableCallback, useVirtualizer, useWorkerPool };
|
package/dist/react/jsx.d.ts
CHANGED
package/dist/react/jsx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx.d.ts","names":["DIFFS_TAG_NAME","
|
|
1
|
+
{"version":3,"file":"jsx.d.ts","names":["DIFFS_TAG_NAME","_1","HTMLElement","React","HTMLAttributes","DetailedHTMLProps","sideEffect"],"sources":["../../src/react/jsx.d.ts"],"sourcesContent":["import 'react';\nimport type { DIFFS_TAG_NAME } from '../constants';\n\ndeclare module 'react' {\n namespace JSX {\n interface IntrinsicElements {\n [DIFFS_TAG_NAME]: React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLElement>,\n HTMLElement\n >;\n }\n }\n}\n"],"mappings":";;;;;EACmD,UAAA,GAAA,CAAA;IAAA,UAAA,iBAAA,CAAA;OAK5CA,cAAAA,CAL4C,EAK3BG,KAAAA,CAAME,iBALqB,CAM3CF,KAAAA,CAAMC,cAAeF,CAAAA,WAAAA,CAAAA,EACrBA,WADME,CACNF;IAFgBC;EAAjBH"}
|
package/dist/react/types.d.ts
CHANGED
|
@@ -12,7 +12,12 @@ interface DiffBasePropsReact<LAnnotation> {
|
|
|
12
12
|
lineAnnotations?: DiffLineAnnotation<LAnnotation>[];
|
|
13
13
|
selectedLines?: SelectedLineRange | null;
|
|
14
14
|
renderAnnotation?(annotations: DiffLineAnnotation<LAnnotation>): ReactNode;
|
|
15
|
+
renderHeaderPrefix?(props: RenderHeaderMetadataProps): ReactNode;
|
|
15
16
|
renderHeaderMetadata?(props: RenderHeaderMetadataProps): ReactNode;
|
|
17
|
+
renderGutterUtility?(getHoveredLine: () => GetHoveredLineResult<'diff'> | undefined): ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use `renderGutterUtility` instead.
|
|
20
|
+
*/
|
|
16
21
|
renderHoverUtility?(getHoveredLine: () => GetHoveredLineResult<'diff'> | undefined): ReactNode;
|
|
17
22
|
className?: string;
|
|
18
23
|
style?: CSSProperties;
|
|
@@ -25,7 +30,12 @@ interface FileProps<LAnnotation> {
|
|
|
25
30
|
lineAnnotations?: LineAnnotation<LAnnotation>[];
|
|
26
31
|
selectedLines?: SelectedLineRange | null;
|
|
27
32
|
renderAnnotation?(annotations: LineAnnotation<LAnnotation>): ReactNode;
|
|
33
|
+
renderHeaderPrefix?(file: FileContents): ReactNode;
|
|
28
34
|
renderHeaderMetadata?(file: FileContents): ReactNode;
|
|
35
|
+
renderGutterUtility?(getHoveredLine: () => GetHoveredLineResult<'file'> | undefined): ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated Use `renderGutterUtility` instead.
|
|
38
|
+
*/
|
|
29
39
|
renderHoverUtility?(getHoveredLine: () => GetHoveredLineResult<'file'> | undefined): ReactNode;
|
|
30
40
|
className?: string;
|
|
31
41
|
style?: CSSProperties;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":["CSSProperties","ReactNode","FileOptions","FileDiffOptions","SelectedLineRange","GetHoveredLineResult","DiffLineAnnotation","FileContents","LineAnnotation","RenderHeaderMetadataProps","VirtualFileMetrics","DiffBasePropsReact","LAnnotation","FileProps"],"sources":["../../src/react/types.d.ts"],"sourcesContent":["import { type CSSProperties, type ReactNode } from 'react';\nimport type { FileOptions } from '../components/File';\nimport type { FileDiffOptions } from '../components/FileDiff';\nimport type { SelectedLineRange } from '../managers/LineSelectionManager';\nimport type { GetHoveredLineResult } from '../managers/MouseEventManager';\nimport type { DiffLineAnnotation, FileContents, LineAnnotation, RenderHeaderMetadataProps, VirtualFileMetrics } from '../types';\nexport interface DiffBasePropsReact<LAnnotation> {\n options?: FileDiffOptions<LAnnotation>;\n metrics?: VirtualFileMetrics;\n lineAnnotations?: DiffLineAnnotation<LAnnotation>[];\n selectedLines?: SelectedLineRange | null;\n renderAnnotation?(annotations: DiffLineAnnotation<LAnnotation>): ReactNode;\n renderHeaderMetadata?(props: RenderHeaderMetadataProps): ReactNode;\n renderHoverUtility?(getHoveredLine: () => GetHoveredLineResult<'diff'> | undefined): ReactNode;\n className?: string;\n style?: CSSProperties;\n prerenderedHTML?: string;\n}\nexport interface FileProps<LAnnotation> {\n file: FileContents;\n options?: FileOptions<LAnnotation>;\n metrics?: VirtualFileMetrics;\n lineAnnotations?: LineAnnotation<LAnnotation>[];\n selectedLines?: SelectedLineRange | null;\n renderAnnotation?(annotations: LineAnnotation<LAnnotation>): ReactNode;\n renderHeaderMetadata?(file: FileContents): ReactNode;\n renderHoverUtility?(getHoveredLine: () => GetHoveredLineResult<'file'> | undefined): ReactNode;\n className?: string;\n style?: CSSProperties;\n prerenderedHTML?: string;\n}\n//# sourceMappingURL=types.d.ts.map"],"mappings":";;;;;;;;UAMiBW;YACHR,gBAAgBS;EADbD,OAAAA,CAAAA,EAEHD,kBAFqBE;EACLA,eAAAA,CAAAA,EAERN,kBAFQM,CAEWA,WAFXA,CAAAA,EAAAA;EAAhBT,aAAAA,CAAAA,EAGMC,iBAHND,GAAAA,IAAAA;EACAO,gBAAAA,EAAAA,WAAAA,EAGqBJ,kBAHrBI,CAGwCE,WAHxCF,CAAAA,CAAAA,EAGuDT,SAHvDS;EAC2BE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":["CSSProperties","ReactNode","FileOptions","FileDiffOptions","SelectedLineRange","GetHoveredLineResult","DiffLineAnnotation","FileContents","LineAnnotation","RenderHeaderMetadataProps","VirtualFileMetrics","DiffBasePropsReact","LAnnotation","FileProps"],"sources":["../../src/react/types.d.ts"],"sourcesContent":["import { type CSSProperties, type ReactNode } from 'react';\nimport type { FileOptions } from '../components/File';\nimport type { FileDiffOptions } from '../components/FileDiff';\nimport type { SelectedLineRange } from '../managers/LineSelectionManager';\nimport type { GetHoveredLineResult } from '../managers/MouseEventManager';\nimport type { DiffLineAnnotation, FileContents, LineAnnotation, RenderHeaderMetadataProps, VirtualFileMetrics } from '../types';\nexport interface DiffBasePropsReact<LAnnotation> {\n options?: FileDiffOptions<LAnnotation>;\n metrics?: VirtualFileMetrics;\n lineAnnotations?: DiffLineAnnotation<LAnnotation>[];\n selectedLines?: SelectedLineRange | null;\n renderAnnotation?(annotations: DiffLineAnnotation<LAnnotation>): ReactNode;\n renderHeaderPrefix?(props: RenderHeaderMetadataProps): ReactNode;\n renderHeaderMetadata?(props: RenderHeaderMetadataProps): ReactNode;\n renderGutterUtility?(getHoveredLine: () => GetHoveredLineResult<'diff'> | undefined): ReactNode;\n /**\n * @deprecated Use `renderGutterUtility` instead.\n */\n renderHoverUtility?(getHoveredLine: () => GetHoveredLineResult<'diff'> | undefined): ReactNode;\n className?: string;\n style?: CSSProperties;\n prerenderedHTML?: string;\n}\nexport interface FileProps<LAnnotation> {\n file: FileContents;\n options?: FileOptions<LAnnotation>;\n metrics?: VirtualFileMetrics;\n lineAnnotations?: LineAnnotation<LAnnotation>[];\n selectedLines?: SelectedLineRange | null;\n renderAnnotation?(annotations: LineAnnotation<LAnnotation>): ReactNode;\n renderHeaderPrefix?(file: FileContents): ReactNode;\n renderHeaderMetadata?(file: FileContents): ReactNode;\n renderGutterUtility?(getHoveredLine: () => GetHoveredLineResult<'file'> | undefined): ReactNode;\n /**\n * @deprecated Use `renderGutterUtility` instead.\n */\n renderHoverUtility?(getHoveredLine: () => GetHoveredLineResult<'file'> | undefined): ReactNode;\n className?: string;\n style?: CSSProperties;\n prerenderedHTML?: string;\n}\n//# sourceMappingURL=types.d.ts.map"],"mappings":";;;;;;;;UAMiBW;YACHR,gBAAgBS;EADbD,OAAAA,CAAAA,EAEHD,kBAFqBE;EACLA,eAAAA,CAAAA,EAERN,kBAFQM,CAEWA,WAFXA,CAAAA,EAAAA;EAAhBT,aAAAA,CAAAA,EAGMC,iBAHND,GAAAA,IAAAA;EACAO,gBAAAA,EAAAA,WAAAA,EAGqBJ,kBAHrBI,CAGwCE,WAHxCF,CAAAA,CAAAA,EAGuDT,SAHvDS;EAC2BE,kBAAAA,EAAAA,KAAAA,EAGVH,yBAHUG,CAAAA,EAGkBX,SAHlBW;EAAnBN,oBAAAA,EAAAA,KAAAA,EAIWG,yBAJXH,CAAAA,EAIuCL,SAJvCK;EACFF,mBAAAA,EAAAA,cAAAA,EAAAA,GAAAA,GAI2BC,oBAJ3BD,CAAAA,MAAAA,CAAAA,GAAAA,SAAAA,CAAAA,EAIsEH,SAJtEG;EACkCQ;;;EACvBH,kBAAAA,EAAAA,cAAAA,EAAAA,GAAAA,GAMeJ,oBANfI,CAAAA,MAAAA,CAAAA,GAAAA,SAAAA,CAAAA,EAM0DR,SAN1DQ;EAA4BR,SAAAA,CAAAA,EAAAA,MAAAA;EAC1BQ,KAAAA,CAAAA,EAOrBT,aAPqBS;EAA4BR,eAAAA,CAAAA,EAAAA,MAAAA;;AAC6BA,UASzEY,SATyEZ,CAAAA,WAAAA,CAAAA,CAAAA;EAI5CI,IAAAA,EAMpCE,YANoCF;EAA2CJ,OAAAA,CAAAA,EAO3EC,WAP2ED,CAO/DW,WAP+DX,CAAAA;EAE7ED,OAAAA,CAAAA,EAMEU,kBANFV;EAAa,eAAA,CAAA,EAOHQ,cAPG,CAOYI,WAPZ,CAAA,EAAA;EAGRC,aAAS,CAAA,EAKNT,iBALMQ,GAAA,IAAA;EAChBL,gBAAAA,EAAAA,WAAAA,EAKyBC,cALzBD,CAKwCK,WALxCL,CAAAA,CAAAA,EAKuDN,SALvDM;EACgBK,kBAAAA,EAAAA,IAAAA,EAKIL,YALJK,CAAAA,EAKmBX,SALnBW;EAAZV,oBAAAA,EAAAA,IAAAA,EAMkBK,YANlBL,CAAAA,EAMiCD,SANjCC;EACAQ,mBAAAA,EAAAA,cAAAA,EAAAA,GAAAA,GAMiCL,oBANjCK,CAAAA,MAAAA,CAAAA,GAAAA,SAAAA,CAAAA,EAM4ET,SAN5ES;EACuBE;;;EAEaA,kBAAAA,EAAAA,cAAAA,EAAAA,GAAAA,GAOJP,oBAPIO,CAAAA,MAAAA,CAAAA,GAAAA,SAAAA,CAAAA,EAOuCX,SAPvCW;EAAfJ,SAAAA,CAAAA,EAAAA,MAAAA;EAA8BP,KAAAA,CAAAA,EASrDD,aATqDC;EACnCM,eAAAA,CAAAA,EAAAA,MAAAA"}
|
package/dist/react/types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "react";
|
|
@@ -8,8 +8,10 @@ interface RenderDiffChildrenProps<LAnnotation> {
|
|
|
8
8
|
fileDiff?: FileDiffMetadata;
|
|
9
9
|
deletionFile?: FileContents;
|
|
10
10
|
additionFile?: FileContents;
|
|
11
|
+
renderHeaderPrefix: DiffBasePropsReact<LAnnotation>['renderHeaderPrefix'];
|
|
11
12
|
renderHeaderMetadata: DiffBasePropsReact<LAnnotation>['renderHeaderMetadata'];
|
|
12
13
|
renderAnnotation: DiffBasePropsReact<LAnnotation>['renderAnnotation'];
|
|
14
|
+
renderGutterUtility: DiffBasePropsReact<LAnnotation>['renderGutterUtility'];
|
|
13
15
|
renderHoverUtility: DiffBasePropsReact<LAnnotation>['renderHoverUtility'];
|
|
14
16
|
lineAnnotations: DiffBasePropsReact<LAnnotation>['lineAnnotations'];
|
|
15
17
|
getHoveredLine(): GetHoveredLineResult<'diff'> | undefined;
|
|
@@ -18,8 +20,10 @@ declare function renderDiffChildren<LAnnotation>({
|
|
|
18
20
|
fileDiff,
|
|
19
21
|
deletionFile,
|
|
20
22
|
additionFile,
|
|
23
|
+
renderHeaderPrefix,
|
|
21
24
|
renderHeaderMetadata,
|
|
22
25
|
renderAnnotation,
|
|
26
|
+
renderGutterUtility,
|
|
23
27
|
renderHoverUtility,
|
|
24
28
|
lineAnnotations,
|
|
25
29
|
getHoveredLine
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderDiffChildren.d.ts","names":["ReactNode","GetHoveredLineResult","FileContents","FileDiffMetadata","DiffBasePropsReact","RenderDiffChildrenProps","LAnnotation","renderDiffChildren","fileDiff","deletionFile","additionFile","renderHeaderMetadata","renderAnnotation","renderHoverUtility","lineAnnotations","getHoveredLine"],"sources":["../../../src/react/utils/renderDiffChildren.d.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { GetHoveredLineResult } from '../../managers/MouseEventManager';\nimport type { FileContents, FileDiffMetadata } from '../../types';\nimport type { DiffBasePropsReact } from '../types';\ninterface RenderDiffChildrenProps<LAnnotation> {\n fileDiff?: FileDiffMetadata;\n deletionFile?: FileContents;\n additionFile?: FileContents;\n renderHeaderMetadata: DiffBasePropsReact<LAnnotation>['renderHeaderMetadata'];\n renderAnnotation: DiffBasePropsReact<LAnnotation>['renderAnnotation'];\n renderHoverUtility: DiffBasePropsReact<LAnnotation>['renderHoverUtility'];\n lineAnnotations: DiffBasePropsReact<LAnnotation>['lineAnnotations'];\n getHoveredLine(): GetHoveredLineResult<'diff'> | undefined;\n}\nexport declare function renderDiffChildren<LAnnotation>({ fileDiff, deletionFile, additionFile, renderHeaderMetadata, renderAnnotation, renderHoverUtility, lineAnnotations, getHoveredLine }: RenderDiffChildrenProps<LAnnotation>): ReactNode;\nexport {};\n//# sourceMappingURL=renderDiffChildren.d.ts.map"],"mappings":";;;;;;UAIUK;aACKF;EADLE,YAAAA,CAAAA,EAESH,YAFc;EAClBC,YAAAA,CAAAA,EAEID,YAFJC;EACID,oBAAAA,EAEOE,kBAFPF,CAE0BI,WAF1BJ,CAAAA,CAAAA,sBAAAA,CAAAA;
|
|
1
|
+
{"version":3,"file":"renderDiffChildren.d.ts","names":["ReactNode","GetHoveredLineResult","FileContents","FileDiffMetadata","DiffBasePropsReact","RenderDiffChildrenProps","LAnnotation","renderDiffChildren","fileDiff","deletionFile","additionFile","renderHeaderPrefix","renderHeaderMetadata","renderAnnotation","renderGutterUtility","renderHoverUtility","lineAnnotations","getHoveredLine"],"sources":["../../../src/react/utils/renderDiffChildren.d.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { GetHoveredLineResult } from '../../managers/MouseEventManager';\nimport type { FileContents, FileDiffMetadata } from '../../types';\nimport type { DiffBasePropsReact } from '../types';\ninterface RenderDiffChildrenProps<LAnnotation> {\n fileDiff?: FileDiffMetadata;\n deletionFile?: FileContents;\n additionFile?: FileContents;\n renderHeaderPrefix: DiffBasePropsReact<LAnnotation>['renderHeaderPrefix'];\n renderHeaderMetadata: DiffBasePropsReact<LAnnotation>['renderHeaderMetadata'];\n renderAnnotation: DiffBasePropsReact<LAnnotation>['renderAnnotation'];\n renderGutterUtility: DiffBasePropsReact<LAnnotation>['renderGutterUtility'];\n renderHoverUtility: DiffBasePropsReact<LAnnotation>['renderHoverUtility'];\n lineAnnotations: DiffBasePropsReact<LAnnotation>['lineAnnotations'];\n getHoveredLine(): GetHoveredLineResult<'diff'> | undefined;\n}\nexport declare function renderDiffChildren<LAnnotation>({ fileDiff, deletionFile, additionFile, renderHeaderPrefix, renderHeaderMetadata, renderAnnotation, renderGutterUtility, renderHoverUtility, lineAnnotations, getHoveredLine }: RenderDiffChildrenProps<LAnnotation>): ReactNode;\nexport {};\n//# sourceMappingURL=renderDiffChildren.d.ts.map"],"mappings":";;;;;;UAIUK;aACKF;EADLE,YAAAA,CAAAA,EAESH,YAFc;EAClBC,YAAAA,CAAAA,EAEID,YAFJC;EACID,kBAAAA,EAEKE,kBAFLF,CAEwBI,WAFxBJ,CAAAA,CAAAA,oBAAAA,CAAAA;EACAA,oBAAAA,EAEOE,kBAFPF,CAE0BI,WAF1BJ,CAAAA,CAAAA,sBAAAA,CAAAA;EACwBI,gBAAAA,EAErBF,kBAFqBE,CAEFA,WAFEA,CAAAA,CAAAA,kBAAAA,CAAAA;EAAnBF,mBAAAA,EAGCA,kBAHDA,CAGoBE,WAHpBF,CAAAA,CAAAA,qBAAAA,CAAAA;EACqBE,kBAAAA,EAGrBF,kBAHqBE,CAGFA,WAHEA,CAAAA,CAAAA,oBAAAA,CAAAA;EAAnBF,eAAAA,EAILA,kBAJKA,CAIcE,WAJdF,CAAAA,CAAAA,iBAAAA,CAAAA;EACeE,cAAAA,EAAAA,EAInBL,oBAJmBK,CAAAA,MAAAA,CAAAA,GAAAA,SAAAA;;AACGA,iBAKpBC,kBALoBD,CAAAA,WAAAA,CAAAA,CAAAA;EAAAA,QAAAA;EAAAA,YAAAA;EAAAA,YAAAA;EAAAA,kBAAAA;EAAAA,oBAAAA;EAAAA,gBAAAA;EAAAA,mBAAAA;EAAAA,kBAAAA;EAAAA,eAAAA;EAAAA;AAAAA,CAAAA,EAK4LD,uBAL5LC,CAKoNA,WALpNA,CAAAA,CAAAA,EAKmON,SALnOM"}
|
|
@@ -1,16 +1,26 @@
|
|
|
1
|
-
import { HEADER_METADATA_SLOT_ID } from "../../constants.js";
|
|
1
|
+
import { HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID } from "../../constants.js";
|
|
2
2
|
import { getLineAnnotationName } from "../../utils/getLineAnnotationName.js";
|
|
3
|
-
import {
|
|
3
|
+
import { GutterUtilitySlotStyles } from "../constants.js";
|
|
4
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/react/utils/renderDiffChildren.tsx
|
|
7
|
-
function renderDiffChildren({ fileDiff, deletionFile, additionFile, renderHeaderMetadata, renderAnnotation, renderHoverUtility, lineAnnotations, getHoveredLine }) {
|
|
7
|
+
function renderDiffChildren({ fileDiff, deletionFile, additionFile, renderHeaderPrefix, renderHeaderMetadata, renderAnnotation, renderGutterUtility, renderHoverUtility, lineAnnotations, getHoveredLine }) {
|
|
8
|
+
const gutterUtility = renderGutterUtility ?? renderHoverUtility;
|
|
9
|
+
const prefix = renderHeaderPrefix?.({
|
|
10
|
+
fileDiff,
|
|
11
|
+
deletionFile,
|
|
12
|
+
additionFile
|
|
13
|
+
});
|
|
8
14
|
const metadata = renderHeaderMetadata?.({
|
|
9
15
|
fileDiff,
|
|
10
16
|
deletionFile,
|
|
11
17
|
additionFile
|
|
12
18
|
});
|
|
13
19
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20
|
+
prefix != null && /* @__PURE__ */ jsx("div", {
|
|
21
|
+
slot: HEADER_PREFIX_SLOT_ID,
|
|
22
|
+
children: prefix
|
|
23
|
+
}),
|
|
14
24
|
metadata != null && /* @__PURE__ */ jsx("div", {
|
|
15
25
|
slot: HEADER_METADATA_SLOT_ID,
|
|
16
26
|
children: metadata
|
|
@@ -19,10 +29,10 @@ function renderDiffChildren({ fileDiff, deletionFile, additionFile, renderHeader
|
|
|
19
29
|
slot: getLineAnnotationName(annotation),
|
|
20
30
|
children: renderAnnotation(annotation)
|
|
21
31
|
}, index)),
|
|
22
|
-
|
|
23
|
-
slot: "
|
|
24
|
-
style:
|
|
25
|
-
children:
|
|
32
|
+
gutterUtility != null && /* @__PURE__ */ jsx("div", {
|
|
33
|
+
slot: "gutter-utility-slot",
|
|
34
|
+
style: GutterUtilitySlotStyles,
|
|
35
|
+
children: gutterUtility(getHoveredLine)
|
|
26
36
|
})
|
|
27
37
|
] });
|
|
28
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderDiffChildren.js","names":[],"sources":["../../../src/react/utils/renderDiffChildren.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport {
|
|
1
|
+
{"version":3,"file":"renderDiffChildren.js","names":[],"sources":["../../../src/react/utils/renderDiffChildren.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport {\n HEADER_METADATA_SLOT_ID,\n HEADER_PREFIX_SLOT_ID,\n} from '../../constants';\nimport type { GetHoveredLineResult } from '../../managers/MouseEventManager';\nimport type { FileContents, FileDiffMetadata } from '../../types';\nimport { getLineAnnotationName } from '../../utils/getLineAnnotationName';\nimport { GutterUtilitySlotStyles } from '../constants';\nimport type { DiffBasePropsReact } from '../types';\n\ninterface RenderDiffChildrenProps<LAnnotation> {\n fileDiff?: FileDiffMetadata;\n deletionFile?: FileContents;\n additionFile?: FileContents;\n renderHeaderPrefix: DiffBasePropsReact<LAnnotation>['renderHeaderPrefix'];\n renderHeaderMetadata: DiffBasePropsReact<LAnnotation>['renderHeaderMetadata'];\n renderAnnotation: DiffBasePropsReact<LAnnotation>['renderAnnotation'];\n renderGutterUtility: DiffBasePropsReact<LAnnotation>['renderGutterUtility'];\n renderHoverUtility: DiffBasePropsReact<LAnnotation>['renderHoverUtility'];\n lineAnnotations: DiffBasePropsReact<LAnnotation>['lineAnnotations'];\n getHoveredLine(): GetHoveredLineResult<'diff'> | undefined;\n}\n\nexport function renderDiffChildren<LAnnotation>({\n fileDiff,\n deletionFile,\n additionFile,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderAnnotation,\n renderGutterUtility,\n renderHoverUtility,\n lineAnnotations,\n getHoveredLine,\n}: RenderDiffChildrenProps<LAnnotation>): ReactNode {\n const gutterUtility = renderGutterUtility ?? renderHoverUtility;\n const prefix = renderHeaderPrefix?.({\n fileDiff,\n deletionFile,\n additionFile,\n });\n const metadata = renderHeaderMetadata?.({\n fileDiff,\n deletionFile,\n additionFile,\n });\n return (\n <>\n {prefix != null && <div slot={HEADER_PREFIX_SLOT_ID}>{prefix}</div>}\n {metadata != null && <div slot={HEADER_METADATA_SLOT_ID}>{metadata}</div>}\n {renderAnnotation != null &&\n lineAnnotations?.map((annotation, index) => (\n <div key={index} slot={getLineAnnotationName(annotation)}>\n {renderAnnotation(annotation)}\n </div>\n ))}\n {gutterUtility != null && (\n <div slot=\"gutter-utility-slot\" style={GutterUtilitySlotStyles}>\n {gutterUtility(getHoveredLine)}\n </div>\n )}\n </>\n );\n}\n"],"mappings":";;;;;;AAyBA,SAAgB,mBAAgC,EAC9C,UACA,cACA,cACA,oBACA,sBACA,kBACA,qBACA,oBACA,iBACA,kBACkD;CAClD,MAAM,gBAAgB,uBAAuB;CAC7C,MAAM,SAAS,qBAAqB;EAClC;EACA;EACA;EACD,CAAC;CACF,MAAM,WAAW,uBAAuB;EACtC;EACA;EACA;EACD,CAAC;AACF,QACE;EACG,UAAU,QAAQ,oBAAC;GAAI,MAAM;aAAwB;IAAa;EAClE,YAAY,QAAQ,oBAAC;GAAI,MAAM;aAA0B;IAAe;EACxE,oBAAoB,QACnB,iBAAiB,KAAK,YAAY,UAChC,oBAAC;GAAgB,MAAM,sBAAsB,WAAW;aACrD,iBAAiB,WAAW;KADrB,MAEJ,CACN;EACH,iBAAiB,QAChB,oBAAC;GAAI,MAAK;GAAsB,OAAO;aACpC,cAAc,eAAe;IAC1B;KAEP"}
|
|
@@ -6,17 +6,21 @@ import { ReactNode } from "react";
|
|
|
6
6
|
//#region src/react/utils/renderFileChildren.d.ts
|
|
7
7
|
interface RenderFileChildrenProps<LAnnotation> {
|
|
8
8
|
file: FileContents;
|
|
9
|
+
renderHeaderPrefix: FileProps<LAnnotation>['renderHeaderPrefix'];
|
|
9
10
|
renderHeaderMetadata: FileProps<LAnnotation>['renderHeaderMetadata'];
|
|
10
11
|
renderAnnotation: FileProps<LAnnotation>['renderAnnotation'];
|
|
11
12
|
lineAnnotations: FileProps<LAnnotation>['lineAnnotations'];
|
|
13
|
+
renderGutterUtility: FileProps<LAnnotation>['renderGutterUtility'];
|
|
12
14
|
renderHoverUtility: FileProps<LAnnotation>['renderHoverUtility'];
|
|
13
15
|
getHoveredLine(): GetHoveredLineResult<'file'> | undefined;
|
|
14
16
|
}
|
|
15
17
|
declare function renderFileChildren<LAnnotation>({
|
|
16
18
|
file,
|
|
19
|
+
renderHeaderPrefix,
|
|
17
20
|
renderHeaderMetadata,
|
|
18
21
|
renderAnnotation,
|
|
19
22
|
lineAnnotations,
|
|
23
|
+
renderGutterUtility,
|
|
20
24
|
renderHoverUtility,
|
|
21
25
|
getHoveredLine
|
|
22
26
|
}: RenderFileChildrenProps<LAnnotation>): ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderFileChildren.d.ts","names":["ReactNode","GetHoveredLineResult","FileContents","FileProps","RenderFileChildrenProps","LAnnotation","renderFileChildren","file","renderHeaderMetadata","renderAnnotation","lineAnnotations","renderHoverUtility","getHoveredLine"],"sources":["../../../src/react/utils/renderFileChildren.d.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { GetHoveredLineResult } from '../../managers/MouseEventManager';\nimport type { FileContents } from '../../types';\nimport type { FileProps } from '../types';\ninterface RenderFileChildrenProps<LAnnotation> {\n file: FileContents;\n renderHeaderMetadata: FileProps<LAnnotation>['renderHeaderMetadata'];\n renderAnnotation: FileProps<LAnnotation>['renderAnnotation'];\n lineAnnotations: FileProps<LAnnotation>['lineAnnotations'];\n renderHoverUtility: FileProps<LAnnotation>['renderHoverUtility'];\n getHoveredLine(): GetHoveredLineResult<'file'> | undefined;\n}\nexport declare function renderFileChildren<LAnnotation>({ file, renderHeaderMetadata, renderAnnotation, lineAnnotations, renderHoverUtility, getHoveredLine }: RenderFileChildrenProps<LAnnotation>): ReactNode;\nexport {};\n//# sourceMappingURL=renderFileChildren.d.ts.map"],"mappings":";;;;;;UAIUI;QACAF;EADAE,
|
|
1
|
+
{"version":3,"file":"renderFileChildren.d.ts","names":["ReactNode","GetHoveredLineResult","FileContents","FileProps","RenderFileChildrenProps","LAnnotation","renderFileChildren","file","renderHeaderPrefix","renderHeaderMetadata","renderAnnotation","lineAnnotations","renderGutterUtility","renderHoverUtility","getHoveredLine"],"sources":["../../../src/react/utils/renderFileChildren.d.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { GetHoveredLineResult } from '../../managers/MouseEventManager';\nimport type { FileContents } from '../../types';\nimport type { FileProps } from '../types';\ninterface RenderFileChildrenProps<LAnnotation> {\n file: FileContents;\n renderHeaderPrefix: FileProps<LAnnotation>['renderHeaderPrefix'];\n renderHeaderMetadata: FileProps<LAnnotation>['renderHeaderMetadata'];\n renderAnnotation: FileProps<LAnnotation>['renderAnnotation'];\n lineAnnotations: FileProps<LAnnotation>['lineAnnotations'];\n renderGutterUtility: FileProps<LAnnotation>['renderGutterUtility'];\n renderHoverUtility: FileProps<LAnnotation>['renderHoverUtility'];\n getHoveredLine(): GetHoveredLineResult<'file'> | undefined;\n}\nexport declare function renderFileChildren<LAnnotation>({ file, renderHeaderPrefix, renderHeaderMetadata, renderAnnotation, lineAnnotations, renderGutterUtility, renderHoverUtility, getHoveredLine }: RenderFileChildrenProps<LAnnotation>): ReactNode;\nexport {};\n//# sourceMappingURL=renderFileChildren.d.ts.map"],"mappings":";;;;;;UAIUI;QACAF;EADAE,kBAAAA,EAEcD,SAFS,CAECE,WAFDA,CAAAA,CAAAA,oBAAA,CAAA;EACvBH,oBAAAA,EAEgBC,SAFhBD,CAE0BG,WAF1BH,CAAAA,CAAAA,sBAAAA,CAAAA;EACwBG,gBAAAA,EAEZF,SAFYE,CAEFA,WAFEA,CAAAA,CAAAA,kBAAAA,CAAAA;EAAVF,eAAAA,EAGHA,SAHGA,CAGOE,WAHPF,CAAAA,CAAAA,iBAAAA,CAAAA;EACYE,mBAAAA,EAGXF,SAHWE,CAGDA,WAHCA,CAAAA,CAAAA,qBAAAA,CAAAA;EAAVF,kBAAAA,EAIFA,SAJEA,CAIQE,WAJRF,CAAAA,CAAAA,oBAAAA,CAAAA;EACME,cAAAA,EAAAA,EAIVJ,oBAJUI,CAAAA,MAAAA,CAAAA,GAAAA,SAAAA;;AACDA,iBAKPC,kBALOD,CAAAA,WAAAA,CAAAA,CAAAA;EAAAA,IAAAA;EAAAA,kBAAAA;EAAAA,oBAAAA;EAAAA,gBAAAA;EAAAA,eAAAA;EAAAA,mBAAAA;EAAAA,kBAAAA;EAAAA;AAAAA,CAAAA,EAKyKD,uBALzKC,CAKiMA,WALjMA,CAAAA,CAAAA,EAKgNL,SALhNK"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import { HEADER_METADATA_SLOT_ID } from "../../constants.js";
|
|
1
|
+
import { HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID } from "../../constants.js";
|
|
2
2
|
import { getLineAnnotationName } from "../../utils/getLineAnnotationName.js";
|
|
3
|
-
import {
|
|
3
|
+
import { GutterUtilitySlotStyles } from "../constants.js";
|
|
4
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/react/utils/renderFileChildren.tsx
|
|
7
|
-
function renderFileChildren({ file, renderHeaderMetadata, renderAnnotation, lineAnnotations, renderHoverUtility, getHoveredLine }) {
|
|
7
|
+
function renderFileChildren({ file, renderHeaderPrefix, renderHeaderMetadata, renderAnnotation, lineAnnotations, renderGutterUtility, renderHoverUtility, getHoveredLine }) {
|
|
8
|
+
const gutterUtility = renderGutterUtility ?? renderHoverUtility;
|
|
9
|
+
const prefix = renderHeaderPrefix?.(file);
|
|
8
10
|
const metadata = renderHeaderMetadata?.(file);
|
|
9
11
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12
|
+
prefix != null && /* @__PURE__ */ jsx("div", {
|
|
13
|
+
slot: HEADER_PREFIX_SLOT_ID,
|
|
14
|
+
children: prefix
|
|
15
|
+
}),
|
|
10
16
|
metadata != null && /* @__PURE__ */ jsx("div", {
|
|
11
17
|
slot: HEADER_METADATA_SLOT_ID,
|
|
12
18
|
children: metadata
|
|
@@ -15,10 +21,10 @@ function renderFileChildren({ file, renderHeaderMetadata, renderAnnotation, line
|
|
|
15
21
|
slot: getLineAnnotationName(annotation),
|
|
16
22
|
children: renderAnnotation(annotation)
|
|
17
23
|
}, index)),
|
|
18
|
-
|
|
19
|
-
slot: "
|
|
20
|
-
style:
|
|
21
|
-
children:
|
|
24
|
+
gutterUtility != null && /* @__PURE__ */ jsx("div", {
|
|
25
|
+
slot: "gutter-utility-slot",
|
|
26
|
+
style: GutterUtilitySlotStyles,
|
|
27
|
+
children: gutterUtility(getHoveredLine)
|
|
22
28
|
})
|
|
23
29
|
] });
|
|
24
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderFileChildren.js","names":[],"sources":["../../../src/react/utils/renderFileChildren.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport {
|
|
1
|
+
{"version":3,"file":"renderFileChildren.js","names":[],"sources":["../../../src/react/utils/renderFileChildren.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport {\n HEADER_METADATA_SLOT_ID,\n HEADER_PREFIX_SLOT_ID,\n} from '../../constants';\nimport type { GetHoveredLineResult } from '../../managers/MouseEventManager';\nimport type { FileContents } from '../../types';\nimport { getLineAnnotationName } from '../../utils/getLineAnnotationName';\nimport { GutterUtilitySlotStyles } from '../constants';\nimport type { FileProps } from '../types';\n\ninterface RenderFileChildrenProps<LAnnotation> {\n file: FileContents;\n renderHeaderPrefix: FileProps<LAnnotation>['renderHeaderPrefix'];\n renderHeaderMetadata: FileProps<LAnnotation>['renderHeaderMetadata'];\n renderAnnotation: FileProps<LAnnotation>['renderAnnotation'];\n lineAnnotations: FileProps<LAnnotation>['lineAnnotations'];\n renderGutterUtility: FileProps<LAnnotation>['renderGutterUtility'];\n renderHoverUtility: FileProps<LAnnotation>['renderHoverUtility'];\n getHoveredLine(): GetHoveredLineResult<'file'> | undefined;\n}\n\nexport function renderFileChildren<LAnnotation>({\n file,\n renderHeaderPrefix,\n renderHeaderMetadata,\n renderAnnotation,\n lineAnnotations,\n renderGutterUtility,\n renderHoverUtility,\n getHoveredLine,\n}: RenderFileChildrenProps<LAnnotation>): ReactNode {\n const gutterUtility = renderGutterUtility ?? renderHoverUtility;\n const prefix = renderHeaderPrefix?.(file);\n const metadata = renderHeaderMetadata?.(file);\n return (\n <>\n {prefix != null && <div slot={HEADER_PREFIX_SLOT_ID}>{prefix}</div>}\n {metadata != null && <div slot={HEADER_METADATA_SLOT_ID}>{metadata}</div>}\n {renderAnnotation != null &&\n lineAnnotations?.map((annotation, index) => (\n <div key={index} slot={getLineAnnotationName(annotation)}>\n {renderAnnotation(annotation)}\n </div>\n ))}\n {gutterUtility != null && (\n <div slot=\"gutter-utility-slot\" style={GutterUtilitySlotStyles}>\n {gutterUtility(getHoveredLine)}\n </div>\n )}\n </>\n );\n}\n"],"mappings":";;;;;;AAuBA,SAAgB,mBAAgC,EAC9C,MACA,oBACA,sBACA,kBACA,iBACA,qBACA,oBACA,kBACkD;CAClD,MAAM,gBAAgB,uBAAuB;CAC7C,MAAM,SAAS,qBAAqB,KAAK;CACzC,MAAM,WAAW,uBAAuB,KAAK;AAC7C,QACE;EACG,UAAU,QAAQ,oBAAC;GAAI,MAAM;aAAwB;IAAa;EAClE,YAAY,QAAQ,oBAAC;GAAI,MAAM;aAA0B;IAAe;EACxE,oBAAoB,QACnB,iBAAiB,KAAK,YAAY,UAChC,oBAAC;GAAgB,MAAM,sBAAsB,WAAW;aACrD,iBAAiB,WAAW;KADrB,MAEJ,CACN;EACH,iBAAiB,QAChB,oBAAC;GAAI,MAAK;GAAsB,OAAO;aACpC,cAAc,eAAe;IAC1B;KAEP"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DEFAULT_COLLAPSED_CONTEXT_THRESHOLD, DEFAULT_EXPANDED_REGION, DEFAULT_RENDER_RANGE, DEFAULT_THEMES } from "../constants.js";
|
|
2
|
+
import { createGutterGap, createGutterItem, createGutterWrapper, createHastElement } from "../utils/hast_utils.js";
|
|
2
3
|
import { areLanguagesAttached } from "../highlighter/languages/areLanguagesAttached.js";
|
|
3
4
|
import { getHighlighterIfLoaded, getSharedHighlighter } from "../highlighter/shared_highlighter.js";
|
|
4
5
|
import { areThemesAttached } from "../highlighter/themes/areThemesAttached.js";
|
|
5
6
|
import { areRenderRangesEqual } from "../utils/areRenderRangesEqual.js";
|
|
6
7
|
import { areThemesEqual } from "../utils/areThemesEqual.js";
|
|
7
|
-
import { createGutterGap, createGutterItem, createGutterWrapper, createHastElement } from "../utils/hast_utils.js";
|
|
8
8
|
import { createAnnotationElement } from "../utils/createAnnotationElement.js";
|
|
9
9
|
import { createContentColumn } from "../utils/createContentColumn.js";
|
|
10
10
|
import { createFileHeaderElement } from "../utils/createFileHeaderElement.js";
|
|
@@ -99,7 +99,7 @@ var DiffHunksRenderer = class {
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
getOptionsWithDefaults() {
|
|
102
|
-
const { diffIndicators = "bars", diffStyle = "split", disableBackground = false, disableFileHeader = false, disableLineNumbers = false, disableVirtualizationBuffers = false, expandUnchanged = false, collapsedContextThreshold = DEFAULT_COLLAPSED_CONTEXT_THRESHOLD, expansionLineCount = 100, hunkSeparators = "line-info", lineDiffType = "word-alt", maxLineDiffLength = 1e3, overflow = "scroll", theme = DEFAULT_THEMES, themeType = "system", tokenizeMaxLineLength = 1e3, useCSSClasses = false } = this.options;
|
|
102
|
+
const { diffIndicators = "bars", diffStyle = "split", disableBackground = false, disableFileHeader = false, disableLineNumbers = false, disableVirtualizationBuffers = false, collapsed = false, expandUnchanged = false, collapsedContextThreshold = DEFAULT_COLLAPSED_CONTEXT_THRESHOLD, expansionLineCount = 100, hunkSeparators = "line-info", lineDiffType = "word-alt", maxLineDiffLength = 1e3, overflow = "scroll", theme = DEFAULT_THEMES, themeType = "system", tokenizeMaxLineLength = 1e3, useCSSClasses = false } = this.options;
|
|
103
103
|
return {
|
|
104
104
|
diffIndicators,
|
|
105
105
|
diffStyle,
|
|
@@ -107,6 +107,7 @@ var DiffHunksRenderer = class {
|
|
|
107
107
|
disableFileHeader,
|
|
108
108
|
disableLineNumbers,
|
|
109
109
|
disableVirtualizationBuffers,
|
|
110
|
+
collapsed,
|
|
110
111
|
expandUnchanged,
|
|
111
112
|
collapsedContextThreshold,
|
|
112
113
|
expansionLineCount,
|