create-slide-deck 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +119 -0
- package/package.json +36 -0
- package/template-full/README.md +99 -0
- package/template-full/package.json +47 -0
- package/template-full/src/reveal/components/auto-layout.ts +229 -0
- package/template-full/src/reveal/components/charts.tsx +213 -0
- package/template-full/src/reveal/core/blocks.ts +172 -0
- package/template-full/src/reveal/core/deck-init.ts +60 -0
- package/template-full/src/reveal/core/design.ts +46 -0
- package/template-full/src/reveal/core/layout.ts +187 -0
- package/template-full/src/reveal/core/mount-registry.ts +41 -0
- package/template-full/src/reveal/core/presets.ts +189 -0
- package/template-full/src/reveal/core/runtime.ts +141 -0
- package/template-full/src/reveal/core/types.ts +114 -0
- package/template-full/src/reveal/data/algorithms.ts +78 -0
- package/template-full/src/reveal/data/benchmark.ts +79 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-arc-progress.tsx +153 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-before-after.tsx +164 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-bigtext.tsx +70 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-card-flip.tsx +118 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-chat-bubbles.tsx +257 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-code.tsx +136 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-concept-map.tsx +336 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-counter.tsx +194 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-cover.tsx +188 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-dark-dashboard.tsx +166 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-eval-matrix.tsx +191 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-force-graph.tsx +169 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-fullbleed-bars.tsx +109 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-fullbleed-flow.tsx +177 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-heatmap.tsx +135 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-icon-wall.tsx +143 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-math.tsx +103 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-number-morph.tsx +126 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-path.tsx +185 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-radar.tsx +124 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-rough.tsx +169 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-sankey.tsx +144 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-screenshot-annotate.tsx +181 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-stacked-cards.tsx +159 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-tabs.tsx +206 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-timeline.tsx +162 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-treemap.tsx +161 -0
- package/template-full/src/reveal/decks/demo-showcase/components/demo-zoom-focus.tsx +223 -0
- package/template-full/src/reveal/decks/demo-showcase/components/registry.ts +63 -0
- package/template-full/src/reveal/decks/demo-showcase/demo.css +237 -0
- package/template-full/src/reveal/decks/demo-showcase/index.html +24 -0
- package/template-full/src/reveal/decks/demo-showcase/main.ts +7 -0
- package/template-full/src/reveal/decks/demo-showcase/slides.ts +271 -0
- package/template-full/src/reveal/decks/fse26-rca/components/aws-cascade.tsx +295 -0
- package/template-full/src/reveal/decks/fse26-rca/components/bench-compare.tsx +64 -0
- package/template-full/src/reveal/decks/fse26-rca/components/bench-deficiency.tsx +104 -0
- package/template-full/src/reveal/decks/fse26-rca/components/bench-loop.tsx +402 -0
- package/template-full/src/reveal/decks/fse26-rca/components/bench-needs.tsx +78 -0
- package/template-full/src/reveal/decks/fse26-rca/components/closing-takeaway.tsx +165 -0
- package/template-full/src/reveal/decks/fse26-rca/components/cloud-incidents.tsx +88 -0
- package/template-full/src/reveal/decks/fse26-rca/components/failure-modes.tsx +59 -0
- package/template-full/src/reveal/decks/fse26-rca/components/fault-heatmap.tsx +85 -0
- package/template-full/src/reveal/decks/fse26-rca/components/hierarchy-tree.tsx +93 -0
- package/template-full/src/reveal/decks/fse26-rca/components/incident-hard.tsx +72 -0
- package/template-full/src/reveal/decks/fse26-rca/components/rca-pipeline.tsx +193 -0
- package/template-full/src/reveal/decks/fse26-rca/components/registry.ts +37 -0
- package/template-full/src/reveal/decks/fse26-rca/components/simple-rca.tsx +216 -0
- package/template-full/src/reveal/decks/fse26-rca/components/sota-collapse.tsx +63 -0
- package/template-full/src/reveal/decks/fse26-rca/components/srca-results.tsx +115 -0
- package/template-full/src/reveal/decks/fse26-rca/images/aws-outage-2025-deployflow.png +0 -0
- package/template-full/src/reveal/decks/fse26-rca/images/aws-post-event-summary.png +0 -0
- package/template-full/src/reveal/decks/fse26-rca/images/bbc-crowdstrike.png +0 -0
- package/template-full/src/reveal/decks/fse26-rca/images/cnn-meta-outage-2021.png +0 -0
- package/template-full/src/reveal/decks/fse26-rca/images/cover.png +0 -0
- package/template-full/src/reveal/decks/fse26-rca/images/nyt-facebook-2021.png +0 -0
- package/template-full/src/reveal/decks/fse26-rca/images/qr-repo.png +0 -0
- package/template-full/src/reveal/decks/fse26-rca/images/verge-crowdstrike-2024.png +0 -0
- package/template-full/src/reveal/decks/fse26-rca/images/wiki-meta-outage-2021.png +0 -0
- package/template-full/src/reveal/decks/fse26-rca/index.html +30 -0
- package/template-full/src/reveal/decks/fse26-rca/main.ts +8 -0
- package/template-full/src/reveal/decks/fse26-rca/slides.ts +175 -0
- package/template-full/src/reveal/env.d.ts +38 -0
- package/template-full/src/reveal/theme.css +762 -0
- package/template-full/src/reveal/tools/dev.mjs +120 -0
- package/template-full/src/reveal/tools/export-pdf.mjs +86 -0
- package/template-full/src/reveal/tools/preview.mjs +132 -0
- package/template-full/tsconfig.json +19 -0
- package/template-full/vite.config.ts +95 -0
- package/template-minimal/package.json +42 -0
- package/template-minimal/src/reveal/components/auto-layout.ts +229 -0
- package/template-minimal/src/reveal/components/charts.tsx +213 -0
- package/template-minimal/src/reveal/core/blocks.ts +172 -0
- package/template-minimal/src/reveal/core/deck-init.ts +60 -0
- package/template-minimal/src/reveal/core/design.ts +46 -0
- package/template-minimal/src/reveal/core/layout.ts +187 -0
- package/template-minimal/src/reveal/core/mount-registry.ts +41 -0
- package/template-minimal/src/reveal/core/presets.ts +189 -0
- package/template-minimal/src/reveal/core/runtime.ts +141 -0
- package/template-minimal/src/reveal/core/types.ts +114 -0
- package/template-minimal/src/reveal/data/.gitkeep +0 -0
- package/template-minimal/src/reveal/decks/my-deck/components/example-component.tsx +28 -0
- package/template-minimal/src/reveal/decks/my-deck/components/registry.ts +9 -0
- package/template-minimal/src/reveal/decks/my-deck/index.html +14 -0
- package/template-minimal/src/reveal/decks/my-deck/main.ts +5 -0
- package/template-minimal/src/reveal/decks/my-deck/slides.ts +34 -0
- package/template-minimal/src/reveal/env.d.ts +38 -0
- package/template-minimal/src/reveal/theme.css +762 -0
- package/template-minimal/tsconfig.json +19 -0
- package/template-minimal/vite.config.ts +95 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CANVAS, useRevealStep } from "../../../core/presets.ts";
|
|
3
|
+
import type { SlideComponentProps } from "../../../core/types.ts";
|
|
4
|
+
|
|
5
|
+
const anime = typeof window !== "undefined" ? (window as any).anime : null;
|
|
6
|
+
|
|
7
|
+
// side: "left" = Engineer (blue), "right" = SRCA System (purple)
|
|
8
|
+
const MESSAGES = [
|
|
9
|
+
{
|
|
10
|
+
side: "left",
|
|
11
|
+
who: "E",
|
|
12
|
+
text: "Service latency spiked to 2.8s on the orders endpoint",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
side: "right",
|
|
16
|
+
who: "S",
|
|
17
|
+
text: "Analyzing traces... Found 3 anomalous spans in the orders → payments path",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
side: "left",
|
|
21
|
+
who: "E",
|
|
22
|
+
text: "What's the root cause?",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
side: "right",
|
|
26
|
+
who: "S",
|
|
27
|
+
text:
|
|
28
|
+
"Root cause: payments-db connection pool exhausted (max_connections=50, active=50). Confidence: 94.2%",
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
const STYLE: Record<string, { bubble: string; avatar: string }> = {
|
|
33
|
+
left: { bubble: "#e8f0fe", avatar: "#4361ee" },
|
|
34
|
+
right: { bubble: "#f3e8ff", avatar: "#7c3aed" },
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
function Bubble(props: { msg: any; visible: boolean; instant: boolean }) {
|
|
38
|
+
const msg = props.msg;
|
|
39
|
+
const visible = props.visible;
|
|
40
|
+
const instant = props.instant;
|
|
41
|
+
const ref = React.useRef<HTMLDivElement>(null);
|
|
42
|
+
const done = React.useRef(false);
|
|
43
|
+
const isLeft = msg.side === "left";
|
|
44
|
+
const pal = STYLE[msg.side];
|
|
45
|
+
|
|
46
|
+
React.useEffect(function () {
|
|
47
|
+
const el = ref.current;
|
|
48
|
+
if (!el) return;
|
|
49
|
+
|
|
50
|
+
if (!visible) {
|
|
51
|
+
// Pre-position off-screen so the entrance reads cleanly when revealed.
|
|
52
|
+
done.current = false;
|
|
53
|
+
el.style.opacity = String(0);
|
|
54
|
+
el.style.transform = "translateX(" + (isLeft ? -40 : 40) + "px)";
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (done.current) {
|
|
59
|
+
el.style.opacity = String(1);
|
|
60
|
+
el.style.transform = "translateX(0px)";
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
done.current = true;
|
|
64
|
+
|
|
65
|
+
if (instant || !anime || !anime.animate) {
|
|
66
|
+
el.style.opacity = String(1);
|
|
67
|
+
el.style.transform = "translateX(0px)";
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
el.style.opacity = String(0);
|
|
72
|
+
el.style.transform = "translateX(" + (isLeft ? -40 : 40) + "px)";
|
|
73
|
+
anime.animate(el, {
|
|
74
|
+
opacity: [0, 1],
|
|
75
|
+
translateX: [isLeft ? -40 : 40, 0],
|
|
76
|
+
duration: 450,
|
|
77
|
+
ease: "outCubic",
|
|
78
|
+
});
|
|
79
|
+
}, [visible, instant, isLeft]);
|
|
80
|
+
|
|
81
|
+
const avatar = (
|
|
82
|
+
<div
|
|
83
|
+
style={{
|
|
84
|
+
flex: "0 0 auto",
|
|
85
|
+
width: 36,
|
|
86
|
+
height: 36,
|
|
87
|
+
borderRadius: "50%",
|
|
88
|
+
background: pal.avatar,
|
|
89
|
+
color: "#ffffff",
|
|
90
|
+
display: "flex",
|
|
91
|
+
alignItems: "center",
|
|
92
|
+
justifyContent: "center",
|
|
93
|
+
fontSize: 16,
|
|
94
|
+
fontWeight: 800,
|
|
95
|
+
}}
|
|
96
|
+
>
|
|
97
|
+
{msg.who}
|
|
98
|
+
</div>
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<div
|
|
103
|
+
ref={ref}
|
|
104
|
+
style={{
|
|
105
|
+
display: "flex",
|
|
106
|
+
flexDirection: isLeft ? "row" : "row-reverse",
|
|
107
|
+
alignItems: "flex-end",
|
|
108
|
+
gap: 10,
|
|
109
|
+
opacity: 0,
|
|
110
|
+
willChange: "transform, opacity",
|
|
111
|
+
}}
|
|
112
|
+
>
|
|
113
|
+
{avatar}
|
|
114
|
+
<div
|
|
115
|
+
style={{
|
|
116
|
+
position: "relative",
|
|
117
|
+
maxWidth: "65%",
|
|
118
|
+
background: pal.bubble,
|
|
119
|
+
color: "#1f2937",
|
|
120
|
+
padding: "16px 20px",
|
|
121
|
+
borderRadius: 16,
|
|
122
|
+
fontSize: 16,
|
|
123
|
+
fontWeight: 500,
|
|
124
|
+
lineHeight: 1.45,
|
|
125
|
+
boxShadow: "0 2px 6px rgba(0,0,0,0.08)",
|
|
126
|
+
}}
|
|
127
|
+
>
|
|
128
|
+
{msg.text}
|
|
129
|
+
<span
|
|
130
|
+
style={
|
|
131
|
+
isLeft
|
|
132
|
+
? {
|
|
133
|
+
position: "absolute",
|
|
134
|
+
left: -7,
|
|
135
|
+
bottom: 10,
|
|
136
|
+
width: 0,
|
|
137
|
+
height: 0,
|
|
138
|
+
borderTop: "7px solid transparent",
|
|
139
|
+
borderBottom: "7px solid transparent",
|
|
140
|
+
borderRight: "8px solid " + pal.bubble,
|
|
141
|
+
}
|
|
142
|
+
: {
|
|
143
|
+
position: "absolute",
|
|
144
|
+
right: -7,
|
|
145
|
+
bottom: 10,
|
|
146
|
+
width: 0,
|
|
147
|
+
height: 0,
|
|
148
|
+
borderTop: "7px solid transparent",
|
|
149
|
+
borderBottom: "7px solid transparent",
|
|
150
|
+
borderLeft: "8px solid " + pal.bubble,
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function SummaryCard(props: { visible: boolean; instant: boolean }) {
|
|
160
|
+
const visible = props.visible;
|
|
161
|
+
const instant = props.instant;
|
|
162
|
+
const ref = React.useRef<HTMLDivElement>(null);
|
|
163
|
+
const done = React.useRef(false);
|
|
164
|
+
|
|
165
|
+
React.useEffect(function () {
|
|
166
|
+
const el = ref.current;
|
|
167
|
+
if (!el) return;
|
|
168
|
+
if (!visible) {
|
|
169
|
+
done.current = false;
|
|
170
|
+
el.style.opacity = String(0);
|
|
171
|
+
el.style.transform = "translateY(16px)";
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (done.current) {
|
|
175
|
+
el.style.opacity = String(1);
|
|
176
|
+
el.style.transform = "translateY(0px)";
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
done.current = true;
|
|
180
|
+
if (instant || !anime || !anime.animate) {
|
|
181
|
+
el.style.opacity = String(1);
|
|
182
|
+
el.style.transform = "translateY(0px)";
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
el.style.opacity = String(0);
|
|
186
|
+
el.style.transform = "translateY(16px)";
|
|
187
|
+
anime.animate(el, {
|
|
188
|
+
opacity: [0, 1],
|
|
189
|
+
translateY: [16, 0],
|
|
190
|
+
duration: 450,
|
|
191
|
+
ease: "outCubic",
|
|
192
|
+
});
|
|
193
|
+
}, [visible, instant]);
|
|
194
|
+
|
|
195
|
+
return (
|
|
196
|
+
<div
|
|
197
|
+
ref={ref}
|
|
198
|
+
style={{
|
|
199
|
+
marginTop: 8,
|
|
200
|
+
alignSelf: "center",
|
|
201
|
+
background: "#ecfdf5",
|
|
202
|
+
border: "1px solid #059669",
|
|
203
|
+
color: "#065f46",
|
|
204
|
+
padding: "12px 22px",
|
|
205
|
+
borderRadius: 12,
|
|
206
|
+
fontSize: 16,
|
|
207
|
+
fontWeight: 700,
|
|
208
|
+
opacity: 0,
|
|
209
|
+
willChange: "transform, opacity",
|
|
210
|
+
}}
|
|
211
|
+
>
|
|
212
|
+
Diagnosed in 4.2 min vs. 30+ min manual
|
|
213
|
+
</div>
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export default function DemoChatBubbles(props: SlideComponentProps) {
|
|
218
|
+
const Reveal = props.Reveal;
|
|
219
|
+
const ref = useRevealStep(Reveal);
|
|
220
|
+
const step = ref[0], ready = ref[1], instant = ref[2];
|
|
221
|
+
|
|
222
|
+
return (
|
|
223
|
+
<div
|
|
224
|
+
style={{
|
|
225
|
+
width: "100%",
|
|
226
|
+
height: "100%",
|
|
227
|
+
background: "#ffffff",
|
|
228
|
+
opacity: ready ? 1 : 0,
|
|
229
|
+
transition: "opacity 0.2s ease",
|
|
230
|
+
fontFamily: CANVAS.fontFamily,
|
|
231
|
+
display: "flex",
|
|
232
|
+
justifyContent: "center",
|
|
233
|
+
alignItems: "center",
|
|
234
|
+
boxSizing: "border-box",
|
|
235
|
+
}}
|
|
236
|
+
>
|
|
237
|
+
<div
|
|
238
|
+
style={{
|
|
239
|
+
width: "100%",
|
|
240
|
+
maxWidth: 900,
|
|
241
|
+
display: "flex",
|
|
242
|
+
flexDirection: "column",
|
|
243
|
+
gap: 16,
|
|
244
|
+
padding: "0 24px",
|
|
245
|
+
boxSizing: "border-box",
|
|
246
|
+
}}
|
|
247
|
+
>
|
|
248
|
+
{MESSAGES.map(function (m, i) {
|
|
249
|
+
return (
|
|
250
|
+
<Bubble key={"m" + i} msg={m} visible={step >= i} instant={instant} />
|
|
251
|
+
);
|
|
252
|
+
})}
|
|
253
|
+
<SummaryCard visible={step >= MESSAGES.length} instant={instant} />
|
|
254
|
+
</div>
|
|
255
|
+
</div>
|
|
256
|
+
);
|
|
257
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Prism from "prismjs";
|
|
3
|
+
import { CANVAS, useRevealStep } from "../../../core/presets.ts";
|
|
4
|
+
import type { SlideComponentProps } from "../../../core/types.ts";
|
|
5
|
+
|
|
6
|
+
const CODE = [
|
|
7
|
+
"async function loadUsers(url) {",
|
|
8
|
+
" const cache = new Map();",
|
|
9
|
+
" let attempt = 0;",
|
|
10
|
+
" const max = 3;",
|
|
11
|
+
"",
|
|
12
|
+
" const res = await fetch(url);",
|
|
13
|
+
" const data = await res.json();",
|
|
14
|
+
" const active = data.filter(u => u.active);",
|
|
15
|
+
" cache.set(url, active);",
|
|
16
|
+
" return active;",
|
|
17
|
+
"",
|
|
18
|
+
" // retry handled by caller",
|
|
19
|
+
" } catch (err) {",
|
|
20
|
+
" console.error('load failed', err);",
|
|
21
|
+
" throw err;",
|
|
22
|
+
"}",
|
|
23
|
+
].join("\n");
|
|
24
|
+
|
|
25
|
+
// Groups of 1-based line ranges that light up per step.
|
|
26
|
+
const GROUPS: (number[] | null)[] = [
|
|
27
|
+
null, // step 0: nothing highlighted
|
|
28
|
+
[1, 4], // step 1: signature + setup
|
|
29
|
+
[5, 9], // step 2: main logic
|
|
30
|
+
[10, 14], // step 3: error handling
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const PRISM_CSS = "\
|
|
34
|
+
.dc-code .token.keyword{color:#569cd6;}\
|
|
35
|
+
.dc-code .token.string{color:#ce9178;}\
|
|
36
|
+
.dc-code .token.function{color:#dcdcaa;}\
|
|
37
|
+
.dc-code .token.comment{color:#6a9955;}\
|
|
38
|
+
.dc-code .token.number{color:#b5cea8;}\
|
|
39
|
+
.dc-code .token.boolean{color:#569cd6;}\
|
|
40
|
+
.dc-code .token.operator{color:#d4d4d4;background:transparent;}\
|
|
41
|
+
.dc-code .token.punctuation{color:#d4d4d4;}\
|
|
42
|
+
.dc-code .token.class-name{color:#4ec9b0;}\
|
|
43
|
+
.dc-code .token.property{color:#9cdcfe;}";
|
|
44
|
+
|
|
45
|
+
function highlightLine(line: string) {
|
|
46
|
+
return Prism.highlight(line, Prism.languages.javascript, "javascript");
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default function DemoCode({ Reveal }: SlideComponentProps) {
|
|
50
|
+
const ref = useRevealStep(Reveal);
|
|
51
|
+
const step = ref[0], ready = ref[1], instant = ref[2];
|
|
52
|
+
|
|
53
|
+
const lines = CODE.split("\n");
|
|
54
|
+
const active = GROUPS[step] || null;
|
|
55
|
+
|
|
56
|
+
function lineStyle(idx: number) {
|
|
57
|
+
const n = idx + 1;
|
|
58
|
+
const on = active && n >= active[0] && n <= active[1];
|
|
59
|
+
return {
|
|
60
|
+
display: "flex",
|
|
61
|
+
padding: "0 14px",
|
|
62
|
+
background: on ? "rgba(38,79,120,0.30)" : "transparent",
|
|
63
|
+
borderLeft: on ? "3px solid #d7ba7d" : "3px solid transparent",
|
|
64
|
+
transition: instant ? "none" : "background 0.4s ease, border-color 0.4s ease",
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<div style={{
|
|
70
|
+
opacity: ready ? 1 : 0,
|
|
71
|
+
transition: "opacity 0.2s ease",
|
|
72
|
+
display: "flex",
|
|
73
|
+
flexDirection: "row",
|
|
74
|
+
alignItems: "center",
|
|
75
|
+
justifyContent: "center",
|
|
76
|
+
gap: 30,
|
|
77
|
+
fontFamily: CANVAS.fontFamily,
|
|
78
|
+
width: "100%",
|
|
79
|
+
height: "100%",
|
|
80
|
+
}}>
|
|
81
|
+
<style dangerouslySetInnerHTML={{ __html: PRISM_CSS }} />
|
|
82
|
+
|
|
83
|
+
<div style={{
|
|
84
|
+
background: "#1e1e1e",
|
|
85
|
+
borderRadius: 12,
|
|
86
|
+
padding: "20px 0",
|
|
87
|
+
boxShadow: "0 8px 30px rgba(0,0,0,0.35)",
|
|
88
|
+
fontFamily: "'JetBrains Mono','Consolas','Courier New',monospace",
|
|
89
|
+
fontSize: 17,
|
|
90
|
+
lineHeight: 1.55,
|
|
91
|
+
color: "#d4d4d4",
|
|
92
|
+
minWidth: 640,
|
|
93
|
+
maxWidth: 720,
|
|
94
|
+
}} className="dc-code">
|
|
95
|
+
{lines.map(function (line, idx) {
|
|
96
|
+
return (
|
|
97
|
+
<div key={idx} style={lineStyle(idx)}>
|
|
98
|
+
<span style={{
|
|
99
|
+
width: 34,
|
|
100
|
+
flex: "0 0 auto",
|
|
101
|
+
textAlign: "right",
|
|
102
|
+
paddingRight: 16,
|
|
103
|
+
color: "#6e7681",
|
|
104
|
+
userSelect: "none",
|
|
105
|
+
}}>{idx + 1}</span>
|
|
106
|
+
<span
|
|
107
|
+
style={{ whiteSpace: "pre", flex: 1 }}
|
|
108
|
+
dangerouslySetInnerHTML={{ __html: highlightLine(line) || " " }}
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
);
|
|
112
|
+
})}
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<div style={{
|
|
116
|
+
opacity: step >= 4 ? 1 : 0,
|
|
117
|
+
transition: instant ? "none" : "opacity 0.45s ease",
|
|
118
|
+
width: 300,
|
|
119
|
+
flex: "0 0 auto",
|
|
120
|
+
background: "#ffffff",
|
|
121
|
+
borderRadius: 14,
|
|
122
|
+
padding: "24px 26px",
|
|
123
|
+
boxShadow: "0 6px 24px rgba(0,0,0,0.12)",
|
|
124
|
+
}}>
|
|
125
|
+
<div style={{ fontSize: 19, fontWeight: 800, color: "#4361ee", marginBottom: 12 }}>
|
|
126
|
+
Fetch-process-guard
|
|
127
|
+
</div>
|
|
128
|
+
<div style={{ fontSize: 15, fontWeight: 600, color: "#555", lineHeight: 1.55 }}>
|
|
129
|
+
Set up state and bounds, await the network call, then filter and cache
|
|
130
|
+
the result. Errors are logged and re-thrown so the caller can decide
|
|
131
|
+
whether to retry.
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
);
|
|
136
|
+
}
|