file-viewer3 1.0.1 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/{ImageViewer-3aabb7c7.mjs → components/ImageViewer.js} +1 -1
- package/dist/{MarkdownViewer-11f6e7ed.mjs → components/MarkdownViewer.js} +1 -1
- package/dist/{PdfView-c5946833.mjs → components/PdfView.js} +17 -12
- package/dist/{PptxRender-f90c00c0.mjs → components/PptxRender.js} +127 -125
- package/dist/{XlsxTable-22ea834f.mjs → components/XlsxTable.js} +5210 -5207
- package/dist/{docx-preview.min-31358ab2.mjs → components/docx-preview.min.js} +2 -2
- package/dist/{index-59c602ca.mjs → components/index.js} +6 -6
- package/dist/components/worker-ref.js +21 -0
- package/dist/{main.mjs → index.mjs} +1 -1
- package/dist/{main.umd.js → index.umd.js} +12 -12
- package/dist/src/package/common/worker-ref.d.ts +12 -0
- package/dist/src/package/vendors/pdf/worker/index.d.ts +4 -0
- package/dist/src/package/vendors/pptx/worker/index.d.ts +4 -0
- package/dist/src/package/vendors/xlsx/worker/index.d.ts +4 -0
- package/dist/style.css +2 -2
- package/package.json +3 -3
- package/.vscode/extensions.json +0 -3
- /package/dist/{_commonjs-dynamic-modules-bed80856.mjs → components/_commonjs-dynamic-modules.js} +0 -0
- /package/dist/{_commonjsHelpers-92157f1b.mjs → components/_commonjsHelpers.js} +0 -0
- /package/dist/{assets/pdf.worker-909112bf.js → worker/pdf.worker.js} +0 -0
- /package/dist/{assets/pptx.worker-762bd091.js → worker/pptx.worker.js} +0 -0
- /package/dist/{assets/xlsx.worker-b50adc35.js → worker/xlsx.worker.js} +0 -0
package/README.md
CHANGED
|
@@ -135,3 +135,13 @@ var context = {
|
|
|
135
135
|
4. 具体请参考demo代码,原理是基于`iframe`跨域通信机制。
|
|
136
136
|
|
|
137
137
|

|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
## 更新日志
|
|
142
|
+
|
|
143
|
+
#### [feature]`v1.0.6` `2022年4月23日`
|
|
144
|
+
|
|
145
|
+
1. 解决部分pdf字体不显示的问题
|
|
146
|
+
2. 增加pdf预览初始缩放大小,自动适配页面。调整pdf预览缩放下限为0.5
|
|
147
|
+
3. demo增加url预览模式,在请求参数中添加`url=文件地址`,可自动拉取并渲染文件
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as Ee, ref as Ve, watch as yt, nextTick as wt, onMounted as Fe, onUnmounted as Me, openBlock as ft, createElementBlock as St, renderSlot as Ye, computed as We, createBlock as Xe, unref as Tt, withCtx as qe, Fragment as He, renderList as Ue } from "vue";
|
|
2
|
-
import { _ as Be } from "./index
|
|
2
|
+
import { _ as Be } from "./index.js";
|
|
3
3
|
/*!
|
|
4
4
|
* Viewer.js v1.11.3
|
|
5
5
|
* https://fengyuanchen.github.io/viewerjs
|
|
@@ -2,7 +2,7 @@ var Y = Object.defineProperty;
|
|
|
2
2
|
var ee = (o, n, t) => n in o ? Y(o, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[n] = t;
|
|
3
3
|
var O = (o, n, t) => (ee(o, typeof n != "symbol" ? n + "" : n, t), t);
|
|
4
4
|
import { defineComponent as te, computed as ne, openBlock as ie, createElementBlock as se, unref as re } from "vue";
|
|
5
|
-
import { _ as le } from "./index
|
|
5
|
+
import { _ as le } from "./index.js";
|
|
6
6
|
function F() {
|
|
7
7
|
return {
|
|
8
8
|
async: !1,
|
|
@@ -17,9 +17,10 @@ var Ue = (W, E, l) => (Fr(W, E, "read from private field"), l ? l.call(W) : E.ge
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
import { defineComponent, ref, onMounted, openBlock, createElementBlock, createElementVNode, pushScopeId, popScopeId } from "vue";
|
|
20
|
-
import { a as getAugmentedNamespace, c as commonjsGlobal } from "./_commonjsHelpers
|
|
21
|
-
import { c as commonjsRequire } from "./_commonjs-dynamic-modules
|
|
22
|
-
import {
|
|
20
|
+
import { a as getAugmentedNamespace, c as commonjsGlobal } from "./_commonjsHelpers.js";
|
|
21
|
+
import { c as commonjsRequire } from "./_commonjs-dynamic-modules.js";
|
|
22
|
+
import { r as refWorker } from "./worker-ref.js";
|
|
23
|
+
import { _ as _export_sfc } from "./index.js";
|
|
23
24
|
var pdfExports$1 = {}, pdf$1 = {
|
|
24
25
|
get exports() {
|
|
25
26
|
return pdfExports$1;
|
|
@@ -21566,10 +21567,11 @@ var pdfExports = requirePdf(), pdf_viewerExports = {}, pdf_viewer = {
|
|
|
21566
21567
|
})()
|
|
21567
21568
|
));
|
|
21568
21569
|
})(pdf_viewer);
|
|
21569
|
-
|
|
21570
|
-
|
|
21571
|
-
}
|
|
21572
|
-
|
|
21570
|
+
const pdf = "", PDFWorker = {
|
|
21571
|
+
create() {
|
|
21572
|
+
return refWorker("pptx.worker.js").defaults(() => new Worker(new URL("" + new URL("../worker/pdf.worker.js", import.meta.url).href, self.location), { type: "module" }));
|
|
21573
|
+
}
|
|
21574
|
+
}, _withScopeId = (W) => (pushScopeId("data-v-9bad3887"), W = W(), popScopeId(), W), _hoisted_1 = { class: "container" }, _hoisted_2 = { class: "pdf_down" }, _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", {
|
|
21573
21575
|
id: "viewer",
|
|
21574
21576
|
class: "pdfViewer"
|
|
21575
21577
|
}, null, -1)), _hoisted_4 = [
|
|
@@ -21588,7 +21590,7 @@ const pdf = "", _withScopeId = (W) => (pushScopeId("data-v-4396b257"), W = W(),
|
|
|
21588
21590
|
//pdf放大系数
|
|
21589
21591
|
pdf_scale: 1
|
|
21590
21592
|
};
|
|
21591
|
-
!pdfExports.GlobalWorkerOptions.workerPort && typeof window < "u" && "Worker" in window && (pdfExports.GlobalWorkerOptions.workerPort =
|
|
21593
|
+
!pdfExports.GlobalWorkerOptions.workerPort && typeof window < "u" && "Worker" in window && (pdfExports.GlobalWorkerOptions.workerPort = PDFWorker.create()), (() => {
|
|
21592
21594
|
async function k() {
|
|
21593
21595
|
if (!l.value)
|
|
21594
21596
|
return;
|
|
@@ -21606,11 +21608,14 @@ const pdf = "", _withScopeId = (W) => (pushScopeId("data-v-4396b257"), W = W(),
|
|
|
21606
21608
|
l10n: new pdf_viewerExports.GenericL10n("zh-CN")
|
|
21607
21609
|
});
|
|
21608
21610
|
R.setViewer(n), m.on("pagesinit", () => {
|
|
21609
|
-
|
|
21611
|
+
var r;
|
|
21612
|
+
const d = (r = n.getPageView(0)) == null ? void 0 : r.viewport;
|
|
21613
|
+
(d == null ? void 0 : d.width) > window.innerWidth ? n.currentScaleValue = "0.5" : n.currentScaleValue = "1";
|
|
21610
21614
|
});
|
|
21611
21615
|
const a = await pdfExports.getDocument({
|
|
21612
21616
|
data: E.data,
|
|
21613
|
-
|
|
21617
|
+
cMapUrl: `https://npm.onmicrosoft.cn/pdfjs-dist@${pdfExports.version}/cmaps/`,
|
|
21618
|
+
useWorkerFetch: !0,
|
|
21614
21619
|
cMapPacked: !0,
|
|
21615
21620
|
enableXfa: !0
|
|
21616
21621
|
}).promise;
|
|
@@ -21629,7 +21634,7 @@ const pdf = "", _withScopeId = (W) => (pushScopeId("data-v-4396b257"), W = W(),
|
|
|
21629
21634
|
if (!p.viewer)
|
|
21630
21635
|
return;
|
|
21631
21636
|
const k = p.viewer.currentScale;
|
|
21632
|
-
k <=
|
|
21637
|
+
k <= 0.5 || (p.viewer.currentScale = k - 0.1);
|
|
21633
21638
|
}
|
|
21634
21639
|
return (k, m) => (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
21635
21640
|
createElementVNode("div", _hoisted_2, [
|
|
@@ -21649,7 +21654,7 @@ const pdf = "", _withScopeId = (W) => (pushScopeId("data-v-4396b257"), W = W(),
|
|
|
21649
21654
|
}, _hoisted_4, 512)
|
|
21650
21655
|
]));
|
|
21651
21656
|
}
|
|
21652
|
-
}),
|
|
21657
|
+
}), PdfView_vue_vue_type_style_index_0_scoped_9bad3887_lang = "", PdfView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9bad3887"]]);
|
|
21653
21658
|
export {
|
|
21654
21659
|
PdfView as default
|
|
21655
21660
|
};
|