@syncfusion/ej2-docx 0.0.0-stage → 35.1.39

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 (416) hide show
  1. package/README.md +68 -2
  2. package/core.js +4 -0
  3. package/dist/ej2-docx.umd.min.js +2 -0
  4. package/dist/ej2-docx.umd.min.js.map +1 -0
  5. package/dist/es6/ej2-docx.es2015.js +66697 -0
  6. package/dist/es6/ej2-docx.es2015.js.map +1 -0
  7. package/dist/es6/ej2-docx.es5.js +77568 -0
  8. package/dist/es6/ej2-docx.es5.js.map +1 -0
  9. package/dist/global/ej2-docx.min.js +2 -0
  10. package/dist/global/ej2-docx.min.js.map +1 -0
  11. package/dist/global/index.d.ts +5 -0
  12. package/features.js +4 -0
  13. package/index.js +4 -0
  14. package/license +10 -0
  15. package/package.json +31 -4
  16. package/src/all.d.ts +50 -0
  17. package/src/all.js +147 -0
  18. package/src/core/compat/base64.d.ts +13 -0
  19. package/src/core/compat/base64.js +90 -0
  20. package/src/core/compat/object-compat.d.ts +30 -0
  21. package/src/core/compat/object-compat.js +40 -0
  22. package/src/core/compat/sha256.d.ts +9 -0
  23. package/src/core/compat/sha256.js +98 -0
  24. package/src/core/errors/docx-error.d.ts +89 -0
  25. package/src/core/errors/docx-error.js +138 -0
  26. package/src/core/errors/error-codes.d.ts +8 -0
  27. package/src/core/errors/error-codes.js +0 -0
  28. package/src/core/errors/index.d.ts +10 -0
  29. package/src/core/errors/index.js +9 -0
  30. package/src/core/index.d.ts +12 -0
  31. package/src/core/index.js +12 -0
  32. package/src/core/mc/alternate-content.d.ts +7 -0
  33. package/src/core/mc/alternate-content.js +67 -0
  34. package/src/core/mc/attributes.d.ts +24 -0
  35. package/src/core/mc/attributes.js +82 -0
  36. package/src/core/mc/index.d.ts +7 -0
  37. package/src/core/mc/index.js +5 -0
  38. package/src/core/mc/inspect.d.ts +16 -0
  39. package/src/core/mc/inspect.js +148 -0
  40. package/src/core/mc/namespaces.d.ts +4 -0
  41. package/src/core/mc/namespaces.js +4 -0
  42. package/src/core/mc/scope.d.ts +6 -0
  43. package/src/core/mc/scope.js +47 -0
  44. package/src/core/opc/content-types.d.ts +34 -0
  45. package/src/core/opc/content-types.js +162 -0
  46. package/src/core/opc/index.d.ts +8 -0
  47. package/src/core/opc/index.js +4 -0
  48. package/src/core/opc/package.d.ts +49 -0
  49. package/src/core/opc/package.js +324 -0
  50. package/src/core/opc/part-name.d.ts +47 -0
  51. package/src/core/opc/part-name.js +205 -0
  52. package/src/core/opc/relationships.d.ts +46 -0
  53. package/src/core/opc/relationships.js +212 -0
  54. package/src/core/preservation/index.d.ts +2 -0
  55. package/src/core/preservation/index.js +1 -0
  56. package/src/core/preservation/opaque-body.d.ts +16 -0
  57. package/src/core/preservation/opaque-body.js +69 -0
  58. package/src/core/registry/block-handlers.d.ts +30 -0
  59. package/src/core/registry/block-handlers.js +36 -0
  60. package/src/core/registry/create-defaults.d.ts +39 -0
  61. package/src/core/registry/create-defaults.js +42 -0
  62. package/src/core/registry/feature-registry.d.ts +20 -0
  63. package/src/core/registry/feature-registry.js +29 -0
  64. package/src/core/registry/index.d.ts +9 -0
  65. package/src/core/registry/index.js +8 -0
  66. package/src/core/registry/inline-handlers.d.ts +20 -0
  67. package/src/core/registry/inline-handlers.js +30 -0
  68. package/src/core/registry/materialize-handlers.d.ts +35 -0
  69. package/src/core/registry/materialize-handlers.js +75 -0
  70. package/src/core/registry/multi-part-handlers.d.ts +37 -0
  71. package/src/core/registry/multi-part-handlers.js +206 -0
  72. package/src/core/registry/package-part-handlers.d.ts +28 -0
  73. package/src/core/registry/package-part-handlers.js +190 -0
  74. package/src/core/registry/part-handlers.d.ts +24 -0
  75. package/src/core/registry/part-handlers.js +172 -0
  76. package/src/core/registry/run-leaf-handlers.d.ts +26 -0
  77. package/src/core/registry/run-leaf-handlers.js +72 -0
  78. package/src/core/security/limits.d.ts +40 -0
  79. package/src/core/security/limits.js +26 -0
  80. package/src/core/xml/index.d.ts +7 -0
  81. package/src/core/xml/index.js +3 -0
  82. package/src/core/xml/model.d.ts +66 -0
  83. package/src/core/xml/model.js +17 -0
  84. package/src/core/xml/parse.d.ts +12 -0
  85. package/src/core/xml/parse.js +382 -0
  86. package/src/core/xml/serialize.d.ts +6 -0
  87. package/src/core/xml/serialize.js +93 -0
  88. package/src/core/zip/crc32.d.ts +2 -0
  89. package/src/core/zip/crc32.js +25 -0
  90. package/src/core/zip/deflate.d.ts +6 -0
  91. package/src/core/zip/deflate.js +6 -0
  92. package/src/core/zip/index.d.ts +10 -0
  93. package/src/core/zip/index.js +4 -0
  94. package/src/core/zip/inflate-raw.d.ts +17 -0
  95. package/src/core/zip/inflate-raw.js +450 -0
  96. package/src/core/zip/names.d.ts +6 -0
  97. package/src/core/zip/names.js +52 -0
  98. package/src/core/zip/read.d.ts +8 -0
  99. package/src/core/zip/read.js +262 -0
  100. package/src/core/zip/write.d.ts +7 -0
  101. package/src/core/zip/write.js +189 -0
  102. package/src/core/zip/zip-entry.d.ts +4 -0
  103. package/src/core/zip/zip-entry.js +0 -0
  104. package/src/features/bibliography/index.d.ts +100 -0
  105. package/src/features/bibliography/index.js +290 -0
  106. package/src/features/bookmarks/index.d.ts +331 -0
  107. package/src/features/bookmarks/index.js +1009 -0
  108. package/src/features/comments/comment-extensions.d.ts +157 -0
  109. package/src/features/comments/comment-extensions.js +356 -0
  110. package/src/features/comments/index.d.ts +579 -0
  111. package/src/features/comments/index.js +1727 -0
  112. package/src/features/content-controls/index.d.ts +821 -0
  113. package/src/features/content-controls/index.js +2857 -0
  114. package/src/features/custom-xml/index.d.ts +236 -0
  115. package/src/features/custom-xml/index.js +661 -0
  116. package/src/features/document/alignment.d.ts +23 -0
  117. package/src/features/document/alignment.js +36 -0
  118. package/src/features/document/alt-chunk.d.ts +103 -0
  119. package/src/features/document/alt-chunk.js +221 -0
  120. package/src/features/document/assert-never.d.ts +1 -0
  121. package/src/features/document/assert-never.js +4 -0
  122. package/src/features/document/augmentations.d.ts +578 -0
  123. package/src/features/document/augmentations.js +0 -0
  124. package/src/features/document/body-always-on.d.ts +36 -0
  125. package/src/features/document/body-always-on.js +66 -0
  126. package/src/features/document/body-blocks.d.ts +7 -0
  127. package/src/features/document/body-blocks.js +78 -0
  128. package/src/features/document/body-item-adapters.d.ts +62 -0
  129. package/src/features/document/body-item-adapters.js +97 -0
  130. package/src/features/document/body-item-collection.d.ts +151 -0
  131. package/src/features/document/body-item-collection.js +440 -0
  132. package/src/features/document/body-item.d.ts +35 -0
  133. package/src/features/document/body-item.js +8 -0
  134. package/src/features/document/body.d.ts +150 -0
  135. package/src/features/document/body.js +263 -0
  136. package/src/features/document/character-format.d.ts +413 -0
  137. package/src/features/document/character-format.js +2054 -0
  138. package/src/features/document/color.d.ts +178 -0
  139. package/src/features/document/color.js +495 -0
  140. package/src/features/document/document.d.ts +410 -0
  141. package/src/features/document/document.js +1049 -0
  142. package/src/features/document/element-type.d.ts +68 -0
  143. package/src/features/document/element-type.js +133 -0
  144. package/src/features/document/entity-type.d.ts +92 -0
  145. package/src/features/document/entity-type.js +93 -0
  146. package/src/features/document/feature-block.d.ts +16 -0
  147. package/src/features/document/feature-block.js +0 -0
  148. package/src/features/document/feature-inline.d.ts +13 -0
  149. package/src/features/document/feature-inline.js +0 -0
  150. package/src/features/document/feature-multi-package-part.d.ts +19 -0
  151. package/src/features/document/feature-multi-package-part.js +8 -0
  152. package/src/features/document/feature-package-level-part.d.ts +18 -0
  153. package/src/features/document/feature-package-level-part.js +8 -0
  154. package/src/features/document/feature-package-part.d.ts +14 -0
  155. package/src/features/document/feature-package-part.js +0 -0
  156. package/src/features/document/feature-run-leaf.d.ts +9 -0
  157. package/src/features/document/feature-run-leaf.js +0 -0
  158. package/src/features/document/headers-footers.d.ts +206 -0
  159. package/src/features/document/headers-footers.js +384 -0
  160. package/src/features/document/index.d.ts +41 -0
  161. package/src/features/document/index.js +34 -0
  162. package/src/features/document/length.d.ts +152 -0
  163. package/src/features/document/length.js +245 -0
  164. package/src/features/document/load-options.d.ts +14 -0
  165. package/src/features/document/load-options.js +0 -0
  166. package/src/features/document/locale-ids.d.ts +227 -0
  167. package/src/features/document/locale-ids.js +485 -0
  168. package/src/features/document/on-off.d.ts +9 -0
  169. package/src/features/document/on-off.js +27 -0
  170. package/src/features/document/page-setup.d.ts +339 -0
  171. package/src/features/document/page-setup.js +244 -0
  172. package/src/features/document/paragraph-format.d.ts +880 -0
  173. package/src/features/document/paragraph-format.js +2807 -0
  174. package/src/features/document/paragraph-item-collection.d.ts +162 -0
  175. package/src/features/document/paragraph-item-collection.js +363 -0
  176. package/src/features/document/paragraph-item.d.ts +83 -0
  177. package/src/features/document/paragraph-item.js +103 -0
  178. package/src/features/document/paragraph.d.ts +435 -0
  179. package/src/features/document/paragraph.js +888 -0
  180. package/src/features/document/run.d.ts +1 -0
  181. package/src/features/document/run.js +768 -0
  182. package/src/features/document/section-partition-flatten.d.ts +124 -0
  183. package/src/features/document/section-partition-flatten.js +217 -0
  184. package/src/features/document/section-properties-model.d.ts +13 -0
  185. package/src/features/document/section-properties-model.js +0 -0
  186. package/src/features/document/section.d.ts +93 -0
  187. package/src/features/document/section.js +178 -0
  188. package/src/features/document/sections.d.ts +103 -0
  189. package/src/features/document/sections.js +217 -0
  190. package/src/features/document/sub-super-script.d.ts +23 -0
  191. package/src/features/document/sub-super-script.js +43 -0
  192. package/src/features/document/text-range.d.ts +445 -0
  193. package/src/features/document/text-range.js +1156 -0
  194. package/src/features/document/typed-body-collections.d.ts +162 -0
  195. package/src/features/document/typed-body-collections.js +371 -0
  196. package/src/features/document/underline-style.d.ts +38 -0
  197. package/src/features/document/underline-style.js +126 -0
  198. package/src/features/document/units.d.ts +8 -0
  199. package/src/features/document/units.js +7 -0
  200. package/src/features/document/wml.d.ts +16 -0
  201. package/src/features/document/wml.js +67 -0
  202. package/src/features/drawing/authoring.d.ts +27 -0
  203. package/src/features/drawing/authoring.js +271 -0
  204. package/src/features/drawing/body-pr.d.ts +271 -0
  205. package/src/features/drawing/body-pr.js +663 -0
  206. package/src/features/drawing/drawing-shape.d.ts +1192 -0
  207. package/src/features/drawing/drawing-shape.js +3239 -0
  208. package/src/features/drawing/encode-builders.d.ts +176 -0
  209. package/src/features/drawing/encode-builders.js +390 -0
  210. package/src/features/drawing/fill-format.d.ts +52 -0
  211. package/src/features/drawing/fill-format.js +124 -0
  212. package/src/features/drawing/host-codec.d.ts +632 -0
  213. package/src/features/drawing/host-codec.js +2595 -0
  214. package/src/features/drawing/index.d.ts +13 -0
  215. package/src/features/drawing/index.js +33 -0
  216. package/src/features/drawing/line-format.d.ts +76 -0
  217. package/src/features/drawing/line-format.js +343 -0
  218. package/src/features/drawing/parse-register.d.ts +50 -0
  219. package/src/features/drawing/parse-register.js +257 -0
  220. package/src/features/drawing/residual-utils.d.ts +47 -0
  221. package/src/features/drawing/residual-utils.js +290 -0
  222. package/src/features/drawing/shape-types.d.ts +433 -0
  223. package/src/features/drawing/shape-types.js +437 -0
  224. package/src/features/drawing/sp-pr.d.ts +396 -0
  225. package/src/features/drawing/sp-pr.js +610 -0
  226. package/src/features/drawing/text-frame.d.ts +90 -0
  227. package/src/features/drawing/text-frame.js +152 -0
  228. package/src/features/drawing/types.d.ts +352 -0
  229. package/src/features/drawing/types.js +60 -0
  230. package/src/features/drawing/wrap-format.d.ts +62 -0
  231. package/src/features/drawing/wrap-format.js +114 -0
  232. package/src/features/editable-ranges/index.d.ts +494 -0
  233. package/src/features/editable-ranges/index.js +1348 -0
  234. package/src/features/fields/index.d.ts +428 -0
  235. package/src/features/fields/index.js +2148 -0
  236. package/src/features/fields/paragraph-field.d.ts +187 -0
  237. package/src/features/fields/paragraph-field.js +692 -0
  238. package/src/features/font-table/font-substitution-table.d.ts +75 -0
  239. package/src/features/font-table/font-substitution-table.js +257 -0
  240. package/src/features/font-table/font-table-entry.d.ts +255 -0
  241. package/src/features/font-table/font-table-entry.js +823 -0
  242. package/src/features/font-table/font-table.d.ts +128 -0
  243. package/src/features/font-table/font-table.js +313 -0
  244. package/src/features/font-table/index.d.ts +27 -0
  245. package/src/features/font-table/index.js +48 -0
  246. package/src/features/glossary/index.d.ts +97 -0
  247. package/src/features/glossary/index.js +286 -0
  248. package/src/features/headers-footers/index.d.ts +506 -0
  249. package/src/features/headers-footers/index.js +1666 -0
  250. package/src/features/hyperlinks/index.d.ts +230 -0
  251. package/src/features/hyperlinks/index.js +685 -0
  252. package/src/features/images/caption-authoring-api.d.ts +33 -0
  253. package/src/features/images/caption-authoring-api.js +33 -0
  254. package/src/features/images/caption-enums.d.ts +52 -0
  255. package/src/features/images/caption-enums.js +141 -0
  256. package/src/features/images/caption-host.d.ts +10 -0
  257. package/src/features/images/caption-host.js +21 -0
  258. package/src/features/images/captions.d.ts +13 -0
  259. package/src/features/images/captions.js +142 -0
  260. package/src/features/images/host-codec.d.ts +103 -0
  261. package/src/features/images/host-codec.js +720 -0
  262. package/src/features/images/image-sniff.d.ts +21 -0
  263. package/src/features/images/image-sniff.js +71 -0
  264. package/src/features/images/index.d.ts +506 -0
  265. package/src/features/images/index.js +1429 -0
  266. package/src/features/images/layout-types.d.ts +232 -0
  267. package/src/features/images/layout-types.js +294 -0
  268. package/src/features/images/public-entry.d.ts +9 -0
  269. package/src/features/images/public-entry.js +9 -0
  270. package/src/features/index.d.ts +35 -0
  271. package/src/features/index.js +36 -0
  272. package/src/features/mail-merge/index.d.ts +113 -0
  273. package/src/features/mail-merge/index.js +315 -0
  274. package/src/features/notes/index.d.ts +573 -0
  275. package/src/features/notes/index.js +1725 -0
  276. package/src/features/numbering/abstract-numbering.d.ts +90 -0
  277. package/src/features/numbering/abstract-numbering.js +292 -0
  278. package/src/features/numbering/index.d.ts +182 -0
  279. package/src/features/numbering/index.js +668 -0
  280. package/src/features/numbering/list-format.d.ts +158 -0
  281. package/src/features/numbering/list-format.js +590 -0
  282. package/src/features/numbering/list-string.d.ts +7 -0
  283. package/src/features/numbering/list-string.js +423 -0
  284. package/src/features/numbering/list-style.d.ts +204 -0
  285. package/src/features/numbering/list-style.js +1084 -0
  286. package/src/features/numbering/numbering-instance.d.ts +101 -0
  287. package/src/features/numbering/numbering-instance.js +329 -0
  288. package/src/features/numbering/numbering-level.d.ts +118 -0
  289. package/src/features/numbering/numbering-level.js +501 -0
  290. package/src/features/numbering/picture-bullet.d.ts +34 -0
  291. package/src/features/numbering/picture-bullet.js +88 -0
  292. package/src/features/ole-object/catalog.d.ts +300 -0
  293. package/src/features/ole-object/catalog.js +908 -0
  294. package/src/features/ole-object/index.d.ts +526 -0
  295. package/src/features/ole-object/index.js +1421 -0
  296. package/src/features/ole-object/relationship.d.ts +27 -0
  297. package/src/features/ole-object/relationship.js +27 -0
  298. package/src/features/ole-object/typed-dom.d.ts +186 -0
  299. package/src/features/ole-object/typed-dom.js +595 -0
  300. package/src/features/properties/index.d.ts +205 -0
  301. package/src/features/properties/index.js +549 -0
  302. package/src/features/revisions/index.d.ts +204 -0
  303. package/src/features/revisions/index.js +695 -0
  304. package/src/features/sections/column-collection.d.ts +119 -0
  305. package/src/features/sections/column-collection.js +478 -0
  306. package/src/features/sections/column.d.ts +15 -0
  307. package/src/features/sections/column.js +37 -0
  308. package/src/features/sections/index.d.ts +91 -0
  309. package/src/features/sections/index.js +1096 -0
  310. package/src/features/sections/margins.d.ts +40 -0
  311. package/src/features/sections/margins.js +105 -0
  312. package/src/features/sections/page-number-style.d.ts +21 -0
  313. package/src/features/sections/page-number-style.js +62 -0
  314. package/src/features/sections/page-orientation.d.ts +10 -0
  315. package/src/features/sections/page-orientation.js +10 -0
  316. package/src/features/sections/page-setup.d.ts +435 -0
  317. package/src/features/sections/page-setup.js +1479 -0
  318. package/src/features/sections/page-size.d.ts +59 -0
  319. package/src/features/sections/page-size.js +68 -0
  320. package/src/features/sections/section-break-code.d.ts +27 -0
  321. package/src/features/sections/section-break-code.js +60 -0
  322. package/src/features/sections/section-document-association.d.ts +18 -0
  323. package/src/features/sections/section-document-association.js +31 -0
  324. package/src/features/sections/section-validation.d.ts +43 -0
  325. package/src/features/sections/section-validation.js +97 -0
  326. package/src/features/settings/attached-template.d.ts +35 -0
  327. package/src/features/settings/attached-template.js +98 -0
  328. package/src/features/settings/compat-settings.d.ts +216 -0
  329. package/src/features/settings/compat-settings.js +508 -0
  330. package/src/features/settings/document-background.d.ts +59 -0
  331. package/src/features/settings/document-background.js +131 -0
  332. package/src/features/settings/document-protection.d.ts +65 -0
  333. package/src/features/settings/document-protection.js +157 -0
  334. package/src/features/settings/document-settings-facades.d.ts +108 -0
  335. package/src/features/settings/document-settings-facades.js +312 -0
  336. package/src/features/settings/document-settings-values.d.ts +43 -0
  337. package/src/features/settings/document-settings-values.js +60 -0
  338. package/src/features/settings/footnote-properties.d.ts +211 -0
  339. package/src/features/settings/footnote-properties.js +591 -0
  340. package/src/features/settings/index.d.ts +356 -0
  341. package/src/features/settings/index.js +829 -0
  342. package/src/features/settings/settings-children.d.ts +151 -0
  343. package/src/features/settings/settings-children.js +505 -0
  344. package/src/features/settings/web-settings.d.ts +88 -0
  345. package/src/features/settings/web-settings.js +227 -0
  346. package/src/features/settings/zoom.d.ts +79 -0
  347. package/src/features/settings/zoom.js +147 -0
  348. package/src/features/styles/builtin-catalog.d.ts +159 -0
  349. package/src/features/styles/builtin-catalog.js +963 -0
  350. package/src/features/styles/builtin-resolver.d.ts +49 -0
  351. package/src/features/styles/builtin-resolver.js +165 -0
  352. package/src/features/styles/default-styles.d.ts +37 -0
  353. package/src/features/styles/default-styles.js +186 -0
  354. package/src/features/styles/default-theme.d.ts +13 -0
  355. package/src/features/styles/default-theme.js +13 -0
  356. package/src/features/styles/doc-defaults.d.ts +58 -0
  357. package/src/features/styles/doc-defaults.js +178 -0
  358. package/src/features/styles/formatting-resolver.d.ts +27 -0
  359. package/src/features/styles/formatting-resolver.js +72 -0
  360. package/src/features/styles/index.d.ts +256 -0
  361. package/src/features/styles/index.js +1325 -0
  362. package/src/features/styles/latent-styles.d.ts +68 -0
  363. package/src/features/styles/latent-styles.js +305 -0
  364. package/src/features/styles/paragraph-properties.d.ts +71 -0
  365. package/src/features/styles/paragraph-properties.js +237 -0
  366. package/src/features/styles/run-properties.d.ts +93 -0
  367. package/src/features/styles/run-properties.js +516 -0
  368. package/src/features/styles/style-base.d.ts +402 -0
  369. package/src/features/styles/style-base.js +1026 -0
  370. package/src/features/styles/style-collection.d.ts +264 -0
  371. package/src/features/styles/style-collection.js +714 -0
  372. package/src/features/styles/style-format-bridge.d.ts +64 -0
  373. package/src/features/styles/style-format-bridge.js +100 -0
  374. package/src/features/styles/style.d.ts +84 -0
  375. package/src/features/styles/style.js +375 -0
  376. package/src/features/styles/styles-with-effects.d.ts +71 -0
  377. package/src/features/styles/styles-with-effects.js +180 -0
  378. package/src/features/styles/table-style.d.ts +272 -0
  379. package/src/features/styles/table-style.js +1226 -0
  380. package/src/features/styles/theme.d.ts +126 -0
  381. package/src/features/styles/theme.js +377 -0
  382. package/src/features/tables/border-style-map.d.ts +24 -0
  383. package/src/features/tables/border-style-map.js +81 -0
  384. package/src/features/tables/borders.d.ts +126 -0
  385. package/src/features/tables/borders.js +527 -0
  386. package/src/features/tables/collections.d.ts +113 -0
  387. package/src/features/tables/collections.js +261 -0
  388. package/src/features/tables/format.d.ts +208 -0
  389. package/src/features/tables/format.js +716 -0
  390. package/src/features/tables/index.d.ts +597 -0
  391. package/src/features/tables/index.js +2386 -0
  392. package/src/features/tables/paddings.d.ts +41 -0
  393. package/src/features/tables/paddings.js +97 -0
  394. package/src/features/tables/tbl-pr-positioning.d.ts +27 -0
  395. package/src/features/tables/tbl-pr-positioning.js +178 -0
  396. package/src/features/tables/tbl-pr.d.ts +528 -0
  397. package/src/features/tables/tbl-pr.js +1208 -0
  398. package/src/features/tables/tc-pr.d.ts +168 -0
  399. package/src/features/tables/tc-pr.js +553 -0
  400. package/src/features/tables/tr-pr.d.ts +60 -0
  401. package/src/features/tables/tr-pr.js +215 -0
  402. package/src/features/watermark/detect.d.ts +76 -0
  403. package/src/features/watermark/detect.js +219 -0
  404. package/src/features/watermark/index.d.ts +28 -0
  405. package/src/features/watermark/index.js +91 -0
  406. package/src/features/watermark/logical-store.d.ts +29 -0
  407. package/src/features/watermark/logical-store.js +31 -0
  408. package/src/features/watermark/model.d.ts +285 -0
  409. package/src/features/watermark/model.js +597 -0
  410. package/src/features/watermark/parse.d.ts +84 -0
  411. package/src/features/watermark/parse.js +815 -0
  412. package/src/features/watermark/serialize.d.ts +98 -0
  413. package/src/features/watermark/serialize.js +1517 -0
  414. package/src/global.js +1 -0
  415. package/src/index.d.ts +2 -0
  416. package/src/index.js +2 -0
@@ -0,0 +1,963 @@
1
+ /**
2
+ * Centralized built-in style catalog — immutable templates for every built-in
3
+ * style the library recognizes, references, or requires.
4
+ *
5
+ * Design (`docs/specs/styles-builtin-definitions-catalog.md` §2):
6
+ * - Templates are structured data (`BuiltinStyleTemplate`), never serialized
7
+ * XML strings — the serializer consumes the `DocxStyle` graph produced by
8
+ * {@link instantiateBuiltinStyle}.
9
+ * - The catalog is built once at module load into frozen entries held in a
10
+ * `ReadonlyMap`; templates are shared but never mutated (deep-cloned on
11
+ * every instantiation).
12
+ * - Formatting payloads reuse the modeled property subsets from
13
+ * `run-properties.ts` / `paragraph-properties.ts` (single source of truth for
14
+ * parse/serialize/clone) — no duplicate formatting models.
15
+ *
16
+ * Value sourcing (never-invent-OOXML, spec §2.5):
17
+ * - `Normal`, `Heading1`, `Heading2` — normative, mandated by the requirement
18
+ * (spec §2.2–§2.4): Times New Roman 12 pt; Arial 16 pt bold / Arial 14 pt
19
+ * bold-italic, keepNext, spacing before 240 after 60, outlineLvl 0/1.
20
+ * - Style ID ↔ display name and style *type* for every entry —
21
+ * `[MS-OI29500]` §2.1.238/§2.1.242 Word reserved built-in style name table
22
+ * (Word reserves these names with these types).
23
+ * - Heading 3–9 shells (basedOn/next/qFormat/keepNext/240/60/outlineLvl)
24
+ * follow the mandated heading shell (spec §2.5) with the Word heading
25
+ * scale (Arial, bold, 13/12/11/11/11/11/11 pt per level).
26
+ * - `DefaultParagraphFont`, `TableNormal`, `NoList`, `TableGrid`,
27
+ * `Hyperlink` — re-sourced from the shipped Word "Hello World" create-path
28
+ * evidence (`default-styles.ts`, TASK-8027).
29
+ * - Other character/paragraph defaults (`Strong` bold, `Emphasis` italic,
30
+ * reference styles superscript, `FollowedHyperlink` 800080 + single
31
+ * underline, `NoSpacing` suppresses doc-default spacing) — semantic
32
+ * defaults from the style names' documented meaning (ECMA-376-1 §17.7)
33
+ * encoded as the catalog's built-in default; a document's parsed
34
+ * definition always wins (spec §11.1).
35
+ *
36
+ * @private
37
+ */
38
+ var __assign = (this && this.__assign) || function () {
39
+ __assign = Object.assign || function(t) {
40
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
41
+ s = arguments[i];
42
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
43
+ t[p] = s[p];
44
+ }
45
+ return t;
46
+ };
47
+ return __assign.apply(this, arguments);
48
+ };
49
+ var __read = (this && this.__read) || function (o, n) {
50
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
51
+ if (!m) return o;
52
+ var i = m.call(o), r, ar = [], e;
53
+ try {
54
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
55
+ }
56
+ catch (error) { e = { error: error }; }
57
+ finally {
58
+ try {
59
+ if (r && !r.done && (m = i["return"])) m.call(i);
60
+ }
61
+ finally { if (e) throw e.error; }
62
+ }
63
+ return ar;
64
+ };
65
+ var __spread = (this && this.__spread) || function () {
66
+ for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
67
+ return ar;
68
+ };
69
+ import { wmlAttr, wmlElement } from '../document/wml';
70
+ import { EMPTY_MODELED_PARAGRAPH_PROPERTIES, serializeModeledParagraphProperties } from './paragraph-properties';
71
+ import { EMPTY_MODELED_RUN_PROPERTIES, serializeModeledRunProperties } from './run-properties';
72
+ import { DocxStyle } from './style';
73
+ // ---------------------------------------------------------------------------
74
+ // Name normalization and identity
75
+ // ---------------------------------------------------------------------------
76
+ /**
77
+ * Normalize a style name or ID for lookup: lowercase, collapse internal
78
+ * whitespace, strip it entirely. "Heading 1", "heading1", "HEADING 1" all
79
+ * normalize identically.
80
+ *
81
+ * @private
82
+ */
83
+ export function normalizeStyleName(name) {
84
+ return name.trim().toLowerCase().replace(/\s+/g, '');
85
+ }
86
+ // ---------------------------------------------------------------------------
87
+ // Template payloads (typed, per spec §2.2–§2.5)
88
+ // ---------------------------------------------------------------------------
89
+ /** `w:lang` values carried on the Normal style (spec §2.2). */
90
+ var NORMAL_LANG = {
91
+ val: 'en-US',
92
+ eastAsia: 'zh-TW',
93
+ bidi: 'ar-SA',
94
+ };
95
+ /**
96
+ * `Normal` rPr payload — Times New Roman 12 pt (spec §2.2, normative).
97
+ * Half-points: 12 pt → 24.
98
+ */
99
+ var NORMAL_RPR = __assign({}, EMPTY_MODELED_RUN_PROPERTIES, { asciiFont: 'Times New Roman', hAnsiFont: 'Times New Roman', eastAsiaFont: 'Times New Roman', fontSize: (12), fontSizeCs: (12), lang: NORMAL_LANG });
100
+ /**
101
+ * `Normal` pPr payload — structural `w:spacing` (spec §2.2). The empty
102
+ * spacing element carries defined semantic meaning ("no doc-default spacing
103
+ * override on this style"), so it is serialized, not dropped.
104
+ */
105
+ var NORMAL_PPR = __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { spacing: {} });
106
+ /**
107
+ * Shared heading shell pPr (spec §2.5): keepNext, before 240 / after 60
108
+ * (twentieths of a point: 12 pt / 3 pt), outlineLvl per level.
109
+ */
110
+ function headingPpr(outlineLevel) {
111
+ return __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { keepNext: true, spacing: { before: (12), after: (3) }, outlineLevel: outlineLevel });
112
+ }
113
+ /**
114
+ * Heading rPr shell: Arial with ascii/hAnsi/cs attributes (spec §2.3/§2.4
115
+ * — eastAsia omitted because the mandated definitions omit it; `kern` is
116
+ * mandated on Heading 1 only; italic is carried on Heading 2 only — an
117
+ * omitted property is `undefined`, never an explicit false).
118
+ */
119
+ function headingRpr(size, italic, kerning) {
120
+ return __assign({}, EMPTY_MODELED_RUN_PROPERTIES, { asciiFont: 'Arial', hAnsiFont: 'Arial', csFont: 'Arial', bold: true, boldCs: true }, (italic ? { italic: true, italicCs: true } : {}), (kerning ? { kerning: (16) } : {}), { fontSize: size, fontSizeCs: size });
121
+ }
122
+ /**
123
+ * The Word heading scale (font sizes in points per level, evidence: the
124
+ * mandated Heading1/Heading2 values 16/14 pt continuing Word's level scale).
125
+ * Sizes: 16, 14, 13, 12, 12, 11, 11, 11, 11.
126
+ */
127
+ var HEADING_SIZES = [16, 14, 13, 12, 12, 11, 11, 11, 11];
128
+ function headingTemplate(level) {
129
+ var __ts33_0;
130
+ var size = ((__ts33_0 = HEADING_SIZES[level - 1]), __ts33_0 != null ? __ts33_0 : 11);
131
+ var levelText = String(level);
132
+ return {
133
+ styleId: "Heading" + levelText,
134
+ displayName: "Heading " + levelText,
135
+ type: 'paragraph',
136
+ basedOn: 'Normal',
137
+ next: 'Normal',
138
+ uiPriority: 9,
139
+ isQuickFormat: true,
140
+ paragraphFormatting: headingPpr(level - 1),
141
+ characterFormatting: headingRpr((size), level === 2, level === 1),
142
+ };
143
+ }
144
+ /** Reference character style shell: superscript (spec §1.4). */
145
+ function referenceStyle(styleId, displayName) {
146
+ return {
147
+ styleId: styleId,
148
+ displayName: displayName,
149
+ type: 'character',
150
+ basedOn: 'DefaultParagraphFont',
151
+ uiPriority: 99,
152
+ isSemiHidden: true,
153
+ unhideWhenUsed: true,
154
+ characterFormatting: __assign({}, EMPTY_MODELED_RUN_PROPERTIES, { vertAlign: 'superscript' }),
155
+ };
156
+ }
157
+ /** Note text style shell (footnote/endnote/comment text). */
158
+ function noteTextStyle(styleId, displayName) {
159
+ return {
160
+ styleId: styleId,
161
+ displayName: displayName,
162
+ type: 'paragraph',
163
+ basedOn: 'Normal',
164
+ next: 'Normal',
165
+ uiPriority: 99,
166
+ isSemiHidden: true,
167
+ unhideWhenUsed: true,
168
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES),
169
+ characterFormatting: __assign({}, EMPTY_MODELED_RUN_PROPERTIES, EMPTY_MODELED_RUN_PROPERTIES, { fontSize: (10), fontSizeCs: (10) }),
170
+ };
171
+ }
172
+ /**
173
+ * Table cell margin structure shared by `TableNormal`/`TableGrid` (shipped
174
+ * create-path evidence, `default-styles.ts`).
175
+ */
176
+ function tableNormalChildren() {
177
+ var tblInd = wmlElement('tblInd', {
178
+ attributes: [wmlAttr('w', '0'), wmlAttr('type', 'dxa')],
179
+ });
180
+ var cellMar = function (side, width) { return wmlElement(side, { attributes: [wmlAttr('w', width), wmlAttr('type', 'dxa')] }); };
181
+ var tblCellMar = wmlElement('tblCellMar', {
182
+ children: [
183
+ cellMar('top', '0'),
184
+ cellMar('left', '108'),
185
+ cellMar('bottom', '0'),
186
+ cellMar('right', '108'),
187
+ ],
188
+ });
189
+ return [wmlElement('tblPr', { children: [tblInd, tblCellMar] })];
190
+ }
191
+ /** `TableGrid` tblPr: single black sz=4 borders on all six sides (TASK-8027). */
192
+ function tableGridChildren() {
193
+ var tblInd = wmlElement('tblInd', {
194
+ attributes: [wmlAttr('w', '0'), wmlAttr('type', 'dxa')],
195
+ });
196
+ var border = function (side) { return wmlElement(side, {
197
+ attributes: [
198
+ wmlAttr('val', 'single'),
199
+ wmlAttr('sz', '4'),
200
+ wmlAttr('space', '0'),
201
+ wmlAttr('color', '000000'),
202
+ ],
203
+ }); };
204
+ var tblBorders = wmlElement('tblBorders', {
205
+ children: [
206
+ border('top'),
207
+ border('left'),
208
+ border('bottom'),
209
+ border('right'),
210
+ border('insideH'),
211
+ border('insideV'),
212
+ ],
213
+ });
214
+ return [wmlElement('tblPr', { children: [tblInd, tblBorders] })];
215
+ }
216
+ /**
217
+ * Light Shading family: subtle theme/accent header row + light band shading.
218
+ * Color may be a fixed RGB hex or a theme color token (`accent1`…`accent6`).
219
+ */
220
+ function lightShadingChildren(headerColor, bandColor) {
221
+ var isTheme = headerColor.indexOf('accent') === 0;
222
+ var border = function (side) {
223
+ var attrs = [
224
+ wmlAttr('val', 'single'),
225
+ wmlAttr('sz', '4'),
226
+ wmlAttr('space', '0'),
227
+ ];
228
+ if (isTheme) {
229
+ attrs.push(wmlAttr('themeColor', headerColor));
230
+ }
231
+ else {
232
+ attrs.push(wmlAttr('color', headerColor));
233
+ }
234
+ return wmlElement(side, { attributes: attrs });
235
+ };
236
+ var tblBorders = wmlElement('tblBorders', {
237
+ children: [
238
+ border('top'),
239
+ border('left'),
240
+ border('bottom'),
241
+ border('right'),
242
+ border('insideH'),
243
+ border('insideV'),
244
+ ],
245
+ });
246
+ var headerShdAttrs = isTheme
247
+ ? [wmlAttr('val', 'clear'), wmlAttr('themeFill', headerColor)]
248
+ : [wmlAttr('val', 'clear'), wmlAttr('fill', headerColor)];
249
+ var bandShdAttrs = [wmlAttr('val', 'clear'), wmlAttr('fill', bandColor)];
250
+ var firstRow = wmlElement('tblStylePr', {
251
+ attributes: [wmlAttr('type', 'firstRow')],
252
+ children: [
253
+ wmlElement('tcPr', {
254
+ children: [wmlElement('shd', { attributes: headerShdAttrs })],
255
+ }),
256
+ wmlElement('rPr', {
257
+ children: [wmlElement('b'), wmlElement('color', {
258
+ attributes: [wmlAttr('val', 'FFFFFF')],
259
+ })],
260
+ }),
261
+ ],
262
+ });
263
+ var band1 = wmlElement('tblStylePr', {
264
+ attributes: [wmlAttr('type', 'band1Horz')],
265
+ children: [
266
+ wmlElement('tcPr', {
267
+ children: [wmlElement('shd', { attributes: bandShdAttrs })],
268
+ }),
269
+ ],
270
+ });
271
+ return [
272
+ wmlElement('tblPr', { children: [tblBorders] }),
273
+ firstRow,
274
+ band1,
275
+ ];
276
+ }
277
+ function lightShadingTemplate(styleId, displayName, headerColor, bandColor) {
278
+ return {
279
+ styleId: styleId,
280
+ displayName: displayName,
281
+ type: 'table',
282
+ basedOn: 'TableNormal',
283
+ uiPriority: 60,
284
+ isQuickFormat: true,
285
+ tableFormatting: lightShadingChildren(headerColor, bandColor),
286
+ };
287
+ }
288
+ /**
289
+ * Public built-in paragraph style identifiers (canonical OOXML `w:styleId` values).
290
+ *
291
+ * Prefer these constants with {@link Paragraph.applyStyle} so callers do not
292
+ * hard-code style ids. Member values are the wire style ids (e.g. `Heading1`).
293
+ *
294
+ * @public
295
+ */
296
+ export var BuiltInStyle = {
297
+ Normal: 'Normal',
298
+ Heading1: 'Heading1',
299
+ Heading2: 'Heading2',
300
+ };
301
+ /**
302
+ * Public built-in table style identifiers (canonical OOXML `w:styleId` values).
303
+ *
304
+ * Prefer these constants with {@link Table.applyStyle} so callers do not hard-code
305
+ * style ids. Member values are the wire style ids (e.g. `LightShading-Accent1`).
306
+ *
307
+ * @public
308
+ */
309
+ export var BuiltinTableStyle = {
310
+ TableNormal: 'TableNormal',
311
+ TableGrid: 'TableGrid',
312
+ LightShading: 'LightShading',
313
+ LightShadingAccent1: 'LightShading-Accent1',
314
+ LightShadingAccent2: 'LightShading-Accent2',
315
+ LightShadingAccent3: 'LightShading-Accent3',
316
+ LightShadingAccent4: 'LightShading-Accent4',
317
+ LightShadingAccent5: 'LightShading-Accent5',
318
+ LightShadingAccent6: 'LightShading-Accent6',
319
+ };
320
+ // ---------------------------------------------------------------------------
321
+ // The catalog (built once, frozen)
322
+ // ---------------------------------------------------------------------------
323
+ /**
324
+ * Deep-freeze a template and every nested payload object so catalog entries
325
+ * are fully immutable (spec §7). Formatted payloads are plain data; the
326
+ * `wmlElement` table payloads are frozen shallowly (element trees are
327
+ * structurally immutable by construction and cloned on instantiation).
328
+ */
329
+ function deepFreezeTemplate(template) {
330
+ var queue = [template];
331
+ while (queue.length > 0) {
332
+ var value = queue.pop();
333
+ if (value === null || value === undefined || typeof value !== 'object' || Object.isFrozen(value)) {
334
+ continue;
335
+ }
336
+ Object.freeze(value);
337
+ // TS 3.3 / ES5 parity: avoid Object.values.
338
+ var record = value;
339
+ for (var key in record) {
340
+ if (!Object.prototype.hasOwnProperty.call(record, key)) {
341
+ continue;
342
+ }
343
+ var child = record[key];
344
+ if (child !== null && typeof child === 'object') {
345
+ queue.push(child);
346
+ }
347
+ }
348
+ }
349
+ return template;
350
+ }
351
+ var RAW_TEMPLATES = [
352
+ // -- Mandatory / create-path (spec §1.2) --------------------------------
353
+ {
354
+ styleId: 'Normal',
355
+ displayName: 'Normal',
356
+ type: 'paragraph',
357
+ isDefault: true,
358
+ isQuickFormat: true,
359
+ paragraphFormatting: NORMAL_PPR,
360
+ characterFormatting: NORMAL_RPR,
361
+ },
362
+ {
363
+ styleId: 'DefaultParagraphFont',
364
+ displayName: 'Default Paragraph Font',
365
+ type: 'character',
366
+ isDefault: true,
367
+ uiPriority: 1,
368
+ isSemiHidden: true,
369
+ unhideWhenUsed: true,
370
+ },
371
+ {
372
+ styleId: 'TableNormal',
373
+ displayName: 'Normal Table',
374
+ type: 'table',
375
+ isDefault: true,
376
+ uiPriority: 99,
377
+ isSemiHidden: true,
378
+ unhideWhenUsed: true,
379
+ tableFormatting: tableNormalChildren(),
380
+ },
381
+ {
382
+ styleId: 'NoList',
383
+ displayName: 'No List',
384
+ type: 'numbering',
385
+ isDefault: true,
386
+ uiPriority: 99,
387
+ isSemiHidden: true,
388
+ unhideWhenUsed: true,
389
+ },
390
+ {
391
+ styleId: 'TableGrid',
392
+ displayName: 'Table Grid',
393
+ type: 'table',
394
+ basedOn: 'TableNormal',
395
+ tableFormatting: tableGridChildren(),
396
+ },
397
+ lightShadingTemplate('LightShading', 'Light Shading', '000000', 'E7E6E6'),
398
+ lightShadingTemplate('LightShading-Accent1', 'Light Shading Accent 1', 'accent1', 'D6DCE4'),
399
+ lightShadingTemplate('LightShading-Accent2', 'Light Shading Accent 2', 'accent2', 'F7D9C8'),
400
+ lightShadingTemplate('LightShading-Accent3', 'Light Shading Accent 3', 'accent3', 'E2EFD9'),
401
+ lightShadingTemplate('LightShading-Accent4', 'Light Shading Accent 4', 'accent4', 'FFF2CC'),
402
+ lightShadingTemplate('LightShading-Accent5', 'Light Shading Accent 5', 'accent5', 'DDEBF7'),
403
+ lightShadingTemplate('LightShading-Accent6', 'Light Shading Accent 6', 'accent6', 'FCE4D6'),
404
+ {
405
+ styleId: 'Hyperlink',
406
+ displayName: 'Hyperlink',
407
+ type: 'character',
408
+ basedOn: 'DefaultParagraphFont',
409
+ characterFormatting: __assign({}, EMPTY_MODELED_RUN_PROPERTIES, { color: '0000FF', underline: { kind: 'single', color: undefined } }),
410
+ },
411
+ // -- Headings (spec §1.3; §2.3/§2.4 normative for 1/2) -------------------
412
+ headingTemplate(1),
413
+ headingTemplate(2),
414
+ headingTemplate(3),
415
+ headingTemplate(4),
416
+ headingTemplate(5),
417
+ headingTemplate(6),
418
+ headingTemplate(7),
419
+ headingTemplate(8),
420
+ headingTemplate(9),
421
+ // -- WordDocument structure paragraph styles --------------------------------
422
+ {
423
+ styleId: 'NoSpacing',
424
+ displayName: 'No Spacing',
425
+ type: 'paragraph',
426
+ basedOn: 'Normal',
427
+ next: 'Normal',
428
+ uiPriority: 1,
429
+ isQuickFormat: true,
430
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { spacing: { after: (0), lineSpacing: (12), lineRule: 'auto' } }),
431
+ },
432
+ {
433
+ styleId: 'Title',
434
+ displayName: 'Title',
435
+ type: 'paragraph',
436
+ basedOn: 'Normal',
437
+ next: 'Normal',
438
+ uiPriority: 10,
439
+ isQuickFormat: true,
440
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { spacing: { after: (0), lineSpacing: (12), lineRule: 'auto' } }),
441
+ characterFormatting: __assign({}, EMPTY_MODELED_RUN_PROPERTIES, { asciiFont: 'Calibri Light', hAnsiFont: 'Calibri Light', eastAsiaFont: 'Calibri Light', csFont: 'Calibri Light', fontSize: (28), fontSizeCs: (28), kerning: (14) }),
442
+ },
443
+ {
444
+ styleId: 'Subtitle',
445
+ displayName: 'Subtitle',
446
+ type: 'paragraph',
447
+ basedOn: 'Normal',
448
+ next: 'Normal',
449
+ uiPriority: 11,
450
+ isQuickFormat: true,
451
+ characterFormatting: __assign({}, EMPTY_MODELED_RUN_PROPERTIES, { color: '595959', asciiFont: 'Calibri Light', hAnsiFont: 'Calibri Light', eastAsiaFont: 'Calibri Light', csFont: 'Calibri Light', fontSize: (12), fontSizeCs: (12), italic: true, italicCs: true }),
452
+ },
453
+ {
454
+ styleId: 'BodyText',
455
+ displayName: 'Body Text',
456
+ type: 'paragraph',
457
+ basedOn: 'Normal',
458
+ next: 'Normal',
459
+ uiPriority: 99,
460
+ isSemiHidden: true,
461
+ unhideWhenUsed: true,
462
+ },
463
+ {
464
+ styleId: 'BodyText2',
465
+ displayName: 'Body Text 2',
466
+ type: 'paragraph',
467
+ basedOn: 'BodyText',
468
+ next: 'BodyText',
469
+ uiPriority: 99,
470
+ isSemiHidden: true,
471
+ unhideWhenUsed: true,
472
+ characterFormatting: __assign({}, EMPTY_MODELED_RUN_PROPERTIES, { fontSize: (11), fontSizeCs: (11) }),
473
+ },
474
+ {
475
+ styleId: 'BodyText3',
476
+ displayName: 'Body Text 3',
477
+ type: 'paragraph',
478
+ basedOn: 'BodyText',
479
+ next: 'BodyText',
480
+ uiPriority: 99,
481
+ isSemiHidden: true,
482
+ unhideWhenUsed: true,
483
+ characterFormatting: __assign({}, EMPTY_MODELED_RUN_PROPERTIES, { fontSize: (10), fontSizeCs: (10) }),
484
+ },
485
+ {
486
+ styleId: 'Caption',
487
+ displayName: 'Caption',
488
+ type: 'paragraph',
489
+ basedOn: 'Normal',
490
+ next: 'Normal',
491
+ uiPriority: 35,
492
+ isQuickFormat: true,
493
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { spacing: { after: (6), lineSpacing: (12), lineRule: 'auto' } }),
494
+ characterFormatting: __assign({}, EMPTY_MODELED_RUN_PROPERTIES, { color: '595959', italic: true, italicCs: true, fontSize: (9), fontSizeCs: (9) }),
495
+ },
496
+ {
497
+ styleId: 'Quote',
498
+ displayName: 'Quote',
499
+ type: 'paragraph',
500
+ basedOn: 'Normal',
501
+ next: 'Normal',
502
+ uiPriority: 29,
503
+ isQuickFormat: true,
504
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { indentation: { left: (18), right: (18) } }),
505
+ characterFormatting: __assign({}, EMPTY_MODELED_RUN_PROPERTIES, { color: '595959', italic: true, italicCs: true }),
506
+ },
507
+ {
508
+ styleId: 'IntenseQuote',
509
+ displayName: 'Intense Quote',
510
+ type: 'paragraph',
511
+ basedOn: 'Normal',
512
+ next: 'Normal',
513
+ uiPriority: 30,
514
+ isQuickFormat: true,
515
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { indentation: { left: (18), right: (18) } }),
516
+ characterFormatting: __assign({}, EMPTY_MODELED_RUN_PROPERTIES, { color: '595959', italic: true, italicCs: true }),
517
+ },
518
+ {
519
+ styleId: 'ListParagraph',
520
+ displayName: 'List Paragraph',
521
+ type: 'paragraph',
522
+ basedOn: 'Normal',
523
+ next: 'Normal',
524
+ uiPriority: 34,
525
+ isQuickFormat: true,
526
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { contextualSpacing: true, indentation: { left: (18), hanging: (18) } }),
527
+ },
528
+ // -- List paragraph styles (spec §1.3; numId never hard-wired, §1.6) ----
529
+ {
530
+ styleId: 'List',
531
+ displayName: 'List',
532
+ type: 'paragraph',
533
+ basedOn: 'Normal',
534
+ next: 'Normal',
535
+ uiPriority: 99,
536
+ isSemiHidden: true,
537
+ unhideWhenUsed: true,
538
+ },
539
+ {
540
+ styleId: 'List2',
541
+ displayName: 'List 2',
542
+ type: 'paragraph',
543
+ basedOn: 'List',
544
+ next: 'List',
545
+ uiPriority: 99,
546
+ isSemiHidden: true,
547
+ unhideWhenUsed: true,
548
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { indentation: { left: (36) } }),
549
+ },
550
+ {
551
+ styleId: 'List3',
552
+ displayName: 'List 3',
553
+ type: 'paragraph',
554
+ basedOn: 'List',
555
+ next: 'List',
556
+ uiPriority: 99,
557
+ isSemiHidden: true,
558
+ unhideWhenUsed: true,
559
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { indentation: { left: (54) } }),
560
+ },
561
+ {
562
+ styleId: 'ListBullet',
563
+ displayName: 'List Bullet',
564
+ type: 'paragraph',
565
+ basedOn: 'Normal',
566
+ next: 'Normal',
567
+ uiPriority: 99,
568
+ isQuickFormat: true,
569
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { indentation: { left: (36), hanging: (18) } }),
570
+ },
571
+ {
572
+ styleId: 'ListBullet2',
573
+ displayName: 'List Bullet 2',
574
+ type: 'paragraph',
575
+ basedOn: 'ListBullet',
576
+ next: 'ListBullet',
577
+ uiPriority: 99,
578
+ isSemiHidden: true,
579
+ unhideWhenUsed: true,
580
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { indentation: { left: (72), hanging: (18) } }),
581
+ },
582
+ {
583
+ styleId: 'ListBullet3',
584
+ displayName: 'List Bullet 3',
585
+ type: 'paragraph',
586
+ basedOn: 'ListBullet',
587
+ next: 'ListBullet',
588
+ uiPriority: 99,
589
+ isSemiHidden: true,
590
+ unhideWhenUsed: true,
591
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { indentation: { left: (108), hanging: (18) } }),
592
+ },
593
+ {
594
+ styleId: 'ListNumber',
595
+ displayName: 'List Number',
596
+ type: 'paragraph',
597
+ basedOn: 'Normal',
598
+ next: 'Normal',
599
+ uiPriority: 99,
600
+ isQuickFormat: true,
601
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { indentation: { left: (36), hanging: (18) } }),
602
+ },
603
+ {
604
+ styleId: 'ListNumber2',
605
+ displayName: 'List Number 2',
606
+ type: 'paragraph',
607
+ basedOn: 'ListNumber',
608
+ next: 'ListNumber',
609
+ uiPriority: 99,
610
+ isSemiHidden: true,
611
+ unhideWhenUsed: true,
612
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { indentation: { left: (72), hanging: (18) } }),
613
+ },
614
+ {
615
+ styleId: 'ListNumber3',
616
+ displayName: 'List Number 3',
617
+ type: 'paragraph',
618
+ basedOn: 'ListNumber',
619
+ next: 'ListNumber',
620
+ uiPriority: 99,
621
+ isSemiHidden: true,
622
+ unhideWhenUsed: true,
623
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { indentation: { left: (108), hanging: (18) } }),
624
+ },
625
+ // -- Header/footer/note text --------------------------------------------
626
+ {
627
+ styleId: 'Header',
628
+ displayName: 'Header',
629
+ type: 'paragraph',
630
+ basedOn: 'Normal',
631
+ next: 'Normal',
632
+ uiPriority: 99,
633
+ isSemiHidden: true,
634
+ unhideWhenUsed: true,
635
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { spacing: { after: (0), lineSpacing: (12), lineRule: 'auto' } }),
636
+ characterFormatting: __assign({}, EMPTY_MODELED_RUN_PROPERTIES),
637
+ },
638
+ {
639
+ styleId: 'Footer',
640
+ displayName: 'Footer',
641
+ type: 'paragraph',
642
+ basedOn: 'Normal',
643
+ next: 'Normal',
644
+ uiPriority: 99,
645
+ isSemiHidden: true,
646
+ unhideWhenUsed: true,
647
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { spacing: { after: (0), lineSpacing: (12), lineRule: 'auto' } }),
648
+ characterFormatting: __assign({}, EMPTY_MODELED_RUN_PROPERTIES),
649
+ },
650
+ noteTextStyle('FootnoteText', 'Footnote Text'),
651
+ noteTextStyle('EndnoteText', 'Endnote Text'),
652
+ noteTextStyle('CommentText', 'Annotation Text'),
653
+ // -- TOC -----------------------------------------------------------------
654
+ {
655
+ styleId: 'TOCHeading',
656
+ displayName: 'TOC Heading',
657
+ type: 'paragraph',
658
+ basedOn: 'Heading1',
659
+ next: 'Normal',
660
+ uiPriority: 39,
661
+ isSemiHidden: true,
662
+ unhideWhenUsed: true,
663
+ isQuickFormat: true,
664
+ },
665
+ {
666
+ styleId: 'TOC1',
667
+ displayName: 'toc 1',
668
+ type: 'paragraph',
669
+ basedOn: 'Normal',
670
+ next: 'Normal',
671
+ uiPriority: 39,
672
+ isSemiHidden: true,
673
+ unhideWhenUsed: true,
674
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { spacing: { after: (5) } }),
675
+ },
676
+ {
677
+ styleId: 'TOC2',
678
+ displayName: 'toc 2',
679
+ type: 'paragraph',
680
+ basedOn: 'Normal',
681
+ next: 'Normal',
682
+ uiPriority: 39,
683
+ isSemiHidden: true,
684
+ unhideWhenUsed: true,
685
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { indentation: { left: (11) } }),
686
+ },
687
+ {
688
+ styleId: 'TOC3',
689
+ displayName: 'toc 3',
690
+ type: 'paragraph',
691
+ basedOn: 'Normal',
692
+ next: 'Normal',
693
+ uiPriority: 39,
694
+ isSemiHidden: true,
695
+ unhideWhenUsed: true,
696
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { indentation: { left: (22) } }),
697
+ },
698
+ {
699
+ styleId: 'TOC4',
700
+ displayName: 'toc 4',
701
+ type: 'paragraph',
702
+ basedOn: 'Normal',
703
+ next: 'Normal',
704
+ uiPriority: 39,
705
+ isSemiHidden: true,
706
+ unhideWhenUsed: true,
707
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { indentation: { left: (33) } }),
708
+ },
709
+ {
710
+ styleId: 'TOC5',
711
+ displayName: 'toc 5',
712
+ type: 'paragraph',
713
+ basedOn: 'Normal',
714
+ next: 'Normal',
715
+ uiPriority: 39,
716
+ isSemiHidden: true,
717
+ unhideWhenUsed: true,
718
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { indentation: { left: (44) } }),
719
+ },
720
+ {
721
+ styleId: 'TOC6',
722
+ displayName: 'toc 6',
723
+ type: 'paragraph',
724
+ basedOn: 'Normal',
725
+ next: 'Normal',
726
+ uiPriority: 39,
727
+ isSemiHidden: true,
728
+ unhideWhenUsed: true,
729
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { indentation: { left: (55) } }),
730
+ },
731
+ {
732
+ styleId: 'TOC7',
733
+ displayName: 'toc 7',
734
+ type: 'paragraph',
735
+ basedOn: 'Normal',
736
+ next: 'Normal',
737
+ uiPriority: 39,
738
+ isSemiHidden: true,
739
+ unhideWhenUsed: true,
740
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { indentation: { left: (66) } }),
741
+ },
742
+ {
743
+ styleId: 'TOC8',
744
+ displayName: 'toc 8',
745
+ type: 'paragraph',
746
+ basedOn: 'Normal',
747
+ next: 'Normal',
748
+ uiPriority: 39,
749
+ isSemiHidden: true,
750
+ unhideWhenUsed: true,
751
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { indentation: { left: (77) } }),
752
+ },
753
+ {
754
+ styleId: 'TOC9',
755
+ displayName: 'toc 9',
756
+ type: 'paragraph',
757
+ basedOn: 'Normal',
758
+ next: 'Normal',
759
+ uiPriority: 39,
760
+ isSemiHidden: true,
761
+ unhideWhenUsed: true,
762
+ paragraphFormatting: __assign({}, EMPTY_MODELED_PARAGRAPH_PROPERTIES, { indentation: { left: (88) } }),
763
+ },
764
+ // -- Character styles ----------------------------------------------------
765
+ {
766
+ styleId: 'FollowedHyperlink',
767
+ displayName: 'Followed Hyperlink',
768
+ type: 'character',
769
+ basedOn: 'DefaultParagraphFont',
770
+ uiPriority: 99,
771
+ isSemiHidden: true,
772
+ unhideWhenUsed: true,
773
+ characterFormatting: __assign({}, EMPTY_MODELED_RUN_PROPERTIES, { color: '800080', underline: { kind: 'single', color: undefined } }),
774
+ },
775
+ {
776
+ styleId: 'Strong',
777
+ displayName: 'Strong',
778
+ type: 'character',
779
+ basedOn: 'DefaultParagraphFont',
780
+ uiPriority: 99,
781
+ isSemiHidden: true,
782
+ unhideWhenUsed: true,
783
+ characterFormatting: __assign({}, EMPTY_MODELED_RUN_PROPERTIES, { bold: true, boldCs: true }),
784
+ },
785
+ {
786
+ styleId: 'Emphasis',
787
+ displayName: 'Emphasis',
788
+ type: 'character',
789
+ basedOn: 'DefaultParagraphFont',
790
+ uiPriority: 99,
791
+ isSemiHidden: true,
792
+ unhideWhenUsed: true,
793
+ characterFormatting: __assign({}, EMPTY_MODELED_RUN_PROPERTIES, { italic: true, italicCs: true }),
794
+ },
795
+ {
796
+ styleId: 'IntenseEmphasis',
797
+ displayName: 'Intense Emphasis',
798
+ type: 'character',
799
+ basedOn: 'DefaultParagraphFont',
800
+ uiPriority: 99,
801
+ isSemiHidden: true,
802
+ unhideWhenUsed: true,
803
+ characterFormatting: __assign({}, EMPTY_MODELED_RUN_PROPERTIES, { color: '0070C0' }),
804
+ },
805
+ {
806
+ styleId: 'SubtleEmphasis',
807
+ displayName: 'Subtle Emphasis',
808
+ type: 'character',
809
+ basedOn: 'DefaultParagraphFont',
810
+ uiPriority: 99,
811
+ isSemiHidden: true,
812
+ unhideWhenUsed: true,
813
+ characterFormatting: __assign({}, EMPTY_MODELED_RUN_PROPERTIES, { color: '0070C0' }),
814
+ },
815
+ {
816
+ styleId: 'BookTitle',
817
+ displayName: 'Book Title',
818
+ type: 'character',
819
+ basedOn: 'DefaultParagraphFont',
820
+ uiPriority: 99,
821
+ isSemiHidden: true,
822
+ unhideWhenUsed: true,
823
+ characterFormatting: __assign({}, EMPTY_MODELED_RUN_PROPERTIES, { asciiFont: 'Times New Roman', hAnsiFont: 'Times New Roman', eastAsiaFont: 'Times New Roman', csFont: 'Times New Roman', fontSize: (20), fontSizeCs: (20), kerning: (10), italic: true, italicCs: true }),
824
+ },
825
+ referenceStyle('FootnoteReference', 'Footnote Reference'),
826
+ referenceStyle('EndnoteReference', 'Endnote Reference'),
827
+ referenceStyle('CommentReference', 'Annotation Reference'),
828
+ ];
829
+ var TEMPLATES = Object.freeze(RAW_TEMPLATES.map(deepFreezeTemplate));
830
+ /**
831
+ * The catalog: canonical ID → template. Built once at module load; entries
832
+ * are frozen and shared immutably.
833
+ */
834
+ var CATALOG = new Map(TEMPLATES.map(function (template) { return [template.styleId, template]; }));
835
+ /** Display-name lookup index (normalized). */
836
+ var CATALOG_BY_NAME = new Map(TEMPLATES.map(function (template) { return [
837
+ normalizeStyleName(template.displayName),
838
+ template,
839
+ ]; }));
840
+ // ---------------------------------------------------------------------------
841
+ // Lookup API (internal — consumed by the resolver, TASK-8066)
842
+ // ---------------------------------------------------------------------------
843
+ /**
844
+ * Look up a template by canonical style ID.
845
+ * @private
846
+ */
847
+ export function getBuiltinStyleTemplate(styleId) {
848
+ return CATALOG.get(styleId);
849
+ }
850
+ /**
851
+ * Look up a template by display name (normalization applied).
852
+ * @private
853
+ */
854
+ export function getBuiltinStyleTemplateByDisplayName(name) {
855
+ return CATALOG_BY_NAME.get(normalizeStyleName(name));
856
+ }
857
+ /**
858
+ * Canonical ID for any known built-in form: canonical ID itself, or the
859
+ * canonical ID whose display name matches (normalized). `undefined` for
860
+ * unknown values — no best-effort guessing.
861
+ *
862
+ * @private
863
+ */
864
+ export function canonicalBuiltinStyleId(nameOrId) {
865
+ var __ts33_1;
866
+ var direct = CATALOG.get(nameOrId);
867
+ if (direct !== undefined) {
868
+ return direct.styleId;
869
+ }
870
+ return ((__ts33_1 = CATALOG_BY_NAME.get(normalizeStyleName(nameOrId))), __ts33_1 == null ? undefined : __ts33_1.styleId);
871
+ }
872
+ /**
873
+ * Frozen snapshot for tests and tooling.
874
+ * @private
875
+ */
876
+ export function listBuiltinStyleTemplates() {
877
+ return TEMPLATES;
878
+ }
879
+ // ---------------------------------------------------------------------------
880
+ // Instantiation (deep clone into a document-owned DocxStyle)
881
+ // ---------------------------------------------------------------------------
882
+ function cloneCharacterFormatting(formatting) {
883
+ if (formatting === undefined) {
884
+ return undefined;
885
+ }
886
+ return __assign({}, formatting, (formatting.underline !== undefined
887
+ ? { underline: __assign({}, formatting.underline) }
888
+ : {}), (formatting.lang !== undefined ? { lang: __assign({}, formatting.lang) } : {}));
889
+ }
890
+ function cloneParagraphFormatting(formatting) {
891
+ if (formatting === undefined) {
892
+ return undefined;
893
+ }
894
+ return __assign({}, formatting, (formatting.spacing !== undefined ? { spacing: __assign({}, formatting.spacing) } : {}), (formatting.indentation !== undefined
895
+ ? { indentation: __assign({}, formatting.indentation) }
896
+ : {}));
897
+ }
898
+ function cloneOpenXmlChildren(children) {
899
+ if (children === undefined) {
900
+ return undefined;
901
+ }
902
+ return children.map(function (child) { return cloneOpenXmlElement(child); });
903
+ }
904
+ function cloneOpenXmlElement(element) {
905
+ return __assign({}, element, { attributes: element.attributes.map(function (attribute) { return (__assign({}, attribute)); }), namespaceDeclarations: element.namespaceDeclarations.map(function (nd) { return (__assign({}, nd)); }), children: element.children.map(function (child) { return child.kind === 'element' ? cloneOpenXmlElement(child) : __assign({}, child); }) });
906
+ }
907
+ /**
908
+ * Instantiate a catalog template as a document-owned `DocxStyle`: deep-clones
909
+ * the shell fields and every nested formatting object into typed `wmlElement`
910
+ * children (via the modeled payload serializers), sharing nothing with the
911
+ * template, the catalog, or any other instantiation.
912
+ *
913
+ * Dependency styles (`basedOn`/`next`/`link`) are referenced by canonical ID
914
+ * and resolved by the resolver (TASK-8066), not here.
915
+ *
916
+ * @private
917
+ */
918
+ export function instantiateBuiltinStyle(template) {
919
+ var children = [
920
+ wmlElement('name', { attributes: [wmlAttr('val', template.displayName)] }),
921
+ ];
922
+ if (template.basedOn !== undefined) {
923
+ children.push(wmlElement('basedOn', { attributes: [wmlAttr('val', template.basedOn)] }));
924
+ }
925
+ if (template.next !== undefined) {
926
+ children.push(wmlElement('next', { attributes: [wmlAttr('val', template.next)] }));
927
+ }
928
+ if (template.link !== undefined) {
929
+ children.push(wmlElement('link', { attributes: [wmlAttr('val', template.link)] }));
930
+ }
931
+ if (template.uiPriority !== undefined) {
932
+ children.push(wmlElement('uiPriority', { attributes: [wmlAttr('val', String(template.uiPriority))] }));
933
+ }
934
+ if (template.isSemiHidden !== undefined && template.isSemiHidden) {
935
+ children.push(wmlElement('semiHidden'));
936
+ }
937
+ if (template.unhideWhenUsed !== undefined && template.unhideWhenUsed) {
938
+ children.push(wmlElement('unhideWhenUsed'));
939
+ }
940
+ if (template.isQuickFormat !== undefined && template.isQuickFormat) {
941
+ children.push(wmlElement('qFormat'));
942
+ }
943
+ var tableFormatting = cloneOpenXmlChildren(template.tableFormatting);
944
+ if (tableFormatting !== undefined) {
945
+ children.push.apply(children, __spread(tableFormatting));
946
+ }
947
+ var paragraphFormatting = cloneParagraphFormatting(template.paragraphFormatting);
948
+ var pPr = paragraphFormatting === undefined
949
+ ? undefined
950
+ : serializeModeledParagraphProperties(paragraphFormatting);
951
+ if (pPr !== undefined) {
952
+ children.push(pPr);
953
+ }
954
+ var characterFormatting = cloneCharacterFormatting(template.characterFormatting);
955
+ var rPr = characterFormatting === undefined
956
+ ? undefined
957
+ : serializeModeledRunProperties(characterFormatting);
958
+ if (rPr !== undefined) {
959
+ children.push(rPr);
960
+ }
961
+ return new DocxStyle(template.styleId, template.type, template.isDefault,
962
+ /* customStyle */ undefined, children);
963
+ }