-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Preview with react-pdf-highlighter (#89)
* feat: add selected style to chunk item * feat: hightlight pdf * feat: add Preview with react-pdf-highlighter
- Loading branch information
Showing
13 changed files
with
426 additions
and
42 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,7 @@ | |
font-style: normal; | ||
} | ||
} | ||
|
||
.cardSelected { | ||
background-color: @selectedBackgroundColor; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...pages/add-knowledge/components/knowledge-chunk/components/document-preview/hightlights.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
export const testHighlights = [ | ||
{ | ||
content: { | ||
text: '实验证明,由氧氯化锆锂和高镍三元正极组成的全固态锂电池展示了极为优异的性能:在12 分钟快速充电的条件下,该电池仍然成功地在室温稳定循环2000 圈以上。', | ||
}, | ||
position: { | ||
boundingRect: { | ||
x1: 219.7, | ||
y1: 204.3, | ||
x2: 547.0, | ||
y2: 264.0, | ||
width: 849, | ||
height: 1200, | ||
}, | ||
rects: [ | ||
{ | ||
x1: 219.7, | ||
y1: 204.3, | ||
x2: 547.0, | ||
y2: 264.0, | ||
width: 849, | ||
height: 1200, | ||
}, | ||
], | ||
pageNumber: 9, | ||
}, | ||
comment: { | ||
text: 'Flow or TypeScript?', | ||
emoji: '🔥', | ||
}, | ||
id: '8245652131754351', | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 7 additions & 2 deletions
9
...src/pages/add-knowledge/components/knowledge-chunk/components/document-preview/index.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
.documentContainer { | ||
width: 100%; | ||
height: calc(100vh - 284px); | ||
overflow-y: auto; | ||
overflow-x: hidden; | ||
// overflow-y: auto; | ||
// overflow-x: hidden; | ||
position: relative; | ||
:global(.PdfHighlighter) { | ||
overflow-x: hidden; | ||
// left: 0; | ||
} | ||
} |
Oops, something went wrong.