@kamishibai/sdk 0.1.1
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.
- package/README.md +192 -0
- package/package.json +54 -0
- package/src/blocks/board.js +210 -0
- package/src/blocks/callout.js +63 -0
- package/src/blocks/code.js +28 -0
- package/src/blocks/deck.js +76 -0
- package/src/blocks/diagram.js +265 -0
- package/src/blocks/element.js +51 -0
- package/src/blocks/graph.js +264 -0
- package/src/blocks/grid.js +156 -0
- package/src/blocks/index.js +106 -0
- package/src/blocks/list.js +50 -0
- package/src/blocks/placement.js +119 -0
- package/src/blocks/prose.js +28 -0
- package/src/blocks/quote.js +25 -0
- package/src/blocks/raw.js +47 -0
- package/src/blocks/registry.js +158 -0
- package/src/blocks/schema-parts.js +19 -0
- package/src/blocks/section.js +53 -0
- package/src/blocks/slide.js +104 -0
- package/src/blocks/stat.js +83 -0
- package/src/blocks/table.js +50 -0
- package/src/blocks/timeline.js +80 -0
- package/src/cli/commands/close.js +51 -0
- package/src/cli/commands/comments.js +73 -0
- package/src/cli/commands/debug.js +34 -0
- package/src/cli/commands/example.js +22 -0
- package/src/cli/commands/export.js +10 -0
- package/src/cli/commands/init.js +53 -0
- package/src/cli/commands/lint.js +93 -0
- package/src/cli/commands/list.js +54 -0
- package/src/cli/commands/open.js +31 -0
- package/src/cli/commands/promote.js +38 -0
- package/src/cli/commands/render.js +31 -0
- package/src/cli/commands/replay.js +49 -0
- package/src/cli/commands/schema.js +10 -0
- package/src/cli/commands/serve.js +178 -0
- package/src/cli/commands/setup.js +64 -0
- package/src/cli/commands/snapshot.js +29 -0
- package/src/cli/commands/templates.js +75 -0
- package/src/cli/deliver.js +54 -0
- package/src/cli/emit.js +29 -0
- package/src/cli/format.js +153 -0
- package/src/cli/index.js +365 -0
- package/src/cli/registry.js +18 -0
- package/src/core/blocks.js +147 -0
- package/src/core/diagram.js +282 -0
- package/src/core/errors.js +156 -0
- package/src/core/example.js +109 -0
- package/src/core/ir.js +62 -0
- package/src/core/lint-gates.js +427 -0
- package/src/core/lint.js +281 -0
- package/src/core/scan.js +84 -0
- package/src/core/schema.js +88 -0
- package/src/core/spec-check.js +33 -0
- package/src/core/validate.js +44 -0
- package/src/core/version.js +18 -0
- package/src/core/vocabulary.js +140 -0
- package/src/delivery/atomic.js +71 -0
- package/src/delivery/comments.js +180 -0
- package/src/delivery/home.js +70 -0
- package/src/delivery/open.js +31 -0
- package/src/delivery/project.js +141 -0
- package/src/delivery/read.js +109 -0
- package/src/delivery/run.js +95 -0
- package/src/delivery/scaffold-blueprints.js +728 -0
- package/src/delivery/store.js +219 -0
- package/src/delivery/template-extensions.js +183 -0
- package/src/delivery/template-format.js +112 -0
- package/src/delivery/template-package.js +376 -0
- package/src/delivery/template-promote.js +240 -0
- package/src/delivery/template-scaffold.js +181 -0
- package/src/delivery/templates.js +192 -0
- package/src/delivery/toml.js +195 -0
- package/src/delivery/write.js +35 -0
- package/src/export/browser.js +130 -0
- package/src/export/index.js +96 -0
- package/src/export/pdf.js +25 -0
- package/src/export/png.js +40 -0
- package/src/export/pptx.js +48 -0
- package/src/export/slides.js +33 -0
- package/src/export/snapshot.js +33 -0
- package/src/layouts/article.js +103 -0
- package/src/layouts/canvas.js +144 -0
- package/src/layouts/card.js +128 -0
- package/src/layouts/deck.js +88 -0
- package/src/layouts/index.js +90 -0
- package/src/layouts/one-page.js +161 -0
- package/src/layouts/registry.js +251 -0
- package/src/layouts/resume.js +172 -0
- package/src/layouts/template-index.js +78 -0
- package/src/parser/artifact.js +38 -0
- package/src/parser/container.js +103 -0
- package/src/parser/index.js +223 -0
- package/src/parser/tokens.js +265 -0
- package/src/render/board-filter.client.js +80 -0
- package/src/render/compile.js +29 -0
- package/src/render/context.js +98 -0
- package/src/render/element.js +32 -0
- package/src/render/fonts.js +129 -0
- package/src/render/graph-hover.client.js +148 -0
- package/src/render/html.js +52 -0
- package/src/render/index.js +241 -0
- package/src/render/measure.js +60 -0
- package/src/render/placement.js +136 -0
- package/src/render/playback.client.js +74 -0
- package/src/render/scale-to-fit.client.js +136 -0
- package/src/render/scale.js +41 -0
- package/src/render/skeleton.js +131 -0
- package/src/render/ssr.js +24 -0
- package/src/render/styles.js +56 -0
- package/src/render/templates.js +191 -0
- package/src/serve/daemon.js +117 -0
- package/src/serve/overlay.js +213 -0
- package/src/serve/protocol.js +36 -0
- package/src/serve/server.js +264 -0
- package/templates/kami/cards/components.js +40 -0
- package/templates/kami/cards/index.js +25 -0
- package/templates/kami/cards/manifest.js +67 -0
- package/templates/kami/cards/styles.css +389 -0
- package/templates/kami/long-form/components.js +102 -0
- package/templates/kami/long-form/index.js +25 -0
- package/templates/kami/long-form/manifest.js +87 -0
- package/templates/kami/long-form/styles.css +481 -0
- package/templates/kami/one-page/components.js +48 -0
- package/templates/kami/one-page/index.js +27 -0
- package/templates/kami/one-page/manifest.js +65 -0
- package/templates/kami/one-page/styles.css +375 -0
- package/templates/kami/resume/components.js +51 -0
- package/templates/kami/resume/index.js +27 -0
- package/templates/kami/resume/manifest.js +65 -0
- package/templates/kami/resume/styles.css +424 -0
- package/templates/kami/slides/components.js +41 -0
- package/templates/kami/slides/index.js +26 -0
- package/templates/kami/slides/manifest.js +64 -0
- package/templates/kami/slides/styles.css +406 -0
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--paper: #14161c;
|
|
3
|
+
--surface: #f7f6f1;
|
|
4
|
+
--accent: #1B365D;
|
|
5
|
+
--accent-soft: #dbe2ec;
|
|
6
|
+
--rule: #ddd9cc;
|
|
7
|
+
--text-primary: #23201a;
|
|
8
|
+
--text-secondary: #5c574c;
|
|
9
|
+
--text-muted: #8a8371;
|
|
10
|
+
--code-bg: #efece1;
|
|
11
|
+
--warn: #8a5a12;
|
|
12
|
+
/* Page geometry is the `deck` layout's logical canvas, shipped on the markup
|
|
13
|
+
as data-ksb-canvas (src/layouts/deck.js). Not restated here: a second copy
|
|
14
|
+
of a size is a copy free to drift from the one that decides anything.
|
|
15
|
+
New comments in this file are ASCII on purpose — every distinct character
|
|
16
|
+
in a stylesheet pulls a font subset into every artifact it draws. */
|
|
17
|
+
/* ksb:maxWidth --slide-measure */
|
|
18
|
+
/* 宣告即內嵌(CONTRACT A4):只列真的隨產物出貨的具名字族。 */
|
|
19
|
+
--serif: 'Noto Serif TC', serif;
|
|
20
|
+
--mono: monospace;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
* {
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
html,
|
|
28
|
+
body {
|
|
29
|
+
margin: 0;
|
|
30
|
+
padding: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
body {
|
|
34
|
+
background: var(--paper);
|
|
35
|
+
color: var(--text-primary);
|
|
36
|
+
font-family: var(--serif);
|
|
37
|
+
font-size: 19px;
|
|
38
|
+
line-height: 1.5;
|
|
39
|
+
-webkit-font-smoothing: antialiased;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.deck {
|
|
43
|
+
margin: 0 auto;
|
|
44
|
+
padding: 32px 24px 88px;
|
|
45
|
+
/* The canvas width is fixed: a narrower window scrolls, never squeezes. */
|
|
46
|
+
overflow-x: auto;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* One slide *is* the bounded canvas: its size arrives inline and the skeleton's
|
|
50
|
+
scale-to-fit asset scales it. Only the skin lives here. */
|
|
51
|
+
.slide {
|
|
52
|
+
margin: 0 auto 28px;
|
|
53
|
+
padding: 48px 56px;
|
|
54
|
+
background: var(--surface);
|
|
55
|
+
border-radius: 4px;
|
|
56
|
+
box-shadow: 0 12px 32px rgb(0 0 0 / 35%);
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* Content region: the 24 tracks are laid inline (src/blocks/slide.js); this
|
|
64
|
+
only caps and centres the content column. */
|
|
65
|
+
.slide-inner {
|
|
66
|
+
width: 100%;
|
|
67
|
+
max-width: var(--slide-measure);
|
|
68
|
+
margin: 0 auto;
|
|
69
|
+
overflow-y: auto;
|
|
70
|
+
max-height: 100%;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* 播放模式由 playback.js 開啟(.is-live):沒有 JS 時每張照常可讀,
|
|
74
|
+
整份產物退化成一份可捲動的文件,而不是一片空白。 */
|
|
75
|
+
.deck.is-live .slide {
|
|
76
|
+
display: none;
|
|
77
|
+
margin: 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.deck.is-live .slide.is-current {
|
|
81
|
+
display: flex;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Playback fills the window; scale-to-fit centres the current slide in it. */
|
|
85
|
+
.deck.is-live {
|
|
86
|
+
position: fixed;
|
|
87
|
+
inset: 0;
|
|
88
|
+
padding: 0;
|
|
89
|
+
overflow: hidden;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.slide-masthead {
|
|
93
|
+
border-bottom: 2px solid var(--accent);
|
|
94
|
+
padding-bottom: 18px;
|
|
95
|
+
margin-bottom: 28px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.slide-masthead .kicker {
|
|
99
|
+
font-size: 13px;
|
|
100
|
+
letter-spacing: 0.22em;
|
|
101
|
+
text-transform: uppercase;
|
|
102
|
+
color: var(--accent);
|
|
103
|
+
margin: 0 0 10px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.slide-masthead .deck-title {
|
|
107
|
+
font-size: 44px;
|
|
108
|
+
line-height: 1.25;
|
|
109
|
+
font-weight: 700;
|
|
110
|
+
margin: 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.slide-masthead .byline {
|
|
114
|
+
margin: 12px 0 0;
|
|
115
|
+
font-size: 15px;
|
|
116
|
+
color: var(--text-secondary);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* One cell on the tracks. Geometry is inline; this only stops the grid default
|
|
120
|
+
`min-width: auto` from widening a track and narrowing its neighbour. */
|
|
121
|
+
.slide-cell {
|
|
122
|
+
min-width: 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.section {
|
|
126
|
+
margin: 0 0 20px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* A cell holds exactly one block, so `:last-child` on the block matches every
|
|
130
|
+
block. "No trailing margin on the last one" has to be said by the cell. */
|
|
131
|
+
.slide-cell:last-child > .section {
|
|
132
|
+
margin-bottom: 0;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.section > .section-title {
|
|
136
|
+
font-weight: 700;
|
|
137
|
+
color: var(--accent);
|
|
138
|
+
line-height: 1.3;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.section-l1 > .section-title {
|
|
142
|
+
font-size: 34px;
|
|
143
|
+
margin: 0 0 20px;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.section-l2 > .section-title {
|
|
147
|
+
font-size: 26px;
|
|
148
|
+
margin: 0 0 16px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.section-l3 > .section-title,
|
|
152
|
+
.section-l4 > .section-title,
|
|
153
|
+
.section-l5 > .section-title,
|
|
154
|
+
.section-l6 > .section-title {
|
|
155
|
+
font-size: 21px;
|
|
156
|
+
margin: 0 0 12px;
|
|
157
|
+
color: var(--text-primary);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.prose {
|
|
161
|
+
margin: 0 0 16px;
|
|
162
|
+
line-height: 1.5;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.prose a {
|
|
166
|
+
color: var(--accent);
|
|
167
|
+
text-underline-offset: 3px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.prose ul,
|
|
171
|
+
.prose ol,
|
|
172
|
+
.list {
|
|
173
|
+
margin: 0 0 16px;
|
|
174
|
+
padding-left: 1.3em;
|
|
175
|
+
line-height: 1.5;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.prose li,
|
|
179
|
+
.list li {
|
|
180
|
+
margin: 0 0 10px;
|
|
181
|
+
line-height: 1.5;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.prose li:last-child,
|
|
185
|
+
.list li:last-child {
|
|
186
|
+
margin-bottom: 0;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.prose li::marker,
|
|
190
|
+
.list li::marker {
|
|
191
|
+
color: var(--text-muted);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.prose ul ul,
|
|
195
|
+
.prose ul ol,
|
|
196
|
+
.prose ol ul,
|
|
197
|
+
.prose ol ol,
|
|
198
|
+
.list .list {
|
|
199
|
+
margin: 8px 0 0;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.list li > .prose {
|
|
203
|
+
margin: 0;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.list li > .prose + * {
|
|
207
|
+
margin-top: 8px;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.list li > .callout,
|
|
211
|
+
.list li > .quote,
|
|
212
|
+
.list li > .code,
|
|
213
|
+
.list li > .table-wrap,
|
|
214
|
+
.list li > .island {
|
|
215
|
+
margin: 8px 0 0;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.prose code,
|
|
219
|
+
.callout code,
|
|
220
|
+
.quote code,
|
|
221
|
+
.table code,
|
|
222
|
+
.list code {
|
|
223
|
+
font-family: var(--mono);
|
|
224
|
+
font-size: 0.9em;
|
|
225
|
+
background: var(--code-bg);
|
|
226
|
+
border-radius: 3px;
|
|
227
|
+
padding: 1px 5px;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.quote {
|
|
231
|
+
margin: 0 0 18px;
|
|
232
|
+
padding: 4px 0 4px 18px;
|
|
233
|
+
border-left: 3px solid var(--accent-soft);
|
|
234
|
+
color: var(--text-secondary);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.callout {
|
|
238
|
+
margin: 0 0 18px;
|
|
239
|
+
padding: 14px 18px;
|
|
240
|
+
background: #efeee7;
|
|
241
|
+
border-left: 4px solid var(--accent);
|
|
242
|
+
border-radius: 2px;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.callout-warn {
|
|
246
|
+
border-left-color: var(--warn);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.callout .callout-label {
|
|
250
|
+
display: block;
|
|
251
|
+
font-size: 11px;
|
|
252
|
+
letter-spacing: 0.18em;
|
|
253
|
+
text-transform: uppercase;
|
|
254
|
+
color: var(--accent);
|
|
255
|
+
margin-bottom: 6px;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.callout-warn .callout-label {
|
|
259
|
+
color: var(--warn);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.callout > .prose:last-child,
|
|
263
|
+
.quote > .prose:last-child {
|
|
264
|
+
margin-bottom: 0;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.code {
|
|
268
|
+
margin: 0 0 18px;
|
|
269
|
+
padding: 14px 16px;
|
|
270
|
+
background: var(--code-bg);
|
|
271
|
+
border: 1px solid var(--rule);
|
|
272
|
+
border-radius: 4px;
|
|
273
|
+
overflow-x: auto;
|
|
274
|
+
font-family: var(--mono);
|
|
275
|
+
font-size: 15px;
|
|
276
|
+
line-height: 1.45;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.code code {
|
|
280
|
+
font-family: inherit;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.table-wrap {
|
|
284
|
+
margin: 0 0 18px;
|
|
285
|
+
overflow-x: auto;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.table {
|
|
289
|
+
width: 100%;
|
|
290
|
+
border-collapse: collapse;
|
|
291
|
+
font-size: 16px;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.table th,
|
|
295
|
+
.table td {
|
|
296
|
+
border-bottom: 1px solid var(--rule);
|
|
297
|
+
padding: 8px 12px;
|
|
298
|
+
text-align: left;
|
|
299
|
+
vertical-align: top;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.table th {
|
|
303
|
+
color: var(--accent);
|
|
304
|
+
font-weight: 700;
|
|
305
|
+
border-bottom: 2px solid var(--accent-soft);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.island {
|
|
309
|
+
margin: 0 0 18px;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/* diagram(CONTRACT D1)——幾何由 core/diagram.js 算出,樣式只上色。
|
|
313
|
+
這段在兩套模板中逐字相同,且只用兩邊取值一致的變數(--accent /
|
|
314
|
+
--accent-soft / --text-primary / --text-secondary),所以同一份 spec
|
|
315
|
+
在長文與簡報下畫出的是同一張圖,不是「看起來很像」的兩張。 */
|
|
316
|
+
.diagram {
|
|
317
|
+
margin: 0 0 22px;
|
|
318
|
+
overflow-x: auto;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.diagram-svg {
|
|
322
|
+
display: block;
|
|
323
|
+
max-width: 100%;
|
|
324
|
+
height: auto;
|
|
325
|
+
font-family: var(--serif);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.diagram-node-box {
|
|
329
|
+
fill: var(--accent-soft);
|
|
330
|
+
stroke: var(--accent);
|
|
331
|
+
stroke-width: 1.5;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.diagram-node-label {
|
|
335
|
+
fill: var(--text-primary);
|
|
336
|
+
font-size: 15px;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.diagram-edge-line {
|
|
340
|
+
fill: none;
|
|
341
|
+
stroke: var(--accent);
|
|
342
|
+
stroke-width: 1.5;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.diagram-arrow {
|
|
346
|
+
fill: var(--accent);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.diagram-edge-label {
|
|
350
|
+
fill: var(--text-secondary);
|
|
351
|
+
font-size: 12px;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.deck-chrome {
|
|
355
|
+
position: fixed;
|
|
356
|
+
left: 0;
|
|
357
|
+
right: 0;
|
|
358
|
+
bottom: 0;
|
|
359
|
+
display: flex;
|
|
360
|
+
justify-content: space-between;
|
|
361
|
+
align-items: center;
|
|
362
|
+
gap: 16px;
|
|
363
|
+
padding: 10px 20px;
|
|
364
|
+
background: rgb(0 0 0 / 45%);
|
|
365
|
+
color: #f2efe6;
|
|
366
|
+
font-size: 13px;
|
|
367
|
+
letter-spacing: 0.08em;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.deck-progress {
|
|
371
|
+
font-weight: 700;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.deck-hint {
|
|
375
|
+
color: #cfc9ba;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
@media print {
|
|
379
|
+
body {
|
|
380
|
+
background: #fff;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/* The printed form puts every slide on paper, so playback's fixed
|
|
384
|
+
positioning and single-slide display both stand aside. */
|
|
385
|
+
.deck.is-live {
|
|
386
|
+
position: static;
|
|
387
|
+
overflow: visible;
|
|
388
|
+
padding: 32px 24px;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.deck.is-live .slide {
|
|
392
|
+
display: flex;
|
|
393
|
+
margin: 0 auto 28px;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.slide {
|
|
397
|
+
box-shadow: none;
|
|
398
|
+
break-inside: avoid;
|
|
399
|
+
/* scale-to-fit is for screens; on paper the inline transform stands down. */
|
|
400
|
+
transform: none !important;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.deck-chrome {
|
|
404
|
+
display: none;
|
|
405
|
+
}
|
|
406
|
+
}
|