docrev 0.8.1 → 0.8.5

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 (306) hide show
  1. package/.claude/settings.local.json +9 -0
  2. package/PLAN-tables-and-postprocess.md +850 -0
  3. package/README.md +33 -0
  4. package/bin/rev.js +12 -131
  5. package/bin/rev.ts +145 -0
  6. package/dist/bin/rev.d.ts +9 -0
  7. package/dist/bin/rev.d.ts.map +1 -0
  8. package/dist/bin/rev.js +118 -0
  9. package/dist/bin/rev.js.map +1 -0
  10. package/dist/lib/annotations.d.ts +91 -0
  11. package/dist/lib/annotations.d.ts.map +1 -0
  12. package/dist/lib/annotations.js +554 -0
  13. package/dist/lib/annotations.js.map +1 -0
  14. package/dist/lib/build.d.ts +171 -0
  15. package/dist/lib/build.d.ts.map +1 -0
  16. package/dist/lib/build.js +755 -0
  17. package/dist/lib/build.js.map +1 -0
  18. package/dist/lib/citations.d.ts +34 -0
  19. package/dist/lib/citations.d.ts.map +1 -0
  20. package/dist/lib/citations.js +140 -0
  21. package/dist/lib/citations.js.map +1 -0
  22. package/dist/lib/commands/build.d.ts +13 -0
  23. package/dist/lib/commands/build.d.ts.map +1 -0
  24. package/dist/lib/commands/build.js +678 -0
  25. package/dist/lib/commands/build.js.map +1 -0
  26. package/dist/lib/commands/citations.d.ts +11 -0
  27. package/dist/lib/commands/citations.d.ts.map +1 -0
  28. package/dist/lib/commands/citations.js +428 -0
  29. package/dist/lib/commands/citations.js.map +1 -0
  30. package/dist/lib/commands/comments.d.ts +11 -0
  31. package/dist/lib/commands/comments.d.ts.map +1 -0
  32. package/dist/lib/commands/comments.js +883 -0
  33. package/dist/lib/commands/comments.js.map +1 -0
  34. package/dist/lib/commands/context.d.ts +35 -0
  35. package/dist/lib/commands/context.d.ts.map +1 -0
  36. package/dist/lib/commands/context.js +59 -0
  37. package/dist/lib/commands/context.js.map +1 -0
  38. package/dist/lib/commands/core.d.ts +11 -0
  39. package/dist/lib/commands/core.d.ts.map +1 -0
  40. package/dist/lib/commands/core.js +246 -0
  41. package/dist/lib/commands/core.js.map +1 -0
  42. package/dist/lib/commands/doi.d.ts +11 -0
  43. package/dist/lib/commands/doi.d.ts.map +1 -0
  44. package/dist/lib/commands/doi.js +373 -0
  45. package/dist/lib/commands/doi.js.map +1 -0
  46. package/dist/lib/commands/history.d.ts +11 -0
  47. package/dist/lib/commands/history.d.ts.map +1 -0
  48. package/dist/lib/commands/history.js +245 -0
  49. package/dist/lib/commands/history.js.map +1 -0
  50. package/dist/lib/commands/index.d.ts +28 -0
  51. package/dist/lib/commands/index.d.ts.map +1 -0
  52. package/dist/lib/commands/index.js +35 -0
  53. package/dist/lib/commands/index.js.map +1 -0
  54. package/dist/lib/commands/init.d.ts +11 -0
  55. package/dist/lib/commands/init.d.ts.map +1 -0
  56. package/dist/lib/commands/init.js +209 -0
  57. package/dist/lib/commands/init.js.map +1 -0
  58. package/dist/lib/commands/response.d.ts +11 -0
  59. package/dist/lib/commands/response.d.ts.map +1 -0
  60. package/dist/lib/commands/response.js +317 -0
  61. package/dist/lib/commands/response.js.map +1 -0
  62. package/dist/lib/commands/sections.d.ts +11 -0
  63. package/dist/lib/commands/sections.d.ts.map +1 -0
  64. package/dist/lib/commands/sections.js +1071 -0
  65. package/dist/lib/commands/sections.js.map +1 -0
  66. package/dist/lib/commands/utilities.d.ts +19 -0
  67. package/dist/lib/commands/utilities.d.ts.map +1 -0
  68. package/dist/lib/commands/utilities.js +2009 -0
  69. package/dist/lib/commands/utilities.js.map +1 -0
  70. package/dist/lib/comment-realign.d.ts +50 -0
  71. package/dist/lib/comment-realign.d.ts.map +1 -0
  72. package/dist/lib/comment-realign.js +372 -0
  73. package/dist/lib/comment-realign.js.map +1 -0
  74. package/dist/lib/config.d.ts +41 -0
  75. package/dist/lib/config.d.ts.map +1 -0
  76. package/dist/lib/config.js +76 -0
  77. package/dist/lib/config.js.map +1 -0
  78. package/dist/lib/crossref.d.ts +108 -0
  79. package/dist/lib/crossref.d.ts.map +1 -0
  80. package/dist/lib/crossref.js +597 -0
  81. package/dist/lib/crossref.js.map +1 -0
  82. package/dist/lib/dependencies.d.ts +30 -0
  83. package/dist/lib/dependencies.d.ts.map +1 -0
  84. package/dist/lib/dependencies.js +95 -0
  85. package/dist/lib/dependencies.js.map +1 -0
  86. package/dist/lib/doi-cache.d.ts +29 -0
  87. package/dist/lib/doi-cache.d.ts.map +1 -0
  88. package/dist/lib/doi-cache.js +104 -0
  89. package/dist/lib/doi-cache.js.map +1 -0
  90. package/dist/lib/doi.d.ts +65 -0
  91. package/dist/lib/doi.d.ts.map +1 -0
  92. package/dist/lib/doi.js +710 -0
  93. package/dist/lib/doi.js.map +1 -0
  94. package/dist/lib/equations.d.ts +61 -0
  95. package/dist/lib/equations.d.ts.map +1 -0
  96. package/dist/lib/equations.js +445 -0
  97. package/dist/lib/equations.js.map +1 -0
  98. package/dist/lib/errors.d.ts +60 -0
  99. package/dist/lib/errors.d.ts.map +1 -0
  100. package/dist/lib/errors.js +303 -0
  101. package/dist/lib/errors.js.map +1 -0
  102. package/dist/lib/format.d.ts +104 -0
  103. package/dist/lib/format.d.ts.map +1 -0
  104. package/dist/lib/format.js +416 -0
  105. package/dist/lib/format.js.map +1 -0
  106. package/dist/lib/git.d.ts +88 -0
  107. package/dist/lib/git.d.ts.map +1 -0
  108. package/dist/lib/git.js +304 -0
  109. package/dist/lib/git.js.map +1 -0
  110. package/dist/lib/grammar.d.ts +62 -0
  111. package/dist/lib/grammar.d.ts.map +1 -0
  112. package/dist/lib/grammar.js +244 -0
  113. package/dist/lib/grammar.js.map +1 -0
  114. package/dist/lib/image-registry.d.ts +68 -0
  115. package/dist/lib/image-registry.d.ts.map +1 -0
  116. package/dist/lib/image-registry.js +112 -0
  117. package/dist/lib/image-registry.js.map +1 -0
  118. package/dist/lib/import.d.ts +184 -0
  119. package/dist/lib/import.d.ts.map +1 -0
  120. package/dist/lib/import.js +1581 -0
  121. package/dist/lib/import.js.map +1 -0
  122. package/dist/lib/journals.d.ts +55 -0
  123. package/dist/lib/journals.d.ts.map +1 -0
  124. package/dist/lib/journals.js +417 -0
  125. package/dist/lib/journals.js.map +1 -0
  126. package/dist/lib/merge.d.ts +138 -0
  127. package/dist/lib/merge.d.ts.map +1 -0
  128. package/dist/lib/merge.js +603 -0
  129. package/dist/lib/merge.js.map +1 -0
  130. package/dist/lib/orcid.d.ts +36 -0
  131. package/dist/lib/orcid.d.ts.map +1 -0
  132. package/dist/lib/orcid.js +117 -0
  133. package/dist/lib/orcid.js.map +1 -0
  134. package/dist/lib/pdf-comments.d.ts +95 -0
  135. package/dist/lib/pdf-comments.d.ts.map +1 -0
  136. package/dist/lib/pdf-comments.js +192 -0
  137. package/dist/lib/pdf-comments.js.map +1 -0
  138. package/dist/lib/pdf-import.d.ts +118 -0
  139. package/dist/lib/pdf-import.d.ts.map +1 -0
  140. package/dist/lib/pdf-import.js +397 -0
  141. package/dist/lib/pdf-import.js.map +1 -0
  142. package/dist/lib/plugins.d.ts +76 -0
  143. package/dist/lib/plugins.d.ts.map +1 -0
  144. package/dist/lib/plugins.js +235 -0
  145. package/dist/lib/plugins.js.map +1 -0
  146. package/dist/lib/postprocess.d.ts +42 -0
  147. package/dist/lib/postprocess.d.ts.map +1 -0
  148. package/dist/lib/postprocess.js +138 -0
  149. package/dist/lib/postprocess.js.map +1 -0
  150. package/dist/lib/pptx-template.d.ts +59 -0
  151. package/dist/lib/pptx-template.d.ts.map +1 -0
  152. package/dist/lib/pptx-template.js +613 -0
  153. package/dist/lib/pptx-template.js.map +1 -0
  154. package/dist/lib/pptx-themes.d.ts +80 -0
  155. package/dist/lib/pptx-themes.d.ts.map +1 -0
  156. package/dist/lib/pptx-themes.js +818 -0
  157. package/dist/lib/pptx-themes.js.map +1 -0
  158. package/dist/lib/protect-restore.d.ts +137 -0
  159. package/dist/lib/protect-restore.d.ts.map +1 -0
  160. package/dist/lib/protect-restore.js +394 -0
  161. package/dist/lib/protect-restore.js.map +1 -0
  162. package/dist/lib/rate-limiter.d.ts +27 -0
  163. package/dist/lib/rate-limiter.d.ts.map +1 -0
  164. package/dist/lib/rate-limiter.js +79 -0
  165. package/dist/lib/rate-limiter.js.map +1 -0
  166. package/dist/lib/response.d.ts +41 -0
  167. package/dist/lib/response.d.ts.map +1 -0
  168. package/dist/lib/response.js +150 -0
  169. package/dist/lib/response.js.map +1 -0
  170. package/dist/lib/review.d.ts +35 -0
  171. package/dist/lib/review.d.ts.map +1 -0
  172. package/dist/lib/review.js +263 -0
  173. package/dist/lib/review.js.map +1 -0
  174. package/dist/lib/schema.d.ts +66 -0
  175. package/dist/lib/schema.d.ts.map +1 -0
  176. package/dist/lib/schema.js +339 -0
  177. package/dist/lib/schema.js.map +1 -0
  178. package/dist/lib/scientific-words.d.ts +6 -0
  179. package/dist/lib/scientific-words.d.ts.map +1 -0
  180. package/dist/lib/scientific-words.js +66 -0
  181. package/dist/lib/scientific-words.js.map +1 -0
  182. package/dist/lib/sections.d.ts +40 -0
  183. package/dist/lib/sections.d.ts.map +1 -0
  184. package/dist/lib/sections.js +288 -0
  185. package/dist/lib/sections.js.map +1 -0
  186. package/dist/lib/slides.d.ts +86 -0
  187. package/dist/lib/slides.d.ts.map +1 -0
  188. package/dist/lib/slides.js +676 -0
  189. package/dist/lib/slides.js.map +1 -0
  190. package/dist/lib/spelling.d.ts +76 -0
  191. package/dist/lib/spelling.d.ts.map +1 -0
  192. package/dist/lib/spelling.js +272 -0
  193. package/dist/lib/spelling.js.map +1 -0
  194. package/dist/lib/templates.d.ts +30 -0
  195. package/dist/lib/templates.d.ts.map +1 -0
  196. package/dist/lib/templates.js +504 -0
  197. package/dist/lib/templates.js.map +1 -0
  198. package/dist/lib/themes.d.ts +85 -0
  199. package/dist/lib/themes.d.ts.map +1 -0
  200. package/dist/lib/themes.js +652 -0
  201. package/dist/lib/themes.js.map +1 -0
  202. package/dist/lib/trackchanges.d.ts +51 -0
  203. package/dist/lib/trackchanges.d.ts.map +1 -0
  204. package/dist/lib/trackchanges.js +202 -0
  205. package/dist/lib/trackchanges.js.map +1 -0
  206. package/dist/lib/tui.d.ts +76 -0
  207. package/dist/lib/tui.d.ts.map +1 -0
  208. package/dist/lib/tui.js +377 -0
  209. package/dist/lib/tui.js.map +1 -0
  210. package/dist/lib/types.d.ts +447 -0
  211. package/dist/lib/types.d.ts.map +1 -0
  212. package/dist/lib/types.js +6 -0
  213. package/dist/lib/types.js.map +1 -0
  214. package/dist/lib/undo.d.ts +57 -0
  215. package/dist/lib/undo.d.ts.map +1 -0
  216. package/dist/lib/undo.js +185 -0
  217. package/dist/lib/undo.js.map +1 -0
  218. package/dist/lib/utils.d.ts +16 -0
  219. package/dist/lib/utils.d.ts.map +1 -0
  220. package/dist/lib/utils.js +40 -0
  221. package/dist/lib/utils.js.map +1 -0
  222. package/dist/lib/variables.d.ts +42 -0
  223. package/dist/lib/variables.d.ts.map +1 -0
  224. package/dist/lib/variables.js +141 -0
  225. package/dist/lib/variables.js.map +1 -0
  226. package/dist/lib/word.d.ts +80 -0
  227. package/dist/lib/word.d.ts.map +1 -0
  228. package/dist/lib/word.js +360 -0
  229. package/dist/lib/word.js.map +1 -0
  230. package/dist/lib/wordcomments.d.ts +51 -0
  231. package/dist/lib/wordcomments.d.ts.map +1 -0
  232. package/dist/lib/wordcomments.js +587 -0
  233. package/dist/lib/wordcomments.js.map +1 -0
  234. package/eslint.config.js +27 -0
  235. package/lib/annotations.ts +622 -0
  236. package/lib/apply-buildup-colors.py +88 -0
  237. package/lib/build.ts +1013 -0
  238. package/lib/{citations.js → citations.ts} +38 -27
  239. package/lib/commands/{build.js → build.ts} +80 -27
  240. package/lib/commands/{citations.js → citations.ts} +36 -18
  241. package/lib/commands/{comments.js → comments.ts} +187 -54
  242. package/lib/commands/{context.js → context.ts} +18 -8
  243. package/lib/commands/{core.js → core.ts} +34 -20
  244. package/lib/commands/{doi.js → doi.ts} +32 -16
  245. package/lib/commands/{history.js → history.ts} +25 -12
  246. package/lib/commands/{index.js → index.ts} +9 -5
  247. package/lib/commands/{init.js → init.ts} +20 -8
  248. package/lib/commands/{response.js → response.ts} +47 -20
  249. package/lib/commands/{sections.js → sections.ts} +273 -68
  250. package/lib/commands/{utilities.js → utilities.ts} +338 -158
  251. package/lib/{comment-realign.js → comment-realign.ts} +117 -45
  252. package/lib/config.ts +84 -0
  253. package/lib/{crossref.js → crossref.ts} +213 -138
  254. package/lib/dependencies.ts +106 -0
  255. package/lib/doi-cache.ts +115 -0
  256. package/lib/{doi.js → doi.ts} +115 -281
  257. package/lib/{equations.js → equations.ts} +60 -64
  258. package/lib/{errors.js → errors.ts} +56 -48
  259. package/lib/{format.js → format.ts} +137 -63
  260. package/lib/{git.js → git.ts} +66 -63
  261. package/lib/{grammar.js → grammar.ts} +45 -32
  262. package/lib/image-registry.ts +180 -0
  263. package/lib/import.ts +2060 -0
  264. package/lib/journals.ts +505 -0
  265. package/lib/{merge.js → merge.ts} +185 -135
  266. package/lib/{orcid.js → orcid.ts} +17 -22
  267. package/lib/{pdf-comments.js → pdf-comments.ts} +76 -18
  268. package/lib/{pdf-import.js → pdf-import.ts} +148 -70
  269. package/lib/{plugins.js → plugins.ts} +82 -39
  270. package/lib/postprocess.ts +188 -0
  271. package/lib/pptx-color-filter.lua +37 -0
  272. package/lib/pptx-template.ts +625 -0
  273. package/lib/pptx-themes/academic.pptx +0 -0
  274. package/lib/pptx-themes/corporate.pptx +0 -0
  275. package/lib/pptx-themes/dark.pptx +0 -0
  276. package/lib/pptx-themes/default.pptx +0 -0
  277. package/lib/pptx-themes/minimal.pptx +0 -0
  278. package/lib/pptx-themes/plant.pptx +0 -0
  279. package/lib/pptx-themes.ts +896 -0
  280. package/lib/protect-restore.ts +516 -0
  281. package/lib/rate-limiter.ts +94 -0
  282. package/lib/{response.js → response.ts} +36 -21
  283. package/lib/{review.js → review.ts} +53 -43
  284. package/lib/{schema.js → schema.ts} +70 -25
  285. package/lib/{sections.js → sections.ts} +71 -76
  286. package/lib/slides.ts +793 -0
  287. package/lib/{spelling.js → spelling.ts} +43 -59
  288. package/lib/{templates.js → templates.ts} +20 -17
  289. package/lib/themes.ts +742 -0
  290. package/lib/{trackchanges.js → trackchanges.ts} +52 -23
  291. package/lib/types.ts +509 -0
  292. package/lib/{undo.js → undo.ts} +75 -52
  293. package/lib/utils.ts +41 -0
  294. package/lib/{variables.js → variables.ts} +60 -54
  295. package/lib/word.ts +428 -0
  296. package/lib/{wordcomments.js → wordcomments.ts} +94 -40
  297. package/package.json +15 -5
  298. package/skill/REFERENCE.md +67 -0
  299. package/tsconfig.json +26 -0
  300. package/lib/annotations.js +0 -414
  301. package/lib/build.js +0 -639
  302. package/lib/config.js +0 -79
  303. package/lib/import.js +0 -1145
  304. package/lib/journals.js +0 -629
  305. package/lib/word.js +0 -225
  306. /package/lib/{scientific-words.js → scientific-words.ts} +0 -0
@@ -0,0 +1,818 @@
1
+ /**
2
+ * PPTX Theme System
3
+ *
4
+ * Provides 6 built-in themes for PPTX output, independent of Beamer themes.
5
+ * Each theme is a reference PPTX file that defines colors, fonts, and slide layouts.
6
+ *
7
+ * Uses pandoc's default reference.pptx as the base template and modifies the theme.xml
8
+ * to apply custom colors and fonts. This ensures all 11 required slide layouts are present.
9
+ *
10
+ * Themes:
11
+ * - default: Clean white with blue accents (professional)
12
+ * - dark: Dark background with light text (modern)
13
+ * - academic: Classic serif fonts, muted colors (scholarly)
14
+ * - minimal: High contrast black/white (clean)
15
+ * - corporate: Navy/gold color scheme (business)
16
+ * - plant: Nature-inspired green theme (ecology/biology)
17
+ */
18
+ import { existsSync, mkdirSync } from 'node:fs';
19
+ import { join, dirname } from 'node:path';
20
+ import { fileURLToPath } from 'node:url';
21
+ import { execSync } from 'node:child_process';
22
+ import AdmZip from 'adm-zip';
23
+ const __dirname = dirname(fileURLToPath(import.meta.url));
24
+ /**
25
+ * Theme definitions with colors and fonts
26
+ */
27
+ export const PPTX_THEMES = {
28
+ default: {
29
+ name: 'Default',
30
+ description: 'Clean white with blue accents',
31
+ colors: {
32
+ dk1: '000000', // Dark text
33
+ lt1: 'FFFFFF', // Light background
34
+ dk2: '1F497D', // Dark accent (navy)
35
+ lt2: 'EEECE1', // Light accent (cream)
36
+ accent1: '4472C4', // Blue
37
+ accent2: 'ED7D31', // Orange
38
+ accent3: 'A5A5A5', // Gray
39
+ accent4: 'FFC000', // Yellow
40
+ accent5: '5B9BD5', // Light blue
41
+ accent6: '70AD47', // Green
42
+ hlink: '0563C1', // Hyperlink blue
43
+ folHlink: '954F72', // Followed hyperlink
44
+ },
45
+ fonts: {
46
+ major: 'Calibri Light',
47
+ minor: 'Calibri',
48
+ },
49
+ },
50
+ dark: {
51
+ name: 'Dark',
52
+ description: 'Dark background with light text',
53
+ colors: {
54
+ dk1: 'FFFFFF', // Light text (inverted)
55
+ lt1: '1E1E1E', // Dark background
56
+ dk2: 'E0E0E0', // Light gray
57
+ lt2: '2D2D2D', // Darker gray
58
+ accent1: '00B4D8', // Cyan
59
+ accent2: 'FF6B6B', // Coral
60
+ accent3: '95E1D3', // Mint
61
+ accent4: 'F38181', // Pink
62
+ accent5: 'AA96DA', // Lavender
63
+ accent6: 'FCBAD3', // Light pink
64
+ hlink: '00B4D8',
65
+ folHlink: 'AA96DA',
66
+ },
67
+ fonts: {
68
+ major: 'Inter',
69
+ minor: 'Inter',
70
+ },
71
+ background: '1E1E1E',
72
+ },
73
+ academic: {
74
+ name: 'Academic',
75
+ description: 'Classic serif fonts, muted colors',
76
+ colors: {
77
+ dk1: '2C3E50', // Dark blue-gray
78
+ lt1: 'FFFEF9', // Warm white
79
+ dk2: '34495E', // Slate
80
+ lt2: 'F5F5DC', // Beige
81
+ accent1: '8B4513', // Saddle brown
82
+ accent2: '2E8B57', // Sea green
83
+ accent3: '708090', // Slate gray
84
+ accent4: 'B8860B', // Dark goldenrod
85
+ accent5: '4682B4', // Steel blue
86
+ accent6: '6B8E23', // Olive drab
87
+ hlink: '8B4513',
88
+ folHlink: '708090',
89
+ },
90
+ fonts: {
91
+ major: 'Georgia',
92
+ minor: 'Palatino Linotype',
93
+ },
94
+ },
95
+ minimal: {
96
+ name: 'Minimal',
97
+ description: 'High contrast black and white',
98
+ colors: {
99
+ dk1: '000000', // Pure black
100
+ lt1: 'FFFFFF', // Pure white
101
+ dk2: '333333', // Dark gray
102
+ lt2: 'F0F0F0', // Light gray
103
+ accent1: '000000', // Black accent
104
+ accent2: '666666', // Medium gray
105
+ accent3: '999999', // Light gray
106
+ accent4: 'CCCCCC', // Lighter gray
107
+ accent5: '333333', // Dark gray
108
+ accent6: '4D4D4D', // Charcoal
109
+ hlink: '000000',
110
+ folHlink: '666666',
111
+ },
112
+ fonts: {
113
+ major: 'Roboto Light',
114
+ minor: 'Roboto',
115
+ },
116
+ },
117
+ corporate: {
118
+ name: 'Corporate',
119
+ description: 'Navy and gold professional theme',
120
+ colors: {
121
+ dk1: '0D1B2A', // Very dark navy
122
+ lt1: 'FFFFFF', // White
123
+ dk2: '1B263B', // Dark navy
124
+ lt2: 'E0E1DD', // Light gray
125
+ accent1: 'D4AF37', // Gold
126
+ accent2: '415A77', // Steel blue
127
+ accent3: '778DA9', // Light steel
128
+ accent4: 'C5A900', // Darker gold
129
+ accent5: '1B4965', // Deep blue
130
+ accent6: '5FA8D3', // Sky blue
131
+ hlink: 'D4AF37',
132
+ folHlink: '778DA9',
133
+ },
134
+ fonts: {
135
+ major: 'Garamond',
136
+ minor: 'Garamond',
137
+ },
138
+ },
139
+ plant: {
140
+ name: 'Plant',
141
+ description: 'Nature-inspired green theme for ecology/biology',
142
+ colors: {
143
+ dk1: '2D4A22', // Dark forest green
144
+ lt1: 'FFFFFF', // White
145
+ dk2: '3D5A2E', // Medium forest
146
+ lt2: 'F5F7F2', // Light sage
147
+ accent1: '608C32', // Primary green (theme accent)
148
+ accent2: '8B4513', // Earth brown
149
+ accent3: '888888', // Gray (for buildup)
150
+ accent4: '7CB342', // Light green
151
+ accent5: '4A6B3A', // Olive green
152
+ accent6: 'A5D6A7', // Pale green
153
+ hlink: '608C32',
154
+ folHlink: '4A6B3A',
155
+ },
156
+ fonts: {
157
+ major: 'Aptos Display',
158
+ minor: 'Aptos',
159
+ },
160
+ },
161
+ };
162
+ /**
163
+ * Get list of available theme names
164
+ */
165
+ export function getThemeNames() {
166
+ return Object.keys(PPTX_THEMES);
167
+ }
168
+ /**
169
+ * Get theme definition by name
170
+ */
171
+ export function getTheme(name) {
172
+ return PPTX_THEMES[name] || null;
173
+ }
174
+ /**
175
+ * Generate [Content_Types].xml
176
+ */
177
+ function generateContentTypes() {
178
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
179
+ <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
180
+ <Default Extension="jpeg" ContentType="image/jpeg"/>
181
+ <Default Extension="png" ContentType="image/png"/>
182
+ <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
183
+ <Default Extension="xml" ContentType="application/xml"/>
184
+ <Override PartName="/ppt/presentation.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"/>
185
+ <Override PartName="/ppt/slideMasters/slideMaster1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml"/>
186
+ <Override PartName="/ppt/slideLayouts/slideLayout1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/>
187
+ <Override PartName="/ppt/slideLayouts/slideLayout2.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/>
188
+ <Override PartName="/ppt/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/>
189
+ <Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
190
+ <Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
191
+ </Types>`;
192
+ }
193
+ /**
194
+ * Generate _rels/.rels
195
+ */
196
+ function generateRels() {
197
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
198
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
199
+ <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="ppt/presentation.xml"/>
200
+ <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>
201
+ <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
202
+ </Relationships>`;
203
+ }
204
+ /**
205
+ * Generate ppt/_rels/presentation.xml.rels
206
+ */
207
+ function generatePresentationRels() {
208
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
209
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
210
+ <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" Target="slideMasters/slideMaster1.xml"/>
211
+ <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/>
212
+ </Relationships>`;
213
+ }
214
+ /**
215
+ * Generate ppt/presentation.xml
216
+ */
217
+ function generatePresentation() {
218
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
219
+ <p:presentation xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" saveSubsetFonts="1">
220
+ <p:sldMasterIdLst>
221
+ <p:sldMasterId id="2147483648" r:id="rId1"/>
222
+ </p:sldMasterIdLst>
223
+ <p:sldSz cx="12192000" cy="6858000"/>
224
+ <p:notesSz cx="6858000" cy="9144000"/>
225
+ <p:defaultTextStyle>
226
+ <a:defPPr>
227
+ <a:defRPr lang="en-US"/>
228
+ </a:defPPr>
229
+ </p:defaultTextStyle>
230
+ </p:presentation>`;
231
+ }
232
+ /**
233
+ * Generate ppt/theme/theme1.xml with theme colors and fonts
234
+ */
235
+ function generateTheme(theme) {
236
+ const c = theme.colors;
237
+ const f = theme.fonts;
238
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
239
+ <a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="${theme.name}">
240
+ <a:themeElements>
241
+ <a:clrScheme name="${theme.name}">
242
+ <a:dk1><a:srgbClr val="${c.dk1}"/></a:dk1>
243
+ <a:lt1><a:srgbClr val="${c.lt1}"/></a:lt1>
244
+ <a:dk2><a:srgbClr val="${c.dk2}"/></a:dk2>
245
+ <a:lt2><a:srgbClr val="${c.lt2}"/></a:lt2>
246
+ <a:accent1><a:srgbClr val="${c.accent1}"/></a:accent1>
247
+ <a:accent2><a:srgbClr val="${c.accent2}"/></a:accent2>
248
+ <a:accent3><a:srgbClr val="${c.accent3}"/></a:accent3>
249
+ <a:accent4><a:srgbClr val="${c.accent4}"/></a:accent4>
250
+ <a:accent5><a:srgbClr val="${c.accent5}"/></a:accent5>
251
+ <a:accent6><a:srgbClr val="${c.accent6}"/></a:accent6>
252
+ <a:hlink><a:srgbClr val="${c.hlink}"/></a:hlink>
253
+ <a:folHlink><a:srgbClr val="${c.folHlink}"/></a:folHlink>
254
+ </a:clrScheme>
255
+ <a:fontScheme name="${theme.name}">
256
+ <a:majorFont>
257
+ <a:latin typeface="${f.major}"/>
258
+ <a:ea typeface=""/>
259
+ <a:cs typeface=""/>
260
+ </a:majorFont>
261
+ <a:minorFont>
262
+ <a:latin typeface="${f.minor}"/>
263
+ <a:ea typeface=""/>
264
+ <a:cs typeface=""/>
265
+ </a:minorFont>
266
+ </a:fontScheme>
267
+ <a:fmtScheme name="${theme.name}">
268
+ <a:fillStyleLst>
269
+ <a:solidFill><a:schemeClr val="phClr"/></a:solidFill>
270
+ <a:gradFill rotWithShape="1">
271
+ <a:gsLst>
272
+ <a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>
273
+ <a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>
274
+ <a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>
275
+ </a:gsLst>
276
+ <a:lin ang="16200000" scaled="1"/>
277
+ </a:gradFill>
278
+ <a:gradFill rotWithShape="1">
279
+ <a:gsLst>
280
+ <a:gs pos="0"><a:schemeClr val="phClr"><a:shade val="51000"/><a:satMod val="130000"/></a:schemeClr></a:gs>
281
+ <a:gs pos="80000"><a:schemeClr val="phClr"><a:shade val="93000"/><a:satMod val="130000"/></a:schemeClr></a:gs>
282
+ <a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="94000"/><a:satMod val="135000"/></a:schemeClr></a:gs>
283
+ </a:gsLst>
284
+ <a:lin ang="16200000" scaled="0"/>
285
+ </a:gradFill>
286
+ </a:fillStyleLst>
287
+ <a:lnStyleLst>
288
+ <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>
289
+ <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>
290
+ <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>
291
+ </a:lnStyleLst>
292
+ <a:effectStyleLst>
293
+ <a:effectStyle><a:effectLst/></a:effectStyle>
294
+ <a:effectStyle><a:effectLst/></a:effectStyle>
295
+ <a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle>
296
+ </a:effectStyleLst>
297
+ <a:bgFillStyleLst>
298
+ <a:solidFill><a:schemeClr val="phClr"/></a:solidFill>
299
+ <a:gradFill rotWithShape="1">
300
+ <a:gsLst>
301
+ <a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>
302
+ <a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>
303
+ <a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>
304
+ </a:gsLst>
305
+ <a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>
306
+ </a:gradFill>
307
+ <a:gradFill rotWithShape="1">
308
+ <a:gsLst>
309
+ <a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>
310
+ <a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>
311
+ </a:gsLst>
312
+ <a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>
313
+ </a:gradFill>
314
+ </a:bgFillStyleLst>
315
+ </a:fmtScheme>
316
+ </a:themeElements>
317
+ <a:objectDefaults/>
318
+ <a:extraClrSchemeLst/>
319
+ </a:theme>`;
320
+ }
321
+ /**
322
+ * Generate slide master with background
323
+ */
324
+ function generateSlideMaster(theme) {
325
+ // For dark themes, set explicit background
326
+ let bgFill = '<a:solidFill><a:schemeClr val="lt1"/></a:solidFill>';
327
+ if (theme.background) {
328
+ bgFill = `<a:solidFill><a:srgbClr val="${theme.background}"/></a:solidFill>`;
329
+ }
330
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
331
+ <p:sldMaster xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main">
332
+ <p:cSld>
333
+ <p:bg>
334
+ <p:bgPr>
335
+ ${bgFill}
336
+ <a:effectLst/>
337
+ </p:bgPr>
338
+ </p:bg>
339
+ <p:spTree>
340
+ <p:nvGrpSpPr>
341
+ <p:cNvPr id="1" name=""/>
342
+ <p:cNvGrpSpPr/>
343
+ <p:nvPr/>
344
+ </p:nvGrpSpPr>
345
+ <p:grpSpPr>
346
+ <a:xfrm>
347
+ <a:off x="0" y="0"/>
348
+ <a:ext cx="0" cy="0"/>
349
+ <a:chOff x="0" y="0"/>
350
+ <a:chExt cx="0" cy="0"/>
351
+ </a:xfrm>
352
+ </p:grpSpPr>
353
+ <p:sp>
354
+ <p:nvSpPr>
355
+ <p:cNvPr id="2" name="Title Placeholder 1"/>
356
+ <p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr>
357
+ <p:nvPr><p:ph type="title"/></p:nvPr>
358
+ </p:nvSpPr>
359
+ <p:spPr>
360
+ <a:xfrm>
361
+ <a:off x="838200" y="365125"/>
362
+ <a:ext cx="10515600" cy="1325563"/>
363
+ </a:xfrm>
364
+ <a:prstGeom prst="rect"><a:avLst/></a:prstGeom>
365
+ </p:spPr>
366
+ <p:txBody>
367
+ <a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0" anchor="ctr"/>
368
+ <a:lstStyle>
369
+ <a:lvl1pPr algn="l">
370
+ <a:defRPr sz="4400" b="0">
371
+ <a:solidFill><a:schemeClr val="dk1"/></a:solidFill>
372
+ <a:latin typeface="+mj-lt"/>
373
+ <a:ea typeface="+mj-ea"/>
374
+ <a:cs typeface="+mj-cs"/>
375
+ </a:defRPr>
376
+ </a:lvl1pPr>
377
+ </a:lstStyle>
378
+ <a:p><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master title style</a:t></a:r></a:p>
379
+ </p:txBody>
380
+ </p:sp>
381
+ <p:sp>
382
+ <p:nvSpPr>
383
+ <p:cNvPr id="3" name="Text Placeholder 2"/>
384
+ <p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr>
385
+ <p:nvPr><p:ph type="body" idx="1"/></p:nvPr>
386
+ </p:nvSpPr>
387
+ <p:spPr>
388
+ <a:xfrm>
389
+ <a:off x="838200" y="1825625"/>
390
+ <a:ext cx="10515600" cy="4351338"/>
391
+ </a:xfrm>
392
+ <a:prstGeom prst="rect"><a:avLst/></a:prstGeom>
393
+ </p:spPr>
394
+ <p:txBody>
395
+ <a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0"/>
396
+ <a:lstStyle>
397
+ <a:lvl1pPr marL="0" indent="0" algn="l">
398
+ <a:buNone/>
399
+ <a:defRPr sz="2800">
400
+ <a:solidFill><a:schemeClr val="dk1"/></a:solidFill>
401
+ <a:latin typeface="+mn-lt"/>
402
+ </a:defRPr>
403
+ </a:lvl1pPr>
404
+ <a:lvl2pPr marL="457200" indent="0" algn="l">
405
+ <a:buNone/>
406
+ <a:defRPr sz="2400">
407
+ <a:solidFill><a:schemeClr val="dk1"/></a:solidFill>
408
+ <a:latin typeface="+mn-lt"/>
409
+ </a:defRPr>
410
+ </a:lvl2pPr>
411
+ <a:lvl3pPr marL="914400" indent="0" algn="l">
412
+ <a:buNone/>
413
+ <a:defRPr sz="2000">
414
+ <a:solidFill><a:schemeClr val="dk1"/></a:solidFill>
415
+ <a:latin typeface="+mn-lt"/>
416
+ </a:defRPr>
417
+ </a:lvl3pPr>
418
+ <a:lvl4pPr marL="1371600" indent="0" algn="l">
419
+ <a:buNone/>
420
+ <a:defRPr sz="1800">
421
+ <a:solidFill><a:schemeClr val="dk1"/></a:solidFill>
422
+ <a:latin typeface="+mn-lt"/>
423
+ </a:defRPr>
424
+ </a:lvl4pPr>
425
+ <a:lvl5pPr marL="1828800" indent="0" algn="l">
426
+ <a:buNone/>
427
+ <a:defRPr sz="1800">
428
+ <a:solidFill><a:schemeClr val="dk1"/></a:solidFill>
429
+ <a:latin typeface="+mn-lt"/>
430
+ </a:defRPr>
431
+ </a:lvl5pPr>
432
+ </a:lstStyle>
433
+ <a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master text styles</a:t></a:r></a:p>
434
+ <a:p><a:pPr lvl="1"/><a:r><a:rPr lang="en-US"/><a:t>Second level</a:t></a:r></a:p>
435
+ <a:p><a:pPr lvl="2"/><a:r><a:rPr lang="en-US"/><a:t>Third level</a:t></a:r></a:p>
436
+ </p:txBody>
437
+ </p:sp>
438
+ <p:sp>
439
+ <p:nvSpPr>
440
+ <p:cNvPr id="4" name="Slide Number Placeholder 3"/>
441
+ <p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr>
442
+ <p:nvPr><p:ph type="sldNum" sz="quarter" idx="4"/></p:nvPr>
443
+ </p:nvSpPr>
444
+ <p:spPr>
445
+ <a:xfrm>
446
+ <a:off x="8610600" y="6356350"/>
447
+ <a:ext cx="2743200" cy="365125"/>
448
+ </a:xfrm>
449
+ <a:prstGeom prst="rect"><a:avLst/></a:prstGeom>
450
+ </p:spPr>
451
+ <p:txBody>
452
+ <a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0" anchor="ctr"/>
453
+ <a:lstStyle>
454
+ <a:lvl1pPr algn="r">
455
+ <a:defRPr sz="1200">
456
+ <a:solidFill><a:schemeClr val="dk1"/></a:solidFill>
457
+ </a:defRPr>
458
+ </a:lvl1pPr>
459
+ </a:lstStyle>
460
+ <a:p>
461
+ <a:fld id="{B6F15528-21DE-4FAA-801F-C0D5B2D67AA7}" type="slidenum">
462
+ <a:rPr lang="en-US" smtClean="0"/>
463
+ <a:t>‹#›</a:t>
464
+ </a:fld>
465
+ <a:endParaRPr lang="en-US"/>
466
+ </a:p>
467
+ </p:txBody>
468
+ </p:sp>
469
+ </p:spTree>
470
+ </p:cSld>
471
+ <p:clrMap bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2" accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" hlink="hlink" folHlink="folHlink"/>
472
+ <p:sldLayoutIdLst>
473
+ <p:sldLayoutId id="2147483649" r:id="rId1"/>
474
+ <p:sldLayoutId id="2147483650" r:id="rId2"/>
475
+ </p:sldLayoutIdLst>
476
+ <p:txStyles>
477
+ <p:titleStyle>
478
+ <a:lvl1pPr algn="l">
479
+ <a:defRPr sz="4400" b="0" kern="1200">
480
+ <a:solidFill><a:schemeClr val="dk1"/></a:solidFill>
481
+ <a:latin typeface="+mj-lt"/>
482
+ <a:ea typeface="+mj-ea"/>
483
+ <a:cs typeface="+mj-cs"/>
484
+ </a:defRPr>
485
+ </a:lvl1pPr>
486
+ </p:titleStyle>
487
+ <p:bodyStyle>
488
+ <a:lvl1pPr marL="0" indent="0" algn="l">
489
+ <a:buNone/>
490
+ <a:defRPr sz="2800" kern="1200">
491
+ <a:solidFill><a:schemeClr val="dk1"/></a:solidFill>
492
+ <a:latin typeface="+mn-lt"/>
493
+ <a:ea typeface="+mn-ea"/>
494
+ <a:cs typeface="+mn-cs"/>
495
+ </a:defRPr>
496
+ </a:lvl1pPr>
497
+ <a:lvl2pPr marL="457200" indent="0" algn="l">
498
+ <a:buNone/>
499
+ <a:defRPr sz="2400" kern="1200">
500
+ <a:solidFill><a:schemeClr val="dk1"/></a:solidFill>
501
+ <a:latin typeface="+mn-lt"/>
502
+ </a:defRPr>
503
+ </a:lvl2pPr>
504
+ <a:lvl3pPr marL="914400" indent="0" algn="l">
505
+ <a:buNone/>
506
+ <a:defRPr sz="2000" kern="1200">
507
+ <a:solidFill><a:schemeClr val="dk1"/></a:solidFill>
508
+ <a:latin typeface="+mn-lt"/>
509
+ </a:defRPr>
510
+ </a:lvl3pPr>
511
+ <a:lvl4pPr marL="1371600" indent="0" algn="l">
512
+ <a:buNone/>
513
+ <a:defRPr sz="1800" kern="1200">
514
+ <a:solidFill><a:schemeClr val="dk1"/></a:solidFill>
515
+ <a:latin typeface="+mn-lt"/>
516
+ </a:defRPr>
517
+ </a:lvl4pPr>
518
+ <a:lvl5pPr marL="1828800" indent="0" algn="l">
519
+ <a:buNone/>
520
+ <a:defRPr sz="1800" kern="1200">
521
+ <a:solidFill><a:schemeClr val="dk1"/></a:solidFill>
522
+ <a:latin typeface="+mn-lt"/>
523
+ </a:defRPr>
524
+ </a:lvl5pPr>
525
+ </p:bodyStyle>
526
+ <p:otherStyle>
527
+ <a:defPPr><a:defRPr lang="en-US"/></a:defPPr>
528
+ </p:otherStyle>
529
+ </p:txStyles>
530
+ </p:sldMaster>`;
531
+ }
532
+ /**
533
+ * Generate slide master relationships
534
+ */
535
+ function generateSlideMasterRels() {
536
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
537
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
538
+ <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Target="../slideLayouts/slideLayout1.xml"/>
539
+ <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Target="../slideLayouts/slideLayout2.xml"/>
540
+ <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="../theme/theme1.xml"/>
541
+ </Relationships>`;
542
+ }
543
+ /**
544
+ * Generate title slide layout
545
+ */
546
+ function generateTitleLayout(theme) {
547
+ let bgFill = '<a:solidFill><a:schemeClr val="lt1"/></a:solidFill>';
548
+ if (theme.background) {
549
+ bgFill = `<a:solidFill><a:srgbClr val="${theme.background}"/></a:solidFill>`;
550
+ }
551
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
552
+ <p:sldLayout xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" type="title" preserve="1">
553
+ <p:cSld name="Title Slide">
554
+ <p:bg>
555
+ <p:bgPr>
556
+ ${bgFill}
557
+ <a:effectLst/>
558
+ </p:bgPr>
559
+ </p:bg>
560
+ <p:spTree>
561
+ <p:nvGrpSpPr>
562
+ <p:cNvPr id="1" name=""/>
563
+ <p:cNvGrpSpPr/>
564
+ <p:nvPr/>
565
+ </p:nvGrpSpPr>
566
+ <p:grpSpPr>
567
+ <a:xfrm>
568
+ <a:off x="0" y="0"/>
569
+ <a:ext cx="0" cy="0"/>
570
+ <a:chOff x="0" y="0"/>
571
+ <a:chExt cx="0" cy="0"/>
572
+ </a:xfrm>
573
+ </p:grpSpPr>
574
+ <p:sp>
575
+ <p:nvSpPr>
576
+ <p:cNvPr id="2" name="Title 1"/>
577
+ <p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr>
578
+ <p:nvPr><p:ph type="ctrTitle"/></p:nvPr>
579
+ </p:nvSpPr>
580
+ <p:spPr>
581
+ <a:xfrm>
582
+ <a:off x="1524000" y="1122363"/>
583
+ <a:ext cx="9144000" cy="2387600"/>
584
+ </a:xfrm>
585
+ </p:spPr>
586
+ <p:txBody>
587
+ <a:bodyPr anchor="b"/>
588
+ <a:lstStyle>
589
+ <a:lvl1pPr algn="ctr">
590
+ <a:defRPr sz="6000">
591
+ <a:solidFill><a:schemeClr val="dk1"/></a:solidFill>
592
+ </a:defRPr>
593
+ </a:lvl1pPr>
594
+ </a:lstStyle>
595
+ <a:p><a:r><a:rPr lang="en-US"/><a:t>Click to edit title</a:t></a:r></a:p>
596
+ </p:txBody>
597
+ </p:sp>
598
+ <p:sp>
599
+ <p:nvSpPr>
600
+ <p:cNvPr id="3" name="Subtitle 2"/>
601
+ <p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr>
602
+ <p:nvPr><p:ph type="subTitle" idx="1"/></p:nvPr>
603
+ </p:nvSpPr>
604
+ <p:spPr>
605
+ <a:xfrm>
606
+ <a:off x="1524000" y="3602038"/>
607
+ <a:ext cx="9144000" cy="1655762"/>
608
+ </a:xfrm>
609
+ </p:spPr>
610
+ <p:txBody>
611
+ <a:bodyPr/>
612
+ <a:lstStyle>
613
+ <a:lvl1pPr marL="0" indent="0" algn="ctr">
614
+ <a:buNone/>
615
+ <a:defRPr sz="2400">
616
+ <a:solidFill><a:schemeClr val="dk1"/></a:solidFill>
617
+ </a:defRPr>
618
+ </a:lvl1pPr>
619
+ </a:lstStyle>
620
+ <a:p><a:r><a:rPr lang="en-US"/><a:t>Click to edit subtitle</a:t></a:r></a:p>
621
+ </p:txBody>
622
+ </p:sp>
623
+ </p:spTree>
624
+ </p:cSld>
625
+ <p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr>
626
+ </p:sldLayout>`;
627
+ }
628
+ /**
629
+ * Generate content slide layout
630
+ */
631
+ function generateContentLayout(theme) {
632
+ let bgFill = '<a:solidFill><a:schemeClr val="lt1"/></a:solidFill>';
633
+ if (theme.background) {
634
+ bgFill = `<a:solidFill><a:srgbClr val="${theme.background}"/></a:solidFill>`;
635
+ }
636
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
637
+ <p:sldLayout xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" type="obj" preserve="1">
638
+ <p:cSld name="Title and Content">
639
+ <p:bg>
640
+ <p:bgPr>
641
+ ${bgFill}
642
+ <a:effectLst/>
643
+ </p:bgPr>
644
+ </p:bg>
645
+ <p:spTree>
646
+ <p:nvGrpSpPr>
647
+ <p:cNvPr id="1" name=""/>
648
+ <p:cNvGrpSpPr/>
649
+ <p:nvPr/>
650
+ </p:nvGrpSpPr>
651
+ <p:grpSpPr>
652
+ <a:xfrm>
653
+ <a:off x="0" y="0"/>
654
+ <a:ext cx="0" cy="0"/>
655
+ <a:chOff x="0" y="0"/>
656
+ <a:chExt cx="0" cy="0"/>
657
+ </a:xfrm>
658
+ </p:grpSpPr>
659
+ <p:sp>
660
+ <p:nvSpPr>
661
+ <p:cNvPr id="2" name="Title 1"/>
662
+ <p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr>
663
+ <p:nvPr><p:ph type="title"/></p:nvPr>
664
+ </p:nvSpPr>
665
+ <p:spPr/>
666
+ <p:txBody>
667
+ <a:bodyPr/>
668
+ <a:lstStyle/>
669
+ <a:p><a:r><a:rPr lang="en-US"/><a:t>Click to edit title</a:t></a:r></a:p>
670
+ </p:txBody>
671
+ </p:sp>
672
+ <p:sp>
673
+ <p:nvSpPr>
674
+ <p:cNvPr id="3" name="Content Placeholder 2"/>
675
+ <p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr>
676
+ <p:nvPr><p:ph idx="1"/></p:nvPr>
677
+ </p:nvSpPr>
678
+ <p:spPr/>
679
+ <p:txBody>
680
+ <a:bodyPr/>
681
+ <a:lstStyle/>
682
+ <a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US"/><a:t>Click to edit text</a:t></a:r></a:p>
683
+ </p:txBody>
684
+ </p:sp>
685
+ </p:spTree>
686
+ </p:cSld>
687
+ <p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr>
688
+ </p:sldLayout>`;
689
+ }
690
+ /**
691
+ * Generate slide layout relationships
692
+ */
693
+ function generateSlideLayoutRels() {
694
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
695
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
696
+ <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" Target="../slideMasters/slideMaster1.xml"/>
697
+ </Relationships>`;
698
+ }
699
+ /**
700
+ * Generate docProps/core.xml
701
+ */
702
+ function generateCore(themeName) {
703
+ const now = new Date().toISOString();
704
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
705
+ <cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
706
+ <dc:title>${themeName} Theme</dc:title>
707
+ <dc:creator>docrev</dc:creator>
708
+ <cp:lastModifiedBy>docrev</cp:lastModifiedBy>
709
+ <dcterms:created xsi:type="dcterms:W3CDTF">${now}</dcterms:created>
710
+ <dcterms:modified xsi:type="dcterms:W3CDTF">${now}</dcterms:modified>
711
+ </cp:coreProperties>`;
712
+ }
713
+ /**
714
+ * Generate docProps/app.xml
715
+ */
716
+ function generateApp() {
717
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
718
+ <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
719
+ <Application>docrev</Application>
720
+ <PresentationFormat>Widescreen</PresentationFormat>
721
+ <Slides>0</Slides>
722
+ </Properties>`;
723
+ }
724
+ /**
725
+ * Get pandoc's default reference.pptx as a base template
726
+ */
727
+ function getPandocReferenceTemplate() {
728
+ try {
729
+ // Use pandoc to extract the default reference template
730
+ const result = execSync('pandoc --print-default-data-file reference.pptx', {
731
+ encoding: 'buffer',
732
+ maxBuffer: 1024 * 1024, // 1MB should be plenty
733
+ });
734
+ return result;
735
+ }
736
+ catch (err) {
737
+ const message = err instanceof Error ? err.message : String(err);
738
+ throw new Error(`Failed to get pandoc reference template: ${message}`);
739
+ }
740
+ }
741
+ /**
742
+ * Generate a PPTX theme file by modifying pandoc's reference template
743
+ */
744
+ export function generateThemeFile(themeName, outputPath) {
745
+ const theme = PPTX_THEMES[themeName];
746
+ if (!theme) {
747
+ throw new Error(`Unknown theme: ${themeName}`);
748
+ }
749
+ // Get pandoc's reference template as base
750
+ const templateBuffer = getPandocReferenceTemplate();
751
+ const zip = new AdmZip(templateBuffer);
752
+ // Replace theme.xml with our custom theme
753
+ zip.updateFile('ppt/theme/theme1.xml', Buffer.from(generateTheme(theme), 'utf-8'));
754
+ // For dark themes, update slide masters and layouts with background color
755
+ if (theme.background) {
756
+ updateBackgroundColor(zip, theme.background);
757
+ }
758
+ // Ensure output directory exists
759
+ const dir = dirname(outputPath);
760
+ if (!existsSync(dir)) {
761
+ mkdirSync(dir, { recursive: true });
762
+ }
763
+ zip.writeZip(outputPath);
764
+ return outputPath;
765
+ }
766
+ /**
767
+ * Update background color in slide masters and layouts for dark themes
768
+ */
769
+ function updateBackgroundColor(zip, bgColor) {
770
+ const entries = zip.getEntries();
771
+ for (const entry of entries) {
772
+ const name = entry.entryName;
773
+ // Update slide masters and layouts
774
+ if (name.includes('slideMasters/') || name.includes('slideLayouts/')) {
775
+ if (name.endsWith('.xml') && !name.includes('_rels')) {
776
+ let content = entry.getData().toString('utf-8');
777
+ // Replace light background with dark background
778
+ // Look for <a:schemeClr val="lt1"/> in bgPr and replace
779
+ content = content.replace(/<p:bg>[\s\S]*?<\/p:bg>/g, `<p:bg><p:bgPr><a:solidFill><a:srgbClr val="${bgColor}"/></a:solidFill><a:effectLst/></p:bgPr></p:bg>`);
780
+ zip.updateFile(name, Buffer.from(content, 'utf-8'));
781
+ }
782
+ }
783
+ }
784
+ }
785
+ /**
786
+ * Get path to bundled theme file, generating if needed
787
+ */
788
+ export function getThemePath(themeName) {
789
+ if (!PPTX_THEMES[themeName]) {
790
+ return null;
791
+ }
792
+ const themesDir = join(__dirname, 'pptx-themes');
793
+ const themePath = join(themesDir, `${themeName}.pptx`);
794
+ // Generate if doesn't exist
795
+ if (!existsSync(themePath)) {
796
+ if (!existsSync(themesDir)) {
797
+ mkdirSync(themesDir, { recursive: true });
798
+ }
799
+ generateThemeFile(themeName, themePath);
800
+ }
801
+ return themePath;
802
+ }
803
+ /**
804
+ * Generate all theme files
805
+ */
806
+ export function generateAllThemes(outputDir) {
807
+ if (!existsSync(outputDir)) {
808
+ mkdirSync(outputDir, { recursive: true });
809
+ }
810
+ const results = [];
811
+ for (const themeName of Object.keys(PPTX_THEMES)) {
812
+ const outputPath = join(outputDir, `${themeName}.pptx`);
813
+ generateThemeFile(themeName, outputPath);
814
+ results.push({ theme: themeName, path: outputPath });
815
+ }
816
+ return results;
817
+ }
818
+ //# sourceMappingURL=pptx-themes.js.map