@repdf/preview 0.8.0 → 0.11.0

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.
Files changed (79) hide show
  1. package/dist/index.mjs +48 -48
  2. package/dist/preview/.next/BUILD_ID +1 -1
  3. package/dist/preview/.next/build-manifest.json +20 -20
  4. package/dist/preview/.next/cache/.previewinfo +1 -1
  5. package/dist/preview/.next/cache/.rscinfo +1 -1
  6. package/dist/preview/.next/cache/.tsbuildinfo +1 -1
  7. package/dist/preview/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/dist/preview/.next/cache/webpack/client-production/index.pack +0 -0
  9. package/dist/preview/.next/cache/webpack/edge-server-production/index.pack +0 -0
  10. package/dist/preview/.next/cache/webpack/server-production/0.pack +0 -0
  11. package/dist/preview/.next/cache/webpack/server-production/index.pack +0 -0
  12. package/dist/preview/.next/next-minimal-server.js.nft.json +1 -1
  13. package/dist/preview/.next/next-server.js.nft.json +1 -1
  14. package/dist/preview/.next/prerender-manifest.json +3 -3
  15. package/dist/preview/.next/react-loadable-manifest.json +2 -2
  16. package/dist/preview/.next/routes-manifest.json +9 -3
  17. package/dist/preview/.next/server/chunks/30.js +6 -0
  18. package/dist/preview/.next/server/chunks/612.js +1 -0
  19. package/dist/preview/.next/server/chunks/638.js +5 -0
  20. package/dist/preview/.next/server/chunks/671.js +1 -0
  21. package/dist/preview/.next/server/chunks/741.js +1 -0
  22. package/dist/preview/.next/server/chunks/791.js +19 -0
  23. package/dist/preview/.next/server/chunks/835.js +127 -0
  24. package/dist/preview/.next/server/middleware-build-manifest.js +1 -1
  25. package/dist/preview/.next/server/middleware-react-loadable-manifest.js +1 -1
  26. package/dist/preview/.next/server/pages/_app.js +1 -1
  27. package/dist/preview/.next/server/pages/_app.js.nft.json +1 -1
  28. package/dist/preview/.next/server/pages/_document.js +1 -1
  29. package/dist/preview/.next/server/pages/_document.js.nft.json +1 -1
  30. package/dist/preview/.next/server/pages/_error.js +1 -1
  31. package/dist/preview/.next/server/pages/_error.js.nft.json +1 -1
  32. package/dist/preview/.next/server/pages/api/component.js +26 -42
  33. package/dist/preview/.next/server/pages/api/component.js.nft.json +1 -1
  34. package/dist/preview/.next/server/pages/api/html.js +56 -0
  35. package/dist/preview/.next/server/pages/api/html.js.nft.json +1 -0
  36. package/dist/preview/.next/server/pages/api/pdf.js +2 -2
  37. package/dist/preview/.next/server/pages/api/pdf.js.nft.json +1 -1
  38. package/dist/preview/.next/server/pages/api/trpc/[trpc].js +4 -1
  39. package/dist/preview/.next/server/pages/api/trpc/[trpc].js.nft.json +1 -1
  40. package/dist/preview/.next/server/pages/en/404.html +1 -1
  41. package/dist/preview/.next/server/pages/en/500.html +1 -1
  42. package/dist/preview/.next/server/pages/en/test.html +1 -1
  43. package/dist/preview/.next/server/pages/index.js +3 -3
  44. package/dist/preview/.next/server/pages/index.js.nft.json +1 -1
  45. package/dist/preview/.next/server/pages/preview/[...relTemplatePath].js +1 -1
  46. package/dist/preview/.next/server/pages/preview/[...relTemplatePath].js.nft.json +1 -1
  47. package/dist/preview/.next/server/pages/test.js.nft.json +1 -1
  48. package/dist/preview/.next/server/pages-manifest.json +1 -0
  49. package/dist/preview/.next/static/chunks/7-71ad0f3afcc99aaf.js +1 -0
  50. package/dist/preview/.next/static/chunks/framework-95999e7820816f6d.js +1 -0
  51. package/dist/preview/.next/static/chunks/main-b829f6ed4d44ca0f.js +5 -0
  52. package/dist/preview/.next/static/chunks/pages/_app-956fbefa6c43224a.js +182 -0
  53. package/dist/preview/.next/static/chunks/pages/_error-f0290a98eb3ed0ec.js +1 -0
  54. package/dist/preview/.next/static/chunks/pages/index-b9f7f3adc7e8841e.js +55 -0
  55. package/dist/preview/.next/static/chunks/pages/preview/[...relTemplatePath]-85b368d356d07933.js +1 -0
  56. package/dist/preview/.next/static/chunks/pages/{test-787280cd6c1cdb85.js → test-a7ae3c7fa10ee85f.js} +1 -1
  57. package/dist/preview/.next/static/css/c639b7970300178e.css +1 -0
  58. package/dist/preview/.next/static/e8AvtD5w9RjVfCGEepp3S/_buildManifest.js +1 -0
  59. package/dist/preview/.next/trace +8 -9
  60. package/dist/preview/.next/trace-build +1 -1
  61. package/dist/preview/.next/types/validator.ts +9 -0
  62. package/package.json +4 -4
  63. package/dist/preview/.next/server/chunks/18.js +0 -1
  64. package/dist/preview/.next/server/chunks/504.js +0 -1
  65. package/dist/preview/.next/server/chunks/539.js +0 -4
  66. package/dist/preview/.next/server/chunks/619.js +0 -6
  67. package/dist/preview/.next/server/chunks/934.js +0 -5
  68. package/dist/preview/.next/server/chunks/937.js +0 -19
  69. package/dist/preview/.next/server/chunks/985.js +0 -1
  70. package/dist/preview/.next/static/5CG-B9ZXFd9Ub7hCsgL1G/_buildManifest.js +0 -1
  71. package/dist/preview/.next/static/chunks/440-7f86160d543d19eb.js +0 -1
  72. package/dist/preview/.next/static/chunks/framework-c1a985c867714b4b.js +0 -1
  73. package/dist/preview/.next/static/chunks/main-3c8a75f1bd6d0687.js +0 -5
  74. package/dist/preview/.next/static/chunks/pages/_app-ae07ed78fca634b6.js +0 -182
  75. package/dist/preview/.next/static/chunks/pages/_error-4911830c68e733ed.js +0 -1
  76. package/dist/preview/.next/static/chunks/pages/index-303e0eb1a2330d43.js +0 -55
  77. package/dist/preview/.next/static/chunks/pages/preview/[...relTemplatePath]-8e77f612d64b68fd.js +0 -1
  78. package/dist/preview/.next/static/css/1fbb4b304a915354.css +0 -1
  79. /package/dist/preview/.next/static/{5CG-B9ZXFd9Ub7hCsgL1G → e8AvtD5w9RjVfCGEepp3S}/_ssgManifest.js +0 -0
package/dist/index.mjs CHANGED
@@ -2,22 +2,22 @@
2
2
  import { program } from "commander";
3
3
  import fs from "node:fs";
4
4
  import pino from "pino";
5
+ import http from "node:http";
5
6
  import { parse } from "node:url";
6
- import path from "path";
7
- import { fileURLToPath } from "url";
8
7
  import next from "next";
9
- import http from "node:http";
8
+ import path from "path";
10
9
  import { Server } from "socket.io";
11
- import * as chokidar from "chokidar";
10
+ import { fileURLToPath } from "url";
11
+ import "puppeteer-core";
12
12
  import path$1 from "node:path";
13
- import dependencyTree from "dependency-tree";
14
- import { glob } from "glob";
15
13
  import "esbuild";
16
14
  import "source-map-js";
17
15
  import "stacktrace-parser";
18
- import "puppeteer-core";
16
+ import * as chokidar from "chokidar";
17
+ import dependencyTree from "dependency-tree";
18
+ import { glob } from "glob";
19
19
  //#region package.json
20
- var version = "0.8.0";
20
+ var version = "0.11.0";
21
21
  //#endregion
22
22
  //#region src/logger.ts
23
23
  const logger = pino({
@@ -28,19 +28,35 @@ function enableDebugLogging() {
28
28
  logger.level = "debug";
29
29
  }
30
30
  //#endregion
31
- //#region src/utils/files/dependencyTree.ts
32
- function getDependencyTree({ relViewerPath, outputType }) {
33
- const options = {
34
- filename: relViewerPath,
35
- directory: ".",
36
- tsConfig: "tsconfig.json",
37
- filter: (path) => path.indexOf("node_modules") === -1,
38
- noTypeDefinitions: false
39
- };
40
- if (outputType === "list") return dependencyTree.toList(options);
41
- return dependencyTree(options);
31
+ //#region src/browser.ts
32
+ let browser = null;
33
+ `${process.env.LOCALAPPDATA ?? ""}`;
34
+ /**
35
+ * Close the singleton browser instance if it exists.
36
+ */
37
+ async function closeBrowser() {
38
+ if (browser) {
39
+ await browser.close();
40
+ browser = null;
41
+ }
42
42
  }
43
43
  //#endregion
44
+ //#region src/template-loader/get-pdf-component.ts
45
+ const COMPONENT_CACHE_STORE_KEY = "__repdf_preview_getPdfComponentCacheStore__";
46
+ const getComponentCacheStore = () => {
47
+ const globalWithStore = globalThis;
48
+ if (!globalWithStore[COMPONENT_CACHE_STORE_KEY]) globalWithStore[COMPONENT_CACHE_STORE_KEY] = {
49
+ componentCache: /* @__PURE__ */ new Map(),
50
+ inflightBuilds: /* @__PURE__ */ new Map()
51
+ };
52
+ return globalWithStore[COMPONENT_CACHE_STORE_KEY];
53
+ };
54
+ const { componentCache, inflightBuilds } = getComponentCacheStore();
55
+ const clearPdfComponentCache = () => {
56
+ componentCache.clear();
57
+ inflightBuilds.clear();
58
+ };
59
+ //#endregion
44
60
  //#region src/constants.ts
45
61
  const RELATIVE_PATH_TO_PDF_FOLDER = () => {
46
62
  if (!process.env.RELATIVE_PATH_TO_PDF_FOLDER) throw new Error("RELATIVE_PATH_TO_PDF_FOLDER is not set");
@@ -55,6 +71,19 @@ const ABSOLUTE_PATH_TO_PDF_FOLDER = () => {
55
71
  throw new Error("ABSOLUTE_PATH_TO_PDF_FOLDER is not set");
56
72
  };
57
73
  //#endregion
74
+ //#region src/utils/files/dependencyTree.ts
75
+ function getDependencyTree({ relViewerPath, outputType }) {
76
+ const options = {
77
+ filename: relViewerPath,
78
+ directory: ".",
79
+ tsConfig: "tsconfig.json",
80
+ filter: (path) => path.indexOf("node_modules") === -1,
81
+ noTypeDefinitions: false
82
+ };
83
+ if (outputType === "list") return dependencyTree.toList(options);
84
+ return dependencyTree(options);
85
+ }
86
+ //#endregion
58
87
  //#region src/utils/files/getPdfTemplates.ts
59
88
  /**
60
89
  * checks if a file could be a pdf template
@@ -156,35 +185,6 @@ function pdfTemplateWatcher() {
156
185
  }
157
186
  }
158
187
  //#endregion
159
- //#region src/template-loader/get-pdf-component.ts
160
- const COMPONENT_CACHE_STORE_KEY = "__repdf_preview_getPdfComponentCacheStore__";
161
- const getComponentCacheStore = () => {
162
- const globalWithStore = globalThis;
163
- if (!globalWithStore[COMPONENT_CACHE_STORE_KEY]) globalWithStore[COMPONENT_CACHE_STORE_KEY] = {
164
- componentCache: /* @__PURE__ */ new Map(),
165
- inflightBuilds: /* @__PURE__ */ new Map()
166
- };
167
- return globalWithStore[COMPONENT_CACHE_STORE_KEY];
168
- };
169
- const { componentCache, inflightBuilds } = getComponentCacheStore();
170
- const clearPdfComponentCache = () => {
171
- componentCache.clear();
172
- inflightBuilds.clear();
173
- };
174
- //#endregion
175
- //#region src/browser.ts
176
- let browser = null;
177
- `${process.env.LOCALAPPDATA ?? ""}`;
178
- /**
179
- * Close the singleton browser instance if it exists.
180
- */
181
- async function closeBrowser() {
182
- if (browser) {
183
- await browser.close();
184
- browser = null;
185
- }
186
- }
187
- //#endregion
188
188
  //#region src/cli/commands/server.ts
189
189
  const __filename = fileURLToPath(import.meta.url);
190
190
  const __dirname = path.dirname(__filename);
@@ -1 +1 @@
1
- 5CG-B9ZXFd9Ub7hCsgL1G
1
+ e8AvtD5w9RjVfCGEepp3S
@@ -4,44 +4,44 @@
4
4
  ],
5
5
  "devFiles": [],
6
6
  "lowPriorityFiles": [
7
- "static/5CG-B9ZXFd9Ub7hCsgL1G/_buildManifest.js",
8
- "static/5CG-B9ZXFd9Ub7hCsgL1G/_ssgManifest.js"
7
+ "static/e8AvtD5w9RjVfCGEepp3S/_buildManifest.js",
8
+ "static/e8AvtD5w9RjVfCGEepp3S/_ssgManifest.js"
9
9
  ],
10
10
  "rootMainFiles": [],
11
11
  "rootMainFilesTree": {},
12
12
  "pages": {
13
13
  "/": [
14
14
  "static/chunks/webpack-6f363cd1990801ba.js",
15
- "static/chunks/framework-c1a985c867714b4b.js",
16
- "static/chunks/main-3c8a75f1bd6d0687.js",
17
- "static/chunks/440-7f86160d543d19eb.js",
18
- "static/chunks/pages/index-303e0eb1a2330d43.js"
15
+ "static/chunks/framework-95999e7820816f6d.js",
16
+ "static/chunks/main-b829f6ed4d44ca0f.js",
17
+ "static/chunks/7-71ad0f3afcc99aaf.js",
18
+ "static/chunks/pages/index-b9f7f3adc7e8841e.js"
19
19
  ],
20
20
  "/_app": [
21
21
  "static/chunks/webpack-6f363cd1990801ba.js",
22
- "static/chunks/framework-c1a985c867714b4b.js",
23
- "static/chunks/main-3c8a75f1bd6d0687.js",
24
- "static/css/1fbb4b304a915354.css",
25
- "static/chunks/pages/_app-ae07ed78fca634b6.js"
22
+ "static/chunks/framework-95999e7820816f6d.js",
23
+ "static/chunks/main-b829f6ed4d44ca0f.js",
24
+ "static/css/c639b7970300178e.css",
25
+ "static/chunks/pages/_app-956fbefa6c43224a.js"
26
26
  ],
27
27
  "/_error": [
28
28
  "static/chunks/webpack-6f363cd1990801ba.js",
29
- "static/chunks/framework-c1a985c867714b4b.js",
30
- "static/chunks/main-3c8a75f1bd6d0687.js",
31
- "static/chunks/pages/_error-4911830c68e733ed.js"
29
+ "static/chunks/framework-95999e7820816f6d.js",
30
+ "static/chunks/main-b829f6ed4d44ca0f.js",
31
+ "static/chunks/pages/_error-f0290a98eb3ed0ec.js"
32
32
  ],
33
33
  "/preview/[...relTemplatePath]": [
34
34
  "static/chunks/webpack-6f363cd1990801ba.js",
35
- "static/chunks/framework-c1a985c867714b4b.js",
36
- "static/chunks/main-3c8a75f1bd6d0687.js",
37
- "static/chunks/440-7f86160d543d19eb.js",
38
- "static/chunks/pages/preview/[...relTemplatePath]-8e77f612d64b68fd.js"
35
+ "static/chunks/framework-95999e7820816f6d.js",
36
+ "static/chunks/main-b829f6ed4d44ca0f.js",
37
+ "static/chunks/7-71ad0f3afcc99aaf.js",
38
+ "static/chunks/pages/preview/[...relTemplatePath]-85b368d356d07933.js"
39
39
  ],
40
40
  "/test": [
41
41
  "static/chunks/webpack-6f363cd1990801ba.js",
42
- "static/chunks/framework-c1a985c867714b4b.js",
43
- "static/chunks/main-3c8a75f1bd6d0687.js",
44
- "static/chunks/pages/test-787280cd6c1cdb85.js"
42
+ "static/chunks/framework-95999e7820816f6d.js",
43
+ "static/chunks/main-b829f6ed4d44ca0f.js",
44
+ "static/chunks/pages/test-a7ae3c7fa10ee85f.js"
45
45
  ]
46
46
  }
47
47
  }
@@ -1 +1 @@
1
- {"previewModeId":"2a5e7c83a14ca2e8ccc04624dc14af6e","previewModeSigningKey":"f2b335f3727b7e80ab32e9b18fb13149efb8bfd5032e4b52d03b36842836c697","previewModeEncryptionKey":"a788337e878ae532282f5d5952e4d2bbc9528acd53fbe854ff471b634a09dcf6","expireAt":1775146933550}
1
+ {"previewModeId":"be7af4608598baf50f7b3cd640cad0d1","previewModeSigningKey":"92b4b175418d29003df90131c58db7c0690098cd66c589d9105a6c9f61769e46","previewModeEncryptionKey":"d5585cf63c3a28df30413ccd816c8f63b9331c7a720364d2d5277ed95a67b779","expireAt":1775235925853}
@@ -1 +1 @@
1
- {"encryption.key":"KkKxJ1odwjLoQGOCzPlkM2sb9q7BBhJ/KMqA3MiQAio=","encryption.expire_at":1775146933538}
1
+ {"encryption.key":"PFDw6AdINHIzo+OWLNTdKXeqmAWni4Yr2+Y94ftbG0A=","encryption.expire_at":1775235925843}