@nguyenphp/antigravity-marketing 1.0.16 → 1.0.19

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 (376) hide show
  1. package/README.md +187 -74
  2. package/bin/index.js +4 -4
  3. package/package.json +4 -3
  4. package/templates/.agent/agents/backend-specialist.md +263 -0
  5. package/templates/.agent/agents/database-architect.md +226 -0
  6. package/templates/.agent/agents/debugger.md +225 -0
  7. package/templates/.agent/agents/devops-engineer.md +242 -0
  8. package/templates/.agent/agents/documentation-writer.md +104 -0
  9. package/templates/.agent/agents/explorer-agent.md +73 -0
  10. package/templates/.agent/agents/frontend-specialist.md +527 -0
  11. package/templates/.agent/agents/game-developer.md +162 -0
  12. package/templates/.agent/agents/mobile-developer.md +377 -0
  13. package/templates/.agent/agents/orchestrator.md +400 -0
  14. package/templates/.agent/agents/penetration-tester.md +188 -0
  15. package/templates/.agent/agents/performance-optimizer.md +187 -0
  16. package/templates/.agent/agents/project-planner.md +403 -0
  17. package/templates/.agent/agents/security-auditor.md +170 -0
  18. package/templates/.agent/agents/seo-specialist.md +111 -0
  19. package/templates/.agent/agents/test-engineer.md +158 -0
  20. package/templates/.agent/rules/GEMINI.md +248 -0
  21. package/templates/.agent/skills/analytics-marketing/SKILL.md +172 -324
  22. package/templates/.agent/skills/api-patterns/SKILL.md +81 -0
  23. package/templates/.agent/skills/api-patterns/api-style.md +42 -0
  24. package/templates/.agent/skills/api-patterns/auth.md +24 -0
  25. package/templates/.agent/skills/api-patterns/documentation.md +26 -0
  26. package/templates/.agent/skills/api-patterns/graphql.md +41 -0
  27. package/templates/.agent/skills/api-patterns/rate-limiting.md +31 -0
  28. package/templates/.agent/skills/api-patterns/response.md +37 -0
  29. package/templates/.agent/skills/api-patterns/rest.md +40 -0
  30. package/templates/.agent/skills/api-patterns/scripts/api_validator.py +211 -0
  31. package/templates/.agent/skills/api-patterns/security-testing.md +122 -0
  32. package/templates/.agent/skills/api-patterns/trpc.md +41 -0
  33. package/templates/.agent/skills/api-patterns/versioning.md +22 -0
  34. package/templates/.agent/skills/app-builder/SKILL.md +75 -0
  35. package/templates/.agent/skills/app-builder/agent-coordination.md +71 -0
  36. package/templates/.agent/skills/app-builder/feature-building.md +53 -0
  37. package/templates/.agent/skills/app-builder/project-detection.md +34 -0
  38. package/templates/.agent/skills/app-builder/scaffolding.md +118 -0
  39. package/templates/.agent/skills/app-builder/tech-stack.md +40 -0
  40. package/templates/.agent/skills/app-builder/templates/SKILL.md +39 -0
  41. package/templates/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
  42. package/templates/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
  43. package/templates/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
  44. package/templates/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
  45. package/templates/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
  46. package/templates/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
  47. package/templates/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
  48. package/templates/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +82 -0
  49. package/templates/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +100 -0
  50. package/templates/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +106 -0
  51. package/templates/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +101 -0
  52. package/templates/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
  53. package/templates/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +93 -0
  54. package/templates/.agent/skills/architecture/SKILL.md +55 -0
  55. package/templates/.agent/skills/architecture/context-discovery.md +43 -0
  56. package/templates/.agent/skills/architecture/examples.md +94 -0
  57. package/templates/.agent/skills/architecture/pattern-selection.md +68 -0
  58. package/templates/.agent/skills/architecture/patterns-reference.md +50 -0
  59. package/templates/.agent/skills/architecture/trade-off-analysis.md +77 -0
  60. package/templates/.agent/skills/banner-design/SKILL.md +192 -0
  61. package/templates/.agent/skills/banner-design/references/banner-sizes-and-styles.md +118 -0
  62. package/templates/.agent/skills/bash-linux/SKILL.md +199 -0
  63. package/templates/.agent/skills/behavioral-modes/SKILL.md +242 -0
  64. package/templates/.agent/skills/brainstorming/SKILL.md +163 -0
  65. package/templates/.agent/skills/brainstorming/dynamic-questioning.md +350 -0
  66. package/templates/.agent/skills/brand/SKILL.md +97 -0
  67. package/templates/.agent/skills/brand/references/approval-checklist.md +169 -0
  68. package/templates/.agent/skills/brand/references/asset-organization.md +157 -0
  69. package/templates/.agent/skills/brand/references/brand-guideline-template.md +140 -0
  70. package/templates/.agent/skills/brand/references/color-palette-management.md +186 -0
  71. package/templates/.agent/skills/brand/references/consistency-checklist.md +94 -0
  72. package/templates/.agent/skills/brand/references/logo-usage-rules.md +185 -0
  73. package/templates/.agent/skills/brand/references/messaging-framework.md +85 -0
  74. package/templates/.agent/skills/brand/references/typography-specifications.md +214 -0
  75. package/templates/.agent/skills/brand/references/update.md +118 -0
  76. package/templates/.agent/skills/brand/references/visual-identity.md +96 -0
  77. package/templates/.agent/skills/brand/references/voice-framework.md +88 -0
  78. package/templates/.agent/skills/brand/scripts/extract-colors.cjs +341 -0
  79. package/templates/.agent/skills/brand/scripts/inject-brand-context.cjs +349 -0
  80. package/templates/.agent/skills/brand/scripts/sync-brand-to-tokens.cjs +266 -0
  81. package/templates/.agent/skills/brand/scripts/validate-asset.cjs +387 -0
  82. package/templates/.agent/skills/brand/templates/brand-guidelines-starter.md +275 -0
  83. package/templates/.agent/skills/clean-code/SKILL.md +201 -0
  84. package/templates/.agent/skills/code-review-checklist/SKILL.md +109 -0
  85. package/templates/.agent/skills/copywriting/SKILL.md +250 -0
  86. package/templates/.agent/skills/database-design/SKILL.md +52 -0
  87. package/templates/.agent/skills/database-design/database-selection.md +43 -0
  88. package/templates/.agent/skills/database-design/indexing.md +39 -0
  89. package/templates/.agent/skills/database-design/migrations.md +48 -0
  90. package/templates/.agent/skills/database-design/optimization.md +36 -0
  91. package/templates/.agent/skills/database-design/orm-selection.md +30 -0
  92. package/templates/.agent/skills/database-design/schema-design.md +56 -0
  93. package/templates/.agent/skills/database-design/scripts/schema_validator.py +172 -0
  94. package/templates/.agent/skills/deployment-procedures/SKILL.md +241 -0
  95. package/templates/.agent/skills/docker-expert/SKILL.md +409 -0
  96. package/templates/.agent/skills/frontend-design/animation-guide.md +331 -0
  97. package/templates/.agent/skills/frontend-design/color-system.md +311 -0
  98. package/templates/.agent/skills/frontend-design/decision-trees.md +418 -0
  99. package/templates/.agent/skills/frontend-design/motion-graphics.md +306 -0
  100. package/templates/.agent/skills/frontend-design/scripts/accessibility_checker.py +183 -0
  101. package/templates/.agent/skills/frontend-design/scripts/ux_audit.py +722 -0
  102. package/templates/.agent/skills/frontend-design/typography-system.md +345 -0
  103. package/templates/.agent/skills/frontend-design/ux-psychology.md +541 -0
  104. package/templates/.agent/skills/frontend-design/visual-effects.md +383 -0
  105. package/templates/.agent/skills/frontend-slides/SKILL.md +92 -0
  106. package/templates/.agent/skills/frontend-slides/STYLE_PRESETS.md +347 -0
  107. package/templates/.agent/skills/frontend-slides/animation-patterns.md +110 -0
  108. package/templates/.agent/skills/frontend-slides/examples/n8n-jupviec-automation.html +789 -0
  109. package/templates/.agent/skills/frontend-slides/examples/n8n-jupviec-automation.pptx +0 -0
  110. package/templates/.agent/skills/frontend-slides/html-template.md +347 -0
  111. package/templates/.agent/skills/frontend-slides/scripts/export-pptx.py +58 -0
  112. package/templates/.agent/skills/frontend-slides/scripts/extract-pptx.py +96 -0
  113. package/templates/.agent/skills/frontend-slides/viewport-base.css +153 -0
  114. package/templates/.agent/skills/game-development/2d-games/SKILL.md +119 -0
  115. package/templates/.agent/skills/game-development/3d-games/SKILL.md +135 -0
  116. package/templates/.agent/skills/game-development/SKILL.md +167 -0
  117. package/templates/.agent/skills/game-development/game-art/SKILL.md +185 -0
  118. package/templates/.agent/skills/game-development/game-audio/SKILL.md +190 -0
  119. package/templates/.agent/skills/game-development/game-design/SKILL.md +129 -0
  120. package/templates/.agent/skills/game-development/mobile-games/SKILL.md +108 -0
  121. package/templates/.agent/skills/game-development/multiplayer/SKILL.md +132 -0
  122. package/templates/.agent/skills/game-development/pc-games/SKILL.md +144 -0
  123. package/templates/.agent/skills/game-development/vr-ar/SKILL.md +123 -0
  124. package/templates/.agent/skills/game-development/web-games/SKILL.md +150 -0
  125. package/templates/.agent/skills/geo-fundamentals/SKILL.md +156 -0
  126. package/templates/.agent/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
  127. package/templates/.agent/skills/growth-engine/SKILL.md +244 -0
  128. package/templates/.agent/skills/i18n-localization/SKILL.md +154 -0
  129. package/templates/.agent/skills/i18n-localization/scripts/i18n_checker.py +241 -0
  130. package/templates/.agent/skills/lint-and-validate/SKILL.md +45 -0
  131. package/templates/.agent/skills/lint-and-validate/scripts/lint_runner.py +172 -0
  132. package/templates/.agent/skills/lint-and-validate/scripts/type_coverage.py +173 -0
  133. package/templates/.agent/skills/marketing-report-expert/SKILL.md +70 -0
  134. package/templates/.agent/skills/mcp-builder/SKILL.md +176 -0
  135. package/templates/.agent/skills/minimax-docx/LICENSE +21 -0
  136. package/templates/.agent/skills/minimax-docx/SKILL.md +274 -0
  137. package/templates/.agent/skills/minimax-docx/assets/styles/academic_styles.xml +250 -0
  138. package/templates/.agent/skills/minimax-docx/assets/styles/corporate_styles.xml +284 -0
  139. package/templates/.agent/skills/minimax-docx/assets/styles/default_styles.xml +449 -0
  140. package/templates/.agent/skills/minimax-docx/assets/xsd/aesthetic-rules.xsd +470 -0
  141. package/templates/.agent/skills/minimax-docx/assets/xsd/business-rules.xsd +130 -0
  142. package/templates/.agent/skills/minimax-docx/assets/xsd/common-types.xsd +159 -0
  143. package/templates/.agent/skills/minimax-docx/assets/xsd/wml-subset.xsd +589 -0
  144. package/templates/.agent/skills/minimax-docx/references/cjk_typography.md +357 -0
  145. package/templates/.agent/skills/minimax-docx/references/cjk_university_template_guide.md +184 -0
  146. package/templates/.agent/skills/minimax-docx/references/comments_guide.md +191 -0
  147. package/templates/.agent/skills/minimax-docx/references/design_good_bad_examples.md +829 -0
  148. package/templates/.agent/skills/minimax-docx/references/design_principles.md +819 -0
  149. package/templates/.agent/skills/minimax-docx/references/openxml_element_order.md +308 -0
  150. package/templates/.agent/skills/minimax-docx/references/openxml_encyclopedia_part1.md +4061 -0
  151. package/templates/.agent/skills/minimax-docx/references/openxml_encyclopedia_part2.md +2820 -0
  152. package/templates/.agent/skills/minimax-docx/references/openxml_encyclopedia_part3.md +3381 -0
  153. package/templates/.agent/skills/minimax-docx/references/openxml_namespaces.md +82 -0
  154. package/templates/.agent/skills/minimax-docx/references/openxml_units.md +72 -0
  155. package/templates/.agent/skills/minimax-docx/references/scenario_a_create.md +284 -0
  156. package/templates/.agent/skills/minimax-docx/references/scenario_b_edit_content.md +295 -0
  157. package/templates/.agent/skills/minimax-docx/references/scenario_c_apply_template.md +456 -0
  158. package/templates/.agent/skills/minimax-docx/references/track_changes_guide.md +200 -0
  159. package/templates/.agent/skills/minimax-docx/references/troubleshooting.md +506 -0
  160. package/templates/.agent/skills/minimax-docx/references/typography_guide.md +294 -0
  161. package/templates/.agent/skills/minimax-docx/references/xsd_validation_guide.md +158 -0
  162. package/templates/.agent/skills/minimax-docx/scripts/doc_to_docx.sh +40 -0
  163. package/templates/.agent/skills/minimax-docx/scripts/docx_preview.sh +37 -0
  164. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Cli/MiniMaxAIDocx.Cli.csproj +19 -0
  165. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Cli/Program.cs +18 -0
  166. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/AnalyzeCommand.cs +147 -0
  167. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/ApplyTemplateCommand.cs +322 -0
  168. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/CreateCommand.cs +324 -0
  169. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/DiffCommand.cs +155 -0
  170. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/EditContentCommand.cs +487 -0
  171. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/FixOrderCommand.cs +108 -0
  172. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/MergeRunsCommand.cs +122 -0
  173. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/ValidateCommand.cs +107 -0
  174. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/MiniMaxAIDocx.Core.csproj +15 -0
  175. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/CommentSynchronizer.cs +169 -0
  176. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/ElementOrder.cs +80 -0
  177. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/NamespaceConstants.cs +42 -0
  178. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/RunMerger.cs +81 -0
  179. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/StyleAnalyzer.cs +81 -0
  180. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/TrackChangesHelper.cs +99 -0
  181. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/UnitConverter.cs +23 -0
  182. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples.cs +1832 -0
  183. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch1.cs +910 -0
  184. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch2.cs +999 -0
  185. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch3.cs +1048 -0
  186. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch4.cs +1038 -0
  187. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/CharacterFormattingSamples.cs +1020 -0
  188. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/DocumentCreationSamples.cs +1121 -0
  189. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/FieldAndTocSamples.cs +624 -0
  190. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/FootnoteAndCommentSamples.cs +675 -0
  191. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/HeaderFooterSamples.cs +838 -0
  192. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/ImageSamples.cs +917 -0
  193. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/ListAndNumberingSamples.cs +826 -0
  194. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/ParagraphFormattingSamples.cs +1199 -0
  195. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/StyleSystemSamples.cs +1487 -0
  196. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/TableSamples.cs +1163 -0
  197. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/TrackChangesSamples.cs +595 -0
  198. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Typography/CjkHelper.cs +39 -0
  199. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Typography/FontDefaults.cs +24 -0
  200. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Typography/PageSizes.cs +20 -0
  201. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/BusinessRuleValidator.cs +224 -0
  202. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/GateCheckValidator.cs +148 -0
  203. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/ValidationResult.cs +23 -0
  204. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/XsdValidator.cs +69 -0
  205. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.slnx +4 -0
  206. package/templates/.agent/skills/minimax-docx/scripts/env_check.sh +196 -0
  207. package/templates/.agent/skills/minimax-docx/scripts/setup.ps1 +274 -0
  208. package/templates/.agent/skills/minimax-docx/scripts/setup.sh +504 -0
  209. package/templates/.agent/skills/minimax-multimodal-toolkit/SKILL.md +359 -0
  210. package/templates/.agent/skills/minimax-pdf/README.md +222 -0
  211. package/templates/.agent/skills/minimax-pdf/SKILL.md +201 -0
  212. package/templates/.agent/skills/minimax-pdf/design/design.md +381 -0
  213. package/templates/.agent/skills/minimax-pdf/scripts/cover.py +1579 -0
  214. package/templates/.agent/skills/minimax-pdf/scripts/fill_inspect.py +200 -0
  215. package/templates/.agent/skills/minimax-pdf/scripts/fill_write.py +242 -0
  216. package/templates/.agent/skills/minimax-pdf/scripts/make.sh +491 -0
  217. package/templates/.agent/skills/minimax-pdf/scripts/merge.py +112 -0
  218. package/templates/.agent/skills/minimax-pdf/scripts/palette.py +559 -0
  219. package/templates/.agent/skills/minimax-pdf/scripts/reformat_parse.py +374 -0
  220. package/templates/.agent/skills/minimax-pdf/scripts/render_body.py +1055 -0
  221. package/templates/.agent/skills/minimax-pdf/scripts/render_cover.cjs +111 -0
  222. package/templates/.agent/skills/minimax-xlsx/SKILL.md +138 -0
  223. package/templates/.agent/skills/minimax-xlsx/references/create.md +691 -0
  224. package/templates/.agent/skills/minimax-xlsx/references/edit.md +684 -0
  225. package/templates/.agent/skills/minimax-xlsx/references/fix.md +37 -0
  226. package/templates/.agent/skills/minimax-xlsx/references/format.md +768 -0
  227. package/templates/.agent/skills/minimax-xlsx/references/ooxml-cheatsheet.md +231 -0
  228. package/templates/.agent/skills/minimax-xlsx/references/read-analyze.md +97 -0
  229. package/templates/.agent/skills/minimax-xlsx/references/validate.md +772 -0
  230. package/templates/.agent/skills/minimax-xlsx/scripts/formula_check.py +422 -0
  231. package/templates/.agent/skills/minimax-xlsx/scripts/libreoffice_recalc.py +248 -0
  232. package/templates/.agent/skills/minimax-xlsx/scripts/shared_strings_builder.py +163 -0
  233. package/templates/.agent/skills/minimax-xlsx/scripts/style_audit.py +575 -0
  234. package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_add_column.py +395 -0
  235. package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_insert_row.py +274 -0
  236. package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_pack.py +87 -0
  237. package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_reader.py +362 -0
  238. package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_shift_rows.py +396 -0
  239. package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_unpack.py +130 -0
  240. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/[Content_Types].xml +9 -0
  241. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/_rels/.rels +6 -0
  242. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/_rels/workbook.xml.rels +19 -0
  243. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/sharedStrings.xml +33 -0
  244. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/styles.xml +160 -0
  245. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/workbook.xml +30 -0
  246. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/worksheets/sheet1.xml +70 -0
  247. package/templates/.agent/skills/mobile-design/SKILL.md +394 -0
  248. package/templates/.agent/skills/mobile-design/decision-trees.md +516 -0
  249. package/templates/.agent/skills/mobile-design/mobile-backend.md +491 -0
  250. package/templates/.agent/skills/mobile-design/mobile-color-system.md +420 -0
  251. package/templates/.agent/skills/mobile-design/mobile-debugging.md +122 -0
  252. package/templates/.agent/skills/mobile-design/mobile-design-thinking.md +357 -0
  253. package/templates/.agent/skills/mobile-design/mobile-navigation.md +458 -0
  254. package/templates/.agent/skills/mobile-design/mobile-performance.md +767 -0
  255. package/templates/.agent/skills/mobile-design/mobile-testing.md +356 -0
  256. package/templates/.agent/skills/mobile-design/mobile-typography.md +433 -0
  257. package/templates/.agent/skills/mobile-design/platform-android.md +666 -0
  258. package/templates/.agent/skills/mobile-design/platform-ios.md +561 -0
  259. package/templates/.agent/skills/mobile-design/scripts/mobile_audit.py +670 -0
  260. package/templates/.agent/skills/mobile-design/touch-psychology.md +537 -0
  261. package/templates/.agent/skills/nestjs-expert/SKILL.md +552 -0
  262. package/templates/.agent/skills/nextjs-best-practices/SKILL.md +203 -0
  263. package/templates/.agent/skills/nodejs-best-practices/SKILL.md +333 -0
  264. package/templates/.agent/skills/parallel-agents/SKILL.md +175 -0
  265. package/templates/.agent/skills/performance-profiling/SKILL.md +143 -0
  266. package/templates/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
  267. package/templates/.agent/skills/plan-writing/SKILL.md +152 -0
  268. package/templates/.agent/skills/powershell-windows/SKILL.md +167 -0
  269. package/templates/.agent/skills/ppc-advertising/SKILL.md +183 -475
  270. package/templates/.agent/skills/pptx-generator/SKILL.md +249 -0
  271. package/templates/.agent/skills/pptx-generator/references/design-system.md +392 -0
  272. package/templates/.agent/skills/pptx-generator/references/editing.md +162 -0
  273. package/templates/.agent/skills/pptx-generator/references/pitfalls.md +112 -0
  274. package/templates/.agent/skills/pptx-generator/references/pptxgenjs.md +420 -0
  275. package/templates/.agent/skills/pptx-generator/references/slide-types.md +413 -0
  276. package/templates/.agent/skills/prisma-expert/SKILL.md +355 -0
  277. package/templates/.agent/skills/python-patterns/SKILL.md +441 -0
  278. package/templates/.agent/skills/react-patterns/SKILL.md +198 -0
  279. package/templates/.agent/skills/red-team-tactics/SKILL.md +199 -0
  280. package/templates/.agent/skills/remotion-best-practices/SKILL.md +45 -111
  281. package/templates/.agent/skills/remotion-best-practices/rules/3d.md +4 -4
  282. package/templates/.agent/skills/remotion-best-practices/rules/animations.md +5 -7
  283. package/templates/.agent/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
  284. package/templates/.agent/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
  285. package/templates/.agent/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +103 -0
  286. package/templates/.agent/skills/remotion-best-practices/rules/assets.md +78 -0
  287. package/templates/.agent/skills/remotion-best-practices/rules/audio-visualization.md +198 -0
  288. package/templates/.agent/skills/remotion-best-practices/rules/audio.md +1 -4
  289. package/templates/.agent/skills/remotion-best-practices/rules/calculate-metadata.md +47 -17
  290. package/templates/.agent/skills/remotion-best-practices/rules/can-decode.md +75 -0
  291. package/templates/.agent/skills/remotion-best-practices/rules/charts.md +80 -48
  292. package/templates/.agent/skills/remotion-best-practices/rules/compositions.md +22 -14
  293. package/templates/.agent/skills/remotion-best-practices/rules/display-captions.md +79 -21
  294. package/templates/.agent/skills/remotion-best-practices/rules/extract-frames.md +229 -0
  295. package/templates/.agent/skills/remotion-best-practices/rules/ffmpeg.md +38 -0
  296. package/templates/.agent/skills/remotion-best-practices/rules/fonts.md +96 -54
  297. package/templates/.agent/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
  298. package/templates/.agent/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
  299. package/templates/.agent/skills/remotion-best-practices/rules/get-video-duration.md +60 -0
  300. package/templates/.agent/skills/remotion-best-practices/rules/gifs.md +21 -18
  301. package/templates/.agent/skills/remotion-best-practices/rules/images.md +6 -2
  302. package/templates/.agent/skills/remotion-best-practices/rules/import-srt-captions.md +69 -0
  303. package/templates/.agent/skills/remotion-best-practices/rules/light-leaks.md +73 -0
  304. package/templates/.agent/skills/remotion-best-practices/rules/lottie.md +10 -7
  305. package/templates/.agent/skills/remotion-best-practices/rules/maps.md +412 -0
  306. package/templates/.agent/skills/remotion-best-practices/rules/measuring-dom-nodes.md +34 -0
  307. package/templates/.agent/skills/remotion-best-practices/rules/measuring-text.md +140 -0
  308. package/templates/.agent/skills/remotion-best-practices/rules/parameters.md +109 -0
  309. package/templates/.agent/skills/remotion-best-practices/rules/sequencing.md +13 -1
  310. package/templates/.agent/skills/remotion-best-practices/rules/sfx.md +26 -0
  311. package/templates/.agent/skills/remotion-best-practices/rules/subtitles.md +36 -0
  312. package/templates/.agent/skills/remotion-best-practices/rules/tailwind.md +11 -0
  313. package/templates/.agent/skills/remotion-best-practices/rules/text-animations.md +4 -115
  314. package/templates/.agent/skills/remotion-best-practices/rules/timing.md +19 -19
  315. package/templates/.agent/skills/remotion-best-practices/rules/transcribe-captions.md +70 -0
  316. package/templates/.agent/skills/remotion-best-practices/rules/transitions.md +117 -42
  317. package/templates/.agent/skills/remotion-best-practices/rules/transparent-videos.md +106 -0
  318. package/templates/.agent/skills/remotion-best-practices/rules/trimming.md +51 -0
  319. package/templates/.agent/skills/remotion-best-practices/rules/voiceover.md +99 -0
  320. package/templates/.agent/skills/seo-fundamentals/SKILL.md +83 -441
  321. package/templates/.agent/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
  322. package/templates/.agent/skills/server-management/SKILL.md +161 -0
  323. package/templates/.agent/skills/systematic-debugging/SKILL.md +109 -0
  324. package/templates/.agent/skills/tdd-workflow/SKILL.md +149 -0
  325. package/templates/.agent/skills/testing-patterns/SKILL.md +178 -0
  326. package/templates/.agent/skills/testing-patterns/scripts/test_runner.py +219 -0
  327. package/templates/.agent/skills/tutorial-video-expert/SKILL.md +88 -0
  328. package/templates/.agent/skills/typescript-expert/SKILL.md +429 -0
  329. package/templates/.agent/skills/ui-ux-pro-max/SKILL.md +1 -1
  330. package/templates/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
  331. package/templates/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
  332. package/templates/.agent/skills/ui-ux-pro-max/data/icons.csv +101 -0
  333. package/templates/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
  334. package/templates/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
  335. package/templates/.agent/skills/ui-ux-pro-max/data/prompts.csv +24 -0
  336. package/templates/.agent/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  337. package/templates/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  338. package/templates/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  339. package/templates/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  340. package/templates/.agent/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  341. package/templates/.agent/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  342. package/templates/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  343. package/templates/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  344. package/templates/.agent/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  345. package/templates/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  346. package/templates/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  347. package/templates/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  348. package/templates/.agent/skills/ui-ux-pro-max/data/styles.csv +59 -0
  349. package/templates/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
  350. package/templates/.agent/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  351. package/templates/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  352. package/templates/.agent/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  353. package/templates/.agent/skills/ui-ux-pro-max/scripts/core.py +257 -0
  354. package/templates/.agent/skills/ui-ux-pro-max/scripts/design_system.py +487 -0
  355. package/templates/.agent/skills/ui-ux-pro-max/scripts/search.py +76 -0
  356. package/templates/.agent/skills/vision-analysis/SKILL.md +174 -0
  357. package/templates/.agent/skills/vue-expert/SKILL.md +374 -0
  358. package/templates/.agent/skills/vulnerability-scanner/SKILL.md +276 -0
  359. package/templates/.agent/skills/vulnerability-scanner/checklists.md +121 -0
  360. package/templates/.agent/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
  361. package/templates/.agent/skills/webapp-testing/SKILL.md +187 -0
  362. package/templates/.agent/skills/webapp-testing/scripts/playwright_runner.py +173 -0
  363. package/templates/.agent/workflows/analyze.md +3 -0
  364. package/templates/.agent/workflows/brainstorm.md +113 -0
  365. package/templates/.agent/workflows/brand-report.md +44 -0
  366. package/templates/.agent/workflows/create.md +59 -0
  367. package/templates/.agent/workflows/debug.md +103 -0
  368. package/templates/.agent/workflows/deploy.md +176 -0
  369. package/templates/.agent/workflows/enhance.md +63 -0
  370. package/templates/.agent/workflows/orchestrate.md +237 -0
  371. package/templates/.agent/workflows/plan.md +89 -0
  372. package/templates/.agent/workflows/preview.md +80 -0
  373. package/templates/.agent/workflows/report.md +49 -0
  374. package/templates/.agent/workflows/status.md +86 -0
  375. package/templates/.agent/workflows/test.md +144 -0
  376. package/templates/.agent/workflows/ui-ux-pro-max.md +231 -0
@@ -0,0 +1,1020 @@
1
+ using DocumentFormat.OpenXml;
2
+ using DocumentFormat.OpenXml.Wordprocessing;
3
+
4
+ namespace MiniMaxAIDocx.Core.Samples;
5
+
6
+ /// <summary>
7
+ /// Exhaustive reference for every RunProperties (w:rPr) child element in OpenXML.
8
+ /// Each method demonstrates one formatting category with full XML doc comments,
9
+ /// unit explanations, and gotchas. All code compiles against DocumentFormat.OpenXml 3.5.1.
10
+ /// </summary>
11
+ public static class CharacterFormattingSamples
12
+ {
13
+ // ──────────────────────────────────────────────────────────────────
14
+ // 1. Font Family (w:rFonts)
15
+ // ──────────────────────────────────────────────────────────────────
16
+
17
+ /// <summary>
18
+ /// Sets the font family on a run using all four font slots defined in OOXML.
19
+ /// <para>
20
+ /// <b>The four font slots:</b>
21
+ /// <list type="bullet">
22
+ /// <item><b>Ascii</b> — Used for characters in the Basic Latin range (U+0000–U+007F).
23
+ /// This is the primary slot for English text.</item>
24
+ /// <item><b>HighAnsi</b> — Used for characters above U+007F that are NOT East Asian
25
+ /// and NOT Complex Script. Covers Latin Extended, Greek, Cyrillic, etc.
26
+ /// Typically set to the same value as Ascii.</item>
27
+ /// <item><b>EastAsia</b> — Used for CJK Unified Ideographs (U+4E00–U+9FFF),
28
+ /// Hiragana, Katakana, Hangul, CJK Compatibility, etc.
29
+ /// Set this for Chinese / Japanese / Korean content.</item>
30
+ /// <item><b>ComplexScript</b> — Used for Complex Script (BiDi) ranges:
31
+ /// Arabic (U+0600–U+06FF), Hebrew (U+0590–U+05FF), Thai, Devanagari,
32
+ /// and other right-to-left or complex-shaping scripts.</item>
33
+ /// </list>
34
+ /// </para>
35
+ /// <para>
36
+ /// <b>Gotcha:</b> If HighAnsi is not set, Word may fall back to a different font
37
+ /// for characters like accented Latin (e.g., "e" uses Ascii, "e-acute" uses HighAnsi).
38
+ /// Always set both Ascii and HighAnsi together for consistent Western text rendering.
39
+ /// </para>
40
+ /// <para>
41
+ /// <b>Gotcha:</b> RunFonts also supports a <c>Hint</c> attribute
42
+ /// (<see cref="FontTypeHintValues"/>) that tells Word which slot to prefer when a
43
+ /// character could belong to multiple ranges. Values: Default, EastAsia, ComplexScript.
44
+ /// </para>
45
+ /// </summary>
46
+ public static void ApplyFontFamily(Run run)
47
+ {
48
+ var rPr = run.GetOrCreateRunProperties();
49
+
50
+ rPr.RunFonts = new RunFonts
51
+ {
52
+ // Basic Latin characters (U+0000–U+007F)
53
+ Ascii = "Calibri",
54
+
55
+ // Non-CJK, non-complex characters above U+007F (Latin Extended, Greek, Cyrillic)
56
+ HighAnsi = "Calibri",
57
+
58
+ // CJK Ideographs, Hiragana, Katakana, Hangul
59
+ EastAsia = "SimSun",
60
+
61
+ // Arabic, Hebrew, Thai, Devanagari and other complex scripts
62
+ ComplexScript = "Arial",
63
+
64
+ // Hint tells Word which font slot to prefer for ambiguous characters.
65
+ // FontTypeHintValues.EastAsia makes Word prefer the EastAsia slot.
66
+ Hint = FontTypeHintValues.EastAsia
67
+ };
68
+ }
69
+
70
+ // ──────────────────────────────────────────────────────────────────
71
+ // 2. Font Size (w:sz, w:szCs)
72
+ // ──────────────────────────────────────────────────────────────────
73
+
74
+ /// <summary>
75
+ /// Sets the font size on a run.
76
+ /// <para>
77
+ /// <b>Unit:</b> w:sz is in <b>half-points</b>. 12pt = 24 half-points, 10.5pt = 21 half-points.
78
+ /// </para>
79
+ /// <para>
80
+ /// <b>w:szCs</b> (FontSizeComplexScript) controls the size for Complex Script text
81
+ /// (Arabic, Hebrew, etc.). It must be set separately — it does NOT inherit from w:sz.
82
+ /// If you only set w:sz, Arabic/Hebrew text may render at a different size.
83
+ /// </para>
84
+ /// </summary>
85
+ /// <param name="run">The run to modify.</param>
86
+ /// <param name="points">Size in typographic points (e.g., 12.0 for 12pt).</param>
87
+ public static void ApplyFontSize(Run run, double points)
88
+ {
89
+ var rPr = run.GetOrCreateRunProperties();
90
+
91
+ // Convert points to half-points: 12pt → "24"
92
+ var halfPoints = ((int)(points * 2)).ToString();
93
+
94
+ // w:sz — size for Latin / East Asian text
95
+ rPr.FontSize = new FontSize { Val = halfPoints };
96
+
97
+ // w:szCs — size for Complex Script text (Arabic, Hebrew, Thai, etc.)
98
+ // Must be set independently; does NOT inherit from w:sz.
99
+ rPr.FontSizeComplexScript = new FontSizeComplexScript { Val = halfPoints };
100
+ }
101
+
102
+ // ──────────────────────────────────────────────────────────────────
103
+ // 3. Bold and Italic (w:b, w:bCs, w:i, w:iCs)
104
+ // ──────────────────────────────────────────────────────────────────
105
+
106
+ /// <summary>
107
+ /// Applies bold and italic formatting to a run.
108
+ /// <para>
109
+ /// <b>Complex Script variants:</b> w:bCs and w:iCs control bold/italic for Complex
110
+ /// Script text (Arabic, Hebrew). They must be set independently.
111
+ /// </para>
112
+ /// <para>
113
+ /// <b>Gotcha:</b> <c>Bold</c> with no <c>Val</c> attribute means "true".
114
+ /// To explicitly disable bold (override a style), set <c>Val = false</c>.
115
+ /// An absent element means "inherit from style".
116
+ /// </para>
117
+ /// </summary>
118
+ public static void ApplyBoldItalic(Run run)
119
+ {
120
+ var rPr = run.GetOrCreateRunProperties();
121
+
122
+ // Bold for Latin / East Asian text
123
+ // <w:b/> (no val) is equivalent to <w:b w:val="true"/>
124
+ rPr.Bold = new Bold();
125
+
126
+ // Bold for Complex Script (Arabic, Hebrew, etc.)
127
+ rPr.BoldComplexScript = new BoldComplexScript();
128
+
129
+ // Italic for Latin / East Asian text
130
+ rPr.Italic = new Italic();
131
+
132
+ // Italic for Complex Script
133
+ rPr.ItalicComplexScript = new ItalicComplexScript();
134
+
135
+ // To DISABLE bold (e.g., override a bold style), explicitly set Val = false:
136
+ // rPr.Bold = new Bold { Val = false };
137
+ }
138
+
139
+ // ──────────────────────────────────────────────────────────────────
140
+ // 4. Underline (w:u) — ALL UnderlineValues
141
+ // ──────────────────────────────────────────────────────────────────
142
+
143
+ /// <summary>
144
+ /// Demonstrates every underline style available in OOXML.
145
+ /// <para>
146
+ /// <b>Underline color:</b> By default, the underline color matches the text color.
147
+ /// Override with <c>Color</c> (hex) and/or <c>ThemeColor</c>.
148
+ /// </para>
149
+ /// <para>
150
+ /// <b>All 18 styles:</b> Single, Words, Double, Thick, Dotted, DottedHeavy,
151
+ /// Dash, DashedHeavy, DashLong, DashLongHeavy, DotDash, DashDotHeavy,
152
+ /// DotDotDash, DashDotDotHeavy, Wave, WavyHeavy, WavyDouble, None.
153
+ /// </para>
154
+ /// </summary>
155
+ public static void ApplyAllUnderlineStyles(Run run)
156
+ {
157
+ var rPr = run.GetOrCreateRunProperties();
158
+
159
+ // ── Standard underlines ──
160
+ // Single: standard single underline (most common)
161
+ rPr.Underline = new Underline { Val = UnderlineValues.Single };
162
+
163
+ // Words: underlines words only, not spaces
164
+ // rPr.Underline = new Underline { Val = UnderlineValues.Words };
165
+
166
+ // Double: two parallel lines
167
+ // rPr.Underline = new Underline { Val = UnderlineValues.Double };
168
+
169
+ // Thick: single thick line
170
+ // rPr.Underline = new Underline { Val = UnderlineValues.Thick };
171
+
172
+ // ── Dotted variants ──
173
+ // Dotted: dots
174
+ // rPr.Underline = new Underline { Val = UnderlineValues.Dotted };
175
+
176
+ // DottedHeavy: thick dots
177
+ // rPr.Underline = new Underline { Val = UnderlineValues.DottedHeavy };
178
+
179
+ // ── Dash variants ──
180
+ // Dash: short dashes
181
+ // rPr.Underline = new Underline { Val = UnderlineValues.Dash };
182
+
183
+ // DashedHeavy: thick short dashes
184
+ // rPr.Underline = new Underline { Val = UnderlineValues.DashedHeavy };
185
+
186
+ // DashLong: long dashes
187
+ // rPr.Underline = new Underline { Val = UnderlineValues.DashLong };
188
+
189
+ // DashLongHeavy: thick long dashes
190
+ // rPr.Underline = new Underline { Val = UnderlineValues.DashLongHeavy };
191
+
192
+ // ── Dash-dot combinations ──
193
+ // DotDash: alternating dot-dash (._._.)
194
+ // rPr.Underline = new Underline { Val = UnderlineValues.DotDash };
195
+
196
+ // DashDotHeavy: thick dot-dash
197
+ // rPr.Underline = new Underline { Val = UnderlineValues.DashDotHeavy };
198
+
199
+ // DotDotDash: dot-dot-dash (.._.._)
200
+ // rPr.Underline = new Underline { Val = UnderlineValues.DotDotDash };
201
+
202
+ // DashDotDotHeavy: thick dot-dot-dash
203
+ // rPr.Underline = new Underline { Val = UnderlineValues.DashDotDotHeavy };
204
+
205
+ // ── Wave variants ──
206
+ // Wave: wavy line
207
+ // rPr.Underline = new Underline { Val = UnderlineValues.Wave };
208
+
209
+ // WavyHeavy: thick wavy line
210
+ // rPr.Underline = new Underline { Val = UnderlineValues.WavyHeavy };
211
+
212
+ // WavyDouble: double wavy line
213
+ // rPr.Underline = new Underline { Val = UnderlineValues.WavyDouble };
214
+
215
+ // ── Remove underline ──
216
+ // None: explicitly remove underline (override style)
217
+ // rPr.Underline = new Underline { Val = UnderlineValues.None };
218
+
219
+ // ── Underline with custom color ──
220
+ // rPr.Underline = new Underline
221
+ // {
222
+ // Val = UnderlineValues.Single,
223
+ // Color = "FF0000", // Red underline, independent of text color
224
+ // ThemeColor = ThemeColorValues.Accent1 // Or use theme color
225
+ // };
226
+ }
227
+
228
+ // ──────────────────────────────────────────────────────────────────
229
+ // 5. Text Color (w:color)
230
+ // ──────────────────────────────────────────────────────────────────
231
+
232
+ /// <summary>
233
+ /// Sets the text color on a run using hex value and/or theme colors.
234
+ /// <para>
235
+ /// <b>Val:</b> 6-digit hex RGB string WITHOUT the "#" prefix (e.g., "FF0000" for red).
236
+ /// The special value "auto" means the application decides (usually black).
237
+ /// </para>
238
+ /// <para>
239
+ /// <b>ThemeColor:</b> References a theme color slot. When set alongside Val, the
240
+ /// theme color takes precedence in theme-aware applications, but Val is the fallback.
241
+ /// </para>
242
+ /// <para>
243
+ /// <b>ThemeShade:</b> Darkens the theme color. Value is a 2-digit hex string (00–FF).
244
+ /// 00 = no change, FF = fully darkened. Applied as a multiplier.
245
+ /// </para>
246
+ /// <para>
247
+ /// <b>ThemeTint:</b> Lightens the theme color. Value is a 2-digit hex string (00–FF).
248
+ /// 00 = no change, FF = fully lightened (white). Applied as a multiplier.
249
+ /// </para>
250
+ /// <para>
251
+ /// <b>Gotcha:</b> ThemeShade and ThemeTint are mutually exclusive — only one should
252
+ /// be set. If both are present, behavior is undefined.
253
+ /// </para>
254
+ /// </summary>
255
+ public static void ApplyColor(Run run)
256
+ {
257
+ var rPr = run.GetOrCreateRunProperties();
258
+
259
+ // Simple hex color (no theme)
260
+ rPr.Color = new Color { Val = "FF0000" }; // Red
261
+
262
+ // Theme-based color with fallback hex value
263
+ rPr.Color = new Color
264
+ {
265
+ Val = "2F5496", // Fallback hex for non-theme-aware renderers
266
+ ThemeColor = ThemeColorValues.Accent1, // Theme color slot
267
+ ThemeTint = "99" // Lighten: 99 hex → ~60% tint
268
+ };
269
+
270
+ // Theme color darkened
271
+ rPr.Color = new Color
272
+ {
273
+ Val = "1F3864",
274
+ ThemeColor = ThemeColorValues.Accent1,
275
+ ThemeShade = "BF" // Darken: BF hex → ~75% shade
276
+ };
277
+
278
+ // Auto color (application-determined, typically black on white)
279
+ rPr.Color = new Color { Val = "auto" };
280
+ }
281
+
282
+ // ──────────────────────────────────────────────────────────────────
283
+ // 6. Highlight (w:highlight)
284
+ // ──────────────────────────────────────────────────────────────────
285
+
286
+ /// <summary>
287
+ /// Applies text highlighting (the "marker pen" effect in Word's UI).
288
+ /// <para>
289
+ /// <b>All HighlightColorValues:</b> Yellow, Green, Cyan, Magenta, Blue, Red,
290
+ /// DarkBlue, DarkCyan, DarkGreen, DarkMagenta, DarkRed, DarkYellow,
291
+ /// DarkGray, LightGray, Black, White, None.
292
+ /// </para>
293
+ /// <para>
294
+ /// <b>Gotcha:</b> Highlighting is limited to the 17 preset colors above.
295
+ /// For arbitrary background colors, use <see cref="ApplyShading"/> on RunProperties
296
+ /// instead — it supports any hex color.
297
+ /// </para>
298
+ /// </summary>
299
+ public static void ApplyHighlight(Run run)
300
+ {
301
+ var rPr = run.GetOrCreateRunProperties();
302
+
303
+ // Standard yellow highlight (most common for "tracked" or "review" marks)
304
+ rPr.Highlight = new Highlight { Val = HighlightColorValues.Yellow };
305
+
306
+ // All available highlight colors for reference:
307
+ // rPr.Highlight = new Highlight { Val = HighlightColorValues.Green };
308
+ // rPr.Highlight = new Highlight { Val = HighlightColorValues.Cyan };
309
+ // rPr.Highlight = new Highlight { Val = HighlightColorValues.Magenta };
310
+ // rPr.Highlight = new Highlight { Val = HighlightColorValues.Blue };
311
+ // rPr.Highlight = new Highlight { Val = HighlightColorValues.Red };
312
+ // rPr.Highlight = new Highlight { Val = HighlightColorValues.DarkBlue };
313
+ // rPr.Highlight = new Highlight { Val = HighlightColorValues.DarkCyan };
314
+ // rPr.Highlight = new Highlight { Val = HighlightColorValues.DarkGreen };
315
+ // rPr.Highlight = new Highlight { Val = HighlightColorValues.DarkMagenta };
316
+ // rPr.Highlight = new Highlight { Val = HighlightColorValues.DarkRed };
317
+ // rPr.Highlight = new Highlight { Val = HighlightColorValues.DarkYellow };
318
+ // rPr.Highlight = new Highlight { Val = HighlightColorValues.DarkGray };
319
+ // rPr.Highlight = new Highlight { Val = HighlightColorValues.LightGray };
320
+ // rPr.Highlight = new Highlight { Val = HighlightColorValues.Black };
321
+ // rPr.Highlight = new Highlight { Val = HighlightColorValues.White };
322
+ // rPr.Highlight = new Highlight { Val = HighlightColorValues.None }; // Remove
323
+ }
324
+
325
+ // ──────────────────────────────────────────────────────────────────
326
+ // 7. Strikethrough (w:strike, w:dstrike)
327
+ // ──────────────────────────────────────────────────────────────────
328
+
329
+ /// <summary>
330
+ /// Applies strikethrough or double-strikethrough formatting.
331
+ /// <para>
332
+ /// <b>Gotcha:</b> w:strike and w:dstrike are mutually exclusive.
333
+ /// If both are present, behavior is undefined (Word typically uses the last one set).
334
+ /// </para>
335
+ /// </summary>
336
+ public static void ApplyStrikethrough(Run run)
337
+ {
338
+ var rPr = run.GetOrCreateRunProperties();
339
+
340
+ // Single strikethrough: a single horizontal line through the text
341
+ rPr.Strike = new Strike(); // No Val = true
342
+
343
+ // Double strikethrough: two horizontal lines through the text
344
+ // rPr.DoubleStrike = new DoubleStrike();
345
+
346
+ // To explicitly disable (override a style that has strikethrough):
347
+ // rPr.Strike = new Strike { Val = false };
348
+ }
349
+
350
+ // ──────────────────────────────────────────────────────────────────
351
+ // 8. Superscript / Subscript (w:vertAlign)
352
+ // ──────────────────────────────────────────────────────────────────
353
+
354
+ /// <summary>
355
+ /// Applies superscript or subscript vertical alignment.
356
+ /// <para>
357
+ /// <b>Values:</b>
358
+ /// <list type="bullet">
359
+ /// <item><b>Superscript</b> — raised text, reduced size (e.g., x²)</item>
360
+ /// <item><b>Subscript</b> — lowered text, reduced size (e.g., H₂O)</item>
361
+ /// <item><b>Baseline</b> — normal position (use to override style)</item>
362
+ /// </list>
363
+ /// </para>
364
+ /// <para>
365
+ /// <b>Gotcha:</b> This is NOT the same as <see cref="ApplyPosition"/>.
366
+ /// VerticalTextAlignment changes both position AND size (like Word's superscript button).
367
+ /// Position (w:position) only shifts the baseline without changing font size.
368
+ /// </para>
369
+ /// </summary>
370
+ public static void ApplySuperSubscript(Run run)
371
+ {
372
+ var rPr = run.GetOrCreateRunProperties();
373
+
374
+ // Superscript (raised + smaller font)
375
+ rPr.VerticalTextAlignment = new VerticalTextAlignment
376
+ {
377
+ Val = VerticalPositionValues.Superscript
378
+ };
379
+
380
+ // Subscript (lowered + smaller font)
381
+ // rPr.VerticalTextAlignment = new VerticalTextAlignment
382
+ // {
383
+ // Val = VerticalPositionValues.Subscript
384
+ // };
385
+
386
+ // Baseline — explicitly reset to normal (override a style)
387
+ // rPr.VerticalTextAlignment = new VerticalTextAlignment
388
+ // {
389
+ // Val = VerticalPositionValues.Baseline
390
+ // };
391
+ }
392
+
393
+ // ──────────────────────────────────────────────────────────────────
394
+ // 9. Caps / Small Caps (w:caps, w:smallCaps)
395
+ // ──────────────────────────────────────────────────────────────────
396
+
397
+ /// <summary>
398
+ /// Applies ALL CAPS or Small Caps display formatting.
399
+ /// <para>
400
+ /// <b>Caps (w:caps):</b> Displays all characters as uppercase. The underlying text
401
+ /// is NOT modified — it remains lowercase in the XML. This is a display-only transform.
402
+ /// </para>
403
+ /// <para>
404
+ /// <b>SmallCaps (w:smallCaps):</b> Displays lowercase letters as smaller uppercase
405
+ /// glyphs. Original uppercase letters remain full size. Common in legal and academic
406
+ /// documents for author names and section references.
407
+ /// </para>
408
+ /// <para>
409
+ /// <b>Gotcha:</b> w:caps and w:smallCaps are mutually exclusive.
410
+ /// If both are present, w:caps wins.
411
+ /// </para>
412
+ /// </summary>
413
+ public static void ApplyCapsSmallCaps(Run run)
414
+ {
415
+ var rPr = run.GetOrCreateRunProperties();
416
+
417
+ // ALL CAPS display (text stored as-is, displayed uppercase)
418
+ rPr.Caps = new Caps();
419
+
420
+ // Small Caps display (lowercase → small uppercase glyphs)
421
+ // rPr.SmallCaps = new SmallCaps();
422
+
423
+ // Disable (override a style):
424
+ // rPr.Caps = new Caps { Val = false };
425
+ }
426
+
427
+ // ──────────────────────────────────────────────────────────────────
428
+ // 10. Character Spacing (w:spacing)
429
+ // ──────────────────────────────────────────────────────────────────
430
+
431
+ /// <summary>
432
+ /// Adjusts the spacing between characters (tracking / character spacing).
433
+ /// <para>
434
+ /// <b>Unit:</b> Value is in <b>twips</b> (1/20 of a point).
435
+ /// Positive values = expanded (letters spread apart).
436
+ /// Negative values = condensed (letters squeezed together).
437
+ /// </para>
438
+ /// <para>
439
+ /// Examples: 20 twips = 1pt expanded, -10 twips = 0.5pt condensed,
440
+ /// 40 twips = 2pt expanded.
441
+ /// </para>
442
+ /// <para>
443
+ /// <b>Gotcha:</b> This is NOT the same as kerning (w:kern).
444
+ /// Spacing applies a uniform offset between ALL characters.
445
+ /// Kerning adjusts spacing between specific character PAIRS based on font metrics.
446
+ /// </para>
447
+ /// </summary>
448
+ public static void ApplyCharacterSpacing(Run run)
449
+ {
450
+ var rPr = run.GetOrCreateRunProperties();
451
+
452
+ // Expanded by 1pt (20 twips)
453
+ rPr.Spacing = new Spacing { Val = 20 };
454
+
455
+ // Condensed by 0.5pt (-10 twips)
456
+ // rPr.Spacing = new Spacing { Val = -10 };
457
+ }
458
+
459
+ // ──────────────────────────────────────────────────────────────────
460
+ // 11. Position — raised/lowered baseline (w:position)
461
+ // ──────────────────────────────────────────────────────────────────
462
+
463
+ /// <summary>
464
+ /// Raises or lowers the text position relative to the baseline.
465
+ /// <para>
466
+ /// <b>Unit:</b> Value is in <b>half-points</b>.
467
+ /// Positive values = raised above baseline.
468
+ /// Negative values = lowered below baseline.
469
+ /// </para>
470
+ /// <para>
471
+ /// Examples: 6 half-points = 3pt raised, -4 half-points = 2pt lowered.
472
+ /// </para>
473
+ /// <para>
474
+ /// <b>Gotcha:</b> Unlike <see cref="ApplySuperSubscript"/>, Position does NOT change
475
+ /// the font size. It only shifts the vertical position. Use this for fine-tuning
476
+ /// baseline alignment (e.g., aligning inline images with text).
477
+ /// </para>
478
+ /// </summary>
479
+ public static void ApplyPosition(Run run)
480
+ {
481
+ var rPr = run.GetOrCreateRunProperties();
482
+
483
+ // Raise text by 3pt (6 half-points)
484
+ rPr.Position = new Position { Val = "6" };
485
+
486
+ // Lower text by 2pt (-4 half-points)
487
+ // rPr.Position = new Position { Val = "-4" };
488
+ }
489
+
490
+ // ──────────────────────────────────────────────────────────────────
491
+ // 12. Run Shading (w:shd) — arbitrary background color on text
492
+ // ──────────────────────────────────────────────────────────────────
493
+
494
+ /// <summary>
495
+ /// Applies shading (background color) to a run.
496
+ /// <para>
497
+ /// <b>Use case:</b> When you need a background color that is NOT one of the 17
498
+ /// preset highlight colors. Shading supports any hex RGB value.
499
+ /// </para>
500
+ /// <para>
501
+ /// <b>Fill:</b> The background color (hex RGB, e.g., "FFFF00" for yellow).
502
+ /// <b>Val:</b> The shading pattern. Use <c>ShadingPatternValues.Clear</c> for a
503
+ /// solid background fill (most common). Other patterns overlay a foreground color.
504
+ /// <b>Color:</b> The foreground/pattern color (only meaningful for non-Clear patterns).
505
+ /// </para>
506
+ /// <para>
507
+ /// <b>Gotcha:</b> If Val is omitted or set to Nil, the shading may not render.
508
+ /// Always set Val = Clear for solid backgrounds.
509
+ /// </para>
510
+ /// </summary>
511
+ public static void ApplyShading(Run run)
512
+ {
513
+ var rPr = run.GetOrCreateRunProperties();
514
+
515
+ // Solid light-blue background
516
+ rPr.Shading = new Shading
517
+ {
518
+ Val = ShadingPatternValues.Clear, // Solid fill (no pattern)
519
+ Fill = "DAEEF3", // Background color: light blue
520
+ Color = "auto" // Foreground/pattern color: auto
521
+ };
522
+
523
+ // Theme-colored shading
524
+ // rPr.Shading = new Shading
525
+ // {
526
+ // Val = ShadingPatternValues.Clear,
527
+ // Fill = "auto",
528
+ // ThemeFill = ThemeColorValues.Accent1,
529
+ // ThemeFillTint = "33" // Light tint of accent1
530
+ // };
531
+ }
532
+
533
+ // ──────────────────────────────────────────────────────────────────
534
+ // 13. Text Border (w:bdr)
535
+ // ──────────────────────────────────────────────────────────────────
536
+
537
+ /// <summary>
538
+ /// Applies a border around a run of text.
539
+ /// <para>
540
+ /// <b>Val:</b> Border style — Single, Double, Dotted, Dashed, DotDash, DotDotDash,
541
+ /// Triple, ThickThinSmallGap, ThinThickSmallGap, ThickThinMediumGap, etc.
542
+ /// Use <c>BorderValues.None</c> to remove.
543
+ /// </para>
544
+ /// <para>
545
+ /// <b>Size:</b> Border width in <b>eighths of a point</b>. 4 = 0.5pt, 8 = 1pt, 12 = 1.5pt.
546
+ /// Valid range: 2–96 (0.25pt–12pt).
547
+ /// </para>
548
+ /// <para>
549
+ /// <b>Space:</b> Padding between text and border in <b>points</b>. Range: 0–31.
550
+ /// </para>
551
+ /// <para>
552
+ /// <b>Gotcha:</b> Run borders look like "boxed text" in Word. Adjacent runs with
553
+ /// borders will have separate boxes — they do NOT merge into one box.
554
+ /// </para>
555
+ /// </summary>
556
+ public static void ApplyBorder(Run run)
557
+ {
558
+ var rPr = run.GetOrCreateRunProperties();
559
+
560
+ rPr.Border = new Border
561
+ {
562
+ Val = BorderValues.Single, // Single-line border
563
+ Size = 4, // 0.5pt wide (4 eighths of a point)
564
+ Space = 1, // 1pt padding between text and border
565
+ Color = "4472C4" // Border color (blue)
566
+ };
567
+
568
+ // Double border
569
+ // rPr.Border = new Border
570
+ // {
571
+ // Val = BorderValues.Double,
572
+ // Size = 4,
573
+ // Space = 1,
574
+ // Color = "auto"
575
+ // };
576
+
577
+ // Theme-colored border
578
+ // rPr.Border = new Border
579
+ // {
580
+ // Val = BorderValues.Single,
581
+ // Size = 8,
582
+ // Space = 1,
583
+ // Color = "auto",
584
+ // ThemeColor = ThemeColorValues.Accent1
585
+ // };
586
+ }
587
+
588
+ // ──────────────────────────────────────────────────────────────────
589
+ // 14. Run Style Reference (w:rStyle)
590
+ // ──────────────────────────────────────────────────────────────────
591
+
592
+ /// <summary>
593
+ /// Applies a named character style to a run.
594
+ /// <para>
595
+ /// <b>Val:</b> The style ID (not the display name). For example, Word's built-in
596
+ /// "Strong" style has ID "Strong", "Emphasis" has ID "Emphasis".
597
+ /// Custom styles use their internal ID which may differ from the display name.
598
+ /// </para>
599
+ /// <para>
600
+ /// <b>Gotcha:</b> The style must exist in the document's styles.xml (StyleDefinitionsPart).
601
+ /// Referencing a non-existent style ID will not cause an error, but the formatting
602
+ /// defined by that style will not be applied — Word silently ignores unknown style IDs.
603
+ /// </para>
604
+ /// <para>
605
+ /// <b>Gotcha:</b> RunProperties set directly on the run override properties from the
606
+ /// style (direct formatting wins). To inherit everything from the style, do not set
607
+ /// additional properties on the RunProperties.
608
+ /// </para>
609
+ /// </summary>
610
+ public static void ApplyRunStyle(Run run)
611
+ {
612
+ var rPr = run.GetOrCreateRunProperties();
613
+
614
+ // Reference the built-in "Strong" character style (bold)
615
+ rPr.RunStyle = new RunStyle { Val = "Strong" };
616
+
617
+ // Common built-in character style IDs:
618
+ // "Strong" — Bold
619
+ // "Emphasis" — Italic
620
+ // "IntenseEmphasis" — Bold + Italic + Accent color
621
+ // "SubtleEmphasis" — Italic + gray color
622
+ // "BookTitle" — Small caps + spacing
623
+ // "IntenseReference" — Bold + Small caps + Accent color + Underline
624
+ // "SubtleReference" — Small caps + Accent color
625
+ // "Hyperlink" — Blue + Underline
626
+ // "FollowedHyperlink" — Purple + Underline
627
+ // "FootnoteReference" — Superscript
628
+ }
629
+
630
+ // ──────────────────────────────────────────────────────────────────
631
+ // 15. Hidden Text (w:vanish)
632
+ // ──────────────────────────────────────────────────────────────────
633
+
634
+ /// <summary>
635
+ /// Makes text hidden (invisible in normal view, shown with dotted underline
636
+ /// when "Show/Hide" is toggled in Word).
637
+ /// <para>
638
+ /// <b>Use cases:</b> Hidden text for internal notes, index entries, TOC field codes.
639
+ /// Hidden text is NOT printed by default (controlled by Word's print settings).
640
+ /// </para>
641
+ /// <para>
642
+ /// <b>Gotcha:</b> Hidden text still participates in page layout calculations in some
643
+ /// modes. It can affect pagination when revealed.
644
+ /// </para>
645
+ /// </summary>
646
+ public static void ApplyHiddenText(Run run)
647
+ {
648
+ var rPr = run.GetOrCreateRunProperties();
649
+
650
+ // Make text hidden
651
+ rPr.Vanish = new Vanish();
652
+
653
+ // Explicitly un-hide (override a style that hides text):
654
+ // rPr.Vanish = new Vanish { Val = false };
655
+ }
656
+
657
+ // ──────────────────────────────────────────────────────────────────
658
+ // 16. Right-to-Left / Complex Script (w:rtl, w:cs)
659
+ // ──────────────────────────────────────────────────────────────────
660
+
661
+ /// <summary>
662
+ /// Marks a run as right-to-left and/or complex script.
663
+ /// <para>
664
+ /// <b>RightToLeft (w:rtl):</b> Indicates the run contains right-to-left text.
665
+ /// This affects character ordering and cursor movement. Required for Arabic/Hebrew text.
666
+ /// </para>
667
+ /// <para>
668
+ /// <b>ComplexScript (w:cs):</b> Marks the run as containing complex script text.
669
+ /// When set, Word uses the ComplexScript variants of font properties:
670
+ /// w:szCs instead of w:sz, w:bCs instead of w:b, rFonts@cs instead of rFonts@ascii.
671
+ /// </para>
672
+ /// <para>
673
+ /// <b>Gotcha:</b> For Arabic/Hebrew content, you typically need BOTH w:rtl and w:cs.
674
+ /// Thai text needs w:cs but NOT w:rtl (Thai is left-to-right but uses complex shaping).
675
+ /// </para>
676
+ /// </summary>
677
+ public static void ApplyRightToLeft(Run run)
678
+ {
679
+ var rPr = run.GetOrCreateRunProperties();
680
+
681
+ // Mark as right-to-left (for Arabic/Hebrew)
682
+ rPr.RightToLeftText = new RightToLeftText();
683
+
684
+ // Mark as complex script (use CS font/size/bold/italic variants)
685
+ rPr.ComplexScript = new ComplexScript();
686
+ }
687
+
688
+ // ──────────────────────────────────────────────────────────────────
689
+ // 17. Emphasis Mark (w:em) — CJK emphasis dots
690
+ // ──────────────────────────────────────────────────────────────────
691
+
692
+ /// <summary>
693
+ /// Applies emphasis marks (dots/circles above or below characters).
694
+ /// Primarily used in CJK (Chinese, Japanese, Korean) typography.
695
+ /// <para>
696
+ /// <b>Values:</b>
697
+ /// <list type="bullet">
698
+ /// <item><b>Dot</b> — small filled dot above each character (Japanese: 傍点)</item>
699
+ /// <item><b>Comma</b> — small comma-like mark above (used in some CJK styles)</item>
700
+ /// <item><b>Circle</b> — small open circle above each character</item>
701
+ /// <item><b>UnderDot</b> — small filled dot below each character (Chinese style)</item>
702
+ /// <item><b>None</b> — remove emphasis marks</item>
703
+ /// </list>
704
+ /// </para>
705
+ /// <para>
706
+ /// <b>Gotcha:</b> Emphasis marks are distinct from underlines. They appear as individual
707
+ /// marks above/below each character, not as a continuous line.
708
+ /// </para>
709
+ /// </summary>
710
+ public static void ApplyEmphasisMark(Run run)
711
+ {
712
+ var rPr = run.GetOrCreateRunProperties();
713
+
714
+ // Dot emphasis (most common in Japanese)
715
+ rPr.Emphasis = new Emphasis { Val = EmphasisMarkValues.Dot };
716
+
717
+ // Other emphasis mark styles:
718
+ // rPr.Emphasis = new Emphasis { Val = EmphasisMarkValues.Comma };
719
+ // rPr.Emphasis = new Emphasis { Val = EmphasisMarkValues.Circle };
720
+ // rPr.Emphasis = new Emphasis { Val = EmphasisMarkValues.UnderDot };
721
+ // rPr.Emphasis = new Emphasis { Val = EmphasisMarkValues.None };
722
+ }
723
+
724
+ // ──────────────────────────────────────────────────────────────────
725
+ // 18. Kerning (w:kern)
726
+ // ──────────────────────────────────────────────────────────────────
727
+
728
+ /// <summary>
729
+ /// Sets the kerning threshold for automatic font-based kerning.
730
+ /// <para>
731
+ /// <b>Unit:</b> Value is in <b>half-points</b>. Characters at or above this size
732
+ /// will have kerning applied (the font's kern table adjusts spacing between
733
+ /// specific character pairs, e.g., "AV", "To", "WA").
734
+ /// </para>
735
+ /// <para>
736
+ /// <b>Common values:</b>
737
+ /// <list type="bullet">
738
+ /// <item>0 — Disable kerning entirely</item>
739
+ /// <item>2 (1pt) — Kern all text (including body text)</item>
740
+ /// <item>28 (14pt) — Kern only headings (Word's typical default threshold)</item>
741
+ /// </list>
742
+ /// </para>
743
+ /// <para>
744
+ /// <b>Gotcha:</b> Kerning only works if the font contains a kern table.
745
+ /// Most professional fonts (Times New Roman, Calibri, Arial) include kern data.
746
+ /// </para>
747
+ /// </summary>
748
+ public static void ApplyKerning(Run run)
749
+ {
750
+ var rPr = run.GetOrCreateRunProperties();
751
+
752
+ // Kern text at 14pt and above (28 half-points)
753
+ rPr.Kern = new Kern { Val = 28 };
754
+
755
+ // Kern all text regardless of size (0 half-points is "no threshold"
756
+ // but some renderers interpret 0 as "off". Use 1 or 2 to be safe.)
757
+ // rPr.Kern = new Kern { Val = 2 };
758
+ }
759
+
760
+ // ──────────────────────────────────────────────────────────────────
761
+ // 19. Fully Formatted Run (combining multiple properties)
762
+ // ──────────────────────────────────────────────────────────────────
763
+
764
+ /// <summary>
765
+ /// Creates a fully formatted run combining multiple character properties.
766
+ /// Demonstrates the correct way to build a run with RunProperties.
767
+ /// <para>
768
+ /// <b>Key principle:</b> Create RunProperties first, add all child elements,
769
+ /// then set it on the run BEFORE adding text. The run's XML structure must be:
770
+ /// <c>&lt;w:r&gt;&lt;w:rPr&gt;...&lt;/w:rPr&gt;&lt;w:t&gt;text&lt;/w:t&gt;&lt;/w:r&gt;</c>
771
+ /// </para>
772
+ /// <para>
773
+ /// <b>Gotcha:</b> If you add RunProperties AFTER the Text element, it will appear
774
+ /// after w:t in the XML, which is technically invalid OOXML ordering. Word tolerates
775
+ /// it but some third-party parsers may not. Always add rPr first.
776
+ /// </para>
777
+ /// </summary>
778
+ public static Run CreateFullyFormattedRun()
779
+ {
780
+ // Build RunProperties with all desired formatting
781
+ var rPr = new RunProperties();
782
+
783
+ // 1. Style reference (must be first child per schema order)
784
+ rPr.RunStyle = new RunStyle { Val = "Strong" };
785
+
786
+ // 2. Font family
787
+ rPr.RunFonts = new RunFonts
788
+ {
789
+ Ascii = "Georgia",
790
+ HighAnsi = "Georgia",
791
+ EastAsia = "SimSun",
792
+ ComplexScript = "Times New Roman"
793
+ };
794
+
795
+ // 3. Bold
796
+ rPr.Bold = new Bold();
797
+ rPr.BoldComplexScript = new BoldComplexScript();
798
+
799
+ // 4. Italic
800
+ rPr.Italic = new Italic();
801
+ rPr.ItalicComplexScript = new ItalicComplexScript();
802
+
803
+ // 5. Caps — omitted here (mutually exclusive with SmallCaps)
804
+ // rPr.Caps = new Caps();
805
+
806
+ // 6. SmallCaps
807
+ rPr.SmallCaps = new SmallCaps();
808
+
809
+ // 7. Strikethrough
810
+ rPr.Strike = new Strike();
811
+
812
+ // 8. Hidden — typically NOT combined with visible formatting
813
+ // rPr.Vanish = new Vanish();
814
+
815
+ // 9. Color
816
+ rPr.Color = new Color { Val = "2F5496" };
817
+
818
+ // 10. Font size
819
+ rPr.FontSize = new FontSize { Val = "28" }; // 14pt
820
+ rPr.FontSizeComplexScript = new FontSizeComplexScript { Val = "28" };
821
+
822
+ // 11. Underline
823
+ rPr.Underline = new Underline { Val = UnderlineValues.Single };
824
+
825
+ // 12. Shading (text background)
826
+ rPr.Shading = new Shading
827
+ {
828
+ Val = ShadingPatternValues.Clear,
829
+ Fill = "FFFFCC"
830
+ };
831
+
832
+ // 13. Highlight (preset colors only)
833
+ // rPr.Highlight = new Highlight { Val = HighlightColorValues.Yellow };
834
+
835
+ // 14. Character spacing
836
+ rPr.Spacing = new Spacing { Val = 10 }; // 0.5pt expanded
837
+
838
+ // 15. Kerning threshold
839
+ rPr.Kern = new Kern { Val = 2 };
840
+
841
+ // 16. Position (raised/lowered)
842
+ // rPr.Position = new Position { Val = "4" }; // 2pt raised
843
+
844
+ // 17. Vertical alignment (super/subscript)
845
+ // rPr.VerticalTextAlignment = new VerticalTextAlignment
846
+ // {
847
+ // Val = VerticalPositionValues.Superscript
848
+ // };
849
+
850
+ // 18. Border
851
+ rPr.Border = new Border
852
+ {
853
+ Val = BorderValues.Single,
854
+ Size = 4,
855
+ Space = 1,
856
+ Color = "auto"
857
+ };
858
+
859
+ // Build the Run: RunProperties MUST come before Text content
860
+ var run = new Run();
861
+ run.RunProperties = rPr;
862
+
863
+ // Add text content
864
+ // PreserveSpace is needed when text has leading/trailing spaces
865
+ run.AppendChild(new Text("Fully formatted text")
866
+ {
867
+ Space = SpaceProcessingModeValues.Preserve
868
+ });
869
+
870
+ return run;
871
+ }
872
+
873
+ // ──────────────────────────────────────────────────────────────────
874
+ // 20. BuildRunProperties helper — recommended property order
875
+ // ──────────────────────────────────────────────────────────────────
876
+
877
+ /// <summary>
878
+ /// Helper that constructs a RunProperties with elements in the correct schema order.
879
+ /// <para>
880
+ /// <b>OOXML schema order for w:rPr children (ISO 29500-1, section 17.3.2.28):</b>
881
+ /// <list type="number">
882
+ /// <item>w:rStyle — Character style reference</item>
883
+ /// <item>w:rFonts — Font family</item>
884
+ /// <item>w:b — Bold</item>
885
+ /// <item>w:bCs — Bold Complex Script</item>
886
+ /// <item>w:i — Italic</item>
887
+ /// <item>w:iCs — Italic Complex Script</item>
888
+ /// <item>w:caps — All Caps</item>
889
+ /// <item>w:smallCaps — Small Caps</item>
890
+ /// <item>w:strike — Strikethrough</item>
891
+ /// <item>w:dstrike — Double Strikethrough</item>
892
+ /// <item>w:outline — Outline effect</item>
893
+ /// <item>w:shadow — Shadow effect</item>
894
+ /// <item>w:emboss — Emboss effect</item>
895
+ /// <item>w:imprint — Imprint/Engrave effect</item>
896
+ /// <item>w:noProof — Skip proofing</item>
897
+ /// <item>w:snapToGrid — Snap to document grid</item>
898
+ /// <item>w:vanish — Hidden text</item>
899
+ /// <item>w:webHidden — Hidden in web view</item>
900
+ /// <item>w:color — Text color</item>
901
+ /// <item>w:spacing — Character spacing</item>
902
+ /// <item>w:w — Character width scaling (%)</item>
903
+ /// <item>w:kern — Kerning threshold</item>
904
+ /// <item>w:position — Raised/lowered position</item>
905
+ /// <item>w:sz — Font size</item>
906
+ /// <item>w:szCs — Font size Complex Script</item>
907
+ /// <item>w:highlight — Highlight color</item>
908
+ /// <item>w:u — Underline</item>
909
+ /// <item>w:effect — Animation effect (deprecated)</item>
910
+ /// <item>w:bdr — Text border</item>
911
+ /// <item>w:shd — Shading</item>
912
+ /// <item>w:fitText — Fit text to width</item>
913
+ /// <item>w:vertAlign — Vertical alignment (super/subscript)</item>
914
+ /// <item>w:rtl — Right-to-left</item>
915
+ /// <item>w:cs — Complex Script</item>
916
+ /// <item>w:em — Emphasis mark</item>
917
+ /// <item>w:lang — Language</item>
918
+ /// <item>w:eastAsianLayout — East Asian typography</item>
919
+ /// <item>w:specVanish — Special vanish</item>
920
+ /// <item>w:oMath — Math formatting</item>
921
+ /// <item>w:rPrChange — Revision tracking for run properties</item>
922
+ /// </list>
923
+ /// </para>
924
+ /// <para>
925
+ /// <b>Gotcha:</b> When using the strongly-typed SDK (setting properties like
926
+ /// <c>rPr.Bold = new Bold()</c>), the SDK handles ordering automatically when
927
+ /// serializing. However, if you use <c>rPr.AppendChild()</c>, you must add
928
+ /// elements in the correct order yourself, or call
929
+ /// <c>rPr.SetElement()</c> which inserts at the correct position.
930
+ /// </para>
931
+ /// </summary>
932
+ /// <param name="fontFamily">Font name for Ascii and HighAnsi slots. Null to skip.</param>
933
+ /// <param name="sizePoints">Font size in points. Null to skip.</param>
934
+ /// <param name="bold">True to apply bold, false to explicitly disable, null to inherit.</param>
935
+ /// <param name="italic">True to apply italic, false to explicitly disable, null to inherit.</param>
936
+ /// <param name="colorHex">Six-digit hex color (e.g., "FF0000"). Null to skip.</param>
937
+ /// <param name="underline">Underline style. Null to skip.</param>
938
+ /// <returns>A well-ordered RunProperties element ready to attach to a Run.</returns>
939
+ public static RunProperties BuildRunProperties(
940
+ string? fontFamily = null,
941
+ double? sizePoints = null,
942
+ bool? bold = null,
943
+ bool? italic = null,
944
+ string? colorHex = null,
945
+ UnderlineValues? underline = null)
946
+ {
947
+ var rPr = new RunProperties();
948
+
949
+ // Using the strongly-typed properties ensures the SDK serializes
950
+ // child elements in the correct schema order automatically.
951
+
952
+ if (fontFamily is not null)
953
+ {
954
+ rPr.RunFonts = new RunFonts
955
+ {
956
+ Ascii = fontFamily,
957
+ HighAnsi = fontFamily
958
+ };
959
+ }
960
+
961
+ if (bold == true)
962
+ {
963
+ rPr.Bold = new Bold();
964
+ rPr.BoldComplexScript = new BoldComplexScript();
965
+ }
966
+ else if (bold == false)
967
+ {
968
+ rPr.Bold = new Bold { Val = false };
969
+ rPr.BoldComplexScript = new BoldComplexScript { Val = false };
970
+ }
971
+
972
+ if (italic == true)
973
+ {
974
+ rPr.Italic = new Italic();
975
+ rPr.ItalicComplexScript = new ItalicComplexScript();
976
+ }
977
+ else if (italic == false)
978
+ {
979
+ rPr.Italic = new Italic { Val = false };
980
+ rPr.ItalicComplexScript = new ItalicComplexScript { Val = false };
981
+ }
982
+
983
+ if (colorHex is not null)
984
+ {
985
+ rPr.Color = new Color { Val = colorHex };
986
+ }
987
+
988
+ if (sizePoints is not null)
989
+ {
990
+ var halfPts = ((int)(sizePoints.Value * 2)).ToString();
991
+ rPr.FontSize = new FontSize { Val = halfPts };
992
+ rPr.FontSizeComplexScript = new FontSizeComplexScript { Val = halfPts };
993
+ }
994
+
995
+ if (underline is not null)
996
+ {
997
+ rPr.Underline = new Underline { Val = underline };
998
+ }
999
+
1000
+ return rPr;
1001
+ }
1002
+
1003
+ // ──────────────────────────────────────────────────────────────────
1004
+ // Internal helper: get or create RunProperties on a Run
1005
+ // ──────────────────────────────────────────────────────────────────
1006
+
1007
+ /// <summary>
1008
+ /// Gets the existing RunProperties from a run or creates and attaches a new one.
1009
+ /// Ensures RunProperties is always the first child element of the run.
1010
+ /// </summary>
1011
+ private static RunProperties GetOrCreateRunProperties(this Run run)
1012
+ {
1013
+ if (run.RunProperties is not null)
1014
+ return run.RunProperties;
1015
+
1016
+ var rPr = new RunProperties();
1017
+ run.RunProperties = rPr;
1018
+ return rPr;
1019
+ }
1020
+ }