konpeki 0.3.1 → 0.4.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 (167) hide show
  1. package/AGENTS.md +21 -28
  2. package/AUTHORING.md +68 -229
  3. package/CONTRIBUTING.md +10 -23
  4. package/README.md +98 -106
  5. package/SETUP.md +49 -129
  6. package/docs/development.md +43 -256
  7. package/docs/workflow.md +6 -108
  8. package/html/README.md +140 -0
  9. package/html/browser.ts +103 -0
  10. package/html/document.ts +38 -0
  11. package/html/floor.ts +34 -0
  12. package/html/index.html +5 -0
  13. package/html/inspect.ts +313 -0
  14. package/html/preview.css +62 -0
  15. package/html/preview.tsx +463 -0
  16. package/html/review-hints.ts +63 -0
  17. package/html/server.ts +99 -0
  18. package/html/source.ts +104 -0
  19. package/html/starter.ts +6 -0
  20. package/html/theme-authoring.md +176 -0
  21. package/html/theme.md +61 -0
  22. package/index.html +9 -9
  23. package/package.json +21 -37
  24. package/plugin.json +1 -1
  25. package/public/og.png +0 -0
  26. package/runtime/browser-B-29TH1a.mjs +595 -0
  27. package/runtime/floor-Cmk7G3pU.mjs +41 -0
  28. package/runtime/konpeki.mjs +90 -1410
  29. package/runtime/server-BAqC_5WD.mjs +2 -0
  30. package/runtime/server-DfRpfcY9.mjs +205 -0
  31. package/runtime/source-B_Ui9tMp.mjs +141 -0
  32. package/runtime/source-CZQq9GUO.mjs +2 -0
  33. package/skills/konpeki/SKILL.md +88 -172
  34. package/skills/konpeki/assets/blank.html +17 -0
  35. package/skills/konpeki/floor.md +76 -0
  36. package/skills/konpeki/references/cover.md +27 -0
  37. package/skills/konpeki/references/long-document.md +40 -0
  38. package/skills/konpeki/references/one-pager.md +27 -0
  39. package/skills/konpeki/references/patterns.md +118 -0
  40. package/skills/konpeki/references/resume.md +28 -0
  41. package/skills/konpeki/references/slides.md +28 -0
  42. package/skills/konpeki/scripts/ensure-runtime.mjs +10 -31
  43. package/skills/konpeki/scripts/prepare-document.mjs +25 -14
  44. package/src/components/PageBoard.tsx +156 -0
  45. package/src/lib/alignment.ts +21 -0
  46. package/src/lib/page-board.ts +25 -0
  47. package/src/lib/review-position.ts +19 -0
  48. package/src/styles/base.css +1 -10
  49. package/src/styles/feedback.css +2 -1
  50. package/src/styles/shell.css +94 -354
  51. package/theme-base.css +90 -0
  52. package/theme.css +56 -0
  53. package/vite.config.ts +2 -5
  54. package/composition/README.md +0 -156
  55. package/composition/compile.ts +0 -227
  56. package/composition/document.ts +0 -600
  57. package/composition/schema.json +0 -3001
  58. package/composition/schema.ts +0 -437
  59. package/composition/theme-tokens.ts +0 -16
  60. package/composition/types.ts +0 -269
  61. package/composition/validate.ts +0 -226
  62. package/composition/vector.ts +0 -143
  63. package/composition/visualizations.ts +0 -319
  64. package/design/README.md +0 -17
  65. package/design/palettes/README.md +0 -14
  66. package/design/palettes/base.ts +0 -14
  67. package/design/palettes/candidates.ts +0 -19
  68. package/design/palettes/index.ts +0 -78
  69. package/design/review/color-theme.md +0 -44
  70. package/design/review/layout.md +0 -16
  71. package/design/review/text.md +0 -18
  72. package/design/review/typography.md +0 -15
  73. package/design/review/visuals.md +0 -31
  74. package/design/semantic-patterns.md +0 -43
  75. package/design/themes/README.md +0 -40
  76. package/design/themes/index.ts +0 -24
  77. package/design/visual-languages/technical-product.md +0 -17
  78. package/design/visual-review.md +0 -88
  79. package/lib/assets.d.ts +0 -8
  80. package/lib/charts.ts +0 -18
  81. package/lib/contrast.ts +0 -16
  82. package/lib/layouts.ts +0 -50
  83. package/lib/slide.tsx +0 -42
  84. package/lib/taste.ts +0 -17
  85. package/lib/text.tsx +0 -89
  86. package/lib/typeface.ts +0 -44
  87. package/scripts/migrate-react-page.ts +0 -120
  88. package/skills/konpeki/assets/blank.json +0 -23
  89. package/slides/README.md +0 -56
  90. package/slides/architecture/PROMPT.md +0 -31
  91. package/slides/architecture/index.tsx +0 -102
  92. package/slides/article-brief/PROMPT.md +0 -35
  93. package/slides/article-brief/index.tsx +0 -71
  94. package/slides/bar-chart/PROMPT.md +0 -39
  95. package/slides/bar-chart/index.tsx +0 -97
  96. package/slides/comparison/PROMPT.md +0 -29
  97. package/slides/comparison/index.tsx +0 -95
  98. package/slides/decision-memo/PROMPT.md +0 -34
  99. package/slides/decision-memo/index.tsx +0 -85
  100. package/slides/delivery-plan/PROMPT.md +0 -45
  101. package/slides/delivery-plan/index.tsx +0 -105
  102. package/slides/drawing-references.md +0 -32
  103. package/slides/experiment/PROMPT.md +0 -44
  104. package/slides/experiment/index.tsx +0 -127
  105. package/slides/github-cover/PROMPT.md +0 -21
  106. package/slides/github-cover/README.md +0 -21
  107. package/slides/github-cover/author.ts +0 -67
  108. package/slides/github-cover/composition.json +0 -595
  109. package/slides/incident-workflow/PROMPT.md +0 -57
  110. package/slides/incident-workflow/index.tsx +0 -78
  111. package/slides/introducing-konpeki/PROMPT.md +0 -30
  112. package/slides/introducing-konpeki/README.md +0 -44
  113. package/slides/introducing-konpeki/SOURCE.md +0 -19
  114. package/slides/introducing-konpeki/author.ts +0 -165
  115. package/slides/introducing-konpeki/composition.json +0 -3270
  116. package/slides/line-chart/PROMPT.md +0 -40
  117. package/slides/line-chart/index.tsx +0 -72
  118. package/slides/migration/PROMPT.md +0 -38
  119. package/slides/migration/index.tsx +0 -89
  120. package/slides/og-images/PROMPT.md +0 -21
  121. package/slides/og-images/index.tsx +0 -76
  122. package/slides/product-introduction/PROMPT.md +0 -24
  123. package/slides/product-introduction/index.tsx +0 -105
  124. package/slides/research-brief/PROMPT.md +0 -40
  125. package/slides/research-brief/index.tsx +0 -104
  126. package/slides/results-explanation/PROMPT.md +0 -32
  127. package/slides/results-explanation/index.tsx +0 -96
  128. package/slides/retrospective/PROMPT.md +0 -43
  129. package/slides/retrospective/index.tsx +0 -105
  130. package/slides/sankey/PROMPT.md +0 -11
  131. package/slides/sankey/index.tsx +0 -93
  132. package/slides/teaching/PROMPT.md +0 -45
  133. package/slides/teaching/index.tsx +0 -124
  134. package/slides/vertical-bar-charts/PROMPT.md +0 -13
  135. package/slides/vertical-bar-charts/index.tsx +0 -97
  136. package/src/app/App.tsx +0 -845
  137. package/src/components/BuildOrb.tsx +0 -40
  138. package/src/components/Canvas.tsx +0 -1191
  139. package/src/components/DiagramTypeIcon.tsx +0 -78
  140. package/src/components/InspectorPanel.tsx +0 -757
  141. package/src/components/LeftPanel.tsx +0 -120
  142. package/src/components/PageSizePicker.tsx +0 -30
  143. package/src/components/Presentation.tsx +0 -105
  144. package/src/components/RevisionNotes.tsx +0 -55
  145. package/src/components/RightPanel.tsx +0 -233
  146. package/src/components/VectorOverflowWarning.tsx +0 -73
  147. package/src/components/WorkspaceChrome.tsx +0 -316
  148. package/src/components/ui.tsx +0 -147
  149. package/src/lib/examples/react-page-migration.json +0 -1295
  150. package/src/lib/examples.ts +0 -42
  151. package/src/lib/export-png.ts +0 -104
  152. package/src/lib/file-session.ts +0 -87
  153. package/src/lib/history.ts +0 -53
  154. package/src/lib/model.ts +0 -188
  155. package/src/lib/page-size.ts +0 -24
  156. package/src/lib/presentation.ts +0 -17
  157. package/src/lib/review.ts +0 -26
  158. package/src/lib/storage.ts +0 -71
  159. package/src/lib/theme.ts +0 -25
  160. package/src/lib/use-file-session.ts +0 -249
  161. package/src/main.tsx +0 -29
  162. package/src/styles/canvas.css +0 -299
  163. package/src/styles/chrome.css +0 -475
  164. package/src/styles/component-previews.css +0 -386
  165. package/src/styles/left-panel.css +0 -187
  166. package/src/styles/presentation.css +0 -72
  167. package/src/styles/right-panel.css +0 -1298
@@ -0,0 +1,21 @@
1
+ export type Guide = { axis: "x" | "y"; value: number };
2
+
3
+ export function closest(points: number[], targets: number[], threshold: number) {
4
+ let match: { delta: number; target: number } | undefined;
5
+ for (const point of points)
6
+ for (const target of targets) {
7
+ const delta = target - point;
8
+ if (Math.abs(delta) <= threshold && (!match || Math.abs(delta) < Math.abs(match.delta)))
9
+ match = { delta, target };
10
+ }
11
+ return match;
12
+ }
13
+
14
+ /** Visual references only. Never change the dragged coordinates. */
15
+ export function referenceGuides(rect: { x: number; y: number; width: number; height: number }, targets: { x: number[]; y: number[] }, threshold = 2): Guide[] {
16
+ return (["x", "y"] as const).flatMap(axis => {
17
+ const size = axis === "x" ? rect.width : rect.height;
18
+ const match = closest([rect[axis], rect[axis] + size / 2, rect[axis] + size], targets[axis], threshold);
19
+ return match ? [{ axis, value: match.target }] : [];
20
+ });
21
+ }
@@ -0,0 +1,25 @@
1
+ /** Presentation geometry only; never stored in the authored document. */
2
+ export function layoutPages(sizes: readonly { width: number; height: number }[], availableWidth: number, availableHeight: number) {
3
+ const gap = 80, heading = 32;
4
+ let nextX = 0;
5
+ const pages = sizes.map(size => {
6
+ const scale = Math.min(availableWidth / size.width, Math.max(0, availableHeight - heading) / size.height);
7
+ const width = size.width * scale, height = size.height * scale;
8
+ const x = nextX;
9
+ nextX += width + gap;
10
+ return { x, y: heading, width, height };
11
+ });
12
+ const arrows = pages.slice(1).map((next, index) => {
13
+ const previous = pages[index];
14
+ const start = previous.x + previous.width + 16;
15
+ const end = next.x - 16;
16
+ const middle = (start + end) / 2;
17
+ return `M ${start} ${previous.y + previous.height / 2} H ${middle} V ${next.y + next.height / 2} H ${end}`;
18
+ });
19
+ return {
20
+ // The board centers this tightly bounded row when it fits the viewport.
21
+ width: pages.length ? nextX - gap : availableWidth,
22
+ height: pages.length ? heading + Math.max(...pages.map(page => page.height)) : 0,
23
+ pages, arrows,
24
+ };
25
+ }
@@ -0,0 +1,19 @@
1
+ type Rect = { x: number; y: number; width: number; height: number };
2
+
3
+ /** Fixed viewport coordinates; the caller measures the already-zoomed target. */
4
+ export function reviewPosition(anchor: Rect, panel: Pick<Rect, "width" | "height">, viewport: Rect) {
5
+ const margin = 16, gap = 12;
6
+ const minX = viewport.x + margin, minY = viewport.y + margin;
7
+ const maxX = Math.max(minX, viewport.x + viewport.width - margin - panel.width);
8
+ const maxY = Math.max(minY, viewport.y + viewport.height - margin - panel.height);
9
+ const left = Math.max(minX, Math.min(anchor.x, maxX));
10
+ const top = Math.max(minY, Math.min(anchor.y, maxY));
11
+ const candidates = [
12
+ { left, top: anchor.y + anchor.height + gap },
13
+ { left, top: anchor.y - gap - panel.height },
14
+ { left: anchor.x + anchor.width + gap, top },
15
+ { left: anchor.x - gap - panel.width, top },
16
+ ];
17
+ return candidates.find(p => p.left >= minX && p.left <= maxX && p.top >= minY && p.top <= maxY)
18
+ ?? { left, top: Math.max(minY, Math.min(candidates[0].top, maxY)) };
19
+ }
@@ -53,10 +53,7 @@ button:disabled {
53
53
  cursor: default;
54
54
  color: #767676;
55
55
  }
56
- .right-panel input[type="number"],
57
- .revision-note-count,
58
- .overflow-trigger,
59
- .thumbnail-page-number {
56
+ .revision-note-count {
60
57
  font-variant-numeric: tabular-nums;
61
58
  }
62
59
  :focus-visible {
@@ -105,12 +102,6 @@ h2 {
105
102
  background: #383838;
106
103
  border-color: #383838;
107
104
  }
108
- .panel-toggle:active:not(:disabled),
109
- .action-island button:active:not(:disabled),
110
- .component-dock button:active:not(:disabled),
111
- .segmented-options button:active:not(:disabled),
112
- .theme-options button:active:not(:disabled),
113
- .appearance-options button:active:not(:disabled),
114
105
  .revision-note-submit button:active:not(:disabled),
115
106
  .revision-note-remove:active:not(:disabled) {
116
107
  transform: scale(0.96);
@@ -69,6 +69,7 @@
69
69
  font-size: 20px !important;
70
70
  color: inherit;
71
71
  }
72
+ .toast-undo { margin-left: 12px; padding: 4px 8px; border: 0; background: transparent; color: var(--accent); font-weight: 500; }
72
73
  .toast.error {
73
74
  background: #fff7f7;
74
75
  color: #8d1717;
@@ -130,7 +131,7 @@ input[aria-invalid="true"]:focus-visible {
130
131
  line-height: 1.5;
131
132
  }
132
133
  @media (max-width: 900px) {
133
- .toast { top: calc(var(--panel-top) + 68px); }
134
+ .toast { top: 16px; }
134
135
  }
135
136
  @media (prefers-reduced-motion: reduce) {
136
137
  *,
@@ -1,364 +1,104 @@
1
- :root {
2
- --panel-top: 20px;
3
- }
4
- .skip-link {
5
- position: fixed;
6
- top: -60px;
7
- left: 12px;
8
- background: white;
9
- padding: 10px;
10
- z-index: 100;
11
- color: var(--accent);
12
- }
13
- .skip-link:focus {
14
- top: 8px;
15
- }
16
1
  .workspace {
17
- --panel-duration: 200ms;
18
- --panel-easing: cubic-bezier(0.2, 0, 0, 1);
19
- --panel-header-height: 58px;
20
- position: relative;
21
2
  height: 100dvh;
22
- min-height: 100dvh;
23
- overflow: hidden;
3
+ overflow: auto;
4
+ padding: 32px 48px;
24
5
  background: var(--ui-bg);
25
- }
26
- .left-sidebar,
27
- .right-panel {
6
+ scrollbar-gutter: stable;
7
+ overflow-anchor: none;
8
+ overscroll-behavior: contain;
9
+ }
10
+ .board-heading { margin: 0 0 24px; }
11
+ .board-heading h1 { font-size: 17px; font-weight: 500; }
12
+ .board-help { margin: 24px auto 0; text-align: center; font-size: 12px; color: var(--ui-muted); }
13
+ .page-board { display: flex; align-items: center; justify-content: center; width: max-content; min-width: 100%; }
14
+ .page-board-content { position: relative; flex: none; }
15
+ .board-page { position: absolute; }
16
+ .stage-meta { display: flex; align-items: baseline; gap: 12px; height: 32px; padding-top: 2px; color: var(--ui-muted); font-size: 12px; line-height: 18px; }
17
+ .page-index { flex: none; font-variant-numeric: tabular-nums; }
18
+ .stage-meta h2 { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: inherit; }
19
+ .stage-meta input { width: min(300px, 100%); height: 26px; margin-top: -3px; padding: 2px 6px; font: inherit; }
20
+ .page-order { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
21
+ .page-order path { fill: none; stroke: #8b969c; stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }
22
+ .review-launcher {
28
23
  position: fixed;
29
- top: var(--panel-top);
30
- height: calc(100dvh - 92px - var(--panel-top));
31
- width: var(--panel-width);
32
- z-index: 30;
33
- display: flex;
34
- flex-direction: column;
35
- overflow: hidden;
36
- background: var(--ui-surface);
37
- min-height: 0;
38
- border: 1px solid transparent;
39
- border-radius: 12px;
40
- box-shadow: var(--ui-floating-shadow);
41
- transition: width var(--panel-duration) var(--panel-easing),
42
- height var(--panel-duration) var(--panel-easing),
43
- top var(--panel-duration) var(--panel-easing);
44
- }
45
- .left-sidebar {
46
- --panel-width: 252px;
47
- left: 20px;
24
+ right: 24px;
25
+ bottom: 24px;
48
26
  z-index: 40;
49
- }
50
- .left-sidebar.collapsed {
51
- top: 20px;
52
- width: 107px;
53
- height: calc(var(--panel-header-height) + 2px);
54
- }
55
- .left-sidebar:not(.collapsed):has(.browser-menu[open]) {
56
- overflow: visible;
57
- }
58
- .right-panel {
59
- --panel-width: min(328px, calc(100vw - 40px));
60
- right: 20px;
61
- }
62
- .right-panel.collapsed {
63
- top: 20px;
64
- width: 50px;
65
- height: calc(var(--panel-header-height) + 2px);
66
- }
67
- .right-panel.collapsed > .panel-toolbar {
68
- gap: 0;
69
- grid-template-columns: minmax(0, 1fr) 0 40px;
70
- padding: 0 4px;
71
- border-bottom-color: transparent;
72
- }
73
- .left-panel,
74
- .right-panel-body {
75
- width: calc(var(--panel-width) - 2px);
76
- display: flex;
77
- flex-direction: column;
78
- flex: 1;
79
- min-height: 0;
80
- overflow: hidden;
81
- }
82
- .right-panel-body {
83
- align-self: flex-end;
84
- }
85
- .right-panel > .panel-toolbar > .panel-tabs {
86
- clip-path: inset(-4px 0);
87
- }
88
- .right-panel .panel-tabs button:focus-visible {
89
- outline-offset: -3px;
90
- }
91
- .document-title,
92
- .document-title-error,
93
- .file-status,
94
- .right-panel > .panel-toolbar > .panel-tabs,
95
- .right-panel > .panel-toolbar > .overflow-control,
96
- .left-panel,
97
- .action-island,
98
- .right-panel-body {
99
- transition: opacity var(--panel-duration) var(--panel-easing),
100
- visibility 0s;
101
- }
102
- .left-collapsed .document-title,
103
- .left-collapsed .document-title-error,
104
- .left-collapsed .file-status,
105
- .right-panel.collapsed .panel-tabs,
106
- .right-panel.collapsed .overflow-control,
107
- .left-panel.collapsed,
108
- .left-collapsed .action-island,
109
- .right-panel.collapsed .right-panel-body {
110
- opacity: 0;
111
- visibility: hidden;
112
- transition-delay: 0s, var(--panel-duration);
113
- }
114
- .panel-toolbar {
115
- position: sticky;
116
- top: 0;
117
- z-index: 2;
118
- display: flex;
119
- align-items: center;
120
- gap: 8px;
121
- height: 48px;
122
- background: var(--ui-surface);
123
- border-bottom: 1px solid var(--ui-border);
124
- }
125
- .left-panel > .panel-toolbar {
126
- flex: none;
127
- padding: 0 8px 0 16px;
128
- border-bottom: 0;
129
- }
130
- .right-panel > .panel-toolbar {
131
- flex: none;
132
27
  display: grid;
133
- grid-template-columns: minmax(0, 1fr) 48px 40px;
134
- height: var(--panel-header-height);
135
- padding: 0 8px 0 12px;
136
- overflow: hidden;
137
- transition: padding var(--panel-duration) var(--panel-easing),
138
- gap var(--panel-duration) var(--panel-easing),
139
- grid-template-columns var(--panel-duration) var(--panel-easing),
140
- border-bottom-color var(--panel-duration) var(--panel-easing);
141
- }
142
- .panel-heading {
143
- flex: 1;
144
- color: var(--ui-text);
145
- font-size: 13px;
146
- font-weight: 500;
147
- }
148
- .panel-toggle {
149
- flex: none;
150
- width: 40px;
151
- height: 40px;
152
- padding: 0;
153
- border: 0;
154
- border-radius: 6px;
155
- border-color: transparent;
156
- box-shadow: none;
157
- }
158
- .panel-toggle:hover:not(:disabled) {
159
- border-color: transparent;
160
- background: var(--ui-hover);
161
- }
162
- .panel-close-icon,
163
- .panel-collapse-icon {
164
- position: relative;
165
- display: block;
166
- width: 14px;
167
- height: 14px;
168
- margin: auto;
169
- }
170
- .panel-collapse-icon {
171
- width: 18px;
172
- height: 18px;
173
- fill: none;
174
- stroke: currentColor;
175
- stroke-linecap: round;
176
- stroke-linejoin: round;
177
- stroke-width: 1.7;
178
- }
179
- .panel-close-icon::before,
180
- .panel-close-icon::after {
181
- position: absolute;
182
- top: 6px;
183
- left: 1px;
184
- width: 12px;
185
- height: 1.5px;
186
- border-radius: 1px;
187
- background: currentColor;
188
- content: "";
189
- }
190
- .panel-close-icon::before {
191
- transform: rotate(45deg);
192
- }
193
- .panel-close-icon::after {
194
- transform: rotate(-45deg);
195
- }
196
- .panel-tabs {
197
- flex: 1;
198
- display: flex;
199
- align-self: stretch;
200
- min-width: 0;
201
- justify-content: flex-start;
202
- gap: 20px;
203
- }
204
- .left-panel .panel-tabs button {
205
- padding-inline: 1px;
206
- font-size: 12px;
207
- }
208
- .panel-tabs button {
209
- position: relative;
210
- border: 0;
211
- border-radius: 0;
212
- padding: 0 2px;
213
- background: transparent;
214
- color: var(--ui-muted);
215
- font-size: 13px;
216
- font-weight: 500;
217
- }
218
- .panel-tabs button:hover:not(:disabled) {
219
- border-color: transparent;
220
- background: transparent;
221
- color: var(--ui-text);
222
- }
223
- .panel-tabs button.active {
224
- background: transparent;
225
- color: #006aa1;
226
- box-shadow: none;
227
- }
228
- .panel-tabs button.active::after {
229
- position: absolute;
230
- right: 0;
231
- bottom: -1px;
232
- left: 0;
233
- height: 2px;
234
- background: var(--accent);
235
- content: "";
236
- }
237
- .stage {
238
- position: absolute;
239
- inset: 0;
240
- padding: 112px 376px 110px 292px;
241
- display: flex;
242
- align-items: center;
243
- justify-content: center;
244
- min-width: 0;
245
- transition: padding-left var(--panel-duration) var(--panel-easing),
246
- padding-right var(--panel-duration) var(--panel-easing);
247
- }
248
- .workspace.left-collapsed .stage {
249
- padding-left: 96px;
250
- }
251
- .workspace.right-collapsed .stage {
252
- padding-right: 96px;
253
- }
254
- .editor-content {
255
- display: contents;
256
- }
257
- .is-building .canvas {
258
- opacity: 0.18;
259
- filter: none;
260
- }
261
- .build-loading {
262
- z-index: 45;
263
- pointer-events: none;
264
- }
265
- .build-loading-card {
266
- pointer-events: auto;
267
- display: grid;
268
- gap: 10px;
269
- width: min(320px, 100%);
270
- padding: 24px;
271
- border: 1px solid var(--ui-border);
272
- border-radius: 16px;
273
- background: var(--ui-surface);
274
- box-shadow: var(--ui-shadow);
275
- text-align: center;
276
- }
277
- .build-loading-card button {
278
- min-height: 40px;
279
- border-radius: 8px;
280
- }
281
- .build-loading-card strong {
282
- font-size: 14px;
283
- font-weight: 500;
284
- }
285
- .build-loading-card span {
286
- font-size: 12px;
287
- line-height: 1.5;
288
- color: var(--ui-muted);
289
- }
290
- .build-nebula {
291
- position: relative;
292
- width: 88px;
293
- height: 88px;
294
- margin: -4px auto 4px;
295
- }
296
- .build-nebula::before {
297
- content: "";
298
- position: absolute;
299
- inset: 14px;
28
+ place-items: center;
29
+ width: 52px;
30
+ height: 52px;
31
+ padding: 14px;
32
+ border: 1px solid #00000014;
300
33
  border-radius: 50%;
301
- background: conic-gradient(from 45deg, #77d3ed70, #b994dc60, #729fec50, #77d3ed70);
302
- filter: blur(10px);
303
- animation: orb-turn 12s linear infinite reverse;
304
- }
305
- .slide-wrap {
306
- width: 100%;
307
- max-width: min(1200px, calc((100vh - 270px) * var(--page-ratio)));
308
- }
309
- .stage-meta {
310
- display: flex;
311
- align-items: center;
312
- justify-content: space-between;
313
- gap: 16px;
314
- height: 40px;
315
- margin: 0 0 12px;
316
- }
317
- .edit-elements-action {
318
- flex-shrink: 0;
319
- min-height: 40px;
320
- padding: 7px 10px;
321
- font-size: 12px;
322
- }
323
- .stage-meta h2 {
324
- min-width: 0;
325
- overflow: hidden;
326
- font-size: 12px;
327
- font-weight: 500;
328
- color: var(--ui-muted);
329
- margin: 0;
330
- text-overflow: ellipsis;
331
- white-space: nowrap;
332
- cursor: text;
333
- }
334
- .stage-meta input {
335
- width: min(240px, 100%);
336
- height: 40px;
337
- padding: 7px 9px;
338
- font-size: 12px;
339
- }
340
- @media (max-width: 1200px) {
341
- .stage {
342
- padding-right: 96px;
343
- padding-left: 276px;
344
- }
345
- }
346
- @media (max-width: 900px) {
347
- .workspace.left-collapsed .stage,
348
- .workspace.right-collapsed .stage,
349
- .workspace.left-collapsed.right-collapsed .stage {
350
- padding: 96px 16px 110px;
351
- }
34
+ background: #25292c;
35
+ color: white;
36
+ box-shadow: 0 2px 4px #00000006, 0 6px 16px #0000000d;
37
+ }
38
+ .review-launcher:hover:not(:disabled) { background: #373d41; border-color: #00000014; color: white; box-shadow: 0 2px 4px #00000008, 0 8px 20px #00000012; }
39
+ .review-launcher:active:not(:disabled) { transform: translateY(1px); }
40
+ .review-launcher[aria-pressed="true"] { border-color: var(--accent); background: var(--ui-selected); color: var(--accent); box-shadow: 0 2px 4px #00000008, 0 6px 18px #007bbb26; }
41
+ .review-launcher[aria-pressed="true"]:hover:not(:disabled),
42
+ .review-launcher[aria-pressed="true"][aria-expanded="true"] { background: #e0f0f8; color: #006da7; }
43
+ .review-launcher svg { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; animation: review-icon-in 160ms ease-out; }
44
+ .review-count { position: absolute; top: -3px; right: -3px; display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 5px; background: var(--accent); color: white; border: 2px solid var(--ui-bg); border-radius: 20px; font-size: 11px; line-height: 16px; font-variant-numeric: tabular-nums; animation: review-icon-in 180ms ease-out; }
45
+ .revision-notes { position: fixed; right: 24px; bottom: 88px; z-index: 40; width: 360px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 112px); overflow: auto; overscroll-behavior: contain; scroll-padding-block: 16px 68px; scrollbar-width: thin; scrollbar-color: #00000026 transparent; padding: 0 16px 16px; border: 1px solid #00000014; border-radius: 14px; background: var(--ui-surface); box-shadow: 0 4px 12px -2px #0000000f, 0 16px 32px -4px #0000001a; font-size: 13px; line-height: 1.5; animation: review-panel-in 180ms cubic-bezier(.2,.8,.2,1); }
46
+ .revision-notes:not(.comment-composer) { max-height: min(50dvh, calc(100dvh - 108px)); }
47
+ .revision-notes > header:not(.sr-only) { padding: 12px 0 0; }
48
+ .revision-notes h2 { min-width: 0; font-size: 14px; line-height: 20px; letter-spacing: -0.01em; }
49
+ .revision-notes svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
50
+ .revision-note-scope { overflow-wrap: anywhere; font-weight: 500; }
51
+ .revision-notes form { padding-top: 14px; }
52
+ .revision-notes textarea { display: block; min-height: 90px; max-height: 220px; padding: 10px 12px; border-color: #dcdfe4; border-radius: 8px; font-size: 14px; }
53
+ .revision-notes textarea::placeholder { color: var(--ui-muted); }
54
+ .revision-notes textarea:hover { border-color: #aab4ba; }
55
+ .revision-notes textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #007bbb1f; }
56
+ .revision-notes .primary, .review-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 7px 12px; border-radius: 999px; font-size: 12px; line-height: 18px; white-space: nowrap; }
57
+ .revision-notes .primary { background: var(--accent); border-color: var(--accent); }
58
+ .revision-notes .primary:hover:not(:disabled) { background: #006da7; border-color: #006da7; }
59
+ .review-secondary { border-color: transparent; background: #eceff1; font-weight: 500; }
60
+ .review-secondary:hover:not(:disabled) { border-color: transparent; background: #e1e6e9; }
61
+ .revision-notes .primary:disabled { background: #f0f2f3; border-color: #e6e9eb; color: #788087; box-shadow: none; }
62
+ .revision-note-submit { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
63
+ .comment-error { margin-top: 12px; color: #9b2929; font-size: 12px; }
64
+ .comment-copy-fallback { display: grid; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--ui-muted); }
65
+ .comment-copy-fallback textarea { font-size: 12px; }
66
+ .revision-note-list { list-style: none; padding: 0; margin: 0; }
67
+ .revision-note-list li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; column-gap: 8px; padding: 14px 0; border-top: 1px solid var(--ui-border); }
68
+ .revision-note-list li:first-child { border-top: 0; }
69
+ .revision-note-list li p { grid-column: 2 / -1; grid-row: 2; margin-top: 6px; line-height: 19px; white-space: pre-wrap; overflow-wrap: anywhere; }
70
+ .revision-note-list button { border: 0; background: transparent; border-radius: 6px; font-size: 12px; line-height: 18px; color: var(--ui-muted); }
71
+ .revision-note-target { grid-column: 1 / 3; grid-row: 1; display: flex; align-items: center; gap: 8px; width: 100%; padding: 0; text-align: left; }
72
+ .revision-note-target > span:last-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
73
+ .revision-note-target:hover:not(:disabled) { background: transparent; color: var(--accent); }
74
+ .revision-note-number { display: inline-grid; flex: none; place-items: center; min-width: 20px; height: 20px; padding: 0 3px; border-radius: 50%; background: var(--ui-selected); color: #006da7; font-size: 10px; line-height: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
75
+ .revision-note-actions { grid-column: 3; grid-row: 1; display: flex; gap: 2px; margin: -4px -6px -4px 0; }
76
+ .revision-note-actions button { display: grid; place-items: center; width: 28px; height: 28px; padding: 4px; }
77
+ .revision-note-actions button:hover:not(:disabled) { background: var(--ui-hover); color: var(--ui-text); }
78
+ .revision-note-actions .revision-note-remove:hover:not(:disabled) { background: #fff1f0; color: #9b2929; }
79
+ .current-comments li p { grid-row: 1; grid-column: 2; margin-top: 0; }
80
+ .current-comments + form { border-top: 1px solid var(--ui-border); }
81
+ .review-empty { margin: 28px 0; color: var(--ui-muted); text-align: center; }
82
+ .review-actions { position: sticky; bottom: -16px; z-index: 2; display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 -16px -16px; padding: 10px 12px; border-top: 1px solid var(--ui-border); background: var(--ui-subtle); }
83
+ .comment-copy-fallback + .review-actions, .comment-error + .review-actions { margin-top: 16px; }
84
+ .comment-composer { padding-bottom: 0; }
85
+ .comment-composer:focus-within { border-color: #007bbb55; }
86
+ .comment-composer .revision-note-scope { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ui-muted); font-size: 12px; line-height: 18px; }
87
+ .comment-composer form { padding-top: 0; }
88
+ .comment-composer #revision-note { min-height: 88px; padding: 10px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
89
+ .comment-composer .revision-note-submit { margin: 4px -16px 0; padding: 10px 12px; border-top: 1px solid var(--ui-border); background: var(--ui-subtle); }
90
+ .comment-composer > .comment-error { margin-bottom: 12px; }
91
+ @keyframes review-panel-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
92
+ @keyframes review-icon-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
93
+ @media (prefers-reduced-motion: reduce) {
94
+ .revision-notes, .review-launcher svg, .review-count { animation: none; }
95
+ .review-launcher, .revision-notes button { transition: none; }
352
96
  }
353
-
354
97
  @media (max-width: 600px) {
355
- :root {
356
- --panel-top: 88px;
357
- }
358
- }
359
-
360
- @media (prefers-reduced-motion: reduce) {
361
- .workspace {
362
- --panel-duration: 0ms;
363
- }
98
+ .workspace { padding: 24px 16px; }
99
+ .board-heading { margin-bottom: 28px; }
100
+ .review-launcher { right: 16px; bottom: 16px; }
101
+ .revision-notes { right: 16px; bottom: 80px; max-height: calc(100dvh - 96px); }
102
+ .revision-note-actions button { width: 32px; height: 32px; }
103
+ .review-actions button, .revision-note-submit button { min-height: 36px; }
364
104
  }
package/theme-base.css ADDED
@@ -0,0 +1,90 @@
1
+ /* Shared output geometry and type scales. Themes supply visual treatments;
2
+ documents own composition. See html/theme.md for the public contract. */
3
+ [data-page] {
4
+ --kp-page-width: 1920px; --kp-page-height: 1080px; --kp-page-margin: 72px;
5
+ --kp-font-fine: 20px; --kp-font-caption: 24px; --kp-font-body: 28px; --kp-font-lead: 36px; --kp-font-heading: 44px; --kp-font-title: 60px; --kp-font-display: 76px;
6
+ --kp-leading-fine: 28px; --kp-leading-caption: 32px; --kp-leading-body: 40px; --kp-leading-lead: 46px; --kp-leading-heading: 52px; --kp-leading-title: 68px; --kp-leading-display: 84px;
7
+ }
8
+ [data-size="portrait"], [data-size="square"] {
9
+ --kp-page-width: 1080px; --kp-page-height: 1350px; --kp-page-margin: 60px;
10
+ --kp-font-fine: 18px; --kp-font-caption: 22px; --kp-font-body: 28px; --kp-font-lead: 34px; --kp-font-heading: 44px; --kp-font-title: 60px; --kp-font-display: 76px;
11
+ --kp-leading-fine: 24px; --kp-leading-caption: 28px; --kp-leading-body: 36px; --kp-leading-lead: 44px; --kp-leading-heading: 52px; --kp-leading-title: 68px; --kp-leading-display: 84px;
12
+ }
13
+ [data-size="square"] { --kp-page-height: 1080px; }
14
+ [data-size="link"] {
15
+ --kp-page-width: 1200px; --kp-page-height: 630px; --kp-page-margin: 48px;
16
+ --kp-font-fine: 16px; --kp-font-caption: 20px; --kp-font-body: 24px; --kp-font-lead: 30px; --kp-font-heading: 40px; --kp-font-title: 52px; --kp-font-display: 64px;
17
+ --kp-leading-fine: 20px; --kp-leading-caption: 24px; --kp-leading-body: 32px; --kp-leading-lead: 36px; --kp-leading-heading: 48px; --kp-leading-title: 60px; --kp-leading-display: 72px;
18
+ }
19
+ [data-size="article"] {
20
+ --kp-page-width: 1600px; --kp-page-height: 600px; --kp-page-margin: 48px;
21
+ --kp-font-fine: 18px; --kp-font-caption: 22px; --kp-font-body: 28px; --kp-font-lead: 34px; --kp-font-heading: 44px; --kp-font-title: 56px; --kp-font-display: 72px;
22
+ --kp-leading-fine: 24px; --kp-leading-caption: 28px; --kp-leading-body: 36px; --kp-leading-lead: 44px; --kp-leading-heading: 52px; --kp-leading-title: 64px; --kp-leading-display: 80px;
23
+ }
24
+ [data-size="a4"] {
25
+ --kp-page-width: 210mm; --kp-page-height: 297mm; --kp-page-margin: 56px;
26
+ --kp-font-fine: 10px; --kp-font-caption: 12px; --kp-font-body: 14px; --kp-font-lead: 18px; --kp-font-heading: 24px; --kp-font-title: 32px; --kp-font-display: 44px;
27
+ --kp-leading-fine: 14px; --kp-leading-caption: 16px; --kp-leading-body: 20px; --kp-leading-lead: 24px; --kp-leading-heading: 30px; --kp-leading-title: 38px; --kp-leading-display: 50px;
28
+ }
29
+ [data-size="explainer"] { --kp-page-width: 1200px; --kp-page-height: 1600px; --kp-page-margin: 60px; }
30
+ [data-size="gallery"] {
31
+ --kp-page-width: 1600px; --kp-page-height: 1000px; --kp-page-margin: 64px;
32
+ --kp-font-lead: 34px; --kp-font-title: 56px; --kp-font-display: 72px;
33
+ --kp-leading-fine: 24px; --kp-leading-body: 36px; --kp-leading-lead: 44px; --kp-leading-title: 64px; --kp-leading-display: 80px;
34
+ }
35
+
36
+ * { box-sizing: border-box; }
37
+ body { margin: 0; }
38
+ :root { color-scheme: light; }
39
+ [data-page] {
40
+ --kp-space-1: var(--kp-unit); --kp-space-2: calc(2 * var(--kp-unit)); --kp-space-3: calc(3 * var(--kp-unit));
41
+ --kp-space-4: calc(4 * var(--kp-unit)); --kp-space-6: calc(6 * var(--kp-unit)); --kp-space-8: calc(8 * var(--kp-unit));
42
+ --kp-space-5: calc(5 * var(--kp-unit)); --kp-space-10: calc(10 * var(--kp-unit));
43
+ --kp-space-12: calc(12 * var(--kp-unit)); --kp-space-16: calc(16 * var(--kp-unit));
44
+ position: relative; display: flow-root;
45
+ width: var(--kp-page-width); height: var(--kp-page-height); padding: var(--kp-page-margin);
46
+ background: var(--kp-bg); color: var(--kp-fg);
47
+ font-family: var(--kp-font-family); font-size: var(--kp-font-body); line-height: var(--kp-leading-body);
48
+ font-weight: var(--kp-weight-body); letter-spacing: var(--kp-tracking-body);
49
+ font-synthesis: none;
50
+ /* Avoid stranded last words; headline roles below balance their lines. */
51
+ text-wrap: pretty;
52
+ }
53
+
54
+ /* Zero-specificity defaults leave page-authored CSS in control. An explicit
55
+ data-type replaces the element's default role without changing its semantics. */
56
+ :where([data-page]) :where(h1, h2, h3, p, figure) { margin: 0; }
57
+ :where([data-page]) :where([data-type="fine"]) {
58
+ font-family: var(--kp-font-family); font-size: var(--kp-font-fine); line-height: var(--kp-leading-fine);
59
+ font-weight: var(--kp-weight-fine); letter-spacing: var(--kp-tracking-fine); color: var(--kp-muted);
60
+ }
61
+ :where([data-page]) :where(figcaption:not([data-type]), [data-type="caption"]) {
62
+ font-family: var(--kp-font-family); font-size: var(--kp-font-caption); line-height: var(--kp-leading-caption);
63
+ font-weight: var(--kp-weight-caption); letter-spacing: var(--kp-tracking-caption); color: var(--kp-muted);
64
+ }
65
+ :where([data-page]) :where([data-type="body"]) {
66
+ font-family: var(--kp-font-family); font-size: var(--kp-font-body); line-height: var(--kp-leading-body);
67
+ font-weight: var(--kp-weight-body); letter-spacing: var(--kp-tracking-body); color: var(--kp-fg);
68
+ }
69
+ :where([data-page]) :where(h3:not([data-type]), [data-type="lead"]) {
70
+ font-family: var(--kp-font-family); font-size: var(--kp-font-lead); line-height: var(--kp-leading-lead);
71
+ font-weight: var(--kp-weight-lead); letter-spacing: var(--kp-tracking-lead);
72
+ }
73
+ :where([data-page]) :where(h2:not([data-type]), [data-type="heading"]) {
74
+ font-family: var(--kp-font-family-heading); font-size: var(--kp-font-heading); line-height: var(--kp-leading-heading);
75
+ font-weight: var(--kp-weight-heading); letter-spacing: var(--kp-tracking-heading);
76
+ text-wrap: balance;
77
+ }
78
+ :where([data-page]) :where(h1:not([data-type]), [data-type="title"]) {
79
+ font-family: var(--kp-font-family-heading); font-size: var(--kp-font-title); line-height: var(--kp-leading-title);
80
+ font-weight: var(--kp-weight-title); letter-spacing: var(--kp-tracking-title); color: var(--kp-accent);
81
+ text-wrap: balance;
82
+ }
83
+ :where([data-page]) :where([data-type="display"]) {
84
+ font-family: var(--kp-font-family-display); font-size: var(--kp-font-display); line-height: var(--kp-leading-display);
85
+ font-weight: var(--kp-weight-display); letter-spacing: var(--kp-tracking-display); color: var(--kp-accent);
86
+ text-wrap: balance;
87
+ }
88
+ :where([data-page]) :where(strong) { font-weight: var(--kp-weight-strong); }
89
+ :where([data-page]) :where(code) { font-family: var(--kp-font-family-mono); font-weight: var(--kp-weight-mono); color: var(--kp-accent); }
90
+ :where([data-page]) :where(hr) { margin: var(--kp-space-3) 0; border: 0; border-top: var(--kp-rule-width) solid var(--kp-line); }