@virtualansoftware/vs-office-viewer 1.0.0 → 1.0.2
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/dist/client/assets/DocxViewer-BcXhLJfm.css +1 -0
- package/dist/client/assets/DocxViewer-CPMpeQTq.js +58 -0
- package/dist/client/assets/LogoIcon-CTf12WP0.js +1 -0
- package/dist/client/assets/PptxViewer-Bvr-20MJ.js +59 -0
- package/dist/client/assets/PptxViewer-Cn8CqLfg.css +1 -0
- package/dist/client/assets/XlsxViewer-CGc0vtBk.js +63 -0
- package/dist/client/assets/XlsxViewer-DTxE-neD.css +1 -0
- package/dist/client/assets/chevron-right-D0jHq8Hg.js +1 -0
- package/dist/client/assets/form-KvBV47dq.js +1 -0
- package/dist/client/assets/index-DATp3RB-.js +12 -0
- package/dist/client/assets/jszip.min-DhiFe-R7.js +2 -0
- package/dist/client/assets/login-aBY8Ktaw.js +1 -0
- package/dist/client/assets/register-BB43pNvY.js +1 -0
- package/dist/client/assets/rolldown-runtime-aKtaBQYM.js +1 -0
- package/dist/client/assets/routes-1JmKig5J.js +2 -0
- package/dist/client/assets/styles-F8oSmVJa.css +2 -0
- package/dist/client/robots.txt +2 -0
- package/dist/index.cjs +1814 -0
- package/dist/index.d.cts +22 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +1777 -0
- package/dist/server/assets/DocxViewer-Bvu47Jxr.js +544 -0
- package/dist/server/assets/LogoIcon-D2qIWtkU.js +93 -0
- package/dist/server/assets/PptxViewer-CjRu82CL.js +209 -0
- package/dist/server/assets/XlsxViewer-CtBSfYb7.js +870 -0
- package/dist/server/assets/_tanstack-start-manifest_v-CQ5gmg8o.js +43 -0
- package/dist/server/assets/createMiddleware-BnSPczhK.js +24 -0
- package/dist/server/assets/empty-plugin-adapters-D9UWiqvJ.js +5 -0
- package/dist/server/assets/form-DY0gQsTv.js +249 -0
- package/dist/server/assets/login-hnUq0LLL.js +122 -0
- package/dist/server/assets/register-DIFjHkZS.js +164 -0
- package/dist/server/assets/router-CJA4LnAB.js +281 -0
- package/dist/server/assets/routes-DT9ZAw-E.js +481 -0
- package/dist/server/assets/server-vIOK9n3w.js +1595 -0
- package/dist/server/assets/start-RYa-0bjt.js +43 -0
- package/dist/server/server.js +86 -0
- package/package.json +7 -13
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { t as renderErrorPage } from "../server.js";
|
|
2
|
+
import { t as createMiddleware } from "./createMiddleware-BnSPczhK.js";
|
|
3
|
+
//#region node_modules/@tanstack/start-client-core/dist/esm/createStart.js
|
|
4
|
+
function dedupeSerializationAdapters(deduped, serializationAdapters) {
|
|
5
|
+
for (let i = 0, len = serializationAdapters.length; i < len; i++) {
|
|
6
|
+
const current = serializationAdapters[i];
|
|
7
|
+
if (!deduped.has(current)) {
|
|
8
|
+
deduped.add(current);
|
|
9
|
+
if (current.extends) dedupeSerializationAdapters(deduped, current.extends);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
var createStart = (getOptions) => {
|
|
14
|
+
return {
|
|
15
|
+
getOptions: async () => {
|
|
16
|
+
const options = await getOptions();
|
|
17
|
+
if (options.serializationAdapters) {
|
|
18
|
+
const deduped = /* @__PURE__ */ new Set();
|
|
19
|
+
dedupeSerializationAdapters(deduped, options.serializationAdapters);
|
|
20
|
+
options.serializationAdapters = Array.from(deduped);
|
|
21
|
+
}
|
|
22
|
+
return options;
|
|
23
|
+
},
|
|
24
|
+
createMiddleware
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/start.ts
|
|
29
|
+
var errorMiddleware = createMiddleware().server(async ({ next }) => {
|
|
30
|
+
try {
|
|
31
|
+
return await next();
|
|
32
|
+
} catch (error) {
|
|
33
|
+
if (error != null && typeof error === "object" && "statusCode" in error) throw error;
|
|
34
|
+
console.error(error);
|
|
35
|
+
return new Response(renderErrorPage(), {
|
|
36
|
+
status: 500,
|
|
37
|
+
headers: { "content-type": "text/html; charset=utf-8" }
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
var startInstance = createStart(() => ({ requestMiddleware: [errorMiddleware] }));
|
|
42
|
+
//#endregion
|
|
43
|
+
export { startInstance };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
//#region src/lib/error-capture.ts
|
|
2
|
+
var lastCapturedError;
|
|
3
|
+
var TTL_MS = 5e3;
|
|
4
|
+
function record(error) {
|
|
5
|
+
lastCapturedError = {
|
|
6
|
+
error,
|
|
7
|
+
at: Date.now()
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
if (typeof globalThis.addEventListener === "function") {
|
|
11
|
+
globalThis.addEventListener("error", (event) => record(event.error ?? event));
|
|
12
|
+
globalThis.addEventListener("unhandledrejection", (event) => record(event.reason));
|
|
13
|
+
}
|
|
14
|
+
function consumeLastCapturedError() {
|
|
15
|
+
if (!lastCapturedError) return void 0;
|
|
16
|
+
if (Date.now() - lastCapturedError.at > TTL_MS) {
|
|
17
|
+
lastCapturedError = void 0;
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const { error } = lastCapturedError;
|
|
21
|
+
lastCapturedError = void 0;
|
|
22
|
+
return error;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/lib/error-page.ts
|
|
26
|
+
function renderErrorPage() {
|
|
27
|
+
return `<!doctype html>
|
|
28
|
+
<html lang="en">
|
|
29
|
+
<head>
|
|
30
|
+
<meta charset="utf-8" />
|
|
31
|
+
<title>This page didn't load</title>
|
|
32
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
33
|
+
<style>
|
|
34
|
+
body { font: 15px/1.5 system-ui, -apple-system, sans-serif; background: #fafafa; color: #111; display: grid; place-items: center; min-height: 100vh; margin: 0; padding: 1.5rem; }
|
|
35
|
+
.card { max-width: 28rem; width: 100%; text-align: center; padding: 2rem; }
|
|
36
|
+
h1 { font-size: 1.25rem; margin: 0 0 0.5rem; }
|
|
37
|
+
p { color: #4b5563; margin: 0 0 1.5rem; }
|
|
38
|
+
.actions { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
|
|
39
|
+
a, button { padding: 0.5rem 1rem; border-radius: 0.375rem; font: inherit; cursor: pointer; text-decoration: none; border: 1px solid transparent; }
|
|
40
|
+
.primary { background: #111; color: #fff; }
|
|
41
|
+
.secondary { background: #fff; color: #111; border-color: #d1d5db; }
|
|
42
|
+
</style>
|
|
43
|
+
</head>
|
|
44
|
+
<body>
|
|
45
|
+
<div class="card">
|
|
46
|
+
<h1>This page didn't load</h1>
|
|
47
|
+
<p>Something went wrong on our end. You can try refreshing or head back home.</p>
|
|
48
|
+
<div class="actions">
|
|
49
|
+
<button class="primary" onclick="location.reload()">Try again</button>
|
|
50
|
+
<a class="secondary" href="/">Go home</a>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</body>
|
|
54
|
+
</html>`;
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/server.ts
|
|
58
|
+
var serverEntryPromise;
|
|
59
|
+
async function getServerEntry() {
|
|
60
|
+
if (!serverEntryPromise) serverEntryPromise = import("./assets/server-vIOK9n3w.js").then((m) => m.default ?? m);
|
|
61
|
+
return serverEntryPromise;
|
|
62
|
+
}
|
|
63
|
+
async function normalizeCatastrophicSsrResponse(response) {
|
|
64
|
+
if (response.status < 500) return response;
|
|
65
|
+
if (!(response.headers.get("content-type") ?? "").includes("application/json")) return response;
|
|
66
|
+
const body = await response.clone().text();
|
|
67
|
+
if (!body.includes("\"unhandled\":true") || !body.includes("\"message\":\"HTTPError\"")) return response;
|
|
68
|
+
console.error(consumeLastCapturedError() ?? /* @__PURE__ */ new Error(`h3 swallowed SSR error: ${body}`));
|
|
69
|
+
return new Response(renderErrorPage(), {
|
|
70
|
+
status: 500,
|
|
71
|
+
headers: { "content-type": "text/html; charset=utf-8" }
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
var server_default = { async fetch(request, env, ctx) {
|
|
75
|
+
try {
|
|
76
|
+
return await normalizeCatastrophicSsrResponse(await (await getServerEntry()).fetch(request, env, ctx));
|
|
77
|
+
} catch (error) {
|
|
78
|
+
console.error(error);
|
|
79
|
+
return new Response(renderErrorPage(), {
|
|
80
|
+
status: 500,
|
|
81
|
+
headers: { "content-type": "text/html; charset=utf-8" }
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
} };
|
|
85
|
+
//#endregion
|
|
86
|
+
export { server_default as default, renderErrorPage as t };
|
package/package.json
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@virtualansoftware/vs-office-viewer",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"sideEffects": true,
|
|
6
6
|
"type": "module",
|
|
7
|
-
|
|
8
7
|
"files": [
|
|
9
8
|
"dist"
|
|
10
9
|
],
|
|
11
|
-
|
|
12
10
|
"main": "./dist/index.cjs",
|
|
13
11
|
"module": "./dist/index.js",
|
|
14
12
|
"types": "./dist/index.d.ts",
|
|
15
|
-
|
|
16
13
|
"exports": {
|
|
17
14
|
".": {
|
|
18
15
|
"types": "./dist/index.d.ts",
|
|
@@ -20,7 +17,6 @@
|
|
|
20
17
|
"require": "./dist/index.cjs"
|
|
21
18
|
}
|
|
22
19
|
},
|
|
23
|
-
|
|
24
20
|
"scripts": {
|
|
25
21
|
"dev": "vite dev",
|
|
26
22
|
"build": "vite build",
|
|
@@ -30,25 +26,21 @@
|
|
|
30
26
|
"format": "prettier --write .",
|
|
31
27
|
"build:lib": "tsup"
|
|
32
28
|
},
|
|
33
|
-
|
|
34
29
|
"peerDependencies": {
|
|
30
|
+
"lucide-react": ">=0.400.0",
|
|
35
31
|
"react": "^18.0.0 || ^19.0.0",
|
|
36
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
37
|
-
"lucide-react": ">=0.400.0"
|
|
32
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
38
33
|
},
|
|
39
|
-
|
|
40
34
|
"dependencies": {
|
|
41
35
|
"docx-preview": "^0.3.7",
|
|
42
36
|
"echarts": "^6.1.0",
|
|
43
37
|
"exceljs": "^4.4.0",
|
|
44
38
|
"jszip": "^3.10.1",
|
|
39
|
+
"lovable-tagger": "^1.3.1",
|
|
45
40
|
"pptx-preview": "^1.0.7",
|
|
46
41
|
"xlsx": "^0.18.5"
|
|
47
42
|
},
|
|
48
|
-
|
|
49
43
|
"devDependencies": {
|
|
50
|
-
"clsx": "^2.1.1",
|
|
51
|
-
"tailwind-merge": "^3.5.0",
|
|
52
44
|
"@eslint/js": "^9.32.0",
|
|
53
45
|
"@hookform/resolvers": "^5.2.2",
|
|
54
46
|
"@lovable.dev/vite-tanstack-config": "^2.1.1",
|
|
@@ -88,6 +80,7 @@
|
|
|
88
80
|
"@types/react-dom": "^19.2.0",
|
|
89
81
|
"@vitejs/plugin-react": "^5.0.4",
|
|
90
82
|
"class-variance-authority": "^0.7.1",
|
|
83
|
+
"clsx": "^2.1.1",
|
|
91
84
|
"cmdk": "^1.1.1",
|
|
92
85
|
"date-fns": "^4.1.0",
|
|
93
86
|
"embla-carousel-react": "^8.6.0",
|
|
@@ -107,13 +100,14 @@
|
|
|
107
100
|
"react-resizable-panels": "^4.6.5",
|
|
108
101
|
"recharts": "^2.15.4",
|
|
109
102
|
"sonner": "^2.0.7",
|
|
103
|
+
"tailwind-merge": "^3.5.0",
|
|
110
104
|
"tailwindcss": "^4.2.1",
|
|
111
105
|
"tsup": "^8.5.1",
|
|
112
106
|
"tw-animate-css": "^1.3.4",
|
|
113
107
|
"typescript": "^5.8.3",
|
|
114
108
|
"typescript-eslint": "^8.56.1",
|
|
115
109
|
"vaul": "^1.1.2",
|
|
116
|
-
"vite": "^
|
|
110
|
+
"vite": "^8.1.4",
|
|
117
111
|
"vite-tsconfig-paths": "^6.0.2",
|
|
118
112
|
"zod": "^3.24.2"
|
|
119
113
|
}
|