@file-viewer/core 2.4.0 → 3.0.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.
@@ -11,10 +11,14 @@ const getAutoRendererBucket = () => {
11
11
  }
12
12
  return host[autoRendererBucketKey];
13
13
  };
14
- const normalizeDefinition = (definition) => ({
15
- ...definition,
16
- extensions: definition.extensions.map(normalizeFileExtension),
17
- });
14
+ const normalizeDefinition = (definition) => {
15
+ var _a;
16
+ return ({
17
+ ...definition,
18
+ extensions: definition.extensions.map(normalizeFileExtension),
19
+ enhancesExtensions: (_a = definition.enhancesExtensions) === null || _a === void 0 ? void 0 : _a.map(normalizeFileExtension),
20
+ });
21
+ };
18
22
  export const createRendererRegistry = (initialDefinitions = DEFAULT_RENDERER_DEFINITIONS) => {
19
23
  const byId = new Map();
20
24
  const byExtension = new Map();
@@ -72,6 +76,142 @@ export const createRendererRegistry = (initialDefinitions = DEFAULT_RENDERER_DEF
72
76
  },
73
77
  };
74
78
  };
79
+ const collectRendererEnhancementClaims = (registry, definitions) => {
80
+ var _a, _b;
81
+ const normalizedDefinitions = definitions.map(normalizeDefinition);
82
+ const incomingDefinitionsById = new Map();
83
+ normalizedDefinitions.forEach(definition => {
84
+ incomingDefinitionsById.set(definition.id, definition);
85
+ });
86
+ const claimsByOwnerAndExtension = new Map();
87
+ for (const definition of registry.list().map(normalizeDefinition)) {
88
+ const ownerId = definition.enhancesRendererId;
89
+ if (!ownerId || !((_a = definition.enhancesExtensions) === null || _a === void 0 ? void 0 : _a.length)) {
90
+ continue;
91
+ }
92
+ const ownedExtensions = new Set(definition.extensions);
93
+ definition.enhancesExtensions.forEach(extension => {
94
+ var _a;
95
+ if (ownedExtensions.has(extension) &&
96
+ ((_a = registry.getByExtension(extension)) === null || _a === void 0 ? void 0 : _a.id) === definition.id) {
97
+ claimsByOwnerAndExtension.set(`${ownerId}\u0000${extension}`, {
98
+ enhancerId: definition.id,
99
+ ownerId,
100
+ extension,
101
+ });
102
+ }
103
+ });
104
+ }
105
+ for (const definition of normalizedDefinitions) {
106
+ const declaresOwner = definition.enhancesRendererId !== undefined;
107
+ const declaresExtensions = definition.enhancesExtensions !== undefined;
108
+ if (declaresOwner !== declaresExtensions) {
109
+ throw new Error(`Renderer "${definition.id}" enhancement must declare both enhancesRendererId and enhancesExtensions.`);
110
+ }
111
+ if (!declaresOwner || !declaresExtensions) {
112
+ continue;
113
+ }
114
+ const ownerId = ((_b = definition.enhancesRendererId) === null || _b === void 0 ? void 0 : _b.trim()) || '';
115
+ const enhancedExtensions = definition.enhancesExtensions || [];
116
+ if (!ownerId) {
117
+ throw new Error(`Renderer "${definition.id}" enhancement owner must not be empty.`);
118
+ }
119
+ if (!enhancedExtensions.length) {
120
+ throw new Error(`Renderer "${definition.id}" enhancement extensions must not be empty.`);
121
+ }
122
+ if (ownerId === definition.id) {
123
+ throw new Error(`Renderer "${definition.id}" cannot enhance its own definition.`);
124
+ }
125
+ const directlyOwnedExtensions = new Set(definition.extensions);
126
+ for (const extension of enhancedExtensions) {
127
+ if (!extension) {
128
+ throw new Error(`Renderer "${definition.id}" enhancement extension must not be empty.`);
129
+ }
130
+ if (directlyOwnedExtensions.has(extension)) {
131
+ throw new Error(`Renderer "${definition.id}" must not own and enhance extension "${extension}" simultaneously.`);
132
+ }
133
+ const key = `${ownerId}\u0000${extension}`;
134
+ const existing = claimsByOwnerAndExtension.get(key);
135
+ if (existing && existing.enhancerId !== definition.id) {
136
+ throw new Error(`Renderer enhancement collision: extension "${extension}" from "${ownerId}" is claimed by both "${existing.enhancerId}" and "${definition.id}".`);
137
+ }
138
+ claimsByOwnerAndExtension.set(key, {
139
+ enhancerId: definition.id,
140
+ ownerId,
141
+ extension,
142
+ });
143
+ }
144
+ }
145
+ for (const claim of claimsByOwnerAndExtension.values()) {
146
+ const owner = incomingDefinitionsById.get(claim.ownerId) || registry.getById(claim.ownerId);
147
+ if (!owner) {
148
+ throw new Error(`Renderer "${claim.enhancerId}" enhances unknown renderer "${claim.ownerId}".`);
149
+ }
150
+ const ownerExtensions = new Set(owner.extensions.map(normalizeFileExtension));
151
+ const installedExtensionOwner = registry.getByExtension(claim.extension);
152
+ const alreadyInstalled = (installedExtensionOwner === null || installedExtensionOwner === void 0 ? void 0 : installedExtensionOwner.id) === claim.enhancerId;
153
+ if (!ownerExtensions.has(claim.extension) && !alreadyInstalled) {
154
+ throw new Error(`Renderer "${claim.enhancerId}" cannot enhance extension "${claim.extension}" because renderer "${claim.ownerId}" does not own it.`);
155
+ }
156
+ }
157
+ return {
158
+ claims: Array.from(claimsByOwnerAndExtension.values()),
159
+ normalizedDefinitions,
160
+ };
161
+ };
162
+ const createRendererDefinitionInstallPlan = (registry, definitions) => {
163
+ const { claims, normalizedDefinitions } = collectRendererEnhancementClaims(registry, definitions);
164
+ const claimedExtensionsByOwnerId = new Map();
165
+ claims.forEach(claim => {
166
+ const extensions = claimedExtensionsByOwnerId.get(claim.ownerId) || new Set();
167
+ extensions.add(claim.extension);
168
+ claimedExtensionsByOwnerId.set(claim.ownerId, extensions);
169
+ });
170
+ const applyClaims = (definition) => {
171
+ var _a, _b;
172
+ const normalized = normalizeDefinition(definition);
173
+ const extensions = new Set(normalized.extensions);
174
+ (_a = normalized.enhancesExtensions) === null || _a === void 0 ? void 0 : _a.forEach(extension => extensions.add(extension));
175
+ (_b = claimedExtensionsByOwnerId.get(normalized.id)) === null || _b === void 0 ? void 0 : _b.forEach(extension => extensions.delete(extension));
176
+ return {
177
+ ...normalized,
178
+ extensions: Array.from(extensions),
179
+ };
180
+ };
181
+ const incomingDefinitionIds = new Set(normalizedDefinitions.map(definition => definition.id));
182
+ const existingOwnerDefinitions = Array.from(claimedExtensionsByOwnerId.keys())
183
+ .filter(ownerId => !incomingDefinitionIds.has(ownerId))
184
+ .map(ownerId => registry.getById(ownerId))
185
+ .filter((definition) => !!definition)
186
+ .map(applyClaims);
187
+ const regularDefinitions = normalizedDefinitions
188
+ .filter(definition => definition.enhancesRendererId === undefined)
189
+ .map(applyClaims);
190
+ const enhancerDefinitions = normalizedDefinitions
191
+ .filter(definition => definition.enhancesRendererId !== undefined)
192
+ .map(applyClaims);
193
+ const plannedDefinitions = [
194
+ ...existingOwnerDefinitions,
195
+ ...regularDefinitions,
196
+ ...enhancerDefinitions,
197
+ ];
198
+ // Validate the complete ownership transition before mutating the caller's registry.
199
+ const validationRegistry = createRendererRegistry(registry.list());
200
+ plannedDefinitions.forEach(definition => validationRegistry.register(definition));
201
+ return { definitions: plannedDefinitions };
202
+ };
203
+ const createEnhancementAwareInstallRegistry = (registry) => ({
204
+ register(definition) {
205
+ const plan = createRendererDefinitionInstallPlan(registry, [definition]);
206
+ plan.definitions.forEach(plannedDefinition => registry.register(plannedDefinition));
207
+ },
208
+ unregister: id => registry.unregister(id),
209
+ getById: id => registry.getById(id),
210
+ getByExtension: extension => registry.getByExtension(extension),
211
+ hasExtension: extension => registry.hasExtension(extension),
212
+ list: () => registry.list(),
213
+ listExtensions: () => registry.listExtensions(),
214
+ });
75
215
  const isRendererPreset = (input) => {
76
216
  return !!input && typeof input === 'object' && !Array.isArray(input) &&
77
217
  Array.isArray(input.renderers);
@@ -187,15 +327,17 @@ export const resolveFileViewerRendererPresetInputs = (input) => {
187
327
  return [input];
188
328
  };
189
329
  export const installFileViewerRendererPlugins = async ({ registry, plugins, registerHandler, }) => {
190
- var _a, _b, _c;
191
- for (const plugin of plugins) {
192
- (_a = plugin.definitions) === null || _a === void 0 ? void 0 : _a.forEach(definition => {
193
- registry.register(definition);
194
- });
195
- (_b = plugin.handlers) === null || _b === void 0 ? void 0 : _b.forEach(registration => {
330
+ var _a, _b;
331
+ const pluginList = Array.from(plugins);
332
+ const definitions = pluginList.flatMap(plugin => [...(plugin.definitions || [])]);
333
+ const plan = createRendererDefinitionInstallPlan(registry, definitions);
334
+ plan.definitions.forEach(definition => registry.register(definition));
335
+ const installRegistry = createEnhancementAwareInstallRegistry(registry);
336
+ for (const plugin of pluginList) {
337
+ (_a = plugin.handlers) === null || _a === void 0 ? void 0 : _a.forEach(registration => {
196
338
  registerHandler === null || registerHandler === void 0 ? void 0 : registerHandler(registration);
197
339
  });
198
- await ((_c = plugin.install) === null || _c === void 0 ? void 0 : _c.call(plugin, { registry, registerHandler }));
340
+ await ((_b = plugin.install) === null || _b === void 0 ? void 0 : _b.call(plugin, { registry: installRegistry, registerHandler }));
199
341
  }
200
342
  return registry;
201
343
  };
@@ -16,7 +16,7 @@ export declare const coreLiteRendererDefinitions: ({
16
16
  readonly supportLevel: "high-fidelity";
17
17
  readonly status: "stable";
18
18
  readonly packageName: "@file-viewer/renderer-word";
19
- readonly presets: readonly ["office", "all"];
19
+ readonly presets: readonly ["standard", "office", "all"];
20
20
  readonly containerVersions: readonly ["OOXML Transitional", "OOXML Strict"];
21
21
  readonly knownLimits: readonly ["VBA is never executed"];
22
22
  readonly capabilities: {
@@ -35,7 +35,7 @@ export declare const coreLiteRendererDefinitions: ({
35
35
  readonly supportLevel: "structured";
36
36
  readonly status: "stable";
37
37
  readonly packageName: "@file-viewer/renderer-word";
38
- readonly presets: readonly ["office", "all"];
38
+ readonly presets: readonly ["standard", "office", "all"];
39
39
  readonly containerVersions: readonly ["Word 97-2003 Binary"];
40
40
  readonly knownLimits: readonly ["Macros are never executed"];
41
41
  readonly capabilities: {
@@ -53,7 +53,7 @@ export declare const coreLiteRendererDefinitions: ({
53
53
  readonly async: true;
54
54
  readonly supportLevel: "structured";
55
55
  readonly status: "stable";
56
- readonly packageName: "@file-viewer/renderer-presentation";
56
+ readonly packageName: "@file-viewer/renderer-ppt";
57
57
  readonly presets: readonly ["office", "all"];
58
58
  readonly containerVersions: readonly ["PowerPoint 97-2003 Binary"];
59
59
  readonly knownLimits: readonly ["Embedded engine watermark is retained", "Macros are never executed"];
@@ -72,8 +72,8 @@ export declare const coreLiteRendererDefinitions: ({
72
72
  readonly async: true;
73
73
  readonly supportLevel: "high-fidelity";
74
74
  readonly status: "stable";
75
- readonly packageName: "@file-viewer/renderer-presentation";
76
- readonly presets: readonly ["office", "all"];
75
+ readonly packageName: "@file-viewer/renderer-pptx";
76
+ readonly presets: readonly ["standard", "office", "all"];
77
77
  readonly containerVersions: readonly ["OOXML Transitional", "OOXML Strict"];
78
78
  readonly knownLimits: readonly ["Macros and external programs are never executed"];
79
79
  readonly capabilities: {
@@ -92,7 +92,7 @@ export declare const coreLiteRendererDefinitions: ({
92
92
  readonly supportLevel: "structured";
93
93
  readonly status: "stable";
94
94
  readonly packageName: "@file-viewer/renderer-word";
95
- readonly presets: readonly ["office", "all"];
95
+ readonly presets: readonly ["standard", "office", "all"];
96
96
  readonly containerVersions: readonly ["RTF", "OpenDocument"];
97
97
  readonly knownLimits: readonly [];
98
98
  readonly capabilities: {
@@ -111,7 +111,7 @@ export declare const coreLiteRendererDefinitions: ({
111
111
  readonly supportLevel: "structured";
112
112
  readonly status: "stable";
113
113
  readonly packageName: "@file-viewer/renderer-spreadsheet";
114
- readonly presets: readonly ["office", "all"];
114
+ readonly presets: readonly ["standard", "office", "all"];
115
115
  readonly containerVersions: readonly ["OOXML", "BIFF", "OpenDocument", "Delimited text"];
116
116
  readonly knownLimits: readonly ["VBA and add-in code are never executed", "Formula results are read from the saved workbook cache"];
117
117
  readonly capabilities: {
@@ -206,7 +206,7 @@ export declare const coreLiteRendererDefinitions: ({
206
206
  readonly supportLevel: "structured";
207
207
  readonly status: "stable";
208
208
  readonly packageName: "@file-viewer/renderer-spreadsheet";
209
- readonly presets: readonly ["office", "all"];
209
+ readonly presets: readonly ["standard", "office", "all"];
210
210
  readonly containerVersions: readonly ["dBASE III/IV", "Visual FoxPro"];
211
211
  readonly knownLimits: readonly ["Missing DBT/FPT memo sidecars are reported as incomplete"];
212
212
  readonly capabilities: {
@@ -225,7 +225,7 @@ export declare const coreLiteRendererDefinitions: ({
225
225
  readonly supportLevel: "high-fidelity";
226
226
  readonly status: "stable";
227
227
  readonly packageName: "@file-viewer/renderer-pdf";
228
- readonly presets: readonly ["office", "all"];
228
+ readonly presets: readonly ["standard", "office", "all"];
229
229
  readonly containerVersions: readonly ["PDF"];
230
230
  readonly knownLimits: readonly [];
231
231
  readonly capabilities: {
@@ -244,7 +244,7 @@ export declare const coreLiteRendererDefinitions: ({
244
244
  readonly supportLevel: "structured";
245
245
  readonly status: "stable";
246
246
  readonly packageName: "@file-viewer/renderer-ofd";
247
- readonly presets: readonly ["office", "all"];
247
+ readonly presets: readonly ["standard", "office", "all"];
248
248
  readonly containerVersions: readonly ["OFD"];
249
249
  readonly knownLimits: readonly [];
250
250
  readonly capabilities: {
@@ -301,7 +301,7 @@ export declare const coreLiteRendererDefinitions: ({
301
301
  readonly supportLevel: "structured";
302
302
  readonly status: "stable";
303
303
  readonly packageName: "@file-viewer/renderer-archive";
304
- readonly presets: readonly ["all"];
304
+ readonly presets: readonly ["standard", "all"];
305
305
  readonly containerVersions: readonly ["libarchive-supported containers"];
306
306
  readonly knownLimits: readonly [];
307
307
  readonly capabilities: {
@@ -311,6 +311,25 @@ export declare const coreLiteRendererDefinitions: ({
311
311
  readonly zoom: false;
312
312
  readonly search: true;
313
313
  };
314
+ } | {
315
+ readonly id: "chm";
316
+ readonly label: "Compiled HTML Help";
317
+ readonly category: "ebook";
318
+ readonly extensions: readonly ["chm"];
319
+ readonly async: true;
320
+ readonly supportLevel: "structured";
321
+ readonly status: "stable";
322
+ readonly packageName: "@file-viewer/renderer-chm";
323
+ readonly presets: readonly ["all"];
324
+ readonly containerVersions: readonly ["Microsoft HTML Help ITSF v2/v3", "LZX MSCompressed and uncompressed content"];
325
+ readonly knownLimits: readonly ["ActiveX, Shortcut/WinHelp commands, scripts and external network resources are intentionally blocked", "Merged help collections require each referenced CHM file to be opened separately"];
326
+ readonly capabilities: {
327
+ readonly download: true;
328
+ readonly print: "adapter";
329
+ readonly exportHtml: "adapter";
330
+ readonly zoom: false;
331
+ readonly search: true;
332
+ };
314
333
  } | {
315
334
  readonly id: "email";
316
335
  readonly label: "Email";
@@ -320,7 +339,7 @@ export declare const coreLiteRendererDefinitions: ({
320
339
  readonly supportLevel: "structured";
321
340
  readonly status: "stable";
322
341
  readonly packageName: "@file-viewer/renderer-email";
323
- readonly presets: readonly ["all"];
342
+ readonly presets: readonly ["standard", "all"];
324
343
  readonly containerVersions: readonly ["MIME", "Outlook MSG", "mbox"];
325
344
  readonly knownLimits: readonly [];
326
345
  readonly capabilities: {
@@ -510,7 +529,7 @@ export declare const coreLiteRendererDefinitions: ({
510
529
  readonly supportLevel: "high-fidelity";
511
530
  readonly status: "stable";
512
531
  readonly packageName: "@file-viewer/renderer-image";
513
- readonly presets: readonly ["lite", "all"];
532
+ readonly presets: readonly ["lite", "standard", "all"];
514
533
  readonly containerVersions: readonly ["Raster", "SVG"];
515
534
  readonly knownLimits: readonly [];
516
535
  readonly capabilities: {
@@ -520,6 +539,44 @@ export declare const coreLiteRendererDefinitions: ({
520
539
  readonly zoom: "provider";
521
540
  readonly search: false;
522
541
  };
542
+ } | {
543
+ readonly id: "dicom";
544
+ readonly label: "DICOM";
545
+ readonly category: "medical-image";
546
+ readonly extensions: readonly ["dcm", "dicom"];
547
+ readonly async: true;
548
+ readonly supportLevel: "basic";
549
+ readonly status: "experimental";
550
+ readonly packageName: "@file-viewer/renderer-dicom";
551
+ readonly presets: readonly [];
552
+ readonly containerVersions: readonly ["DICOM Part 10"];
553
+ readonly knownLimits: readonly ["Local single-file and multi-frame viewing only; series assembly, PACS/DICOMweb, MPR, segmentation, measurement tools, and diagnostic-use claims are not included", "Tested transfer syntaxes are Implicit/Explicit VR Little Endian, JPEG Lossless Process 14 SV1, JPEG-LS Lossless, and JPEG 2000 Lossless"];
554
+ readonly capabilities: {
555
+ readonly download: true;
556
+ readonly print: false;
557
+ readonly exportHtml: false;
558
+ readonly zoom: "provider";
559
+ readonly search: false;
560
+ };
561
+ } | {
562
+ readonly id: "signature";
563
+ readonly label: "Digital signatures and evidence containers";
564
+ readonly category: "cryptographic-container";
565
+ readonly extensions: readonly ["p7m", "p7s", "p7c", "p7b", "pkcs7", "cms", "cmsc", "tsd", "tst", "tsq", "tsr", "asics", "scs", "asice", "sce", "ers", "asc", "sig", "pgp", "gpg", "jws"];
566
+ readonly async: true;
567
+ readonly supportLevel: "structured";
568
+ readonly status: "experimental";
569
+ readonly packageName: "@file-viewer/renderer-signature";
570
+ readonly presets: readonly [];
571
+ readonly containerVersions: readonly ["CMS/PKCS#7", "CAdES attributes", "RFC 3161", "RFC 5544", "ASiC-S/E", "RFC 4998", "RFC 7515", "OpenPGP RFC 9580"];
572
+ readonly knownLimits: readonly ["Opt-in renderer; it is not added to the published preset-all/full compatibility closure", "Cryptographic checks are reported separately from certificate/key trust, policy, qualified-signature status and legal validity", "ASiC XML references and RFC 4998 renewal chains are structurally inspected; full XAdES and archival-policy validation are not claimed", "OpenPGP private-key operations and automatic decryption are intentionally excluded"];
573
+ readonly capabilities: {
574
+ readonly download: true;
575
+ readonly print: false;
576
+ readonly exportHtml: false;
577
+ readonly zoom: false;
578
+ readonly search: false;
579
+ };
523
580
  } | {
524
581
  readonly id: "markdown";
525
582
  readonly label: "Markdown";
@@ -529,7 +586,7 @@ export declare const coreLiteRendererDefinitions: ({
529
586
  readonly supportLevel: "structured";
530
587
  readonly status: "stable";
531
588
  readonly packageName: "@file-viewer/renderer-text";
532
- readonly presets: readonly ["lite", "all"];
589
+ readonly presets: readonly ["lite", "standard", "all"];
533
590
  readonly containerVersions: readonly ["CommonMark/GFM"];
534
591
  readonly knownLimits: readonly [];
535
592
  readonly capabilities: {
@@ -548,7 +605,7 @@ export declare const coreLiteRendererDefinitions: ({
548
605
  readonly supportLevel: "structured";
549
606
  readonly status: "stable";
550
607
  readonly packageName: "@file-viewer/renderer-text";
551
- readonly presets: readonly ["lite", "all"];
608
+ readonly presets: readonly ["lite", "standard", "all"];
552
609
  readonly containerVersions: readonly ["Plain text", "source code", "Git bundle"];
553
610
  readonly knownLimits: readonly [];
554
611
  readonly capabilities: {
@@ -567,7 +624,7 @@ export declare const coreLiteRendererDefinitions: ({
567
624
  readonly supportLevel: "high-fidelity";
568
625
  readonly status: "stable";
569
626
  readonly packageName: "@file-viewer/renderer-media";
570
- readonly presets: readonly ["lite", "all"];
627
+ readonly presets: readonly ["lite", "standard", "all"];
571
628
  readonly containerVersions: readonly ["Browser media"];
572
629
  readonly knownLimits: readonly ["Codec support follows the browser"];
573
630
  readonly capabilities: {
@@ -586,7 +643,7 @@ export declare const coreLiteRendererDefinitions: ({
586
643
  readonly supportLevel: "high-fidelity";
587
644
  readonly status: "stable";
588
645
  readonly packageName: "@file-viewer/renderer-media";
589
- readonly presets: readonly ["lite", "all"];
646
+ readonly presets: readonly ["lite", "standard", "all"];
590
647
  readonly containerVersions: readonly ["Browser media", "MIDI"];
591
648
  readonly knownLimits: readonly ["Codec support follows the browser"];
592
649
  readonly capabilities: {
@@ -596,6 +653,202 @@ export declare const coreLiteRendererDefinitions: ({
596
653
  readonly zoom: false;
597
654
  readonly search: false;
598
655
  };
656
+ } | {
657
+ readonly id: "photoshop-design";
658
+ readonly label: "Adobe Photoshop";
659
+ readonly category: "asset";
660
+ readonly extensions: readonly ["psb", "pdd", "psdt"];
661
+ readonly async: true;
662
+ readonly supportLevel: "experimental";
663
+ readonly status: "experimental";
664
+ readonly packageName: "@file-viewer/renderer-design";
665
+ readonly presets: readonly [];
666
+ readonly enhancesRendererId: "data-asset";
667
+ readonly enhancesExtensions: readonly ["psd"];
668
+ readonly containerVersions: readonly ["PSD v1", "PSB v2"];
669
+ readonly knownLimits: readonly ["Pixel rendering is enabled only for 8-bit RGB and grayscale documents; unsupported color modes and bit depths are rejected instead of decoded incorrectly", "The untouched merged composite is the fidelity reference and must have been saved with Maximize Compatibility using Raw or PackBits RLE compression; ZIP composites are rejected", "Auxiliary channels are accepted only when PSD layer-info declares one merged-transparency channel; PSB currently requires exactly the base RGB or grayscale channels", "Embedded ICC profiles are detected but not color-converted yet, so profiled color is not reference-verified", "The PSD/PSB container version is taken from the 8BPS header; a mismatched filename extension is diagnosed and never used as the format authority", "Legacy PhotoDeluxe PDD and Photoshop template PSDT inputs are accepted only when the bytes validate as a PSD v1 8BPS container; unrelated files sharing those extensions are rejected", "PSD layer visibility is interactive only for flat normal-blend 100%-opacity documents without masks, effects, clipping, adjustments, groups, or resource-limit violations", "PSB currently exposes the saved composite and a read-only layer tree; interactive PSB layer recomposition is not claimed, and PSB files containing ZIP-compressed layer channels are rejected"];
670
+ readonly capabilities: {
671
+ readonly download: true;
672
+ readonly print: true;
673
+ readonly exportHtml: false;
674
+ readonly zoom: true;
675
+ readonly search: false;
676
+ };
677
+ } | {
678
+ readonly id: "illustrator-pdf-design";
679
+ readonly label: "Adobe Illustrator AI/AIT";
680
+ readonly category: "asset";
681
+ readonly extensions: readonly ["ait"];
682
+ readonly async: true;
683
+ readonly supportLevel: "experimental";
684
+ readonly status: "experimental";
685
+ readonly packageName: "@file-viewer/renderer-design";
686
+ readonly presets: readonly [];
687
+ readonly enhancesRendererId: "data-asset";
688
+ readonly enhancesExtensions: readonly ["ai"];
689
+ readonly containerVersions: readonly ["Illustrator PDF-compatible AI/AIT", "Illustrator native PGF/private source"];
690
+ readonly knownLimits: readonly ["Automatic mode prefers the verified PDF-compatible surface for the highest saved appearance fidelity, while Native PGF mode parses the editable private source in a dedicated bounded Worker and exposes native artboards and layer visibility", "A PDF header alone is insufficient: the renderer also requires Illustrator-origin XMP, MIME, creator, or AIPrivateData evidence so an ordinary renamed PDF is not advertised as an Illustrator document", "The packaged browser Worker decodes uncompressed, deflate, and Illustrator 24 zstd private source entirely offline; zstd output is streamed through the same decoded-byte ceiling and unsupported long-distance frames fail explicitly", "Native PGF rendering currently preserves and reports unknown operators but does not claim complete Illustrator gradients, text shaping, placed or embedded images, plugins, effects, masks, blending, overprint, spot-color management, or font substitution fidelity", "The PDF renderer is required only for the saved PDF surface; native-only AI/AIT can open without it, and PDF pages or optional-content groups are not presented as native artboards or layers"];
691
+ readonly capabilities: {
692
+ readonly download: true;
693
+ readonly print: true;
694
+ readonly exportHtml: false;
695
+ readonly zoom: true;
696
+ readonly search: true;
697
+ };
698
+ } | {
699
+ readonly id: "indesign-idml-design";
700
+ readonly label: "Adobe InDesign IDML";
701
+ readonly category: "asset";
702
+ readonly extensions: readonly ["idml"];
703
+ readonly async: true;
704
+ readonly supportLevel: "experimental";
705
+ readonly status: "experimental";
706
+ readonly packageName: "@file-viewer/renderer-design";
707
+ readonly presets: readonly [];
708
+ readonly containerVersions: readonly ["IDML package", "@paged-media/introspect-wasm 0.62.0"];
709
+ readonly knownLimits: readonly ["Pages are rendered locally by the CPU WASM engine in a module Worker; the browser never uploads the IDML package", "ZIP64, encrypted, multi-disk, overlapping, unsafe-path, unsupported-compression, and configured expansion-limit packages are rejected before the WASM engine opens them", "The current engine page tree lists TextFrame and Rectangle objects only even though other supported objects may still appear in rendered page pixels", "Each page render rebuilds the upstream document internally; interactive requests are latest-wins, preview is lazy, and print-all is bounded by the configured total RGBA working-set limit"];
710
+ readonly capabilities: {
711
+ readonly download: true;
712
+ readonly print: true;
713
+ readonly exportHtml: false;
714
+ readonly zoom: true;
715
+ readonly search: false;
716
+ };
717
+ } | {
718
+ readonly id: "indesign-exchange-design";
719
+ readonly label: "Adobe InCopy and InDesign Exchange";
720
+ readonly category: "asset";
721
+ readonly extensions: readonly ["icml", "idms", "inx"];
722
+ readonly async: true;
723
+ readonly supportLevel: "structured";
724
+ readonly status: "experimental";
725
+ readonly packageName: "@file-viewer/renderer-design";
726
+ readonly presets: readonly [];
727
+ readonly containerVersions: readonly ["ICML InCopyInterchange", "IDMS PageItem", "legacy INX"];
728
+ readonly knownLimits: readonly ["ICML is rendered as styled story content because the format does not carry a complete document page layout", "IDMS page-item paths, transforms, colors, stories, styles, layers, and linked-resource metadata are parsed in a terminable Worker and shown as a bounded layout-fragment preview; it is not advertised as a complete INDD page", "Legacy INX abbreviated records have no maintained browser layout engine; common page items and geometry are visualized while every unmapped element name remains visible in the structure inventory", "UTF-8, signature, DTD/entity, source size, node, depth, attribute, text, story, item, point, style, and color limits are enforced; linked resource paths are never fetched"];
729
+ readonly capabilities: {
730
+ readonly download: true;
731
+ readonly print: true;
732
+ readonly exportHtml: true;
733
+ readonly zoom: false;
734
+ readonly search: true;
735
+ };
736
+ } | {
737
+ readonly id: "adobe-animate-xfl-design";
738
+ readonly label: "Adobe Animate XFL";
739
+ readonly category: "asset";
740
+ readonly extensions: readonly ["fla", "xfl"];
741
+ readonly async: true;
742
+ readonly supportLevel: "structured";
743
+ readonly status: "experimental";
744
+ readonly packageName: "@file-viewer/renderer-design";
745
+ readonly presets: readonly [];
746
+ readonly containerVersions: readonly ["Modern compressed XFL-based FLA (CS5+)", "single DOMDocument XML XFL"];
747
+ readonly knownLimits: readonly ["Modern ZIP/XFL-based FLA is parsed in a terminable Worker; legacy binary FLA (Flash CS4 and earlier) is explicitly rejected", "The bounded first-frame preview reconstructs solid shapes, static text, nested symbols, and direct PNG/JPEG instances; masks, filters, tweens, ActionScript, audio/video playback, and proprietary bitmap .dat payloads remain structure-only", "A standard uncompressed .xfl is only a marker beside DOMDocument.xml, LIBRARY, and media folders; a single browser File object cannot access those siblings, so it must be packaged as FLA or supplied through a future folder/multi-file API", "ZIP64, encryption, multi-disk archives, overlapping records, unsafe or ambiguous paths, CRC failures, unsupported compression, DTD/entity XML, external XML stylesheets, and configured size/node/depth/ratio limits are rejected"];
748
+ readonly capabilities: {
749
+ readonly download: true;
750
+ readonly print: false;
751
+ readonly exportHtml: false;
752
+ readonly zoom: false;
753
+ readonly search: false;
754
+ };
755
+ } | {
756
+ readonly id: "adobe-xd-design";
757
+ readonly label: "Adobe XD Package";
758
+ readonly category: "asset";
759
+ readonly extensions: readonly ["xd"];
760
+ readonly async: true;
761
+ readonly supportLevel: "structured";
762
+ readonly status: "experimental";
763
+ readonly packageName: "@file-viewer/renderer-design";
764
+ readonly presets: readonly [];
765
+ readonly containerVersions: readonly ["XD UCF package", "AGC JSON inventory"];
766
+ readonly knownLimits: readonly ["A terminable module Worker shows the highest-resolution structurally referenced embedded PNG/JPEG rendition and a bounded manifest, artboard, layer, and resource inventory", "Native AGC vector scene reconstruction is not implemented; files without a saved preview remain structure-only", "ZIP64, encrypted, multi-disk, overlapping, unsafe-path, CRC-invalid, unsupported-compression, and configured expansion-limit packages are rejected"];
767
+ readonly capabilities: {
768
+ readonly download: true;
769
+ readonly print: false;
770
+ readonly exportHtml: false;
771
+ readonly zoom: false;
772
+ readonly search: false;
773
+ };
774
+ } | {
775
+ readonly id: "indesign-native-design";
776
+ readonly label: "Adobe InDesign Native";
777
+ readonly category: "asset";
778
+ readonly extensions: readonly ["indd", "indt"];
779
+ readonly async: true;
780
+ readonly supportLevel: "structured";
781
+ readonly status: "experimental";
782
+ readonly packageName: "@file-viewer/renderer-design";
783
+ readonly presets: readonly [];
784
+ readonly containerVersions: readonly ["InDesign 2+ native database", "INDD", "INDT"];
785
+ readonly knownLimits: readonly ["A terminable module Worker shows a JPEG/PNG preview only when it is embedded in a structurally verified contiguous XMP object", "The proprietary native layout database is not reconstructed; files without a saved XMP thumbnail remain metadata- or structure-only and should be exported to IDML for full page rendering", "The reader follows declared master-page and object boundaries and never scans arbitrary binary bytes for coincidental image signatures; legacy InDesign 1.x is rejected"];
786
+ readonly capabilities: {
787
+ readonly download: true;
788
+ readonly print: false;
789
+ readonly exportHtml: false;
790
+ readonly zoom: false;
791
+ readonly search: false;
792
+ };
793
+ } | {
794
+ readonly id: "postscript-design";
795
+ readonly label: "Adobe EPS and PostScript";
796
+ readonly category: "asset";
797
+ readonly extensions: readonly ["ps"];
798
+ readonly async: true;
799
+ readonly supportLevel: "experimental";
800
+ readonly status: "experimental";
801
+ readonly packageName: "@file-viewer/renderer-design";
802
+ readonly presets: readonly [];
803
+ readonly enhancesRendererId: "data-asset";
804
+ readonly enhancesExtensions: readonly ["eps"];
805
+ readonly containerVersions: readonly ["EPSF/DSC PostScript", "Adobe PostScript programs"];
806
+ readonly knownLimits: readonly ["Stet WASM renders pages in a terminable Worker with latest-wins interactive requests and bounded source size, VM memory, page count, dimensions, pixels, DPI, total print working set, and retained canvas cache", "The distributed runtime excludes upstream URW Base35 and Ghostscript CMYK ICC assets; Carlito, Tinos, Cousine, and Noto Sans Symbols 2 OFL substitutes plus the PLRM DeviceCMYK formula fallback can differ in metrics and color from Adobe applications", "This experimental path is not claimed to implement every Adobe PostScript Level 3 operator, font technology, color-management workflow, or printer device"];
807
+ readonly capabilities: {
808
+ readonly download: true;
809
+ readonly print: true;
810
+ readonly exportHtml: false;
811
+ readonly zoom: true;
812
+ readonly search: false;
813
+ };
814
+ } | {
815
+ readonly id: "adobe-palette-design";
816
+ readonly label: "Adobe Color Palettes";
817
+ readonly category: "asset";
818
+ readonly extensions: readonly ["ase", "aco"];
819
+ readonly async: true;
820
+ readonly supportLevel: "structured";
821
+ readonly status: "stable";
822
+ readonly packageName: "@file-viewer/renderer-design";
823
+ readonly presets: readonly [];
824
+ readonly containerVersions: readonly ["ASE 1.x", "ACO v1/v2"];
825
+ readonly knownLimits: readonly ["ASE RGB, CMYK, Gray, and CIELAB colors and ACO RGB, HSB, CMYK, CIELAB, and Gray colors are parsed with strict bounds in a terminable module Worker", "Browser swatches convert CIELAB D50 and device CMYK to approximate sRGB; original model values remain visible for reference", "Unknown ASE blocks and bounded ACO trailing application data are skipped and reported rather than executed"];
826
+ readonly capabilities: {
827
+ readonly download: true;
828
+ readonly print: true;
829
+ readonly exportHtml: true;
830
+ readonly zoom: false;
831
+ readonly search: true;
832
+ };
833
+ } | {
834
+ readonly id: "photoshop-resource-design";
835
+ readonly label: "Adobe Photoshop Resources and Presets";
836
+ readonly category: "asset";
837
+ readonly extensions: readonly ["abr", "csh", "pat", "grd", "asl"];
838
+ readonly async: true;
839
+ readonly supportLevel: "structured";
840
+ readonly status: "experimental";
841
+ readonly packageName: "@file-viewer/renderer-design";
842
+ readonly presets: readonly [];
843
+ readonly containerVersions: readonly ["Photoshop ABR 6.x", "Photoshop CSH v2", "PAT v1", "GRD v5", "ASL v2", "ag-psd 31.0.2"];
844
+ readonly knownLimits: readonly ["ABR previews decode saved brush-tip alpha, embedded patterns, and bounded preset metadata; they do not simulate Photoshop's stroke engine, dynamics, or paint blending", "CSH previews reconstruct bounded Bezier path geometry; subtract, intersect, and exclude composition is exposed as metadata rather than claimed as Photoshop-equivalent raster output", "PAT previews decode bounded RGB, grayscale, indexed-color, alpha, Raw, and PackBits pattern tiles; unsupported image modes and compression variants fail closed", "GRD previews render saved solid color stops and deterministic bounded noise samples from v5 descriptors; they do not claim Photoshop's complete interpolation and color-management pipeline", "ASL previews expose bounded layer-effect descriptors, blend metadata, and embedded pattern thumbnails as a structure view; they do not rasterize Photoshop's full effect stack", "Legacy ABR variants before 6.x and unknown CSH container versions are rejected instead of being scanned heuristically"];
845
+ readonly capabilities: {
846
+ readonly download: true;
847
+ readonly print: true;
848
+ readonly exportHtml: false;
849
+ readonly zoom: false;
850
+ readonly search: true;
851
+ };
599
852
  } | {
600
853
  readonly id: "data-asset";
601
854
  readonly label: "Data Asset";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Keep ordinary SVG styles while preventing imports and resource requests.
3
+ * Obfuscated URL tokens fail closed instead of depending on parser quirks.
4
+ */
5
+ export declare const sanitizeFileViewerSvgCss: (value: string) => string;
6
+ /** Remove executable attributes and every SVG resource URL that can load data remotely. */
7
+ export declare const sanitizeFileViewerSvgResources: (root: ParentNode) => void;
8
+ /**
9
+ * Mermaid 11 resolves image-node URLs with `new Image()` while rendering,
10
+ * before its SVG can be sanitized. Reject image metadata and explicit remote
11
+ * URLs before calling Mermaid so an untrusted diagram cannot initiate I/O.
12
+ */
13
+ export declare const assertFileViewerMermaidSourceHasNoExternalResources: (source: string) => void;