@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/index.cjs
CHANGED
|
@@ -614,19 +614,39 @@ function materialize(doc, cache, changed = null) {
|
|
|
614
614
|
mainDocumentPart: main
|
|
615
615
|
});
|
|
616
616
|
}
|
|
617
|
+
var MEDIA_TYPES = {
|
|
618
|
+
png: "image/png",
|
|
619
|
+
jpg: "image/jpeg",
|
|
620
|
+
jpeg: "image/jpeg",
|
|
621
|
+
gif: "image/gif",
|
|
622
|
+
bmp: "image/bmp",
|
|
623
|
+
tif: "image/tiff",
|
|
624
|
+
tiff: "image/tiff",
|
|
625
|
+
webp: "image/webp",
|
|
626
|
+
svg: "image/svg+xml",
|
|
627
|
+
emf: "image/x-emf",
|
|
628
|
+
wmf: "image/x-wmf"
|
|
629
|
+
};
|
|
617
630
|
function withMirroredOverrides(pkg) {
|
|
618
631
|
const bytes = store.contentTypesPartBytes(pkg);
|
|
619
632
|
if (!bytes) return pkg;
|
|
633
|
+
const xml = new TextDecoder().decode(bytes.bytes);
|
|
620
634
|
const declared = new Set(
|
|
621
|
-
[...
|
|
622
|
-
|
|
623
|
-
|
|
635
|
+
[...xml.matchAll(/PartName\s*=\s*["']([^"']+)["']/gi)].map((m) => m[1].toLowerCase())
|
|
636
|
+
);
|
|
637
|
+
const defaults = new Set(
|
|
638
|
+
[...xml.matchAll(/Extension\s*=\s*["']([^"']+)["']/gi)].map((m) => m[1].toLowerCase())
|
|
624
639
|
);
|
|
625
640
|
let next = pkg;
|
|
626
641
|
for (const name of [...pkg.parts.keys(), ...pkg.partBytes.keys()]) {
|
|
627
|
-
const
|
|
628
|
-
if (
|
|
642
|
+
const key = name.toLowerCase();
|
|
643
|
+
if (declared.has(key) || key === bytes.storageKey.toLowerCase()) continue;
|
|
644
|
+
const extension = key.slice(key.lastIndexOf(".") + 1);
|
|
645
|
+
const type = pkg.contentTypes.overrides.get(key) ?? (defaults.has(extension) ? void 0 : MEDIA_TYPES[extension]);
|
|
646
|
+
if (type) {
|
|
629
647
|
next = store.withContentTypeOverride(next, name, type, { forceOverride: true });
|
|
648
|
+
declared.add(key);
|
|
649
|
+
}
|
|
630
650
|
}
|
|
631
651
|
return next;
|
|
632
652
|
}
|