@file-viewer/vue3 3.2.2 → 3.3.1
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.en.md +31 -9
- package/README.md +265 -246
- package/README.zh-CN.md +465 -0
- package/dist/components/export.js +2 -3
- package/dist/components/export2.js +458 -426
- package/dist/components/fit.js +4 -14
- package/dist/components/image.js +130 -66
- package/dist/components/messages.js +1 -2
- package/dist/components/objectSpread2.js +6 -12
- package/dist/components/print-mask.js +1 -2
- package/dist/components/printMask.js +1 -2
- package/dist/index.mjs +1414 -1401
- package/dist/src/package/components/FileViewer/hooks/useViewerSourceLoading.d.ts +2 -1
- package/dist/src/package/components/FileViewer/hooks/useViewerToolbar.d.ts +1 -0
- package/dist/vue3.css +1 -1
- package/package.json +6 -5
package/dist/components/fit.js
CHANGED
|
@@ -51,14 +51,7 @@ var n = (e = {}) => {
|
|
|
51
51
|
n += i - o, r += 1;
|
|
52
52
|
}
|
|
53
53
|
}), c;
|
|
54
|
-
}, s = (/* @__PURE__ */ "[data-viewer-anchor-id],.pdfViewer .page,.docx-wrapper section,.docx p,.docx li,.docx table,.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6,.markdown-body p,.markdown-body li,.markdown-body pre,.markdown-body table,article h1,article h2,article h3,article h4,article h5,article h6,article p,article li,article pre,article table,pre code,p,li,tr,h1,h2,h3,h4,h5,h6,pre,table".split(",")).join(","), c = [
|
|
55
|
-
".viewer-actions",
|
|
56
|
-
".viewer-watermark",
|
|
57
|
-
".state-panel",
|
|
58
|
-
".pdf-toolbar",
|
|
59
|
-
".pdf-nav-pane",
|
|
60
|
-
".flyfish-search-match"
|
|
61
|
-
].join(","), l = (e) => typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/["\\]/g, "\\$&"), u = (e, t = 160) => {
|
|
54
|
+
}, s = (/* @__PURE__ */ "[data-viewer-anchor-id],.pdfViewer .page,.docx-wrapper section,.docx p,.docx li,.docx table,.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6,.markdown-body p,.markdown-body li,.markdown-body pre,.markdown-body table,article h1,article h2,article h3,article h4,article h5,article h6,article p,article li,article pre,article table,pre code,p,li,tr,h1,h2,h3,h4,h5,h6,pre,table".split(",")).join(","), c = ".viewer-actions,.viewer-watermark,.state-panel,.pdf-toolbar,.pdf-nav-pane,.flyfish-search-match", l = (e) => typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/["\\]/g, "\\$&"), u = (e, t = 160) => {
|
|
62
55
|
let n = e.replace(/\s+/g, " ").trim();
|
|
63
56
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
64
57
|
}, d = (e) => {
|
|
@@ -162,8 +155,7 @@ var n = (e = {}) => {
|
|
|
162
155
|
let n = w(e, "[data-viewer-view-state-provider]"), r = n.find((e) => e.dataset.viewerViewStateProvider !== "generic"), i = n.find((e) => e.dataset.viewerViewStateProvider === "generic"), a = r || i;
|
|
163
156
|
return a ? S.get(a) || a.__flyfishViewerViewStateProvider || null : t || null;
|
|
164
157
|
};
|
|
165
|
-
|
|
166
|
-
//#region ../../core/dist/features/document/zoomGestures.js
|
|
158
|
+
// ../../core/dist/features/document/zoomGestures.js
|
|
167
159
|
function M(t, n) {
|
|
168
160
|
let r = t.ownerDocument.defaultView;
|
|
169
161
|
if (!r) return () => {};
|
|
@@ -175,7 +167,7 @@ function M(t, n) {
|
|
|
175
167
|
let i = t.getState();
|
|
176
168
|
return Math.min((n = i.maxScale) == null ? 4 : n, Math.max((r = i.minScale) == null ? .1 : r, e));
|
|
177
169
|
}, p = () => {
|
|
178
|
-
|
|
170
|
+
i || o || a || s === null || (a = r.requestAnimationFrame(() => {
|
|
179
171
|
a = 0, m();
|
|
180
172
|
}));
|
|
181
173
|
}, m = function() {
|
|
@@ -224,8 +216,7 @@ function M(t, n) {
|
|
|
224
216
|
i = !0, s = null, c = null, l = null, a && r.cancelAnimationFrame(a), t.removeEventListener("wheel", g), t.removeEventListener("touchstart", v), t.removeEventListener("touchmove", y), t.removeEventListener("touchend", b), t.removeEventListener("touchcancel", b);
|
|
225
217
|
};
|
|
226
218
|
}
|
|
227
|
-
|
|
228
|
-
//#region ../../core/dist/features/document/zoom.js
|
|
219
|
+
// ../../core/dist/features/document/zoom.js
|
|
229
220
|
var N = (e) => ({
|
|
230
221
|
scale: e.scale,
|
|
231
222
|
label: e.label,
|
|
@@ -542,5 +533,4 @@ var I = () => {
|
|
|
542
533
|
}
|
|
543
534
|
};
|
|
544
535
|
};
|
|
545
|
-
//#endregion
|
|
546
536
|
export { o as _, R as a, O as c, A as d, D as f, y as g, v as h, I as i, k as l, _ as m, ee as n, T as o, g as p, Z as r, j as s, re as t, E as u, i as v, r as y };
|
package/dist/components/image.js
CHANGED
|
@@ -1,8 +1,73 @@
|
|
|
1
1
|
import { r as e } from "./objectSpread2.js";
|
|
2
2
|
import { f as t, i as n, r, u as i } from "./fit.js";
|
|
3
3
|
import { t as a } from "./messages.js";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
// ../../core/dist/features/document/imageHandTool.js
|
|
5
|
+
function o(e, t) {
|
|
6
|
+
let n = e.ownerDocument.defaultView;
|
|
7
|
+
if (!n || t != null && t.aborted) return () => {};
|
|
8
|
+
let r = e.style.getPropertyValue("cursor"), i = e.style.getPropertyPriority("cursor"), a = e.style.getPropertyValue("user-select"), o = e.style.getPropertyPriority("user-select"), s = e.getAttribute("data-viewer-image-hand-tool"), c = e.getAttribute("data-viewer-image-panning"), l = e.ownerDocument.createElement("style");
|
|
9
|
+
l.textContent = "[data-viewer-image-hand-tool=\"true\"] img{cursor:grab!important}[data-viewer-image-panning=\"true\"] img{cursor:grabbing!important}", e.append(l);
|
|
10
|
+
let u = null, d = !1, f = !1, p = 0, m = () => e.scrollWidth > e.clientWidth || e.scrollHeight > e.clientHeight, h = () => {
|
|
11
|
+
if (d || u != null && u.moved) return;
|
|
12
|
+
let t = m();
|
|
13
|
+
e.setAttribute("data-viewer-image-hand-tool", String(t)), e.style.setProperty("cursor", t ? "grab" : r, t ? "" : i);
|
|
14
|
+
}, g = () => {
|
|
15
|
+
var t;
|
|
16
|
+
let r = u;
|
|
17
|
+
r && (u = null, e.style.setProperty("user-select", a, o), e.removeAttribute("data-viewer-image-panning"), n.removeEventListener("pointermove", _, !0), n.removeEventListener("pointerup", v, !0), n.removeEventListener("pointercancel", v, !0), n.removeEventListener("blur", g), (t = e.hasPointerCapture) != null && t.call(e, r.id) && e.releasePointerCapture(r.id), f = r.moved, n.clearTimeout(p), p = n.setTimeout(() => {
|
|
18
|
+
f = !1;
|
|
19
|
+
}, 250), h());
|
|
20
|
+
}, _ = (t) => {
|
|
21
|
+
var n;
|
|
22
|
+
if (!u || t.pointerId !== u.id) return;
|
|
23
|
+
if (!(t.buttons & 1)) {
|
|
24
|
+
g();
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
let r = (t.clientX - u.x) / u.ratioX, i = (t.clientY - u.y) / u.ratioY;
|
|
28
|
+
if (!(!u.moved && Math.hypot(r, i) < 3)) {
|
|
29
|
+
if (!u.moved) {
|
|
30
|
+
u.moved = !0, e.setAttribute("data-viewer-image-panning", "true"), e.style.cursor = "grabbing", e.style.setProperty("user-select", "none");
|
|
31
|
+
try {
|
|
32
|
+
(n = e.setPointerCapture) == null || n.call(e, t.pointerId);
|
|
33
|
+
} catch (e) {}
|
|
34
|
+
}
|
|
35
|
+
e.scrollLeft = u.left - r, e.scrollTop = u.top - i, t.preventDefault();
|
|
36
|
+
}
|
|
37
|
+
}, v = (e) => {
|
|
38
|
+
e.pointerId === (u == null ? void 0 : u.id) && g();
|
|
39
|
+
}, y = (t) => {
|
|
40
|
+
if (d || t.defaultPrevented || t.pointerType !== "mouse" || t.button !== 0 || t.isPrimary === !1 || t.ctrlKey || t.metaKey || t.altKey || t.shiftKey || t.composedPath().some((t) => {
|
|
41
|
+
var n, r;
|
|
42
|
+
return t !== e && ((r = (n = t).matches) == null ? void 0 : r.call(n, "a,button,input,textarea,select,option,[contenteditable]:not([contenteditable=\"false\"]),[role=\"button\"]:not(img),[role=\"link\"],[role=\"textbox\"]"));
|
|
43
|
+
}) || (g(), f = !1, h(), !m())) return;
|
|
44
|
+
let r = e.getBoundingClientRect(), i = e.offsetWidth ? r.width / e.offsetWidth : 1, a = e.offsetHeight ? r.height / e.offsetHeight : 1;
|
|
45
|
+
if (![i, a].every((e) => Number.isFinite(e) && e > 0)) return;
|
|
46
|
+
let o = (t.clientX - r.left) / i - e.clientLeft, s = (t.clientY - r.top) / a - e.clientTop;
|
|
47
|
+
o < 0 || s < 0 || o >= e.clientWidth || s >= e.clientHeight || (u = {
|
|
48
|
+
id: t.pointerId,
|
|
49
|
+
x: t.clientX,
|
|
50
|
+
y: t.clientY,
|
|
51
|
+
left: e.scrollLeft,
|
|
52
|
+
top: e.scrollTop,
|
|
53
|
+
ratioX: i,
|
|
54
|
+
ratioY: a,
|
|
55
|
+
moved: !1
|
|
56
|
+
}, n.addEventListener("pointermove", _, {
|
|
57
|
+
capture: !0,
|
|
58
|
+
passive: !1
|
|
59
|
+
}), n.addEventListener("pointerup", v, !0), n.addEventListener("pointercancel", v, !0), n.addEventListener("blur", g));
|
|
60
|
+
}, b = (e) => {
|
|
61
|
+
f && e.detail > 0 && (e.preventDefault(), e.stopImmediatePropagation());
|
|
62
|
+
}, x = (e) => {
|
|
63
|
+
u && e.preventDefault();
|
|
64
|
+
}, S = (t, n) => n === null ? e.removeAttribute(t) : e.setAttribute(t, n), C = () => {
|
|
65
|
+
d || (g(), d = !0, n.clearTimeout(p), f = !1, e.style.setProperty("cursor", r, i), e.style.setProperty("user-select", a, o), S("data-viewer-image-hand-tool", s), S("data-viewer-image-panning", c), e.removeEventListener("pointerdown", y), e.removeEventListener("pointermove", h), e.removeEventListener("pointerover", h), e.removeEventListener("lostpointercapture", v), e.removeEventListener("click", b, !0), e.removeEventListener("dragstart", x), t == null || t.removeEventListener("abort", C), l.remove());
|
|
66
|
+
};
|
|
67
|
+
return e.addEventListener("pointerdown", y), e.addEventListener("pointermove", h), e.addEventListener("pointerover", h), e.addEventListener("lostpointercapture", v), e.addEventListener("click", b, !0), e.addEventListener("dragstart", x), t == null || t.addEventListener("abort", C, { once: !0 }), h(), C;
|
|
68
|
+
}
|
|
69
|
+
// ../../core/dist/renderers/image.js
|
|
70
|
+
var s = {
|
|
6
71
|
avif: "image/avif",
|
|
7
72
|
bmp: "image/bmp",
|
|
8
73
|
gif: "image/gif",
|
|
@@ -17,10 +82,10 @@ var o = {
|
|
|
17
82
|
tif: "image/tiff",
|
|
18
83
|
tiff: "image/tiff",
|
|
19
84
|
webp: "image/webp"
|
|
20
|
-
},
|
|
85
|
+
}, c = "\n.image-viewer{position:relative;width:100%;height:100%;overflow:auto;background:var(--file-viewer-render-surface-background,#eef1f4);box-sizing:border-box}\n.image-stage{width:max-content;min-width:100%;min-height:100%;display:flex;align-items:center;justify-content:center;padding:24px;box-sizing:border-box}\n.image-stage img{display:block;width:auto;max-width:none;margin:0 auto;border:0;box-shadow:0 18px 48px rgba(15,23,42,.16);background:#fff;cursor:zoom-in}\n.image-stage img:focus-visible{outline:3px solid #2563eb;outline-offset:4px}\n.image-lightbox{position:absolute;inset:0;z-index:40;display:flex;align-items:center;justify-content:center;padding:40px;background:rgba(15,23,42,.9);box-sizing:border-box;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .18s ease,visibility 0s linear .18s}\n.image-lightbox[data-open='true']{opacity:1;visibility:visible;pointer-events:auto;transition-delay:0s}\n.image-lightbox img{display:block;max-width:100%;max-height:100%;object-fit:contain;background:#fff;box-shadow:0 30px 80px rgba(0,0,0,.4);cursor:default;transform:scale(.985);transition:transform .18s ease}\n.image-lightbox[data-open='true'] img{transform:scale(1)}\n.image-lightbox button{position:absolute;top:16px;right:16px;display:grid;width:40px;height:40px;place-items:center;padding:0;border:1px solid rgba(255,255,255,.7);border-radius:999px;background:rgba(255,255,255,.96);color:#172033;font:400 27px/1 Arial,sans-serif;cursor:pointer;box-shadow:0 12px 28px rgba(0,0,0,.24);transition:background-color .14s ease,transform .14s ease}\n.image-lightbox button:hover{background:#fff;transform:scale(1.04)}\n.image-lightbox button:focus-visible{outline:3px solid #60a5fa;outline-offset:2px}\n[data-viewer-theme='dark'] .image-viewer{background:var(--file-viewer-render-surface-background,#101820)}\n@media (prefers-color-scheme:dark){[data-viewer-theme='system'] .image-viewer{background:var(--file-viewer-render-surface-background,#101820)}}\n@media (max-width:767px){.image-stage{padding:12px}.image-lightbox{padding:16px}.image-lightbox button{top:12px;right:12px}}\n@media (prefers-reduced-motion:reduce){.image-lightbox,.image-lightbox img,.image-lightbox button{transition:none}}\n", l = (e) => {
|
|
21
86
|
let t = e.createElement("style");
|
|
22
|
-
return t.textContent =
|
|
23
|
-
},
|
|
87
|
+
return t.textContent = c, t;
|
|
88
|
+
}, u = (e) => s[(e || "").trim().toLowerCase()] || "image/*", d = function() {
|
|
24
89
|
var t = e(function* (e) {
|
|
25
90
|
return yield new Promise((t, n) => {
|
|
26
91
|
let r = new FileReader();
|
|
@@ -34,16 +99,16 @@ var o = {
|
|
|
34
99
|
return function(e) {
|
|
35
100
|
return t.apply(this, arguments);
|
|
36
101
|
};
|
|
37
|
-
}(),
|
|
102
|
+
}(), f = function() {
|
|
38
103
|
var t = e(function* (e, t) {
|
|
39
104
|
let n = (t || "").trim().toLowerCase();
|
|
40
105
|
if (n === "heic" || n === "heif") throw Error("HEIC/HEIF image conversion has moved out of @file-viewer/core. Install and pass @file-viewer/renderer-image, or use @file-viewer/preset-all.");
|
|
41
|
-
return
|
|
106
|
+
return d(new Blob([e], { type: u(n) }));
|
|
42
107
|
});
|
|
43
108
|
return function(e, n) {
|
|
44
109
|
return t.apply(this, arguments);
|
|
45
110
|
};
|
|
46
|
-
}(),
|
|
111
|
+
}(), p = (e) => Number(e.toFixed(3)), m = (e, t, n) => {
|
|
47
112
|
let r = e.createElement("div");
|
|
48
113
|
r.className = "image-lightbox", r.dataset.open = "false", r.setAttribute("role", "dialog"), r.setAttribute("aria-modal", "true"), r.setAttribute("aria-hidden", "true");
|
|
49
114
|
let i = e.createElement("img");
|
|
@@ -67,59 +132,59 @@ var o = {
|
|
|
67
132
|
}
|
|
68
133
|
};
|
|
69
134
|
};
|
|
70
|
-
function
|
|
71
|
-
return
|
|
135
|
+
function h(e, t, n, r) {
|
|
136
|
+
return g.apply(this, arguments);
|
|
72
137
|
}
|
|
73
|
-
function
|
|
74
|
-
return
|
|
75
|
-
var
|
|
76
|
-
let
|
|
77
|
-
(
|
|
78
|
-
let
|
|
79
|
-
|
|
80
|
-
let
|
|
81
|
-
|
|
82
|
-
let
|
|
83
|
-
|
|
84
|
-
let
|
|
85
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
138
|
+
function g() {
|
|
139
|
+
return g = e(function* (e, s, c, d) {
|
|
140
|
+
var h, g, _, v;
|
|
141
|
+
let y = a(d == null ? void 0 : d.options), b = s.ownerDocument || document, x = b.defaultView, S = yield f(e, c);
|
|
142
|
+
(h = d == null ? void 0 : d.registerThumbnailAdapter) == null || h.call(d, { capture: () => new Blob([e], { type: u(c) }) });
|
|
143
|
+
let C = 1, w = 1, T = 1, E = 0, D = null, O = !1, k = n(), A = b.createElement("div");
|
|
144
|
+
A.className = "image-viewer", A.dataset.viewerZoomProvider = "image";
|
|
145
|
+
let j = b.createElement("div");
|
|
146
|
+
j.className = "image-stage";
|
|
147
|
+
let M = b.createElement("img");
|
|
148
|
+
M.alt = y("image.alt"), M.src = S, M.tabIndex = 0, M.setAttribute("role", "button"), M.setAttribute("aria-haspopup", "dialog"), j.append(M), A.append(j);
|
|
149
|
+
let N = ((_ = (g = d == null ? void 0 : d.options) == null ? void 0 : g.image) == null ? void 0 : _.handTool) === !0 ? o(A, d.signal) : () => {}, P = m(b, S, y), F = () => P.open(M), I = (e) => {
|
|
150
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), P.open(M));
|
|
86
151
|
};
|
|
87
|
-
|
|
88
|
-
let
|
|
89
|
-
let t =
|
|
90
|
-
return Math.min(5, Math.max(t,
|
|
91
|
-
},
|
|
92
|
-
let e =
|
|
152
|
+
M.addEventListener("click", F), M.addEventListener("keydown", I);
|
|
153
|
+
let L = () => Math.min(.1, w || .1), R = (e) => {
|
|
154
|
+
let t = L();
|
|
155
|
+
return Math.min(5, Math.max(t, p(e)));
|
|
156
|
+
}, z = () => {
|
|
157
|
+
let e = M.naturalWidth || 0, t = M.naturalHeight || 0;
|
|
93
158
|
if (!e || !t) return 1;
|
|
94
|
-
let n = Math.max((
|
|
159
|
+
let n = Math.max((A.clientWidth || 0) - 48, 1), r = Math.max((A.clientHeight || E || 0) - 48, 1);
|
|
95
160
|
return Math.min(1, n / e, r / t);
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}) :
|
|
161
|
+
}, B = () => {
|
|
162
|
+
w = z(), T = R(w * C), M.naturalWidth && M.naturalHeight ? (M.style.width = `${Math.max(1, Math.round(M.naturalWidth * T))}px`, M.style.height = `${Math.max(1, Math.round(M.naturalHeight * T))}px`) : (M.style.width = "auto", M.style.height = E > 0 ? `${Math.max(1, Math.round(E * C))}px` : `${C * 100}%`);
|
|
163
|
+
}, V = () => {
|
|
164
|
+
E = A.clientHeight || 0, B(), k.emit();
|
|
165
|
+
}, H = new ResizeObserver(() => {
|
|
166
|
+
O || D !== null || (x != null && x.requestAnimationFrame ? D = x.requestAnimationFrame(() => {
|
|
167
|
+
D = null, O || V();
|
|
168
|
+
}) : V());
|
|
104
169
|
});
|
|
105
|
-
|
|
106
|
-
let
|
|
107
|
-
scale:
|
|
108
|
-
label: `${Math.round(
|
|
109
|
-
canZoomIn:
|
|
110
|
-
canZoomOut:
|
|
111
|
-
canReset: Math.abs(
|
|
112
|
-
minScale:
|
|
170
|
+
H.observe(A), M.addEventListener("load", V);
|
|
171
|
+
let U = () => ({
|
|
172
|
+
scale: T,
|
|
173
|
+
label: `${Math.round(T * 100)}%`,
|
|
174
|
+
canZoomIn: T < 5,
|
|
175
|
+
canZoomOut: T > L(),
|
|
176
|
+
canReset: Math.abs(C - 1) > .001,
|
|
177
|
+
minScale: L(),
|
|
113
178
|
maxScale: 5
|
|
114
|
-
}),
|
|
115
|
-
return i(
|
|
116
|
-
zoomIn: () =>
|
|
117
|
-
zoomOut: () =>
|
|
118
|
-
resetZoom: () => (
|
|
119
|
-
setZoom:
|
|
179
|
+
}), W = (e) => (C = R(e) / Math.max(w, .001), B(), k.emit(), U());
|
|
180
|
+
return i(A, {
|
|
181
|
+
zoomIn: () => W(T + .15),
|
|
182
|
+
zoomOut: () => W(T - .15),
|
|
183
|
+
resetZoom: () => (C = 1, B(), k.emit(), U()),
|
|
184
|
+
setZoom: W,
|
|
120
185
|
fit: (e) => {
|
|
121
186
|
var t, n;
|
|
122
|
-
let i =
|
|
187
|
+
let i = M.naturalWidth || 0, a = M.naturalHeight || 0;
|
|
123
188
|
if (!i || !a) return {
|
|
124
189
|
applied: !1,
|
|
125
190
|
mode: e.mode,
|
|
@@ -130,12 +195,12 @@ function h() {
|
|
|
130
195
|
};
|
|
131
196
|
let o = e.mode === "auto" ? "scale-down" : e.mode, s = r({
|
|
132
197
|
mode: o,
|
|
133
|
-
viewportWidth: Math.max(1, e.viewportWidth ||
|
|
134
|
-
viewportHeight: Math.max(1, e.viewportHeight ||
|
|
198
|
+
viewportWidth: Math.max(1, e.viewportWidth || A.clientWidth || 0),
|
|
199
|
+
viewportHeight: Math.max(1, e.viewportHeight || A.clientHeight || E || 0),
|
|
135
200
|
contentWidth: i,
|
|
136
201
|
contentHeight: a,
|
|
137
|
-
currentScale:
|
|
138
|
-
minScale: (t = e.minScale) == null ?
|
|
202
|
+
currentScale: T,
|
|
203
|
+
minScale: (t = e.minScale) == null ? L() : t,
|
|
139
204
|
maxScale: (n = e.maxScale) == null ? 5 : n
|
|
140
205
|
});
|
|
141
206
|
if (!s) return {
|
|
@@ -146,7 +211,7 @@ function h() {
|
|
|
146
211
|
reason: "unmeasurable",
|
|
147
212
|
provider: "zoom"
|
|
148
213
|
};
|
|
149
|
-
let c =
|
|
214
|
+
let c = W(s);
|
|
150
215
|
return {
|
|
151
216
|
applied: !0,
|
|
152
217
|
mode: e.mode,
|
|
@@ -156,16 +221,15 @@ function h() {
|
|
|
156
221
|
provider: "zoom"
|
|
157
222
|
};
|
|
158
223
|
},
|
|
159
|
-
getState:
|
|
160
|
-
subscribe:
|
|
161
|
-
}),
|
|
162
|
-
$el:
|
|
224
|
+
getState: U,
|
|
225
|
+
subscribe: k.subscribe
|
|
226
|
+
}), s.replaceChildren(l(b), A), (((v = d == null ? void 0 : d.surface) == null ? void 0 : v.shadowRoot) || s).append(P.element), V(), {
|
|
227
|
+
$el: s,
|
|
163
228
|
unmount() {
|
|
164
229
|
var e;
|
|
165
|
-
|
|
230
|
+
O = !0, D !== null && (x == null || x.cancelAnimationFrame(D), D = null), (e = d == null ? void 0 : d.registerThumbnailAdapter) == null || e.call(d, null), t(A), N(), H.disconnect(), M.removeEventListener("load", V), M.removeEventListener("click", F), M.removeEventListener("keydown", I), P.destroy(), s.replaceChildren();
|
|
166
231
|
}
|
|
167
232
|
};
|
|
168
|
-
}),
|
|
233
|
+
}), g.apply(this, arguments);
|
|
169
234
|
}
|
|
170
|
-
|
|
171
|
-
export { m as default };
|
|
235
|
+
export { h as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../core/dist/i18n/messages.ja.js
|
|
2
2
|
var e = {
|
|
3
3
|
"toolbar.zoomGroup": "ズーム操作",
|
|
4
4
|
"toolbar.zoomOut": "縮小",
|
|
@@ -1884,5 +1884,4 @@ var e = {
|
|
|
1884
1884
|
let r = l(e), a = c(e);
|
|
1885
1885
|
return u((typeof a == "function" ? a(t, n, r) : a == null ? void 0 : a[t]) || i[r][t] || i["en-US"][t] || i["zh-CN"][t], n);
|
|
1886
1886
|
}, f = (e) => (t, n) => d(e, t, n);
|
|
1887
|
-
//#endregion
|
|
1888
1887
|
export { l as n, d as r, f as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// \0@oxc-project+runtime@0.155.0/helpers/esm/asyncToGenerator.js
|
|
2
2
|
function e(e, t, n, r, i, a, o) {
|
|
3
3
|
try {
|
|
4
4
|
var s = e[a](o), c = s.value;
|
|
@@ -23,8 +23,7 @@ function t(t) {
|
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
26
|
+
// \0@oxc-project+runtime@0.155.0/helpers/esm/typeof.js
|
|
28
27
|
function n(e) {
|
|
29
28
|
"@babel/helpers - typeof";
|
|
30
29
|
return n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
@@ -33,8 +32,7 @@ function n(e) {
|
|
|
33
32
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
34
33
|
}, n(e);
|
|
35
34
|
}
|
|
36
|
-
|
|
37
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
35
|
+
// \0@oxc-project+runtime@0.155.0/helpers/esm/toPrimitive.js
|
|
38
36
|
function r(e, t) {
|
|
39
37
|
if (n(e) != "object" || !e) return e;
|
|
40
38
|
var r = e[Symbol.toPrimitive];
|
|
@@ -45,14 +43,12 @@ function r(e, t) {
|
|
|
45
43
|
}
|
|
46
44
|
return (t === "string" ? String : Number)(e);
|
|
47
45
|
}
|
|
48
|
-
|
|
49
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
46
|
+
// \0@oxc-project+runtime@0.155.0/helpers/esm/toPropertyKey.js
|
|
50
47
|
function i(e) {
|
|
51
48
|
var t = r(e, "string");
|
|
52
49
|
return n(t) == "symbol" ? t : t + "";
|
|
53
50
|
}
|
|
54
|
-
|
|
55
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
51
|
+
// \0@oxc-project+runtime@0.155.0/helpers/esm/defineProperty.js
|
|
56
52
|
function a(e, t, n) {
|
|
57
53
|
return (t = i(t)) in e ? Object.defineProperty(e, t, {
|
|
58
54
|
value: n,
|
|
@@ -61,8 +57,7 @@ function a(e, t, n) {
|
|
|
61
57
|
writable: !0
|
|
62
58
|
}) : e[t] = n, e;
|
|
63
59
|
}
|
|
64
|
-
|
|
65
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/objectSpread2.js
|
|
60
|
+
// \0@oxc-project+runtime@0.155.0/helpers/esm/objectSpread2.js
|
|
66
61
|
function o(e, t) {
|
|
67
62
|
var n = Object.keys(e);
|
|
68
63
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -84,5 +79,4 @@ function s(e) {
|
|
|
84
79
|
}
|
|
85
80
|
return e;
|
|
86
81
|
}
|
|
87
|
-
//#endregion
|
|
88
82
|
export { a as n, t as r, s as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as e, t } from "./objectSpread2.js";
|
|
2
2
|
import { t as n } from "./messages.js";
|
|
3
3
|
import { a as r, o as i } from "./printMask.js";
|
|
4
|
-
|
|
4
|
+
// ../../core/dist/features/printMaskDesigner.js
|
|
5
5
|
var a = "\n.fv-print-mask-layer{position:absolute;inset:0;z-index:2147483000;pointer-events:none;}\n.fv-print-mask-canvas{position:absolute;inset:0;z-index:2147483000;pointer-events:none;cursor:default;}\n.fv-print-mask-canvas.is-armed{pointer-events:auto;cursor:crosshair;touch-action:none;}\n.fv-print-mask-block{position:absolute;background:#000;box-sizing:border-box;pointer-events:auto;}\n.fv-print-mask-block-remove{position:absolute;right:-8px;top:-8px;width:18px;height:18px;border:0;border-radius:999px;background:#111;color:#fff;font:700 12px/18px system-ui,sans-serif;cursor:pointer;padding:0;}\n.fv-print-stamp{position:absolute;box-sizing:border-box;border:1px dashed rgba(22,119,76,.7);border-radius:4px;pointer-events:auto;touch-action:none;cursor:move;transform-origin:center center;}\n.fv-print-stamp img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none;user-select:none;}\n.fv-print-stamp-resize{position:absolute;right:-7px;bottom:-7px;width:15px;height:15px;border:2px solid #fff;border-radius:4px;background:#16774c;box-shadow:0 1px 5px rgba(15,23,42,.22);cursor:nwse-resize;touch-action:none;}\n.fv-print-stamp-input{display:none!important;}\n.fv-print-mask-toolbar{position:absolute;left:50%;bottom:16px;transform:translateX(-50%);z-index:2147483001;display:inline-flex;align-items:center;gap:6px;padding:6px 8px;border:1px solid rgba(20,35,53,.12);border-radius:999px;background:rgba(255,255,255,.94);box-shadow:0 12px 28px rgba(15,23,42,.16);pointer-events:auto;max-width:calc(100% - 24px);flex-wrap:wrap;justify-content:center;}\n.fv-print-mask-toolbar span{font:600 12px/1.2 system-ui,sans-serif;color:#40546a;white-space:nowrap;}\n.fv-print-mask-toolbar button{min-width:42px;height:30px;padding:0 10px;border:0;border-radius:999px;background:transparent;color:#40546a;font:800 12px/1 system-ui,sans-serif;cursor:pointer;}\n.fv-print-mask-toolbar button:hover,.fv-print-mask-toolbar button.is-active{background:rgba(33,163,102,.1);color:#16774c;}\n.fv-print-mask-toolbar button.primary{background:#16774c;color:#fff;}\n.fv-print-mask-toolbar button.primary:hover{background:#0f5f3c;}\n", o = (e) => {
|
|
6
6
|
let t = e.ownerDocument, n = e.getRootNode(), r = n === t ? t.head : n;
|
|
7
7
|
if (r.querySelector("#fv-print-mask-designer-style")) return;
|
|
@@ -202,5 +202,4 @@ var a = "\n.fv-print-mask-layer{position:absolute;inset:0;z-index:2147483000;poi
|
|
|
202
202
|
}), F();
|
|
203
203
|
});
|
|
204
204
|
};
|
|
205
|
-
//#endregion
|
|
206
205
|
export { d as openFileViewerPrintMaskDesigner };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./objectSpread2.js";
|
|
2
|
-
|
|
2
|
+
// ../../core/dist/features/printMask.js
|
|
3
3
|
var t = (e) => Math.max(0, Math.min(100, e)), n = (e) => {
|
|
4
4
|
if (typeof e != "string") return "#000000";
|
|
5
5
|
let t = e.trim();
|
|
@@ -122,5 +122,4 @@ var t = (e) => Math.max(0, Math.min(100, e)), n = (e) => {
|
|
|
122
122
|
}
|
|
123
123
|
return s.length ? (s.push(e.slice(l)), s.join("")) : e;
|
|
124
124
|
};
|
|
125
|
-
//#endregion
|
|
126
125
|
export { r as a, c as i, _ as n, s as o, u as r, d as t };
|