From e47cbe1286a2143b0f8078a683e96edea0ed967b Mon Sep 17 00:00:00 2001 From: Bart Riepe Date: Thu, 19 Oct 2023 14:06:06 +0900 Subject: [PATCH] feat: add summary element and fold expansion/folding (fixes #22, #21) --- examples/src/index.tsx | 23 ++++++++- src/compute-hidden-blocks.ts | 2 +- src/expand.tsx | 3 ++ src/fold.tsx | 3 ++ src/index.tsx | 98 ++++++++++++++++++++++++------------ src/styles.ts | 38 +++++++++++++- 6 files changed, 132 insertions(+), 35 deletions(-) create mode 100644 src/expand.tsx create mode 100644 src/fold.tsx diff --git a/examples/src/index.tsx b/examples/src/index.tsx index 4a8d3e2..e825169 100644 --- a/examples/src/index.tsx +++ b/examples/src/index.tsx @@ -18,6 +18,7 @@ interface ExampleState { language?: string; theme: 'dark' | 'light'; enableSyntaxHighlighting?: boolean; + columnHeaders: boolean; compareMethod?: DiffMethod; customGutter?: boolean; } @@ -31,6 +32,7 @@ class Example extends Component<{}, ExampleState> { highlightLine: [], theme: 'dark', splitView: true, + columnHeaders: true, customGutter: true, enableSyntaxHighlighting: true, compareMethod: DiffMethod.CHARS @@ -145,6 +147,22 @@ class Example extends Component<{}, ExampleState> { Syntax highlighting +
+ + Column Headers +