@arbidocs/coedit 0.4.98 → 0.4.100
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/encoding.cjs +25 -5
- package/dist/encoding.cjs.map +1 -1
- package/dist/encoding.js +25 -5
- package/dist/encoding.js.map +1 -1
- package/dist/hocuspocus.cjs +25 -5
- package/dist/hocuspocus.cjs.map +1 -1
- package/dist/hocuspocus.js +25 -5
- package/dist/hocuspocus.js.map +1 -1
- package/dist/index.cjs +25 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -5
- package/dist/index.js.map +1 -1
- package/dist/server.cjs +25 -5
- package/dist/server.cjs.map +1 -1
- package/dist/server.js +25 -5
- package/dist/server.js.map +1 -1
- package/dist/template.cjs +54 -0
- package/dist/template.cjs.map +1 -1
- package/dist/template.d.cts +17 -1
- package/dist/template.d.ts +17 -1
- package/dist/template.js +54 -1
- package/dist/template.js.map +1 -1
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -666,19 +666,39 @@ function materialize(doc, cache, changed = null) {
|
|
|
666
666
|
mainDocumentPart: main
|
|
667
667
|
});
|
|
668
668
|
}
|
|
669
|
+
var MEDIA_TYPES = {
|
|
670
|
+
png: "image/png",
|
|
671
|
+
jpg: "image/jpeg",
|
|
672
|
+
jpeg: "image/jpeg",
|
|
673
|
+
gif: "image/gif",
|
|
674
|
+
bmp: "image/bmp",
|
|
675
|
+
tif: "image/tiff",
|
|
676
|
+
tiff: "image/tiff",
|
|
677
|
+
webp: "image/webp",
|
|
678
|
+
svg: "image/svg+xml",
|
|
679
|
+
emf: "image/x-emf",
|
|
680
|
+
wmf: "image/x-wmf"
|
|
681
|
+
};
|
|
669
682
|
function withMirroredOverrides(pkg) {
|
|
670
683
|
const bytes = contentTypesPartBytes(pkg);
|
|
671
684
|
if (!bytes) return pkg;
|
|
685
|
+
const xml = new TextDecoder().decode(bytes.bytes);
|
|
672
686
|
const declared = new Set(
|
|
673
|
-
[...
|
|
674
|
-
|
|
675
|
-
|
|
687
|
+
[...xml.matchAll(/PartName\s*=\s*["']([^"']+)["']/gi)].map((m) => m[1].toLowerCase())
|
|
688
|
+
);
|
|
689
|
+
const defaults = new Set(
|
|
690
|
+
[...xml.matchAll(/Extension\s*=\s*["']([^"']+)["']/gi)].map((m) => m[1].toLowerCase())
|
|
676
691
|
);
|
|
677
692
|
let next = pkg;
|
|
678
693
|
for (const name of [...pkg.parts.keys(), ...pkg.partBytes.keys()]) {
|
|
679
|
-
const
|
|
680
|
-
if (
|
|
694
|
+
const key = name.toLowerCase();
|
|
695
|
+
if (declared.has(key) || key === bytes.storageKey.toLowerCase()) continue;
|
|
696
|
+
const extension = key.slice(key.lastIndexOf(".") + 1);
|
|
697
|
+
const type = pkg.contentTypes.overrides.get(key) ?? (defaults.has(extension) ? void 0 : MEDIA_TYPES[extension]);
|
|
698
|
+
if (type) {
|
|
681
699
|
next = withContentTypeOverride(next, name, type, { forceOverride: true });
|
|
700
|
+
declared.add(key);
|
|
701
|
+
}
|
|
682
702
|
}
|
|
683
703
|
return next;
|
|
684
704
|
}
|