ywb-office-preview 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +198 -0
- package/lib/index.cjs.js +135 -0
- package/lib/index.css +5 -0
- package/lib/index.js +135 -0
- package/lib/types/index.d.ts +88 -0
- package/office-preview/assets/deps-Db5o6o29.js +5 -0
- package/office-preview/assets/index-CayzP9YK.css +1 -0
- package/office-preview/assets/index-D5bO9emD.js +1 -0
- package/office-preview/assets/vue-office-docx-Bx6VTAU0.js +33 -0
- package/office-preview/assets/vue-office-docx-DlzDd1un.css +1 -0
- package/office-preview/assets/vue-office-excel-BGtZg_F9.js +198 -0
- package/office-preview/assets/vue-office-excel-D2SrlbN3.css +1 -0
- package/office-preview/assets/vue-office-pdf-Dz0sk0VW.js +5 -0
- package/office-preview/assets/vue-office-pptx-ox0f8gib.js +98 -0
- package/office-preview/favicon.svg +7 -0
- package/office-preview/index.html +21 -0
- package/package.json +67 -0
- package/webpack.js +21 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
2
|
+
<rect width="64" height="64" rx="14" fill="#2D8CF0"/>
|
|
3
|
+
<path d="M19 13 h17 l9 9 v27 a3 3 0 0 1-3 3 H19 a3 3 0 0 1-3-3 V16 a3 3 0 0 1 3-3 z" fill="#ffffff"/>
|
|
4
|
+
<path d="M36 13 v9 h9 z" fill="#BFE0FF"/>
|
|
5
|
+
<circle cx="29" cy="37" r="6.5" fill="none" stroke="#2D8CF0" stroke-width="3"/>
|
|
6
|
+
<line x1="33.5" y1="41.5" x2="39" y2="47" stroke="#2D8CF0" stroke-width="3" stroke-linecap="round"/>
|
|
7
|
+
</svg>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
|
|
6
|
+
<title>OfficePreview</title>
|
|
7
|
+
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
|
|
8
|
+
<script type="module" crossorigin src="./assets/index-D5bO9emD.js"></script>
|
|
9
|
+
<link rel="modulepreload" crossorigin href="./assets/deps-Db5o6o29.js">
|
|
10
|
+
<link rel="modulepreload" crossorigin href="./assets/vue-office-docx-Bx6VTAU0.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="./assets/vue-office-excel-BGtZg_F9.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="./assets/vue-office-pdf-Dz0sk0VW.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="./assets/vue-office-pptx-ox0f8gib.js">
|
|
14
|
+
<link rel="stylesheet" crossorigin href="./assets/vue-office-docx-DlzDd1un.css">
|
|
15
|
+
<link rel="stylesheet" crossorigin href="./assets/vue-office-excel-D2SrlbN3.css">
|
|
16
|
+
<link rel="stylesheet" crossorigin href="./assets/index-CayzP9YK.css">
|
|
17
|
+
</head>
|
|
18
|
+
<body>
|
|
19
|
+
<div id="app"></div>
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ywb-office-preview",
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "Preview office files in Vue without compiling the office library",
|
|
5
|
+
"main": "lib/index.cjs.js",
|
|
6
|
+
"module": "lib/index.js",
|
|
7
|
+
"typings": "lib/types/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"dev": "vite",
|
|
10
|
+
"tsc": "tsc --emitDeclarationOnly --declaration --declarationDir lib/types",
|
|
11
|
+
"build": "npm run build:lib && npm run build:html",
|
|
12
|
+
"build:lib": "vite build -c vite.lib.config.ts",
|
|
13
|
+
"build:html": "vite build --mode production",
|
|
14
|
+
"preview": "vite preview"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"lib",
|
|
18
|
+
"office-preview",
|
|
19
|
+
"package.json",
|
|
20
|
+
"webpack.js",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/lodash": "^4.17.16",
|
|
25
|
+
"@types/node": "^22.13.10",
|
|
26
|
+
"@vitejs/plugin-vue2": "^2.3.1",
|
|
27
|
+
"@vitejs/plugin-vue2-jsx": "^1.1.1",
|
|
28
|
+
"@vue-office/docx": "^1.6.3",
|
|
29
|
+
"@vue-office/excel": "^1.7.14",
|
|
30
|
+
"@vue-office/pdf": "^2.0.10",
|
|
31
|
+
"@vue-office/pptx": "^1.0.1",
|
|
32
|
+
"@vue/babel-helper-vue-jsx-merge-props": "^1.4.0",
|
|
33
|
+
"@vue/runtime-dom": "^3.5.10",
|
|
34
|
+
"csstype": "^3.1.3",
|
|
35
|
+
"eventemitter3": "^5.0.1",
|
|
36
|
+
"lodash": "^4.17.21",
|
|
37
|
+
"sass-embedded": "^1.86.0",
|
|
38
|
+
"typescript": "~5.7.2",
|
|
39
|
+
"unplugin-vue-define-options": "1.5.5",
|
|
40
|
+
"vite": "^5.0.0",
|
|
41
|
+
"vite-plugin-dts": "^4.5.3",
|
|
42
|
+
"vite-plugin-static-copy": "^2.3.0",
|
|
43
|
+
"vue": "^2.7.14",
|
|
44
|
+
"vue-demi": "^0.14.10",
|
|
45
|
+
"vue-tsc": "^2.2.4"
|
|
46
|
+
},
|
|
47
|
+
"keywords": [
|
|
48
|
+
"office",
|
|
49
|
+
"preview",
|
|
50
|
+
"vue",
|
|
51
|
+
"office-preview"
|
|
52
|
+
],
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"repository": {
|
|
55
|
+
"type": "git",
|
|
56
|
+
"url": "git+https://gitee.com/as1314/office-preview.git"
|
|
57
|
+
},
|
|
58
|
+
"homepage": "https://gitee.com/as1314/office-preview#readme",
|
|
59
|
+
"bugs": {
|
|
60
|
+
"url": "https://gitee.com/as1314/office-preview/issues"
|
|
61
|
+
},
|
|
62
|
+
"author": "杨文彬",
|
|
63
|
+
"engines": {
|
|
64
|
+
"node": "18"
|
|
65
|
+
},
|
|
66
|
+
"packageManager": "yarn@1.22.21+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72"
|
|
67
|
+
}
|
package/webpack.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const path = require("path");
|
|
2
|
+
const CopyPlugin = require("copy-webpack-plugin");
|
|
3
|
+
|
|
4
|
+
class OfficePreviewPlugin {
|
|
5
|
+
constructor() {}
|
|
6
|
+
|
|
7
|
+
apply(compiler) {
|
|
8
|
+
const htmlPath = path.resolve(__dirname, "office-preview");
|
|
9
|
+
const outputPath = compiler.options.output.path || path.resolve(process.cwd(), "dist");
|
|
10
|
+
|
|
11
|
+
new CopyPlugin([
|
|
12
|
+
{
|
|
13
|
+
from: htmlPath,
|
|
14
|
+
to: path.resolve(outputPath, "office-preview"),
|
|
15
|
+
noErrorOnMissing: true
|
|
16
|
+
}
|
|
17
|
+
]).apply(compiler);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
module.exports = OfficePreviewPlugin;
|