vue-book-reader 1.2.3 → 1.2.4

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/lib/index.css CHANGED
@@ -13,21 +13,21 @@
13
13
  }
14
14
 
15
15
  /* ↓ */
16
- .tocAreaButton .expansion[data-v-9d18782d]::before {
16
+ .tocAreaButton .expansion[data-v-56e71b55]::before {
17
17
  transform: rotate(-45deg) translateX(2.5px);
18
18
  }
19
- .tocAreaButton .expansion[data-v-9d18782d]::after {
19
+ .tocAreaButton .expansion[data-v-56e71b55]::after {
20
20
  transform: rotate(45deg) translateX(-2.5px);
21
21
  }
22
22
 
23
23
  /* ↑ */
24
- .tocAreaButton .open[data-v-9d18782d]::before {
24
+ .tocAreaButton .open[data-v-56e71b55]::before {
25
25
  transform: rotate(45deg) translateX(2.5px);
26
26
  }
27
- .tocAreaButton .open[data-v-9d18782d]::after {
27
+ .tocAreaButton .open[data-v-56e71b55]::after {
28
28
  transform: rotate(-45deg) translateX(-2.5px);
29
29
  }
30
- .tocAreaButton[data-v-9d18782d] {
30
+ .tocAreaButton[data-v-56e71b55] {
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-9d18782d]:hover {
48
+ .tocAreaButton[data-v-56e71b55]:hover {
49
49
  background: rgba(0, 0, 0, 0.05);
50
50
  }
51
- .tocAreaButton[data-v-9d18782d]:active {
51
+ .tocAreaButton[data-v-56e71b55]:active {
52
52
  background: rgba(0, 0, 0, 0.1);
53
53
  }
54
- .active[data-v-9d18782d] {
54
+ .active[data-v-56e71b55] {
55
55
  color: #1565c0;
56
56
  border-bottom: 2px solid #1565c0;
57
57
  }
58
58
 
59
59
  /* 二级目录 */
60
- .tocAreaButton .expansion[data-v-9d18782d] {
60
+ .tocAreaButton .expansion[data-v-56e71b55] {
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-9d18782d]::after,
73
- .tocAreaButton .expansion[data-v-9d18782d]::before {
72
+ .tocAreaButton .expansion[data-v-56e71b55]::after,
73
+ .tocAreaButton .expansion[data-v-56e71b55]::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-94907056] {
86
+ .container[data-v-ce33d15c] {
87
87
  overflow: hidden;
88
88
  position: relative;
89
89
  height: 100%;
90
90
  }
91
- .containerExpanded[data-v-94907056] {
91
+ .containerExpanded[data-v-ce33d15c] {
92
92
  transform: translateX(256px);
93
93
  }
94
- .readerArea[data-v-94907056] {
94
+ .readerArea[data-v-ce33d15c] {
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-94907056] {
102
+ .container .titleArea[data-v-ce33d15c] {
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-94907056] {
115
+ .tocBackground[data-v-ce33d15c] {
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-94907056] {
123
+ .tocArea[data-v-ce33d15c] {
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-94907056]::-webkit-scrollbar {
137
+ .tocArea[data-v-ce33d15c]::-webkit-scrollbar {
138
138
  width: 5px;
139
139
  height: 5px;
140
140
  }
141
- .tocArea[data-v-94907056]::-webkit-scrollbar-thumb:vertical {
141
+ .tocArea[data-v-ce33d15c]::-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-94907056] {
148
+ .tocButton[data-v-ce33d15c] {
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-94907056] {
160
+ .tocButtonBar[data-v-ce33d15c] {
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-94907056] {
170
+ .tocButtonExpanded[data-v-ce33d15c] {
171
171
  background: #f2f2f2;
172
172
  }
173
173
 
174
174
  /* 翻页 */
175
- .arrow[data-v-94907056] {
175
+ .arrow[data-v-ce33d15c] {
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-94907056]:hover {
191
+ .arrow[data-v-ce33d15c]:hover {
192
192
  color: #777;
193
193
  }
194
- .arrow[data-v-94907056]:disabled {
194
+ .arrow[data-v-ce33d15c]:disabled {
195
195
  cursor: not-allowed;
196
196
  color: #e2e2e2;
197
197
  }
198
- .prev[data-v-94907056] {
198
+ .prev[data-v-ce33d15c] {
199
199
  left: 1px;
200
200
  }
201
- .next[data-v-94907056] {
201
+ .next[data-v-ce33d15c] {
202
202
  right: 1px;
203
203
  }
204
204
 
205
205
  /* loading */
206
- .loadingView[data-v-94907056] {
206
+ .loadingView[data-v-ce33d15c] {
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-94907056] {
217
+ .errorView[data-v-ce33d15c] {
218
218
  position: absolute;
219
219
  top: 50%;
220
220
  left: 10%;
@@ -0,0 +1,175 @@
1
+ const createSVGElement = tag =>
2
+ document.createElementNS('http://www.w3.org/2000/svg', tag)
3
+
4
+ export class Overlayer {
5
+ #svg = createSVGElement('svg')
6
+ #map = new Map()
7
+ constructor() {
8
+ Object.assign(this.#svg.style, {
9
+ position: 'absolute', top: '0', left: '0',
10
+ width: '100%', height: '100%',
11
+ pointerEvents: 'none',
12
+ })
13
+ }
14
+ get element() {
15
+ return this.#svg
16
+ }
17
+ add(key, range, draw, options) {
18
+ if (this.#map.has(key)) this.remove(key)
19
+ if (typeof range === 'function') range = range(this.#svg.getRootNode())
20
+ const rects = range.getClientRects()
21
+ const element = draw(rects, options)
22
+ this.#svg.append(element)
23
+ this.#map.set(key, { range, draw, options, element, rects })
24
+ }
25
+ remove(key) {
26
+ if (!this.#map.has(key)) return
27
+ this.#svg.removeChild(this.#map.get(key).element)
28
+ this.#map.delete(key)
29
+ }
30
+ redraw() {
31
+ for (const obj of this.#map.values()) {
32
+ const { range, draw, options, element } = obj
33
+ this.#svg.removeChild(element)
34
+ const rects = range.getClientRects()
35
+ const el = draw(rects, options)
36
+ this.#svg.append(el)
37
+ obj.element = el
38
+ obj.rects = rects
39
+ }
40
+ }
41
+ hitTest({ x, y }) {
42
+ const arr = Array.from(this.#map.entries())
43
+ // loop in reverse to hit more recently added items first
44
+ for (let i = arr.length - 1; i >= 0; i--) {
45
+ const [key, obj] = arr[i]
46
+ for (const { left, top, right, bottom } of obj.rects)
47
+ if (top <= y && left <= x && bottom > y && right > x)
48
+ return [key, obj.range]
49
+ }
50
+ return []
51
+ }
52
+ static underline(rects, options = {}) {
53
+ const { color = 'red', width: strokeWidth = 2, writingMode } = options
54
+ const g = createSVGElement('g')
55
+ g.setAttribute('fill', color)
56
+ if (writingMode === 'vertical-rl' || writingMode === 'vertical-lr')
57
+ for (const { right, top, height } of rects) {
58
+ const el = createSVGElement('rect')
59
+ el.setAttribute('x', right - strokeWidth)
60
+ el.setAttribute('y', top)
61
+ el.setAttribute('height', height)
62
+ el.setAttribute('width', strokeWidth)
63
+ g.append(el)
64
+ }
65
+ else for (const { left, bottom, width } of rects) {
66
+ const el = createSVGElement('rect')
67
+ el.setAttribute('x', left)
68
+ el.setAttribute('y', bottom - strokeWidth)
69
+ el.setAttribute('height', strokeWidth)
70
+ el.setAttribute('width', width)
71
+ g.append(el)
72
+ }
73
+ return g
74
+ }
75
+ static strikethrough(rects, options = {}) {
76
+ const { color = 'red', width: strokeWidth = 2, writingMode } = options
77
+ const g = createSVGElement('g')
78
+ g.setAttribute('fill', color)
79
+ if (writingMode === 'vertical-rl' || writingMode === 'vertical-lr')
80
+ for (const { right, left, top, height } of rects) {
81
+ const el = createSVGElement('rect')
82
+ el.setAttribute('x', (right + left) / 2)
83
+ el.setAttribute('y', top)
84
+ el.setAttribute('height', height)
85
+ el.setAttribute('width', strokeWidth)
86
+ g.append(el)
87
+ }
88
+ else for (const { left, top, bottom, width } of rects) {
89
+ const el = createSVGElement('rect')
90
+ el.setAttribute('x', left)
91
+ el.setAttribute('y', (top + bottom) / 2)
92
+ el.setAttribute('height', strokeWidth)
93
+ el.setAttribute('width', width)
94
+ g.append(el)
95
+ }
96
+ return g
97
+ }
98
+ static squiggly(rects, options = {}) {
99
+ const { color = 'red', width: strokeWidth = 2, writingMode } = options
100
+ const g = createSVGElement('g')
101
+ g.setAttribute('fill', 'none')
102
+ g.setAttribute('stroke', color)
103
+ g.setAttribute('stroke-width', strokeWidth)
104
+ const block = strokeWidth * 1.5
105
+ if (writingMode === 'vertical-rl' || writingMode === 'vertical-lr')
106
+ for (const { right, top, height } of rects) {
107
+ const el = createSVGElement('path')
108
+ const n = Math.round(height / block / 1.5)
109
+ const inline = height / n
110
+ const ls = Array.from({ length: n },
111
+ (_, i) => `l${i % 2 ? -block : block} ${inline}`).join('')
112
+ el.setAttribute('d', `M${right} ${top}${ls}`)
113
+ g.append(el)
114
+ }
115
+ else for (const { left, bottom, width } of rects) {
116
+ const el = createSVGElement('path')
117
+ const n = Math.round(width / block / 1.5)
118
+ const inline = width / n
119
+ const ls = Array.from({ length: n },
120
+ (_, i) => `l${inline} ${i % 2 ? block : -block}`).join('')
121
+ el.setAttribute('d', `M${left} ${bottom}${ls}`)
122
+ g.append(el)
123
+ }
124
+ return g
125
+ }
126
+ static highlight(rects, options = {}) {
127
+ const { color = 'red' } = options
128
+ const g = createSVGElement('g')
129
+ g.setAttribute('fill', color)
130
+ g.style.opacity = 'var(--overlayer-highlight-opacity, .3)'
131
+ g.style.mixBlendMode = 'var(--overlayer-highlight-blend-mode, normal)'
132
+ for (const { left, top, height, width } of rects) {
133
+ const el = createSVGElement('rect')
134
+ el.setAttribute('x', left)
135
+ el.setAttribute('y', top)
136
+ el.setAttribute('height', height)
137
+ el.setAttribute('width', width)
138
+ g.append(el)
139
+ }
140
+ return g
141
+ }
142
+ static outline(rects, options = {}) {
143
+ const { color = 'red', width: strokeWidth = 3, radius = 3 } = options
144
+ const g = createSVGElement('g')
145
+ g.setAttribute('fill', 'none')
146
+ g.setAttribute('stroke', color)
147
+ g.setAttribute('stroke-width', strokeWidth)
148
+ for (const { left, top, height, width } of rects) {
149
+ const el = createSVGElement('rect')
150
+ el.setAttribute('x', left)
151
+ el.setAttribute('y', top)
152
+ el.setAttribute('height', height)
153
+ el.setAttribute('width', width)
154
+ el.setAttribute('rx', radius)
155
+ g.append(el)
156
+ }
157
+ return g
158
+ }
159
+ // make an exact copy of an image in the overlay
160
+ // one can then apply filters to the entire element, without affecting them;
161
+ // it's a bit silly and probably better to just invert images twice
162
+ // (though the color will be off in that case if you do heu-rotate)
163
+ static copyImage([rect], options = {}) {
164
+ const { src } = options
165
+ const image = createSVGElement('image')
166
+ const { left, top, height, width } = rect
167
+ image.setAttribute('href', src)
168
+ image.setAttribute('x', left)
169
+ image.setAttribute('y', top)
170
+ image.setAttribute('height', height)
171
+ image.setAttribute('width', width)
172
+ return image
173
+ }
174
+ }
175
+
@@ -1789,7 +1789,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1789
1789
  };
1790
1790
  }
1791
1791
  });
1792
- const Toc = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-9d18782d"]]);
1792
+ const Toc = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-56e71b55"]]);
1793
1793
  const _hoisted_1 = { class: "container" };
1794
1794
  const _hoisted_2 = ["title"];
1795
1795
  const _hoisted_3 = { key: 0 };
@@ -1931,7 +1931,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1931
1931
  };
1932
1932
  }
1933
1933
  });
1934
- const VueReader = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-94907056"]]);
1934
+ const VueReader = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ce33d15c"]]);
1935
1935
  const findIndices = (arr, f2) => arr.map((x2, i2, a2) => f2(x2, i2, a2) ? i2 : null).filter((x2) => x2 != null);
1936
1936
  const splitAt = (arr, is) => [-1, ...is, arr.length].reduce(({ xs, a: a2 }, b2) => ({ xs: (xs == null ? void 0 : xs.concat([arr.slice(a2 + 1, b2)])) ?? [], a: b2 }), {}).xs;
1937
1937
  const concatArrays = (a2, b2) => a2.slice(0, -1).concat([a2[a2.length - 1].concat(b2[0])]).concat(b2.slice(1));
@@ -3,7 +3,7 @@
3
3
  })(this, (function(exports2, vue) {
4
4
  "use strict";
5
5
  var __vite_style__ = document.createElement("style");
6
- __vite_style__.textContent = "\n.reader[data-v-cbfdb46e] {\r\n position: absolute;\r\n inset: 50px 50px 20px;\n}\n.viewHolder[data-v-cbfdb46e] {\r\n height: 100%;\r\n width: 100%;\r\n position: relative;\n}\n#viewer[data-v-cbfdb46e] {\r\n height: 100%;\n}\r\n\r\n/* ↓ */\n.tocAreaButton .expansion[data-v-9d18782d]::before {\r\n transform: rotate(-45deg) translateX(2.5px);\n}\n.tocAreaButton .expansion[data-v-9d18782d]::after {\r\n transform: rotate(45deg) translateX(-2.5px);\n}\r\n\r\n/* ↑ */\n.tocAreaButton .open[data-v-9d18782d]::before {\r\n transform: rotate(45deg) translateX(2.5px);\n}\n.tocAreaButton .open[data-v-9d18782d]::after {\r\n transform: rotate(-45deg) translateX(-2.5px);\n}\n.tocAreaButton[data-v-9d18782d] {\r\n user-select: none;\r\n appearance: none;\r\n background: none;\r\n border: none;\r\n display: block;\r\n font-family: sans-serif;\r\n width: 100%;\r\n font-size: 0.9em;\r\n text-align: left;\r\n padding: 0.9em 1em;\r\n border-bottom: 1px solid #ddd;\r\n color: #aaa;\r\n box-sizing: border-box;\r\n outline: none;\r\n cursor: pointer;\r\n position: relative;\n}\n.tocAreaButton[data-v-9d18782d]:hover {\r\n background: rgba(0, 0, 0, 0.05);\n}\n.tocAreaButton[data-v-9d18782d]:active {\r\n background: rgba(0, 0, 0, 0.1);\n}\n.active[data-v-9d18782d] {\r\n color: #1565c0;\r\n border-bottom: 2px solid #1565c0;\n}\r\n\r\n/* 二级目录 */\n.tocAreaButton .expansion[data-v-9d18782d] {\r\n cursor: pointer;\r\n transform: translateY(-50%);\r\n top: 50%;\r\n right: 12px;\r\n position: absolute;\r\n width: 10px;\r\n background-color: #a2a5b4;\r\n transition:\r\n transform 0.3s ease-in-out,\r\n top 0.3s ease-in-out;\n}\n.tocAreaButton .expansion[data-v-9d18782d]::after,\r\n.tocAreaButton .expansion[data-v-9d18782d]::before {\r\n content: '';\r\n position: absolute;\r\n width: 6px;\r\n height: 2px;\r\n background-color: currentcolor;\r\n border-radius: 2px;\r\n transition:\r\n transform 0.3s ease-in-out,\r\n top 0.3s ease-in-out;\n}\r\n\r\n/* container */\n.container[data-v-94907056] {\r\n overflow: hidden;\r\n position: relative;\r\n height: 100%;\n}\n.containerExpanded[data-v-94907056] {\r\n transform: translateX(256px);\n}\n.readerArea[data-v-94907056] {\r\n position: relative;\r\n z-index: 1;\r\n height: 100%;\r\n width: 100%;\r\n background-color: #fff;\r\n transition: all 0.3s ease;\n}\n.container .titleArea[data-v-94907056] {\r\n position: absolute;\r\n top: 20px;\r\n left: 50px;\r\n right: 50px;\r\n text-align: center;\r\n color: #999;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\n}\r\n\r\n/* toc */\n.tocBackground[data-v-94907056] {\r\n position: absolute;\r\n left: 256px;\r\n top: 0;\r\n bottom: 0;\r\n right: 0;\r\n z-index: 1;\n}\n.tocArea[data-v-94907056] {\r\n position: absolute;\r\n left: 0;\r\n top: 0;\r\n bottom: 0;\r\n z-index: 0;\r\n width: 256px;\r\n overflow-y: auto;\r\n -webkit-overflow-scrolling: touch;\r\n background: #f2f2f2;\r\n padding: 10px 0;\n}\r\n\r\n/* 滚动条 */\n.tocArea[data-v-94907056]::-webkit-scrollbar {\r\n width: 5px;\r\n height: 5px;\n}\n.tocArea[data-v-94907056]::-webkit-scrollbar-thumb:vertical {\r\n height: 5px;\r\n background-color: rgba(0, 0, 0, 0.1);\r\n border-radius: 0.5rem;\n}\r\n\r\n/* tocButton */\n.tocButton[data-v-94907056] {\r\n background: none;\r\n border: none;\r\n width: 32px;\r\n height: 32px;\r\n position: absolute;\r\n top: 10px;\r\n left: 10px;\r\n border-radius: 2px;\r\n outline: none;\r\n cursor: pointer;\n}\n.tocButtonBar[data-v-94907056] {\r\n position: absolute;\r\n width: 60%;\r\n background: #ccc;\r\n height: 2px;\r\n left: 50%;\r\n margin: -1px -30%;\r\n top: 50%;\r\n transition: all 0.5s ease;\n}\n.tocButtonExpanded[data-v-94907056] {\r\n background: #f2f2f2;\n}\r\n\r\n/* 翻页 */\n.arrow[data-v-94907056] {\r\n outline: none;\r\n border: none;\r\n background: none;\r\n position: absolute;\r\n top: 50%;\r\n margin-top: -32px;\r\n font-size: 64px;\r\n padding: 0 10px;\r\n color: #e2e2e2;\r\n font-family: arial, sans-serif;\r\n cursor: pointer;\r\n user-select: none;\r\n appearance: none;\r\n font-weight: normal;\n}\n.arrow[data-v-94907056]:hover {\r\n color: #777;\n}\n.arrow[data-v-94907056]:disabled {\r\n cursor: not-allowed;\r\n color: #e2e2e2;\n}\n.prev[data-v-94907056] {\r\n left: 1px;\n}\n.next[data-v-94907056] {\r\n right: 1px;\n}\r\n\r\n/* loading */\n.loadingView[data-v-94907056] {\r\n position: absolute;\r\n top: 50%;\r\n left: 10%;\r\n right: 10%;\r\n color: #ccc;\r\n text-align: center;\r\n margin-top: -0.5em;\n}\r\n\r\n/* errorView */\n.errorView[data-v-94907056] {\r\n position: absolute;\r\n top: 50%;\r\n left: 10%;\r\n right: 10%;\r\n color: #c00;\r\n text-align: center;\r\n margin-top: -0.5em;\n}\r\n/*$vite$:1*/";
6
+ __vite_style__.textContent = "\n.reader[data-v-cbfdb46e] {\r\n position: absolute;\r\n inset: 50px 50px 20px;\n}\n.viewHolder[data-v-cbfdb46e] {\r\n height: 100%;\r\n width: 100%;\r\n position: relative;\n}\n#viewer[data-v-cbfdb46e] {\r\n height: 100%;\n}\r\n\r\n/* ↓ */\n.tocAreaButton .expansion[data-v-56e71b55]::before {\r\n transform: rotate(-45deg) translateX(2.5px);\n}\n.tocAreaButton .expansion[data-v-56e71b55]::after {\r\n transform: rotate(45deg) translateX(-2.5px);\n}\r\n\r\n/* ↑ */\n.tocAreaButton .open[data-v-56e71b55]::before {\r\n transform: rotate(45deg) translateX(2.5px);\n}\n.tocAreaButton .open[data-v-56e71b55]::after {\r\n transform: rotate(-45deg) translateX(-2.5px);\n}\n.tocAreaButton[data-v-56e71b55] {\r\n user-select: none;\r\n appearance: none;\r\n background: none;\r\n border: none;\r\n display: block;\r\n font-family: sans-serif;\r\n width: 100%;\r\n font-size: 0.9em;\r\n text-align: left;\r\n padding: 0.9em 1em;\r\n border-bottom: 1px solid #ddd;\r\n color: #aaa;\r\n box-sizing: border-box;\r\n outline: none;\r\n cursor: pointer;\r\n position: relative;\n}\n.tocAreaButton[data-v-56e71b55]:hover {\r\n background: rgba(0, 0, 0, 0.05);\n}\n.tocAreaButton[data-v-56e71b55]:active {\r\n background: rgba(0, 0, 0, 0.1);\n}\n.active[data-v-56e71b55] {\r\n color: #1565c0;\r\n border-bottom: 2px solid #1565c0;\n}\r\n\r\n/* 二级目录 */\n.tocAreaButton .expansion[data-v-56e71b55] {\r\n cursor: pointer;\r\n transform: translateY(-50%);\r\n top: 50%;\r\n right: 12px;\r\n position: absolute;\r\n width: 10px;\r\n background-color: #a2a5b4;\r\n transition:\r\n transform 0.3s ease-in-out,\r\n top 0.3s ease-in-out;\n}\n.tocAreaButton .expansion[data-v-56e71b55]::after,\r\n.tocAreaButton .expansion[data-v-56e71b55]::before {\r\n content: '';\r\n position: absolute;\r\n width: 6px;\r\n height: 2px;\r\n background-color: currentcolor;\r\n border-radius: 2px;\r\n transition:\r\n transform 0.3s ease-in-out,\r\n top 0.3s ease-in-out;\n}\r\n\r\n/* container */\n.container[data-v-ce33d15c] {\r\n overflow: hidden;\r\n position: relative;\r\n height: 100%;\n}\n.containerExpanded[data-v-ce33d15c] {\r\n transform: translateX(256px);\n}\n.readerArea[data-v-ce33d15c] {\r\n position: relative;\r\n z-index: 1;\r\n height: 100%;\r\n width: 100%;\r\n background-color: #fff;\r\n transition: all 0.3s ease;\n}\n.container .titleArea[data-v-ce33d15c] {\r\n position: absolute;\r\n top: 20px;\r\n left: 50px;\r\n right: 50px;\r\n text-align: center;\r\n color: #999;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\n}\r\n\r\n/* toc */\n.tocBackground[data-v-ce33d15c] {\r\n position: absolute;\r\n left: 256px;\r\n top: 0;\r\n bottom: 0;\r\n right: 0;\r\n z-index: 1;\n}\n.tocArea[data-v-ce33d15c] {\r\n position: absolute;\r\n left: 0;\r\n top: 0;\r\n bottom: 0;\r\n z-index: 0;\r\n width: 256px;\r\n overflow-y: auto;\r\n -webkit-overflow-scrolling: touch;\r\n background: #f2f2f2;\r\n padding: 10px 0;\n}\r\n\r\n/* 滚动条 */\n.tocArea[data-v-ce33d15c]::-webkit-scrollbar {\r\n width: 5px;\r\n height: 5px;\n}\n.tocArea[data-v-ce33d15c]::-webkit-scrollbar-thumb:vertical {\r\n height: 5px;\r\n background-color: rgba(0, 0, 0, 0.1);\r\n border-radius: 0.5rem;\n}\r\n\r\n/* tocButton */\n.tocButton[data-v-ce33d15c] {\r\n background: none;\r\n border: none;\r\n width: 32px;\r\n height: 32px;\r\n position: absolute;\r\n top: 10px;\r\n left: 10px;\r\n border-radius: 2px;\r\n outline: none;\r\n cursor: pointer;\n}\n.tocButtonBar[data-v-ce33d15c] {\r\n position: absolute;\r\n width: 60%;\r\n background: #ccc;\r\n height: 2px;\r\n left: 50%;\r\n margin: -1px -30%;\r\n top: 50%;\r\n transition: all 0.5s ease;\n}\n.tocButtonExpanded[data-v-ce33d15c] {\r\n background: #f2f2f2;\n}\r\n\r\n/* 翻页 */\n.arrow[data-v-ce33d15c] {\r\n outline: none;\r\n border: none;\r\n background: none;\r\n position: absolute;\r\n top: 50%;\r\n margin-top: -32px;\r\n font-size: 64px;\r\n padding: 0 10px;\r\n color: #e2e2e2;\r\n font-family: arial, sans-serif;\r\n cursor: pointer;\r\n user-select: none;\r\n appearance: none;\r\n font-weight: normal;\n}\n.arrow[data-v-ce33d15c]:hover {\r\n color: #777;\n}\n.arrow[data-v-ce33d15c]:disabled {\r\n cursor: not-allowed;\r\n color: #e2e2e2;\n}\n.prev[data-v-ce33d15c] {\r\n left: 1px;\n}\n.next[data-v-ce33d15c] {\r\n right: 1px;\n}\r\n\r\n/* loading */\n.loadingView[data-v-ce33d15c] {\r\n position: absolute;\r\n top: 50%;\r\n left: 10%;\r\n right: 10%;\r\n color: #ccc;\r\n text-align: center;\r\n margin-top: -0.5em;\n}\r\n\r\n/* errorView */\n.errorView[data-v-ce33d15c] {\r\n position: absolute;\r\n top: 50%;\r\n left: 10%;\r\n right: 10%;\r\n color: #c00;\r\n text-align: center;\r\n margin-top: -0.5em;\n}\r\n/*$vite$:1*/";
7
7
  document.head.appendChild(__vite_style__);
8
8
  function keyListener(el, fn) {
9
9
  el.addEventListener(
@@ -1795,7 +1795,7 @@
1795
1795
  };
1796
1796
  }
1797
1797
  });
1798
- const Toc = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-9d18782d"]]);
1798
+ const Toc = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-56e71b55"]]);
1799
1799
  const _hoisted_1 = { class: "container" };
1800
1800
  const _hoisted_2 = ["title"];
1801
1801
  const _hoisted_3 = { key: 0 };
@@ -1937,7 +1937,7 @@
1937
1937
  };
1938
1938
  }
1939
1939
  });
1940
- const VueReader = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-94907056"]]);
1940
+ const VueReader = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ce33d15c"]]);
1941
1941
  const findIndices = (arr, f2) => arr.map((x2, i2, a2) => f2(x2, i2, a2) ? i2 : null).filter((x2) => x2 != null);
1942
1942
  const splitAt = (arr, is) => [-1, ...is, arr.length].reduce(({ xs, a: a2 }, b2) => ({ xs: (xs == null ? void 0 : xs.concat([arr.slice(a2 + 1, b2)])) ?? [], a: b2 }), {}).xs;
1943
1943
  const concatArrays = (a2, b2) => a2.slice(0, -1).concat([a2[a2.length - 1].concat(b2[0])]).concat(b2.slice(1));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-book-reader",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "type": "module",
5
5
  "main": "lib/vue-book-reader.umd.js",
6
6
  "module": "lib/vue-book-reader.es.js",
@@ -48,6 +48,7 @@
48
48
  "typescript": "^5.4.5",
49
49
  "vite": "^7.3.1",
50
50
  "vite-plugin-lib-inject-css": "^2.2.2",
51
+ "vite-plugin-static-copy": "^3.2.0",
51
52
  "vue": "^3.5.27",
52
53
  "vue-tsc": "^2.0.6"
53
54
  },