@file-viewer/renderer-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/README.en.md +3 -7
- package/README.md +3 -7
- package/dist/index.js +0 -19
- package/package.json +15 -18
package/README.en.md
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
# @file-viewer/renderer-pptx
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Runtime package version 3.2.1.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
import { pptxRenderer } from '@file-viewer/renderer-pptx'
|
|
7
|
-
```
|
|
5
|
+
Usage and API documentation: https://doc.file-viewer.app/guide/on-demand-renderers
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Worker resolution first honors `presentation.workerUrl` or a configured shared asset base, then uses an emitted or directly served package asset, then checks the standard asset-copy manifest. Unknown locations never fall back to a guessed application-relative URL; Angular, offline, and separate static directories use the standard asset-copy command without application aliases.
|
|
7
|
+
The package's own license is Apache-2.0. Included third-party notices apply to their respective components.
|
package/README.md
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
# @file-viewer/renderer-pptx
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Runtime package version 3.2.1.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
import { pptxRenderer } from '@file-viewer/renderer-pptx'
|
|
7
|
-
```
|
|
5
|
+
Usage and API documentation: https://doc.file-viewer.app/guide/on-demand-renderers
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Worker 选择顺序为显式 `presentation.workerUrl` 或共享资源根目录、打包器已输出或包目录内可解析的 Worker、标准复制工具的资源清单。未知路径不会回退为猜测的应用相对地址;Angular、离线或独立静态目录使用标准资产复制,无需业务 alias。
|
|
7
|
+
The package's own license is Apache-2.0. Included third-party notices apply to their respective components.
|
package/dist/index.js
CHANGED
|
@@ -45,9 +45,6 @@ const pptxPrintStyle = `
|
|
|
45
45
|
}
|
|
46
46
|
`;
|
|
47
47
|
const SLIDESHOW_HOTKEY_LABEL = 'F5 / P';
|
|
48
|
-
// With several viewers on one page each renderer installs a document-level
|
|
49
|
-
// F5/P listener. Keep one explicitly activated shell per document so shortcuts
|
|
50
|
-
// never leak across viewers, host controls, or iframe documents.
|
|
51
48
|
const activePptxShells = new WeakMap();
|
|
52
49
|
const createStyle = (documentRef) => {
|
|
53
50
|
const style = documentRef.createElement('style');
|
|
@@ -235,8 +232,6 @@ const formatPptxDiagnosticError = (error, fallback, context) => {
|
|
|
235
232
|
? rawReason || localizedReason
|
|
236
233
|
: localizedReason || rawReason) || fallback;
|
|
237
234
|
const detail = sanitizePptxDiagnosticText(error.detail);
|
|
238
|
-
// Engine diagnostics may carry source-language hints. A known code has a
|
|
239
|
-
// wrapper-owned translation, so prefer it over the engine's raw copy.
|
|
240
235
|
const hint = localizePptxDiagnosticCopy(pptxDiagnosticFallbackHints[code], locale) ||
|
|
241
236
|
sanitizePptxDiagnosticText(error.hint);
|
|
242
237
|
const stage = sanitizePptxDiagnosticText(error.stage);
|
|
@@ -341,8 +336,6 @@ export default async function renderPptx(buffer, target, _type, context) {
|
|
|
341
336
|
const surface = createElement(documentRef, 'div', 'pptx-render-surface');
|
|
342
337
|
shell.append(loading, error, slideshowButton, surface);
|
|
343
338
|
target.replaceChildren(style, shell);
|
|
344
|
-
// A viewer owns the shortcut only after the user interacts with it. Moving
|
|
345
|
-
// focus or the pointer back to the host page releases that ownership.
|
|
346
339
|
const activateShell = () => {
|
|
347
340
|
activePptxShells.set(documentRef, shell);
|
|
348
341
|
};
|
|
@@ -364,8 +357,6 @@ export default async function renderPptx(buffer, target, _type, context) {
|
|
|
364
357
|
shell.addEventListener('focusin', activateShell);
|
|
365
358
|
documentRef.addEventListener('pointerdown', deactivateShell);
|
|
366
359
|
documentRef.addEventListener('focusin', deactivateShell);
|
|
367
|
-
// F5 mirrors PowerPoint; P is the keyboard-only toggle for browsers where F5 is spoken for.
|
|
368
|
-
// Typing in a field must never start a slideshow, so editable targets are skipped.
|
|
369
360
|
const isEditableTarget = (node) => {
|
|
370
361
|
const element = node;
|
|
371
362
|
if (!element || typeof element.closest !== 'function') {
|
|
@@ -383,8 +374,6 @@ export default async function renderPptx(buffer, target, _type, context) {
|
|
|
383
374
|
if (!shell.isConnected || isEditableTarget(event.target)) {
|
|
384
375
|
return;
|
|
385
376
|
}
|
|
386
|
-
// Only the focused/last-activated shell answers, and a key pressed inside
|
|
387
|
-
// another shell belongs to that shell.
|
|
388
377
|
if (activePptxShells.get(documentRef) !== shell) {
|
|
389
378
|
return;
|
|
390
379
|
}
|
|
@@ -421,8 +410,6 @@ export default async function renderPptx(buffer, target, _type, context) {
|
|
|
421
410
|
capture: () => (viewer === null || viewer === void 0 ? void 0 : viewer.thumbnailDataUrl)
|
|
422
411
|
? fetch(viewer.thumbnailDataUrl).then(response => response.blob())
|
|
423
412
|
: null,
|
|
424
|
-
// Keep the renderer ancestry in the snapshot: slide CSS is scoped below
|
|
425
|
-
// .pptx-render-surface and loses layout when the slide node is cloned alone.
|
|
426
413
|
getTarget: () => surface,
|
|
427
414
|
});
|
|
428
415
|
const getCurrentZoomPercent = () => { var _a; return clampZoomPercent((_a = viewer === null || viewer === void 0 ? void 0 : viewer.zoomPercent) !== null && _a !== void 0 ? _a : zoomPercent); };
|
|
@@ -502,9 +489,6 @@ export default async function renderPptx(buffer, target, _type, context) {
|
|
|
502
489
|
resolveCompletion = resolve;
|
|
503
490
|
rejectCompletion = reject;
|
|
504
491
|
});
|
|
505
|
-
// Abort/error may arrive while PptxViewer.open() is still resolving. Mark
|
|
506
|
-
// the completion promise handled immediately, then await the same promise
|
|
507
|
-
// below so cancellation cannot surface as a transient unhandled rejection.
|
|
508
492
|
void completion.catch(() => { });
|
|
509
493
|
const abort = () => {
|
|
510
494
|
var _a;
|
|
@@ -518,9 +502,6 @@ export default async function renderPptx(buffer, target, _type, context) {
|
|
|
518
502
|
if ((_c = context === null || context === void 0 ? void 0 : context.signal) === null || _c === void 0 ? void 0 : _c.aborted) {
|
|
519
503
|
throw context.signal.reason || new DOMException('PPTX rendering aborted.', 'AbortError');
|
|
520
504
|
}
|
|
521
|
-
// Use a package-emitted Worker without probing unrelated manifest URLs.
|
|
522
|
-
// Angular production still needs the CLI's verified copy when its builder
|
|
523
|
-
// leaves dependency-relative Worker references untouched.
|
|
524
505
|
const workerUrl = (presentationOptions === null || presentationOptions === void 0 ? void 0 : presentationOptions.workerUrl) || getDefaultFileViewerAssetBaseUrl()
|
|
525
506
|
? resolveFileViewerPresentationWorkerUrl(presentationOptions, resolveFileViewerRuntimeAssetBaseUrl(documentRef))
|
|
526
507
|
: resolvePptxPackageWorkerUrl() ||
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@file-viewer/renderer-pptx",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Standalone OpenXML PowerPoint renderer for PPTX, PPTM, POTX, POTM, PPSX, and PPSM files.",
|
|
@@ -23,8 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|
|
26
|
-
"url": "git+https://github.com/flyfish-dev/file-viewer.git"
|
|
27
|
-
"directory": "packages/renderers/presentation-pptx"
|
|
26
|
+
"url": "git+https://github.com/flyfish-dev/file-viewer.git"
|
|
28
27
|
},
|
|
29
28
|
"homepage": "https://doc.file-viewer.app/guide/on-demand-renderers",
|
|
30
29
|
"bugs": {
|
|
@@ -46,25 +45,23 @@
|
|
|
46
45
|
"./package.json": "./package.json"
|
|
47
46
|
},
|
|
48
47
|
"files": [
|
|
49
|
-
"dist",
|
|
48
|
+
"dist/index.d.ts",
|
|
49
|
+
"dist/index.js",
|
|
50
50
|
"file-viewer.capability.json",
|
|
51
|
-
"
|
|
51
|
+
"LICENSE",
|
|
52
52
|
"README.en.md",
|
|
53
|
-
"
|
|
53
|
+
"README.md"
|
|
54
54
|
],
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@file-viewer/core": "3.1
|
|
57
|
-
"@file-viewer/pptx": "3.1
|
|
58
|
-
},
|
|
59
|
-
"devDependencies": {
|
|
60
|
-
"typescript": "^6.0.3"
|
|
56
|
+
"@file-viewer/core": "3.2.1",
|
|
57
|
+
"@file-viewer/pptx": "3.2.1"
|
|
61
58
|
},
|
|
62
59
|
"fileViewer": {
|
|
63
|
-
"capabilityManifest": "./file-viewer.capability.json"
|
|
60
|
+
"capabilityManifest": "./file-viewer.capability.json",
|
|
61
|
+
"distribution": {
|
|
62
|
+
"schemaVersion": 1,
|
|
63
|
+
"mode": "runtime-only"
|
|
64
|
+
}
|
|
64
65
|
},
|
|
65
|
-
"license": "Apache-2.0"
|
|
66
|
-
|
|
67
|
-
"build": "tsc -b tsconfig.json",
|
|
68
|
-
"type-check": "tsc -b tsconfig.json"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
66
|
+
"license": "Apache-2.0"
|
|
67
|
+
}
|