@file-viewer/core 2.2.8 → 2.3.0
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/contracts/types.d.ts +80 -4
- package/dist/headless.d.ts +5 -5
- package/dist/headless.js +3 -3
- package/dist/i18n/messages.d.ts +3 -2
- package/dist/i18n/messages.de.d.ts +6 -0
- package/dist/i18n/messages.de.js +455 -0
- package/dist/i18n/messages.ja.js +15 -0
- package/dist/i18n/messages.js +36 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +3 -3
- package/dist/platform/assets.d.ts +16 -2
- package/dist/platform/assets.js +109 -18
- package/dist/registry/capabilities.d.ts +2 -2
- package/dist/registry/formats.d.ts +5 -331
- package/dist/registry/formats.generated.d.ts +613 -0
- package/dist/registry/formats.generated.js +1125 -0
- package/dist/registry/formats.js +10 -224
- package/dist/renderers/index.d.ts +285 -2
- package/dist/rendering/dispatcher.d.ts +9 -0
- package/dist/rendering/dispatcher.js +7 -0
- package/dist/rendering/handler.d.ts +1 -1
- package/dist/rendering/handler.js +35 -2
- package/dist/source/index.d.ts +2 -0
- package/dist/source/index.js +1 -0
- package/dist/source/textEncoding.d.ts +14 -0
- package/dist/source/textEncoding.js +156 -0
- package/dist/viewer/state.js +9 -4
- package/package.json +1 -1
package/dist/registry/formats.js
CHANGED
|
@@ -1,224 +1,10 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
];
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export const TEXT_EXTENSIONS = [
|
|
12
|
-
'txt', 'json', 'js', 'mjs', 'cjs', 'css', 'java', 'py', 'html', 'htm', 'jsx', 'ts',
|
|
13
|
-
'tsx', 'xml', 'log', 'vue', 'yaml', 'yml', 'ini', 'sh', 'bash', 'sql', 'go', 'rs',
|
|
14
|
-
'php', 'c', 'cpp', 'cc', 'h', 'hpp', 'cs', 'diff', 'patch', 'bundle', 'bdl',
|
|
15
|
-
'jsonc', 'json5', 'ipynb', 'toml', 'proto', 'hcl', 'tex', 'gv', 'http', 'react',
|
|
16
|
-
'rb', 'swift', 'kt',
|
|
17
|
-
];
|
|
18
|
-
export const IMAGE_EXTENSIONS = [
|
|
19
|
-
'gif', 'jpg', 'jpeg', 'bmp', 'tiff', 'tif', 'png', 'svg', 'webp', 'avif', 'ico',
|
|
20
|
-
'heic', 'heif', 'jxl',
|
|
21
|
-
];
|
|
22
|
-
export const DEFAULT_RENDERER_DEFINITIONS = [
|
|
23
|
-
{
|
|
24
|
-
id: 'office-word-openxml',
|
|
25
|
-
label: 'Word OpenXML',
|
|
26
|
-
category: 'office',
|
|
27
|
-
extensions: ['docx', 'docm', 'dotx', 'dotm'],
|
|
28
|
-
async: true,
|
|
29
|
-
capabilities: { download: true, print: 'adapter', exportHtml: 'adapter', zoom: 'provider', search: true },
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
id: 'office-word-binary',
|
|
33
|
-
label: 'Word Binary',
|
|
34
|
-
category: 'office',
|
|
35
|
-
extensions: ['doc', 'dot'],
|
|
36
|
-
async: true,
|
|
37
|
-
capabilities: { download: true, print: 'adapter', exportHtml: 'adapter', zoom: 'provider', search: true },
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
id: 'office-presentation-binary',
|
|
41
|
-
label: 'PowerPoint 97–2003',
|
|
42
|
-
category: 'office',
|
|
43
|
-
extensions: ['ppt'],
|
|
44
|
-
async: true,
|
|
45
|
-
capabilities: { download: true, print: 'adapter', exportHtml: 'adapter', zoom: 'provider', search: false },
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
id: 'office-presentation',
|
|
49
|
-
label: 'PowerPoint OpenXML',
|
|
50
|
-
category: 'office',
|
|
51
|
-
extensions: ['pptx', 'pptm', 'potx', 'potm', 'ppsx', 'ppsm'],
|
|
52
|
-
async: true,
|
|
53
|
-
capabilities: { download: true, print: true, exportHtml: true, zoom: 'provider', search: true },
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
id: 'open-document',
|
|
57
|
-
label: 'Open Document',
|
|
58
|
-
category: 'office',
|
|
59
|
-
extensions: ['rtf', 'odt', 'odp'],
|
|
60
|
-
async: true,
|
|
61
|
-
capabilities: { download: true, print: true, exportHtml: true, zoom: 'provider', search: true },
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
id: 'spreadsheet-openxml',
|
|
65
|
-
label: 'Spreadsheet',
|
|
66
|
-
category: 'office',
|
|
67
|
-
extensions: ['xlsx', 'xltx', 'xlsm', 'xlsb', 'xls', 'xlt', 'xltm', 'csv', 'tsv', 'ods', 'fods', 'numbers'],
|
|
68
|
-
async: true,
|
|
69
|
-
capabilities: { download: true, print: false, exportHtml: false, zoom: 'provider', search: true },
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
id: 'pdf',
|
|
73
|
-
label: 'PDF',
|
|
74
|
-
category: 'document',
|
|
75
|
-
extensions: ['pdf'],
|
|
76
|
-
async: true,
|
|
77
|
-
capabilities: { download: true, print: 'adapter', exportHtml: 'adapter', zoom: 'provider', search: 'provider' },
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
id: 'ofd',
|
|
81
|
-
label: 'OFD',
|
|
82
|
-
category: 'document',
|
|
83
|
-
extensions: ['ofd'],
|
|
84
|
-
async: true,
|
|
85
|
-
capabilities: { download: true, print: true, exportHtml: true, zoom: 'provider', search: true },
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
id: 'typst',
|
|
89
|
-
label: 'Typst',
|
|
90
|
-
category: 'document',
|
|
91
|
-
extensions: ['typ', 'typst'],
|
|
92
|
-
async: true,
|
|
93
|
-
capabilities: { download: true, print: 'adapter', exportHtml: 'adapter', zoom: 'provider', search: true },
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
id: 'archive',
|
|
97
|
-
label: 'Archive',
|
|
98
|
-
category: 'archive',
|
|
99
|
-
extensions: ARCHIVE_EXTENSIONS,
|
|
100
|
-
async: true,
|
|
101
|
-
capabilities: { download: true, print: false, exportHtml: false, zoom: false, search: true },
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
id: 'email',
|
|
105
|
-
label: 'Email',
|
|
106
|
-
category: 'email',
|
|
107
|
-
extensions: ['eml', 'msg', 'mbox'],
|
|
108
|
-
async: true,
|
|
109
|
-
capabilities: { download: true, print: false, exportHtml: true, zoom: false, search: true },
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
id: 'eda',
|
|
113
|
-
label: 'EDA',
|
|
114
|
-
category: 'eda',
|
|
115
|
-
extensions: ['olb', 'dra', 'gds', 'oas', 'oasis'],
|
|
116
|
-
async: true,
|
|
117
|
-
capabilities: { download: true, print: true, exportHtml: true, zoom: false, search: true },
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
id: 'cad',
|
|
121
|
-
label: 'CAD',
|
|
122
|
-
category: 'cad',
|
|
123
|
-
extensions: ['dxf', 'dwg', 'dwf', 'dwfx', 'xps'],
|
|
124
|
-
async: true,
|
|
125
|
-
capabilities: { download: true, print: true, exportHtml: true, zoom: 'provider', search: false },
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
id: 'model',
|
|
129
|
-
label: '3D Model',
|
|
130
|
-
category: 'model',
|
|
131
|
-
extensions: MODEL_EXTENSIONS,
|
|
132
|
-
async: true,
|
|
133
|
-
capabilities: { download: true, print: false, exportHtml: false, zoom: 'provider', search: false },
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
id: 'geo',
|
|
137
|
-
label: 'Geospatial',
|
|
138
|
-
category: 'geo',
|
|
139
|
-
extensions: ['geojson', 'kml', 'gpx', 'shp'],
|
|
140
|
-
async: true,
|
|
141
|
-
capabilities: { download: true, print: true, exportHtml: true, zoom: 'provider', search: true },
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
id: 'drawing',
|
|
145
|
-
label: 'Drawing',
|
|
146
|
-
category: 'drawing',
|
|
147
|
-
extensions: ['excalidraw', 'drawio', 'dio', 'mermaid', 'mmd', 'plantuml', 'puml'],
|
|
148
|
-
async: true,
|
|
149
|
-
capabilities: { download: true, print: true, exportHtml: true, zoom: 'provider', search: true },
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
id: 'mindmap',
|
|
153
|
-
label: 'Mind Map',
|
|
154
|
-
category: 'mindmap',
|
|
155
|
-
extensions: ['xmind'],
|
|
156
|
-
async: true,
|
|
157
|
-
capabilities: { download: true, print: true, exportHtml: true, zoom: 'provider', search: true },
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
id: 'epub',
|
|
161
|
-
label: 'EPUB',
|
|
162
|
-
category: 'ebook',
|
|
163
|
-
extensions: ['epub'],
|
|
164
|
-
async: true,
|
|
165
|
-
capabilities: { download: true, print: false, exportHtml: true, zoom: false, search: 'provider' },
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
id: 'umd',
|
|
169
|
-
label: 'UMD',
|
|
170
|
-
category: 'ebook',
|
|
171
|
-
extensions: ['umd'],
|
|
172
|
-
async: true,
|
|
173
|
-
capabilities: { download: true, print: true, exportHtml: true, zoom: 'provider', search: true },
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
id: 'image',
|
|
177
|
-
label: 'Image',
|
|
178
|
-
category: 'image',
|
|
179
|
-
extensions: IMAGE_EXTENSIONS,
|
|
180
|
-
async: true,
|
|
181
|
-
capabilities: { download: true, print: true, exportHtml: true, zoom: 'provider', search: false },
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
id: 'markdown',
|
|
185
|
-
label: 'Markdown',
|
|
186
|
-
category: 'markdown',
|
|
187
|
-
extensions: ['md', 'markdown'],
|
|
188
|
-
async: true,
|
|
189
|
-
capabilities: { download: true, print: true, exportHtml: true, zoom: false, search: true },
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
id: 'code',
|
|
193
|
-
label: 'Code and Text',
|
|
194
|
-
category: 'code',
|
|
195
|
-
extensions: TEXT_EXTENSIONS,
|
|
196
|
-
async: true,
|
|
197
|
-
capabilities: { download: true, print: true, exportHtml: true, zoom: false, search: true },
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
id: 'video',
|
|
201
|
-
label: 'Video',
|
|
202
|
-
category: 'media',
|
|
203
|
-
extensions: ['mp4', 'webm', 'm3u8'],
|
|
204
|
-
async: true,
|
|
205
|
-
capabilities: { download: true, print: false, exportHtml: false, zoom: false, search: false },
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
id: 'audio',
|
|
209
|
-
label: 'Audio',
|
|
210
|
-
category: 'media',
|
|
211
|
-
extensions: ['mp3', 'mpeg', 'wav', 'ogg', 'oga', 'opus', 'm4a', 'aac', 'flac', 'weba', 'midi', 'mid'],
|
|
212
|
-
async: true,
|
|
213
|
-
capabilities: { download: true, print: false, exportHtml: false, zoom: false, search: false },
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
id: 'data-asset',
|
|
217
|
-
label: 'Data Asset',
|
|
218
|
-
category: 'asset',
|
|
219
|
-
extensions: ['ttf', 'otf', 'woff', 'woff2', 'psd', 'ai', 'eps', 'sqlite', 'wasm', 'parquet', 'avro', 'webarchive'],
|
|
220
|
-
async: true,
|
|
221
|
-
capabilities: { download: true, print: false, exportHtml: true, zoom: false, search: true },
|
|
222
|
-
},
|
|
223
|
-
];
|
|
224
|
-
export const DEFAULT_SUPPORTED_EXTENSIONS = Object.freeze(Array.from(new Set(DEFAULT_RENDERER_DEFINITIONS.flatMap(definition => definition.extensions))).sort());
|
|
1
|
+
export { DEFAULT_REGISTERED_EXTENSIONS, DEFAULT_RENDERER_DEFINITIONS, DEFAULT_STABLE_SUPPORTED_EXTENSIONS, DEFAULT_SUPPORTED_EXTENSIONS, } from './formats.generated.js';
|
|
2
|
+
import { DEFAULT_RENDERER_DEFINITIONS } from './formats.generated.js';
|
|
3
|
+
const extensionsFor = (rendererId) => {
|
|
4
|
+
var _a, _b;
|
|
5
|
+
return Object.freeze([...((_b = (_a = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === rendererId)) === null || _a === void 0 ? void 0 : _a.extensions) !== null && _b !== void 0 ? _b : [])]);
|
|
6
|
+
};
|
|
7
|
+
export const ARCHIVE_EXTENSIONS = extensionsFor('archive');
|
|
8
|
+
export const MODEL_EXTENSIONS = extensionsFor('model');
|
|
9
|
+
export const TEXT_EXTENSIONS = extensionsFor('code');
|
|
10
|
+
export const IMAGE_EXTENSIONS = extensionsFor('image');
|