vue-book-reader 1.2.2 → 1.2.3

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <div align="center">
2
2
  <img width=250 src="https://raw.githubusercontent.com/jinhuan138/vue--book-reader/master/public/logo.png" />
3
- <h1>VueReader</h1>
3
+ <h1>VueBookReader</h1>
4
4
  </div>
5
5
 
6
6
  <p>
@@ -37,7 +37,7 @@ And in your vue-component...
37
37
  ```vue
38
38
  <template>
39
39
  <div style="height: 100vh">
40
- <vue-reader url="/files/啼笑因缘.epub" />
40
+ <vue-reader url="/vue-book-reader/files/啼笑因缘.epub" />
41
41
  </div>
42
42
  </template>
43
43
  <script setup>
@@ -45,23 +45,46 @@ import { VueReader } from 'vue-book-reader'
45
45
  </script>
46
46
  ```
47
47
 
48
- ## VueReader Attributes
48
+ ## VueReader API
49
49
 
50
- | **Name** | **Description** | **Type** | **Default** |
51
- | -------- | --------------------------------- | ---------------------- | ----------- |
52
- | url | book url or File | `string`/`File` | — |
53
- | location | set / update location of the book | `string`/`number` | — |
54
- | title | the title of the book | `string` | — |
55
- | showToc | whether to show the toc | `boolean` | true |
50
+ ### VueReader Attributes
56
51
 
57
- ## VueReader Slots
52
+ | **Name** | **Description** | **Type** | **Default** |
53
+ | -------- | --------------------------------- | ------------------------------------- | ----------- |
54
+ | url | book url or File | `string`/`File` | — |
55
+ | location | set / update location of the book | `string`/`number` | — |
56
+ | title | the title of the book | `string` | — |
57
+ | showToc | whether to show the toc | `boolean` | true |
58
+ | [BookView Attributes](#bookview-attributes) | BookView attributes all can be used. | - |
58
59
 
59
- | **Name** | **Description** |
60
- | -------- | ----------------------------------------------------------------------------------- |
61
- | title | You have access to title by [slot](https://v3.vuejs.org/guide/component-slots.html) |
62
- | loadingView | epub view loadingView |
60
+ ### VueReader Slots
63
61
 
64
- ## EpubView Exposes
62
+ | **Name** | **Description** |
63
+ | --------------------------------- | --------------------------------- |
64
+ | title | book title |
65
+ | [BookView slots](#bookview-slots) | BookView slots all can be used. |
66
+
67
+ ### VueReader Exposes
68
+ | **Name** | **Description** |
69
+ | ------------------------------------- | ----------------------------------- |
70
+ | [BookView Exposes](#bookview-exposes) | BookView exposes all can be used. |
71
+ ## BookView API
72
+
73
+ ### BookView Attributes
74
+
75
+ | **Name** | **Description** | **Type** | **Default** |
76
+ | ---------- | --------------------------------- | ----------------------- | ---------------- |
77
+ | url | book url or File | `string`/`File` |
78
+ | tocChanged | get an array representing the table of contents of the book | `function(href)` |
79
+
80
+ ### BookView Slots
81
+
82
+ | **Name** | **Description** |
83
+ | ----------- | ------------------------ |
84
+ | loadingView | BookView loadingView |
85
+ | errorView | BookView errorView |
86
+
87
+ ### BookView Exposes
65
88
 
66
89
  | **Name** | **Description** | **Type** |
67
90
  | ----------- | ---------------------- | ---------------- |
@@ -69,3 +92,8 @@ import { VueReader } from 'vue-book-reader'
69
92
  | prevPage | display previous page | `function` |
70
93
  | setLocation | Set the page | `function(href)` |
71
94
 
95
+ <style>
96
+ html:focus-within {
97
+ scroll-behavior: smooth;
98
+ }
99
+ </style>
package/lib/index.css CHANGED
@@ -1,33 +1,33 @@
1
1
 
2
- .reader[data-v-1350176b] {
2
+ .reader[data-v-cbfdb46e] {
3
3
  position: absolute;
4
4
  inset: 50px 50px 20px;
5
5
  }
6
- .viewHolder[data-v-1350176b] {
6
+ .viewHolder[data-v-cbfdb46e] {
7
7
  height: 100%;
8
8
  width: 100%;
9
9
  position: relative;
10
10
  }
11
- #viewer[data-v-1350176b] {
11
+ #viewer[data-v-cbfdb46e] {
12
12
  height: 100%;
13
13
  }
14
14
 
15
15
  /* ↓ */
16
- .tocAreaButton .expansion[data-v-faba9f3e]::before {
16
+ .tocAreaButton .expansion[data-v-9d18782d]::before {
17
17
  transform: rotate(-45deg) translateX(2.5px);
18
18
  }
19
- .tocAreaButton .expansion[data-v-faba9f3e]::after {
19
+ .tocAreaButton .expansion[data-v-9d18782d]::after {
20
20
  transform: rotate(45deg) translateX(-2.5px);
21
21
  }
22
22
 
23
23
  /* ↑ */
24
- .tocAreaButton .open[data-v-faba9f3e]::before {
24
+ .tocAreaButton .open[data-v-9d18782d]::before {
25
25
  transform: rotate(45deg) translateX(2.5px);
26
26
  }
27
- .tocAreaButton .open[data-v-faba9f3e]::after {
27
+ .tocAreaButton .open[data-v-9d18782d]::after {
28
28
  transform: rotate(-45deg) translateX(-2.5px);
29
29
  }
30
- .tocAreaButton[data-v-faba9f3e] {
30
+ .tocAreaButton[data-v-9d18782d] {
31
31
  user-select: none;
32
32
  appearance: none;
33
33
  background: none;
@@ -45,19 +45,19 @@
45
45
  cursor: pointer;
46
46
  position: relative;
47
47
  }
48
- .tocAreaButton[data-v-faba9f3e]:hover {
48
+ .tocAreaButton[data-v-9d18782d]:hover {
49
49
  background: rgba(0, 0, 0, 0.05);
50
50
  }
51
- .tocAreaButton[data-v-faba9f3e]:active {
51
+ .tocAreaButton[data-v-9d18782d]:active {
52
52
  background: rgba(0, 0, 0, 0.1);
53
53
  }
54
- .active[data-v-faba9f3e] {
54
+ .active[data-v-9d18782d] {
55
55
  color: #1565c0;
56
56
  border-bottom: 2px solid #1565c0;
57
57
  }
58
58
 
59
59
  /* 二级目录 */
60
- .tocAreaButton .expansion[data-v-faba9f3e] {
60
+ .tocAreaButton .expansion[data-v-9d18782d] {
61
61
  cursor: pointer;
62
62
  transform: translateY(-50%);
63
63
  top: 50%;
@@ -69,8 +69,8 @@
69
69
  transform 0.3s ease-in-out,
70
70
  top 0.3s ease-in-out;
71
71
  }
72
- .tocAreaButton .expansion[data-v-faba9f3e]::after,
73
- .tocAreaButton .expansion[data-v-faba9f3e]::before {
72
+ .tocAreaButton .expansion[data-v-9d18782d]::after,
73
+ .tocAreaButton .expansion[data-v-9d18782d]::before {
74
74
  content: '';
75
75
  position: absolute;
76
76
  width: 6px;
@@ -83,15 +83,15 @@
83
83
  }
84
84
 
85
85
  /* container */
86
- .container[data-v-e3dfdabb] {
86
+ .container[data-v-94907056] {
87
87
  overflow: hidden;
88
88
  position: relative;
89
89
  height: 100%;
90
90
  }
91
- .containerExpanded[data-v-e3dfdabb] {
91
+ .containerExpanded[data-v-94907056] {
92
92
  transform: translateX(256px);
93
93
  }
94
- .readerArea[data-v-e3dfdabb] {
94
+ .readerArea[data-v-94907056] {
95
95
  position: relative;
96
96
  z-index: 1;
97
97
  height: 100%;
@@ -99,7 +99,7 @@
99
99
  background-color: #fff;
100
100
  transition: all 0.3s ease;
101
101
  }
102
- .container .titleArea[data-v-e3dfdabb] {
102
+ .container .titleArea[data-v-94907056] {
103
103
  position: absolute;
104
104
  top: 20px;
105
105
  left: 50px;
@@ -112,7 +112,7 @@
112
112
  }
113
113
 
114
114
  /* toc */
115
- .tocBackground[data-v-e3dfdabb] {
115
+ .tocBackground[data-v-94907056] {
116
116
  position: absolute;
117
117
  left: 256px;
118
118
  top: 0;
@@ -120,7 +120,7 @@
120
120
  right: 0;
121
121
  z-index: 1;
122
122
  }
123
- .tocArea[data-v-e3dfdabb] {
123
+ .tocArea[data-v-94907056] {
124
124
  position: absolute;
125
125
  left: 0;
126
126
  top: 0;
@@ -134,18 +134,18 @@
134
134
  }
135
135
 
136
136
  /* 滚动条 */
137
- .tocArea[data-v-e3dfdabb]::-webkit-scrollbar {
137
+ .tocArea[data-v-94907056]::-webkit-scrollbar {
138
138
  width: 5px;
139
139
  height: 5px;
140
140
  }
141
- .tocArea[data-v-e3dfdabb]::-webkit-scrollbar-thumb:vertical {
141
+ .tocArea[data-v-94907056]::-webkit-scrollbar-thumb:vertical {
142
142
  height: 5px;
143
143
  background-color: rgba(0, 0, 0, 0.1);
144
144
  border-radius: 0.5rem;
145
145
  }
146
146
 
147
147
  /* tocButton */
148
- .tocButton[data-v-e3dfdabb] {
148
+ .tocButton[data-v-94907056] {
149
149
  background: none;
150
150
  border: none;
151
151
  width: 32px;
@@ -157,7 +157,7 @@
157
157
  outline: none;
158
158
  cursor: pointer;
159
159
  }
160
- .tocButtonBar[data-v-e3dfdabb] {
160
+ .tocButtonBar[data-v-94907056] {
161
161
  position: absolute;
162
162
  width: 60%;
163
163
  background: #ccc;
@@ -167,12 +167,12 @@
167
167
  top: 50%;
168
168
  transition: all 0.5s ease;
169
169
  }
170
- .tocButtonExpanded[data-v-e3dfdabb] {
170
+ .tocButtonExpanded[data-v-94907056] {
171
171
  background: #f2f2f2;
172
172
  }
173
173
 
174
174
  /* 翻页 */
175
- .arrow[data-v-e3dfdabb] {
175
+ .arrow[data-v-94907056] {
176
176
  outline: none;
177
177
  border: none;
178
178
  background: none;
@@ -188,22 +188,22 @@
188
188
  appearance: none;
189
189
  font-weight: normal;
190
190
  }
191
- .arrow[data-v-e3dfdabb]:hover {
191
+ .arrow[data-v-94907056]:hover {
192
192
  color: #777;
193
193
  }
194
- .arrow[data-v-e3dfdabb]:disabled {
194
+ .arrow[data-v-94907056]:disabled {
195
195
  cursor: not-allowed;
196
196
  color: #e2e2e2;
197
197
  }
198
- .prev[data-v-e3dfdabb] {
198
+ .prev[data-v-94907056] {
199
199
  left: 1px;
200
200
  }
201
- .next[data-v-e3dfdabb] {
201
+ .next[data-v-94907056] {
202
202
  right: 1px;
203
203
  }
204
204
 
205
205
  /* loading */
206
- .loadingView[data-v-e3dfdabb] {
206
+ .loadingView[data-v-94907056] {
207
207
  position: absolute;
208
208
  top: 50%;
209
209
  left: 10%;
@@ -214,7 +214,7 @@
214
214
  }
215
215
 
216
216
  /* errorView */
217
- .errorView[data-v-e3dfdabb] {
217
+ .errorView[data-v-94907056] {
218
218
  position: absolute;
219
219
  top: 50%;
220
220
  left: 10%;