@haklex/rich-renderer-mermaid 0.0.38 → 0.0.39
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/dist/index.mjs +403 -238
- package/dist/mermaid-theme.d.ts +26 -0
- package/dist/mermaid-theme.d.ts.map +1 -1
- package/dist/rich-renderer-mermaid.css +1 -1
- package/dist/static.d.ts +2 -0
- package/dist/static.d.ts.map +1 -0
- package/dist/svg-post-process.d.ts +3 -0
- package/dist/svg-post-process.d.ts.map +1 -0
- package/dist/useMermaidRender.d.ts.map +1 -1
- package/package.json +8 -4
package/dist/index.mjs
CHANGED
|
@@ -41,243 +41,404 @@ var editorFooter = "_36yqiey";
|
|
|
41
41
|
var footerActions = "_36yqie12";
|
|
42
42
|
var footerBtnCancel = "_36yqie14 _36yqie13";
|
|
43
43
|
var footerBtnSave = "_36yqie15 _36yqie13";
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
secondaryColor: "#fafafa",
|
|
55
|
-
secondaryTextColor: "#171717",
|
|
56
|
-
secondaryBorderColor: "#e5e5e5",
|
|
57
|
-
tertiaryColor: "#f0f0f0",
|
|
58
|
-
tertiaryTextColor: "#262626",
|
|
59
|
-
tertiaryBorderColor: "#d4d4d4",
|
|
60
|
-
noteBkgColor: "#fafafa",
|
|
61
|
-
noteTextColor: "#0a0a0a",
|
|
62
|
-
noteBorderColor: "#e5e5e5",
|
|
63
|
-
lineColor: "#a3a3a3",
|
|
64
|
-
textColor: "#0a0a0a",
|
|
65
|
-
mainBkg: "#f5f5f5",
|
|
66
|
-
nodeBorder: "#d4d4d4",
|
|
67
|
-
nodeTextColor: "#0a0a0a",
|
|
68
|
-
clusterBkg: "#fafafa",
|
|
69
|
-
clusterBorder: "#e5e5e5",
|
|
70
|
-
titleColor: "#0a0a0a",
|
|
71
|
-
labelColor: "#0a0a0a",
|
|
72
|
-
altBackground: "#fafafa",
|
|
73
|
-
fillType0: "#f5f5f5",
|
|
74
|
-
fillType1: "#fafafa",
|
|
75
|
-
fillType2: "#f0f0f0",
|
|
76
|
-
fillType3: "#e5e5e5",
|
|
77
|
-
fillType4: "#d4d4d4",
|
|
78
|
-
fillType5: "#fafafa",
|
|
79
|
-
fillType6: "#f5f5f5",
|
|
80
|
-
fillType7: "#f0f0f0",
|
|
81
|
-
actorBkg: "#f5f5f5",
|
|
82
|
-
actorBorder: "#d4d4d4",
|
|
83
|
-
actorTextColor: "#0a0a0a",
|
|
84
|
-
actorLineColor: "#a3a3a3",
|
|
85
|
-
signalColor: "#0a0a0a",
|
|
86
|
-
signalTextColor: "#0a0a0a",
|
|
87
|
-
labelBoxBkgColor: "#f5f5f5",
|
|
88
|
-
labelBoxBorderColor: "#d4d4d4",
|
|
89
|
-
labelTextColor: "#0a0a0a",
|
|
90
|
-
loopTextColor: "#0a0a0a",
|
|
91
|
-
activationBorderColor: "#a3a3a3",
|
|
92
|
-
activationBkgColor: "#e5e5e5",
|
|
93
|
-
sequenceNumberColor: "#ffffff",
|
|
94
|
-
git0: "#0a0a0a",
|
|
95
|
-
git1: "#525252",
|
|
96
|
-
git2: "#737373",
|
|
97
|
-
git3: "#a3a3a3",
|
|
98
|
-
git4: "#d4d4d4",
|
|
99
|
-
git5: "#e5e5e5",
|
|
100
|
-
git6: "#f5f5f5",
|
|
101
|
-
git7: "#fafafa",
|
|
102
|
-
gitBranchLabel0: "#ffffff",
|
|
103
|
-
gitBranchLabel1: "#ffffff",
|
|
104
|
-
gitBranchLabel2: "#ffffff",
|
|
105
|
-
gitBranchLabel3: "#0a0a0a",
|
|
106
|
-
gitInv0: "#ffffff",
|
|
107
|
-
pie1: "#0a0a0a",
|
|
108
|
-
pie2: "#404040",
|
|
109
|
-
pie3: "#737373",
|
|
110
|
-
pie4: "#a3a3a3",
|
|
111
|
-
pie5: "#d4d4d4",
|
|
112
|
-
pie6: "#e5e5e5",
|
|
113
|
-
pie7: "#f0f0f0",
|
|
114
|
-
pie8: "#f5f5f5",
|
|
115
|
-
pie9: "#fafafa",
|
|
116
|
-
pie10: "#ffffff",
|
|
117
|
-
pie11: "#525252",
|
|
118
|
-
pie12: "#888888",
|
|
119
|
-
pieTitleTextColor: "#0a0a0a",
|
|
120
|
-
pieSectionTextColor: "#ffffff",
|
|
121
|
-
pieLegendTextColor: "#0a0a0a",
|
|
122
|
-
pieLegendTextSize: MERMAID_FONT_SIZE,
|
|
123
|
-
pieStrokeColor: "#ffffff",
|
|
124
|
-
pieStrokeWidth: "2px",
|
|
125
|
-
classText: "#0a0a0a",
|
|
126
|
-
sectionBkgColor: "#f5f5f5",
|
|
127
|
-
altSectionBkgColor: "#fafafa",
|
|
128
|
-
sectionBkgColor2: "#f0f0f0",
|
|
129
|
-
taskBkgColor: "#e5e5e5",
|
|
130
|
-
taskTextColor: "#0a0a0a",
|
|
131
|
-
taskTextLightColor: "#0a0a0a",
|
|
132
|
-
taskTextOutsideColor: "#0a0a0a",
|
|
133
|
-
activeTaskBkgColor: "#d4d4d4",
|
|
134
|
-
activeTaskBorderColor: "#a3a3a3",
|
|
135
|
-
gridColor: "#e5e5e5",
|
|
136
|
-
doneTaskBkgColor: "#d4d4d4",
|
|
137
|
-
doneTaskBorderColor: "#a3a3a3",
|
|
138
|
-
critBkgColor: "#0a0a0a",
|
|
139
|
-
critBorderColor: "#0a0a0a",
|
|
140
|
-
todayLineColor: "#0a0a0a",
|
|
141
|
-
requirementBackground: "#f5f5f5",
|
|
142
|
-
requirementBorderColor: "#d4d4d4",
|
|
143
|
-
requirementBorderSize: "1px",
|
|
144
|
-
requirementTextColor: "#0a0a0a",
|
|
145
|
-
relationColor: "#a3a3a3",
|
|
146
|
-
relationLabelBackground: "#ffffff",
|
|
147
|
-
relationLabelColor: "#0a0a0a",
|
|
148
|
-
edgeLabelBackground: "#ffffff",
|
|
149
|
-
cScale0: "#f5f5f5",
|
|
150
|
-
cScale1: "#e5e5e5",
|
|
151
|
-
cScale2: "#d4d4d4",
|
|
152
|
-
cScale3: "#a3a3a3",
|
|
153
|
-
cScale4: "#737373",
|
|
154
|
-
cScale5: "#525252",
|
|
155
|
-
cScale6: "#404040",
|
|
156
|
-
cScale7: "#262626",
|
|
157
|
-
cScale8: "#171717",
|
|
158
|
-
cScale9: "#0a0a0a",
|
|
159
|
-
cScaleLabel0: "#0a0a0a",
|
|
160
|
-
cScaleLabel2: "#0a0a0a"
|
|
161
|
-
}
|
|
44
|
+
const MIX = {
|
|
45
|
+
textSec: 60,
|
|
46
|
+
textMuted: 40,
|
|
47
|
+
textFaint: 25,
|
|
48
|
+
line: 50,
|
|
49
|
+
arrow: 85,
|
|
50
|
+
nodeFill: 3,
|
|
51
|
+
nodeStroke: 20,
|
|
52
|
+
groupHeader: 5,
|
|
53
|
+
innerStroke: 12
|
|
162
54
|
};
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
55
|
+
function parseHex(hex) {
|
|
56
|
+
return [
|
|
57
|
+
Number.parseInt(hex.slice(1, 3), 16),
|
|
58
|
+
Number.parseInt(hex.slice(3, 5), 16),
|
|
59
|
+
Number.parseInt(hex.slice(5, 7), 16)
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
function toHex(r, g, b) {
|
|
63
|
+
const clamp = (v) => Math.round(Math.max(0, Math.min(255, v)));
|
|
64
|
+
return `#${clamp(r).toString(16).padStart(2, "0")}${clamp(g).toString(16).padStart(2, "0")}${clamp(b).toString(16).padStart(2, "0")}`;
|
|
65
|
+
}
|
|
66
|
+
function mix(fg, bg, percent) {
|
|
67
|
+
const [fR, fG, fB] = parseHex(fg);
|
|
68
|
+
const [bR, bG, bB] = parseHex(bg);
|
|
69
|
+
const p = percent / 100;
|
|
70
|
+
return toHex(
|
|
71
|
+
fR * p + bR * (1 - p),
|
|
72
|
+
fG * p + bG * (1 - p),
|
|
73
|
+
fB * p + bB * (1 - p)
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
function deriveTokens(bg, fg) {
|
|
77
|
+
return {
|
|
78
|
+
bg,
|
|
79
|
+
fg,
|
|
80
|
+
line: mix(fg, bg, MIX.line),
|
|
81
|
+
arrow: mix(fg, bg, MIX.arrow),
|
|
82
|
+
nodeFill: mix(fg, bg, MIX.nodeFill),
|
|
83
|
+
nodeStroke: mix(fg, bg, MIX.nodeStroke),
|
|
84
|
+
groupHeader: mix(fg, bg, MIX.groupHeader),
|
|
85
|
+
innerStroke: mix(fg, bg, MIX.innerStroke),
|
|
86
|
+
textSec: mix(fg, bg, MIX.textSec),
|
|
87
|
+
textMuted: mix(fg, bg, MIX.textMuted),
|
|
88
|
+
textFaint: mix(fg, bg, MIX.textFaint)
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function buildTheme(bg, fg) {
|
|
92
|
+
const t = deriveTokens(bg, fg);
|
|
93
|
+
return {
|
|
94
|
+
theme: "base",
|
|
95
|
+
themeVariables: {
|
|
96
|
+
background: t.bg,
|
|
97
|
+
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
98
|
+
fontSize: "14px",
|
|
99
|
+
primaryColor: t.nodeFill,
|
|
100
|
+
primaryTextColor: t.fg,
|
|
101
|
+
primaryBorderColor: t.nodeStroke,
|
|
102
|
+
secondaryColor: t.nodeFill,
|
|
103
|
+
secondaryTextColor: t.fg,
|
|
104
|
+
secondaryBorderColor: t.innerStroke,
|
|
105
|
+
tertiaryColor: t.groupHeader,
|
|
106
|
+
tertiaryTextColor: t.fg,
|
|
107
|
+
tertiaryBorderColor: t.innerStroke,
|
|
108
|
+
noteBkgColor: t.nodeFill,
|
|
109
|
+
noteTextColor: t.fg,
|
|
110
|
+
noteBorderColor: t.innerStroke,
|
|
111
|
+
lineColor: t.line,
|
|
112
|
+
textColor: t.fg,
|
|
113
|
+
mainBkg: t.nodeFill,
|
|
114
|
+
nodeBorder: t.nodeStroke,
|
|
115
|
+
nodeTextColor: t.fg,
|
|
116
|
+
clusterBkg: t.bg,
|
|
117
|
+
clusterBorder: t.nodeStroke,
|
|
118
|
+
titleColor: t.fg,
|
|
119
|
+
labelColor: t.fg,
|
|
120
|
+
altBackground: t.nodeFill,
|
|
121
|
+
fillType0: t.nodeFill,
|
|
122
|
+
fillType1: t.groupHeader,
|
|
123
|
+
fillType2: mix(fg, bg, 7),
|
|
124
|
+
fillType3: t.innerStroke,
|
|
125
|
+
fillType4: t.nodeStroke,
|
|
126
|
+
fillType5: t.groupHeader,
|
|
127
|
+
fillType6: t.nodeFill,
|
|
128
|
+
fillType7: mix(fg, bg, 7),
|
|
129
|
+
// Sequence diagram
|
|
130
|
+
actorBkg: t.nodeFill,
|
|
131
|
+
actorBorder: t.nodeStroke,
|
|
132
|
+
actorTextColor: t.fg,
|
|
133
|
+
actorLineColor: t.line,
|
|
134
|
+
signalColor: t.fg,
|
|
135
|
+
signalTextColor: t.fg,
|
|
136
|
+
labelBoxBkgColor: t.nodeFill,
|
|
137
|
+
labelBoxBorderColor: t.nodeStroke,
|
|
138
|
+
labelTextColor: t.fg,
|
|
139
|
+
loopTextColor: t.fg,
|
|
140
|
+
activationBorderColor: t.line,
|
|
141
|
+
activationBkgColor: t.innerStroke,
|
|
142
|
+
sequenceNumberColor: t.bg,
|
|
143
|
+
// Git graph
|
|
144
|
+
git0: t.fg,
|
|
145
|
+
git1: t.line,
|
|
146
|
+
git2: t.textMuted,
|
|
147
|
+
git3: t.textFaint,
|
|
148
|
+
git4: t.nodeStroke,
|
|
149
|
+
git5: t.innerStroke,
|
|
150
|
+
git6: t.groupHeader,
|
|
151
|
+
git7: t.nodeFill,
|
|
152
|
+
gitBranchLabel0: t.bg,
|
|
153
|
+
gitBranchLabel1: t.bg,
|
|
154
|
+
gitBranchLabel2: t.bg,
|
|
155
|
+
gitBranchLabel3: t.fg,
|
|
156
|
+
gitInv0: t.bg,
|
|
157
|
+
// Pie chart
|
|
158
|
+
pie1: t.fg,
|
|
159
|
+
pie2: mix(fg, bg, 80),
|
|
160
|
+
pie3: t.line,
|
|
161
|
+
pie4: t.textMuted,
|
|
162
|
+
pie5: t.nodeStroke,
|
|
163
|
+
pie6: t.innerStroke,
|
|
164
|
+
pie7: mix(fg, bg, 7),
|
|
165
|
+
pie8: t.groupHeader,
|
|
166
|
+
pie9: t.nodeFill,
|
|
167
|
+
pie10: t.bg,
|
|
168
|
+
pie11: t.textSec,
|
|
169
|
+
pie12: t.arrow,
|
|
170
|
+
pieTitleTextColor: t.fg,
|
|
171
|
+
pieSectionTextColor: t.bg,
|
|
172
|
+
pieLegendTextColor: t.fg,
|
|
173
|
+
pieLegendTextSize: "14px",
|
|
174
|
+
pieStrokeColor: t.bg,
|
|
175
|
+
pieStrokeWidth: "2px",
|
|
176
|
+
classText: t.fg,
|
|
177
|
+
// Gantt / timeline
|
|
178
|
+
sectionBkgColor: t.nodeFill,
|
|
179
|
+
altSectionBkgColor: t.groupHeader,
|
|
180
|
+
sectionBkgColor2: mix(fg, bg, 7),
|
|
181
|
+
taskBkgColor: t.innerStroke,
|
|
182
|
+
taskTextColor: t.fg,
|
|
183
|
+
taskTextLightColor: t.fg,
|
|
184
|
+
taskTextOutsideColor: t.fg,
|
|
185
|
+
activeTaskBkgColor: t.nodeStroke,
|
|
186
|
+
activeTaskBorderColor: t.line,
|
|
187
|
+
gridColor: t.innerStroke,
|
|
188
|
+
doneTaskBkgColor: t.nodeStroke,
|
|
189
|
+
doneTaskBorderColor: t.line,
|
|
190
|
+
critBkgColor: t.fg,
|
|
191
|
+
critBorderColor: t.fg,
|
|
192
|
+
todayLineColor: t.fg,
|
|
193
|
+
// Requirement diagram
|
|
194
|
+
requirementBackground: t.nodeFill,
|
|
195
|
+
requirementBorderColor: t.nodeStroke,
|
|
196
|
+
requirementBorderSize: "1px",
|
|
197
|
+
requirementTextColor: t.fg,
|
|
198
|
+
relationColor: t.line,
|
|
199
|
+
relationLabelBackground: t.bg,
|
|
200
|
+
relationLabelColor: t.fg,
|
|
201
|
+
edgeLabelBackground: t.bg,
|
|
202
|
+
// Color scales
|
|
203
|
+
cScale0: t.nodeFill,
|
|
204
|
+
cScale1: t.innerStroke,
|
|
205
|
+
cScale2: t.nodeStroke,
|
|
206
|
+
cScale3: t.textMuted,
|
|
207
|
+
cScale4: t.line,
|
|
208
|
+
cScale5: t.textSec,
|
|
209
|
+
cScale6: mix(fg, bg, 70),
|
|
210
|
+
cScale7: mix(fg, bg, 80),
|
|
211
|
+
cScale8: t.arrow,
|
|
212
|
+
cScale9: t.fg,
|
|
213
|
+
cScaleLabel0: t.fg,
|
|
214
|
+
cScaleLabel2: t.fg
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
const lightTheme = buildTheme("#ffffff", "#27272a");
|
|
219
|
+
const darkTheme = buildTheme("#18181b", "#fafafa");
|
|
220
|
+
const lightTokens = deriveTokens("#ffffff", "#27272a");
|
|
221
|
+
const darkTokens = deriveTokens("#18181b", "#fafafa");
|
|
222
|
+
const CORNER_RADIUS = {
|
|
223
|
+
node: 5,
|
|
224
|
+
classNode: 4,
|
|
225
|
+
entity: 5,
|
|
226
|
+
subgraphOuter: 7,
|
|
227
|
+
actor: 6,
|
|
228
|
+
activation: 4
|
|
280
229
|
};
|
|
230
|
+
function applyCornerRounding(doc) {
|
|
231
|
+
const applyRadius = (selector, radius) => {
|
|
232
|
+
const rects = doc.querySelectorAll(selector);
|
|
233
|
+
for (const rect of rects) {
|
|
234
|
+
rect.setAttribute("rx", String(radius));
|
|
235
|
+
rect.setAttribute("ry", String(radius));
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
applyRadius(".node > rect", CORNER_RADIUS.node);
|
|
239
|
+
applyRadius(".node > .basic", CORNER_RADIUS.node);
|
|
240
|
+
applyRadius(".classGroup > rect", CORNER_RADIUS.classNode);
|
|
241
|
+
applyRadius(".er > rect", CORNER_RADIUS.entity);
|
|
242
|
+
applyRadius(".cluster > rect", CORNER_RADIUS.subgraphOuter);
|
|
243
|
+
applyRadius(".actor", CORNER_RADIUS.actor);
|
|
244
|
+
applyRadius(
|
|
245
|
+
".activation0, .activation1, .activation2",
|
|
246
|
+
CORNER_RADIUS.activation
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
function buildVisualCss(tokens) {
|
|
250
|
+
return `
|
|
251
|
+
/* beautiful-mermaid inspired visual overrides */
|
|
252
|
+
|
|
253
|
+
/* Edge styling: rounded linecaps for clean connections */
|
|
254
|
+
.edgePath path.path,
|
|
255
|
+
.flowchart-link,
|
|
256
|
+
line[class*="messageLine"] {
|
|
257
|
+
stroke-linecap: round !important;
|
|
258
|
+
stroke-linejoin: round !important;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/* Cluster/subgraph "soft" styling */
|
|
262
|
+
.cluster > rect {
|
|
263
|
+
fill: ${tokens.nodeFill} !important;
|
|
264
|
+
fill-opacity: 0.96 !important;
|
|
265
|
+
stroke: ${tokens.nodeStroke} !important;
|
|
266
|
+
stroke-width: 1px !important;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/* Cluster title */
|
|
270
|
+
.cluster text,
|
|
271
|
+
.cluster .nodeLabel {
|
|
272
|
+
fill: ${tokens.textSec} !important;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/* Node stroke consistency */
|
|
276
|
+
.node rect,
|
|
277
|
+
.node circle,
|
|
278
|
+
.node ellipse,
|
|
279
|
+
.node polygon,
|
|
280
|
+
.node .basic {
|
|
281
|
+
stroke: ${tokens.nodeStroke} !important;
|
|
282
|
+
stroke-width: 1px !important;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/* Node fill */
|
|
286
|
+
.node rect,
|
|
287
|
+
.node .basic {
|
|
288
|
+
fill: ${tokens.nodeFill} !important;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/* Edge label "subtle" styling */
|
|
292
|
+
.edgeLabel rect,
|
|
293
|
+
.labelBkg {
|
|
294
|
+
rx: 5 !important;
|
|
295
|
+
ry: 5 !important;
|
|
296
|
+
fill: ${tokens.bg} !important;
|
|
297
|
+
stroke: ${tokens.innerStroke} !important;
|
|
298
|
+
stroke-width: 1px !important;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.edgeLabel text,
|
|
302
|
+
.edgeLabel .edgeLabel {
|
|
303
|
+
fill: ${tokens.textMuted} !important;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/* Arrow heads */
|
|
307
|
+
marker path {
|
|
308
|
+
fill: ${tokens.arrow} !important;
|
|
309
|
+
stroke: ${tokens.arrow} !important;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/* Edge paths */
|
|
313
|
+
.edgePath path.path {
|
|
314
|
+
stroke: ${tokens.line} !important;
|
|
315
|
+
stroke-width: 1px !important;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/* Sequence diagram refinements */
|
|
319
|
+
.actor {
|
|
320
|
+
fill: ${tokens.nodeFill} !important;
|
|
321
|
+
stroke: ${tokens.nodeStroke} !important;
|
|
322
|
+
stroke-width: 1px !important;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.messageLine0,
|
|
326
|
+
.messageLine1 {
|
|
327
|
+
stroke: ${tokens.line} !important;
|
|
328
|
+
stroke-width: 1px !important;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.messageText {
|
|
332
|
+
fill: ${tokens.fg} !important;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.loopLine {
|
|
336
|
+
stroke: ${tokens.innerStroke} !important;
|
|
337
|
+
stroke-width: 1px !important;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.labelBox {
|
|
341
|
+
fill: ${tokens.nodeFill} !important;
|
|
342
|
+
stroke: ${tokens.nodeStroke} !important;
|
|
343
|
+
stroke-width: 1px !important;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.loopText tspan,
|
|
347
|
+
.loopText {
|
|
348
|
+
fill: ${tokens.textSec} !important;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/* Activation bars */
|
|
352
|
+
.activation0,
|
|
353
|
+
.activation1,
|
|
354
|
+
.activation2 {
|
|
355
|
+
fill: ${tokens.innerStroke} !important;
|
|
356
|
+
stroke: ${tokens.line} !important;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/* Note styling */
|
|
360
|
+
.note {
|
|
361
|
+
fill: ${tokens.nodeFill} !important;
|
|
362
|
+
stroke: ${tokens.innerStroke} !important;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.noteText {
|
|
366
|
+
fill: ${tokens.fg} !important;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/* Inner divider lines */
|
|
370
|
+
.divider {
|
|
371
|
+
stroke: ${tokens.innerStroke} !important;
|
|
372
|
+
stroke-width: 0.75px !important;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/* Class diagram */
|
|
376
|
+
.classGroup rect {
|
|
377
|
+
fill: ${tokens.nodeFill} !important;
|
|
378
|
+
stroke: ${tokens.nodeStroke} !important;
|
|
379
|
+
stroke-width: 1px !important;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.classGroup line {
|
|
383
|
+
stroke: ${tokens.innerStroke} !important;
|
|
384
|
+
stroke-width: 0.75px !important;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.classGroup text {
|
|
388
|
+
fill: ${tokens.fg} !important;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.classLabel .box {
|
|
392
|
+
fill: ${tokens.groupHeader} !important;
|
|
393
|
+
stroke: ${tokens.nodeStroke} !important;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.relation {
|
|
397
|
+
stroke: ${tokens.line} !important;
|
|
398
|
+
stroke-width: 1px !important;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/* State diagram */
|
|
402
|
+
.stateGroup rect,
|
|
403
|
+
.statediagram-state rect {
|
|
404
|
+
fill: ${tokens.nodeFill} !important;
|
|
405
|
+
stroke: ${tokens.nodeStroke} !important;
|
|
406
|
+
stroke-width: 1px !important;
|
|
407
|
+
rx: 5 !important;
|
|
408
|
+
ry: 5 !important;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.stateGroup text {
|
|
412
|
+
fill: ${tokens.fg} !important;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/* Git graph */
|
|
416
|
+
.commit-id text {
|
|
417
|
+
fill: ${tokens.textMuted} !important;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
`;
|
|
421
|
+
}
|
|
422
|
+
function postProcessMermaidSvg(svg, tokens) {
|
|
423
|
+
const parser = new DOMParser();
|
|
424
|
+
const doc = parser.parseFromString(svg, "image/svg+xml");
|
|
425
|
+
const parseError = doc.querySelector("parsererror");
|
|
426
|
+
if (parseError) return svg;
|
|
427
|
+
const root = doc.documentElement;
|
|
428
|
+
if (!root || root.tagName.toLowerCase() !== "svg") return svg;
|
|
429
|
+
applyCornerRounding(doc);
|
|
430
|
+
const existingOverride = root.querySelector("style[data-visual-overrides]");
|
|
431
|
+
existingOverride?.remove();
|
|
432
|
+
const styleEl = doc.createElementNS("http://www.w3.org/2000/svg", "style");
|
|
433
|
+
styleEl.dataset.visualOverrides = "";
|
|
434
|
+
styleEl.textContent = buildVisualCss(tokens);
|
|
435
|
+
if (root.firstChild) {
|
|
436
|
+
root.insertBefore(styleEl, root.firstChild);
|
|
437
|
+
} else {
|
|
438
|
+
root.append(styleEl);
|
|
439
|
+
}
|
|
440
|
+
return new XMLSerializer().serializeToString(root);
|
|
441
|
+
}
|
|
281
442
|
function useMermaidRender(content, preferredColorScheme) {
|
|
282
443
|
const [loading, setLoading] = useState(true);
|
|
283
444
|
const [error, setError] = useState("");
|
|
@@ -295,6 +456,7 @@ function useMermaidRender(content, preferredColorScheme) {
|
|
|
295
456
|
import("mermaid").then(async (mo) => {
|
|
296
457
|
const mermaid = mo.default;
|
|
297
458
|
const themeConfig = effectiveColorScheme === "dark" ? darkTheme : lightTheme;
|
|
459
|
+
const tokens = effectiveColorScheme === "dark" ? darkTokens : lightTokens;
|
|
298
460
|
mermaid.initialize({
|
|
299
461
|
startOnLoad: false,
|
|
300
462
|
theme: themeConfig.theme,
|
|
@@ -303,7 +465,9 @@ function useMermaidRender(content, preferredColorScheme) {
|
|
|
303
465
|
flowchart: {
|
|
304
466
|
htmlLabels: true,
|
|
305
467
|
curve: "basis",
|
|
306
|
-
padding:
|
|
468
|
+
padding: 20,
|
|
469
|
+
nodeSpacing: 24,
|
|
470
|
+
rankSpacing: 48
|
|
307
471
|
},
|
|
308
472
|
sequence: {
|
|
309
473
|
actorMargin: 80,
|
|
@@ -329,8 +493,9 @@ function useMermaidRender(content, preferredColorScheme) {
|
|
|
329
493
|
}
|
|
330
494
|
if (cancelled) return;
|
|
331
495
|
if (result) {
|
|
332
|
-
|
|
333
|
-
|
|
496
|
+
const processedSvg = postProcessMermaidSvg(result.svg, tokens);
|
|
497
|
+
setSvg(processedSvg);
|
|
498
|
+
const match = processedSvg.match(/viewBox="[^"]*\s([\d.]+)\s([\d.]+)"/);
|
|
334
499
|
if (match?.[1] && match?.[2]) {
|
|
335
500
|
setWidth(Number.parseInt(match[1]));
|
|
336
501
|
setHeight(Number.parseInt(match[2]));
|
package/dist/mermaid-theme.d.ts
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mermaid theme system inspired by beautiful-mermaid (lukilabs/beautiful-mermaid).
|
|
3
|
+
*
|
|
4
|
+
* Architecture:
|
|
5
|
+
* - Two base colors: bg (background) + fg (foreground)
|
|
6
|
+
* - All derived colors computed via color-mix ratios from bg + fg
|
|
7
|
+
* - Produces a coherent mono hierarchy on any bg/fg combination
|
|
8
|
+
*
|
|
9
|
+
* @see https://github.com/lukilabs/beautiful-mermaid/blob/main/src/theme.ts
|
|
10
|
+
*/
|
|
1
11
|
interface MermaidThemeConfig {
|
|
2
12
|
theme: 'base';
|
|
3
13
|
themeVariables: Record<string, string>;
|
|
4
14
|
}
|
|
15
|
+
export interface ThemeTokens {
|
|
16
|
+
bg: string;
|
|
17
|
+
fg: string;
|
|
18
|
+
line: string;
|
|
19
|
+
arrow: string;
|
|
20
|
+
nodeFill: string;
|
|
21
|
+
nodeStroke: string;
|
|
22
|
+
groupHeader: string;
|
|
23
|
+
innerStroke: string;
|
|
24
|
+
textSec: string;
|
|
25
|
+
textMuted: string;
|
|
26
|
+
textFaint: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function deriveTokens(bg: string, fg: string): ThemeTokens;
|
|
5
29
|
export declare const lightTheme: MermaidThemeConfig;
|
|
6
30
|
export declare const darkTheme: MermaidThemeConfig;
|
|
31
|
+
export declare const lightTokens: ThemeTokens;
|
|
32
|
+
export declare const darkTokens: ThemeTokens;
|
|
7
33
|
export {};
|
|
8
34
|
//# sourceMappingURL=mermaid-theme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mermaid-theme.d.ts","sourceRoot":"","sources":["../src/mermaid-theme.ts"],"names":[],"mappings":"AAAA,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACvC;
|
|
1
|
+
{"version":3,"file":"mermaid-theme.d.ts","sourceRoot":"","sources":["../src/mermaid-theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACvC;AAwCD,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,WAAW,CAchE;AAqJD,eAAO,MAAM,UAAU,oBAAmC,CAAA;AAG1D,eAAO,MAAM,SAAS,oBAAmC,CAAA;AAEzD,eAAO,MAAM,WAAW,aAAqC,CAAA;AAC7D,eAAO,MAAM,UAAU,aAAqC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}:root.dark{--rc-text: #fafafa;--rc-text-secondary: #a1a1aa;--rc-text-tertiary: #71717a;--rc-text-quaternary: #52525b;--rc-bg: #09090b;--rc-bg-secondary: #18181b;--rc-bg-tertiary: #27272a;--rc-border: #27272a;--rc-accent: #60a5fa;--rc-accent-light: #60a5fa20;--rc-link: #60a5fa;--rc-code-text: #e4e4e7;--rc-code-bg: #27272a;--rc-hr-border: #27272a;--rc-quote-border: #60a5fa;--rc-quote-bg: #1e3a5f;--rc-alert-info: #7db9e5;--rc-alert-warning: #da864a;--rc-alert-tip: #54da48;--rc-alert-caution: #e16973;--rc-alert-important: #9966e0;--rc-max-width: 700px;--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}._165ss5a0{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}._165ss5a1{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.8;--rc-line-height-tight: 1.4;--rc-font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}._165ss5a2{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #a1a1aa;--rc-quote-bg: #fafafa;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: none;--rc-space-xs: 2px;--rc-space-sm: 4px;--rc-space-md: 10px;--rc-space-lg: 16px;--rc-space-xl: 20px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 14px;--rc-font-size-small: 12px;--rc-line-height: 1.5;--rc-line-height-tight: 1.3;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 3px;--rc-radius-md: 6px;--rc-radius-lg: 8px}.dark ._165ss5a0,[data-theme=dark] ._165ss5a0,.dark._165ss5a0,[data-theme=dark]._165ss5a0,.dark ._165ss5a1,[data-theme=dark] ._165ss5a1,.dark._165ss5a1,[data-theme=dark]._165ss5a1,.dark ._165ss5a2,[data-theme=dark] ._165ss5a2,.dark._165ss5a2,[data-theme=dark]._165ss5a2{--rc-text: #fafafa;--rc-text-secondary: #a1a1aa;--rc-text-tertiary: #71717a;--rc-text-quaternary: #52525b;--rc-bg: #09090b;--rc-bg-secondary: #18181b;--rc-bg-tertiary: #27272a;--rc-border: #27272a;--rc-accent: #60a5fa;--rc-accent-light: #60a5fa20;--rc-link: #60a5fa;--rc-code-text: #e4e4e7;--rc-code-bg: #27272a;--rc-hr-border: #27272a;--rc-quote-border: #60a5fa;--rc-quote-bg: #1e3a5f;--rc-alert-info: #7db9e5;--rc-alert-warning: #da864a;--rc-alert-tip: #54da48;--rc-alert-caution: #e16973;--rc-alert-important: #9966e0}@keyframes _36yqie5{to{transform:rotate(360deg)}}._36yqie0{display:flex;flex-direction:column;align-items:center;margin:1rem 0;position:relative;overflow:hidden;cursor:grab}._36yqie0:active{cursor:grabbing}._36yqie0 img{max-width:100%;height:auto}._36yqie1{position:absolute;top:8px;right:8px;padding:2px 8px;border-radius:4px;font-size:var(--rc-font-size-xs);color:var(--rc-text-secondary);background-color:color-mix(in srgb,var(--rc-bg) 80%,transparent);backdrop-filter:blur(4px);opacity:0;transition:opacity .2s;cursor:pointer;z-index:2}._36yqie1:hover{color:var(--rc-text);background-color:color-mix(in srgb,var(--rc-bg) 95%,transparent)}._36yqie0:hover ._36yqie1{opacity:1}._36yqie2{position:absolute;bottom:8px;right:8px;display:flex;gap:2px;opacity:0;transition:opacity .2s;z-index:2}._36yqie0:hover ._36yqie2{opacity:1}._36yqie3{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:.25rem;border:none;cursor:pointer;color:var(--rc-text-secondary);background-color:color-mix(in srgb,var(--rc-bg) 80%,transparent);backdrop-filter:blur(4px);transition:color .15s,background-color .15s}._36yqie3:hover{color:var(--rc-text);background-color:color-mix(in srgb,var(--rc-bg) 95%,transparent)}._36yqie4{display:flex;align-items:center;justify-content:center;min-height:80px;color:var(--rc-text-secondary);font-size:var(--rc-font-size-md)}._36yqie4:after{content:"";display:inline-block;width:16px;height:16px;margin-left:8px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:_36yqie5 .6s linear infinite}._36yqie6{display:flex;align-items:center;justify-content:center;min-height:50px;padding:.75rem 1rem;border-radius:.5rem;background-color:color-mix(in srgb,var(--rc-alert-caution) 10%,transparent);color:var(--rc-alert-caution);font-size:var(--rc-font-size-md)}._36yqie7._36yqie7{padding:0;gap:0;display:flex;flex-direction:column;overflow:hidden;width:calc(100vw - 2rem);height:min(680px,85vh);border-radius:.5rem}._36yqie8{display:flex;align-items:center;justify-content:space-between;padding:0 1rem;height:48px;border-bottom:1px solid var(--rc-border);flex-shrink:0}._36yqie9{display:flex;align-items:center;gap:.75rem}._36yqiea{display:flex;align-items:center;gap:4px}._36yqieb{width:1px;height:16px;background-color:var(--rc-border);flex-shrink:0}._36yqiec{display:flex;align-items:center;gap:.5rem;font-size:var(--rc-font-size-md);font-weight:500;color:var(--rc-text)}._36yqied{padding:.25rem .5rem;font-size:var(--rc-font-size-xs);color:var(--rc-text-secondary);background:none;border:none;border-radius:.375rem;cursor:pointer;transition:color .15s,background-color .15s}._36yqied:hover{color:var(--rc-text);background-color:color-mix(in srgb,var(--rc-text) 5%,transparent)}._36yqiee{display:flex;align-items:center;background-color:color-mix(in srgb,var(--rc-text) 5%,transparent);border-radius:.375rem;padding:2px;margin-right:4px}._36yqief{display:inline-flex;align-items:center;justify-content:center;padding:4px;border-radius:.25rem;border:none;background:none;cursor:pointer;color:var(--rc-text-secondary);transition:color .15s,background-color .15s,box-shadow .15s}._36yqief:hover{color:var(--rc-text)}._36yqieg{background-color:var(--rc-bg);color:var(--rc-text);box-shadow:0 1px 2px #0000000d}._36yqieh{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:.25rem;border:none;background:none;cursor:pointer;color:var(--rc-text-secondary);transition:color .15s,background-color .15s}._36yqieh:hover{color:var(--rc-text);background-color:color-mix(in srgb,var(--rc-text) 5%,transparent)}._36yqiei{display:flex;flex:1;min-height:0}._36yqiej{display:flex;flex-direction:column;border-right:1px solid var(--rc-border)}._36yqiek{width:50%}._36yqiel{flex:1}._36yqiem{display:flex;align-items:center;padding:0 .75rem;height:32px;border-bottom:1px solid var(--rc-border);background-color:color-mix(in srgb,var(--rc-text) 2%,transparent);flex-shrink:0;font-size:var(--rc-font-size-xs);font-weight:500;color:var(--rc-text-secondary);text-transform:uppercase;letter-spacing:.05em}._36yqien{display:flex;flex-direction:column;flex:1}._36yqieo{display:flex;flex:1;min-height:0;align-items:center;justify-content:center;position:relative;overflow:hidden;cursor:grab}._36yqieo:active{cursor:grabbing}._36yqieo:hover ._36yqie2{opacity:1}._36yqieo img{max-width:100%;height:auto}._36yqiep{font-size:var(--rc-font-size-md);color:color-mix(in srgb,var(--rc-text-secondary) 50%,transparent)}._36yqieq{display:flex;flex-direction:column;align-items:center;gap:.75rem;max-width:320px;text-align:center}._36yqier{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:.375rem;background-color:color-mix(in srgb,var(--rc-alert-caution) 10%,transparent);color:var(--rc-alert-caution)}._36yqies{font-size:var(--rc-font-size-md);font-weight:500;color:var(--rc-text)}._36yqiet{font-size:var(--rc-font-size-xs);color:var(--rc-text-secondary);line-height:1.5;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}._36yqieu{position:relative;display:flex;flex:1;min-height:0;overflow:hidden;font-family:var(--rc-font-mono);font-size:var(--rc-font-size-sm);line-height:1.25rem}._36yqiev{flex-shrink:0;width:40px;overflow:hidden;user-select:none;border-right:1px solid var(--rc-border);background-color:color-mix(in srgb,var(--rc-text) 2%,transparent);padding:.75rem 0}._36yqiew{padding:0 .5rem;text-align:right;line-height:1.25rem;color:color-mix(in srgb,var(--rc-text-secondary) 40%,transparent)}._36yqiex{flex:1;resize:none;background-color:transparent;padding:.75rem;color:var(--rc-text);outline:none;border:none;line-height:1.25rem;font-family:var(--rc-font-mono);font-size:var(--rc-font-size-md);tab-size:2}._36yqiex::placeholder{color:color-mix(in srgb,var(--rc-text-secondary) 40%,transparent)}._36yqiey{display:flex;align-items:center;justify-content:flex-end;padding:0 1rem;height:44px;border-top:1px solid var(--rc-border);flex-shrink:0;background-color:color-mix(in srgb,var(--rc-text) 1.5%,transparent)}._36yqiez{display:flex;align-items:center;gap:.5rem}._36yqie10{width:6px;height:6px;border-radius:50%;background-color:var(--rc-alert-tip)}._36yqie11{font-size:var(--rc-font-size-xs);color:var(--rc-text-secondary)}._36yqie12{display:flex;align-items:center;gap:.5rem}._36yqie13{padding:.25rem .75rem;border-radius:.375rem;font-size:var(--rc-font-size-xs);font-weight:500;cursor:pointer;height:28px;transition:background-color .15s,border-color .15s}._36yqie14{background-color:transparent;color:var(--rc-text-secondary);border:1px solid var(--rc-border)}._36yqie14:hover{background-color:color-mix(in srgb,var(--rc-text) 4%,transparent)}._36yqie15{background-color:var(--rc-text);color:var(--rc-bg);border:1px solid transparent}._36yqie15:hover{background-color:color-mix(in srgb,var(--rc-text) 85%,transparent)}@media(min-width:640px){._36yqie7._36yqie7{max-width:64rem}}
|
|
1
|
+
:root{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}:root.dark{--rc-text: #fafafa;--rc-text-secondary: #a1a1aa;--rc-text-tertiary: #71717a;--rc-text-quaternary: #52525b;--rc-bg: #09090b;--rc-bg-secondary: #18181b;--rc-bg-tertiary: #27272a;--rc-border: #27272a;--rc-accent: #60a5fa;--rc-accent-light: #60a5fa20;--rc-link: #60a5fa;--rc-code-text: #e4e4e7;--rc-code-bg: #27272a;--rc-hr-border: #27272a;--rc-quote-border: #60a5fa;--rc-quote-bg: #1e3a5f;--rc-alert-info: #7db9e5;--rc-alert-warning: #da864a;--rc-alert-tip: #54da48;--rc-alert-caution: #e16973;--rc-alert-important: #9966e0;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -4px rgba(0,0,0,.35);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.25), 0 4px 16px rgba(0,0,0,.4);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}._165ss5a0{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}._165ss5a1{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.8;--rc-line-height-tight: 1.4;--rc-font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}._165ss5a2{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #a1a1aa;--rc-quote-bg: #fafafa;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: none;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 2px;--rc-space-sm: 4px;--rc-space-md: 10px;--rc-space-lg: 16px;--rc-space-xl: 20px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 14px;--rc-font-size-small: 12px;--rc-line-height: 1.5;--rc-line-height-tight: 1.3;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 3px;--rc-radius-md: 6px;--rc-radius-lg: 8px}.dark ._165ss5a0,[data-theme=dark] ._165ss5a0,.dark._165ss5a0,[data-theme=dark]._165ss5a0,.dark ._165ss5a1,[data-theme=dark] ._165ss5a1,.dark._165ss5a1,[data-theme=dark]._165ss5a1,.dark ._165ss5a2,[data-theme=dark] ._165ss5a2,.dark._165ss5a2,[data-theme=dark]._165ss5a2{--rc-text: #fafafa;--rc-text-secondary: #a1a1aa;--rc-text-tertiary: #71717a;--rc-text-quaternary: #52525b;--rc-bg: #09090b;--rc-bg-secondary: #18181b;--rc-bg-tertiary: #27272a;--rc-border: #27272a;--rc-accent: #60a5fa;--rc-accent-light: #60a5fa20;--rc-link: #60a5fa;--rc-code-text: #e4e4e7;--rc-code-bg: #27272a;--rc-hr-border: #27272a;--rc-quote-border: #60a5fa;--rc-quote-bg: #1e3a5f;--rc-alert-info: #7db9e5;--rc-alert-warning: #da864a;--rc-alert-tip: #54da48;--rc-alert-caution: #e16973;--rc-alert-important: #9966e0;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -4px rgba(0,0,0,.35);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.25), 0 4px 16px rgba(0,0,0,.4)}@keyframes _36yqie5{to{transform:rotate(360deg)}}._36yqie0{display:flex;flex-direction:column;align-items:center;margin:1rem 0;position:relative;overflow:hidden;cursor:grab}._36yqie0:active{cursor:grabbing}._36yqie0 img{max-width:100%;height:auto}._36yqie1{position:absolute;top:8px;right:8px;padding:2px 8px;border-radius:4px;font-size:var(--rc-font-size-xs);color:var(--rc-text-secondary);background-color:color-mix(in srgb,var(--rc-bg) 80%,transparent);backdrop-filter:blur(4px);opacity:0;transition:opacity .2s;cursor:pointer;z-index:2}._36yqie1:hover{color:var(--rc-text);background-color:color-mix(in srgb,var(--rc-bg) 95%,transparent)}._36yqie0:hover ._36yqie1{opacity:1}._36yqie2{position:absolute;bottom:8px;right:8px;display:flex;gap:2px;opacity:0;transition:opacity .2s;z-index:2}._36yqie0:hover ._36yqie2{opacity:1}._36yqie3{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:.25rem;border:none;cursor:pointer;color:var(--rc-text-secondary);background-color:color-mix(in srgb,var(--rc-bg) 80%,transparent);backdrop-filter:blur(4px);transition:color .15s,background-color .15s}._36yqie3:hover{color:var(--rc-text);background-color:color-mix(in srgb,var(--rc-bg) 95%,transparent)}._36yqie4{display:flex;align-items:center;justify-content:center;min-height:80px;color:var(--rc-text-secondary);font-size:var(--rc-font-size-md)}._36yqie4:after{content:"";display:inline-block;width:16px;height:16px;margin-left:8px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:_36yqie5 .6s linear infinite}._36yqie6{display:flex;align-items:center;justify-content:center;min-height:50px;padding:.75rem 1rem;border-radius:.5rem;background-color:color-mix(in srgb,var(--rc-alert-caution) 10%,transparent);color:var(--rc-alert-caution);font-size:var(--rc-font-size-md)}._36yqie7._36yqie7{padding:0;gap:0;display:flex;flex-direction:column;overflow:hidden;width:calc(100vw - 2rem);height:min(680px,85vh);border-radius:.5rem}._36yqie8{display:flex;align-items:center;justify-content:space-between;padding:0 1rem;height:48px;border-bottom:1px solid var(--rc-border);flex-shrink:0}._36yqie9{display:flex;align-items:center;gap:.75rem}._36yqiea{display:flex;align-items:center;gap:4px}._36yqieb{width:1px;height:16px;background-color:var(--rc-border);flex-shrink:0}._36yqiec{display:flex;align-items:center;gap:.5rem;font-size:var(--rc-font-size-md);font-weight:500;color:var(--rc-text)}._36yqied{padding:.25rem .5rem;font-size:var(--rc-font-size-xs);color:var(--rc-text-secondary);background:none;border:none;border-radius:.375rem;cursor:pointer;transition:color .15s,background-color .15s}._36yqied:hover{color:var(--rc-text);background-color:color-mix(in srgb,var(--rc-text) 5%,transparent)}._36yqiee{display:flex;align-items:center;background-color:color-mix(in srgb,var(--rc-text) 5%,transparent);border-radius:.375rem;padding:2px;margin-right:4px}._36yqief{display:inline-flex;align-items:center;justify-content:center;padding:4px;border-radius:.25rem;border:none;background:none;cursor:pointer;color:var(--rc-text-secondary);transition:color .15s,background-color .15s,box-shadow .15s}._36yqief:hover{color:var(--rc-text)}._36yqieg{background-color:var(--rc-bg);color:var(--rc-text);box-shadow:var(--rc-shadow-menu)}._36yqieh{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:.25rem;border:none;background:none;cursor:pointer;color:var(--rc-text-secondary);transition:color .15s,background-color .15s}._36yqieh:hover{color:var(--rc-text);background-color:color-mix(in srgb,var(--rc-text) 5%,transparent)}._36yqiei{display:flex;flex:1;min-height:0}._36yqiej{display:flex;flex-direction:column;border-right:1px solid var(--rc-border)}._36yqiek{width:50%}._36yqiel{flex:1}._36yqiem{display:flex;align-items:center;padding:0 .75rem;height:32px;border-bottom:1px solid var(--rc-border);background-color:color-mix(in srgb,var(--rc-text) 2%,transparent);flex-shrink:0;font-size:var(--rc-font-size-xs);font-weight:500;color:var(--rc-text-secondary);text-transform:uppercase;letter-spacing:.05em}._36yqien{display:flex;flex-direction:column;flex:1}._36yqieo{display:flex;flex:1;min-height:0;align-items:center;justify-content:center;position:relative;overflow:hidden;cursor:grab}._36yqieo:active{cursor:grabbing}._36yqieo:hover ._36yqie2{opacity:1}._36yqieo img{max-width:100%;height:auto}._36yqiep{font-size:var(--rc-font-size-md);color:color-mix(in srgb,var(--rc-text-secondary) 50%,transparent)}._36yqieq{display:flex;flex-direction:column;align-items:center;gap:.75rem;max-width:320px;text-align:center}._36yqier{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:.375rem;background-color:color-mix(in srgb,var(--rc-alert-caution) 10%,transparent);color:var(--rc-alert-caution)}._36yqies{font-size:var(--rc-font-size-md);font-weight:500;color:var(--rc-text)}._36yqiet{font-size:var(--rc-font-size-xs);color:var(--rc-text-secondary);line-height:1.5;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}._36yqieu{position:relative;display:flex;flex:1;min-height:0;overflow:hidden;font-family:var(--rc-font-mono);font-size:var(--rc-font-size-sm);line-height:1.25rem}._36yqiev{flex-shrink:0;width:40px;overflow:hidden;user-select:none;border-right:1px solid var(--rc-border);background-color:color-mix(in srgb,var(--rc-text) 2%,transparent);padding:.75rem 0}._36yqiew{padding:0 .5rem;text-align:right;line-height:1.25rem;color:color-mix(in srgb,var(--rc-text-secondary) 40%,transparent)}._36yqiex{flex:1;resize:none;background-color:transparent;padding:.75rem;color:var(--rc-text);outline:none;border:none;line-height:1.25rem;font-family:var(--rc-font-mono);font-size:var(--rc-font-size-md);tab-size:2}._36yqiex::placeholder{color:color-mix(in srgb,var(--rc-text-secondary) 40%,transparent)}._36yqiey{display:flex;align-items:center;justify-content:flex-end;padding:0 1rem;height:44px;border-top:1px solid var(--rc-border);flex-shrink:0;background-color:color-mix(in srgb,var(--rc-text) 1.5%,transparent)}._36yqiez{display:flex;align-items:center;gap:.5rem}._36yqie10{width:6px;height:6px;border-radius:50%;background-color:var(--rc-alert-tip)}._36yqie11{font-size:var(--rc-font-size-xs);color:var(--rc-text-secondary)}._36yqie12{display:flex;align-items:center;gap:.5rem}._36yqie13{padding:.25rem .75rem;border-radius:.375rem;font-size:var(--rc-font-size-xs);font-weight:500;cursor:pointer;height:28px;transition:background-color .15s,border-color .15s}._36yqie14{background-color:transparent;color:var(--rc-text-secondary);border:1px solid var(--rc-border)}._36yqie14:hover{background-color:color-mix(in srgb,var(--rc-text) 4%,transparent)}._36yqie15{background-color:var(--rc-text);color:var(--rc-bg);border:1px solid transparent}._36yqie15:hover{background-color:color-mix(in srgb,var(--rc-text) 85%,transparent)}@media(min-width:640px){._36yqie7._36yqie7{max-width:64rem}}
|
package/dist/static.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../src/static.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg-post-process.d.ts","sourceRoot":"","sources":["../src/svg-post-process.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AA2NlD,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,WAAW,GAClB,MAAM,CA6BR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMermaidRender.d.ts","sourceRoot":"","sources":["../src/useMermaidRender.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"useMermaidRender.d.ts","sourceRoot":"","sources":["../src/useMermaidRender.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAOtD,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,oBAAoB,CAAC,EAAE,WAAW;;;;;;;EA2FnC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-renderer-mermaid",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.39",
|
|
4
4
|
"description": "Mermaid diagram renderer",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"import": "./dist/index.mjs",
|
|
10
10
|
"types": "./dist/index.d.ts"
|
|
11
11
|
},
|
|
12
|
+
"./static": {
|
|
13
|
+
"import": "./dist/static.mjs",
|
|
14
|
+
"types": "./dist/static.d.ts"
|
|
15
|
+
},
|
|
12
16
|
"./style.css": "./dist/rich-renderer-mermaid.css"
|
|
13
17
|
},
|
|
14
18
|
"main": "./dist/index.mjs",
|
|
@@ -19,9 +23,9 @@
|
|
|
19
23
|
"lucide-react": "^0.574.0",
|
|
20
24
|
"mermaid": "^11.12.3",
|
|
21
25
|
"react-zoom-pan-pinch": "^3.7.0",
|
|
22
|
-
"@haklex/rich-editor": "0.0.
|
|
23
|
-
"@haklex/rich-editor-ui": "0.0.
|
|
24
|
-
"@haklex/rich-style-token": "0.0.
|
|
26
|
+
"@haklex/rich-editor": "0.0.39",
|
|
27
|
+
"@haklex/rich-editor-ui": "0.0.39",
|
|
28
|
+
"@haklex/rich-style-token": "0.0.39"
|
|
25
29
|
},
|
|
26
30
|
"devDependencies": {
|
|
27
31
|
"@types/react": "^19.2.14",
|