@cfbender/cesium 0.4.0 → 0.5.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/CHANGELOG.md +94 -0
- package/README.md +2 -5
- package/package.json +3 -2
- package/src/cli/commands/serve.ts +18 -2
- package/src/index.ts +4 -1
- package/src/prompt/field-reference.ts +94 -0
- package/src/prompt/system-fragment.md +56 -65
- package/src/render/blocks/catalog.ts +39 -0
- package/src/render/blocks/escape.ts +27 -0
- package/src/render/blocks/highlight.ts +188 -0
- package/src/render/blocks/index.ts +6 -0
- package/src/render/blocks/markdown.ts +217 -0
- package/src/render/blocks/render.ts +104 -0
- package/src/render/blocks/renderers/callout.ts +38 -0
- package/src/render/blocks/renderers/code.ts +46 -0
- package/src/render/blocks/renderers/compare-table.ts +56 -0
- package/src/render/blocks/renderers/diagram.ts +48 -0
- package/src/render/blocks/renderers/divider.ts +31 -0
- package/src/render/blocks/renderers/hero.ts +66 -0
- package/src/render/blocks/renderers/kv.ts +45 -0
- package/src/render/blocks/renderers/list.ts +51 -0
- package/src/render/blocks/renderers/pill-row.ts +45 -0
- package/src/render/blocks/renderers/prose.ts +29 -0
- package/src/render/blocks/renderers/raw-html.ts +32 -0
- package/src/render/blocks/renderers/risk-table.ts +76 -0
- package/src/render/blocks/renderers/section.ts +97 -0
- package/src/render/blocks/renderers/timeline.ts +58 -0
- package/src/render/blocks/renderers/tldr.ts +30 -0
- package/src/render/blocks/themes/claret-dark.ts +206 -0
- package/src/render/blocks/themes/claret-light.ts +227 -0
- package/src/render/blocks/types.ts +127 -0
- package/src/render/blocks/validate-block.ts +202 -0
- package/src/render/critique.ts +410 -10
- package/src/render/fallback.ts +18 -0
- package/src/render/theme.ts +154 -0
- package/src/render/validate.ts +282 -17
- package/src/render/wrap.ts +7 -7
- package/src/server/lifecycle.ts +190 -3
- package/src/storage/assets.ts +66 -0
- package/src/storage/index-cache.ts +1 -0
- package/src/storage/index-gen.ts +13 -14
- package/src/tools/ask.ts +7 -5
- package/src/tools/critique.ts +41 -6
- package/src/tools/publish.ts +43 -14
- package/src/tools/styleguide.ts +118 -9
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
// Claret-dark shiki theme — converted from ports/bat/ClaretDark.tmTheme.
|
|
2
|
+
// src/render/blocks/themes/claret-dark.ts
|
|
3
|
+
//
|
|
4
|
+
// Source of truth: /claret.nvim/ports/bat/ClaretDark.tmTheme
|
|
5
|
+
// Every scope rule in the tmTheme is preserved verbatim; comma-separated
|
|
6
|
+
// scope strings are split into the string[] form shiki prefers.
|
|
7
|
+
//
|
|
8
|
+
// Global tokens (from tmTheme global settings):
|
|
9
|
+
// bg #180810 — editor background
|
|
10
|
+
// fg #DDD3C7 — default foreground
|
|
11
|
+
// selection #2B1F22
|
|
12
|
+
// gutter fg #71685E
|
|
13
|
+
//
|
|
14
|
+
// Derived palette reference (claret.nvim/lua/claret/palette.lua — dark):
|
|
15
|
+
// rose_1 #C75B7A keyword / statement / accent
|
|
16
|
+
// rose_2 #B04A68 property / data keys
|
|
17
|
+
// gold_1 #D4A76A function / number / constant / decorator
|
|
18
|
+
// sage_1 #8FA86E string
|
|
19
|
+
// slate_1 #8995A8 type / class / tag / escape / link
|
|
20
|
+
// slate_2 #6E7A90 tag attribute
|
|
21
|
+
// text #DDD3C7 variable / default fg
|
|
22
|
+
// text_2 #BDB3A7 operator (syntax.lua maps Operator → text_2; tmTheme uses #9E9288)
|
|
23
|
+
// NOTE: the tmTheme uses #9E9288 (text_3) for operator/punctuation — preserved.
|
|
24
|
+
// text_4 #71685E comment (fg)
|
|
25
|
+
// terra_1 #C44536 invalid / diff deleted
|
|
26
|
+
|
|
27
|
+
import type { ThemeRegistration } from "shiki";
|
|
28
|
+
|
|
29
|
+
export const claretDark: ThemeRegistration = {
|
|
30
|
+
name: "claret-dark",
|
|
31
|
+
type: "dark",
|
|
32
|
+
fg: "#DDD3C7",
|
|
33
|
+
bg: "#180810",
|
|
34
|
+
colors: {
|
|
35
|
+
"editor.foreground": "#DDD3C7",
|
|
36
|
+
"editor.background": "#180810",
|
|
37
|
+
"editor.selectionBackground": "#2B1F22",
|
|
38
|
+
"editor.lineHighlightBackground": "#2B1F22",
|
|
39
|
+
"editorLineNumber.foreground": "#71685E",
|
|
40
|
+
},
|
|
41
|
+
tokenColors: [
|
|
42
|
+
// Comment — #71685E italic
|
|
43
|
+
{
|
|
44
|
+
name: "Comment",
|
|
45
|
+
scope: ["comment", "punctuation.definition.comment"],
|
|
46
|
+
settings: { foreground: "#71685E", fontStyle: "italic" },
|
|
47
|
+
},
|
|
48
|
+
// Keyword — #C75B7A
|
|
49
|
+
{
|
|
50
|
+
name: "Keyword",
|
|
51
|
+
scope: ["keyword", "storage.type", "storage.modifier"],
|
|
52
|
+
settings: { foreground: "#C75B7A" },
|
|
53
|
+
},
|
|
54
|
+
// Function — #D4A76A
|
|
55
|
+
{
|
|
56
|
+
name: "Function",
|
|
57
|
+
scope: ["entity.name.function", "support.function"],
|
|
58
|
+
settings: { foreground: "#D4A76A" },
|
|
59
|
+
},
|
|
60
|
+
// String — #8FA86E
|
|
61
|
+
{
|
|
62
|
+
name: "String",
|
|
63
|
+
scope: ["string", "punctuation.definition.string"],
|
|
64
|
+
settings: { foreground: "#8FA86E" },
|
|
65
|
+
},
|
|
66
|
+
// Number — #D4A76A
|
|
67
|
+
{
|
|
68
|
+
name: "Number",
|
|
69
|
+
scope: ["constant.numeric"],
|
|
70
|
+
settings: { foreground: "#D4A76A" },
|
|
71
|
+
},
|
|
72
|
+
// Constant — #D4A76A
|
|
73
|
+
{
|
|
74
|
+
name: "Constant",
|
|
75
|
+
scope: ["constant", "constant.language", "variable.language"],
|
|
76
|
+
settings: { foreground: "#D4A76A" },
|
|
77
|
+
},
|
|
78
|
+
// Type — #8995A8
|
|
79
|
+
{
|
|
80
|
+
name: "Type",
|
|
81
|
+
scope: [
|
|
82
|
+
"entity.name.type",
|
|
83
|
+
"entity.name.class",
|
|
84
|
+
"support.type",
|
|
85
|
+
"support.class",
|
|
86
|
+
],
|
|
87
|
+
settings: { foreground: "#8995A8" },
|
|
88
|
+
},
|
|
89
|
+
// Variable — #DDD3C7
|
|
90
|
+
{
|
|
91
|
+
name: "Variable",
|
|
92
|
+
scope: ["variable", "variable.parameter"],
|
|
93
|
+
settings: { foreground: "#DDD3C7" },
|
|
94
|
+
},
|
|
95
|
+
// Parameter — #DDD3C7 italic (overrides Variable for parameters)
|
|
96
|
+
{
|
|
97
|
+
name: "Parameter",
|
|
98
|
+
scope: ["variable.parameter"],
|
|
99
|
+
settings: { foreground: "#DDD3C7", fontStyle: "italic" },
|
|
100
|
+
},
|
|
101
|
+
// Property — #B04A68
|
|
102
|
+
{
|
|
103
|
+
name: "Property",
|
|
104
|
+
scope: ["variable.other.property", "variable.other.member"],
|
|
105
|
+
settings: { foreground: "#B04A68" },
|
|
106
|
+
},
|
|
107
|
+
// JSON/YAML/TOML Keys — #B04A68
|
|
108
|
+
{
|
|
109
|
+
name: "JSON/YAML/TOML Keys",
|
|
110
|
+
scope: [
|
|
111
|
+
"meta.mapping.key string",
|
|
112
|
+
"support.type.property-name.json",
|
|
113
|
+
"punctuation.support.type.property-name.json",
|
|
114
|
+
"support.type.property-name.toml",
|
|
115
|
+
"punctuation.support.type.property-name.toml",
|
|
116
|
+
"entity.name.tag.yaml",
|
|
117
|
+
"support.type.property-name.yaml",
|
|
118
|
+
],
|
|
119
|
+
settings: { foreground: "#B04A68" },
|
|
120
|
+
},
|
|
121
|
+
// Operator — #9E9288
|
|
122
|
+
{
|
|
123
|
+
name: "Operator",
|
|
124
|
+
scope: ["keyword.operator"],
|
|
125
|
+
settings: { foreground: "#9E9288" },
|
|
126
|
+
},
|
|
127
|
+
// Punctuation — #9E9288
|
|
128
|
+
{
|
|
129
|
+
name: "Punctuation",
|
|
130
|
+
scope: ["punctuation"],
|
|
131
|
+
settings: { foreground: "#9E9288" },
|
|
132
|
+
},
|
|
133
|
+
// Decorator — #D4A76A italic
|
|
134
|
+
{
|
|
135
|
+
name: "Decorator",
|
|
136
|
+
scope: ["meta.decorator", "punctuation.decorator"],
|
|
137
|
+
settings: { foreground: "#D4A76A", fontStyle: "italic" },
|
|
138
|
+
},
|
|
139
|
+
// Tag — #8995A8
|
|
140
|
+
{
|
|
141
|
+
name: "Tag",
|
|
142
|
+
scope: ["entity.name.tag"],
|
|
143
|
+
settings: { foreground: "#8995A8" },
|
|
144
|
+
},
|
|
145
|
+
// Tag Attribute — #6E7A90
|
|
146
|
+
{
|
|
147
|
+
name: "Tag Attribute",
|
|
148
|
+
scope: ["entity.other.attribute-name"],
|
|
149
|
+
settings: { foreground: "#6E7A90" },
|
|
150
|
+
},
|
|
151
|
+
// Invalid — #C44536
|
|
152
|
+
{
|
|
153
|
+
name: "Invalid",
|
|
154
|
+
scope: ["invalid", "invalid.illegal"],
|
|
155
|
+
settings: { foreground: "#C44536" },
|
|
156
|
+
},
|
|
157
|
+
// Escape — #8995A8
|
|
158
|
+
{
|
|
159
|
+
name: "Escape",
|
|
160
|
+
scope: ["constant.character.escape"],
|
|
161
|
+
settings: { foreground: "#8995A8" },
|
|
162
|
+
},
|
|
163
|
+
// Markup Heading — #C75B7A bold
|
|
164
|
+
{
|
|
165
|
+
name: "Markup Heading",
|
|
166
|
+
scope: ["markup.heading"],
|
|
167
|
+
settings: { foreground: "#C75B7A", fontStyle: "bold" },
|
|
168
|
+
},
|
|
169
|
+
// Markup Bold — bold (no color override)
|
|
170
|
+
{
|
|
171
|
+
name: "Markup Bold",
|
|
172
|
+
scope: ["markup.bold"],
|
|
173
|
+
settings: { fontStyle: "bold" },
|
|
174
|
+
},
|
|
175
|
+
// Markup Italic — italic (no color override)
|
|
176
|
+
{
|
|
177
|
+
name: "Markup Italic",
|
|
178
|
+
scope: ["markup.italic"],
|
|
179
|
+
settings: { fontStyle: "italic" },
|
|
180
|
+
},
|
|
181
|
+
// Markup Link — #8995A8
|
|
182
|
+
{
|
|
183
|
+
name: "Markup Link",
|
|
184
|
+
scope: ["markup.underline.link", "string.other.link"],
|
|
185
|
+
settings: { foreground: "#8995A8" },
|
|
186
|
+
},
|
|
187
|
+
// Diff Added — #8FA86E
|
|
188
|
+
{
|
|
189
|
+
name: "Diff Added",
|
|
190
|
+
scope: ["markup.inserted"],
|
|
191
|
+
settings: { foreground: "#8FA86E" },
|
|
192
|
+
},
|
|
193
|
+
// Diff Deleted — #C44536
|
|
194
|
+
{
|
|
195
|
+
name: "Diff Deleted",
|
|
196
|
+
scope: ["markup.deleted"],
|
|
197
|
+
settings: { foreground: "#C44536" },
|
|
198
|
+
},
|
|
199
|
+
// Diff Changed — #D4A76A
|
|
200
|
+
{
|
|
201
|
+
name: "Diff Changed",
|
|
202
|
+
scope: ["markup.changed"],
|
|
203
|
+
settings: { foreground: "#D4A76A" },
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
};
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
// Claret-light shiki theme — derived from claret.nvim light palette.
|
|
2
|
+
// src/render/blocks/themes/claret-light.ts
|
|
3
|
+
//
|
|
4
|
+
// Source of truth: /claret.nvim/lua/claret/palette.lua (light section)
|
|
5
|
+
// Scope-to-role mapping mirrors ClaretDark.tmTheme exactly; colors
|
|
6
|
+
// are substituted from the light palette using the same semantic roles.
|
|
7
|
+
//
|
|
8
|
+
// Light palette (palette.lua):
|
|
9
|
+
// bg #F5E6E2 editor background
|
|
10
|
+
// bg_mute #DDD0CC selection / line highlight
|
|
11
|
+
// text #2A1F1A default fg
|
|
12
|
+
// text_4 #928578 comment / gutter fg
|
|
13
|
+
// rose_1 #B80842 keyword / heading / statement
|
|
14
|
+
// rose_2 #920820 property / data keys
|
|
15
|
+
// gold_1 #946000 function / number / constant / decorator
|
|
16
|
+
// sage_1 #1B5500 string
|
|
17
|
+
// slate_1 #0E3088 type / class / tag / escape / link
|
|
18
|
+
// slate_2 #0A2575 tag attribute
|
|
19
|
+
// terra_1 #D42010 invalid / diff deleted
|
|
20
|
+
//
|
|
21
|
+
// Role mapping (matching dark tmTheme):
|
|
22
|
+
// Comment → text_4 #928578 italic
|
|
23
|
+
// Keyword → rose_1 #B80842
|
|
24
|
+
// Function → gold_1 #946000
|
|
25
|
+
// String → sage_1 #1B5500
|
|
26
|
+
// Number → gold_1 #946000
|
|
27
|
+
// Constant → gold_1 #946000
|
|
28
|
+
// Type → slate_1 #0E3088
|
|
29
|
+
// Variable → text #2A1F1A
|
|
30
|
+
// Parameter → text #2A1F1A italic
|
|
31
|
+
// Property → rose_2 #920820
|
|
32
|
+
// Keys → rose_2 #920820
|
|
33
|
+
// Operator → text_4 #928578 (text_3 equivalent; nearest warm muted in light palette)
|
|
34
|
+
// Punctuation → text_4 #928578
|
|
35
|
+
// Decorator → gold_1 #946000 italic
|
|
36
|
+
// Tag → slate_1 #0E3088
|
|
37
|
+
// Tag Attribute → slate_2 #0A2575
|
|
38
|
+
// Invalid → terra_1 #D42010
|
|
39
|
+
// Escape → slate_1 #0E3088
|
|
40
|
+
// Markup Heading→ rose_1 #B80842 bold
|
|
41
|
+
// Markup Bold → (no fg) bold
|
|
42
|
+
// Markup Italic → (no fg) italic
|
|
43
|
+
// Markup Link → slate_1 #0E3088
|
|
44
|
+
// Diff Added → sage_1 #1B5500
|
|
45
|
+
// Diff Deleted → terra_1 #D42010
|
|
46
|
+
// Diff Changed → gold_1 #946000
|
|
47
|
+
|
|
48
|
+
import type { ThemeRegistration } from "shiki";
|
|
49
|
+
|
|
50
|
+
export const claretLight: ThemeRegistration = {
|
|
51
|
+
name: "claret-light",
|
|
52
|
+
type: "light",
|
|
53
|
+
fg: "#2A1F1A",
|
|
54
|
+
bg: "#F5E6E2",
|
|
55
|
+
colors: {
|
|
56
|
+
"editor.foreground": "#2A1F1A",
|
|
57
|
+
"editor.background": "#F5E6E2",
|
|
58
|
+
"editor.selectionBackground": "#DDD0CC",
|
|
59
|
+
"editor.lineHighlightBackground": "#DDD0CC",
|
|
60
|
+
"editorLineNumber.foreground": "#928578",
|
|
61
|
+
},
|
|
62
|
+
tokenColors: [
|
|
63
|
+
// Comment — #928578 italic
|
|
64
|
+
{
|
|
65
|
+
name: "Comment",
|
|
66
|
+
scope: ["comment", "punctuation.definition.comment"],
|
|
67
|
+
settings: { foreground: "#928578", fontStyle: "italic" },
|
|
68
|
+
},
|
|
69
|
+
// Keyword — #B80842
|
|
70
|
+
{
|
|
71
|
+
name: "Keyword",
|
|
72
|
+
scope: ["keyword", "storage.type", "storage.modifier"],
|
|
73
|
+
settings: { foreground: "#B80842" },
|
|
74
|
+
},
|
|
75
|
+
// Function — #946000
|
|
76
|
+
{
|
|
77
|
+
name: "Function",
|
|
78
|
+
scope: ["entity.name.function", "support.function"],
|
|
79
|
+
settings: { foreground: "#946000" },
|
|
80
|
+
},
|
|
81
|
+
// String — #1B5500
|
|
82
|
+
{
|
|
83
|
+
name: "String",
|
|
84
|
+
scope: ["string", "punctuation.definition.string"],
|
|
85
|
+
settings: { foreground: "#1B5500" },
|
|
86
|
+
},
|
|
87
|
+
// Number — #946000
|
|
88
|
+
{
|
|
89
|
+
name: "Number",
|
|
90
|
+
scope: ["constant.numeric"],
|
|
91
|
+
settings: { foreground: "#946000" },
|
|
92
|
+
},
|
|
93
|
+
// Constant — #946000
|
|
94
|
+
{
|
|
95
|
+
name: "Constant",
|
|
96
|
+
scope: ["constant", "constant.language", "variable.language"],
|
|
97
|
+
settings: { foreground: "#946000" },
|
|
98
|
+
},
|
|
99
|
+
// Type — #0E3088
|
|
100
|
+
{
|
|
101
|
+
name: "Type",
|
|
102
|
+
scope: [
|
|
103
|
+
"entity.name.type",
|
|
104
|
+
"entity.name.class",
|
|
105
|
+
"support.type",
|
|
106
|
+
"support.class",
|
|
107
|
+
],
|
|
108
|
+
settings: { foreground: "#0E3088" },
|
|
109
|
+
},
|
|
110
|
+
// Variable — #2A1F1A
|
|
111
|
+
{
|
|
112
|
+
name: "Variable",
|
|
113
|
+
scope: ["variable", "variable.parameter"],
|
|
114
|
+
settings: { foreground: "#2A1F1A" },
|
|
115
|
+
},
|
|
116
|
+
// Parameter — #2A1F1A italic (overrides Variable for parameters)
|
|
117
|
+
{
|
|
118
|
+
name: "Parameter",
|
|
119
|
+
scope: ["variable.parameter"],
|
|
120
|
+
settings: { foreground: "#2A1F1A", fontStyle: "italic" },
|
|
121
|
+
},
|
|
122
|
+
// Property — #920820
|
|
123
|
+
{
|
|
124
|
+
name: "Property",
|
|
125
|
+
scope: ["variable.other.property", "variable.other.member"],
|
|
126
|
+
settings: { foreground: "#920820" },
|
|
127
|
+
},
|
|
128
|
+
// JSON/YAML/TOML Keys — #920820
|
|
129
|
+
{
|
|
130
|
+
name: "JSON/YAML/TOML Keys",
|
|
131
|
+
scope: [
|
|
132
|
+
"meta.mapping.key string",
|
|
133
|
+
"support.type.property-name.json",
|
|
134
|
+
"punctuation.support.type.property-name.json",
|
|
135
|
+
"support.type.property-name.toml",
|
|
136
|
+
"punctuation.support.type.property-name.toml",
|
|
137
|
+
"entity.name.tag.yaml",
|
|
138
|
+
"support.type.property-name.yaml",
|
|
139
|
+
],
|
|
140
|
+
settings: { foreground: "#920820" },
|
|
141
|
+
},
|
|
142
|
+
// Operator — #928578
|
|
143
|
+
{
|
|
144
|
+
name: "Operator",
|
|
145
|
+
scope: ["keyword.operator"],
|
|
146
|
+
settings: { foreground: "#928578" },
|
|
147
|
+
},
|
|
148
|
+
// Punctuation — #928578
|
|
149
|
+
{
|
|
150
|
+
name: "Punctuation",
|
|
151
|
+
scope: ["punctuation"],
|
|
152
|
+
settings: { foreground: "#928578" },
|
|
153
|
+
},
|
|
154
|
+
// Decorator — #946000 italic
|
|
155
|
+
{
|
|
156
|
+
name: "Decorator",
|
|
157
|
+
scope: ["meta.decorator", "punctuation.decorator"],
|
|
158
|
+
settings: { foreground: "#946000", fontStyle: "italic" },
|
|
159
|
+
},
|
|
160
|
+
// Tag — #0E3088
|
|
161
|
+
{
|
|
162
|
+
name: "Tag",
|
|
163
|
+
scope: ["entity.name.tag"],
|
|
164
|
+
settings: { foreground: "#0E3088" },
|
|
165
|
+
},
|
|
166
|
+
// Tag Attribute — #0A2575
|
|
167
|
+
{
|
|
168
|
+
name: "Tag Attribute",
|
|
169
|
+
scope: ["entity.other.attribute-name"],
|
|
170
|
+
settings: { foreground: "#0A2575" },
|
|
171
|
+
},
|
|
172
|
+
// Invalid — #D42010
|
|
173
|
+
{
|
|
174
|
+
name: "Invalid",
|
|
175
|
+
scope: ["invalid", "invalid.illegal"],
|
|
176
|
+
settings: { foreground: "#D42010" },
|
|
177
|
+
},
|
|
178
|
+
// Escape — #0E3088
|
|
179
|
+
{
|
|
180
|
+
name: "Escape",
|
|
181
|
+
scope: ["constant.character.escape"],
|
|
182
|
+
settings: { foreground: "#0E3088" },
|
|
183
|
+
},
|
|
184
|
+
// Markup Heading — #B80842 bold
|
|
185
|
+
{
|
|
186
|
+
name: "Markup Heading",
|
|
187
|
+
scope: ["markup.heading"],
|
|
188
|
+
settings: { foreground: "#B80842", fontStyle: "bold" },
|
|
189
|
+
},
|
|
190
|
+
// Markup Bold — bold (no color override)
|
|
191
|
+
{
|
|
192
|
+
name: "Markup Bold",
|
|
193
|
+
scope: ["markup.bold"],
|
|
194
|
+
settings: { fontStyle: "bold" },
|
|
195
|
+
},
|
|
196
|
+
// Markup Italic — italic (no color override)
|
|
197
|
+
{
|
|
198
|
+
name: "Markup Italic",
|
|
199
|
+
scope: ["markup.italic"],
|
|
200
|
+
settings: { fontStyle: "italic" },
|
|
201
|
+
},
|
|
202
|
+
// Markup Link — #0E3088
|
|
203
|
+
{
|
|
204
|
+
name: "Markup Link",
|
|
205
|
+
scope: ["markup.underline.link", "string.other.link"],
|
|
206
|
+
settings: { foreground: "#0E3088" },
|
|
207
|
+
},
|
|
208
|
+
// Diff Added — #1B5500
|
|
209
|
+
{
|
|
210
|
+
name: "Diff Added",
|
|
211
|
+
scope: ["markup.inserted"],
|
|
212
|
+
settings: { foreground: "#1B5500" },
|
|
213
|
+
},
|
|
214
|
+
// Diff Deleted — #D42010
|
|
215
|
+
{
|
|
216
|
+
name: "Diff Deleted",
|
|
217
|
+
scope: ["markup.deleted"],
|
|
218
|
+
settings: { foreground: "#D42010" },
|
|
219
|
+
},
|
|
220
|
+
// Diff Changed — #946000
|
|
221
|
+
{
|
|
222
|
+
name: "Diff Changed",
|
|
223
|
+
scope: ["markup.changed"],
|
|
224
|
+
settings: { foreground: "#946000" },
|
|
225
|
+
},
|
|
226
|
+
],
|
|
227
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// Block discriminated union — the closed type system for cesium_publish structured input.
|
|
2
|
+
// src/render/blocks/types.ts
|
|
3
|
+
|
|
4
|
+
export type Block =
|
|
5
|
+
| HeroBlock
|
|
6
|
+
| TldrBlock
|
|
7
|
+
| SectionBlock
|
|
8
|
+
| ProseBlock
|
|
9
|
+
| ListBlock
|
|
10
|
+
| CalloutBlock
|
|
11
|
+
| CodeBlock
|
|
12
|
+
| TimelineBlock
|
|
13
|
+
| CompareTableBlock
|
|
14
|
+
| RiskTableBlock
|
|
15
|
+
| KvBlock
|
|
16
|
+
| PillRowBlock
|
|
17
|
+
| DividerBlock
|
|
18
|
+
| DiagramBlock
|
|
19
|
+
| RawHtmlBlock;
|
|
20
|
+
|
|
21
|
+
export type HeroBlock = {
|
|
22
|
+
type: "hero";
|
|
23
|
+
eyebrow?: string;
|
|
24
|
+
title: string;
|
|
25
|
+
subtitle?: string;
|
|
26
|
+
meta?: Array<{ k: string; v: string }>;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type TldrBlock = {
|
|
30
|
+
type: "tldr";
|
|
31
|
+
// markdown subset; at most one tldr per document
|
|
32
|
+
markdown: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type SectionBlock = {
|
|
36
|
+
type: "section";
|
|
37
|
+
title: string;
|
|
38
|
+
num?: string; // omitted = auto-numbered sequentially
|
|
39
|
+
eyebrow?: string;
|
|
40
|
+
children: Block[];
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type ProseBlock = {
|
|
44
|
+
type: "prose";
|
|
45
|
+
markdown: string;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type ListBlock = {
|
|
49
|
+
type: "list";
|
|
50
|
+
style?: "bullet" | "number" | "check";
|
|
51
|
+
items: string[]; // each item is markdown (subset)
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export type CalloutBlock = {
|
|
55
|
+
type: "callout";
|
|
56
|
+
variant: "note" | "warn" | "risk";
|
|
57
|
+
title?: string;
|
|
58
|
+
markdown: string;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export type CodeBlock = {
|
|
62
|
+
type: "code";
|
|
63
|
+
lang: string; // required; "text" if unknown
|
|
64
|
+
code: string;
|
|
65
|
+
filename?: string;
|
|
66
|
+
caption?: string;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export type TimelineBlock = {
|
|
70
|
+
type: "timeline";
|
|
71
|
+
items: Array<{ label: string; text: string; date?: string }>;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export type CompareTableBlock = {
|
|
75
|
+
type: "compare_table";
|
|
76
|
+
headers: string[];
|
|
77
|
+
rows: string[][]; // cells are markdown (subset)
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export type RiskTableBlock = {
|
|
81
|
+
type: "risk_table";
|
|
82
|
+
rows: Array<{
|
|
83
|
+
risk: string;
|
|
84
|
+
likelihood: "low" | "medium" | "high";
|
|
85
|
+
impact: "low" | "medium" | "high";
|
|
86
|
+
mitigation: string;
|
|
87
|
+
}>;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export type KvBlock = {
|
|
91
|
+
type: "kv";
|
|
92
|
+
rows: Array<{ k: string; v: string }>;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export type PillRowBlock = {
|
|
96
|
+
type: "pill_row";
|
|
97
|
+
items: Array<{ kind: "pill" | "tag"; text: string }>;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export type DividerBlock = {
|
|
101
|
+
type: "divider";
|
|
102
|
+
label?: string;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export type DiagramBlock = {
|
|
106
|
+
type: "diagram";
|
|
107
|
+
caption?: string;
|
|
108
|
+
// exactly one of svg or html
|
|
109
|
+
svg?: string;
|
|
110
|
+
html?: string;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export type RawHtmlBlock = {
|
|
114
|
+
type: "raw_html";
|
|
115
|
+
html: string;
|
|
116
|
+
purpose?: string; // brief reason; surfaced in critique findings
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// ─── BlockMeta ───────────────────────────────────────────────────────────────
|
|
120
|
+
|
|
121
|
+
export type BlockMeta = {
|
|
122
|
+
type: Block["type"];
|
|
123
|
+
description: string;
|
|
124
|
+
schema: object; // JSON Schema fragment for the block
|
|
125
|
+
example: Block; // canonical example matching schema
|
|
126
|
+
renderedExample?: string; // optional pre-rendered HTML for docs
|
|
127
|
+
};
|