Skip to content

Commit 36adc99

Browse files
committed
Update narration steps
1 parent a70179c commit 36adc99

File tree

1 file changed

+46
-21
lines changed

1 file changed

+46
-21
lines changed

src/components/EnumerationDemo.tsx

+46-21
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,22 @@ const EnumerationDemo: React.FC<EnumerationDemoProps> = ({
108108

109109
const steps: Record<EnumerationType, Step[]> = {
110110
eager: [
111+
{
112+
pos: 0,
113+
from: 0,
114+
to: 0,
115+
progress: 0,
116+
narrationTitle: 'Start',
117+
narrationDescription: 'Press Play to begin',
118+
},
111119
...Array(7)
112120
.fill(null)
113121
.map((_, i) => ({
114122
pos: i,
115123
from: 0,
116124
to: 1,
117125
progress: i * 8 + 8,
118-
narrationTitle: 'map(&:blue!)',
126+
narrationTitle: 'map: change color',
119127
narrationDescription: `Item ${i}`,
120128
})),
121129
...Array(7)
@@ -126,15 +134,15 @@ const EnumerationDemo: React.FC<EnumerationDemoProps> = ({
126134
to: 2,
127135
progress: 64 + i * 8,
128136
explode: !isEven(i),
129-
narrationTitle: `select(&:even?)`,
137+
narrationTitle: `select: even index?`,
130138
narrationDescription: `Item ${i}: ${isEven(i) ? 'yes' : 'no'}`,
131139
})),
132140
...[0, 2, 4].map((i, idx) => ({
133141
pos: i,
134142
from: 2,
135143
to: 3,
136144
progress: 128 + idx * 8,
137-
narrationTitle: `take(3)`,
145+
narrationTitle: `take: 3`,
138146
narrationDescription: `Item ${i}`,
139147
})),
140148
{
@@ -143,41 +151,58 @@ const EnumerationDemo: React.FC<EnumerationDemoProps> = ({
143151
to: 2,
144152
progress: 144,
145153
skipRemaining: true,
146-
narrationTitle: 'Done!',
147-
narrationDescription: 'Remaining items not taken',
154+
narrationTitle: 'take: 3, done!',
155+
narrationDescription: '3 items taken',
156+
},
157+
{
158+
pos: 6,
159+
from: 2,
160+
to: 2,
161+
progress: 144,
162+
skipRemaining: true,
163+
narrationTitle: 'take: 3, done!',
164+
narrationDescription: '3 items taken, remaining items not taken',
148165
},
149166
],
150167
lazy: [
168+
{
169+
pos: 0,
170+
from: 0,
171+
to: 0,
172+
progress: 0,
173+
narrationTitle: 'Start',
174+
narrationDescription: 'Press Play to begin',
175+
},
151176
{
152177
pos: 0,
153178
from: 0,
154179
to: 1,
155180
progress: 8,
156-
narrationTitle: 'Map to blue',
181+
narrationTitle: 'map: change color',
157182
narrationDescription: 'Item 0',
158183
},
159184
{
160185
pos: 0,
161186
from: 1,
162187
to: 2,
163188
progress: 16,
164-
narrationTitle: 'Select even?',
189+
narrationTitle: 'select: even index?',
165190
narrationDescription: 'Item 0: yes',
166191
},
167192
{
168193
pos: 0,
169194
from: 2,
170195
to: 3,
171196
progress: 24,
172-
narrationTitle: 'Take 1',
197+
narrationTitle: 'take: 3',
173198
narrationDescription: 'Item 0',
174199
},
175200
{
176201
pos: 1,
177202
from: 0,
178203
to: 1,
179204
progress: 32,
180-
narrationTitle: 'Map to blue',
205+
narrationTitle: 'map: change color',
181206
narrationDescription: 'Item 1',
182207
},
183208
{
@@ -186,39 +211,39 @@ const EnumerationDemo: React.FC<EnumerationDemoProps> = ({
186211
to: 2,
187212
progress: 40,
188213
explode: true,
189-
narrationTitle: 'Select even?',
214+
narrationTitle: 'select: even index?',
190215
narrationDescription: 'Item 1: no',
191216
},
192217
{
193218
pos: 2,
194219
from: 0,
195220
to: 1,
196221
progress: 56,
197-
narrationTitle: 'Map to blue',
222+
narrationTitle: 'map: change color',
198223
narrationDescription: 'Item 2',
199224
},
200225
{
201226
pos: 2,
202227
from: 1,
203228
to: 2,
204229
progress: 64,
205-
narrationTitle: 'Select even?',
230+
narrationTitle: 'select: even index?',
206231
narrationDescription: 'Item 2: yes',
207232
},
208233
{
209234
pos: 2,
210235
from: 2,
211236
to: 3,
212237
progress: 72,
213-
narrationTitle: 'Take 3',
238+
narrationTitle: 'take: 3',
214239
narrationDescription: 'Item 2',
215240
},
216241
{
217242
pos: 3,
218243
from: 0,
219244
to: 1,
220245
progress: 84,
221-
narrationTitle: 'Map to blue',
246+
narrationTitle: 'map: change color',
222247
narrationDescription: 'Item 3',
223248
},
224249
{
@@ -227,39 +252,39 @@ const EnumerationDemo: React.FC<EnumerationDemoProps> = ({
227252
to: 2,
228253
progress: 92,
229254
explode: true,
230-
narrationTitle: 'Select even?',
255+
narrationTitle: 'select: even index?',
231256
narrationDescription: 'Item 3: no',
232257
},
233258
{
234259
pos: 4,
235260
from: 0,
236261
to: 1,
237262
progress: 108,
238-
narrationTitle: 'Map to blue',
263+
narrationTitle: 'map: change color',
239264
narrationDescription: 'Item 4',
240265
},
241266
{
242267
pos: 4,
243268
from: 1,
244269
to: 2,
245270
progress: 116,
246-
narrationTitle: 'Select even?',
271+
narrationTitle: 'select: even index?',
247272
narrationDescription: 'Item 4: yes',
248273
},
249274
{
250275
pos: 4,
251276
from: 2,
252277
to: 3,
253278
progress: 124,
254-
narrationTitle: 'Take 3',
279+
narrationTitle: 'take: 3',
255280
narrationDescription: 'Item 4',
256281
},
257282
{
258283
pos: 4,
259284
from: 3,
260285
to: 3,
261286
progress: 132,
262-
narrationTitle: 'Done!',
287+
narrationTitle: 'take 3, done!',
263288
narrationDescription: '3 items taken',
264289
},
265290
{
@@ -268,8 +293,8 @@ const EnumerationDemo: React.FC<EnumerationDemoProps> = ({
268293
to: 0,
269294
progress: 140,
270295
skipRemaining: true,
271-
narrationTitle: 'Done!',
272-
narrationDescription: 'Remaining items skipped',
296+
narrationTitle: 'take: 3, done!',
297+
narrationDescription: '3 items taken, remaining items skipped',
273298
},
274299
],
275300
};

0 commit comments

Comments
 (0)