@arbidocs/coedit 0.5.21 → 0.5.22
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 +54 -56
- package/dist/encoding.cjs.map +1 -1
- package/dist/encoding.d.cts +50 -14
- package/dist/encoding.d.ts +50 -14
- package/dist/encoding.js +54 -57
- package/dist/encoding.js.map +1 -1
- package/dist/hocuspocus.cjs +211 -109
- package/dist/hocuspocus.cjs.map +1 -1
- package/dist/hocuspocus.js +211 -109
- package/dist/hocuspocus.js.map +1 -1
- package/dist/index.cjs +210 -108
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +210 -108
- package/dist/index.js.map +1 -1
- package/dist/server.cjs +214 -112
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +214 -112
- package/dist/server.js.map +1 -1
- package/dist/template.cjs +3 -2
- package/dist/template.cjs.map +1 -1
- package/dist/template.d.cts +5 -0
- package/dist/template.d.ts +5 -0
- package/dist/template.js +3 -2
- package/dist/template.js.map +1 -1
- package/dist/{versions-DXiFQMA6.d.cts → versions-XSYTVmOU.d.cts} +1 -1
- package/dist/{versions-DXiFQMA6.d.ts → versions-XSYTVmOU.d.ts} +1 -1
- package/package.json +1 -1
package/dist/template.d.cts
CHANGED
|
@@ -23,6 +23,11 @@ declare function applyTemplate(document: Uint8Array, template: Uint8Array, optio
|
|
|
23
23
|
* File › New from a template: the template package as a new document. A .dotx/.dotm main part
|
|
24
24
|
* becomes a document part (macros are not carried), the glossary stays behind, and the template
|
|
25
25
|
* is recorded as attached.
|
|
26
|
+
*
|
|
27
|
+
* Word 2010's `stylesWithEffects.xml`, a second copy of the style definitions that Word 2013 and
|
|
28
|
+
* later neither read nor write, stays behind too: the new document's styles are `styles.xml`
|
|
29
|
+
* alone, and a template saved by python-docx does not put hundreds of kilobytes of duplicate
|
|
30
|
+
* styles into every new note.
|
|
26
31
|
*/
|
|
27
32
|
declare function newFromTemplate(template: Uint8Array, options?: {
|
|
28
33
|
attachedTemplate?: string;
|
package/dist/template.d.ts
CHANGED
|
@@ -23,6 +23,11 @@ declare function applyTemplate(document: Uint8Array, template: Uint8Array, optio
|
|
|
23
23
|
* File › New from a template: the template package as a new document. A .dotx/.dotm main part
|
|
24
24
|
* becomes a document part (macros are not carried), the glossary stays behind, and the template
|
|
25
25
|
* is recorded as attached.
|
|
26
|
+
*
|
|
27
|
+
* Word 2010's `stylesWithEffects.xml`, a second copy of the style definitions that Word 2013 and
|
|
28
|
+
* later neither read nor write, stays behind too: the new document's styles are `styles.xml`
|
|
29
|
+
* alone, and a template saved by python-docx does not put hundreds of kilobytes of duplicate
|
|
30
|
+
* styles into every new note.
|
|
26
31
|
*/
|
|
27
32
|
declare function newFromTemplate(template: Uint8Array, options?: {
|
|
28
33
|
attachedTemplate?: string;
|
package/dist/template.js
CHANGED
|
@@ -697,7 +697,8 @@ function newFromTemplate(template, options = {}) {
|
|
|
697
697
|
const main = pkg.main;
|
|
698
698
|
pkg.setContentType(main, CT.document);
|
|
699
699
|
const rels = pkg.rels(main);
|
|
700
|
-
|
|
700
|
+
const left = (type) => type === RT.glossary || /vbaProject$/.test(type) || /\/stylesWithEffects$/.test(type);
|
|
701
|
+
for (const rel of rels.filter((r) => left(r.type))) {
|
|
701
702
|
const target = pkg.find(pkg.target(main, rel));
|
|
702
703
|
if (target) {
|
|
703
704
|
for (const sub of pkg.rels(target)) if (!sub.external) pkg.remove(pkg.target(target, sub));
|
|
@@ -706,7 +707,7 @@ function newFromTemplate(template, options = {}) {
|
|
|
706
707
|
}
|
|
707
708
|
pkg.setRels(
|
|
708
709
|
main,
|
|
709
|
-
rels.filter((r) =>
|
|
710
|
+
rels.filter((r) => !left(r.type))
|
|
710
711
|
);
|
|
711
712
|
if (options.attachedTemplate) {
|
|
712
713
|
const { part, root } = settingsOf(pkg);
|