@xtctwins/tctwins-pdf-core 0.1.2 → 0.1.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfViewer.vue.d.ts","sourceRoot":"","sources":["../../src/components/PdfViewer.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PdfViewer.vue.d.ts","sourceRoot":"","sources":["../../src/components/PdfViewer.vue"],"names":[],"mappings":"AAmWA,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,qBAAqB,CAAC;AAuX1E,QAAA,MAAM,YAAY;mBAhMU,IAAI,GAAG,WAAW;;;;;;IA6F5C,mBAAmB;;IAEnB,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EAsGzB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* · 视图状态只有两个量:zoom(CSS px / pt) 与 center(纸面 pt,y 向下),
|
|
7
7
|
* 所有屏幕位置由它们反推 —— 没有 tx/ty + cssExtraScale 的“两阶段补偿”,
|
|
8
8
|
* 也就没有逐档累积的锚点漂移;
|
|
9
|
-
* · backing
|
|
10
|
-
* 于是 backing 尺寸恒为 ≈ 视口 × DPR(与 zoom
|
|
9
|
+
* · backing 超过视口量级(或 maxSide 硬上限)时不再切 tile,而是只渲染「可见 region」,
|
|
10
|
+
* 于是 backing 尺寸恒为 ≈ 视口 × prefetch × DPR(与 zoom 无关),深缩放不爆内存、不卡渲染;
|
|
11
11
|
* · 每次渲染前 cancel 上一次未完成的渲染:滚轮连发不排队、不卡顿。
|
|
12
12
|
*
|
|
13
13
|
* 坐标系:
|
|
@@ -71,7 +71,7 @@ export interface PageCanvasRendererOptions {
|
|
|
71
71
|
invertMode?: InvertMode;
|
|
72
72
|
/** "achromatic" 模式下的黑白判定阈值(色度 ≤ 该值视为黑白,默认 24) */
|
|
73
73
|
invertThreshold?: number;
|
|
74
|
-
/** 单边 backing
|
|
74
|
+
/** 单边 backing 硬上限(默认 8192);一般由「视口量级」规则更早触发,此项仅作兵底 */
|
|
75
75
|
maxSide?: number;
|
|
76
76
|
/** 分片时的预取边倍率(默认 1.25,即多渲染 25% 的边) */
|
|
77
77
|
prefetch?: number;
|
|
@@ -113,6 +113,8 @@ export declare class PageCanvasRenderer {
|
|
|
113
113
|
private task;
|
|
114
114
|
private rafId;
|
|
115
115
|
private backgroundColor;
|
|
116
|
+
/** 当前离屏位图使用的铺色(反色时为白);用于判断底色变化是否真的需要重渲染 */
|
|
117
|
+
private offFillColor;
|
|
116
118
|
private invertColorsValue;
|
|
117
119
|
private invertModeValue;
|
|
118
120
|
private invertThresholdValue;
|
|
@@ -140,9 +142,14 @@ export declare class PageCanvasRenderer {
|
|
|
140
142
|
get invertColors(): boolean;
|
|
141
143
|
/** 反色模式(unblend = 覆盖度反解;hue = 保色相;all = 纯反色;achromatic = 彩色完全原样) */
|
|
142
144
|
get invertMode(): InvertMode;
|
|
143
|
-
/**
|
|
145
|
+
/**
|
|
146
|
+
* 开关内容反色(深色主题下由上层跟随主题调用):变化时才重绘。
|
|
147
|
+
* 反色只发生在「上屏」这一步(位图本身不变),所以走 representCurrentBitmap() 快通道:
|
|
148
|
+
* 复用离屏位图,一次像素 pass(4~20ms)完成 —— 不会等一次完整 pdf.js 渲染,
|
|
149
|
+
* 这样画布颜色能和界面底色几乎同时切换(旧实现要等上百 ms~秒级)。
|
|
150
|
+
*/
|
|
144
151
|
setInvertColors(on: boolean): void;
|
|
145
|
-
/**
|
|
152
|
+
/** 切换反色模式(同样只影响上屏,走快通道) */
|
|
146
153
|
setInvertMode(mode: InvertMode, threshold?: number): void;
|
|
147
154
|
/** 当前智能反色是否走 WebGL 快路径(降级时为逐像素) */
|
|
148
155
|
get usingWebGLInvert(): boolean;
|
|
@@ -180,11 +187,28 @@ export declare class PageCanvasRenderer {
|
|
|
180
187
|
private stageCenterOnScreen;
|
|
181
188
|
/** 需要分片时的可见 pt 矩形(含预取边);返回 null 表示整页可直接渲染 */
|
|
182
189
|
private computeRegion;
|
|
183
|
-
/**
|
|
190
|
+
/**
|
|
191
|
+
* 把「位图 + 内容空间」摆到 **本次位图对应的** zoom/center(上屏后调用)。
|
|
192
|
+
* 必须传入快照而不是读当前值:慢渲染期间用户又缩放时,旧位图若按新 zoom 摆放
|
|
193
|
+
* 就会被拉伸/位移(backing/CSS 比例与真实缩放不符),这是“深缩放时画面跳位”的根因。
|
|
194
|
+
*/
|
|
184
195
|
private layout;
|
|
185
196
|
/** rAF 合并渲染请求(连续滚轮/捏合时一帧只渲一次) */
|
|
186
197
|
requestRender(): void;
|
|
187
198
|
/** 立即渲染一帧(await 到上屏完成) */
|
|
188
199
|
render(): Promise<void>;
|
|
200
|
+
/** 按当前反色配置把离屏位图上屏(纯像素 pass,不重跑 pdf.js) */
|
|
201
|
+
private presentBitmap;
|
|
202
|
+
/**
|
|
203
|
+
* 只重上屏、不重渲染 PDF:主题 / 反色 / 底色的快速通道。
|
|
204
|
+
*
|
|
205
|
+
* 背景:反色只发生在「上屏」这一步,离屏里那张原始位图没有任何变化。
|
|
206
|
+
* 若走常规 render(),深缩放下要等一次几百 ms~秒级的 pdf.js 渲染,画布颜色会明显晚于界面底色;
|
|
207
|
+
* 直接复用离屏位图只需一次像素 pass(4~20ms),视觉上是“立刻切换”。
|
|
208
|
+
*
|
|
209
|
+
* 返回 false 表示当前没有「与视图一致」的可复用位图(渲染在途 / 视图已变 / 从未渲染过),
|
|
210
|
+
* 调用方应退回常规 render()。
|
|
211
|
+
*/
|
|
212
|
+
private representCurrentBitmap;
|
|
189
213
|
}
|
|
190
214
|
//# sourceMappingURL=PageCanvasRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageCanvasRenderer.d.ts","sourceRoot":"","sources":["../../src/core/PageCanvasRenderer.ts"],"names":[],"mappings":"AAAA;;;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E,MAAM,GAAG,IAAI;IAS9B,uCAAuC;IACvC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAO3B;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAW1E,uDAAuD;IACvD,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IASjE,8BAA8B;IAC9B,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAK3C,iDAAiD;IACjD,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAUxC,6BAA6B;IAC7B,eAAe,IAAI,IAAI;IAKvB,OAAO,CAAC,iBAAiB;IAQzB,kBAAkB;IAClB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM;IAWpD,iCAAiC;IACjC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAU9B,sDAAsD;IACtD,eAAe,IAAI,IAAI;IAavB,OAAO,CAAC,mBAAmB;IAI3B,6CAA6C;IAC7C,OAAO,CAAC,aAAa;IA4BrB;;;;OAIG;IACH,OAAO,CAAC,MAAM;IAyBd,iCAAiC;IACjC,aAAa,IAAI,IAAI;IAQrB,0BAA0B;IACpB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IA+D7B,0CAA0C;IAC1C,OAAO,CAAC,aAAa;IAwBrB;;;;;;;;;OASG;IACH,OAAO,CAAC,sBAAsB;CAiB9B"}
|
package/dist/pdf-core.js
CHANGED
|
@@ -4,12 +4,12 @@ import { Fragment as t, computed as n, createCommentVNode as r, createElementBlo
|
|
|
4
4
|
function w(t) {
|
|
5
5
|
t && (e.GlobalWorkerOptions.workerSrc = t);
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function T(t = "/pdf.worker.min.mjs") {
|
|
8
8
|
e.GlobalWorkerOptions.workerSrc = t, fetch(t, { method: "HEAD" }).catch(() => {
|
|
9
9
|
e.GlobalWorkerOptions.workerSrc = "https://unpkg.com/pdfjs-dist@5.7.284/legacy/build/pdf.worker.min.mjs";
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
|
-
async function
|
|
12
|
+
async function E(t, n = {}) {
|
|
13
13
|
let r = t instanceof File ? await t.arrayBuffer() : t, i = r.slice(0);
|
|
14
14
|
n.workerSrc && w(n.workerSrc);
|
|
15
15
|
let a = await e.getDocument({ data: i }).promise;
|
|
@@ -21,7 +21,7 @@ async function T(t, n = {}) {
|
|
|
21
21
|
}
|
|
22
22
|
//#endregion
|
|
23
23
|
//#region src/core/ColorInverter.ts
|
|
24
|
-
var
|
|
24
|
+
var D = "invert(1)", ee = "invert(1) hue-rotate(180deg)", te = 24, ne = "\nattribute vec2 aPos;\nvarying vec2 vUv;\nvoid main() {\n vUv = aPos * 0.5 + 0.5;\n gl_Position = vec4(aPos, 0.0, 1.0);\n}", re = "\nprecision mediump float;\nuniform sampler2D uTex;\nuniform float uThreshold;\nuniform float uUnblend;\nvarying vec2 vUv;\nvoid main() {\n vec4 c = texture2D(uTex, vUv);\n float mx = max(c.r, max(c.g, c.b));\n float mn = min(c.r, min(c.g, c.b));\n float chroma = mx - mn;\n float luma = dot(c.rgb, vec3(0.299, 0.587, 0.114));\n if (chroma <= uThreshold) {\n // 灰度(含抗锯齿灰阶):按亮度反色 → 纸白→纸黑、黑线→白线,斜坡平滑\n gl_FragColor = vec4(vec3(1.0 - luma), 1.0);\n } else if (uUnblend > 0.5) {\n // 彩色 + 覆盖度反解:像素 - min(通道) = 原墨色 × 覆盖度(新纸色为黑)\n gl_FragColor = vec4(c.rgb - mn, 1.0);\n } else {\n // 彩色原样保留(\"achromatic\" 模式;代价是边缘会有一圈亮边)\n gl_FragColor = vec4(c.rgb, 1.0);\n }\n}", O = (e, t, n) => Math.max(t, Math.min(n, e)), k = class {
|
|
25
25
|
constructor() {
|
|
26
26
|
this.glCanvas = null, this.gl = null, this.program = null, this.texture = null, this.thresholdLoc = null, this.unblendLoc = null, this.webglReady = null, this.loggedPath = !1;
|
|
27
27
|
}
|
|
@@ -79,7 +79,7 @@ var E = "invert(1)", te = "invert(1) hue-rotate(180deg)", ne = 24, re = "\nattri
|
|
|
79
79
|
buildProgram(e) {
|
|
80
80
|
let t = e.createShader(e.VERTEX_SHADER), n = e.createShader(e.FRAGMENT_SHADER);
|
|
81
81
|
if (!t || !n) throw Error("shader 创建失败");
|
|
82
|
-
if (e.shaderSource(t,
|
|
82
|
+
if (e.shaderSource(t, ne), e.compileShader(t), e.shaderSource(n, re), e.compileShader(n), !e.getShaderParameter(t, e.COMPILE_STATUS) || !e.getShaderParameter(n, e.COMPILE_STATUS)) throw Error("shader 编译失败");
|
|
83
83
|
let r = e.createProgram();
|
|
84
84
|
if (!r) throw Error("program 创建失败");
|
|
85
85
|
if (e.attachShader(r, t), e.attachShader(r, n), e.linkProgram(r), !e.getProgramParameter(r, e.LINK_STATUS)) throw Error("program 链接失败");
|
|
@@ -88,7 +88,7 @@ var E = "invert(1)", te = "invert(1) hue-rotate(180deg)", ne = 24, re = "\nattri
|
|
|
88
88
|
drawWithGL(e, t, n, r, i, a) {
|
|
89
89
|
let o = this.gl, s = this.glCanvas;
|
|
90
90
|
if (!o || !s || !this.texture) throw Error("WebGL 未就绪");
|
|
91
|
-
(s.width !== n || s.height !== r) && (s.width = n, s.height = r), o.viewport(0, 0, n, r), o.useProgram(this.program), o.activeTexture(o.TEXTURE0), o.bindTexture(o.TEXTURE_2D, this.texture), o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, 1), o.texImage2D(o.TEXTURE_2D, 0, o.RGBA, o.RGBA, o.UNSIGNED_BYTE, e), this.thresholdLoc && o.uniform1f(this.thresholdLoc,
|
|
91
|
+
(s.width !== n || s.height !== r) && (s.width = n, s.height = r), o.viewport(0, 0, n, r), o.useProgram(this.program), o.activeTexture(o.TEXTURE0), o.bindTexture(o.TEXTURE_2D, this.texture), o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, 1), o.texImage2D(o.TEXTURE_2D, 0, o.RGBA, o.RGBA, o.UNSIGNED_BYTE, e), this.thresholdLoc && o.uniform1f(this.thresholdLoc, O(a, 0, 255) / 255), this.unblendLoc && o.uniform1f(this.unblendLoc, +(i === "unblend")), o.drawArrays(o.TRIANGLE_STRIP, 0, 4), t.setTransform(1, 0, 0, 1, 0, 0), t.drawImage(s, 0, 0);
|
|
92
92
|
}
|
|
93
93
|
disableWebGL() {
|
|
94
94
|
let e = this.gl;
|
|
@@ -105,14 +105,25 @@ var E = "invert(1)", te = "invert(1) hue-rotate(180deg)", ne = 24, re = "\nattri
|
|
|
105
105
|
}
|
|
106
106
|
t.setTransform(1, 0, 0, 1, 0, 0), t.putImageData(o, 0, 0);
|
|
107
107
|
}
|
|
108
|
-
},
|
|
108
|
+
}, ie = 8192, ae = 1.25, oe = .05, se = 128, A = (e, t, n) => Math.max(t, Math.min(n, e)), ce = (e, t) => {
|
|
109
|
+
if (e === t) return !0;
|
|
110
|
+
let n = (e) => {
|
|
111
|
+
let t = (e || "").trim().toLowerCase(), n = /^#([0-9a-f]{3})$/.exec(t);
|
|
112
|
+
return n ? `#${n[1][0]}${n[1][0]}${n[1][1]}${n[1][1]}${n[1][2]}${n[1][2]}` : (n = /^#([0-9a-f]{6})$/.exec(t), n ? `#${n[1]}` : (n = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/.exec(t), n ? `#${[
|
|
113
|
+
n[1],
|
|
114
|
+
n[2],
|
|
115
|
+
n[3]
|
|
116
|
+
].map((e) => (+e).toString(16).padStart(2, "0")).join("")}` : t));
|
|
117
|
+
};
|
|
118
|
+
return n(e) === n(t);
|
|
119
|
+
}, le = (() => {
|
|
109
120
|
try {
|
|
110
121
|
let e = document.createElement("canvas").getContext("2d");
|
|
111
122
|
return e ? (e.filter = "invert(1)", e.filter === "invert(1)") : !1;
|
|
112
123
|
} catch {
|
|
113
124
|
return !1;
|
|
114
125
|
}
|
|
115
|
-
})(),
|
|
126
|
+
})(), j = class {
|
|
116
127
|
constructor(e) {
|
|
117
128
|
this.doc = null, this.page = null, this.pageW = 0, this.pageH = 0, this.inkCenter = {
|
|
118
129
|
x: 0,
|
|
@@ -143,12 +154,12 @@ var E = "invert(1)", te = "invert(1) hue-rotate(180deg)", ne = 24, re = "\nattri
|
|
|
143
154
|
}, this.dragExtra = {
|
|
144
155
|
x: 0,
|
|
145
156
|
y: 0
|
|
146
|
-
}, this.seq = 0, this.task = null, this.rafId = null, this.backgroundColor = "rgb(255,255,255)", this.invertColorsValue = !1, this.invertModeValue = "unblend", this.invertThresholdValue = 24, this.inverter = new
|
|
157
|
+
}, this.seq = 0, this.task = null, this.rafId = null, this.backgroundColor = "rgb(255,255,255)", this.offFillColor = "", this.invertColorsValue = !1, this.invertModeValue = "unblend", this.invertThresholdValue = 24, this.inverter = new k(), this.destroyed = !1, this.stageBox = {
|
|
147
158
|
left: 0,
|
|
148
159
|
top: 0,
|
|
149
160
|
w: 0,
|
|
150
161
|
h: 0
|
|
151
|
-
}, this.canvas = e.canvas, this.stage = e.stage, this.wrap = e.wrap ?? null, this.dprOf = e.dpr ?? (() => window.devicePixelRatio || 1), this.maxSide = e.maxSide ??
|
|
162
|
+
}, this.canvas = e.canvas, this.stage = e.stage, this.wrap = e.wrap ?? null, this.dprOf = e.dpr ?? (() => window.devicePixelRatio || 1), this.maxSide = e.maxSide ?? ie, this.prefetch = e.prefetch ?? ae, this.minZoom = e.minZoom ?? oe, this.maxZoomValue = e.maxZoom ?? se, this.onPresented = e.onPresented ?? null, this.backgroundColor = e.backgroundColor ?? "rgb(255,255,255)", this.invertColorsValue = e.invertColors ?? !1, this.invertModeValue = e.invertMode ?? "unblend", this.invertThresholdValue = e.invertThreshold ?? 24;
|
|
152
163
|
let t = this.canvas.getContext("2d");
|
|
153
164
|
if (!t) throw Error("[PDF-CORE] 2d context 不可用");
|
|
154
165
|
this.ctx = t, this.off = document.createElement("canvas");
|
|
@@ -231,7 +242,7 @@ var E = "invert(1)", te = "invert(1) hue-rotate(180deg)", ne = 24, re = "\nattri
|
|
|
231
242
|
}
|
|
232
243
|
}
|
|
233
244
|
setBackgroundColor(e) {
|
|
234
|
-
this.backgroundColor = e, this.canvas.style.background = e, this.requestRender();
|
|
245
|
+
this.backgroundColor = e, this.canvas.style.background = e, !(!(!this.invertColorsValue && !ce(e, this.offFillColor)) && this.representCurrentBitmap()) && this.requestRender();
|
|
235
246
|
}
|
|
236
247
|
get invertColors() {
|
|
237
248
|
return this.invertColorsValue;
|
|
@@ -240,11 +251,11 @@ var E = "invert(1)", te = "invert(1) hue-rotate(180deg)", ne = 24, re = "\nattri
|
|
|
240
251
|
return this.invertModeValue;
|
|
241
252
|
}
|
|
242
253
|
setInvertColors(e) {
|
|
243
|
-
e !== this.invertColorsValue && (this.invertColorsValue = e, this.requestRender());
|
|
254
|
+
e !== this.invertColorsValue && (this.invertColorsValue = e, this.representCurrentBitmap() || this.requestRender());
|
|
244
255
|
}
|
|
245
256
|
setInvertMode(e, t) {
|
|
246
257
|
let n = t ?? this.invertThresholdValue;
|
|
247
|
-
e === this.invertModeValue && n === this.invertThresholdValue || (this.invertModeValue = e, this.invertThresholdValue = n, this.requestRender());
|
|
258
|
+
e === this.invertModeValue && n === this.invertThresholdValue || (this.invertModeValue = e, this.invertThresholdValue = n, this.representCurrentBitmap() || this.requestRender());
|
|
248
259
|
}
|
|
249
260
|
get usingWebGLInvert() {
|
|
250
261
|
return this.inverter.usingWebGL;
|
|
@@ -256,11 +267,11 @@ var E = "invert(1)", te = "invert(1) hue-rotate(180deg)", ne = 24, re = "\nattri
|
|
|
256
267
|
!(e > 0) || e === this.maxZoomValue || (this.maxZoomValue = e, this.zoomValue > e && (this.zoomValue = e, this.requestRender()));
|
|
257
268
|
}
|
|
258
269
|
setZoom(e) {
|
|
259
|
-
let t =
|
|
270
|
+
let t = A(e, this.minZoom, this.maxZoomValue);
|
|
260
271
|
t !== this.zoomValue && (this.zoomValue = t, this.requestRender());
|
|
261
272
|
}
|
|
262
273
|
anchorAt(e, t, n, r) {
|
|
263
|
-
let i =
|
|
274
|
+
let i = A(r, this.minZoom, this.maxZoomValue);
|
|
264
275
|
this.zoomValue = i;
|
|
265
276
|
let a = this.stageCenterOnScreen();
|
|
266
277
|
this.centerValue = {
|
|
@@ -269,7 +280,7 @@ var E = "invert(1)", te = "invert(1) hue-rotate(180deg)", ne = 24, re = "\nattri
|
|
|
269
280
|
}, this.requestRender();
|
|
270
281
|
}
|
|
271
282
|
zoomAt(e, t, n) {
|
|
272
|
-
let r =
|
|
283
|
+
let r = A(this.zoomValue * n, this.minZoom, this.maxZoomValue);
|
|
273
284
|
if (r === this.zoomValue) return !1;
|
|
274
285
|
let i = this.screenToPt(e, t);
|
|
275
286
|
return this.anchorAt(e, t, i, r), !0;
|
|
@@ -336,25 +347,22 @@ var E = "invert(1)", te = "invert(1) hue-rotate(180deg)", ne = 24, re = "\nattri
|
|
|
336
347
|
};
|
|
337
348
|
}
|
|
338
349
|
computeRegion() {
|
|
339
|
-
let e = this.zoomValue * this.
|
|
340
|
-
if (
|
|
341
|
-
let
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
350
|
+
let e = this.dprOf(), t = this.zoomValue * e, n = Math.min(this.maxSide, (this.stageBox.w || 1) * this.prefetch * e), r = Math.min(this.maxSide, (this.stageBox.h || 1) * this.prefetch * e);
|
|
351
|
+
if (this.pageW * t <= n && this.pageH * t <= r) return null;
|
|
352
|
+
let i = (this.stageBox.w || 1) / this.zoomValue * this.prefetch, a = (this.stageBox.h || 1) / this.zoomValue * this.prefetch, o = Math.min(i, this.pageW), s = Math.min(a, this.pageH);
|
|
353
|
+
return {
|
|
354
|
+
x: A(this.centerValue.x - o / 2, 0, Math.max(this.pageW - o, 0)),
|
|
355
|
+
y: A(this.centerValue.y - s / 2, 0, Math.max(this.pageH - s, 0)),
|
|
356
|
+
w: o,
|
|
357
|
+
h: s,
|
|
346
358
|
tiled: !0
|
|
347
359
|
};
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
},
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
let t = this.zoomValue;
|
|
355
|
-
this.wrap && (this.wrap.style.position = "absolute", this.wrap.style.left = "0", this.wrap.style.top = "0", this.wrap.style.width = `${Math.round(this.pageW * t)}px`, this.wrap.style.height = `${Math.round(this.pageH * t)}px`, this.wrap.style.transformOrigin = "0 0", this.wrap.style.transform = `translate(${this.stageBox.w / 2 - this.centerValue.x * t}px, ${this.stageBox.h / 2 - this.centerValue.y * t}px)`);
|
|
356
|
-
let n = this.wrap ? 0 : this.stageBox.w / 2 - this.centerValue.x * t, r = this.wrap ? 0 : this.stageBox.h / 2 - this.centerValue.y * t;
|
|
357
|
-
this.canvas.style.left = `${n + e.x * t}px`, this.canvas.style.top = `${r + e.y * t}px`, this.canvas.style.width = `${Math.round(e.w * t)}px`, this.canvas.style.height = `${Math.round(e.h * t)}px`, this.unpresented = {
|
|
360
|
+
}
|
|
361
|
+
layout(e, t, n) {
|
|
362
|
+
let r = t;
|
|
363
|
+
this.wrap && (this.wrap.style.position = "absolute", this.wrap.style.left = "0", this.wrap.style.top = "0", this.wrap.style.width = `${Math.round(this.pageW * r)}px`, this.wrap.style.height = `${Math.round(this.pageH * r)}px`, this.wrap.style.transformOrigin = "0 0", this.wrap.style.transform = `translate(${this.stageBox.w / 2 - n.x * r}px, ${this.stageBox.h / 2 - n.y * r}px)`);
|
|
364
|
+
let i = this.wrap ? 0 : this.stageBox.w / 2 - n.x * r, a = this.wrap ? 0 : this.stageBox.h / 2 - n.y * r;
|
|
365
|
+
this.canvas.style.left = `${i + e.x * r}px`, this.canvas.style.top = `${a + e.y * r}px`, this.canvas.style.width = `${Math.round(e.w * r)}px`, this.canvas.style.height = `${Math.round(e.h * r)}px`, this.unpresented = {
|
|
358
366
|
x: 0,
|
|
359
367
|
y: 0
|
|
360
368
|
}, this.dragExtra = {
|
|
@@ -377,39 +385,48 @@ var E = "invert(1)", te = "invert(1) hue-rotate(180deg)", ne = 24, re = "\nattri
|
|
|
377
385
|
w: this.pageW,
|
|
378
386
|
h: this.pageH,
|
|
379
387
|
tiled: !1
|
|
380
|
-
}, i = this.page.getViewport({ scale: t });
|
|
381
|
-
n && (
|
|
388
|
+
}, i = this.zoomValue, a = { ...this.centerValue }, o = this.page.getViewport({ scale: t });
|
|
389
|
+
n && (o = o.clone({
|
|
382
390
|
offsetX: -n.x * t,
|
|
383
391
|
offsetY: -n.y * t
|
|
384
392
|
}));
|
|
385
|
-
let
|
|
386
|
-
this.off.width =
|
|
387
|
-
let
|
|
393
|
+
let s = Math.max(1, Math.floor(r.w * t)), c = Math.max(1, Math.floor(r.h * t));
|
|
394
|
+
this.off.width = s, this.off.height = c, this.offCtx.setTransform(1, 0, 0, 1, 0, 0), this.offFillColor = this.invertColorsValue ? "#ffffff" : this.backgroundColor, this.offCtx.fillStyle = this.offFillColor, this.offCtx.fillRect(0, 0, s, c);
|
|
395
|
+
let l = null;
|
|
388
396
|
try {
|
|
389
|
-
|
|
397
|
+
l = this.page.render({
|
|
390
398
|
canvas: this.off,
|
|
391
399
|
canvasContext: this.offCtx,
|
|
392
|
-
viewport:
|
|
393
|
-
}), this.task =
|
|
400
|
+
viewport: o
|
|
401
|
+
}), this.task = l, await l.promise;
|
|
394
402
|
} catch (t) {
|
|
395
403
|
if (e !== this.seq || (t?.name ?? "") === "RenderingCancelledException") return;
|
|
396
404
|
throw t;
|
|
397
405
|
} finally {
|
|
398
|
-
this.task ===
|
|
406
|
+
this.task === l && (this.task = null);
|
|
399
407
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
zoom: this.zoomValue,
|
|
404
|
-
center: { ...this.centerValue },
|
|
408
|
+
e === this.seq && (this.presentBitmap(s, c), this.presentedValue = {
|
|
409
|
+
zoom: i,
|
|
410
|
+
center: { ...a },
|
|
405
411
|
region: r,
|
|
406
412
|
offset: {
|
|
407
413
|
x: 0,
|
|
408
414
|
y: 0
|
|
409
415
|
}
|
|
410
|
-
}, this.layout(r), this.onPresented?.(this.presentedValue);
|
|
416
|
+
}, this.layout(r, i, a), this.onPresented?.(this.presentedValue));
|
|
411
417
|
}
|
|
412
|
-
|
|
418
|
+
presentBitmap(e, t) {
|
|
419
|
+
let n = this.invertColorsValue, r = this.invertModeValue, i = n && (r === "unblend" || r === "achromatic"), a = r === "all" ? D : ee, o = n && !i && le;
|
|
420
|
+
this.canvas.width = e, this.canvas.height = t, i ? this.inverter.presentPerPixel(this.off, this.offCtx, this.ctx, e, t, r, this.invertThresholdValue) : (this.ctx.setTransform(1, 0, 0, 1, 0, 0), o && (this.ctx.filter = a), this.ctx.drawImage(this.off, 0, 0), o && (this.ctx.filter = "none")), this.canvas.style.filter = n && !i && !o ? a : "", this.canvas.style.background = this.backgroundColor;
|
|
421
|
+
}
|
|
422
|
+
representCurrentBitmap() {
|
|
423
|
+
if (this.destroyed || !this.page) return !1;
|
|
424
|
+
let e = this.presentedValue, t = this.off.width, n = this.off.height;
|
|
425
|
+
if (!t || !n || this.task || this.unpresented.x !== 0 || this.unpresented.y !== 0 || this.dragExtra.x !== 0 || this.dragExtra.y !== 0 || e.zoom !== this.zoomValue || e.center.x !== this.centerValue.x || e.center.y !== this.centerValue.y) return !1;
|
|
426
|
+
let r = e.zoom * this.dprOf();
|
|
427
|
+
return t !== Math.max(1, Math.floor(e.region.w * r)) || n !== Math.max(1, Math.floor(e.region.h * r)) ? !1 : (this.presentBitmap(t, n), this.onPresented?.(e), !0);
|
|
428
|
+
}
|
|
429
|
+
}, M = class e {
|
|
413
430
|
constructor(e = 100) {
|
|
414
431
|
this.cache = /* @__PURE__ */ new Map(), this.capacity = e;
|
|
415
432
|
}
|
|
@@ -445,20 +462,20 @@ var E = "invert(1)", te = "invert(1) hue-rotate(180deg)", ne = 24, re = "\nattri
|
|
|
445
462
|
get size() {
|
|
446
463
|
return this.cache.size;
|
|
447
464
|
}
|
|
448
|
-
},
|
|
449
|
-
function
|
|
465
|
+
}, ue = () => typeof navigator < "u" && /Mobi|Android|iPhone|iPad/i.test(navigator.userAgent);
|
|
466
|
+
function N(e) {
|
|
450
467
|
let t = window.devicePixelRatio ?? 1;
|
|
451
468
|
return e >= 32 ? 1 : e >= 16 ? Math.min(t, 2) : t;
|
|
452
469
|
}
|
|
453
|
-
function
|
|
470
|
+
function P(e) {
|
|
454
471
|
return e ? 2048 : 4096;
|
|
455
472
|
}
|
|
456
|
-
var
|
|
457
|
-
async function
|
|
458
|
-
let n = t.scale ?? 1.5, r =
|
|
473
|
+
var de = 4096, F = 128;
|
|
474
|
+
async function I(e, t = {}) {
|
|
475
|
+
let n = t.scale ?? 1.5, r = ue(), i = t.backgroundColor ?? "rgb(255,255,255)";
|
|
459
476
|
t.cache;
|
|
460
|
-
let a =
|
|
461
|
-
p >
|
|
477
|
+
let a = N(n), o = e.getViewport({ scale: n * a }), s = o.width, c = o.height, l = P(r), u = Math.min(l, de, Math.max(s, c)), d = Math.ceil(s / u), f = Math.ceil(c / u), p = d * f;
|
|
478
|
+
p > F && console.warn(`[PDF-CORE] scale=${n} dpr=${a}, tile=${p} (${d}×${f}), tileSize=${u}px (physical). IntersectionObserver 将按需渲染。`);
|
|
462
479
|
let m = s / a, h = c / a, g = document.createElement("div");
|
|
463
480
|
g.style.cssText = [
|
|
464
481
|
"position:relative",
|
|
@@ -487,14 +504,14 @@ async function F(e, t = {}) {
|
|
|
487
504
|
}).finally(() => {
|
|
488
505
|
v.delete(s), b--, S();
|
|
489
506
|
});
|
|
490
|
-
}, w = r ? "128px" : "256px",
|
|
507
|
+
}, w = r ? "128px" : "256px", T = r ? 2 : 3, E = new IntersectionObserver((e) => {
|
|
491
508
|
e.forEach((e) => {
|
|
492
509
|
let t = e.target, r = t.dataset.tileKey, [a, o] = (t.dataset.tilePos ?? "0,0").split(",").map(Number);
|
|
493
510
|
if (e.isIntersecting) {
|
|
494
511
|
if (_.has(r) || v.has(r)) return;
|
|
495
512
|
let e = () => C(t, a, o);
|
|
496
513
|
b >= y ? x.push(e) : e();
|
|
497
|
-
} else if (n >=
|
|
514
|
+
} else if (n >= T && _.has(r)) {
|
|
498
515
|
let e = t.getContext("2d", { alpha: !1 });
|
|
499
516
|
e.setTransform(1, 0, 0, 1, 0, 0), e.fillStyle = i, e.fillRect(0, 0, t.width, t.height), _.delete(r);
|
|
500
517
|
}
|
|
@@ -503,7 +520,7 @@ async function F(e, t = {}) {
|
|
|
503
520
|
root: null,
|
|
504
521
|
rootMargin: w,
|
|
505
522
|
threshold: 0
|
|
506
|
-
}),
|
|
523
|
+
}), D = [];
|
|
507
524
|
for (let t = 0; t < f; t++) for (let r = 0; r < d; r++) {
|
|
508
525
|
let o = r * u, l = t * u, d = Math.round(Math.min(u, s - o)), f = Math.round(Math.min(u, c - l)), p = o / a, m = l / a, h = d / a, _ = f / a, v = document.createElement("canvas");
|
|
509
526
|
v.width = d, v.height = f;
|
|
@@ -515,7 +532,7 @@ async function F(e, t = {}) {
|
|
|
515
532
|
`width:${h}px`,
|
|
516
533
|
`height:${_}px`,
|
|
517
534
|
`background:${i}`
|
|
518
|
-
].join(";"), v.dataset.tileKey =
|
|
535
|
+
].join(";"), v.dataset.tileKey = M.makeKey(e.pageNumber, n, r, t), v.dataset.tilePos = `${r},${t}`, g.appendChild(v), E.observe(v), D.push({
|
|
519
536
|
canvas: v,
|
|
520
537
|
col: r,
|
|
521
538
|
row: t,
|
|
@@ -530,14 +547,14 @@ async function F(e, t = {}) {
|
|
|
530
547
|
container: g,
|
|
531
548
|
pageWidth: m,
|
|
532
549
|
pageHeight: h,
|
|
533
|
-
tiles:
|
|
550
|
+
tiles: D
|
|
534
551
|
},
|
|
535
|
-
observer:
|
|
552
|
+
observer: E
|
|
536
553
|
};
|
|
537
554
|
}
|
|
538
555
|
//#endregion
|
|
539
556
|
//#region src/core/coords/CoordTransformer.ts
|
|
540
|
-
var
|
|
557
|
+
var L = class {
|
|
541
558
|
constructor(e, t, n) {
|
|
542
559
|
if (this.viewport = e, this.scale = t, this.pageSizePt = n, t <= 0) throw RangeError(`scale 必须大于 0,收到: ${t}`);
|
|
543
560
|
}
|
|
@@ -583,7 +600,7 @@ var I = class {
|
|
|
583
600
|
get pageSize() {
|
|
584
601
|
return this.pageSizePt;
|
|
585
602
|
}
|
|
586
|
-
},
|
|
603
|
+
}, R = [
|
|
587
604
|
5,
|
|
588
605
|
10,
|
|
589
606
|
25,
|
|
@@ -612,10 +629,10 @@ var I = class {
|
|
|
612
629
|
1e4,
|
|
613
630
|
12800
|
|
614
631
|
];
|
|
615
|
-
function
|
|
616
|
-
return t === "in" ?
|
|
632
|
+
function z(e, t) {
|
|
633
|
+
return t === "in" ? R.find((t) => t > e) ?? R[R.length - 1] : [...R].reverse().find((t) => t < e) ?? R[0];
|
|
617
634
|
}
|
|
618
|
-
var
|
|
635
|
+
var B = class {
|
|
619
636
|
constructor() {
|
|
620
637
|
this.interaction = null, this.toolManager = null, this.drawCallback = null, this.domContainerId = null, this.zoomCtrl = null, this.initialScale = 1.5;
|
|
621
638
|
}
|
|
@@ -653,12 +670,12 @@ var z = class {
|
|
|
653
670
|
}
|
|
654
671
|
zoomIn() {
|
|
655
672
|
if (!this.zoomCtrl) return;
|
|
656
|
-
let e = this.zoomCtrl.getScale(), t =
|
|
673
|
+
let e = this.zoomCtrl.getScale(), t = z(Math.round(e * 100), "in");
|
|
657
674
|
this.zoomCtrl.setScale(t / 100);
|
|
658
675
|
}
|
|
659
676
|
zoomOut() {
|
|
660
677
|
if (!this.zoomCtrl) return;
|
|
661
|
-
let e = this.zoomCtrl.getScale(), t =
|
|
678
|
+
let e = this.zoomCtrl.getScale(), t = z(Math.round(e * 100), "out");
|
|
662
679
|
this.zoomCtrl.setScale(t / 100);
|
|
663
680
|
}
|
|
664
681
|
setScale(e) {
|
|
@@ -719,7 +736,7 @@ var z = class {
|
|
|
719
736
|
};
|
|
720
737
|
//#endregion
|
|
721
738
|
//#region src/annotations/utils.ts
|
|
722
|
-
function
|
|
739
|
+
function V(e, t = 0, n = "px") {
|
|
723
740
|
return {
|
|
724
741
|
id: `measure-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
|
|
725
742
|
kind: "measure",
|
|
@@ -731,7 +748,7 @@ function B(e, t = 0, n = "px") {
|
|
|
731
748
|
createdAt: Date.now()
|
|
732
749
|
};
|
|
733
750
|
}
|
|
734
|
-
function
|
|
751
|
+
function H(e, t = "rectangle") {
|
|
735
752
|
return {
|
|
736
753
|
id: `shape-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
|
|
737
754
|
kind: "shape",
|
|
@@ -742,12 +759,12 @@ function V(e, t = "rectangle") {
|
|
|
742
759
|
createdAt: Date.now()
|
|
743
760
|
};
|
|
744
761
|
}
|
|
745
|
-
function
|
|
762
|
+
function U(e) {
|
|
746
763
|
return JSON.parse(JSON.stringify(e));
|
|
747
764
|
}
|
|
748
765
|
//#endregion
|
|
749
766
|
//#region src/utils/EventTrigger.ts
|
|
750
|
-
var
|
|
767
|
+
var W = class {
|
|
751
768
|
constructor() {
|
|
752
769
|
this._events = /* @__PURE__ */ new Map();
|
|
753
770
|
}
|
|
@@ -788,12 +805,12 @@ var H = class {
|
|
|
788
805
|
};
|
|
789
806
|
//#endregion
|
|
790
807
|
//#region src/vue/usePdfCore.ts
|
|
791
|
-
function
|
|
792
|
-
let t = h(null), n = _(null), r = _(null), i = _(null), a = h(0), o = h(1), s = h(e.scale ?? 1), c = h(e.backgroundColor ?? "rgb(255,255,255)"), l = h(e.invertColors ?? !1), u = h(!1), d = h(null), f = new
|
|
808
|
+
function fe(e = {}) {
|
|
809
|
+
let t = h(null), n = _(null), r = _(null), i = _(null), a = h(0), o = h(1), s = h(e.scale ?? 1), c = h(e.backgroundColor ?? "rgb(255,255,255)"), l = h(e.invertColors ?? !1), u = h(!1), d = h(null), f = new W(), p = (i) => {
|
|
793
810
|
let { canvas: a, stage: u, wrap: d } = i;
|
|
794
811
|
if (!a || !u) return null;
|
|
795
812
|
n.value && n.value.destroy();
|
|
796
|
-
let p = new
|
|
813
|
+
let p = new j({
|
|
797
814
|
canvas: a,
|
|
798
815
|
stage: u,
|
|
799
816
|
wrap: d ?? null,
|
|
@@ -829,7 +846,7 @@ function pe(e = {}) {
|
|
|
829
846
|
}, g = async (e) => {
|
|
830
847
|
u.value = !0, d.value = null;
|
|
831
848
|
try {
|
|
832
|
-
let t = await
|
|
849
|
+
let t = await E(e);
|
|
833
850
|
r.value = t.doc, a.value = t.pageCount, o.value = 1;
|
|
834
851
|
let c = n.value;
|
|
835
852
|
if (c) {
|
|
@@ -880,14 +897,10 @@ function pe(e = {}) {
|
|
|
880
897
|
});
|
|
881
898
|
},
|
|
882
899
|
setBackgroundColor: async (e) => {
|
|
883
|
-
c.value = e;
|
|
884
|
-
let t = n.value;
|
|
885
|
-
t && (t.setBackgroundColor(e), t.pageRef && await t.render());
|
|
900
|
+
c.value = e, n.value?.setBackgroundColor(e);
|
|
886
901
|
},
|
|
887
902
|
setInvertColors: (e) => {
|
|
888
|
-
l.value = e;
|
|
889
|
-
let t = n.value;
|
|
890
|
-
t && (t.setInvertColors(e), t.pageRef && t.render());
|
|
903
|
+
l.value = e, n.value?.setInvertColors(e);
|
|
891
904
|
},
|
|
892
905
|
setInvertMode: (e, t) => {
|
|
893
906
|
n.value?.setInvertMode(e, t);
|
|
@@ -906,15 +919,15 @@ function pe(e = {}) {
|
|
|
906
919
|
}
|
|
907
920
|
//#endregion
|
|
908
921
|
//#region src/vue/useAnnotations.ts
|
|
909
|
-
function
|
|
922
|
+
function G() {
|
|
910
923
|
let e = h([]);
|
|
911
924
|
return {
|
|
912
925
|
annotations: e,
|
|
913
926
|
addMeasureAnnotation: (t, n = 0, r = "px") => {
|
|
914
|
-
e.value = [...e.value,
|
|
927
|
+
e.value = [...e.value, V(t, n, r)];
|
|
915
928
|
},
|
|
916
929
|
addShapeAnnotation: (t, n = "rectangle") => {
|
|
917
|
-
e.value = [...e.value,
|
|
930
|
+
e.value = [...e.value, H(t, n)];
|
|
918
931
|
},
|
|
919
932
|
removeAnnotation: (t) => {
|
|
920
933
|
e.value = e.value.filter((e) => e.id !== t);
|
|
@@ -923,13 +936,13 @@ function U() {
|
|
|
923
936
|
e.value = [];
|
|
924
937
|
},
|
|
925
938
|
replaceAnnotations: (t) => {
|
|
926
|
-
e.value = t.map(
|
|
939
|
+
e.value = t.map(U);
|
|
927
940
|
}
|
|
928
941
|
};
|
|
929
942
|
}
|
|
930
943
|
//#endregion
|
|
931
944
|
//#region src/vue/useMeasurement.ts
|
|
932
|
-
function
|
|
945
|
+
function K() {
|
|
933
946
|
let e = h([]);
|
|
934
947
|
return {
|
|
935
948
|
points: e,
|
|
@@ -948,8 +961,8 @@ function W() {
|
|
|
948
961
|
}
|
|
949
962
|
//#endregion
|
|
950
963
|
//#region src/vue/useInteraction.ts
|
|
951
|
-
function
|
|
952
|
-
let { annotations: e, addMeasureAnnotation: t, clearAnnotations: n } =
|
|
964
|
+
function pe() {
|
|
965
|
+
let { annotations: e, addMeasureAnnotation: t, clearAnnotations: n } = G(), { points: r, addPoint: i, clearPoints: a, distance: o } = K(), s = h(!1);
|
|
953
966
|
return {
|
|
954
967
|
points: r,
|
|
955
968
|
annotations: e,
|
|
@@ -970,7 +983,7 @@ function me() {
|
|
|
970
983
|
}
|
|
971
984
|
//#endregion
|
|
972
985
|
//#region src/components/interaction.ts
|
|
973
|
-
function
|
|
986
|
+
function me() {
|
|
974
987
|
let e = [], t = [], n = "none", r = null;
|
|
975
988
|
return {
|
|
976
989
|
get points() {
|
|
@@ -990,11 +1003,11 @@ function he() {
|
|
|
990
1003
|
},
|
|
991
1004
|
addPoint(i) {
|
|
992
1005
|
if (e = [...e, i], n === "measure" && e.length >= 2) {
|
|
993
|
-
let n =
|
|
1006
|
+
let n = V([e[e.length - 2], e[e.length - 1]], Math.hypot(e[e.length - 1].x - e[e.length - 2].x, e[e.length - 1].y - e[e.length - 2].y));
|
|
994
1007
|
return t = [...t, n], r = n.id, e = [], n;
|
|
995
1008
|
}
|
|
996
1009
|
if (n === "rectangle" && e.length >= 2) {
|
|
997
|
-
let n =
|
|
1010
|
+
let n = H([e[e.length - 2], e[e.length - 1]], "rectangle");
|
|
998
1011
|
return t = [...t, n], r = n.id, e = [], n;
|
|
999
1012
|
}
|
|
1000
1013
|
return null;
|
|
@@ -1016,7 +1029,7 @@ function he() {
|
|
|
1016
1029
|
}
|
|
1017
1030
|
//#endregion
|
|
1018
1031
|
//#region src/components/useAnnotationCanvas.ts
|
|
1019
|
-
function
|
|
1032
|
+
function he(e) {
|
|
1020
1033
|
let { annotationCanvas: t, rootRef: n, pdfLayerRef: r, interaction: i, previewPoint: a } = e, o = (e) => {
|
|
1021
1034
|
let t = e.currentTarget.getBoundingClientRect();
|
|
1022
1035
|
return {
|
|
@@ -1080,7 +1093,7 @@ function ge(e) {
|
|
|
1080
1093
|
}
|
|
1081
1094
|
//#endregion
|
|
1082
1095
|
//#region src/components/usePointerInteraction.ts
|
|
1083
|
-
function
|
|
1096
|
+
function ge(e) {
|
|
1084
1097
|
let { annotationCanvas: t, interaction: n, previewPoint: r, isRectangleDragging: i, getCanvasPoint: a, hitTestAnnotation: o, drawAnnotations: s, deleteSelectedAnnotation: c, emit: l } = e;
|
|
1085
1098
|
return {
|
|
1086
1099
|
handlePointerDown: (e) => {
|
|
@@ -1145,7 +1158,7 @@ function _e(e) {
|
|
|
1145
1158
|
}
|
|
1146
1159
|
//#endregion
|
|
1147
1160
|
//#region src/components/useViewerLayout.ts
|
|
1148
|
-
function
|
|
1161
|
+
function _e(e) {
|
|
1149
1162
|
let { viewerRef: t, renderer: r, zoomSpeed: i, theme: a, onViewChanged: o } = e, s = n(() => ({
|
|
1150
1163
|
width: "100%",
|
|
1151
1164
|
height: "100%",
|
|
@@ -1245,10 +1258,10 @@ function ve(e) {
|
|
|
1245
1258
|
}
|
|
1246
1259
|
//#endregion
|
|
1247
1260
|
//#region src/types/tools.ts
|
|
1248
|
-
var
|
|
1261
|
+
var ve = {
|
|
1249
1262
|
mode: "none",
|
|
1250
1263
|
measureSubType: "distance"
|
|
1251
|
-
},
|
|
1264
|
+
}, q = class {
|
|
1252
1265
|
constructor(e) {
|
|
1253
1266
|
this.TOOLNAME = "measure", this._active = !1, this._isStart = !1, this._isEnd = !1, this._isMeasuring = !1, this._isDragging = !1, this._startPoint = null, this._endPoint = null, this._points = [], this._measureList = /* @__PURE__ */ new Map(), this._dragStart = null, this._dragThreshold = 3, this.coordProvider = e.coordProvider, this.calibration = e.calibration ?? {
|
|
1254
1267
|
scale: 1,
|
|
@@ -1333,7 +1346,7 @@ var ye = {
|
|
|
1333
1346
|
destroy() {
|
|
1334
1347
|
this._measureList.clear(), this.resetState(), this._active = !1;
|
|
1335
1348
|
}
|
|
1336
|
-
},
|
|
1349
|
+
}, J = class extends q {
|
|
1337
1350
|
constructor(e) {
|
|
1338
1351
|
super(e), this.currentType = "distance", this._previewEnd = null;
|
|
1339
1352
|
}
|
|
@@ -1385,7 +1398,7 @@ var ye = {
|
|
|
1385
1398
|
interrupt() {
|
|
1386
1399
|
this._previewEnd = null, super.interrupt();
|
|
1387
1400
|
}
|
|
1388
|
-
},
|
|
1401
|
+
}, Y = class extends q {
|
|
1389
1402
|
constructor(e) {
|
|
1390
1403
|
super(e), this.currentType = "angle", this._secondPoint = null, this._thirdPoint = null;
|
|
1391
1404
|
}
|
|
@@ -1415,7 +1428,7 @@ var ye = {
|
|
|
1415
1428
|
let u = Math.max(-1, Math.min(1, s / (c * l)));
|
|
1416
1429
|
return parseFloat((Math.acos(u) * 180 / Math.PI).toFixed(2));
|
|
1417
1430
|
}
|
|
1418
|
-
},
|
|
1431
|
+
}, X = class extends q {
|
|
1419
1432
|
constructor(e) {
|
|
1420
1433
|
super(e), this.currentType = "area";
|
|
1421
1434
|
}
|
|
@@ -1443,7 +1456,7 @@ var ye = {
|
|
|
1443
1456
|
}
|
|
1444
1457
|
return Math.abs(t) / 2;
|
|
1445
1458
|
}
|
|
1446
|
-
},
|
|
1459
|
+
}, Z = class {
|
|
1447
1460
|
get currentType() {
|
|
1448
1461
|
return this._currentSubType;
|
|
1449
1462
|
}
|
|
@@ -1452,7 +1465,7 @@ var ye = {
|
|
|
1452
1465
|
this._isCreating = !0;
|
|
1453
1466
|
}, this._onMeasureCreated = (e) => {
|
|
1454
1467
|
this._isCreating = !1, this._resultList.set(e.result.id, e.result);
|
|
1455
|
-
}, this.events = e.eventTrigger ?? new
|
|
1468
|
+
}, this.events = e.eventTrigger ?? new W();
|
|
1456
1469
|
let t = {
|
|
1457
1470
|
coordProvider: e.coordProvider,
|
|
1458
1471
|
calibration: e.calibration ?? {
|
|
@@ -1462,7 +1475,7 @@ var ye = {
|
|
|
1462
1475
|
},
|
|
1463
1476
|
eventTrigger: this.events
|
|
1464
1477
|
};
|
|
1465
|
-
this.distanceMeasure = new
|
|
1478
|
+
this.distanceMeasure = new J(t), this.angleMeasure = new Y(t), this.areaMeasure = new X(t), this._subTools = /* @__PURE__ */ new Map([
|
|
1466
1479
|
["distance", this.distanceMeasure],
|
|
1467
1480
|
["angle", this.angleMeasure],
|
|
1468
1481
|
["area", this.areaMeasure]
|
|
@@ -1532,9 +1545,9 @@ var ye = {
|
|
|
1532
1545
|
for (let e of this._subTools.values()) e.destroy();
|
|
1533
1546
|
this._subTools.clear(), this._resultList.clear(), this._active = !1;
|
|
1534
1547
|
}
|
|
1535
|
-
},
|
|
1548
|
+
}, Q = class {
|
|
1536
1549
|
constructor(e) {
|
|
1537
|
-
this._activeTool = null, this._activeMode = "none", this._tools = /* @__PURE__ */ new Map(), this.events = new
|
|
1550
|
+
this._activeTool = null, this._activeMode = "none", this._tools = /* @__PURE__ */ new Map(), this.events = new W(), this.measureTool = new Z({
|
|
1538
1551
|
coordProvider: e.coordProvider,
|
|
1539
1552
|
calibration: e.calibration,
|
|
1540
1553
|
eventTrigger: this.events
|
|
@@ -1582,8 +1595,8 @@ var ye = {
|
|
|
1582
1595
|
};
|
|
1583
1596
|
//#endregion
|
|
1584
1597
|
//#region src/components/useViewerManager.ts
|
|
1585
|
-
function
|
|
1586
|
-
let { drawAnnotations: t, currentScale: n, setScale: r, viewerRef: i, adjustLayout: a, screenToScene: o, toggleTheme: s } = e, c = new
|
|
1598
|
+
function ye(e) {
|
|
1599
|
+
let { drawAnnotations: t, currentScale: n, setScale: r, viewerRef: i, adjustLayout: a, screenToScene: o, toggleTheme: s } = e, c = new Q({ coordProvider: {
|
|
1587
1600
|
screenToScene: o,
|
|
1588
1601
|
sceneToScreen: (e) => ({
|
|
1589
1602
|
x: 0,
|
|
@@ -1650,7 +1663,7 @@ function be(e) {
|
|
|
1650
1663
|
toggleTheme: () => {
|
|
1651
1664
|
s();
|
|
1652
1665
|
}
|
|
1653
|
-
}, o = new
|
|
1666
|
+
}, o = new B();
|
|
1654
1667
|
o.registerWithToolManager(c, t, e), window.pdfViewer = o;
|
|
1655
1668
|
},
|
|
1656
1669
|
unregisterManager: () => {
|
|
@@ -1660,10 +1673,10 @@ function be(e) {
|
|
|
1660
1673
|
}
|
|
1661
1674
|
//#endregion
|
|
1662
1675
|
//#region src/components/MobileConsole.vue?vue&type=script&setup=true&lang.ts
|
|
1663
|
-
var
|
|
1676
|
+
var be = { class: "mobile-console__title" }, xe = { class: "mobile-console__count" }, Se = { class: "mobile-console__actions" }, Ce = { class: "mobile-console__toggle" }, we = { class: "mobile-console__level" }, Te = { class: "mobile-console__msg" }, Ee = {
|
|
1664
1677
|
key: 0,
|
|
1665
1678
|
class: "mobile-console__empty"
|
|
1666
|
-
},
|
|
1679
|
+
}, $ = /*@__PURE__*/ c({
|
|
1667
1680
|
__name: "MobileConsole",
|
|
1668
1681
|
props: {
|
|
1669
1682
|
visible: {
|
|
@@ -1693,7 +1706,7 @@ var xe = { class: "mobile-console__title" }, Se = { class: "mobile-console__coun
|
|
|
1693
1706
|
});
|
|
1694
1707
|
let w = () => {
|
|
1695
1708
|
s.value = [];
|
|
1696
|
-
},
|
|
1709
|
+
}, T = async () => {
|
|
1697
1710
|
let e = s.value.map((e) => `[${e.level.toUpperCase()}] ${e.message}`).join("\n");
|
|
1698
1711
|
if (e) try {
|
|
1699
1712
|
await navigator.clipboard.writeText(e);
|
|
@@ -1701,7 +1714,7 @@ var xe = { class: "mobile-console__title" }, Se = { class: "mobile-console__coun
|
|
|
1701
1714
|
let t = document.createElement("textarea");
|
|
1702
1715
|
t.value = e, t.style.position = "fixed", t.style.left = "-9999px", document.body.appendChild(t), t.select(), document.execCommand("copy"), document.body.removeChild(t);
|
|
1703
1716
|
}
|
|
1704
|
-
},
|
|
1717
|
+
}, E = () => {
|
|
1705
1718
|
c.value = !c.value, c.value || l(() => {
|
|
1706
1719
|
d.value && (d.value.scrollTop = d.value.scrollHeight);
|
|
1707
1720
|
});
|
|
@@ -1717,8 +1730,8 @@ var xe = { class: "mobile-console__title" }, Se = { class: "mobile-console__coun
|
|
|
1717
1730
|
class: u(["mobile-console", { collapsed: c.value }])
|
|
1718
1731
|
}, [a("div", {
|
|
1719
1732
|
class: "mobile-console__header",
|
|
1720
|
-
onClick:
|
|
1721
|
-
}, [a("span",
|
|
1733
|
+
onClick: E
|
|
1734
|
+
}, [a("span", be, [l[0] ||= o(" 📟 Console ", -1), a("span", xe, v(s.value.length), 1)]), a("span", Se, [
|
|
1722
1735
|
a("button", {
|
|
1723
1736
|
class: "mobile-console__btn",
|
|
1724
1737
|
title: "清空",
|
|
@@ -1727,9 +1740,9 @@ var xe = { class: "mobile-console__title" }, Se = { class: "mobile-console__coun
|
|
|
1727
1740
|
a("button", {
|
|
1728
1741
|
class: "mobile-console__btn",
|
|
1729
1742
|
title: "复制全部",
|
|
1730
|
-
onClick: C(
|
|
1743
|
+
onClick: C(T, ["stop"])
|
|
1731
1744
|
}, "📋"),
|
|
1732
|
-
a("span",
|
|
1745
|
+
a("span", Ce, v(c.value ? "▲" : "▼"), 1)
|
|
1733
1746
|
])]), S(a("div", {
|
|
1734
1747
|
ref_key: "logListRef",
|
|
1735
1748
|
ref: d,
|
|
@@ -1737,13 +1750,13 @@ var xe = { class: "mobile-console__title" }, Se = { class: "mobile-console__coun
|
|
|
1737
1750
|
}, [(m(!0), i(t, null, g(s.value, (e, t) => (m(), i("div", {
|
|
1738
1751
|
key: t,
|
|
1739
1752
|
class: u(["mobile-console__entry", "mobile-console__entry--" + e.level])
|
|
1740
|
-
}, [a("span", we, v(e.level.toUpperCase()), 1), a("span",
|
|
1753
|
+
}, [a("span", we, v(e.level.toUpperCase()), 1), a("span", Te, v(e.message), 1)], 2))), 128)), s.value.length === 0 ? (m(), i("div", Ee, "暂无日志")) : r("", !0)], 512), [[b, !c.value]])], 2)) : r("", !0);
|
|
1741
1754
|
}
|
|
1742
|
-
}),
|
|
1755
|
+
}), De = (e, t) => {
|
|
1743
1756
|
let n = e.__vccOpts || e;
|
|
1744
1757
|
for (let [e, r] of t) n[e] = r;
|
|
1745
1758
|
return n;
|
|
1746
|
-
},
|
|
1759
|
+
}, Oe = /*#__PURE__*/ De($, [["__scopeId", "data-v-ef8b578a"]]), ke = /*#__PURE__*/ De(/* @__PURE__ */ c({
|
|
1747
1760
|
__name: "PdfViewer",
|
|
1748
1761
|
props: {
|
|
1749
1762
|
modelValue: { default: null },
|
|
@@ -1776,7 +1789,7 @@ var xe = { class: "mobile-console__title" }, Se = { class: "mobile-console__coun
|
|
|
1776
1789
|
setup(e, { expose: t, emit: r }) {
|
|
1777
1790
|
let o = e, c = r, u = h(null), g = h(null), _ = h(null), v = h(null), b = h(o.theme), S = n(() => b.value === "dark" ? "#000000" : "rgb(255,255,255)"), C = n(() => b.value === "dark" && o.invertDarkContent !== !1), w = () => {
|
|
1778
1791
|
b.value = b.value === "light" ? "dark" : "light";
|
|
1779
|
-
}, { containerRef:
|
|
1792
|
+
}, { containerRef: T, renderer: E, loadFile: D, doc: ee, pageCount: te, currentPageNum: ne, error: re, currentScale: O, setScale: k, setBackgroundColor: ie, setInvertColors: ae, setInvertMode: oe, setMaxZoom: se, reset: A, resetView: ce, attach: le, detach: j, events: M } = fe({
|
|
1780
1793
|
autoLoad: !1,
|
|
1781
1794
|
scale: o.scale,
|
|
1782
1795
|
backgroundColor: S.value,
|
|
@@ -1789,26 +1802,26 @@ var xe = { class: "mobile-console__title" }, Se = { class: "mobile-console__coun
|
|
|
1789
1802
|
function ue() {
|
|
1790
1803
|
I(), F();
|
|
1791
1804
|
}
|
|
1792
|
-
let N =
|
|
1805
|
+
let N = me(), P = h(null), de = h(!1), { drawAnnotations: F, syncCanvasSize: I, getCanvasPoint: L, hitTestAnnotation: R } = he({
|
|
1793
1806
|
annotationCanvas: v,
|
|
1794
1807
|
rootRef: g,
|
|
1795
1808
|
pdfLayerRef: g,
|
|
1796
1809
|
interaction: N,
|
|
1797
1810
|
previewPoint: P
|
|
1798
|
-
}), { containerStyle: z, adjustLayout: B, handleWheel: V, handlePointerDown:
|
|
1811
|
+
}), { containerStyle: z, adjustLayout: B, handleWheel: V, handlePointerDown: H, handlePointerMove: U, handlePointerUp: W, handlePointerCancel: G, isMouseDragging: K, cleanupMouseDrag: pe } = _e({
|
|
1799
1812
|
viewerRef: u,
|
|
1800
|
-
renderer:
|
|
1813
|
+
renderer: E,
|
|
1801
1814
|
zoomSpeed: o.zoomSpeed ?? 1,
|
|
1802
1815
|
theme: b
|
|
1803
|
-
}),
|
|
1804
|
-
N.mode === "none" &&
|
|
1805
|
-
},
|
|
1816
|
+
}), ve = (e) => {
|
|
1817
|
+
N.mode === "none" && H(e);
|
|
1818
|
+
}, q = n(() => ({
|
|
1806
1819
|
...z.value,
|
|
1807
|
-
cursor:
|
|
1808
|
-
})), { setMode:
|
|
1820
|
+
cursor: K.value ? "grabbing" : "grab"
|
|
1821
|
+
})), { setMode: J, clearInteraction: Y, deleteSelectedAnnotation: X, selectAnnotation: Z, registerManager: Q, unregisterManager: be } = ye({
|
|
1809
1822
|
drawAnnotations: F,
|
|
1810
|
-
currentScale:
|
|
1811
|
-
setScale:
|
|
1823
|
+
currentScale: O,
|
|
1824
|
+
setScale: k,
|
|
1812
1825
|
viewerRef: u,
|
|
1813
1826
|
adjustLayout: B,
|
|
1814
1827
|
screenToScene: (e) => {
|
|
@@ -1819,7 +1832,7 @@ var xe = { class: "mobile-console__title" }, Se = { class: "mobile-console__coun
|
|
|
1819
1832
|
};
|
|
1820
1833
|
},
|
|
1821
1834
|
toggleTheme: w
|
|
1822
|
-
}), { handlePointerDown:
|
|
1835
|
+
}), { handlePointerDown: xe, handlePointerMove: Se, handlePointerUp: Ce, handleKeydown: we } = ge({
|
|
1823
1836
|
annotationCanvas: v,
|
|
1824
1837
|
interaction: N,
|
|
1825
1838
|
previewPoint: P,
|
|
@@ -1827,12 +1840,12 @@ var xe = { class: "mobile-console__title" }, Se = { class: "mobile-console__coun
|
|
|
1827
1840
|
getCanvasPoint: L,
|
|
1828
1841
|
hitTestAnnotation: R,
|
|
1829
1842
|
drawAnnotations: F,
|
|
1830
|
-
deleteSelectedAnnotation:
|
|
1843
|
+
deleteSelectedAnnotation: X,
|
|
1831
1844
|
emit: c
|
|
1832
1845
|
}), Te = async (e) => {
|
|
1833
|
-
await
|
|
1846
|
+
await D(e);
|
|
1834
1847
|
}, Ee = () => {
|
|
1835
|
-
|
|
1848
|
+
A();
|
|
1836
1849
|
};
|
|
1837
1850
|
M.on("loaded", (e) => {
|
|
1838
1851
|
c("loaded", {
|
|
@@ -1844,50 +1857,50 @@ var xe = { class: "mobile-console__title" }, Se = { class: "mobile-console__coun
|
|
|
1844
1857
|
}), x(() => N.annotations.length, () => {
|
|
1845
1858
|
F();
|
|
1846
1859
|
}), x(() => o.scale, async (e) => {
|
|
1847
|
-
e && e !==
|
|
1860
|
+
e && e !== O.value && (await k(e), await l(), B());
|
|
1848
1861
|
}), x(() => o.modelValue, async (e) => {
|
|
1849
|
-
e && (await
|
|
1862
|
+
e && (await D(e), await l(), B(!0));
|
|
1850
1863
|
}, {
|
|
1851
1864
|
immediate: !0,
|
|
1852
1865
|
flush: "post"
|
|
1853
1866
|
}), x([b, C], async () => {
|
|
1854
|
-
|
|
1867
|
+
ae(C.value), await ie(S.value);
|
|
1855
1868
|
}), x([() => o.invertMode, () => o.invertThreshold], () => {
|
|
1856
|
-
|
|
1869
|
+
oe(o.invertMode ?? "unblend", o.invertThreshold);
|
|
1857
1870
|
}), x(() => o.maxZoom, (e) => {
|
|
1858
|
-
e && e > 0 &&
|
|
1871
|
+
e && e > 0 && se(e);
|
|
1859
1872
|
});
|
|
1860
1873
|
let $ = null;
|
|
1861
1874
|
return p(() => {
|
|
1862
|
-
|
|
1875
|
+
le({
|
|
1863
1876
|
canvas: _.value,
|
|
1864
1877
|
stage: u.value,
|
|
1865
1878
|
wrap: g.value
|
|
1866
|
-
}), I(), F(), window.addEventListener("keydown",
|
|
1867
|
-
|
|
1879
|
+
}), I(), F(), window.addEventListener("keydown", we), Q(), $ = new ResizeObserver(() => {
|
|
1880
|
+
E.value?.refreshStageBox(), E.value?.requestRender();
|
|
1868
1881
|
}), u.value && $.observe(u.value);
|
|
1869
1882
|
}), f(() => {
|
|
1870
|
-
$?.disconnect(), $ = null, window.removeEventListener("keydown",
|
|
1883
|
+
$?.disconnect(), $ = null, window.removeEventListener("keydown", we), pe(), be(), j();
|
|
1871
1884
|
}), t({
|
|
1872
1885
|
load: Te,
|
|
1873
1886
|
clear: Ee,
|
|
1874
|
-
setMode:
|
|
1875
|
-
clearInteraction:
|
|
1876
|
-
deleteSelectedAnnotation:
|
|
1877
|
-
selectAnnotation:
|
|
1878
|
-
resetView:
|
|
1879
|
-
zoomIn: () =>
|
|
1880
|
-
zoomOut: () =>
|
|
1887
|
+
setMode: J,
|
|
1888
|
+
clearInteraction: Y,
|
|
1889
|
+
deleteSelectedAnnotation: X,
|
|
1890
|
+
selectAnnotation: Z,
|
|
1891
|
+
resetView: ce,
|
|
1892
|
+
zoomIn: () => k(E.value ? E.value.zoom * 1.25 : O.value),
|
|
1893
|
+
zoomOut: () => k(E.value ? E.value.zoom / 1.25 : O.value)
|
|
1881
1894
|
}), (t, n) => (m(), i("div", {
|
|
1882
1895
|
ref_key: "viewerRef",
|
|
1883
1896
|
ref: u,
|
|
1884
1897
|
class: "pdf-core-viewer",
|
|
1885
|
-
style: d(
|
|
1898
|
+
style: d(q.value),
|
|
1886
1899
|
onWheel: n[3] ||= (...e) => y(V) && y(V)(...e),
|
|
1887
|
-
onPointerdown:
|
|
1888
|
-
onPointermove: n[4] ||= (...e) => y(
|
|
1889
|
-
onPointerup: n[5] ||= (...e) => y(
|
|
1890
|
-
onPointercancel: n[6] ||= (...e) => y(
|
|
1900
|
+
onPointerdown: ve,
|
|
1901
|
+
onPointermove: n[4] ||= (...e) => y(U) && y(U)(...e),
|
|
1902
|
+
onPointerup: n[5] ||= (...e) => y(W) && y(W)(...e),
|
|
1903
|
+
onPointercancel: n[6] ||= (...e) => y(G) && y(G)(...e)
|
|
1891
1904
|
}, [a("div", {
|
|
1892
1905
|
ref_key: "rootRef",
|
|
1893
1906
|
ref: g,
|
|
@@ -1898,16 +1911,16 @@ var xe = { class: "mobile-console__title" }, Se = { class: "mobile-console__coun
|
|
|
1898
1911
|
class: "pdf-core-page-canvas"
|
|
1899
1912
|
}, null, 512), a("div", {
|
|
1900
1913
|
class: "pdf-core-overlay",
|
|
1901
|
-
onPointerdown: n[0] ||= (...e) => y(
|
|
1902
|
-
onPointerup: n[1] ||= (...e) => y(
|
|
1903
|
-
onPointermove: n[2] ||= (...e) => y(
|
|
1904
|
-
}, null, 32)], 512), s(
|
|
1914
|
+
onPointerdown: n[0] ||= (...e) => y(xe) && y(xe)(...e),
|
|
1915
|
+
onPointerup: n[1] ||= (...e) => y(Ce) && y(Ce)(...e),
|
|
1916
|
+
onPointermove: n[2] ||= (...e) => y(Se) && y(Se)(...e)
|
|
1917
|
+
}, null, 32)], 512), s(Oe, { visible: e.showConsole }, null, 8, ["visible"])], 36));
|
|
1905
1918
|
}
|
|
1906
|
-
}), [["__scopeId", "data-v-
|
|
1919
|
+
}), [["__scopeId", "data-v-affa757b"]]);
|
|
1907
1920
|
//#endregion
|
|
1908
1921
|
//#region src/vue/plugin.ts
|
|
1909
|
-
function
|
|
1910
|
-
e.component("PdfViewer",
|
|
1922
|
+
function Ae(e) {
|
|
1923
|
+
e.component("PdfViewer", ke);
|
|
1911
1924
|
}
|
|
1912
1925
|
//#endregion
|
|
1913
|
-
export {
|
|
1926
|
+
export { Y as AngleMeasure, X as AreaMeasure, k as ColorInverter, L as CoordTransformer, te as DEFAULT_ACHROMATIC_THRESHOLD, ve as DEFAULT_TOOL_STATE, J as DistanceMeasure, W as EventTrigger, D as INVERT_FILTER_ALL, ee as INVERT_FILTER_HUE, q as MeasureBase, Z as MeasureTool, j as PageCanvasRenderer, ke as PdfViewer, B as PdfViewerCore, M as TileLRUCache, Q as ToolManager, R as ZOOM_LEVELS, V as createMeasureAnnotation, H as createShapeAnnotation, z as getNextZoom, Ae as installPdfCore, E as loadPDF, I as renderPageTiledVirtual, w as setPDFWorkerSrc, G as useAnnotations, T as useDefaultWorker, pe as useInteraction, K as useMeasurement, fe as usePdfCore };
|
package/dist/style.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.mobile-console[data-v-ef8b578a]{z-index:9999;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);color:#d4d4d4;-webkit-user-select:text;user-select:text;background:#1e1e1eeb;border-top:1px solid #ffffff1f;flex-direction:column;max-height:45%;font-family:SF Mono,Cascadia Code,Consolas,monospace;font-size:10px;line-height:1.4;display:flex;position:absolute;bottom:0;left:0;right:0}.mobile-console.collapsed[data-v-ef8b578a]{max-height:none}.mobile-console__header[data-v-ef8b578a]{cursor:pointer;-webkit-tap-highlight-color:transparent;background:#0006;flex-shrink:0;justify-content:space-between;align-items:center;padding:4px 10px;display:flex}.mobile-console__title[data-v-ef8b578a]{color:#e0e0e0;font-size:11px;font-weight:600}.mobile-console__count[data-v-ef8b578a]{text-align:center;background:#ffffff26;border-radius:8px;min-width:18px;margin-left:6px;padding:0 5px;font-size:9px;line-height:16px;display:inline-block}.mobile-console__actions[data-v-ef8b578a]{align-items:center;gap:4px;display:flex}.mobile-console__btn[data-v-ef8b578a]{color:#ccc;cursor:pointer;-webkit-tap-highlight-color:transparent;background:#ffffff14;border:none;border-radius:4px;padding:2px 6px;font-size:11px;line-height:1}.mobile-console__btn[data-v-ef8b578a]:active{background:#fff3}.mobile-console__toggle[data-v-ef8b578a]{color:#999;font-size:10px}.mobile-console__list[data-v-ef8b578a]{-webkit-overflow-scrolling:touch;flex:1;max-height:35vh;padding:2px 0;overflow-y:auto}.mobile-console__entry[data-v-ef8b578a]{word-break:break-all;border-bottom:1px solid #ffffff0a;gap:6px;padding:1px 10px;display:flex}.mobile-console__level[data-v-ef8b578a]{opacity:.6;flex-shrink:0;font-size:9px}.mobile-console__entry--warn .mobile-console__level[data-v-ef8b578a]{color:#eab308}.mobile-console__entry--warn .mobile-console__msg[data-v-ef8b578a]{color:#fde68a}.mobile-console__entry--error .mobile-console__level[data-v-ef8b578a]{color:#ef4444}.mobile-console__entry--error .mobile-console__msg[data-v-ef8b578a]{color:#fca5a5}.mobile-console__msg[data-v-ef8b578a]{color:#d4d4d4}.mobile-console__empty[data-v-ef8b578a]{color:#666;text-align:center;padding:8px 10px;font-style:italic}.pdf-core-viewer[data-v-
|
|
1
|
+
.mobile-console[data-v-ef8b578a]{z-index:9999;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);color:#d4d4d4;-webkit-user-select:text;user-select:text;background:#1e1e1eeb;border-top:1px solid #ffffff1f;flex-direction:column;max-height:45%;font-family:SF Mono,Cascadia Code,Consolas,monospace;font-size:10px;line-height:1.4;display:flex;position:absolute;bottom:0;left:0;right:0}.mobile-console.collapsed[data-v-ef8b578a]{max-height:none}.mobile-console__header[data-v-ef8b578a]{cursor:pointer;-webkit-tap-highlight-color:transparent;background:#0006;flex-shrink:0;justify-content:space-between;align-items:center;padding:4px 10px;display:flex}.mobile-console__title[data-v-ef8b578a]{color:#e0e0e0;font-size:11px;font-weight:600}.mobile-console__count[data-v-ef8b578a]{text-align:center;background:#ffffff26;border-radius:8px;min-width:18px;margin-left:6px;padding:0 5px;font-size:9px;line-height:16px;display:inline-block}.mobile-console__actions[data-v-ef8b578a]{align-items:center;gap:4px;display:flex}.mobile-console__btn[data-v-ef8b578a]{color:#ccc;cursor:pointer;-webkit-tap-highlight-color:transparent;background:#ffffff14;border:none;border-radius:4px;padding:2px 6px;font-size:11px;line-height:1}.mobile-console__btn[data-v-ef8b578a]:active{background:#fff3}.mobile-console__toggle[data-v-ef8b578a]{color:#999;font-size:10px}.mobile-console__list[data-v-ef8b578a]{-webkit-overflow-scrolling:touch;flex:1;max-height:35vh;padding:2px 0;overflow-y:auto}.mobile-console__entry[data-v-ef8b578a]{word-break:break-all;border-bottom:1px solid #ffffff0a;gap:6px;padding:1px 10px;display:flex}.mobile-console__level[data-v-ef8b578a]{opacity:.6;flex-shrink:0;font-size:9px}.mobile-console__entry--warn .mobile-console__level[data-v-ef8b578a]{color:#eab308}.mobile-console__entry--warn .mobile-console__msg[data-v-ef8b578a]{color:#fde68a}.mobile-console__entry--error .mobile-console__level[data-v-ef8b578a]{color:#ef4444}.mobile-console__entry--error .mobile-console__msg[data-v-ef8b578a]{color:#fca5a5}.mobile-console__msg[data-v-ef8b578a]{color:#d4d4d4}.mobile-console__empty[data-v-ef8b578a]{color:#666;text-align:center;padding:8px 10px;font-style:italic}.pdf-core-viewer[data-v-affa757b]{width:100%;height:100%;position:relative}.pdf-core-content[data-v-affa757b]{transform-origin:0 0;position:absolute;top:0;left:0}.pdf-core-page-canvas[data-v-affa757b]{background:#fff;display:block;position:absolute}.pdf-core-annotation-canvas[data-v-affa757b]{z-index:1;pointer-events:none;position:absolute;inset:0}.pdf-core-overlay[data-v-affa757b]{z-index:2;position:absol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M,EAAE,IAAI,GAAG,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,aAAa;IACb,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,4BAA4B;IAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,qBAAqB;IACrB,eAAe,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,sCAAsC;IACtC,aAAa,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9D,kCAAkC;IAClC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,aAAa;IACb,YAAY,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAC3B,wBAAwB;IACxB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,KAAK,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,gBAAgB,CA+L5E"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xtctwins/tctwins-pdf-core",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.3",
|
|
5
5
|
"description": "Reusable PDF core with Vue 3 viewer, tile rendering, annotations (measure/rectangle), and composables",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|