@file-viewer/pptx 3.1.2 → 3.2.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/dist/worker.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import type { PptxWorkerFactoryOptions } from './types';
2
- /** Returns only a Worker URL that the active bundler has emitted or serves directly. */
1
+ import type { PptxWorkerFactoryOptions } from "./types.js";
3
2
  export declare const resolvePptxPackageWorkerUrl: () => string | undefined;
4
3
  export declare const createPptxWorker: (options?: PptxWorkerFactoryOptions) => Worker;
package/dist/worker.js CHANGED
@@ -1,14 +1,10 @@
1
- import { isResolvedPptxWorkerLocation } from './worker-location.js';
1
+ import { isResolvedPptxWorkerLocation } from "./worker-location.js";
2
2
  const viteOptimizedWorkerPathPattern = /\/\.?vite\/deps\/worker\/pptx\.worker\.js$/;
3
3
  const viteSourceWorkerModulePattern = /\/src\/worker\.[cm]?[jt]s$/;
4
4
  const angularCachePath = '/.angular/cache/';
5
5
  const viteOptimizedPptxSourcePattern = /\/\/\s+(node_modules\/(?:\.pnpm\/[^\n]+?\/node_modules\/)?@file-viewer\/pptx\/dist\/worker\.js)\b/;
6
6
  const resolveBundledPptxWorkerUrl = () => {
7
7
  const moduleUrl = new URL(import.meta.url);
8
- // Workspace demos and source-linked consumer projects let Vite serve this
9
- // TypeScript module directly from /@fs/.../src/worker.ts. The built Worker
10
- // remains under dist/worker, so resolving ./worker from the source module
11
- // points at a directory that does not exist.
12
8
  if (viteSourceWorkerModulePattern.test(moduleUrl.pathname)) {
13
9
  return new URL('../dist/worker/pptx.worker.js', moduleUrl);
14
10
  }
@@ -31,8 +27,6 @@ const resolveViteOptimizedPptxWorkerUrl = (defaultPptxWorkerUrl) => {
31
27
  }
32
28
  try {
33
29
  const request = new XMLHttpRequest();
34
- // Vite dev-only fallback: inspect the optimized module to recover the real
35
- // package path when @file-viewer/pptx is only a transitive pnpm dependency.
36
30
  request.open('GET', import.meta.url, false);
37
31
  request.send(null);
38
32
  if ((request.status > 0 && request.status < 200) || request.status >= 400) {
@@ -66,17 +60,12 @@ const resolvePptxWorkerUrl = (allowDependencyRelativeUrl) => {
66
60
  const optimizedUrl = resolveViteOptimizedPptxWorkerUrl(workerUrl);
67
61
  return optimizedUrl ? String(optimizedUrl) : undefined;
68
62
  }
69
- // An untouched dependency-relative URL points below the application bundle,
70
- // not this package. Renderers with copied-asset discovery must not select it.
71
63
  return allowDependencyRelativeUrl ? workerUrl.href : undefined;
72
64
  }
73
65
  catch {
74
- // An inlined module without a resolvable package base can still use the
75
- // host's standard copied assets or an explicitly configured Worker URL.
76
66
  }
77
67
  return undefined;
78
68
  };
79
- /** Returns only a Worker URL that the active bundler has emitted or serves directly. */
80
69
  export const resolvePptxPackageWorkerUrl = () => {
81
70
  return resolvePptxWorkerUrl(false);
82
71
  };
@@ -90,7 +79,6 @@ export const createPptxWorker = (options = {}) => {
90
79
  type: (_a = options.workerType) !== null && _a !== void 0 ? _a : 'module',
91
80
  });
92
81
  }
93
- // Direct PptxViewer users have no renderer-level copied-asset discovery.
94
82
  const workerUrl = resolvePptxWorkerUrl(true);
95
83
  if (!workerUrl) {
96
84
  throw new Error('PPTX Worker URL is unavailable. Run file-viewer-copy-assets or provide workerUrl.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@file-viewer/pptx",
3
- "version": "3.1.2",
3
+ "version": "3.2.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Native PPTX renderer extracted from File Viewer",
@@ -24,8 +24,7 @@
24
24
  },
25
25
  "repository": {
26
26
  "type": "git",
27
- "url": "git+https://github.com/flyfish-dev/file-viewer.git",
28
- "directory": "packages/renderers/pptx"
27
+ "url": "git+https://github.com/flyfish-dev/file-viewer.git"
29
28
  },
30
29
  "homepage": "https://doc.file-viewer.app/",
31
30
  "bugs": {
@@ -54,32 +53,45 @@
54
53
  "./package.json": "./package.json"
55
54
  },
56
55
  "files": [
57
- "dist",
58
- "README.md",
56
+ "dist/chart.d.ts",
57
+ "dist/chart.js",
58
+ "dist/index.d.ts",
59
+ "dist/index.js",
60
+ "dist/options.d.ts",
61
+ "dist/options.js",
62
+ "dist/presentation.d.ts",
63
+ "dist/presentation.js",
64
+ "dist/sanitize.d.ts",
65
+ "dist/sanitize.js",
66
+ "dist/styles.d.ts",
67
+ "dist/styles.js",
68
+ "dist/styles/pptxjs.css",
69
+ "dist/types.d.ts",
70
+ "dist/types.js",
71
+ "dist/viewer.d.ts",
72
+ "dist/viewer.js",
73
+ "dist/worker-location.d.ts",
74
+ "dist/worker-location.js",
75
+ "dist/worker.d.ts",
76
+ "dist/worker.js",
77
+ "dist/worker.THIRD_PARTY_LICENSES.txt",
78
+ "dist/worker/pptx.worker.js",
79
+ "LICENSE",
59
80
  "README.en.md",
60
- "LICENSE"
81
+ "README.md"
61
82
  ],
62
83
  "dependencies": {
63
84
  "dingbat-to-unicode": "^1.0.1",
64
- "dompurify": "3.4.15",
85
+ "dompurify": "3.4.16",
65
86
  "jszip": "3.10.2",
66
87
  "tinycolor2": "^1.6.0",
67
88
  "utif": "^3.1.0"
68
89
  },
69
- "devDependencies": {
70
- "@types/d3-format": "^3.0.4",
71
- "@types/node": "^26.5.1",
72
- "billboard.js": "^3.17.2",
73
- "d3-format": "^3.1.2",
74
- "esbuild": "^0.28.2",
75
- "typescript": "^6.0.3"
76
- },
77
90
  "license": "Apache-2.0",
78
- "scripts": {
79
- "build": "node scripts/clean-dist.mjs && tsc -b tsconfig.json --force && node scripts/build-worker.mjs && node scripts/copy-assets.mjs && node scripts/fix-esm-extensions.mjs",
80
- "type-check": "tsc -b tsconfig.json",
81
- "verify:github-176": "node scripts/verify-github-176.mjs",
82
- "verify:github-268": "node scripts/verify-github-268.mjs",
83
- "verify:github-268-browser": "node scripts/verify-github-268-browser.mjs"
91
+ "fileViewer": {
92
+ "distribution": {
93
+ "schemaVersion": 1,
94
+ "mode": "runtime-only"
95
+ }
84
96
  }
85
- }
97
+ }