abstract-document 6.9.5 → 6.10.3

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 (227) hide show
  1. package/CHANGELOG.md +12 -1
  2. package/README.md +2 -2
  3. package/lib/abstract-document/table/text-row.d.ts +1 -0
  4. package/lib/abstract-document/table/text-row.d.ts.map +1 -0
  5. package/lib/abstract-document/table/text-row.js +1 -0
  6. package/lib/abstract-document/table/text-row.js.map +1 -0
  7. package/lib/abstract-document-xml/__tests__/export-test-def.d.ts +13 -0
  8. package/lib/abstract-document-xml/__tests__/export-test-def.d.ts.map +1 -0
  9. package/lib/abstract-document-xml/__tests__/export-test-def.js +3 -0
  10. package/lib/abstract-document-xml/__tests__/export-test-def.js.map +1 -0
  11. package/lib/abstract-document-xml/__tests__/export.test.d.ts +3 -0
  12. package/lib/abstract-document-xml/__tests__/export.test.d.ts.map +1 -0
  13. package/lib/abstract-document-xml/__tests__/export.test.js +41 -0
  14. package/lib/abstract-document-xml/__tests__/export.test.js.map +1 -0
  15. package/lib/abstract-document-xml/__tests__/layer/export-test-def.d.ts +13 -0
  16. package/lib/abstract-document-xml/__tests__/layer/export-test-def.d.ts.map +1 -0
  17. package/lib/abstract-document-xml/__tests__/layer/export-test-def.js +3 -0
  18. package/lib/abstract-document-xml/__tests__/layer/export-test-def.js.map +1 -0
  19. package/lib/abstract-document-xml/__tests__/layer/export.test.d.ts +3 -0
  20. package/lib/abstract-document-xml/__tests__/layer/export.test.d.ts.map +1 -0
  21. package/lib/abstract-document-xml/__tests__/layer/export.test.js +41 -0
  22. package/lib/abstract-document-xml/__tests__/layer/export.test.js.map +1 -0
  23. package/lib/abstract-document-xml/__tests__/layer/test-defs/simple-document.d.ts +3 -0
  24. package/lib/abstract-document-xml/__tests__/layer/test-defs/simple-document.d.ts.map +1 -0
  25. package/lib/abstract-document-xml/__tests__/layer/test-defs/simple-document.js +361 -0
  26. package/lib/abstract-document-xml/__tests__/layer/test-defs/simple-document.js.map +1 -0
  27. package/lib/abstract-document-xml/__tests__/test-defs/simple-document.d.ts +3 -0
  28. package/lib/abstract-document-xml/__tests__/test-defs/simple-document.d.ts.map +1 -0
  29. package/lib/abstract-document-xml/__tests__/test-defs/simple-document.js +198 -0
  30. package/lib/abstract-document-xml/__tests__/test-defs/simple-document.js.map +1 -0
  31. package/lib/abstract-document-xml/abstract-doc-of-xml/abstract-doc-of-xml.d.ts +5 -0
  32. package/lib/abstract-document-xml/abstract-doc-of-xml/abstract-doc-of-xml.d.ts.map +1 -0
  33. package/lib/abstract-document-xml/abstract-doc-of-xml/abstract-doc-of-xml.js +94 -0
  34. package/lib/abstract-document-xml/abstract-doc-of-xml/abstract-doc-of-xml.js.map +1 -0
  35. package/lib/abstract-document-xml/abstract-doc-of-xml/creator.d.ts +14 -0
  36. package/lib/abstract-document-xml/abstract-doc-of-xml/creator.d.ts.map +1 -0
  37. package/lib/abstract-document-xml/abstract-doc-of-xml/creator.js +218 -0
  38. package/lib/abstract-document-xml/abstract-doc-of-xml/creator.js.map +1 -0
  39. package/lib/abstract-document-xml/abstract-doc-of-xml/custom-elements.d.ts +38 -0
  40. package/lib/abstract-document-xml/abstract-doc-of-xml/custom-elements.d.ts.map +1 -0
  41. package/lib/abstract-document-xml/abstract-doc-of-xml/custom-elements.js +59 -0
  42. package/lib/abstract-document-xml/abstract-doc-of-xml/custom-elements.js.map +1 -0
  43. package/lib/abstract-document-xml/abstract-doc-of-xml/index.d.ts +3 -0
  44. package/lib/abstract-document-xml/abstract-doc-of-xml/index.d.ts.map +1 -0
  45. package/lib/abstract-document-xml/abstract-doc-of-xml/index.js +17 -0
  46. package/lib/abstract-document-xml/abstract-doc-of-xml/index.js.map +1 -0
  47. package/lib/abstract-document-xml/index.d.ts +4 -0
  48. package/lib/abstract-document-xml/index.d.ts.map +1 -0
  49. package/lib/abstract-document-xml/index.js +16 -0
  50. package/lib/abstract-document-xml/index.js.map +1 -0
  51. package/lib/abstract-document-xml/parse-xml/index.d.ts +3 -0
  52. package/lib/abstract-document-xml/parse-xml/index.d.ts.map +1 -0
  53. package/lib/abstract-document-xml/parse-xml/index.js +15 -0
  54. package/lib/abstract-document-xml/parse-xml/index.js.map +1 -0
  55. package/lib/abstract-document-xml/parse-xml/parse-xml.d.ts +12 -0
  56. package/lib/abstract-document-xml/parse-xml/parse-xml.d.ts.map +1 -0
  57. package/lib/abstract-document-xml/parse-xml/parse-xml.js +83 -0
  58. package/lib/abstract-document-xml/parse-xml/parse-xml.js.map +1 -0
  59. package/lib/abstract-document-xml/parse-xml/validation.d.ts +21 -0
  60. package/lib/abstract-document-xml/parse-xml/validation.d.ts.map +1 -0
  61. package/lib/abstract-document-xml/parse-xml/validation.js +205 -0
  62. package/lib/abstract-document-xml/parse-xml/validation.js.map +1 -0
  63. package/lib/abstract-document-xml/xsd-template/custom-elements.d.ts +7 -0
  64. package/lib/abstract-document-xml/xsd-template/custom-elements.d.ts.map +1 -0
  65. package/lib/abstract-document-xml/xsd-template/custom-elements.js +57 -0
  66. package/lib/abstract-document-xml/xsd-template/custom-elements.js.map +1 -0
  67. package/lib/abstract-document-xml/xsd-template/elements.d.ts +19 -0
  68. package/lib/abstract-document-xml/xsd-template/elements.d.ts.map +1 -0
  69. package/lib/abstract-document-xml/xsd-template/elements.js +187 -0
  70. package/lib/abstract-document-xml/xsd-template/elements.js.map +1 -0
  71. package/lib/abstract-document-xml/xsd-template/index.d.ts +2 -0
  72. package/lib/abstract-document-xml/xsd-template/index.d.ts.map +1 -0
  73. package/lib/abstract-document-xml/xsd-template/index.js +14 -0
  74. package/lib/abstract-document-xml/xsd-template/index.js.map +1 -0
  75. package/lib/abstract-document-xml/xsd-template/styles.d.ts +11 -0
  76. package/lib/abstract-document-xml/xsd-template/styles.d.ts.map +1 -0
  77. package/lib/abstract-document-xml/xsd-template/styles.js +279 -0
  78. package/lib/abstract-document-xml/xsd-template/styles.js.map +1 -0
  79. package/lib/abstract-document-xml/xsd-template/xsd-template.d.ts +3 -0
  80. package/lib/abstract-document-xml/xsd-template/xsd-template.d.ts.map +1 -0
  81. package/lib/abstract-document-xml/xsd-template/xsd-template.js +71 -0
  82. package/lib/abstract-document-xml/xsd-template/xsd-template.js.map +1 -0
  83. package/lib/index.d.ts +2 -1
  84. package/lib/index.d.ts.map +1 -1
  85. package/lib/index.js +3 -1
  86. package/lib/index.js.map +1 -1
  87. package/package.json +4 -3
  88. package/src/abstract-document/table/text-row.ts +0 -0
  89. package/src/abstract-document-exporters/__tests__/docx2/tmp/Group.docx +0 -0
  90. package/src/abstract-document-exporters/__tests__/docx2/tmp/Header and footer.docx and b/package/src/abstract-document-exporters/__tests__/docx2/tmp/Header → footer.docx +0 -0
  91. package/src/abstract-document-exporters/__tests__/docx2/tmp/Mixed hyperlink and textrun.docx and b/package/src/abstract-document-exporters/__tests__/docx2/tmp/Mixed hyperlink → textrun.docx +0 -0
  92. package/src/abstract-document-exporters/__tests__/docx2/tmp/Mixed textrun and images.docx and b/package/src/abstract-document-exporters/__tests__/docx2/tmp/Mixed textrun → images.docx +0 -0
  93. package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple images.docx +0 -0
  94. package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple tables.docx +0 -0
  95. package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with Center alignment.docx +0 -0
  96. package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with End alignment.docx +0 -0
  97. package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with Start alignment that linebreaks.docx +0 -0
  98. package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with Start alignment.docx +0 -0
  99. package/src/abstract-document-exporters/__tests__/docx2/tmp/Page numbering.docx +0 -0
  100. package/src/abstract-document-exporters/__tests__/docx2/tmp/Simple table colSpan and rowSpan.docx and b/package/src/abstract-document-exporters/__tests__/docx2/tmp/Simple table colSpan → rowSpan.docx +0 -0
  101. package/src/abstract-document-exporters/__tests__/docx2/tmp/Simple table without rows.docx +0 -0
  102. package/src/abstract-document-exporters/__tests__/docx2/tmp/Simple table.docx +0 -0
  103. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single hyperlink.docx +0 -0
  104. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single image.docx +0 -0
  105. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Center alignment that linebreaks.docx +0 -0
  106. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Center alignment.docx +0 -0
  107. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with End alignment that linebreaks.docx +0 -0
  108. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with End alignment.docx +0 -0
  109. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Start alignment that linebreaks.docx +0 -0
  110. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Start alignment.docx +0 -0
  111. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun.docx +0 -0
  112. package/src/abstract-document-exporters/__tests__/docx2/tmp/hello with Arial font.docx +0 -0
  113. package/src/abstract-document-exporters/__tests__/docx2/tmp/hello.docx +0 -0
  114. package/src/abstract-document-exporters/__tests__/docx2/tmp/letter-dimensions.docx +0 -0
  115. package/src/abstract-document-exporters/__tests__/docx2/tmp/page-orientation-landscape.docx +0 -0
  116. package/src/abstract-document-exporters/__tests__/docx2/tmp/page-orientation-portrait.docx +0 -0
  117. package/src/abstract-document-exporters/__tests__/docx2/tmp/tocSeparator.docx +0 -0
  118. package/src/abstract-document-exporters/__tests__/docx2/tmp/world.docx +0 -0
  119. package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position group.pdf +2 -2
  120. package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position header and footer.pdf +2 -2
  121. package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position paragraph.pdf +2 -2
  122. package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position section in group.pdf +2 -2
  123. package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position section in table.pdf +2 -2
  124. package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position table.pdf +2 -2
  125. package/src/abstract-document-exporters/__tests__/pdf/tmp/Group Paragraphs.pdf +2 -2
  126. package/src/abstract-document-exporters/__tests__/pdf/tmp/Group Tables.pdf +2 -2
  127. package/src/abstract-document-exporters/__tests__/pdf/tmp/Group no keeptogether.pdf +2 -2
  128. package/src/abstract-document-exporters/__tests__/pdf/tmp/Group too big for one page.pdf +2 -2
  129. package/src/abstract-document-exporters/__tests__/pdf/tmp/Header and footer.pdf +2 -2
  130. package/src/abstract-document-exporters/__tests__/pdf/tmp/Hyperlink internal linktarget.pdf +2 -2
  131. package/src/abstract-document-exporters/__tests__/pdf/tmp/Hyperlink internal.pdf +2 -2
  132. package/src/abstract-document-exporters/__tests__/pdf/tmp/Margins header body footer.pdf +2 -2
  133. package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed hyperlink and textrun no underline.pdf +2 -2
  134. package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed hyperlink and textrun with underline.pdf +2 -2
  135. package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed hyperlink and textrun.pdf +2 -2
  136. package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed textrun and images.pdf and b/package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed textrun → images.pdf +0 -0
  137. package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple images overflow.pdf +0 -0
  138. package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple images.pdf +0 -0
  139. package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with Center alignment.pdf +2 -2
  140. package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with End alignment.pdf +2 -2
  141. package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with Start alignment that linebreaks.pdf +2 -2
  142. package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with Start alignment.pdf +2 -2
  143. package/src/abstract-document-exporters/__tests__/pdf/tmp/Page numbering.pdf +2 -2
  144. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table row that doesnt fit page.pdf +2 -2
  145. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table single row.pdf +2 -2
  146. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with group.pdf +2 -2
  147. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with header 2.pdf +2 -2
  148. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with header.pdf +2 -2
  149. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with margin bottom.pdf +2 -2
  150. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with margin top single table.pdf +2 -2
  151. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with margin top.pdf +2 -2
  152. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with rowSpan multipages.pdf +2 -2
  153. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with rowSpan.pdf +2 -2
  154. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table all auto.pdf +2 -2
  155. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table all fix.pdf +2 -2
  156. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table background.pdf +2 -2
  157. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table cell padding of image.pdf +0 -0
  158. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table cell padding of text.pdf +2 -2
  159. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table center alignment.pdf +2 -2
  160. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table colSpan and rowSpan.pdf +2 -2
  161. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table minimal row height.pdf +2 -2
  162. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table mix auto fix.pdf +2 -2
  163. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table padding.pdf +2 -2
  164. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table right alignment.pdf +2 -2
  165. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table row alignment.pdf +2 -2
  166. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table text alignment in cell with wrapping.pdf +2 -2
  167. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table text alignment in cell.pdf +2 -2
  168. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table with default colored borders.pdf +2 -2
  169. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table with header.pdf +2 -2
  170. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table with multi colored borders.pdf +2 -2
  171. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table with single colored borders.pdf +2 -2
  172. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single date.pdf +14 -14
  173. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single figure.pdf +2 -2
  174. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink centered.pdf +2 -2
  175. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink no underline.pdf +2 -2
  176. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink right aligned.pdf +2 -2
  177. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink.pdf +2 -2
  178. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image from URL.pdf +0 -0
  179. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg color hex.pdf +2 -2
  180. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg color name.pdf +2 -2
  181. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg color url.pdf +2 -2
  182. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg dasharray.pdf +2 -2
  183. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image.pdf +0 -0
  184. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline alphabetic.pdf +2 -2
  185. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline bottom.pdf +2 -2
  186. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline hanging.pdf +2 -2
  187. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline middle.pdf +2 -2
  188. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline top.pdf +2 -2
  189. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Center alignment that linebreaks.pdf +2 -2
  190. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Center alignment.pdf +2 -2
  191. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with End alignment that linebreaks.pdf +2 -2
  192. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with End alignment.pdf +2 -2
  193. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Justify alignment.pdf +2 -2
  194. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Start alignment that linebreaks.pdf +2 -2
  195. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Start alignment.pdf +2 -2
  196. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with super and subscripts.pdf +2 -2
  197. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun.pdf +2 -2
  198. package/src/abstract-document-exporters/__tests__/pdf/tmp/Table of content separator.pdf +2 -2
  199. package/src/abstract-document-exporters/__tests__/pdf/tmp/hello with roman font.pdf +2 -2
  200. package/src/abstract-document-exporters/__tests__/pdf/tmp/hello.pdf +2 -2
  201. package/src/abstract-document-exporters/__tests__/pdf/tmp/pagebreak.pdf +2 -2
  202. package/src/abstract-document-exporters/__tests__/pdf/tmp/world.pdf +2 -2
  203. package/src/abstract-document-xml/__tests__/export-test-def.ts +12 -0
  204. package/src/abstract-document-xml/__tests__/export.test.tsx +43 -0
  205. package/src/abstract-document-xml/__tests__/test-defs/simple-document.tsx +196 -0
  206. package/src/abstract-document-xml/abstract-doc-of-xml/abstract-doc-of-xml.ts +96 -0
  207. package/src/abstract-document-xml/abstract-doc-of-xml/creator.ts +267 -0
  208. package/src/abstract-document-xml/abstract-doc-of-xml/custom-elements.tsx +110 -0
  209. package/src/abstract-document-xml/abstract-doc-of-xml/index.ts +2 -0
  210. package/src/abstract-document-xml/index.ts +3 -0
  211. package/src/abstract-document-xml/parse-xml/index.ts +2 -0
  212. package/src/abstract-document-xml/parse-xml/parse-xml.ts +95 -0
  213. package/src/abstract-document-xml/parse-xml/validation.ts +280 -0
  214. package/src/abstract-document-xml/xsd-template/custom-elements.ts +56 -0
  215. package/src/abstract-document-xml/xsd-template/elements.ts +201 -0
  216. package/src/abstract-document-xml/xsd-template/index.ts +1 -0
  217. package/src/abstract-document-xml/xsd-template/styles.ts +284 -0
  218. package/src/abstract-document-xml/xsd-template/xsd-template.ts +51 -0
  219. package/src/index.ts +2 -1
  220. package/src/abstract-document-exporters/__tests__/docx2/tmp/Table of content separator.docx +0 -0
  221. package/src/abstract-document-exporters/__tests__/pdf/tmp/Empty Paragraph.pdf +0 -91
  222. package/src/abstract-document-exporters/__tests__/pdf/tmp/Group.pdf +0 -123
  223. package/src/abstract-document-exporters/__tests__/pdf/tmp/Named destination.pdf +0 -1761
  224. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with margin.pdf +0 -404
  225. package/src/abstract-document-exporters/__tests__/pdf/tmp/Paragraph numbering.pdf +0 -143
  226. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table.pdf +0 -133
  227. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with default alignment.pdf +0 -113
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ImageCell = exports.TextRow = exports.TextCell = exports.TextParagraph = exports.extractStyleNames = void 0;
4
+ const index_1 = require("../../abstract-document/index");
5
+ const stylePropsKeys = {
6
+ ParagraphStyle: true,
7
+ TextStyle: true,
8
+ TableCellStyle: true,
9
+ TableStyle: true,
10
+ GroupStyle: true,
11
+ };
12
+ function extractStyleNames(styleNames, styleNameTypes) {
13
+ const names = (styleNames || "").split(",");
14
+ let styleNameProps = {};
15
+ for (const name of names) {
16
+ const trimmed = name.trim();
17
+ const type = styleNameTypes[trimmed];
18
+ if (type && stylePropsKeys[type]) {
19
+ styleNameProps = Object.assign(Object.assign({}, styleNameProps), { [type]: trimmed });
20
+ }
21
+ }
22
+ return styleNameProps;
23
+ }
24
+ exports.extractStyleNames = extractStyleNames;
25
+ function TextParagraph(props, styleNameTypes) {
26
+ const { text, textStyle, paragraphStyle } = props;
27
+ const styleNames = extractStyleNames(props.styleNames, styleNameTypes);
28
+ const textRun = index_1.TextRun.create({ text, style: textStyle, styleName: styleNames.TextStyle });
29
+ return index_1.Paragraph.create({ style: paragraphStyle, styleName: styleNames.ParagraphStyle }, [textRun]);
30
+ }
31
+ exports.TextParagraph = TextParagraph;
32
+ function TextCell(props, styleNameTypes) {
33
+ const { text, textStyle, paragraphStyle, cellStyle, columnSpan, rowSpan } = props;
34
+ const styleNames = extractStyleNames(props.styleNames, styleNameTypes);
35
+ const textRun = index_1.TextRun.create({ text, style: textStyle, styleName: styleNames.TextStyle });
36
+ const paragraph = index_1.Paragraph.create({ style: paragraphStyle, styleName: styleNames.ParagraphStyle }, [textRun]);
37
+ return index_1.TableCell.create({ columnSpan, rowSpan, style: cellStyle, styleName: styleNames.TableCellStyle }, [paragraph]);
38
+ }
39
+ exports.TextCell = TextCell;
40
+ function TextRow(props, styleNameTypes) {
41
+ const { text, textStyle, paragraphStyle, cellStyle, columnSpan, rowSpan } = props;
42
+ const styleNames = extractStyleNames(props.styleNames, styleNameTypes);
43
+ const textRun = index_1.TextRun.create({ text, style: textStyle, styleName: styleNames.TextStyle });
44
+ const paragraph = index_1.Paragraph.create({ style: paragraphStyle, styleName: styleNames.ParagraphStyle }, [textRun]);
45
+ const tableCell = index_1.TableCell.create({ columnSpan, rowSpan, style: cellStyle, styleName: styleNames.TableCellStyle }, [
46
+ paragraph,
47
+ ]);
48
+ return index_1.TableRow.create({}, [tableCell]);
49
+ }
50
+ exports.TextRow = TextRow;
51
+ function ImageCell(props, styleNameTypes) {
52
+ const { image, width, height, paragraphStyle, cellStyle, columnSpan, rowSpan } = props;
53
+ const styleNames = extractStyleNames(props.styleNames, styleNameTypes);
54
+ const imageElement = image && index_1.Image.create({ imageResource: image, width, height });
55
+ const paragraph = imageElement && index_1.Paragraph.create({ style: paragraphStyle, styleName: styleNames.ParagraphStyle }, [imageElement]);
56
+ return index_1.TableCell.create({ columnSpan, rowSpan, style: cellStyle, styleName: styleNames.TableCellStyle }, paragraph && [paragraph]);
57
+ }
58
+ exports.ImageCell = ImageCell;
59
+ //# sourceMappingURL=custom-elements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-elements.js","sourceRoot":"","sources":["../../../src/abstract-document-xml/abstract-doc-of-xml/custom-elements.tsx"],"names":[],"mappings":";;;AAAA,yDAUuC;AAUvC,MAAM,cAAc,GAA4B;IAC9C,cAAc,EAAE,IAAI;IACpB,SAAS,EAAE,IAAI;IACf,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,IAAI;IAChB,UAAU,EAAE,IAAI;CACjB,CAAC;AAEF,SAAgB,iBAAiB,CAC/B,UAA8B,EAC9B,cAAsC;IAEtC,MAAM,KAAK,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE5C,IAAI,cAAc,GAAG,EAAE,CAAC;IAExB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;QACrC,IAAI,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC,EAAE;YAChC,cAAc,mCAAQ,cAAc,KAAE,CAAC,IAAI,CAAC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AE,CAAC,CAAC;IACpF,MAAM,SAAS,GACb,YAAY,IAAI,iBAAS,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,CAAC,cAAc,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IACpH,OAAO,iBAAS,CAAC,MAAM,CACrB,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC,cAAc,EAAE,EAC/E,SAAS,IAAI,CAAC,SAAS,CAAC,CACzB,CAAC;AACJ,CAAC;AAVD,8BAUC"}
@@ -0,0 +1,3 @@
1
+ export * from "./abstract-doc-of-xml";
2
+ export { creators } from "./creator";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/abstract-document-xml/abstract-doc-of-xml/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.creators = void 0;
14
+ __exportStar(require("./abstract-doc-of-xml"), exports);
15
+ var creator_1 = require("./creator");
16
+ Object.defineProperty(exports, "creators", { enumerable: true, get: function () { return creator_1.creators; } });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/abstract-document-xml/abstract-doc-of-xml/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,wDAAsC;AACtC,qCAAqC;AAA5B,mGAAA,QAAQ,OAAA"}
@@ -0,0 +1,4 @@
1
+ export * from "./xsd-template";
2
+ export * from "./abstract-doc-of-xml";
3
+ export * from "./parse-xml";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/abstract-document-xml/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./xsd-template"), exports);
14
+ __exportStar(require("./abstract-doc-of-xml"), exports);
15
+ __exportStar(require("./parse-xml"), exports);
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/abstract-document-xml/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA+B;AAC/B,wDAAsC;AACtC,8CAA4B"}
@@ -0,0 +1,3 @@
1
+ export * from "./validation";
2
+ export * from "./parse-xml";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/abstract-document-xml/parse-xml/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./validation"), exports);
14
+ __exportStar(require("./parse-xml"), exports);
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/abstract-document-xml/parse-xml/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA6B;AAC7B,8CAA4B"}
@@ -0,0 +1,12 @@
1
+ import { X2jOptionsOptional } from "fast-xml-parser";
2
+ export declare type XmlElement = {
3
+ readonly tagName: string;
4
+ readonly attributes: Record<string, string>;
5
+ readonly children: ReadonlyArray<XmlElement>;
6
+ readonly textContent?: string;
7
+ };
8
+ export declare type FastXmlElement = Record<string, ReadonlyArray<FastXmlElement> | Record<string, string>>;
9
+ export declare function parseXml(text: string, options?: X2jOptionsOptional): ReadonlyArray<XmlElement>;
10
+ export declare function findElement(elements: ReadonlyArray<XmlElement>, elementName: string | undefined): XmlElement | undefined;
11
+ export declare function getChildren(elements: ReadonlyArray<XmlElement>): ReadonlyArray<XmlElement>;
12
+ //# sourceMappingURL=parse-xml.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-xml.d.ts","sourceRoot":"","sources":["../../../src/abstract-document-xml/parse-xml/parse-xml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAa,MAAM,iBAAiB,CAAC;AAEhE,oBAAY,UAAU,GAAG;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAC7C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,oBAAY,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEpG,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,aAAa,CAAC,UAAU,CAAC,CAO9F;AA8BD,wBAAgB,WAAW,CACzB,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,EACnC,WAAW,EAAE,MAAM,GAAG,SAAS,GAC9B,UAAU,GAAG,SAAS,CAqBxB;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,aAAa,CAAC,UAAU,CAAC,CAc1F"}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getChildren = exports.findElement = exports.parseXml = void 0;
4
+ const fast_xml_parser_1 = require("fast-xml-parser");
5
+ function parseXml(text, options) {
6
+ const parser = new fast_xml_parser_1.XMLParser(options);
7
+ // Unescape HTML entity
8
+ parser.addEntity("#x2F", "/");
9
+ parser.addEntity("#x3D", "=");
10
+ const parsedXml = parser.parse(text);
11
+ return transformFXP(parsedXml);
12
+ }
13
+ exports.parseXml = parseXml;
14
+ // Transforms fast-xml-parser format to a format that is much easier to work with
15
+ function transformFXP(parsedXml) {
16
+ return parsedXml.flatMap((element) => {
17
+ const key = Object.keys(element).find((k) => k !== ":@" && k !== "#text");
18
+ if (key === "?xml") {
19
+ return [];
20
+ }
21
+ const children = (element[key] || []).filter((c) => {
22
+ const key = Object.keys(c)[0];
23
+ return key !== "#text" && key !== ":@";
24
+ });
25
+ const attributes = element[":@"] || {};
26
+ const textChilds = (element[key] || [])
27
+ .filter((c) => {
28
+ const key = Object.keys(c)[0];
29
+ return key === "#text";
30
+ })
31
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
+ .flatMap((t) => t["#text"]);
33
+ const textContents = textChilds.flatMap((text) => {
34
+ const cleaned = text.replace(/\n/g, "").replace(/\t/g, "").trim();
35
+ return cleaned ? [text] : [];
36
+ });
37
+ const textContent = textContents.join("\n");
38
+ return { tagName: key, attributes: attributes, children: transformFXP(children), textContent: textContent };
39
+ });
40
+ }
41
+ function findElement(elements, elementName) {
42
+ if (!elementName) {
43
+ return undefined;
44
+ }
45
+ for (const elem of elements) {
46
+ if (elem.tagName === "annotation" || elem.tagName === "attribute") {
47
+ continue;
48
+ }
49
+ if (shouldSkipLevel(elem)) {
50
+ const childElement = findElement(Array.from(elem.children), elementName);
51
+ if (childElement) {
52
+ return shouldSkipLevel(childElement)
53
+ ? findElement(Array.from(childElement.children), elementName)
54
+ : childElement;
55
+ }
56
+ }
57
+ if (elem.attributes.name === elementName) {
58
+ return elem;
59
+ }
60
+ }
61
+ return undefined;
62
+ }
63
+ exports.findElement = findElement;
64
+ function getChildren(elements) {
65
+ for (const elem of elements) {
66
+ if (elem.tagName === "annotation" || elem.tagName === "attribute") {
67
+ continue;
68
+ }
69
+ if (shouldSkipLevel(elem)) {
70
+ const child = getChildren(Array.from(elem.children));
71
+ if (child.length > 0) {
72
+ return child.flatMap((c) => (shouldSkipLevel(c) ? getChildren(Array.from(c.children)) : c));
73
+ }
74
+ }
75
+ return elements;
76
+ }
77
+ return [];
78
+ }
79
+ exports.getChildren = getChildren;
80
+ function shouldSkipLevel(tag) {
81
+ return (tag.tagName === "all" || tag.tagName === "sequence" || tag.tagName === "choice" || tag.attributes.name === undefined);
82
+ }
83
+ //# sourceMappingURL=parse-xml.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-xml.js","sourceRoot":"","sources":["../../../src/abstract-document-xml/parse-xml/parse-xml.ts"],"names":[],"mappings":";;;AAAA,qDAAgE;AAWhE,SAAgB,QAAQ,CAAC,IAAY,EAAE,OAA4B;IACjE,MAAM,MAAM,GAAG,IAAI,2BAAS,CAAC,OAAO,CAAC,CAAC;IACtC,uBAAuB;IACvB,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACrC,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC;AAPD,4BAOC;AAED,iFAAiF;AACjF,SAAS,YAAY,CAAC,SAAwC;IAC5D,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QACnC,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,OAAO,CAAE,CAAC;QAC3E,IAAI,GAAG,KAAK,MAAM,EAAE;YAClB,OAAO,EAAE,CAAC;SACX;QACD,MAAM,QAAQ,GAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAA2B,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;YAC5E,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC9B,OAAO,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,IAAI,CAAC;QACzC,CAAC,CAAC,CAA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GAAG,CAAC,OAAO,KAAK,KAAK,IAAI,GAAG,CAAC,OAAO,KAAK,UAAU,IAAI,GAAG,CAAC,OAAO,KAAK,QAAQ,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,KAAK,SAAS,CACrH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { XmlElement } from "./parse-xml";
2
+ declare type Range = {
3
+ readonly startLineNumber: number;
4
+ readonly startColumn: number;
5
+ readonly endLineNumber: number;
6
+ readonly endColumn: number;
7
+ };
8
+ declare type ErrorObject = {
9
+ readonly range: Range;
10
+ readonly options: ErrorOptions;
11
+ };
12
+ declare type ErrorOptions = {
13
+ readonly className: string;
14
+ readonly hoverMessage: Array<{
15
+ readonly value: string;
16
+ }>;
17
+ };
18
+ export declare function validateXml(fullXml: string, xsdSchema: ReadonlyArray<XmlElement>): Array<ErrorObject>;
19
+ export declare function errorToReadableText(errors: ReadonlyArray<ErrorObject>, templateName?: string): string;
20
+ export {};
21
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/abstract-document-xml/parse-xml/validation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAyB,MAAM,aAAa,CAAC;AAOhE,aAAK,KAAK,GAAG;IACX,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B,CAAC;AAMF,aAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;CAChC,CAAC;AAEF,aAAK,YAAY,GAAG;IAClB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,QAAQ,CAAC,YAAY,EAAE,KAAK,CAAC;QAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;KACxB,CAAC,CAAC;CACJ,CAAC;AASF,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,CAuErG;AAqJD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,EAAE,YAAY,GAAE,MAAW,GAAG,MAAM,CAYzG"}
@@ -0,0 +1,205 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.errorToReadableText = exports.validateXml = void 0;
4
+ const fast_xml_parser_1 = require("fast-xml-parser");
5
+ const parse_xml_1 = require("./parse-xml");
6
+ var ErrorType;
7
+ (function (ErrorType) {
8
+ ErrorType[ErrorType["warning"] = 0] = "warning";
9
+ ErrorType[ErrorType["error"] = 1] = "error";
10
+ })(ErrorType || (ErrorType = {}));
11
+ // eslint-disable-next-line functional/prefer-readonly-type
12
+ function validateXml(fullXml, xsdSchema) {
13
+ const errors = [];
14
+ // ignore all mustache brackets
15
+ const matchMustacheBrackets = /{{.*}}(?!([\S]))/g;
16
+ // Ignore xml comments
17
+ const xmlComments = /<!--[^>]*-->/g;
18
+ // Replace matches with spaces of same length
19
+ let cleanedXml = fullXml.replace(matchMustacheBrackets, (m) => " ".repeat(m.length));
20
+ cleanedXml = cleanedXml.replace(xmlComments, (m) => {
21
+ const x = (m.match(/^.*$/gm) || []).map((m2) => " ".repeat(m2.length));
22
+ return x.join("\n");
23
+ });
24
+ const xml = `<xml>\n${cleanedXml}\n</xml>`;
25
+ if (xml) {
26
+ try {
27
+ const result = fast_xml_parser_1.XMLValidator.validate(xml, {
28
+ allowBooleanAttributes: true,
29
+ });
30
+ if (result !== true) {
31
+ errors.push(getErrorFromException(result, xml));
32
+ }
33
+ const entryPointXml = (0, parse_xml_1.parseXml)(xml, {
34
+ preserveOrder: true,
35
+ ignoreAttributes: false,
36
+ attributeNamePrefix: "",
37
+ allowBooleanAttributes: true,
38
+ trimValues: false,
39
+ ignoreDeclaration: true,
40
+ })[0];
41
+ const entryPointSchema = xsdSchema[0];
42
+ let pos = 0;
43
+ const lines = cleanedXml.split("\n");
44
+ const getRangeOfElement = (text, incrementPosition = true) => {
45
+ if (text === undefined) {
46
+ const monacoPosition = getPositionFromIndex(lines, pos);
47
+ return toRange(monacoPosition.lineNumber, monacoPosition.column, monacoPosition.lineNumber, monacoPosition.column + 5);
48
+ }
49
+ const position = cleanedXml.indexOf(text, pos);
50
+ if (incrementPosition) {
51
+ pos = position >= pos ? position + text.length : pos;
52
+ }
53
+ const monacoPosition = getPositionFromIndex(lines, position);
54
+ return toRange(monacoPosition.lineNumber, monacoPosition.column, monacoPosition.lineNumber, monacoPosition.column + text.length);
55
+ };
56
+ const validationErrors = entryPointXml.children.flatMap((child) => validateElements(child, undefined, entryPointSchema, getRangeOfElement));
57
+ errors.push(...validationErrors);
58
+ }
59
+ catch (e) {
60
+ errors.push(createError(e.message, ErrorType.error, toRange(1, 1, 1, 100)));
61
+ }
62
+ }
63
+ return errors.map((e) => getDecorationsFromError(e));
64
+ }
65
+ exports.validateXml = validateXml;
66
+ function validateElements(element, schemaElement, completeSchema, getRangeOfElement) {
67
+ const errors = [];
68
+ // Validate element name
69
+ const tagName = element.tagName;
70
+ const range = getRangeOfElement(tagName);
71
+ const slashPosition = getRangeOfElement("/", false);
72
+ const closingTagPosition = getRangeOfElement(">", false);
73
+ const isClosed = rangeLessThan(slashPosition, closingTagPosition);
74
+ const validElements = Object.values(completeSchema.children);
75
+ const schemaName = (schemaElement === null || schemaElement === void 0 ? void 0 : schemaElement.attributes.type) || tagName;
76
+ const foundSchemaElement = (0, parse_xml_1.findElement)(validElements, schemaName);
77
+ if (!foundSchemaElement) {
78
+ return [createError(`"${tagName}" is not a valid element`, ErrorType.error, range)];
79
+ }
80
+ const possibleAttributes = Array.from(foundSchemaElement.children).flatMap((c) => c.tagName === "attribute" ? c : []);
81
+ // Validate required attributes
82
+ for (const possibleAttribute of possibleAttributes) {
83
+ const attributeName = possibleAttribute.attributes.name;
84
+ const isRequired = possibleAttribute.attributes.use;
85
+ if (attributeName && isRequired && isRequired === "required") {
86
+ if (element.attributes[attributeName] === undefined) {
87
+ errors.push(createError(`"${attributeName}" is a required attribute on "${tagName}"`, ErrorType.error, range));
88
+ }
89
+ }
90
+ }
91
+ // Validate existing attributes
92
+ for (const [attrKey, attrVal] of Object.entries(element.attributes)) {
93
+ const possibleAttrNames = possibleAttributes.flatMap((p) => p.attributes.name || []);
94
+ const attrText = typeof attrVal === "string" ? `${attrKey}="${attrVal}"` : attrKey;
95
+ const attrRange = getRangeOfElement(attrText, false);
96
+ if (!possibleAttrNames.includes(attrKey)) {
97
+ errors.push(createError(`"${attrKey}" is a not a valid attribute on "${tagName}"`, ErrorType.error, attrRange));
98
+ }
99
+ }
100
+ // Validate that the children are allowed as a child of current element
101
+ // and then validate the children themselves
102
+ const schemaChildren = Object.values(foundSchemaElement.children);
103
+ for (const child of element.children) {
104
+ const childName = child.tagName;
105
+ if (!childName) {
106
+ continue;
107
+ }
108
+ const foundChild = (0, parse_xml_1.findElement)(schemaChildren, childName);
109
+ if (!foundChild) {
110
+ const childRange = getRangeOfElement(childName, false);
111
+ if (childRange) {
112
+ errors.push(createError(`"${childName}" is not a valid child of "${tagName}"`, ErrorType.error, childRange));
113
+ }
114
+ }
115
+ const elementErrors = validateElements(child, foundChild, completeSchema, getRangeOfElement);
116
+ errors.push(...elementErrors);
117
+ }
118
+ if (!isClosed) {
119
+ // Increment position to after closing tag
120
+ getRangeOfElement(`</${tagName}`, true);
121
+ }
122
+ return errors;
123
+ }
124
+ function getDecorationsFromError(error) {
125
+ return {
126
+ range: error.range,
127
+ options: {
128
+ className: getErrorClassNames(error),
129
+ hoverMessage: [{ value: getErrorType(error) }, { value: getErrorMessage(error) }],
130
+ },
131
+ };
132
+ }
133
+ function getErrorFromException(result, xml) {
134
+ const { col, line, msg } = result.err;
135
+ const startLine = line - 1;
136
+ const lines = xml.split("\n");
137
+ const rowText = lines[startLine] || "";
138
+ const length = rowText.indexOf(">") - rowText.indexOf("<") || 4;
139
+ const range = toRange(startLine, col, startLine, col + length);
140
+ return createError(msg, ErrorType.error, range);
141
+ }
142
+ function getErrorClassNames(error) {
143
+ switch (error.type) {
144
+ case ErrorType.warning:
145
+ return "xml-lint xml-lint--warning";
146
+ case ErrorType.error:
147
+ return "xml-lint xml-lint--error";
148
+ default:
149
+ return "";
150
+ }
151
+ }
152
+ function getErrorType(error) {
153
+ switch (error.type) {
154
+ case ErrorType.warning:
155
+ return "**Warning**";
156
+ case ErrorType.error:
157
+ return "**Error**";
158
+ default:
159
+ return "";
160
+ }
161
+ }
162
+ function getErrorMessage(error) {
163
+ var _a;
164
+ return (_a = error.message.split(/[\t\n]/g)[1]) !== null && _a !== void 0 ? _a : error.message;
165
+ }
166
+ function createError(message, type, range) {
167
+ return { message, type, range };
168
+ }
169
+ function getPositionFromIndex(lines, index) {
170
+ let totalLength = 0;
171
+ for (const [lineNumber, line] of lines.entries()) {
172
+ totalLength += line.length;
173
+ if (totalLength >= index - lineNumber) {
174
+ return {
175
+ lineNumber: lineNumber + 1,
176
+ column: 1 + index - (totalLength - line.length) - lineNumber || 1, // "- lineNumber" because of \n characters
177
+ };
178
+ }
179
+ }
180
+ return { lineNumber: lines.length, column: 1 };
181
+ }
182
+ function toRange(startLineNumber, startColumn, endLineNumber, endColumn) {
183
+ return { startLineNumber, startColumn, endLineNumber, endColumn };
184
+ }
185
+ function errorToReadableText(errors, templateName = "") {
186
+ const errorLines = [];
187
+ if (templateName) {
188
+ errorLines.push(`Error in template ${templateName} \n`);
189
+ }
190
+ for (const error of errors) {
191
+ const hoverErrors = error.options.hoverMessage.map((e) => e.value.replace(/\*/g, ""));
192
+ errorLines.push(`${hoverErrors.join("\n")}`);
193
+ errorLines.push(`On line ${error.range.startLineNumber}, column ${error.range.startColumn}\n`);
194
+ }
195
+ return errorLines.join("\n");
196
+ }
197
+ exports.errorToReadableText = errorToReadableText;
198
+ function rangeLessThan(range1, range2) {
199
+ return range1.startLineNumber < range2.startLineNumber
200
+ ? true
201
+ : range1.startLineNumber > range2.startLineNumber
202
+ ? false
203
+ : range1.startColumn < range2.startColumn;
204
+ }
205
+ //# sourceMappingURL=validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/abstract-document-xml/parse-xml/validation.ts"],"names":[],"mappings":";;;AAAA,qDAAgE;AAChE,2CAAgE;AAEhE,IAAK,SAGJ;AAHD,WAAK,SAAS;IACZ,+CAAW,CAAA;IACX,2CAAS,CAAA;AACX,CAAC,EAHI,SAAS,KAAT,SAAS,QAGb;AAgCD,2DAA2D;AAC3D,SAAgB,WAAW,CAAC,OAAe,EAAE,SAAoC;IAC/E,MAAM,MAAM,GAAoB,EAAE,CAAC;IAEnC,+BAA+B;IAC/B,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;IAClD,sBAAsB;IACtB,MAAM,WAAW,GAAG,eAAe,CAAC;IAEpC,6CAA6C;IAC7C,IAAI,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IACrF,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE;QACjD,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QACvE,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC,CAAC,CAAC;IAEH,MAAM,GAAG,GAAG,UAAU,U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WAAmB,EAAE,aAAqB,EAAE,SAAiB;IACrG,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC;AACpE,CAAC;AAED,SAAgB,mBAAmB,CAAC,MAAkC,EAAE,eAAuB,EAAE;IAC/F,MAAM,UAAU,GAAkB,EAAE,CAAC;IACrC,IAAI,YAAY,EAAE;QAChB,UAAU,CAAC,IAAI,CAAC,qBAAqB,YAAY,KAAK,CAAC,CAAC;KACzD;IACD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;QAC1B,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;QACtF,UAAU,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC7C,UAAU,CAAC,IAAI,CAAC,WAAW,KAAK,CAAC,KAAK,CAAC,eAAe,YAAY,KAAK,CAAC,KAAK,CAAC,WAAW,IAAI,CAAC,CAAC;KAChG;IAED,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAZD,kDAYC;AAED,SAAS,aAAa,CAAC,MAAa,EAAE,MAAa;IACjD,OAAO,MAAM,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe;QACpD,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,MAAM,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe;YACjD,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const textParagraph = "<xs:complexType name=\"TextParagraph\">\n\t<xs:annotation>\n\t\t<xs:documentation>Shortcut to create \\<Paragraph> \\<TextRun text=\"...\" /> \\</Paragraph></xs:documentation>\n\t</xs:annotation>\n\t<xs:choice minOccurs=\"0\" maxOccurs=\"1\">\n\t\t<xs:element name=\"style\" type=\"TextStyle\" />\n\t</xs:choice>\n\t<xs:attribute name=\"styleNames\" type=\"xs:string\" >\n\t\t<xs:annotation>\n\t\t\t<xs:documentation>Refrence to a TextStyle that is defined in \\<AbstractDoc> \\<StyleNames> \\<StyleName name=\"...\" /> \\</StyleNames> \\</AbstractDoc></xs:documentation>\n\t\t</xs:annotation>\n\t</xs:attribute>\n\t<xs:attribute name=\"target\" type=\"xs:string\" />\n\t<xs:attribute name=\"text\" type=\"xs:string\" use=\"required\" />\n</xs:complexType>";
2
+ export declare const textParagraphElement = "<xs:element name=\"TextParagraph\" type=\"TextParagraph\" maxOccurs=\"unbounded\" />";
3
+ export declare const textCell = "<xs:complexType name=\"TextCell\">\n\t<xs:annotation>\n\t\t<xs:documentation>Shortcut to create a \\<TableCell> \\<Paragraph> \\<TextRun text=\"...\" /> \\</Paragraph> \\</TableCell></xs:documentation>\n\t</xs:annotation>\n\t<xs:choice minOccurs=\"0\" maxOccurs=\"1\">\n\t\t<xs:element name=\"style\" type=\"TextStyle\" />\n\t</xs:choice>\n\t<xs:attribute name=\"styleNames\" type=\"xs:string\" >\n\t\t<xs:annotation>\n\t\t<xs:documentation>Refrence to a TextStyle that is defined in \\<AbstractDoc> \\<StyleNames> \\<StyleName name=\"...\" /> \\</StyleNames> \\</AbstractDoc></xs:documentation>\n\t\t</xs:annotation>\n\t</xs:attribute>\n\t<xs:attribute name=\"target\" type=\"xs:string\" />\n\t<xs:attribute name=\"columnSpan\" type=\"xs:string\" />\n\t<xs:attribute name=\"rowSpan\" type=\"xs:string\" />\n\t<xs:attribute name=\"text\" type=\"xs:string\" use=\"required\" />\n</xs:complexType>";
4
+ export declare const textCellElement = "<xs:element name=\"TextCell\" type=\"TextCell\" minOccurs=\"0\" maxOccurs=\"unbounded\" />";
5
+ export declare const textRow = "<xs:complexType name=\"TextRow\">\n\t<xs:annotation>\n\t\t<xs:documentation>Shortcut to create a \\<TableRow> \\<TableCell> \\<Paragraph> \\<TextRun text=\"...\" /> \\</Paragraph> \\</TableCell> \\</TableRow></xs:documentation>\n\t</xs:annotation>\n\t<xs:choice minOccurs=\"0\" maxOccurs=\"1\">\n\t\t<xs:element name=\"style\" type=\"TextStyle\" />\n\t</xs:choice>\n\t<xs:attribute name=\"styleNames\" type=\"xs:string\" >\n\t\t<xs:annotation>\n\t\t<xs:documentation>Refrence to a TextStyle that is defined in \\<AbstractDoc> \\<StyleNames> \\<StyleName name=\"...\" /> \\</StyleNames> \\</AbstractDoc></xs:documentation>\n\t\t</xs:annotation>\n\t</xs:attribute>\n\t<xs:attribute name=\"target\" type=\"xs:string\" />\n\t<xs:attribute name=\"columnSpan\" type=\"xs:string\" />\n\t<xs:attribute name=\"rowSpan\" type=\"xs:string\" />\n\t<xs:attribute name=\"text\" type=\"xs:string\" use=\"required\" />\n</xs:complexType>";
6
+ export declare const textRowElement = "<xs:element name=\"TextRow\" type=\"TextRow\" maxOccurs=\"unbounded\" />";
7
+ //# sourceMappingURL=custom-elements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-elements.d.ts","sourceRoot":"","sources":["../../../src/abstract-document-xml/xsd-template/custom-elements.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,aAAa,yvBAcR,CAAC;AACnB,eAAO,MAAM,oBAAoB,yFAAmF,CAAC;AAErH,eAAO,MAAM,QAAQ,o4BAgBH,CAAC;AACnB,eAAO,MAAM,eAAe,+FAAuF,CAAC;AAEpH,eAAO,MAAM,OAAO,85BAgBF,CAAC;AAEnB,eAAO,MAAM,cAAc,6EAAuE,CAAC"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.textRowElement = exports.textRow = exports.textCellElement = exports.textCell = exports.textParagraphElement = exports.textParagraph = void 0;
4
+ /* eslint-disable no-useless-escape */
5
+ exports.textParagraph = `<xs:complexType name="TextParagraph">
6
+ <xs:annotation>
7
+ <xs:documentation>Shortcut to create \\<Paragraph> \\<TextRun text="..." /> \\</Paragraph></xs:documentation>
8
+ </xs:annotation>
9
+ <xs:choice minOccurs="0" maxOccurs="1">
10
+ <xs:element name="style" type="TextStyle" />
11
+ </xs:choice>
12
+ <xs:attribute name="styleNames" type="xs:string" >
13
+ <xs:annotation>
14
+ <xs:documentation>Refrence to a TextStyle that is defined in \\<AbstractDoc> \\<StyleNames> \\<StyleName name="..." /> \\</StyleNames> \\</AbstractDoc></xs:documentation>
15
+ </xs:annotation>
16
+ </xs:attribute>
17
+ <xs:attribute name="target" type="xs:string" />
18
+ <xs:attribute name="text" type="xs:string" use="required" />
19
+ </xs:complexType>`;
20
+ exports.textParagraphElement = `<xs:element name="TextParagraph" type="TextParagraph" maxOccurs="unbounded" />`;
21
+ exports.textCell = `<xs:complexType name="TextCell">
22
+ <xs:annotation>
23
+ <xs:documentation>Shortcut to create a \\<TableCell> \\<Paragraph> \\<TextRun text="..." /> \\</Paragraph> \\</TableCell></xs:documentation>
24
+ </xs:annotation>
25
+ <xs:choice minOccurs="0" maxOccurs="1">
26
+ <xs:element name="style" type="TextStyle" />
27
+ </xs:choice>
28
+ <xs:attribute name="styleNames" type="xs:string" >
29
+ <xs:annotation>
30
+ <xs:documentation>Refrence to a TextStyle that is defined in \\<AbstractDoc> \\<StyleNames> \\<StyleName name="..." /> \\</StyleNames> \\</AbstractDoc></xs:documentation>
31
+ </xs:annotation>
32
+ </xs:attribute>
33
+ <xs:attribute name="target" type="xs:string" />
34
+ <xs:attribute name="columnSpan" type="xs:string" />
35
+ <xs:attribute name="rowSpan" type="xs:string" />
36
+ <xs:attribute name="text" type="xs:string" use="required" />
37
+ </xs:complexType>`;
38
+ exports.textCellElement = `<xs:element name="TextCell" type="TextCell" minOccurs="0" maxOccurs="unbounded" />`;
39
+ exports.textRow = `<xs:complexType name="TextRow">
40
+ <xs:annotation>
41
+ <xs:documentation>Shortcut to create a \\<TableRow> \\<TableCell> \\<Paragraph> \\<TextRun text="..." /> \\</Paragraph> \\</TableCell> \\</TableRow></xs:documentation>
42
+ </xs:annotation>
43
+ <xs:choice minOccurs="0" maxOccurs="1">
44
+ <xs:element name="style" type="TextStyle" />
45
+ </xs:choice>
46
+ <xs:attribute name="styleNames" type="xs:string" >
47
+ <xs:annotation>
48
+ <xs:documentation>Refrence to a TextStyle that is defined in \\<AbstractDoc> \\<StyleNames> \\<StyleName name="..." /> \\</StyleNames> \\</AbstractDoc></xs:documentation>
49
+ </xs:annotation>
50
+ </xs:attribute>
51
+ <xs:attribute name="target" type="xs:string" />
52
+ <xs:attribute name="columnSpan" type="xs:string" />
53
+ <xs:attribute name="rowSpan" type="xs:string" />
54
+ <xs:attribute name="text" type="xs:string" use="required" />
55
+ </xs:complexType>`;
56
+ exports.textRowElement = `<xs:element name="TextRow" type="TextRow" maxOccurs="unbounded" />`;
57
+ //# sourceMappingURL=custom-elements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-elements.js","sourceRoot":"","sources":["../../../src/abstract-document-xml/xsd-template/custom-elements.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACzB,QAAA,aAAa,GAAG;;;;;;;;;;;;;;kBAcX,CAAC;AACN,QAAA,oBAAoB,GAAG,gFAAgF,CAAC;AAExG,QAAA,QAAQ,GAAG;;;;;;;;;;;;;;;;kBAgBN,CAAC;AACN,QAAA,eAAe,GAAG,oFAAoF,CAAC;AAEvG,QAAA,OAAO,GAAG;;;;;;;;;;;;;;;;kBAgBL,CAAC;AAEN,QAAA,cAAc,GAAG,oEAAoE,CAAC"}