@file-viewer/core 3.2.2 → 3.3.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 +26 -15
- package/README.md +47 -41
- package/README.zh-CN.md +175 -0
- package/dist/assets.d.ts +2 -2
- package/dist/assets.js +5 -1
- package/dist/browser/controller.d.ts +2 -1
- package/dist/browser/controller.js +156 -32
- package/dist/browser/source-feedback.d.ts +4 -0
- package/dist/browser/source-feedback.js +40 -0
- package/dist/browser/toolbar-focus.d.ts +2 -0
- package/dist/browser/toolbar-focus.js +46 -0
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +2 -2
- package/dist/config/options.d.ts +1 -1
- package/dist/contracts/types.d.ts +479 -1
- package/dist/contracts/xml.d.ts +11 -0
- package/dist/export.d.ts +10 -3
- package/dist/export.js +9 -2
- package/dist/exportDocument.d.ts +12 -1
- package/dist/exportDocument.js +31 -2
- package/dist/features/document/dom/anchors.d.ts +1 -1
- package/dist/features/document/dom/index.d.ts +5 -5
- package/dist/features/document/dom/index.js +3 -3
- package/dist/features/document/dom/providers.d.ts +1 -1
- package/dist/features/document/events.d.ts +2 -2
- package/dist/features/document/events.js +3 -3
- package/dist/features/document/fit.d.ts +1 -1
- package/dist/features/document/fit.js +1 -1
- package/dist/features/document/imageHandTool.d.ts +3 -0
- package/dist/features/document/imageHandTool.js +141 -0
- package/dist/features/document/model.d.ts +1 -1
- package/dist/features/document/search.d.ts +1 -1
- package/dist/features/document/search.js +2 -2
- package/dist/features/document/viewState.d.ts +1 -1
- package/dist/features/document/viewState.js +2 -2
- package/dist/features/document/zoom.d.ts +1 -1
- package/dist/features/document/zoom.js +3 -3
- package/dist/features/document/zoomGestures.d.ts +2 -2
- package/dist/features/document/zoomGestures.js +2 -0
- package/dist/features/printMask.d.ts +1 -1
- package/dist/features/printMaskDesigner.d.ts +6 -2
- package/dist/features/printMaskDesigner.js +11 -2
- package/dist/features/printMaskLoader.d.ts +7 -1
- package/dist/features/printMaskLoader.js +7 -1
- package/dist/features/watermark.d.ts +1 -1
- package/dist/headless.d.ts +29 -29
- package/dist/headless.js +21 -16
- package/dist/i18n/messages.d.ts +1 -1
- package/dist/i18n/messages.de.d.ts +5 -1
- package/dist/i18n/messages.de.js +4 -0
- package/dist/i18n/messages.ja.d.ts +6 -1
- package/dist/i18n/messages.ja.js +5 -0
- package/dist/i18n/messages.js +2 -2
- package/dist/index.d.ts +77 -75
- package/dist/index.js +39 -37
- package/dist/lifecycle/facade.d.ts +4 -4
- package/dist/lifecycle/facade.js +2 -2
- package/dist/lifecycle/operations.d.ts +6 -4
- package/dist/lifecycle/operations.js +21 -4
- package/dist/output/canvasImage.d.ts +2 -1
- package/dist/output/canvasImage.js +4 -1
- package/dist/output/export.d.ts +3 -1
- package/dist/output/export.js +12 -0
- package/dist/output/printLayout.d.ts +5 -0
- package/dist/output/printLayout.js +4 -0
- package/dist/output/snapshotDownload.d.ts +2 -1
- package/dist/output/snapshotDownload.js +3 -2
- package/dist/platform/assets.d.ts +9 -2
- package/dist/platform/assets.js +15 -1
- package/dist/platform/copiedAssets.d.ts +1 -0
- package/dist/platform/copiedAssets.js +2 -1
- package/dist/presentation/colorScheme.d.ts +3 -0
- package/dist/presentation/colorScheme.js +40 -0
- package/dist/presentation/state.d.ts +1 -1
- package/dist/presentation/state.js +3 -3
- package/dist/print-mask.d.ts +2 -2
- package/dist/print-mask.js +1 -1
- package/dist/registry/capabilities.d.ts +14 -1
- package/dist/registry/capabilities.js +15 -2
- package/dist/registry/formats.d.ts +1 -1
- package/dist/registry/formats.generated.d.ts +1 -0
- package/dist/registry/formats.generated.js +1 -0
- package/dist/registry/formats.js +2 -2
- package/dist/registry/registry.d.ts +15 -1
- package/dist/registry/registry.js +10 -2
- package/dist/renderers/image.d.ts +1 -1
- package/dist/renderers/image.js +13 -7
- package/dist/renderers/index.d.ts +1 -1
- package/dist/renderers/index.js +11 -5
- package/dist/rendering/dispatcher.d.ts +6 -1
- package/dist/rendering/dispatcher.js +3 -3
- package/dist/rendering/handler.d.ts +13 -3
- package/dist/rendering/handler.js +21 -9
- package/dist/security/svgResources.d.ts +10 -0
- package/dist/security/svgResources.js +12 -0
- package/dist/source/index.d.ts +3 -3
- package/dist/source/index.js +1 -1
- package/dist/source/loading.d.ts +12 -7
- package/dist/source/loading.js +22 -17
- package/dist/source/precheck.d.ts +13 -1
- package/dist/source/precheck.js +9 -2
- package/dist/source/textEncoding.d.ts +18 -0
- package/dist/source/textEncoding.js +15 -0
- package/dist/viewer/createViewer.d.ts +1 -1
- package/dist/viewer/createViewer.js +30 -17
- package/dist/viewer/loading.d.ts +6 -2
- package/dist/viewer/loading.js +9 -1
- package/dist/viewer/operations.d.ts +3 -3
- package/dist/viewer/operations.js +14 -6
- package/dist/viewer/state.d.ts +6 -2
- package/dist/viewer/state.js +8 -3
- package/package.json +14 -5
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
1
|
+
// Imperative viewer composition root.
|
|
2
|
+
//
|
|
3
|
+
// `createViewer` wires source normalization, lifecycle hooks, renderer
|
|
4
|
+
// sessions, document features, watermarking, and public operations into a
|
|
5
|
+
// framework-neutral controller. Framework packages should wrap this API instead
|
|
6
|
+
// of reimplementing the orchestration.
|
|
7
|
+
import { createEmptyFileViewerSearchState, } from '../features/document/model.js';
|
|
8
|
+
import { createFileViewerDocumentFeatureControllerActionHandlers, } from '../features/document/events.js';
|
|
9
|
+
import { createFileViewerZoomController } from '../features/document/zoom.js';
|
|
10
|
+
import { createFileViewerViewStateController } from '../features/document/viewState.js';
|
|
11
|
+
import { createFileViewerFitController, hasFileViewerExplicitInitialViewState, } from '../features/document/fit.js';
|
|
12
|
+
import { DEFAULT_FILE_VIEWER_DOWNLOAD_FILENAME, DEFAULT_FILE_VIEWER_EXPORT_FILENAME, DEFAULT_FILE_VIEWER_PREVIEW_TITLE, createFileViewerOriginalSourceStateFromNormalizedSource, executeFileViewerDownloadOperation, executeFileViewerExportHtmlOperation, executeFileViewerPrintOperation, resolveFileViewerDisplayFilename, resolveFileViewerOperationFilename, } from './operations.js';
|
|
13
|
+
import { openFileViewerPrintMaskDesignerAsync } from '../features/printMaskLoader.js';
|
|
14
|
+
import { applyFileViewerZoomAvailability, createUnsupportedAvailability, getRendererAvailability, } from '../registry/capabilities.js';
|
|
15
|
+
import { buildFileViewerLifecycleContextFromNormalizedSource, buildFileViewerOperationContext, runFileViewerBeforeOperation, runFileViewerLifecycleHook, } from '../lifecycle/operations.js';
|
|
16
|
+
import { collectFileViewerRendererPlugins, createRendererRegistry, getFileViewerAutoRendererPresetVersion, hasFileViewerRendererPresetName, installFileViewerRendererPlugins, listFileViewerAutoRendererPresets, resolveFileViewerRendererPresetInputs, resolveFileViewerRendererDefinition, } from '../registry/registry.js';
|
|
17
|
+
import { createFileRenderHandlerLoader, applyFileViewerRenderSurfaceState, createFileViewerRenderSurfaceState, createFileViewerRenderSurface, removeFileViewerRenderTarget, syncFileViewerRenderSurfaceBackground, } from '../rendering/handler.js';
|
|
18
|
+
import { createFileViewerCoreRendererRegistry } from '../renderers/index.js';
|
|
19
|
+
import { createFileViewerRequestScope } from '../source/loading.js';
|
|
20
|
+
import { normalizeSource } from '../source/index.js';
|
|
21
|
+
import { buildFileViewerWatermarkInlineStyle } from '../features/watermark.js';
|
|
22
|
+
import { createFileViewerSnapshotDownload } from '../output/snapshotDownload.js';
|
|
23
|
+
import { createFileViewerErrorState, createFileViewerUnsupportedState } from './state.js';
|
|
18
24
|
const emitLifecycle = async (options, onEvent, phase, source, version, startedAt, reason) => {
|
|
19
25
|
const now = Date.now();
|
|
20
26
|
const context = buildFileViewerLifecycleContextFromNormalizedSource({
|
|
@@ -259,6 +265,7 @@ export const createViewer = (container, createOptions = {}) => {
|
|
|
259
265
|
surface.container.style.height = '100%';
|
|
260
266
|
}
|
|
261
267
|
syncFileViewerRenderSurfaceBackground(target, options);
|
|
268
|
+
target.setAttribute('data-viewer-theme', options.theme || 'system');
|
|
262
269
|
currentRenderTarget = target;
|
|
263
270
|
return surface;
|
|
264
271
|
};
|
|
@@ -383,6 +390,9 @@ export const createViewer = (container, createOptions = {}) => {
|
|
|
383
390
|
registry,
|
|
384
391
|
options: {
|
|
385
392
|
...inheritedOptions,
|
|
393
|
+
// The parent already resolved its renderer assembly into `registry`.
|
|
394
|
+
// Reuse that exact registry without reinstalling presets or mutating a
|
|
395
|
+
// shared registry while an attachment is open.
|
|
386
396
|
autoRenderers: false,
|
|
387
397
|
rendererMode: 'extend',
|
|
388
398
|
renderers: undefined,
|
|
@@ -676,6 +686,8 @@ export const createViewer = (container, createOptions = {}) => {
|
|
|
676
686
|
zoomController.refreshProvider();
|
|
677
687
|
viewStateController.refreshProvider();
|
|
678
688
|
const finishStaleLoad = async () => {
|
|
689
|
+
// unload/replace may already have disposed this session. Clear only
|
|
690
|
+
// the session still owned by this load, preserving a replacement.
|
|
679
691
|
if (renderSurfaceState.session === session && currentRenderTarget === targetHost) {
|
|
680
692
|
await destroyCurrent('replace');
|
|
681
693
|
}
|
|
@@ -722,6 +734,7 @@ export const createViewer = (container, createOptions = {}) => {
|
|
|
722
734
|
...nextOptions,
|
|
723
735
|
};
|
|
724
736
|
syncFileViewerRenderSurfaceBackground(currentRenderTarget, options);
|
|
737
|
+
currentRenderTarget === null || currentRenderTarget === void 0 ? void 0 : currentRenderTarget.setAttribute('data-viewer-theme', options.theme || 'system');
|
|
725
738
|
syncWatermarkOverlay();
|
|
726
739
|
if ('fit' in nextOptions && nextOptions.fit !== previousFit) {
|
|
727
740
|
fitController.resetAutoFit();
|
package/dist/viewer/loading.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type FileViewerI18nInput } from
|
|
2
|
-
import type { FileViewerStateTheme } from
|
|
1
|
+
import { type FileViewerI18nInput } from '../i18n/messages.js';
|
|
2
|
+
import type { FileViewerStateTheme } from '../contracts/types.js';
|
|
3
3
|
export type FileViewerLoadingTheme = FileViewerStateTheme;
|
|
4
4
|
export interface FileViewerLoadingState {
|
|
5
5
|
loading: boolean;
|
|
@@ -51,4 +51,8 @@ export declare const syncFileViewerLoadingControllerState: <Target extends Mutab
|
|
|
51
51
|
export declare const runFileViewerLoadingControllerAction: <Target extends MutableFileViewerLoadingState>(target: Target, action: () => FileViewerLoadingState) => Target;
|
|
52
52
|
export declare const runFileViewerLoadingExtensionSync: <Target extends MutableFileViewerLoadingState>({ target, controller, extension, }: RunFileViewerLoadingExtensionSyncInput<Target>) => Target;
|
|
53
53
|
export declare const createFileViewerLoadingControllerActionHandlers: <Target extends MutableFileViewerLoadingState>(target: Target, controller: FileViewerLoadingController) => FileViewerLoadingControllerActionHandlers;
|
|
54
|
+
/**
|
|
55
|
+
* 统一管理加载、错误、文案和主题色。
|
|
56
|
+
* wrapper 只负责把这个加载状态映射到各自框架的响应式系统。
|
|
57
|
+
*/
|
|
54
58
|
export declare const createFileViewerLoadingController: (extend?: string, initialI18n?: FileViewerI18nInput) => FileViewerLoadingController;
|
package/dist/viewer/loading.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { translateFileViewerMessage, } from
|
|
1
|
+
import { translateFileViewerMessage, } from '../i18n/messages.js';
|
|
2
2
|
export const FALLBACK_FILE_VIEWER_LOADING_THEME = {
|
|
3
3
|
accent: '#5f6f82',
|
|
4
4
|
soft: 'rgba(95, 111, 130, 0.12)',
|
|
@@ -418,6 +418,10 @@ const FILE_VIEWER_LOADING_COPY_KEYS = {
|
|
|
418
418
|
flac: { label: 'loading.audio.label', hint: 'loading.audio.hint' },
|
|
419
419
|
weba: { label: 'loading.audio.label', hint: 'loading.audio.hint' },
|
|
420
420
|
};
|
|
421
|
+
/**
|
|
422
|
+
* 根据扩展名返回统一的加载主题。
|
|
423
|
+
* 这样不同预览器可以复用同一套视觉语义,避免颜色、图标和文案各写一份。
|
|
424
|
+
*/
|
|
421
425
|
const localizeFileViewerLoadingTheme = (theme, extend = '', i18n) => {
|
|
422
426
|
const normalized = extend.trim().toLowerCase();
|
|
423
427
|
const keys = FILE_VIEWER_LOADING_COPY_KEYS[normalized] || {
|
|
@@ -507,6 +511,10 @@ export const createFileViewerLoadingControllerActionHandlers = (target, controll
|
|
|
507
511
|
},
|
|
508
512
|
};
|
|
509
513
|
};
|
|
514
|
+
/**
|
|
515
|
+
* 统一管理加载、错误、文案和主题色。
|
|
516
|
+
* wrapper 只负责把这个加载状态映射到各自框架的响应式系统。
|
|
517
|
+
*/
|
|
510
518
|
export const createFileViewerLoadingController = (extend = '', initialI18n) => {
|
|
511
519
|
let currentExtend = extend;
|
|
512
520
|
let currentI18n = initialI18n;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { FileViewerErrorMessageFormatter } from
|
|
2
|
-
import { type FileViewerI18nInput } from
|
|
3
|
-
import type { FileRenderExportAdapter, FileViewerDownloadOptions, FileViewerExportHtmlOptions, FileViewerOperationType, FileViewerPrintOptions, NormalizedFileViewerSource } from
|
|
1
|
+
import type { FileViewerErrorMessageFormatter } from './state.js';
|
|
2
|
+
import { type FileViewerI18nInput } from '../i18n/messages.js';
|
|
3
|
+
import type { FileRenderExportAdapter, FileViewerDownloadOptions, FileViewerExportHtmlOptions, FileViewerOperationType, FileViewerPrintOptions, NormalizedFileViewerSource } from '../contracts/types.js';
|
|
4
4
|
export interface FileViewerOriginalSourceState {
|
|
5
5
|
buffer?: ArrayBuffer | null;
|
|
6
6
|
file?: File | Blob | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { triggerFileViewerBlobDownload, triggerFileViewerUrlDownload, waitForFileViewerPrintWindowReady, } from
|
|
2
|
-
import { DEFAULT_FILE_VIEWER_SOURCE_FILENAME } from
|
|
3
|
-
import { translateFileViewerMessage, } from
|
|
1
|
+
import { triggerFileViewerBlobDownload, triggerFileViewerUrlDownload, waitForFileViewerPrintWindowReady, } from '../output/export.js';
|
|
2
|
+
import { DEFAULT_FILE_VIEWER_SOURCE_FILENAME } from '../source/index.js';
|
|
3
|
+
import { translateFileViewerMessage, } from '../i18n/messages.js';
|
|
4
4
|
export const DEFAULT_FILE_VIEWER_PREVIEW_TITLE = 'file-viewer-preview';
|
|
5
5
|
export const DEFAULT_FILE_VIEWER_EXPORT_FILENAME = 'preview';
|
|
6
6
|
export const DEFAULT_FILE_VIEWER_DOWNLOAD_FILENAME = DEFAULT_FILE_VIEWER_SOURCE_FILENAME;
|
|
@@ -65,7 +65,7 @@ const buildRenderedHtmlDocumentFromOperation = async (mode, { source, title, fil
|
|
|
65
65
|
if (!source) {
|
|
66
66
|
throw new Error(translateFileViewerMessage(i18n, 'error.noExportContent'));
|
|
67
67
|
}
|
|
68
|
-
const { buildFileViewerRenderedHtmlDocument } = await import(
|
|
68
|
+
const { buildFileViewerRenderedHtmlDocument } = await import('../export.js');
|
|
69
69
|
return buildFileViewerRenderedHtmlDocument({
|
|
70
70
|
source,
|
|
71
71
|
mode,
|
|
@@ -82,7 +82,7 @@ const buildRenderedDomDocumentFromOperation = async ({ source, title, filename,
|
|
|
82
82
|
if (!source) {
|
|
83
83
|
throw new Error(translateFileViewerMessage(i18n, 'error.noExportContent'));
|
|
84
84
|
}
|
|
85
|
-
const { buildFileViewerRenderedDomDocument } = await import(
|
|
85
|
+
const { buildFileViewerRenderedDomDocument } = await import('../export.js');
|
|
86
86
|
return buildFileViewerRenderedDomDocument({
|
|
87
87
|
source,
|
|
88
88
|
mode: 'print',
|
|
@@ -157,6 +157,11 @@ export const executeFileViewerDownloadOperation = async ({ source, filename, bef
|
|
|
157
157
|
source,
|
|
158
158
|
fallback: DEFAULT_FILE_VIEWER_DOWNLOAD_FILENAME,
|
|
159
159
|
});
|
|
160
|
+
// PDF.js transfers ArrayBuffer-backed data to its worker. After a successful
|
|
161
|
+
// render the original buffer can therefore be detached (byteLength === 0),
|
|
162
|
+
// while the File or URL retained by the viewer is still the complete source.
|
|
163
|
+
// Preserve the existing buffer-first contract for non-empty buffers, but do
|
|
164
|
+
// not turn a detached buffer into a zero-byte download.
|
|
160
165
|
if (source.buffer &&
|
|
161
166
|
(source.buffer.byteLength > 0 || (!source.file && !source.url))) {
|
|
162
167
|
triggerFileViewerBlobDownload(new Blob([source.buffer], { type: source.mimeType || ((_a = source.file) === null || _a === void 0 ? void 0 : _a.type) || 'application/octet-stream' }), resolvedFilename);
|
|
@@ -170,6 +175,8 @@ export const executeFileViewerDownloadOperation = async ({ source, filename, bef
|
|
|
170
175
|
triggerFileViewerUrlDownload(source.url, resolvedFilename);
|
|
171
176
|
return true;
|
|
172
177
|
}
|
|
178
|
+
// Empty local files are valid sources. These final fallbacks preserve their
|
|
179
|
+
// intentional zero-byte downloads when no complete File or URL is available.
|
|
173
180
|
if (source.file) {
|
|
174
181
|
triggerFileViewerBlobDownload(source.file, resolvedFilename);
|
|
175
182
|
return true;
|
|
@@ -203,6 +210,7 @@ export const executeFileViewerPrintOperation = async ({ autoPrint = true, before
|
|
|
203
210
|
if (beforeResult === false) {
|
|
204
211
|
return false;
|
|
205
212
|
}
|
|
213
|
+
// Preserve the browser's transient user activation while the snapshot is built.
|
|
206
214
|
const ownsPrintWindow = !printWindow;
|
|
207
215
|
const targetWindow = printWindow ||
|
|
208
216
|
(openWindow === null || openWindow === void 0 ? void 0 : openWindow()) ||
|
|
@@ -340,7 +348,7 @@ export const createFileViewerOperationActionHandlers = ({ getBuffer, getFile, ge
|
|
|
340
348
|
if (!source) {
|
|
341
349
|
throw new Error(translateFileViewerMessage(resolveI18n(), 'error.noExportContent'));
|
|
342
350
|
}
|
|
343
|
-
const { openFileViewerPrintMaskDesignerAsync } = await import(
|
|
351
|
+
const { openFileViewerPrintMaskDesignerAsync } = await import('../features/printMaskLoader.js');
|
|
344
352
|
const adapter = (_a = getAdapter === null || getAdapter === void 0 ? void 0 : getAdapter()) !== null && _a !== void 0 ? _a : null;
|
|
345
353
|
const result = await openFileViewerPrintMaskDesignerAsync({
|
|
346
354
|
root: source,
|
package/dist/viewer/state.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { type FileViewerI18nInput } from
|
|
2
|
-
import type { FileViewerRendererCategory, FileViewerStateDescriptor, FileViewerStateTheme } from
|
|
1
|
+
import { type FileViewerI18nInput } from '../i18n/messages.js';
|
|
2
|
+
import type { FileViewerRendererCategory, FileViewerStateDescriptor, FileViewerStateTheme } from '../contracts/types.js';
|
|
3
3
|
export type FileViewerErrorMessageFormatter = (prefix: string, error: unknown, i18n?: FileViewerI18nInput) => string;
|
|
4
|
+
/**
|
|
5
|
+
* Renderers can attach a localized, user-safe explanation without replacing
|
|
6
|
+
* the original error object that hosts use for diagnostics and recovery.
|
|
7
|
+
*/
|
|
4
8
|
export declare const FILE_VIEWER_ERROR_MESSAGE: "fileViewerErrorMessage";
|
|
5
9
|
export interface FileViewerErrorMessageCarrier {
|
|
6
10
|
[FILE_VIEWER_ERROR_MESSAGE]?: string;
|
package/dist/viewer/state.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { normalizeFileExtension } from
|
|
2
|
-
import { DEFAULT_RENDERER_DEFINITIONS } from
|
|
3
|
-
import { resolveFileViewerLocale, translateFileViewerMessage, } from
|
|
1
|
+
import { normalizeFileExtension } from '../source/index.js';
|
|
2
|
+
import { DEFAULT_RENDERER_DEFINITIONS } from '../registry/formats.js';
|
|
3
|
+
import { resolveFileViewerLocale, translateFileViewerMessage, } from '../i18n/messages.js';
|
|
4
|
+
/**
|
|
5
|
+
* Renderers can attach a localized, user-safe explanation without replacing
|
|
6
|
+
* the original error object that hosts use for diagnostics and recovery.
|
|
7
|
+
*/
|
|
4
8
|
export const FILE_VIEWER_ERROR_MESSAGE = 'fileViewerErrorMessage';
|
|
5
9
|
export const attachFileViewerErrorMessage = (error, message) => {
|
|
6
10
|
const normalizedMessage = message.trim();
|
|
@@ -16,6 +20,7 @@ export const attachFileViewerErrorMessage = (error, message) => {
|
|
|
16
20
|
return error;
|
|
17
21
|
}
|
|
18
22
|
catch {
|
|
23
|
+
// Frozen cross-realm errors retain their original value as the cause below.
|
|
19
24
|
}
|
|
20
25
|
}
|
|
21
26
|
const presented = new Error(normalizedMessage);
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@file-viewer/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
|
-
"description": "Framework-neutral
|
|
6
|
+
"description": "Framework-neutral TypeScript APIs for browser-side file preview, renderer presets, search, zoom, page navigation, print and export.",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"file-viewer",
|
|
9
9
|
"document-preview",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"type": "individual",
|
|
37
37
|
"url": "https://dev.flyfish.group/donate?source=npm"
|
|
38
38
|
},
|
|
39
|
-
"homepage": "https://
|
|
39
|
+
"homepage": "https://github.com/flyfish-dev/file-viewer#readme",
|
|
40
40
|
"main": "./dist/index.js",
|
|
41
41
|
"module": "./dist/index.js",
|
|
42
42
|
"types": "./dist/index.d.ts",
|
|
@@ -84,6 +84,10 @@
|
|
|
84
84
|
"dist/browser.js",
|
|
85
85
|
"dist/browser/controller.d.ts",
|
|
86
86
|
"dist/browser/controller.js",
|
|
87
|
+
"dist/browser/source-feedback.d.ts",
|
|
88
|
+
"dist/browser/source-feedback.js",
|
|
89
|
+
"dist/browser/toolbar-focus.d.ts",
|
|
90
|
+
"dist/browser/toolbar-focus.js",
|
|
87
91
|
"dist/config/options.d.ts",
|
|
88
92
|
"dist/config/options.js",
|
|
89
93
|
"dist/contracts/types.d.ts",
|
|
@@ -106,6 +110,8 @@
|
|
|
106
110
|
"dist/features/document/events.js",
|
|
107
111
|
"dist/features/document/fit.d.ts",
|
|
108
112
|
"dist/features/document/fit.js",
|
|
113
|
+
"dist/features/document/imageHandTool.d.ts",
|
|
114
|
+
"dist/features/document/imageHandTool.js",
|
|
109
115
|
"dist/features/document/model.d.ts",
|
|
110
116
|
"dist/features/document/model.js",
|
|
111
117
|
"dist/features/document/search.d.ts",
|
|
@@ -152,6 +158,8 @@
|
|
|
152
158
|
"dist/platform/copiedAssets.js",
|
|
153
159
|
"dist/platform/worker.d.ts",
|
|
154
160
|
"dist/platform/worker.js",
|
|
161
|
+
"dist/presentation/colorScheme.d.ts",
|
|
162
|
+
"dist/presentation/colorScheme.js",
|
|
155
163
|
"dist/presentation/state.d.ts",
|
|
156
164
|
"dist/presentation/state.js",
|
|
157
165
|
"dist/print-mask.d.ts",
|
|
@@ -196,10 +204,11 @@
|
|
|
196
204
|
"print-mask.d.ts",
|
|
197
205
|
"print-mask.js",
|
|
198
206
|
"README.en.md",
|
|
199
|
-
"README.md"
|
|
207
|
+
"README.md",
|
|
208
|
+
"README.zh-CN.md"
|
|
200
209
|
],
|
|
201
210
|
"dependencies": {
|
|
202
|
-
"dompurify": "3.4.
|
|
211
|
+
"dompurify": "3.4.17"
|
|
203
212
|
},
|
|
204
213
|
"license": "Apache-2.0",
|
|
205
214
|
"fileViewer": {
|