@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,128 @@
1
+ import {
2
+ type DesignSystem,
3
+ type DocEntry,
4
+ type DocMeta,
5
+ type DocPage,
6
+ Field,
7
+ } from '@open-document/core';
8
+ import type { CSSProperties } from 'react';
9
+ import recipients from './data/recipients.csv';
10
+
11
+ // One copy of the document per row. The viewer shows a picker to preview each
12
+ // row; `open-doc export <id> --each` writes one file per row, named by
13
+ // `meta.recordName`.
14
+ export const records = recipients;
15
+
16
+ export const meta: DocMeta = {
17
+ title: 'Certificate of completion',
18
+ orientation: 'landscape',
19
+ createdAt: '2026-01-01T00:00:00.000Z',
20
+ recordName: 'certificate-{name}',
21
+ recordLabel: 'name',
22
+ };
23
+
24
+ export const design: DesignSystem = {
25
+ palette: {
26
+ bg: '#fffdf8',
27
+ text: '#1f1d1a',
28
+ muted: '#7a7369',
29
+ accent: '#a16207',
30
+ rule: '#e8e1d4',
31
+ },
32
+ fonts: {
33
+ heading: 'Georgia, "Times New Roman", serif',
34
+ body: '-apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif',
35
+ mono: 'ui-monospace, "SF Mono", Menlo, monospace',
36
+ },
37
+ typeScale: { title: 46, h1: 30, h2: 18, h3: 14, body: 13, caption: 10 },
38
+ margin: 56,
39
+ leading: 1.5,
40
+ radius: 0,
41
+ };
42
+
43
+ const page: CSSProperties = {
44
+ width: '100%',
45
+ height: '100%',
46
+ boxSizing: 'border-box',
47
+ padding: 'var(--od-margin)',
48
+ position: 'relative',
49
+ };
50
+
51
+ const small: CSSProperties = {
52
+ fontSize: 11,
53
+ letterSpacing: '0.18em',
54
+ textTransform: 'uppercase',
55
+ color: 'var(--od-muted)',
56
+ margin: 0,
57
+ };
58
+
59
+ const Certificate: DocPage = () => (
60
+ <div style={page}>
61
+ <div
62
+ style={{
63
+ height: '100%',
64
+ boxSizing: 'border-box',
65
+ border: '1px solid var(--od-accent)',
66
+ outline: '6px double var(--od-rule)',
67
+ outlineOffset: -14,
68
+ display: 'flex',
69
+ flexDirection: 'column',
70
+ alignItems: 'center',
71
+ justifyContent: 'center',
72
+ textAlign: 'center',
73
+ padding: '0 80px',
74
+ }}
75
+ >
76
+ <p style={small}>Your organisation</p>
77
+ <h1
78
+ style={{
79
+ fontFamily: 'var(--od-font-heading)',
80
+ fontSize: 'var(--od-size-title)',
81
+ fontWeight: 400,
82
+ margin: '22px 0 26px',
83
+ }}
84
+ >
85
+ Certificate of completion
86
+ </h1>
87
+ <p style={{ margin: 0, color: 'var(--od-muted)' }}>This certifies that</p>
88
+ <p
89
+ style={{
90
+ fontFamily: 'var(--od-font-heading)',
91
+ fontSize: 'var(--od-size-h1)',
92
+ margin: '10px 0 14px',
93
+ padding: '0 24px 8px',
94
+ borderBottom: '1px solid var(--od-accent)',
95
+ }}
96
+ >
97
+ <Field name="name" />
98
+ </p>
99
+ <p style={{ margin: 0, maxWidth: 520 }}>
100
+ has completed{' '}
101
+ <strong>
102
+ <Field name="course" />
103
+ </strong>
104
+ , <Field name="hours" /> hours of study.
105
+ </p>
106
+ <div
107
+ style={{
108
+ display: 'flex',
109
+ justifyContent: 'space-between',
110
+ width: '100%',
111
+ maxWidth: 560,
112
+ marginTop: 56,
113
+ fontSize: 11,
114
+ color: 'var(--od-muted)',
115
+ }}
116
+ >
117
+ <span style={{ borderTop: '1px solid var(--od-text)', paddingTop: 6, minWidth: 180 }}>
118
+ <Field name="date" />
119
+ </span>
120
+ <span style={{ borderTop: '1px solid var(--od-text)', paddingTop: 6, minWidth: 180 }}>
121
+ Signature
122
+ </span>
123
+ </div>
124
+ </div>
125
+ </div>
126
+ );
127
+
128
+ export default [Certificate] satisfies DocEntry[];
@@ -0,0 +1,6 @@
1
+ {
2
+ "title": "Certificate",
3
+ "description": "One certificate per row of data/recipients.csv — preview each in the viewer, export them all with --each.",
4
+ "category": "batch",
5
+ "placeholder": "Certificate of completion"
6
+ }
@@ -0,0 +1,106 @@
1
+ import type { DesignSystem, DocEntry, DocMeta, DocPage } from '@open-document/core';
2
+ import type { CSSProperties } from 'react';
3
+
4
+ export const meta: DocMeta = {
5
+ title: 'Letter',
6
+ createdAt: '2026-01-01T00:00:00.000Z',
7
+ };
8
+
9
+ export const design: DesignSystem = {
10
+ palette: {
11
+ bg: '#ffffff',
12
+ text: '#1a1a1a',
13
+ muted: '#6b6b6b',
14
+ accent: '#9a3412',
15
+ rule: '#e6e2dd',
16
+ },
17
+ fonts: {
18
+ heading: 'Georgia, "Times New Roman", serif',
19
+ body: 'Georgia, "Times New Roman", serif',
20
+ mono: 'ui-monospace, "SF Mono", Menlo, monospace',
21
+ },
22
+ typeScale: { title: 22, h1: 18, h2: 14, h3: 12.5, body: 12.5, caption: 9.5 },
23
+ margin: 80,
24
+ leading: 1.6,
25
+ radius: 0,
26
+ };
27
+
28
+ const page: CSSProperties = {
29
+ width: '100%',
30
+ height: '100%',
31
+ boxSizing: 'border-box',
32
+ padding: 'var(--od-margin)',
33
+ position: 'relative',
34
+ display: 'flex',
35
+ flexDirection: 'column',
36
+ fontFamily: 'var(--od-font-body)',
37
+ };
38
+ const p: CSSProperties = { margin: '0 0 12px' };
39
+ const small: CSSProperties = { fontSize: 11, color: 'var(--od-muted)', lineHeight: 1.5 };
40
+
41
+ const Letter: DocPage = () => (
42
+ <div style={page}>
43
+ <header
44
+ style={{
45
+ display: 'flex',
46
+ justifyContent: 'space-between',
47
+ alignItems: 'flex-end',
48
+ paddingBottom: 14,
49
+ borderBottom: '2px solid var(--od-accent)',
50
+ marginBottom: 36,
51
+ }}
52
+ >
53
+ <div style={{ fontFamily: 'var(--od-font-heading)', fontSize: 'var(--od-size-title)' }}>
54
+ Your company
55
+ </div>
56
+ <div style={{ ...small, textAlign: 'right' }}>
57
+ 123 Example Street, City 10001
58
+ <br />
59
+ hello@example.com · +1 555 0100
60
+ </div>
61
+ </header>
62
+
63
+ <address style={{ ...p, fontStyle: 'normal', marginBottom: 24 }}>
64
+ Recipient name
65
+ <br />
66
+ Title, Organisation
67
+ <br />
68
+ 456 Another Road
69
+ <br />
70
+ City 20002
71
+ </address>
72
+
73
+ <p style={{ ...p, marginBottom: 24 }}>12 January 2026</p>
74
+
75
+ <p style={{ ...p, fontWeight: 700 }}>Subject: what this letter is about</p>
76
+
77
+ <p style={p}>Dear Recipient name,</p>
78
+ <p style={p}>
79
+ Open with the reason you are writing, in one sentence the reader cannot misread.
80
+ </p>
81
+ <p style={p}>
82
+ Give the detail they need to act: the facts, what you are asking for, and by when. Keep each
83
+ paragraph to one idea.
84
+ </p>
85
+ <p style={p}>Close by saying what happens next, and how to reach you.</p>
86
+
87
+ <p style={{ ...p, marginTop: 12 }}>Yours sincerely,</p>
88
+ <div style={{ height: 52 }} />
89
+ <p style={{ ...p, margin: 0 }}>Your name</p>
90
+ <p style={{ ...small, margin: 0 }}>Your title, Your company</p>
91
+
92
+ <footer
93
+ style={{
94
+ ...small,
95
+ marginTop: 'auto',
96
+ paddingTop: 10,
97
+ borderTop: '1px solid var(--od-rule)',
98
+ fontSize: 'var(--od-size-caption)',
99
+ }}
100
+ >
101
+ Your company Ltd · Registered in Country, No. 0000000
102
+ </footer>
103
+ </div>
104
+ );
105
+
106
+ export default [Letter] satisfies DocEntry[];
@@ -0,0 +1,5 @@
1
+ {
2
+ "title": "Letter",
3
+ "description": "A one-page formal letter: letterhead, recipient, date, subject, body and signature.",
4
+ "category": "correspondence"
5
+ }
@@ -0,0 +1,194 @@
1
+ import {
2
+ type DesignSystem,
3
+ type DocEntry,
4
+ type DocMeta,
5
+ flow,
6
+ useDocPageCount,
7
+ useDocPageNumber,
8
+ } from '@open-document/core';
9
+ import type { CSSProperties, ReactNode } from 'react';
10
+
11
+ export const meta: DocMeta = {
12
+ title: 'Weekly sync',
13
+ subtitle: 'Meeting notes',
14
+ createdAt: '2026-01-01T00:00:00.000Z',
15
+ };
16
+
17
+ export const design: DesignSystem = {
18
+ palette: {
19
+ bg: '#ffffff',
20
+ text: '#15181b',
21
+ muted: '#65707b',
22
+ accent: '#0f766e',
23
+ rule: '#e2e8ec',
24
+ },
25
+ fonts: {
26
+ heading: '-apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif',
27
+ body: '-apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif',
28
+ mono: 'ui-monospace, "SF Mono", Menlo, monospace',
29
+ },
30
+ typeScale: { title: 30, h1: 18, h2: 14, h3: 12.5, body: 12, caption: 9.5 },
31
+ margin: 64,
32
+ leading: 1.55,
33
+ radius: 4,
34
+ };
35
+
36
+ const h1: CSSProperties = {
37
+ fontSize: 'var(--od-size-h1)',
38
+ fontWeight: 650,
39
+ margin: '20px 0 8px',
40
+ paddingBottom: 4,
41
+ borderBottom: '1px solid var(--od-rule)',
42
+ };
43
+ const h2: CSSProperties = { fontSize: 'var(--od-size-h2)', fontWeight: 600, margin: '12px 0 6px' };
44
+ const p: CSSProperties = { margin: '0 0 8px' };
45
+ const list: CSSProperties = { margin: '0 0 8px', paddingLeft: 18 };
46
+ const cell: CSSProperties = {
47
+ borderBottom: '1px solid var(--od-rule)',
48
+ padding: '6px 8px',
49
+ textAlign: 'left',
50
+ verticalAlign: 'top',
51
+ fontSize: 11.5,
52
+ };
53
+ const head: CSSProperties = { ...cell, fontWeight: 600, color: 'var(--od-muted)', fontSize: 10.5 };
54
+
55
+ const Fact = ({ label, children }: { label: string; children: ReactNode }) => (
56
+ <>
57
+ <dt style={{ color: 'var(--od-muted)' }}>{label}</dt>
58
+ <dd style={{ margin: 0 }}>{children}</dd>
59
+ </>
60
+ );
61
+
62
+ const Status = ({ children }: { children: string }) => (
63
+ <span
64
+ style={{
65
+ fontSize: 10,
66
+ padding: '1px 6px',
67
+ borderRadius: 'var(--od-radius)',
68
+ border: '1px solid var(--od-rule)',
69
+ color: 'var(--od-muted)',
70
+ whiteSpace: 'nowrap',
71
+ }}
72
+ >
73
+ {children}
74
+ </span>
75
+ );
76
+
77
+ const Footer = () => (
78
+ <div
79
+ style={{
80
+ position: 'absolute',
81
+ left: 'var(--od-margin)',
82
+ right: 'var(--od-margin)',
83
+ bottom: 32,
84
+ display: 'flex',
85
+ justifyContent: 'space-between',
86
+ fontSize: 'var(--od-size-caption)',
87
+ color: 'var(--od-muted)',
88
+ }}
89
+ >
90
+ <span>Weekly sync · 12 January 2026</span>
91
+ <span style={{ fontVariantNumeric: 'tabular-nums' }}>
92
+ {useDocPageNumber()} / {useDocPageCount()}
93
+ </span>
94
+ </div>
95
+ );
96
+
97
+ const Body = flow(
98
+ <>
99
+ <p
100
+ style={{
101
+ ...p,
102
+ fontSize: 10.5,
103
+ fontWeight: 600,
104
+ letterSpacing: '0.14em',
105
+ textTransform: 'uppercase',
106
+ color: 'var(--od-accent)',
107
+ }}
108
+ >
109
+ Meeting notes
110
+ </p>
111
+ <h1
112
+ data-od-outline="skip"
113
+ style={{
114
+ fontSize: 'var(--od-size-title)',
115
+ fontWeight: 650,
116
+ letterSpacing: '-0.01em',
117
+ margin: '0 0 14px',
118
+ }}
119
+ >
120
+ Weekly sync
121
+ </h1>
122
+ <dl
123
+ style={{
124
+ display: 'grid',
125
+ gridTemplateColumns: '90px 1fr',
126
+ gap: '4px 12px',
127
+ margin: '0 0 6px',
128
+ fontSize: 11.5,
129
+ }}
130
+ >
131
+ <Fact label="Date">Monday 12 January 2026, 10:00–10:45</Fact>
132
+ <Fact label="Attendees">Alex Chen, Sam Lee, Jordan Wu</Fact>
133
+ <Fact label="Absent">Taylor Lin</Fact>
134
+ <Fact label="Notes by">Sam Lee</Fact>
135
+ </dl>
136
+
137
+ <h1 style={h1}>Agenda</h1>
138
+ <ol style={list}>
139
+ <li>Last week's actions</li>
140
+ <li>Launch readiness</li>
141
+ <li>Anything else</li>
142
+ </ol>
143
+
144
+ <h1 style={h1}>Discussion</h1>
145
+ <h2 style={h2}>1. Last week's actions</h2>
146
+ <p style={p}>What was done, and what slipped and why.</p>
147
+ <h2 style={h2}>2. Launch readiness</h2>
148
+ <p style={p}>The points raised, who raised them, and where the group landed.</p>
149
+
150
+ <h1 style={h1}>Decisions</h1>
151
+ <ul style={list}>
152
+ <li>
153
+ <strong>Launch stays on 2 February.</strong> The remaining risk is covered by the rollback
154
+ plan.
155
+ </li>
156
+ </ul>
157
+
158
+ <h1 style={h1}>Action items</h1>
159
+ <table style={{ width: '100%', borderCollapse: 'collapse', margin: '4px 0 10px' }}>
160
+ <thead>
161
+ <tr>
162
+ <th style={head}>Action</th>
163
+ <th style={head}>Owner</th>
164
+ <th style={head}>Due</th>
165
+ <th style={head}>Status</th>
166
+ </tr>
167
+ </thead>
168
+ <tbody>
169
+ <tr>
170
+ <td style={cell}>Write the rollback plan</td>
171
+ <td style={cell}>Alex</td>
172
+ <td style={cell}>16 Jan</td>
173
+ <td style={cell}>
174
+ <Status>Open</Status>
175
+ </td>
176
+ </tr>
177
+ <tr>
178
+ <td style={cell}>Confirm the launch email copy</td>
179
+ <td style={cell}>Jordan</td>
180
+ <td style={cell}>19 Jan</td>
181
+ <td style={cell}>
182
+ <Status>Open</Status>
183
+ </td>
184
+ </tr>
185
+ </tbody>
186
+ </table>
187
+ <p style={{ ...p, fontSize: 'var(--od-size-caption)', color: 'var(--od-muted)' }}>
188
+ Next meeting: Monday 19 January 2026, 10:00.
189
+ </p>
190
+ </>,
191
+ { footer: Footer },
192
+ );
193
+
194
+ export default [Body] satisfies DocEntry[];
@@ -0,0 +1,6 @@
1
+ {
2
+ "title": "Meeting notes",
3
+ "description": "Date and attendees, agenda, discussion, decisions and an action-item table.",
4
+ "category": "team",
5
+ "placeholder": "Weekly sync"
6
+ }