@file-viewer/core 2.1.24 → 2.1.25

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.
@@ -77,10 +77,10 @@ export const DEFAULT_FILE_VIEWER_RENDERER_ASSET_MANIFESTS = [
77
77
  rendererId: 'pdf',
78
78
  kind: 'wasm-directory',
79
79
  target: 'public',
80
- required: true,
80
+ required: false,
81
81
  defaultPath: DEFAULT_FILE_VIEWER_PDF_WASM_PATH,
82
82
  optionPath: 'pdf.wasmUrl',
83
- description: 'PDF.js WebAssembly helper directory for fully self-hosted PDF rendering.',
83
+ description: 'Optional PDF.js WebAssembly helper directory when the bundled PDF.js version ships one.',
84
84
  },
85
85
  {
86
86
  id: 'pdf-standard-fonts',
@@ -276,27 +276,6 @@ export const resolveFileViewerAssetUrl = (value, fallback, options = {}) => {
276
276
  const resolved = new URL(raw, resolvedBase).href;
277
277
  return options.trimTrailingSlash ? resolved.replace(/\/+$/, '') : resolved;
278
278
  };
279
- const getFileViewerDocumentOriginBaseUrl = (documentBaseUrl) => {
280
- try {
281
- const parsed = new URL(documentBaseUrl || DEFAULT_FILE_VIEWER_DOCUMENT_BASE_URL, DEFAULT_FILE_VIEWER_DOCUMENT_BASE_URL);
282
- if (parsed.origin && parsed.origin !== 'null') {
283
- return `${parsed.origin}/`;
284
- }
285
- }
286
- catch {
287
- // Keep the resolver deterministic in non-browser tests and unusual URL schemes.
288
- }
289
- return DEFAULT_FILE_VIEWER_DOCUMENT_BASE_URL;
290
- };
291
- const resolveFileViewerRootDefaultAssetUrl = (value, fallback, options = {}) => {
292
- if (value !== undefined && value !== null && String(value).trim()) {
293
- return resolveFileViewerAssetUrl(value, fallback, options);
294
- }
295
- return resolveFileViewerAssetUrl(undefined, fallback, {
296
- ...options,
297
- baseUrl: getFileViewerDocumentOriginBaseUrl(options.documentBaseUrl),
298
- });
299
- };
300
279
  export const resolveFileViewerArchiveWorkerUrl = (options, baseUrl) => {
301
280
  return resolveFileViewerAssetUrl(options === null || options === void 0 ? void 0 : options.workerUrl, DEFAULT_FILE_VIEWER_ARCHIVE_WORKER_PATH, { baseUrl });
302
281
  };
@@ -322,16 +301,16 @@ export const resolveFileViewerCadAssetUrls = (options, documentBaseUrl) => {
322
301
  };
323
302
  export const resolveFileViewerPdfAssetUrls = (options, documentBaseUrl) => {
324
303
  return {
325
- workerUrl: resolveFileViewerRootDefaultAssetUrl(options === null || options === void 0 ? void 0 : options.workerUrl, DEFAULT_FILE_VIEWER_PDF_WORKER_PATH, {
304
+ workerUrl: resolveFileViewerAssetUrl(options === null || options === void 0 ? void 0 : options.workerUrl, DEFAULT_FILE_VIEWER_PDF_WORKER_PATH, {
326
305
  documentBaseUrl,
327
306
  }),
328
- cMapUrl: resolveFileViewerRootDefaultAssetUrl(options === null || options === void 0 ? void 0 : options.cMapUrl, DEFAULT_FILE_VIEWER_PDF_CMAP_PATH, {
307
+ cMapUrl: resolveFileViewerAssetUrl(options === null || options === void 0 ? void 0 : options.cMapUrl, DEFAULT_FILE_VIEWER_PDF_CMAP_PATH, {
329
308
  documentBaseUrl,
330
309
  }),
331
- wasmUrl: resolveFileViewerRootDefaultAssetUrl(options === null || options === void 0 ? void 0 : options.wasmUrl, DEFAULT_FILE_VIEWER_PDF_WASM_PATH, {
310
+ wasmUrl: resolveFileViewerAssetUrl(options === null || options === void 0 ? void 0 : options.wasmUrl, DEFAULT_FILE_VIEWER_PDF_WASM_PATH, {
332
311
  documentBaseUrl,
333
312
  }),
334
- standardFontDataUrl: resolveFileViewerRootDefaultAssetUrl(options === null || options === void 0 ? void 0 : options.standardFontDataUrl, DEFAULT_FILE_VIEWER_PDF_STANDARD_FONT_PATH, { documentBaseUrl }),
313
+ standardFontDataUrl: resolveFileViewerAssetUrl(options === null || options === void 0 ? void 0 : options.standardFontDataUrl, DEFAULT_FILE_VIEWER_PDF_STANDARD_FONT_PATH, { documentBaseUrl }),
335
314
  };
336
315
  };
337
316
  export const resolveFileViewerDrawioViewerScriptUrl = (options, documentBaseUrl) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@file-viewer/core",
3
- "version": "2.1.24",
3
+ "version": "2.1.25",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Framework-neutral modular TypeScript core for Flyfish File Viewer renderer orchestration, lifecycle APIs, search, zoom, print, and export",