@docx4j/core-ts 0.1.4 → 0.2.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.
Files changed (48) hide show
  1. package/README.md +76 -0
  2. package/dist/model/content/Body.d.mts +36 -2
  3. package/dist/model/content/Body.mjs +79 -4
  4. package/dist/model/content/Comment.d.mts +15 -5
  5. package/dist/model/content/Comment.mjs +70 -22
  6. package/dist/model/content/List.d.mts +80 -1
  7. package/dist/model/content/List.mjs +140 -22
  8. package/dist/model/content/Paragraph.d.mts +11 -1
  9. package/dist/model/content/Paragraph.mjs +18 -7
  10. package/dist/model/content/Range.d.mts +29 -2
  11. package/dist/model/content/Range.mjs +137 -7
  12. package/dist/model/content/binder.d.mts +44 -0
  13. package/dist/model/content/binder.mjs +95 -0
  14. package/dist/model/content/comments.d.mts +19 -1
  15. package/dist/model/content/index.d.mts +6 -4
  16. package/dist/model/content/index.mjs +4 -2
  17. package/dist/model/content/search.d.mts +27 -2
  18. package/dist/model/content/search.mjs +59 -3
  19. package/dist/model/content/stylesFacade.d.mts +37 -0
  20. package/dist/model/content/stylesFacade.mjs +114 -0
  21. package/dist/model/content/tracking.d.mts +57 -2
  22. package/dist/model/content/tracking.mjs +47 -15
  23. package/dist/model/customxml/CustomXmlPartCollection.d.mts +7 -0
  24. package/dist/model/customxml/CustomXmlPartCollection.mjs +40 -6
  25. package/dist/model/customxml/xpath.d.mts +18 -3
  26. package/dist/model/customxml/xpath.mjs +18 -3
  27. package/dist/office-js/index.d.mts +3 -1
  28. package/dist/office-js/run.d.mts +12 -2
  29. package/dist/office-js/run.mjs +8 -1
  30. package/dist/office-js/shimmed.d.mts +46 -0
  31. package/dist/office-js/shimmed.mjs +1 -0
  32. package/dist/office-js/supported.generated.mjs +1 -0
  33. package/dist/opc/exceptions.d.mts +25 -0
  34. package/dist/opc/exceptions.mjs +20 -0
  35. package/dist/opc/index.d.mts +1 -1
  36. package/dist/opc/index.mjs +1 -1
  37. package/dist/opc/mce/understood.mjs +37 -8
  38. package/dist/packages/WordprocessingMLPackage.d.mts +101 -2
  39. package/dist/packages/WordprocessingMLPackage.mjs +155 -1
  40. package/dist/parts/XmlPart.d.mts +44 -0
  41. package/dist/parts/XmlPart.mjs +86 -3
  42. package/dist/parts/sml/index.d.mts +9 -8
  43. package/dist/parts/sml/index.mjs +23 -19
  44. package/dist/parts/wml/index.d.mts +10 -2
  45. package/dist/parts/wml/index.mjs +11 -3
  46. package/dist/parts/wml/spliceableStyles.d.mts +1 -0
  47. package/dist/parts/wml/spliceableStyles.mjs +122 -0
  48. package/package.json +2 -2
@@ -0,0 +1,122 @@
1
+ // The style definitions docx4j's own `styles.xml` carries but leaves **commented out**, so that
2
+ // `createPackage()` - which writes that file verbatim (`DEFAULT_STYLES_XML`, generated, faithful to
3
+ // docx4j) - produces a document without them. `pkg.styles.ensure(ids)` splices them in when a caller
4
+ // needs one: inserting a footnote into such a document otherwise shows the note in Normal
5
+ // (CR-002 section 22.2).
6
+ //
7
+ // Taken verbatim from the two comments in
8
+ // docx4j-core/src/main/resources/org/docx4j/openpackaging/parts/WordprocessingML/styles.xml
9
+ // (a UTF-16 file; docx4j VERSION_17_3_0), which is where Word's own definitions of these came from.
10
+ // 9 styles: BlockText, EndnoteText, EndnoteTextChar, Footer, FooterChar, FootnoteText, FootnoteTextChar, FootnoteReference, EndnoteReference.
11
+ export const SPLICEABLE_STYLES_XML = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
12
+ <w:styles xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
13
+ <w:style w:type="paragraph" w:styleId="BlockText">
14
+ <w:name w:val="Block Text" />
15
+ <w:basedOn w:val="Normal" />
16
+ <w:uiPriority w:val="99" />
17
+ <w:unhideWhenUsed />
18
+ <w:rsid w:val="00841CD9" />
19
+ <w:pPr>
20
+ <w:pBdr>
21
+ <w:top w:val="single" w:sz="2" w:space="10" w:color="4F81BD" w:themeColor="accent1" w:shadow="1" />
22
+ <w:left w:val="single" w:sz="2" w:space="10" w:color="4F81BD" w:themeColor="accent1" w:shadow="1" />
23
+ <w:bottom w:val="single" w:sz="2" w:space="10" w:color="4F81BD" w:themeColor="accent1" w:shadow="1" />
24
+ <w:right w:val="single" w:sz="2" w:space="10" w:color="4F81BD" w:themeColor="accent1" w:shadow="1" />
25
+ </w:pBdr>
26
+ <w:ind w:left="1152" w:right="1152" />
27
+ </w:pPr>
28
+ <w:rPr>
29
+ <w:rFonts w:eastAsiaTheme="minorEastAsia" />
30
+ <w:i />
31
+ <w:iCs />
32
+ <w:color w:val="4F81BD" w:themeColor="accent1" />
33
+ </w:rPr>
34
+ </w:style>
35
+ <w:style w:type="paragraph" w:styleId="EndnoteText">
36
+ <w:name w:val="endnote text" />
37
+ <w:basedOn w:val="Normal" />
38
+ <w:link w:val="EndnoteTextChar" />
39
+ <w:uiPriority w:val="99" />
40
+ <w:unhideWhenUsed />
41
+ <w:rsid w:val="00841CD9" />
42
+ <w:rPr>
43
+ <w:sz w:val="20" />
44
+ <w:szCs w:val="20" />
45
+ </w:rPr>
46
+ </w:style>
47
+ <w:style w:type="character" w:customStyle="1" w:styleId="EndnoteTextChar">
48
+ <w:name w:val="Endnote Text Char" />
49
+ <w:basedOn w:val="DefaultParagraphFont" />
50
+ <w:link w:val="EndnoteText" />
51
+ <w:uiPriority w:val="99" />
52
+ <w:rsid w:val="00841CD9" />
53
+ <w:rPr>
54
+ <w:sz w:val="20" />
55
+ <w:szCs w:val="20" />
56
+ </w:rPr>
57
+ </w:style>
58
+ <w:style w:type="paragraph" w:styleId="Footer">
59
+ <w:name w:val="footer" />
60
+ <w:basedOn w:val="Normal" />
61
+ <w:link w:val="FooterChar" />
62
+ <w:uiPriority w:val="99" />
63
+ <w:unhideWhenUsed />
64
+ <w:rsid w:val="00841CD9" />
65
+ <w:pPr>
66
+ <w:tabs>
67
+ <w:tab w:val="center" w:pos="4680" />
68
+ <w:tab w:val="right" w:pos="9360" />
69
+ </w:tabs>
70
+ </w:pPr>
71
+ </w:style>
72
+ <w:style w:type="character" w:customStyle="1" w:styleId="FooterChar">
73
+ <w:name w:val="Footer Char" />
74
+ <w:basedOn w:val="DefaultParagraphFont" />
75
+ <w:link w:val="Footer" />
76
+ <w:uiPriority w:val="99" />
77
+ <w:rsid w:val="00841CD9" />
78
+ </w:style>
79
+ <w:style w:type="paragraph" w:styleId="FootnoteText">
80
+ <w:name w:val="footnote text" />
81
+ <w:basedOn w:val="Normal" />
82
+ <w:link w:val="FootnoteTextChar" />
83
+ <w:uiPriority w:val="99" />
84
+ <w:unhideWhenUsed />
85
+ <w:rsid w:val="00841CD9" />
86
+ <w:rPr>
87
+ <w:sz w:val="20" />
88
+ <w:szCs w:val="20" />
89
+ </w:rPr>
90
+ </w:style>
91
+ <w:style w:type="character" w:customStyle="1" w:styleId="FootnoteTextChar">
92
+ <w:name w:val="Footnote Text Char" />
93
+ <w:basedOn w:val="DefaultParagraphFont" />
94
+ <w:link w:val="FootnoteText" />
95
+ <w:uiPriority w:val="99" />
96
+ <w:rsid w:val="00841CD9" />
97
+ <w:rPr>
98
+ <w:sz w:val="20" />
99
+ <w:szCs w:val="20" />
100
+ </w:rPr>
101
+ </w:style>
102
+ <w:style w:type="character" w:styleId="FootnoteReference">
103
+ <w:name w:val="footnote reference" />
104
+ <w:basedOn w:val="DefaultParagraphFont" />
105
+ <w:uiPriority w:val="99" />
106
+ <w:unhideWhenUsed />
107
+ <w:rsid w:val="00D1197D" />
108
+ <w:rPr>
109
+ <w:vertAlign w:val="superscript" />
110
+ </w:rPr>
111
+ </w:style>
112
+ <w:style w:type="character" w:styleId="EndnoteReference">
113
+ <w:name w:val="endnote reference" />
114
+ <w:basedOn w:val="DefaultParagraphFont" />
115
+ <w:uiPriority w:val="99" />
116
+ <w:unhideWhenUsed />
117
+ <w:rsid w:val="00D1197D" />
118
+ <w:rPr>
119
+ <w:vertAlign w:val="superscript" />
120
+ </w:rPr>
121
+ </w:style>
122
+ </w:styles>`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docx4j/core-ts",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "description": "docx4j-core for TypeScript: Open Packaging (docx/pptx/xlsx zip and flat OPC), typed parts and relationships, style, numbering and font resolution over @docx4j/generated-objects-ts. Node, browsers, Word add-ins.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -79,7 +79,7 @@
79
79
  },
80
80
  "license": "Apache-2.0",
81
81
  "dependencies": {
82
- "@docx4j/generated-objects-ts": "^0.2.0",
82
+ "@docx4j/generated-objects-ts": "^0.3.0",
83
83
  "fflate": "^0.8.2"
84
84
  },
85
85
  "devDependencies": {