@open-document/core 0.11.0 → 0.13.0

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 (105) hide show
  1. package/dist/{build-BHFGY8eF.js → build-CbgIk6bA.js} +1 -1
  2. package/dist/{check-UEBmDfT_.js → check-BTroj-5Z.js} +3 -3
  3. package/dist/cli/bin.js +58 -34
  4. package/dist/config-BWtOZ1jc.d.ts +45 -0
  5. package/dist/{config-B_pdNbYg.js → config-DKKNIbvO.js} +1458 -983
  6. package/dist/{context-BM9_-u9P.js → context-DXNP8v9I.js} +3 -2
  7. package/dist/deploy-gcp-BUiSuqz7.js +758 -0
  8. package/dist/{dev-DX3QMIRi.js → dev-YXumw5iX.js} +1 -1
  9. package/dist/{diagram-BK4jTZr4.js → diagram-CKf3ptOE.js} +293 -13
  10. package/dist/{diff-DayvbXfX.js → diff-CTFfU4Tz.js} +2 -2
  11. package/dist/{export-BPsXj1i6.js → export-D2QLtF84.js} +11 -4
  12. package/dist/flow-CS5apebG.d.ts +252 -0
  13. package/dist/{import-71wlAsrd.js → import-CcmrFetU.js} +3 -2
  14. package/dist/index.d.ts +155 -59
  15. package/dist/index.js +945 -104
  16. package/dist/open-doc-plugin-DnX5usgI.js +320 -0
  17. package/dist/ops/index.d.ts +112 -3
  18. package/dist/ops/index.js +3 -3
  19. package/dist/{ops-BUo67DaP.js → ops-DmEecq1k.js} +86 -164
  20. package/dist/package-version-C89gtYSk.js +36 -0
  21. package/dist/{preview-D3m1-gUL.js → preview-_mHpBhMk.js} +1 -1
  22. package/dist/templates-MMblHwmT.js +34 -0
  23. package/dist/vite/index.d.ts +1 -1
  24. package/dist/vite/index.js +2 -1
  25. package/package.json +2 -1
  26. package/skills/apply-comments/SKILL.md +3 -1
  27. package/skills/create-doc/SKILL.md +2 -0
  28. package/skills/doc-authoring/SKILL.md +17 -16
  29. package/skills/doc-authoring/references/long-form.md +43 -2
  30. package/skills/doc-authoring/references/pagination.md +14 -2
  31. package/skills/doc-authoring/references/tables-and-charts.md +21 -17
  32. package/src/app/components/browser/browser-ui.tsx +21 -0
  33. package/src/app/components/browser/new-document-dialog.tsx +208 -0
  34. package/src/app/components/callout.tsx +101 -0
  35. package/src/app/components/changes/changes-overlay.tsx +68 -0
  36. package/src/app/components/changes/changes-panel.tsx +341 -0
  37. package/src/app/components/changes/use-changes.ts +85 -0
  38. package/src/app/components/chart.tsx +191 -33
  39. package/src/app/components/code-block.tsx +249 -0
  40. package/src/app/components/comments/comments-overlay.tsx +50 -0
  41. package/src/app/components/comments/comments-panel.tsx +272 -0
  42. package/src/app/components/comments/use-comments.ts +61 -0
  43. package/src/app/components/data-table.tsx +146 -18
  44. package/src/app/components/doc-sidebar.tsx +32 -2
  45. package/src/app/components/flow-page.tsx +57 -8
  46. package/src/app/components/inspector/field-source.tsx +41 -0
  47. package/src/app/components/inspector/inspector.tsx +64 -65
  48. package/src/app/components/numbering.tsx +226 -12
  49. package/src/app/components/overlay-frame.tsx +79 -0
  50. package/src/app/components/page-frame.tsx +46 -0
  51. package/src/app/components/page-placement.ts +68 -0
  52. package/src/app/components/record-picker.tsx +79 -0
  53. package/src/app/components/themes/theme-preview.tsx +5 -4
  54. package/src/app/lib/agent-bridge.ts +29 -1
  55. package/src/app/lib/chart.test.ts +15 -0
  56. package/src/app/lib/chart.ts +134 -9
  57. package/src/app/lib/diagnostics.ts +45 -1
  58. package/src/app/lib/docx/ooxml.test.ts +24 -1
  59. package/src/app/lib/docx/ooxml.ts +27 -1
  60. package/src/app/lib/export-docx.ts +3 -1
  61. package/src/app/lib/export-dom.ts +17 -3
  62. package/src/app/lib/export-html.ts +4 -2
  63. package/src/app/lib/export-image.ts +2 -1
  64. package/src/app/lib/export-pdf.ts +9 -1
  65. package/src/app/lib/flow-measure.test.ts +30 -0
  66. package/src/app/lib/flow-measure.ts +68 -14
  67. package/src/app/lib/flow.test.ts +20 -1
  68. package/src/app/lib/flow.ts +120 -20
  69. package/src/app/lib/i18n-ja/browser.ts +10 -0
  70. package/src/app/lib/i18n-ja/doc.ts +4 -0
  71. package/src/app/lib/i18n-ja/panels.ts +40 -0
  72. package/src/app/lib/i18n-ko/browser.ts +10 -0
  73. package/src/app/lib/i18n-ko/doc.ts +4 -0
  74. package/src/app/lib/i18n-ko/panels.ts +39 -0
  75. package/src/app/lib/i18n-zh-cn/browser.ts +10 -0
  76. package/src/app/lib/i18n-zh-cn/doc.ts +4 -0
  77. package/src/app/lib/i18n-zh-cn/panels.ts +38 -0
  78. package/src/app/lib/i18n-zh-tw/browser.ts +10 -0
  79. package/src/app/lib/i18n-zh-tw/doc.ts +4 -0
  80. package/src/app/lib/i18n-zh-tw/panels.ts +38 -0
  81. package/src/app/lib/labels.ts +29 -10
  82. package/src/app/lib/records.test.ts +38 -0
  83. package/src/app/lib/records.ts +127 -0
  84. package/src/app/lib/sdk.ts +35 -0
  85. package/src/app/lib/use-doc-module.ts +7 -0
  86. package/src/app/lib/use-doc-pages.ts +38 -17
  87. package/src/app/routes/doc.tsx +275 -13
  88. package/src/app/routes/home.tsx +30 -5
  89. package/src/app/styles.css +23 -0
  90. package/templates/blank/index.tsx +63 -0
  91. package/templates/blank/template.json +6 -0
  92. package/templates/certificate/data/recipients.csv +4 -0
  93. package/templates/certificate/index.tsx +128 -0
  94. package/templates/certificate/template.json +6 -0
  95. package/templates/letter/index.tsx +106 -0
  96. package/templates/letter/template.json +5 -0
  97. package/templates/meeting-notes/index.tsx +194 -0
  98. package/templates/meeting-notes/template.json +6 -0
  99. package/templates/proposal/index.tsx +264 -0
  100. package/templates/proposal/template.json +6 -0
  101. package/templates/report/data/metrics.csv +5 -0
  102. package/templates/report/index.tsx +224 -0
  103. package/templates/report/template.json +6 -0
  104. package/dist/config-P61niZMf.d.ts +0 -24
  105. package/dist/sdk-CpDEGRIo.d.ts +0 -138
@@ -0,0 +1,264 @@
1
+ import {
2
+ type DesignSystem,
3
+ type DocEntry,
4
+ type DocMeta,
5
+ type DocPage,
6
+ flow,
7
+ useDocPageCount,
8
+ useDocPageNumber,
9
+ } from '@open-document/core';
10
+ import type { CSSProperties, ReactNode } from 'react';
11
+
12
+ export const meta: DocMeta = {
13
+ title: 'Project proposal',
14
+ subtitle: 'What we propose, what it costs, and when it lands',
15
+ author: 'Your team',
16
+ createdAt: '2026-01-01T00:00:00.000Z',
17
+ };
18
+
19
+ export const design: DesignSystem = {
20
+ palette: {
21
+ bg: '#ffffff',
22
+ text: '#17161a',
23
+ muted: '#6b6873',
24
+ accent: '#6d28d9',
25
+ rule: '#e7e5ec',
26
+ },
27
+ fonts: {
28
+ heading: 'Georgia, "Times New Roman", serif',
29
+ body: '-apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif',
30
+ mono: 'ui-monospace, "SF Mono", Menlo, monospace',
31
+ },
32
+ typeScale: { title: 44, h1: 24, h2: 16, h3: 13.5, body: 12.5, caption: 9.5 },
33
+ margin: 72,
34
+ leading: 1.6,
35
+ radius: 4,
36
+ };
37
+
38
+ const page: CSSProperties = {
39
+ width: '100%',
40
+ height: '100%',
41
+ boxSizing: 'border-box',
42
+ padding: 'var(--od-margin)',
43
+ position: 'relative',
44
+ };
45
+ const h1: CSSProperties = {
46
+ fontFamily: 'var(--od-font-heading)',
47
+ fontSize: 'var(--od-size-h1)',
48
+ fontWeight: 600,
49
+ margin: '10px 0 12px',
50
+ };
51
+ const h2: CSSProperties = { fontSize: 'var(--od-size-h2)', fontWeight: 600, margin: '16px 0 8px' };
52
+ const p: CSSProperties = { margin: '0 0 10px' };
53
+ const list: CSSProperties = { margin: '0 0 10px', paddingLeft: 18 };
54
+ const cell: CSSProperties = {
55
+ borderBottom: '1px solid var(--od-rule)',
56
+ padding: '6px 8px',
57
+ textAlign: 'left',
58
+ verticalAlign: 'top',
59
+ fontSize: 11.5,
60
+ };
61
+ const head: CSSProperties = { ...cell, fontWeight: 600, color: 'var(--od-muted)', fontSize: 10.5 };
62
+
63
+ const Table = ({
64
+ columns,
65
+ rows,
66
+ align = [],
67
+ }: {
68
+ columns: string[];
69
+ rows: ReactNode[][];
70
+ align?: Array<'left' | 'right'>;
71
+ }) => (
72
+ <table style={{ width: '100%', borderCollapse: 'collapse', margin: '6px 0 14px' }}>
73
+ <thead>
74
+ <tr>
75
+ {columns.map((column, at) => (
76
+ <th key={column} style={{ ...head, textAlign: align[at] ?? 'left' }}>
77
+ {column}
78
+ </th>
79
+ ))}
80
+ </tr>
81
+ </thead>
82
+ <tbody>
83
+ {rows.map((row, r) => (
84
+ // biome-ignore lint/suspicious/noArrayIndexKey: rows are positional
85
+ <tr key={r}>
86
+ {row.map((value, c) => (
87
+ <td
88
+ // biome-ignore lint/suspicious/noArrayIndexKey: cells are positional
89
+ key={c}
90
+ style={{
91
+ ...cell,
92
+ textAlign: align[c] ?? 'left',
93
+ fontVariantNumeric: 'tabular-nums',
94
+ }}
95
+ >
96
+ {value}
97
+ </td>
98
+ ))}
99
+ </tr>
100
+ ))}
101
+ </tbody>
102
+ </table>
103
+ );
104
+
105
+ const SectionNo = ({ n }: { n: string }) => (
106
+ <span style={{ color: 'var(--od-accent)', marginRight: 10 }}>{n}</span>
107
+ );
108
+
109
+ const Footer = () => (
110
+ <div
111
+ style={{
112
+ position: 'absolute',
113
+ left: 'var(--od-margin)',
114
+ right: 'var(--od-margin)',
115
+ bottom: 36,
116
+ display: 'flex',
117
+ justifyContent: 'space-between',
118
+ fontSize: 'var(--od-size-caption)',
119
+ color: 'var(--od-muted)',
120
+ }}
121
+ >
122
+ <span>Project proposal · Prepared for Client name</span>
123
+ <span style={{ fontVariantNumeric: 'tabular-nums' }}>
124
+ {useDocPageNumber()} / {useDocPageCount()}
125
+ </span>
126
+ </div>
127
+ );
128
+
129
+ const Cover: DocPage = () => (
130
+ <div
131
+ style={{
132
+ ...page,
133
+ display: 'flex',
134
+ flexDirection: 'column',
135
+ justifyContent: 'center',
136
+ borderLeft: '10px solid var(--od-accent)',
137
+ }}
138
+ >
139
+ <p style={{ ...p, fontSize: 11, letterSpacing: '0.16em', textTransform: 'uppercase' }}>
140
+ Proposal for Client name
141
+ </p>
142
+ <h1
143
+ data-od-outline="skip"
144
+ style={{ ...h1, fontSize: 'var(--od-size-title)', lineHeight: 1.1, margin: '6px 0 18px' }}
145
+ >
146
+ Project proposal
147
+ </h1>
148
+ <p style={{ ...p, fontSize: 15, color: 'var(--od-muted)', maxWidth: 420 }}>
149
+ What we propose, what it costs, and when it lands.
150
+ </p>
151
+ <dl
152
+ style={{
153
+ display: 'grid',
154
+ gridTemplateColumns: 'auto 1fr',
155
+ gap: '4px 18px',
156
+ marginTop: 56,
157
+ fontSize: 11.5,
158
+ }}
159
+ >
160
+ <dt style={{ color: 'var(--od-muted)' }}>Prepared by</dt>
161
+ <dd style={{ margin: 0 }}>Your name, Your company</dd>
162
+ <dt style={{ color: 'var(--od-muted)' }}>Date</dt>
163
+ <dd style={{ margin: 0 }}>January 2026</dd>
164
+ <dt style={{ color: 'var(--od-muted)' }}>Valid until</dt>
165
+ <dd style={{ margin: 0 }}>31 March 2026</dd>
166
+ </dl>
167
+ </div>
168
+ );
169
+
170
+ const Body = flow(
171
+ <>
172
+ <h1 style={h1}>
173
+ <SectionNo n="01" />
174
+ The problem
175
+ </h1>
176
+ <p style={p}>
177
+ Describe the situation in the client's own terms: what is not working, what it costs them, and
178
+ why it matters now.
179
+ </p>
180
+
181
+ <h1 style={h1}>
182
+ <SectionNo n="02" />
183
+ Our approach
184
+ </h1>
185
+ <p style={p}>Explain the solution in a paragraph, then the parts it is made of.</p>
186
+ <ul style={list}>
187
+ <li>The first part, and the result it produces.</li>
188
+ <li>The second part, and how it builds on the first.</li>
189
+ <li>How you will know it worked.</li>
190
+ </ul>
191
+
192
+ <h1 style={h1}>
193
+ <SectionNo n="03" />
194
+ Scope
195
+ </h1>
196
+ <h2 style={h2}>Included</h2>
197
+ <ul style={list}>
198
+ <li>Deliverable one</li>
199
+ <li>Deliverable two</li>
200
+ </ul>
201
+ <h2 style={h2}>Not included</h2>
202
+ <ul style={list}>
203
+ <li>What the client should not expect, said plainly.</li>
204
+ </ul>
205
+
206
+ <h1 style={h1}>
207
+ <SectionNo n="04" />
208
+ Timeline
209
+ </h1>
210
+ <Table
211
+ columns={['Phase', 'What happens', 'Weeks']}
212
+ align={['left', 'left', 'right']}
213
+ rows={[
214
+ ['Discovery', 'Interviews, audit, agreed plan', '2'],
215
+ ['Build', 'The work itself, reviewed every week', '6'],
216
+ ['Handover', 'Training, documentation, sign-off', '1'],
217
+ ]}
218
+ />
219
+
220
+ <h1 style={h1}>
221
+ <SectionNo n="05" />
222
+ Investment
223
+ </h1>
224
+ <Table
225
+ columns={['Item', 'Amount (USD)']}
226
+ align={['left', 'right']}
227
+ rows={[
228
+ ['Discovery', '8,000'],
229
+ ['Build', '36,000'],
230
+ ['Handover', '4,000'],
231
+ [<strong key="t">Total</strong>, <strong key="v">48,000</strong>],
232
+ ]}
233
+ />
234
+ <p style={{ ...p, fontSize: 'var(--od-size-caption)', color: 'var(--od-muted)' }}>
235
+ Invoiced at the start of each phase. Prices exclude tax.
236
+ </p>
237
+
238
+ <h1 style={h1}>
239
+ <SectionNo n="06" />
240
+ Next steps
241
+ </h1>
242
+ <p style={p}>Sign below to accept, and we will schedule the first workshop within a week.</p>
243
+ <div
244
+ style={{
245
+ display: 'grid',
246
+ gridTemplateColumns: '1fr 1fr',
247
+ gap: 40,
248
+ marginTop: 36,
249
+ fontSize: 11,
250
+ color: 'var(--od-muted)',
251
+ }}
252
+ >
253
+ <div style={{ borderTop: '1px solid var(--od-text)', paddingTop: 6 }}>
254
+ For Client name — signature and date
255
+ </div>
256
+ <div style={{ borderTop: '1px solid var(--od-text)', paddingTop: 6 }}>
257
+ For Your company — signature and date
258
+ </div>
259
+ </div>
260
+ </>,
261
+ { footer: Footer },
262
+ );
263
+
264
+ export default [Cover, Body] satisfies DocEntry[];
@@ -0,0 +1,6 @@
1
+ {
2
+ "title": "Proposal",
3
+ "description": "Cover, the problem, the proposed approach, scope, timeline, budget and sign-off.",
4
+ "category": "business",
5
+ "placeholder": "Project proposal"
6
+ }
@@ -0,0 +1,5 @@
1
+ quarter,revenue,customers,churn
2
+ Q1,1240000,412,0.031
3
+ Q2,1385000,447,0.028
4
+ Q3,1512000,489,0.026
5
+ Q4,1698000,531,0.024
@@ -0,0 +1,224 @@
1
+ import {
2
+ DataTable,
3
+ type DesignSystem,
4
+ type DocEntry,
5
+ type DocMeta,
6
+ type DocPage,
7
+ Footnote,
8
+ flow,
9
+ TableOfContents,
10
+ useDocPageCount,
11
+ useDocPageNumber,
12
+ } from '@open-document/core';
13
+ import type { CSSProperties, ReactNode } from 'react';
14
+ import metrics from './data/metrics.csv';
15
+
16
+ export const meta: DocMeta = {
17
+ title: 'Annual report',
18
+ subtitle: 'Performance, findings and what we recommend next',
19
+ author: 'Your team',
20
+ createdAt: '2026-01-01T00:00:00.000Z',
21
+ };
22
+
23
+ export const design: DesignSystem = {
24
+ palette: {
25
+ bg: '#ffffff',
26
+ text: '#14171c',
27
+ muted: '#667085',
28
+ accent: '#0f5b9e',
29
+ rule: '#e3e7ee',
30
+ },
31
+ fonts: {
32
+ heading: '-apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif',
33
+ body: '-apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif',
34
+ mono: 'ui-monospace, "SF Mono", Menlo, monospace',
35
+ },
36
+ typeScale: { title: 42, h1: 24, h2: 16, h3: 13.5, body: 12.5, caption: 9.5 },
37
+ margin: 72,
38
+ leading: 1.6,
39
+ radius: 4,
40
+ };
41
+
42
+ const page: CSSProperties = {
43
+ width: '100%',
44
+ height: '100%',
45
+ boxSizing: 'border-box',
46
+ padding: 'var(--od-margin)',
47
+ position: 'relative',
48
+ };
49
+ const h1: CSSProperties = {
50
+ fontSize: 'var(--od-size-h1)',
51
+ fontWeight: 650,
52
+ letterSpacing: '-0.01em',
53
+ margin: '8px 0 12px',
54
+ };
55
+ const h2: CSSProperties = { fontSize: 'var(--od-size-h2)', fontWeight: 600, margin: '18px 0 8px' };
56
+ const p: CSSProperties = { margin: '0 0 10px' };
57
+ const list: CSSProperties = { margin: '0 0 10px', paddingLeft: 18 };
58
+
59
+ const Eyebrow = ({ children }: { children: ReactNode }) => (
60
+ <p
61
+ style={{
62
+ margin: 0,
63
+ fontSize: 10.5,
64
+ fontWeight: 600,
65
+ letterSpacing: '0.16em',
66
+ textTransform: 'uppercase',
67
+ color: 'var(--od-accent)',
68
+ }}
69
+ >
70
+ {children}
71
+ </p>
72
+ );
73
+
74
+ /** One figure that matters, set large, with what it means underneath. */
75
+ const Stat = ({ value, label }: { value: string; label: string }) => (
76
+ <div style={{ borderTop: '2px solid var(--od-accent)', paddingTop: 8 }}>
77
+ <div style={{ fontSize: 22, fontWeight: 650, fontVariantNumeric: 'tabular-nums' }}>{value}</div>
78
+ <div style={{ fontSize: 'var(--od-size-caption)', color: 'var(--od-muted)' }}>{label}</div>
79
+ </div>
80
+ );
81
+
82
+ const Header = () => (
83
+ <div
84
+ style={{
85
+ position: 'absolute',
86
+ top: 34,
87
+ left: 'var(--od-margin)',
88
+ right: 'var(--od-margin)',
89
+ fontSize: 'var(--od-size-caption)',
90
+ color: 'var(--od-muted)',
91
+ letterSpacing: '0.08em',
92
+ textTransform: 'uppercase',
93
+ }}
94
+ >
95
+ Annual report
96
+ </div>
97
+ );
98
+
99
+ const Footer = () => (
100
+ <div
101
+ style={{
102
+ position: 'absolute',
103
+ left: 'var(--od-margin)',
104
+ right: 'var(--od-margin)',
105
+ bottom: 36,
106
+ display: 'flex',
107
+ justifyContent: 'space-between',
108
+ fontSize: 'var(--od-size-caption)',
109
+ color: 'var(--od-muted)',
110
+ borderTop: '1px solid var(--od-rule)',
111
+ paddingTop: 8,
112
+ }}
113
+ >
114
+ <span>Your organisation · Confidential</span>
115
+ <span style={{ fontVariantNumeric: 'tabular-nums' }}>
116
+ {useDocPageNumber()} / {useDocPageCount()}
117
+ </span>
118
+ </div>
119
+ );
120
+
121
+ const Cover: DocPage = () => (
122
+ <div style={{ ...page, display: 'flex', flexDirection: 'column' }}>
123
+ <div style={{ height: 6, width: 56, background: 'var(--od-accent)', marginBottom: 'auto' }} />
124
+ <Eyebrow>Report · 2026</Eyebrow>
125
+ <h1
126
+ data-od-outline="skip"
127
+ style={{ ...h1, fontSize: 'var(--od-size-title)', lineHeight: 1.1, margin: '14px 0 14px' }}
128
+ >
129
+ Annual report
130
+ </h1>
131
+ <p style={{ ...p, fontSize: 15, color: 'var(--od-muted)', maxWidth: 440 }}>
132
+ Performance, findings and what we recommend next.
133
+ </p>
134
+ <div
135
+ style={{
136
+ marginTop: 48,
137
+ paddingTop: 12,
138
+ borderTop: '1px solid var(--od-rule)',
139
+ display: 'flex',
140
+ gap: 40,
141
+ fontSize: 11,
142
+ color: 'var(--od-muted)',
143
+ }}
144
+ >
145
+ <span>Prepared by Your team</span>
146
+ <span>January 2026</span>
147
+ </div>
148
+ </div>
149
+ );
150
+
151
+ const Contents: DocPage = () => (
152
+ <div style={page}>
153
+ <h2 data-od-outline="skip" style={h1}>
154
+ Contents
155
+ </h2>
156
+ <TableOfContents maxLevel={1} />
157
+ </div>
158
+ );
159
+
160
+ const Body = flow(
161
+ <>
162
+ <Eyebrow>Summary</Eyebrow>
163
+ <h1 style={h1}>Executive summary</h1>
164
+ <p style={p}>
165
+ State the conclusion first, in two or three sentences: what happened this year, why it
166
+ matters, and the one decision you need from the reader.
167
+ </p>
168
+ <div
169
+ style={{
170
+ display: 'grid',
171
+ gridTemplateColumns: 'repeat(3, 1fr)',
172
+ gap: 20,
173
+ margin: '16px 0 20px',
174
+ }}
175
+ >
176
+ <Stat value="$5.8M" label="Revenue, up 37% on last year" />
177
+ <Stat value="531" label="Customers at year end" />
178
+ <Stat value="2.4%" label="Quarterly churn, down from 3.1%" />
179
+ </div>
180
+
181
+ <Eyebrow>Section 1</Eyebrow>
182
+ <h1 style={h1}>Background</h1>
183
+ <p style={p}>
184
+ Describe where things stood at the start of the period and what you set out to do. Keep it to
185
+ what the reader needs to follow the findings.
186
+ <Footnote>Source and method notes go in footnotes, not in the body.</Footnote>
187
+ </p>
188
+
189
+ <Eyebrow>Section 2</Eyebrow>
190
+ <h1 style={h1}>Findings</h1>
191
+ <h2 style={h2}>2.1 Growth by quarter</h2>
192
+ <p style={p}>
193
+ The table is printed from <code>data/metrics.csv</code>; replace the file and the numbers
194
+ follow.
195
+ </p>
196
+ <DataTable
197
+ caption="Revenue, customers and churn by quarter"
198
+ rows={metrics}
199
+ columns={[
200
+ { key: 'quarter', label: 'Quarter' },
201
+ { key: 'revenue', label: 'Revenue (USD)', format: 'integer' },
202
+ { key: 'customers', label: 'Customers', format: 'integer' },
203
+ { key: 'churn', label: 'Churn', format: 'percent' },
204
+ ]}
205
+ />
206
+ <h2 style={h2}>2.2 What drove it</h2>
207
+ <p style={p}>Explain the two or three causes behind the numbers, each with its evidence.</p>
208
+
209
+ <Eyebrow>Section 3</Eyebrow>
210
+ <h1 style={h1}>Recommendations</h1>
211
+ <ol style={list}>
212
+ <li>The first thing to do, who owns it, and by when.</li>
213
+ <li>The second, with the result you expect from it.</li>
214
+ <li>What to stop doing, and what that frees up.</li>
215
+ </ol>
216
+
217
+ <Eyebrow>Appendix</Eyebrow>
218
+ <h1 style={h1}>Appendix</h1>
219
+ <p style={p}>Definitions, detailed tables and anything a careful reader may want to check.</p>
220
+ </>,
221
+ { header: Header, footer: Footer },
222
+ );
223
+
224
+ export default [Cover, Contents, Body] satisfies DocEntry[];
@@ -0,0 +1,6 @@
1
+ {
2
+ "title": "Report",
3
+ "description": "Cover, contents, executive summary, findings with a data table, recommendations and an appendix.",
4
+ "category": "business",
5
+ "placeholder": "Annual report"
6
+ }
@@ -1,24 +0,0 @@
1
- //#region src/config.d.ts
2
- type OpenDocBuildConfig = {
3
- /** Ship the document browser (`/`) in the static build. Defaults to true. */
4
- showDocBrowser?: boolean;
5
- /** Offer the "Export HTML" button in the static build. Defaults to true. */
6
- allowHtmlExport?: boolean;
7
- };
8
- type OpenDocConfig = {
9
- base?: string;
10
- /**
11
- * Where the viewer's back affordance goes. Unset it points at this app's own
12
- * document browser; set it to escape the app entirely — a viewer mounted
13
- * under a larger site needs to return to that site, not to its own index.
14
- */
15
- home?: string;
16
- docsDir?: string;
17
- themesDir?: string;
18
- assetsDir?: string;
19
- port?: number;
20
- allowedHosts?: string[] | true;
21
- build?: OpenDocBuildConfig;
22
- };
23
- //#endregion
24
- export { OpenDocConfig as n, OpenDocBuildConfig as t };
@@ -1,138 +0,0 @@
1
- import { ComponentType, ReactNode } from "react";
2
- //#region src/app/lib/labels.d.ts
3
- type LabelKind = 'figure' | 'table' | 'footnote';
4
- type LabelEntry = {
5
- /** Author-supplied id for `<Ref to>`, or a generated one. */
6
- id: string;
7
- kind: LabelKind;
8
- /** 1-based, counted per kind across the whole document. */
9
- number: number;
10
- /** Caption text, for a list of figures. */
11
- text: string;
12
- /** 1-based page the item sits on. */
13
- page: number;
14
- };
15
- /**
16
- * The words wrapped around a number. Numbering is structural; what it is
17
- * *called* is a document's own business — `圖 3` and `Figure 3` are the same
18
- * entry. Set it once in `meta.labels`.
19
- */
20
- type LabelVocabulary = {
21
- figure: string;
22
- table: string;
23
- /** Heading above a page's footnotes. Empty string renders no heading. */
24
- footnotes: string;
25
- /** Page suffix for a cross-reference. `{page}` is replaced. */
26
- onPage: string;
27
- };
28
- /** The document's numbered items of one kind, in order. Empty on the first render pass. */
29
- declare function useDocLabels(kind: LabelKind): LabelEntry[];
30
- /** One numbered item by id, once the scan has run. */
31
- declare function useDocLabel(id: string): LabelEntry | null;
32
- //#endregion
33
- //#region src/app/lib/design.d.ts
34
- type DesignPalette = {
35
- bg: string;
36
- text: string;
37
- muted: string;
38
- accent: string;
39
- rule: string;
40
- };
41
- type DesignFonts = {
42
- heading: string;
43
- body: string;
44
- mono: string;
45
- };
46
- type DesignTypeScale = {
47
- title: number;
48
- h1: number;
49
- h2: number;
50
- h3: number;
51
- body: number;
52
- caption: number;
53
- };
54
- type DesignSystem = {
55
- palette: DesignPalette;
56
- fonts: DesignFonts;
57
- typeScale: DesignTypeScale;
58
- /** Page margin in CSS px — the printable text block's inset from the sheet edge. */
59
- margin: number;
60
- /** Body line-height multiplier. Headings tighten this themselves. */
61
- leading: number;
62
- radius: number;
63
- };
64
- declare function designToCssVars(d: DesignSystem): Record<string, string>;
65
- declare function cssVarsToString(vars: Record<string, string>): string;
66
- declare const defaultDesign: DesignSystem;
67
- //#endregion
68
- //#region src/app/lib/sdk.d.ts
69
- /** The only sheets a document may be laid out on. */
70
- declare const PAGE_SIZE_NAMES: readonly ["A4", "B4", "A3"];
71
- type PageSizeName = (typeof PAGE_SIZE_NAMES)[number];
72
- declare const ORIENTATIONS: readonly ["portrait", "landscape"];
73
- type Orientation = (typeof ORIENTATIONS)[number];
74
- /**
75
- * Portrait dimensions in CSS pixels at 96dpi — the unit authors write in —
76
- * paired with the physical millimetres used when printing. Keeping both means a
77
- * page laid out at 794×1123 on screen maps to a real A4 sheet with no rescaling.
78
- */
79
- declare const PAGE_SIZES: Record<PageSizeName, {
80
- width: number;
81
- height: number;
82
- mm: readonly [number, number];
83
- }>;
84
- declare const DEFAULT_PAGE_SIZE: PageSizeName;
85
- declare const DEFAULT_ORIENTATION: Orientation;
86
- declare function isPageSizeName(value: unknown): value is PageSizeName;
87
- declare function isOrientation(value: unknown): value is Orientation;
88
- type PageGeometry = {
89
- width: number;
90
- height: number;
91
- /** Value for the `@page { size: … }` descriptor, orientation included. */
92
- css: string;
93
- };
94
- type DocPage = ComponentType;
95
- /**
96
- * A run of continuous content the framework paginates itself. Build one with
97
- * `flow(...)` and put it in the page array alongside fixed pages.
98
- */
99
- type FlowSection = {
100
- readonly __odFlow: true;
101
- blocks: ReactNode[];
102
- /** Rendered on every page the section expands into, in the top margin band. */
103
- header?: ComponentType;
104
- /** Rendered on every page the section expands into. */
105
- footer?: ComponentType;
106
- /** Page padding override in px; defaults to the design's `margin`. */
107
- padding?: number;
108
- };
109
- /** What a document's default export may contain: fixed pages, flow sections, or both. */
110
- type DocEntry = DocPage | FlowSection;
111
- /**
112
- * Every format `open-doc export` can write. The CLI's `--format`, the MCP
113
- * `export_document` schema and `ops/layout.ts` all read this tuple, so adding a
114
- * format is one edit here and its branch in `exportDocument`.
115
- */
116
- declare const EXPORT_FORMATS: readonly ["pdf", "html", "png", "docx"];
117
- type ExportFormat = (typeof EXPORT_FORMATS)[number];
118
- type DocMeta = {
119
- title?: string;
120
- subtitle?: string;
121
- author?: string;
122
- pageSize?: PageSizeName;
123
- orientation?: Orientation;
124
- /** Id of a theme under `themes/` this document was built from. Adds a back-link. */
125
- theme?: string;
126
- /** ISO 8601 timestamp. Set once at scaffold time; used to sort the doc list. */
127
- createdAt?: string;
128
- /** What numbered items are called — `圖`/`表` instead of `Figure`/`Table`. */
129
- labels?: Partial<LabelVocabulary>;
130
- };
131
- type DocModule = {
132
- default: DocEntry[];
133
- meta?: DocMeta;
134
- design?: DesignSystem;
135
- };
136
- declare function resolvePageGeometry(meta?: DocMeta): PageGeometry;
137
- //#endregion
138
- export { useDocLabels as A, cssVarsToString as C, LabelKind as D, LabelEntry as E, LabelVocabulary as O, DesignTypeScale as S, designToCssVars as T, isPageSizeName as _, DocModule as a, DesignPalette as b, ExportFormat as c, Orientation as d, PAGE_SIZES as f, isOrientation as g, PageSizeName as h, DocMeta as i, useDocLabel as k, FlowSection as l, PageGeometry as m, DEFAULT_PAGE_SIZE as n, DocPage as o, PAGE_SIZE_NAMES as p, DocEntry as r, EXPORT_FORMATS as s, DEFAULT_ORIENTATION as t, ORIENTATIONS as u, resolvePageGeometry as v, defaultDesign as w, DesignSystem as x, DesignFonts as y };