Enhance/pdf (#2855)

* feat(pdf): add go to annations page to pdf viewer toolbar

* improve(pdf): try to fix highlight selection blink

* improve(pdf): remove annations layer

* fix(pdf): try to fix selection blink

* Squashed commit of the following:

commit 995fba8623
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Thu Sep 16 13:59:08 2021 +0800

    fix: disable plugins on the Web

commit d6a011fd35
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Thu Sep 16 12:31:01 2021 +0800

    enhance(perf): add :ref/linked-references-collapsed-threshold option

    Related to #2792

commit f59f59b9ae
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Sep 15 21:47:05 2021 +0800

    enhance: don't overwrite logseq's file if changes from journal file

    is empty or the default template content.

    To prevent overwritten when using iCloud/OneDrive/GDrive.

commit f5cdfaa2f1
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Sep 15 20:59:10 2021 +0800

    fix: add command-palette/toggle

commit ae25bb387f
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Sep 15 20:57:57 2021 +0800

    fix: add both Cmd+! and Cmd+Shift+p to configurable shortcuts

commit b20d29f813
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Sep 15 17:12:20 2021 +0800

    fix: don't count as failed writes if content from the disk

    is not matched to the content in logseq

commit ac89a36ab0
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Sep 15 14:31:48 2021 +0800

    chore: bump mldoc

commit c7128dfc87
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Sep 15 12:31:11 2021 +0800

    enhance: text update

commit d965394be2
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Sep 15 11:28:39 2021 +0800

    feat: add namespace query support

commit 4f1402ea42
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Sep 15 09:52:56 2021 +0800

    enhance: remove the plus icon for switching graphs

commit 3550e4bbf0
Author: Gustavo Santos <gustavofsantos@outlook.com>
Date:   Tue Sep 14 13:43:57 2021 -0300

    fix: set aria-checked to "true" if toggle is on

commit 640d447b3b
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Sep 15 09:48:47 2021 +0800

    debug: disable cache node modules temporally

commit 6ab7f44f5f
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Sep 15 00:01:14 2021 +0800

    enhance: marketplace polish

commit 07063f1592
Author: charlie <xyhp915@qq.com>
Date:   Tue Sep 14 18:27:06 2021 +0800

    fix(plugin): restart app not work

commit 7b909704ab
Author: charlie <xyhp915@qq.com>
Date:   Tue Sep 14 15:43:30 2021 +0800

    fix(ui): broken width for plugins page when toggling widen mode

commit d456ed7823
Author: charlie <xyhp915@qq.com>
Date:   Tue Sep 14 15:36:32 2021 +0800

    enhance(plugin): polish marketplace ui

* fix(pdf): try to fix horizontal scroller when viewer overflow

* fix(pdf): make text selectable for embed highlight range

* feat(pdf): pager of viewer on toolbar

* fix: conflicts

* improve(pdf): register shortcuts for pager

* improve(pdf): try to fix area image blurry for high dpi screen

* improve(pdf): support dashed style for area highlight

* fix(pdf): change shortcuts for win32
This commit is contained in:
Charlie
2021-09-22 12:14:39 +08:00
committed by GitHub
parent 9dce190204
commit e47ad9909d
9 changed files with 240 additions and 56 deletions

View File

@@ -12,6 +12,13 @@
--ph-view-container-width: 42vw;
}
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
.extensions__pdf {
&-container {
@@ -54,6 +61,33 @@
border-bottom: 2px solid #969494;
border-radius: 0;
}
&:active {
opacity: .6;
}
}
}
.pager {
> .nu {
padding-right: 4px;
input {
user-select: inherit;
width: 35px;
text-align: right;
padding-right: 4px;
}
}
> .ct {
.button {
margin: 0;
&:last-child {
padding-right: 3px;
}
}
}
}
}
@@ -61,11 +95,7 @@
&-outline {
position: absolute;
right: 30px;
&-wrap {
}
right: 15px;
> section {
white-space: pre-wrap;
@@ -150,7 +180,7 @@
&-settings {
&-inner.hls-popup-box {
position: absolute;
right: 206px;
right: 345px;
width: 178px;
padding: 15px 10px;
}
@@ -190,13 +220,23 @@
}
}
}
&.toggle-input {
align-items: center;
justify-content: space-between;
font-size: 11px;
padding: 0 9px;
padding-top: 12px;
margin-top: 13px;
opacity: 0.8;
border-top: 1px solid #ccc;
}
}
}
&-viewer {
position: absolute;
overflow-y: auto;
overflow-x: hidden;
overflow: auto;
width: 100%;
height: 100%;
@@ -204,13 +244,13 @@
}
> .pdfViewer {
overflow: hidden;
&.disabled-text-selection {
user-select: none;
pointer-events: none;
}
}
}
&-resizer {
@@ -239,25 +279,41 @@
background-color: #FCD713FF;
mix-blend-mode: multiply;
touch-action: none;
border-style: dashed;
&[data-color=yellow] {
background-color: var(--ph-highlight-color-yellow);
border-color: var(--ph-highlight-color-yellow);
}
&[data-color=blue] {
background-color: var(--ph-highlight-color-blue);
border-color: var(--ph-highlight-color-blue);
}
&[data-color=green] {
background-color: var(--ph-highlight-color-green);
border-color: var(--ph-highlight-color-green);
}
&[data-color=red] {
background-color: var(--ph-highlight-color-red);
border-color: var(--ph-highlight-color-red);
}
&[data-color=purple] {
background-color: var(--ph-highlight-color-purple);
border-color: var(--ph-highlight-color-purple);
}
}
&-viewer.is-area-dashed {
.extensions__pdf {
&-hls-area-region {
background-color: transparent;
border-width: 3px;
opacity: 1 !important;
}
}
}
@@ -393,6 +449,8 @@
&-wrap {
position: absolute;
top: 40px;
right: 0;
left: 0;
width: 100%;
height: 92vh;
background-color: rgba(0, 0, 0, 0);
@@ -557,6 +615,7 @@
img {
margin: 0;
box-shadow: none;
max-width: 80%;
}
}
}
@@ -634,6 +693,10 @@ body.is-pdf-active {
top: 0;
z-index: 3;
.highlightAnnotation, .underlineAnnotation {
display: none;
}
}
.textLayer ::selection {