docrev 0.11.1 → 0.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/.gitattributes +1 -1
  2. package/CHANGELOG.md +207 -197
  3. package/PLAN-tables-and-postprocess.md +850 -850
  4. package/README.md +433 -433
  5. package/bin/rev.js +11 -11
  6. package/bin/rev.ts +145 -145
  7. package/completions/rev.bash +127 -127
  8. package/completions/rev.ps1 +210 -210
  9. package/completions/rev.zsh +207 -207
  10. package/dist/lib/annotations.d.ts.map +1 -1
  11. package/dist/lib/annotations.js +28 -0
  12. package/dist/lib/annotations.js.map +1 -1
  13. package/dist/lib/build.d.ts +28 -0
  14. package/dist/lib/build.d.ts.map +1 -1
  15. package/dist/lib/build.js +81 -4
  16. package/dist/lib/build.js.map +1 -1
  17. package/dist/lib/commands/comments.d.ts.map +1 -1
  18. package/dist/lib/commands/comments.js +58 -28
  19. package/dist/lib/commands/comments.js.map +1 -1
  20. package/dist/lib/commands/context.d.ts +1 -0
  21. package/dist/lib/commands/context.d.ts.map +1 -1
  22. package/dist/lib/commands/context.js +1 -0
  23. package/dist/lib/commands/context.js.map +1 -1
  24. package/dist/lib/commands/core.d.ts.map +1 -1
  25. package/dist/lib/commands/core.js +25 -8
  26. package/dist/lib/commands/core.js.map +1 -1
  27. package/dist/lib/commands/response.js +1 -1
  28. package/dist/lib/commands/response.js.map +1 -1
  29. package/dist/lib/commands/utilities.js +164 -164
  30. package/dist/lib/commands/word-tools.js +8 -8
  31. package/dist/lib/grammar.js +3 -3
  32. package/dist/lib/import.d.ts +14 -0
  33. package/dist/lib/import.d.ts.map +1 -1
  34. package/dist/lib/import.js +23 -0
  35. package/dist/lib/import.js.map +1 -1
  36. package/dist/lib/input.d.ts +67 -0
  37. package/dist/lib/input.d.ts.map +1 -0
  38. package/dist/lib/input.js +164 -0
  39. package/dist/lib/input.js.map +1 -0
  40. package/dist/lib/macro-filter.lua +201 -201
  41. package/dist/lib/pdf-comments.js +44 -44
  42. package/dist/lib/plugins.js +57 -57
  43. package/dist/lib/pptx-color-filter.lua +37 -37
  44. package/dist/lib/pptx-themes.js +115 -115
  45. package/dist/lib/response.d.ts +1 -1
  46. package/dist/lib/response.d.ts.map +1 -1
  47. package/dist/lib/response.js +5 -2
  48. package/dist/lib/response.js.map +1 -1
  49. package/dist/lib/schema.d.ts.map +1 -1
  50. package/dist/lib/schema.js +8 -2
  51. package/dist/lib/schema.js.map +1 -1
  52. package/dist/lib/spelling.js +2 -2
  53. package/dist/lib/templates.js +387 -387
  54. package/dist/lib/themes.js +51 -51
  55. package/eslint.config.js +27 -27
  56. package/lib/anchor-match.ts +307 -307
  57. package/lib/annotations.ts +695 -664
  58. package/lib/build.ts +2047 -1956
  59. package/lib/citations.ts +160 -160
  60. package/lib/commands/build.ts +885 -885
  61. package/lib/commands/citations.ts +515 -515
  62. package/lib/commands/comments.ts +1077 -1050
  63. package/lib/commands/context.ts +185 -176
  64. package/lib/commands/core.ts +328 -309
  65. package/lib/commands/doi.ts +451 -451
  66. package/lib/commands/file-ops.ts +372 -372
  67. package/lib/commands/history.ts +320 -320
  68. package/lib/commands/index.ts +87 -87
  69. package/lib/commands/init.ts +259 -259
  70. package/lib/commands/merge-resolve.ts +378 -378
  71. package/lib/commands/preview.ts +178 -178
  72. package/lib/commands/project-info.ts +244 -244
  73. package/lib/commands/quality.ts +517 -517
  74. package/lib/commands/response.ts +454 -454
  75. package/lib/commands/section-boundaries.ts +82 -82
  76. package/lib/commands/sections.ts +451 -451
  77. package/lib/commands/sync.ts +689 -689
  78. package/lib/commands/text-ops.ts +449 -449
  79. package/lib/commands/utilities.ts +448 -448
  80. package/lib/commands/verify-anchors.ts +272 -272
  81. package/lib/commands/word-tools.ts +340 -340
  82. package/lib/comment-realign.ts +99 -99
  83. package/lib/config.ts +84 -84
  84. package/lib/crossref.ts +781 -781
  85. package/lib/csl.ts +191 -191
  86. package/lib/dependencies.ts +132 -132
  87. package/lib/diff-engine.ts +465 -465
  88. package/lib/doi-cache.ts +115 -115
  89. package/lib/doi.ts +879 -879
  90. package/lib/equations.ts +506 -506
  91. package/lib/errors.ts +350 -350
  92. package/lib/format.ts +541 -541
  93. package/lib/git.ts +326 -326
  94. package/lib/grammar.ts +303 -303
  95. package/lib/image-registry.ts +180 -180
  96. package/lib/import.ts +932 -906
  97. package/lib/input.ts +174 -0
  98. package/lib/journals.ts +543 -543
  99. package/lib/macro-filter.lua +201 -201
  100. package/lib/macros.ts +273 -273
  101. package/lib/merge.ts +633 -633
  102. package/lib/ooxml.ts +768 -768
  103. package/lib/orcid.ts +144 -144
  104. package/lib/pdf-comments.ts +263 -263
  105. package/lib/pdf-import.ts +524 -524
  106. package/lib/plugins.ts +362 -362
  107. package/lib/postprocess.ts +188 -188
  108. package/lib/pptx-color-filter.lua +37 -37
  109. package/lib/pptx-template.ts +469 -469
  110. package/lib/pptx-themes.ts +483 -483
  111. package/lib/protect-restore.ts +520 -520
  112. package/lib/rate-limiter.ts +127 -127
  113. package/lib/response.ts +200 -197
  114. package/lib/restore-references.ts +240 -240
  115. package/lib/review.ts +327 -327
  116. package/lib/schema.ts +494 -488
  117. package/lib/scientific-words.ts +73 -73
  118. package/lib/sections.ts +428 -428
  119. package/lib/slides.ts +756 -756
  120. package/lib/spelling.ts +334 -334
  121. package/lib/templates.ts +526 -526
  122. package/lib/themes.ts +742 -742
  123. package/lib/trackchanges.ts +166 -166
  124. package/lib/tui.ts +450 -450
  125. package/lib/types.ts +546 -546
  126. package/lib/undo.ts +250 -250
  127. package/lib/utils.ts +69 -69
  128. package/lib/variables.ts +179 -179
  129. package/lib/word-extraction.ts +525 -525
  130. package/lib/word.ts +526 -526
  131. package/lib/wordcomments.ts +789 -789
  132. package/package.json +1 -1
  133. package/scripts/postbuild.js +47 -47
  134. package/skill/REFERENCE.md +550 -550
  135. package/skill/SKILL.md +302 -302
  136. package/tsconfig.json +26 -26
  137. package/types/index.d.ts +531 -531
  138. package/issues.md +0 -180
  139. package/site/assets/extra.css +0 -208
  140. package/site/commands.html +0 -926
  141. package/site/configuration.html +0 -469
  142. package/site/index.html +0 -288
  143. package/site/troubleshooting.html +0 -461
  144. package/site/workflow.html +0 -518
@@ -8,42 +8,42 @@ import { escapeLatex } from './utils.js';
8
8
  * LaTeX preamble for margin comments
9
9
  * Uses todonotes package with custom styling
10
10
  */
11
- export const MARGIN_NOTES_PREAMBLE = `
12
- % Margin notes for comments
13
- \\usepackage[colorinlistoftodos,textsize=scriptsize]{todonotes}
14
- \\usepackage{xcolor}
15
-
16
- % Define comment colors by author
17
- \\definecolor{commentblue}{RGB}{59, 130, 246}
18
- \\definecolor{commentgreen}{RGB}{34, 197, 94}
19
- \\definecolor{commentorange}{RGB}{249, 115, 22}
20
- \\definecolor{commentpurple}{RGB}{168, 85, 247}
21
- \\definecolor{commentgray}{RGB}{107, 114, 128}
22
-
23
- % Custom margin note command
24
- \\newcommand{\\margincomment}[2][]{%
25
- \\todo[linecolor=commentblue,backgroundcolor=commentblue!10,bordercolor=commentblue,size=\\scriptsize,#1]{#2}%
26
- }
27
-
28
- % Author-specific commands
29
- \\newcommand{\\reviewercomment}[2]{%
30
- \\todo[linecolor=commentgreen,backgroundcolor=commentgreen!10,bordercolor=commentgreen,size=\\scriptsize]{\\textbf{#1:} #2}%
31
- }
32
-
33
- % Increase margin for notes (if needed)
34
- % \\setlength{\\marginparwidth}{2.5cm}
11
+ export const MARGIN_NOTES_PREAMBLE = `
12
+ % Margin notes for comments
13
+ \\usepackage[colorinlistoftodos,textsize=scriptsize]{todonotes}
14
+ \\usepackage{xcolor}
15
+
16
+ % Define comment colors by author
17
+ \\definecolor{commentblue}{RGB}{59, 130, 246}
18
+ \\definecolor{commentgreen}{RGB}{34, 197, 94}
19
+ \\definecolor{commentorange}{RGB}{249, 115, 22}
20
+ \\definecolor{commentpurple}{RGB}{168, 85, 247}
21
+ \\definecolor{commentgray}{RGB}{107, 114, 128}
22
+
23
+ % Custom margin note command
24
+ \\newcommand{\\margincomment}[2][]{%
25
+ \\todo[linecolor=commentblue,backgroundcolor=commentblue!10,bordercolor=commentblue,size=\\scriptsize,#1]{#2}%
26
+ }
27
+
28
+ % Author-specific commands
29
+ \\newcommand{\\reviewercomment}[2]{%
30
+ \\todo[linecolor=commentgreen,backgroundcolor=commentgreen!10,bordercolor=commentgreen,size=\\scriptsize]{\\textbf{#1:} #2}%
31
+ }
32
+
33
+ % Increase margin for notes (if needed)
34
+ % \\setlength{\\marginparwidth}{2.5cm}
35
35
  `;
36
36
  /**
37
37
  * Simpler preamble using marginpar (no extra packages needed)
38
38
  */
39
- export const SIMPLE_MARGIN_PREAMBLE = `
40
- % Simple margin notes for comments
41
- \\usepackage{xcolor}
42
- \\definecolor{commentcolor}{RGB}{59, 130, 246}
43
-
44
- \\newcommand{\\margincomment}[1]{%
45
- \\marginpar{\\raggedright\\scriptsize\\textcolor{commentcolor}{#1}}%
46
- }
39
+ export const SIMPLE_MARGIN_PREAMBLE = `
40
+ % Simple margin notes for comments
41
+ \\usepackage{xcolor}
42
+ \\definecolor{commentcolor}{RGB}{59, 130, 246}
43
+
44
+ \\newcommand{\\margincomment}[1]{%
45
+ \\marginpar{\\raggedright\\scriptsize\\textcolor{commentcolor}{#1}}%
46
+ }
47
47
  `;
48
48
  /**
49
49
  * Convert CriticMarkup comments to LaTeX margin notes
@@ -110,12 +110,12 @@ export function convertTrackChangesToLatex(markdown) {
110
110
  result = result.replace(/\{~~([^~]+)~>([^~]+)~~\}/g, (match, oldText, newText) => {
111
111
  return `\\textcolor{red}{\\sout{${escapeLatex(oldText)}}}\\textcolor{green}{${escapeLatex(newText)}}`;
112
112
  });
113
- const preamble = `
114
- % Track changes visualization
115
- \\usepackage{xcolor}
116
- \\usepackage[normalem]{ulem}
117
- \\definecolor{green}{RGB}{34, 197, 94}
118
- \\definecolor{red}{RGB}{239, 68, 68}
113
+ const preamble = `
114
+ % Track changes visualization
115
+ \\usepackage{xcolor}
116
+ \\usepackage[normalem]{ulem}
117
+ \\definecolor{green}{RGB}{34, 197, 94}
118
+ \\definecolor{red}{RGB}{239, 68, 68}
119
119
  `;
120
120
  return { markdown: result, preamble };
121
121
  }
@@ -131,16 +131,16 @@ export function getCombinedPreamble(options = {}) {
131
131
  preamble += useTodonotes ? MARGIN_NOTES_PREAMBLE : SIMPLE_MARGIN_PREAMBLE;
132
132
  }
133
133
  if (trackChanges) {
134
- preamble += `
135
- % Track changes visualization
136
- \\usepackage[normalem]{ulem}
134
+ preamble += `
135
+ % Track changes visualization
136
+ \\usepackage[normalem]{ulem}
137
137
  `;
138
138
  if (!comments) {
139
139
  preamble += `\\usepackage{xcolor}\n`;
140
140
  }
141
- preamble += `
142
- \\definecolor{insertgreen}{RGB}{34, 197, 94}
143
- \\definecolor{deletered}{RGB}{239, 68, 68}
141
+ preamble += `
142
+ \\definecolor{insertgreen}{RGB}{34, 197, 94}
143
+ \\definecolor{deletered}{RGB}{239, 68, 68}
144
144
  `;
145
145
  }
146
146
  return preamble;
@@ -128,63 +128,63 @@ export function getPluginDirs() {
128
128
  */
129
129
  export function createProfileTemplate(journalName) {
130
130
  const id = journalName.toLowerCase().replace(/\s+/g, '-');
131
- return `# Custom journal profile for ${journalName}
132
- # Save as: ~/.rev/profiles/${id}.yaml (user-wide)
133
- # Or: .rev/profiles/${id}.yaml (project-specific)
134
-
135
- id: ${id}
136
- name: "${journalName}"
137
- url: "https://journal-website.com/author-guidelines"
138
-
139
- # Word count limits
140
- wordLimit:
141
- main: 8000 # null for no limit
142
- abstract: 300
143
- title: null # characters
144
-
145
- # Reference requirements
146
- references:
147
- max: null # null for no limit
148
- doiRequired: true
149
-
150
- # Figure/table limits
151
- figures:
152
- max: 8
153
- combinedWithTables: false
154
-
155
- # Required sections
156
- sections:
157
- required:
158
- - Abstract
159
- - Introduction
160
- - Methods
161
- - Results
162
- - Discussion
163
- methodsPosition: null # 'end' or 'before-results'
164
-
165
- # Keywords
166
- keywords:
167
- min: 4
168
- max: 8
169
-
170
- # Other requirements
171
- dataAvailability: true
172
- highlights: false
173
- graphicalAbstract: false
174
-
175
- # Build formatting defaults (applied via rev build -j ${id})
176
- # formatting:
177
- # csl: "${id}" # CSL style name or path
178
- # pdf:
179
- # fontsize: 12pt
180
- # geometry: margin=1in
181
- # linestretch: 1.5
182
- # numbersections: false
183
- # docx:
184
- # reference: null # Path to reference .docx template
185
- # crossref:
186
- # figPrefix: [Fig., Figs.]
187
- # tblPrefix: [Table, Tables]
131
+ return `# Custom journal profile for ${journalName}
132
+ # Save as: ~/.rev/profiles/${id}.yaml (user-wide)
133
+ # Or: .rev/profiles/${id}.yaml (project-specific)
134
+
135
+ id: ${id}
136
+ name: "${journalName}"
137
+ url: "https://journal-website.com/author-guidelines"
138
+
139
+ # Word count limits
140
+ wordLimit:
141
+ main: 8000 # null for no limit
142
+ abstract: 300
143
+ title: null # characters
144
+
145
+ # Reference requirements
146
+ references:
147
+ max: null # null for no limit
148
+ doiRequired: true
149
+
150
+ # Figure/table limits
151
+ figures:
152
+ max: 8
153
+ combinedWithTables: false
154
+
155
+ # Required sections
156
+ sections:
157
+ required:
158
+ - Abstract
159
+ - Introduction
160
+ - Methods
161
+ - Results
162
+ - Discussion
163
+ methodsPosition: null # 'end' or 'before-results'
164
+
165
+ # Keywords
166
+ keywords:
167
+ min: 4
168
+ max: 8
169
+
170
+ # Other requirements
171
+ dataAvailability: true
172
+ highlights: false
173
+ graphicalAbstract: false
174
+
175
+ # Build formatting defaults (applied via rev build -j ${id})
176
+ # formatting:
177
+ # csl: "${id}" # CSL style name or path
178
+ # pdf:
179
+ # fontsize: 12pt
180
+ # geometry: margin=1in
181
+ # linestretch: 1.5
182
+ # numbersections: false
183
+ # docx:
184
+ # reference: null # Path to reference .docx template
185
+ # crossref:
186
+ # figPrefix: [Fig., Figs.]
187
+ # tblPrefix: [Table, Tables]
188
188
  `;
189
189
  }
190
190
  /**
@@ -1,37 +1,37 @@
1
- -- Pandoc Lua filter to add color support for PPTX
2
- -- Handles [text]{color=#RRGGBB} syntax
3
-
4
- function Span(elem)
5
- local color = elem.attributes['color']
6
- if color then
7
- -- Remove # if present
8
- color = color:gsub('^#', '')
9
-
10
- -- Create raw OpenXML for colored text
11
- local content_text = pandoc.utils.stringify(elem.content)
12
-
13
- -- Check if content has bold
14
- local is_bold = false
15
- for _, item in ipairs(elem.content) do
16
- if item.t == 'Strong' then
17
- is_bold = true
18
- content_text = pandoc.utils.stringify(item.content)
19
- break
20
- end
21
- end
22
-
23
- local bold_attr = ''
24
- if is_bold then
25
- bold_attr = ' b="1"'
26
- end
27
-
28
- -- Return raw OOXML span with color
29
- local ooxml = string.format(
30
- '<a:r><a:rPr%s><a:solidFill><a:srgbClr val="%s"/></a:solidFill></a:rPr><a:t>%s</a:t></a:r>',
31
- bold_attr, color, content_text
32
- )
33
-
34
- return pandoc.RawInline('openxml', ooxml)
35
- end
36
- return elem
37
- end
1
+ -- Pandoc Lua filter to add color support for PPTX
2
+ -- Handles [text]{color=#RRGGBB} syntax
3
+
4
+ function Span(elem)
5
+ local color = elem.attributes['color']
6
+ if color then
7
+ -- Remove # if present
8
+ color = color:gsub('^#', '')
9
+
10
+ -- Create raw OpenXML for colored text
11
+ local content_text = pandoc.utils.stringify(elem.content)
12
+
13
+ -- Check if content has bold
14
+ local is_bold = false
15
+ for _, item in ipairs(elem.content) do
16
+ if item.t == 'Strong' then
17
+ is_bold = true
18
+ content_text = pandoc.utils.stringify(item.content)
19
+ break
20
+ end
21
+ end
22
+
23
+ local bold_attr = ''
24
+ if is_bold then
25
+ bold_attr = ' b="1"'
26
+ end
27
+
28
+ -- Return raw OOXML span with color
29
+ local ooxml = string.format(
30
+ '<a:r><a:rPr%s><a:solidFill><a:srgbClr val="%s"/></a:solidFill></a:rPr><a:t>%s</a:t></a:r>',
31
+ bold_attr, color, content_text
32
+ )
33
+
34
+ return pandoc.RawInline('openxml', ooxml)
35
+ end
36
+ return elem
37
+ end
@@ -175,58 +175,58 @@ export function getTheme(name) {
175
175
  * Generate [Content_Types].xml
176
176
  */
177
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"/>
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
191
  </Types>`;
192
192
  }
193
193
  /**
194
194
  * Generate _rels/.rels
195
195
  */
196
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"/>
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
202
  </Relationships>`;
203
203
  }
204
204
  /**
205
205
  * Generate ppt/_rels/presentation.xml.rels
206
206
  */
207
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"/>
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
212
  </Relationships>`;
213
213
  }
214
214
  /**
215
215
  * Generate ppt/presentation.xml
216
216
  */
217
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>
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
230
  </p:presentation>`;
231
231
  }
232
232
  /**
@@ -235,87 +235,87 @@ function generatePresentation() {
235
235
  function generateTheme(theme) {
236
236
  const c = theme.colors;
237
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/>
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
319
  </a:theme>`;
320
320
  }
321
321
  /**
@@ -36,6 +36,6 @@ export declare function generateResponseLetter(comments: CommentWithReplies[], o
36
36
  /**
37
37
  * Collect comments from multiple files
38
38
  */
39
- export declare function collectComments(files: string[]): CommentWithReplies[];
39
+ export declare function collectComments(files: string[]): Promise<CommentWithReplies[]>;
40
40
  export {};
41
41
  //# sourceMappingURL=response.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../lib/response.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,kBAAkB;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,KAAK,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,eAAe;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,MAAW,GAAG,kBAAkB,EAAE,CAoC9F;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,kBAAkB,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,CAAC,CAYjG;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,EAAE,OAAO,GAAE,eAAoB,GAAG,MAAM,CAwF5G;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,kBAAkB,EAAE,CAYrE"}
1
+ {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../lib/response.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,kBAAkB;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,KAAK,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,eAAe;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,MAAW,GAAG,kBAAkB,EAAE,CAoC9F;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,kBAAkB,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,CAAC,CAYjG;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,EAAE,OAAO,GAAE,eAAoB,GAAG,MAAM,CAwF5G;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAepF"}
@@ -136,12 +136,15 @@ export function generateResponseLetter(comments, options = {}) {
136
136
  /**
137
137
  * Collect comments from multiple files
138
138
  */
139
- export function collectComments(files) {
139
+ export async function collectComments(files) {
140
+ const { readAnnotatedInput } = await import('./input.js');
140
141
  const allComments = [];
141
142
  for (const file of files) {
142
143
  if (!fs.existsSync(file))
143
144
  continue;
144
- const text = fs.readFileSync(file, 'utf-8');
145
+ // Route each file through the shared reader so a returned `.docx` is
146
+ // converted to CriticMarkup first, rather than regexing the binary ZIP.
147
+ const text = await readAnnotatedInput(file);
145
148
  const comments = parseCommentsWithReplies(text, path.basename(file));
146
149
  allComments.push(...comments);
147
150
  }