| 284 | } |
| 285 | |
| 286 | private *prependTween(value: string, duration: number) { |
| 287 | let current = this.get(); |
| 288 | const progress = createSignal(0); |
| 289 | const scope = { |
| 290 | progress, |
| 291 | fragments: [insert(value)], |
| 292 | }; |
| 293 | this.set({ |
| 294 | progress: current.progress, |
| 295 | fragments: [scope, ...current.fragments], |
| 296 | }); |
| 297 | yield* progress(1, duration); |
| 298 | current = this.get(); |
| 299 | this.set({ |
| 300 | progress: current.progress, |
| 301 | fragments: current.fragments.map(fragment => |
| 302 | fragment === scope ? value : fragment, |
| 303 | ), |
| 304 | }); |
| 305 | progress.context.dispose(); |
| 306 | } |
| 307 | |
| 308 | public override parse(value: PossibleCodeScope): CodeScope { |
| 309 | return parseCodeScope(value); |