sketchmark 0.2.8 → 1.0.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/README.md +207 -53
- package/dist/animation/index.d.ts +50 -10
- package/dist/animation/index.d.ts.map +1 -1
- package/dist/ast/types.d.ts +10 -2
- package/dist/ast/types.d.ts.map +1 -1
- package/dist/config.d.ts +12 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/index.cjs +603 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +603 -50
- package/dist/index.js.map +1 -1
- package/dist/parser/index.d.ts.map +1 -1
- package/dist/parser/tokenizer.d.ts.map +1 -1
- package/dist/scene/index.d.ts +2 -2
- package/dist/scene/index.d.ts.map +1 -1
- package/dist/sketchmark.iife.js +604 -51
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,6 +25,12 @@
|
|
|
25
25
|
11. [Themes](#themes)
|
|
26
26
|
12. [Fonts](#fonts)
|
|
27
27
|
13. [Animation System](#animation-system)
|
|
28
|
+
- [Narration](#narration)
|
|
29
|
+
- [Annotations](#annotations)
|
|
30
|
+
- [Parallel Steps (Beat)](#parallel-steps-beat)
|
|
31
|
+
- [Pace](#pace)
|
|
32
|
+
- [Text-to-Speech](#text-to-speech)
|
|
33
|
+
- [Pointer / Cursor](#pointer--cursor)
|
|
28
34
|
14. [Config Options](#config-options)
|
|
29
35
|
15. [Export](#export)
|
|
30
36
|
16. [Supported vs Unsupported Features](#supported-vs-unsupported-features)
|
|
@@ -581,7 +587,7 @@ step <action> <target> [options]
|
|
|
581
587
|
| Action | Target | Options | Description |
|
|
582
588
|
|--------|--------|---------|-------------|
|
|
583
589
|
| `highlight` | node/edge/group | — | Pulsing glow highlight (only one element at a time) |
|
|
584
|
-
| `draw` | node/edge/group/table/chart/markdown | `duration=N` | Animated stroke-drawing reveal |
|
|
590
|
+
| `draw` | node/edge/group/table/chart/markdown | `duration=N` | Animated stroke-drawing reveal with text writing effect |
|
|
585
591
|
| `fade` | node/edge/group | — | Fade to 22% opacity |
|
|
586
592
|
| `unfade` | node/edge/group | — | Restore from fade |
|
|
587
593
|
| `erase` | node/edge/group | `duration=N` | Fade to invisible (opacity 0) |
|
|
@@ -592,6 +598,69 @@ step <action> <target> [options]
|
|
|
592
598
|
| `scale` | node | `factor=N duration=N` | Scale to factor (absolute) |
|
|
593
599
|
| `rotate` | node | `deg=N duration=N` | Rotate by deg (cumulative) |
|
|
594
600
|
| `color` | node/edge | `fill="#..."` or `color="#..."` | Change fill/stroke color |
|
|
601
|
+
| `narrate` | — | `"text"` | Show a caption with typing effect |
|
|
602
|
+
| `circle` | node | — | Draw a rough circle annotation around element |
|
|
603
|
+
| `underline` | node | — | Draw a rough underline below element |
|
|
604
|
+
| `crossout` | node | — | Draw rough diagonal cross-out lines |
|
|
605
|
+
| `bracket` | node node | — | Draw a rough curly brace spanning two elements |
|
|
606
|
+
|
|
607
|
+
### Narration
|
|
608
|
+
|
|
609
|
+
Show captions like a teacher explaining on a blackboard. The caption appears as a floating bar at the bottom center of the viewport with a typing effect.
|
|
610
|
+
|
|
611
|
+
```
|
|
612
|
+
step narrate "Plants need sunlight to make food"
|
|
613
|
+
step narrate "This is the most important step" pace=slow
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
- Caption is rendered as a fixed-position `<div>` on `document.body` (independent of diagram pan/zoom).
|
|
617
|
+
- Access via `anim.captionElement` to reparent it anywhere.
|
|
618
|
+
- Supports built-in browser text-to-speech (see [TTS](#text-to-speech)).
|
|
619
|
+
|
|
620
|
+
### Annotations
|
|
621
|
+
|
|
622
|
+
Hand-drawn annotation marks powered by rough.js. A clean guide path draws in first, then the rough sketch fades in. If `config pointer=chalk|dot|hand` is set, a pointer follows the annotation stroke.
|
|
623
|
+
|
|
624
|
+
```
|
|
625
|
+
step circle leaf # circle around "leaf" node
|
|
626
|
+
step underline sun # underline below "sun" node
|
|
627
|
+
step crossout wrong # X through "wrong" node
|
|
628
|
+
step bracket sun leaf # curly brace spanning "sun" and "leaf"
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
Annotations require rough.js to be loaded. They are drawn into a dedicated SVG layer on top of the diagram.
|
|
632
|
+
|
|
633
|
+
### Parallel Steps (Beat)
|
|
634
|
+
|
|
635
|
+
Fire multiple steps simultaneously with `beat { }`:
|
|
636
|
+
|
|
637
|
+
```
|
|
638
|
+
beat {
|
|
639
|
+
step draw sun
|
|
640
|
+
step draw co2
|
|
641
|
+
step narrate "Both appear at once"
|
|
642
|
+
}
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
- All children fire at the same time.
|
|
646
|
+
- Playback waits for the longest child to finish before advancing.
|
|
647
|
+
- Beats can contain any step action including `narrate` and annotations.
|
|
648
|
+
|
|
649
|
+
### Pace
|
|
650
|
+
|
|
651
|
+
Control timing per step with `pace=slow|fast|pause`:
|
|
652
|
+
|
|
653
|
+
```
|
|
654
|
+
step draw sun pace=slow # 2× slower
|
|
655
|
+
step draw leaf pace=fast # 2× faster
|
|
656
|
+
step narrate "Key point" pace=pause # extra 1.5s hold after step
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
| Pace | Effect |
|
|
660
|
+
|------|--------|
|
|
661
|
+
| `slow` | Duration × 2.0 |
|
|
662
|
+
| `fast` | Duration × 0.5 |
|
|
663
|
+
| `pause` | Adds 1500ms hold |
|
|
595
664
|
|
|
596
665
|
### Step Options
|
|
597
666
|
|
|
@@ -599,6 +668,7 @@ step <action> <target> [options]
|
|
|
599
668
|
|--------|-------------|---------|
|
|
600
669
|
| `duration=N` | Animation duration in ms | varies by type |
|
|
601
670
|
| `delay=N` | Delay before this step fires (ms) | 0 |
|
|
671
|
+
| `pace=slow\|fast\|pause` | Timing modifier | — |
|
|
602
672
|
| `dx=N` | X translation for `move` | 0 |
|
|
603
673
|
| `dy=N` | Y translation for `move` | 0 |
|
|
604
674
|
| `factor=N` | Scale factor for `scale` | 1 |
|
|
@@ -615,6 +685,22 @@ step highlight server
|
|
|
615
685
|
step draw server-->db
|
|
616
686
|
step highlight db
|
|
617
687
|
|
|
688
|
+
# Narration with pacing
|
|
689
|
+
step narrate "The client sends a request" pace=slow
|
|
690
|
+
step draw client-->server
|
|
691
|
+
step narrate "The server processes it"
|
|
692
|
+
|
|
693
|
+
# Annotations
|
|
694
|
+
step circle server
|
|
695
|
+
step underline db
|
|
696
|
+
step bracket server db
|
|
697
|
+
|
|
698
|
+
# Parallel steps
|
|
699
|
+
beat {
|
|
700
|
+
step draw sun
|
|
701
|
+
step draw moon
|
|
702
|
+
}
|
|
703
|
+
|
|
618
704
|
# Move a node
|
|
619
705
|
step move myBox dx=100 dy=0 duration=500
|
|
620
706
|
|
|
@@ -649,11 +735,13 @@ step highlight server delay=500
|
|
|
649
735
|
const { anim } = render({ ... });
|
|
650
736
|
|
|
651
737
|
// Properties
|
|
652
|
-
anim.total
|
|
653
|
-
anim.currentStep
|
|
654
|
-
anim.canNext
|
|
655
|
-
anim.canPrev
|
|
656
|
-
anim.atEnd
|
|
738
|
+
anim.total // number of steps
|
|
739
|
+
anim.currentStep // current step index (-1 = before start)
|
|
740
|
+
anim.canNext // boolean
|
|
741
|
+
anim.canPrev // boolean
|
|
742
|
+
anim.atEnd // boolean
|
|
743
|
+
anim.captionElement // HTMLDivElement | null — the narration caption element
|
|
744
|
+
anim.tts // boolean — text-to-speech enabled/disabled
|
|
657
745
|
|
|
658
746
|
// Methods
|
|
659
747
|
anim.next() // advance one step (returns bool)
|
|
@@ -661,17 +749,61 @@ anim.prev() // go back one step (returns bool)
|
|
|
661
749
|
anim.reset() // reset to before step 0
|
|
662
750
|
anim.goTo(index) // jump to step N
|
|
663
751
|
await anim.play(700) // play all remaining steps (700ms between)
|
|
752
|
+
anim.destroy() // remove caption, annotations, pointer from DOM
|
|
753
|
+
|
|
754
|
+
// Toggle TTS programmatically
|
|
755
|
+
anim.tts = true; // enable browser speech
|
|
756
|
+
anim.tts = false; // disable (stops current speech)
|
|
757
|
+
|
|
758
|
+
// Reparent the narration caption to a custom container
|
|
759
|
+
myDiv.appendChild(anim.captionElement);
|
|
664
760
|
|
|
665
761
|
// Event listener
|
|
666
762
|
const unsub = anim.on((event) => {
|
|
667
763
|
console.log(event.type); // 'step-change' | 'animation-start' | 'animation-end' | 'animation-reset'
|
|
668
764
|
console.log(event.stepIndex); // number
|
|
669
|
-
console.log(event.step); // ASTStep
|
|
765
|
+
console.log(event.step); // ASTStepItem (ASTStep | ASTBeat)
|
|
670
766
|
console.log(event.total); // total steps
|
|
671
767
|
});
|
|
672
768
|
unsub(); // unsubscribe
|
|
673
769
|
```
|
|
674
770
|
|
|
771
|
+
### Text-to-Speech
|
|
772
|
+
|
|
773
|
+
Enable browser-native speech synthesis for narrate steps:
|
|
774
|
+
|
|
775
|
+
```
|
|
776
|
+
# In DSL
|
|
777
|
+
config tts=on
|
|
778
|
+
```
|
|
779
|
+
|
|
780
|
+
```javascript
|
|
781
|
+
// Or via API
|
|
782
|
+
anim.tts = true;
|
|
783
|
+
|
|
784
|
+
// Custom TTS (e.g. ElevenLabs) via event listener
|
|
785
|
+
anim.tts = false; // disable built-in
|
|
786
|
+
anim.on((e) => {
|
|
787
|
+
if (e.step?.kind === 'step' && e.step.action === 'narrate') {
|
|
788
|
+
myTTSService.speak(e.step.value);
|
|
789
|
+
}
|
|
790
|
+
});
|
|
791
|
+
```
|
|
792
|
+
|
|
793
|
+
Speech cancels automatically on `reset()`, `prev()`, `destroy()`, or when a new narrate step fires.
|
|
794
|
+
|
|
795
|
+
### Pointer / Cursor
|
|
796
|
+
|
|
797
|
+
Show a pointer that follows annotation strokes (circle, underline, crossout, bracket):
|
|
798
|
+
|
|
799
|
+
```
|
|
800
|
+
config pointer=chalk # white dot with outline
|
|
801
|
+
config pointer=dot # colored dot
|
|
802
|
+
config pointer=hand # hand cursor
|
|
803
|
+
```
|
|
804
|
+
|
|
805
|
+
The pointer only appears during annotation steps — it follows the guide path as the annotation draws in, then fades out.
|
|
806
|
+
|
|
675
807
|
### Pre-hidden Elements (Draw Targets)
|
|
676
808
|
|
|
677
809
|
Any element targeted by a `step draw` action starts **hidden** and only appears when that step fires. Elements NOT targeted by `draw` are always visible.
|
|
@@ -692,6 +824,8 @@ Set in DSL with `config key=value`:
|
|
|
692
824
|
| `title-color` | Diagram title text color | palette default |
|
|
693
825
|
| `title-size` | Diagram title font size | `18` |
|
|
694
826
|
| `title-weight` | Diagram title font weight | `600` |
|
|
827
|
+
| `pointer` | Annotation pointer type | `none` |
|
|
828
|
+
| `tts` | Enable browser text-to-speech | `off` |
|
|
695
829
|
|
|
696
830
|
```
|
|
697
831
|
diagram
|
|
@@ -701,6 +835,8 @@ config gap=60
|
|
|
701
835
|
config margin=40
|
|
702
836
|
config theme=ocean
|
|
703
837
|
config font=caveat
|
|
838
|
+
config pointer=chalk
|
|
839
|
+
config tts=on
|
|
704
840
|
config title-size=24
|
|
705
841
|
config title-color="#001f5b"
|
|
706
842
|
```
|
|
@@ -836,7 +972,7 @@ exportHTML(instance.svg, dslSource, { filename: 'diagram.html' });
|
|
|
836
972
|
| Feature | Supported | Notes |
|
|
837
973
|
|---------|-----------|-------|
|
|
838
974
|
| highlight | ✅ | Pulsing glow |
|
|
839
|
-
| draw (nodes) | ✅ |
|
|
975
|
+
| draw (nodes) | ✅ | Guide-path stroke reveal + text writing effect |
|
|
840
976
|
| draw (edges) | ✅ | Animated line draw |
|
|
841
977
|
| draw (groups) | ✅ | |
|
|
842
978
|
| draw (tables) | ✅ | |
|
|
@@ -850,11 +986,20 @@ exportHTML(instance.svg, dslSource, { filename: 'diagram.html' });
|
|
|
850
986
|
| scale | ✅ | CSS transform scale |
|
|
851
987
|
| rotate | ✅ | CSS transform rotate |
|
|
852
988
|
| color | ✅ | Dynamic fill/stroke color change |
|
|
989
|
+
| narrate | ✅ | Typing-effect captions |
|
|
990
|
+
| circle annotation | ✅ | Rough circle around element |
|
|
991
|
+
| underline annotation | ✅ | Rough underline below element |
|
|
992
|
+
| crossout annotation | ✅ | Rough X through element |
|
|
993
|
+
| bracket annotation | ✅ | Rough curly brace spanning two elements |
|
|
994
|
+
| pace (slow/fast/pause) | ✅ | Per-step timing control |
|
|
995
|
+
| parallel steps (beat) | ✅ | `beat { }` fires children simultaneously |
|
|
996
|
+
| pointer / cursor | ✅ | Follows annotation strokes (chalk/dot/hand) |
|
|
997
|
+
| text-to-speech | ✅ | Browser `speechSynthesis` API |
|
|
998
|
+
| text writing animation | ✅ | Left-to-right clipPath reveal on draw |
|
|
853
999
|
| delay per step | ✅ | `delay=N` ms |
|
|
854
1000
|
| custom duration | ✅ | `duration=N` ms |
|
|
855
1001
|
| Canvas renderer animation | ❌ | SVG renderer only |
|
|
856
1002
|
| Click-triggered steps | ❌ | Parsed but not implemented |
|
|
857
|
-
| Parallel steps | ❌ | Sequential only |
|
|
858
1003
|
|
|
859
1004
|
### Export
|
|
860
1005
|
|
|
@@ -924,20 +1069,27 @@ exportHTML(instance.svg, dslSource, { filename: 'diagram.html' });
|
|
|
924
1069
|
| `step scale` | Animation | `step scale nodeId factor=1.5 duration=300` |
|
|
925
1070
|
| `step rotate` | Animation | `step rotate nodeId deg=90 duration=400` |
|
|
926
1071
|
| `step color` | Animation | `step color nodeId fill="#ff0000"` |
|
|
1072
|
+
| `step narrate` | Animation | `step narrate "Caption text" pace=slow` |
|
|
1073
|
+
| `step circle` | Animation | `step circle nodeId` |
|
|
1074
|
+
| `step underline` | Animation | `step underline nodeId` |
|
|
1075
|
+
| `step crossout` | Animation | `step crossout nodeId` |
|
|
1076
|
+
| `step bracket` | Animation | `step bracket nodeId1 nodeId2` |
|
|
1077
|
+
| `beat` | Animation | `beat { step draw a \n step draw b }` |
|
|
1078
|
+
| `pace` | Animation | `step draw nodeId pace=slow\|fast\|pause` |
|
|
927
1079
|
|
|
928
1080
|
---
|
|
929
1081
|
|
|
930
1082
|
## Complete Example
|
|
931
1083
|
|
|
932
|
-
This example demonstrates most features
|
|
1084
|
+
This example demonstrates most features including narration, annotations, beats, pacing, and pointer:
|
|
933
1085
|
|
|
934
1086
|
```
|
|
935
1087
|
diagram
|
|
936
|
-
title label="
|
|
1088
|
+
title label="How the Internet Delivers a Webpage"
|
|
937
1089
|
layout row
|
|
938
1090
|
config gap=50
|
|
939
|
-
config
|
|
940
|
-
config
|
|
1091
|
+
config pointer=chalk
|
|
1092
|
+
config tts=on
|
|
941
1093
|
|
|
942
1094
|
# Define named themes
|
|
943
1095
|
theme primary fill="#e8f4ff" stroke="#0044cc" color="#003399"
|
|
@@ -945,48 +1097,50 @@ theme success fill="#e8ffe8" stroke="#007700" color="#004400"
|
|
|
945
1097
|
theme warning fill="#fff9e6" stroke="#f0a500" color="#7a5000"
|
|
946
1098
|
theme muted fill="#f5f5f5" stroke="#999999" color="#444444"
|
|
947
1099
|
|
|
948
|
-
|
|
949
|
-
box
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
1100
|
+
box you label="You" theme=warning width=120 height=50
|
|
1101
|
+
box browser label="Browser" theme=primary width=120 height=50
|
|
1102
|
+
box dns label="DNS\nServer" theme=muted width=120 height=55
|
|
1103
|
+
box server label="Web\nServer" theme=success width=120 height=55
|
|
1104
|
+
box html label="HTML\nCSS JS" theme=primary width=120 height=55
|
|
1105
|
+
box screen label="Rendered\nPage" theme=warning width=120 height=55
|
|
1106
|
+
|
|
1107
|
+
you --> browser label="types URL"
|
|
1108
|
+
browser --> dns label="lookup"
|
|
1109
|
+
dns --> browser label="IP address"
|
|
1110
|
+
browser --> server label="request"
|
|
1111
|
+
server --> html label="responds"
|
|
1112
|
+
html --> screen label="renders"
|
|
1113
|
+
|
|
1114
|
+
# Animation with narration, annotations, beats, and pacing
|
|
1115
|
+
step narrate "You type a website address into your browser" pace=slow
|
|
1116
|
+
step draw you
|
|
1117
|
+
step draw browser
|
|
1118
|
+
step draw you-->browser
|
|
1119
|
+
step underline you
|
|
1120
|
+
step narrate "The browser asks a DNS server — the internet's phone book"
|
|
1121
|
+
step draw dns
|
|
1122
|
+
step draw browser-->dns
|
|
1123
|
+
step circle dns
|
|
1124
|
+
step narrate "DNS translates the domain name into an IP address"
|
|
1125
|
+
step draw dns-->browser
|
|
1126
|
+
step narrate "Now the browser knows WHERE to go" pace=slow
|
|
1127
|
+
beat {
|
|
1128
|
+
step draw server
|
|
1129
|
+
step draw browser-->server
|
|
956
1130
|
}
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
api --> auth
|
|
964
|
-
api --> db label="SQL"
|
|
965
|
-
auth --> db label="SQL"
|
|
966
|
-
|
|
967
|
-
# Inline table
|
|
968
|
-
table users label="Users Table"
|
|
969
|
-
{
|
|
970
|
-
header ID Name Email
|
|
971
|
-
row "1" "Alice" "alice@example.com"
|
|
972
|
-
row "2" "Bob" "bob@example.com"
|
|
1131
|
+
step narrate "It sends a request to the web server at that address"
|
|
1132
|
+
step underline server
|
|
1133
|
+
step narrate "The server responds with HTML, CSS, and JavaScript" pace=slow
|
|
1134
|
+
beat {
|
|
1135
|
+
step draw html
|
|
1136
|
+
step draw server-->html
|
|
973
1137
|
}
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
["Tue", 1500],
|
|
981
|
-
["Wed", 900]]
|
|
982
|
-
|
|
983
|
-
# Animation sequence
|
|
984
|
-
step highlight client
|
|
985
|
-
step draw client-->api
|
|
986
|
-
step highlight api
|
|
987
|
-
step draw api-->auth
|
|
988
|
-
step draw api-->db
|
|
989
|
-
step highlight db
|
|
1138
|
+
step circle html
|
|
1139
|
+
step narrate "The browser assembles everything into the page you see"
|
|
1140
|
+
step draw html-->screen
|
|
1141
|
+
step draw screen pace=slow
|
|
1142
|
+
step bracket html screen
|
|
1143
|
+
step narrate "All of this happens in under a second!" pace=pause
|
|
990
1144
|
end
|
|
991
1145
|
```
|
|
992
1146
|
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ASTStepItem } from "../ast/types";
|
|
2
2
|
export type AnimationEventType = "step-change" | "step-complete" | "animation-reset" | "animation-start" | "animation-end";
|
|
3
3
|
export interface AnimationEvent {
|
|
4
4
|
type: AnimationEventType;
|
|
5
5
|
stepIndex: number;
|
|
6
|
-
step?:
|
|
6
|
+
step?: ASTStepItem;
|
|
7
7
|
total: number;
|
|
8
8
|
}
|
|
9
9
|
export type AnimationListener = (e: AnimationEvent) => void;
|
|
10
|
-
export declare function getDrawTargetEdgeIds(steps:
|
|
11
|
-
export declare function getDrawTargetNodeIds(steps:
|
|
12
|
-
export declare function getDrawTargetTableIds(steps:
|
|
13
|
-
export declare function getDrawTargetNoteIds(steps:
|
|
14
|
-
export declare function getDrawTargetChartIds(steps:
|
|
10
|
+
export declare function getDrawTargetEdgeIds(steps: ASTStepItem[]): Set<string>;
|
|
11
|
+
export declare function getDrawTargetNodeIds(steps: ASTStepItem[]): Set<string>;
|
|
12
|
+
export declare function getDrawTargetTableIds(steps: ASTStepItem[]): Set<string>;
|
|
13
|
+
export declare function getDrawTargetNoteIds(steps: ASTStepItem[]): Set<string>;
|
|
14
|
+
export declare function getDrawTargetChartIds(steps: ASTStepItem[]): Set<string>;
|
|
15
15
|
export declare class AnimationController {
|
|
16
16
|
private svg;
|
|
17
|
-
readonly steps:
|
|
17
|
+
readonly steps: ASTStepItem[];
|
|
18
|
+
private _container?;
|
|
19
|
+
private _rc?;
|
|
20
|
+
private _config?;
|
|
18
21
|
private _step;
|
|
19
22
|
private _pendingStepTimers;
|
|
20
23
|
private _transforms;
|
|
@@ -26,8 +29,21 @@ export declare class AnimationController {
|
|
|
26
29
|
readonly drawTargetNotes: Set<string>;
|
|
27
30
|
readonly drawTargetCharts: Set<string>;
|
|
28
31
|
readonly drawTargetMarkdowns: Set<string>;
|
|
32
|
+
private _captionEl;
|
|
33
|
+
private _captionTextEl;
|
|
34
|
+
private _annotationLayer;
|
|
35
|
+
private _annotations;
|
|
36
|
+
private _pointerEl;
|
|
37
|
+
private _pointerType;
|
|
38
|
+
private _tts;
|
|
39
|
+
private _speechDone;
|
|
29
40
|
get drawTargets(): Set<string>;
|
|
30
|
-
constructor(svg: SVGSVGElement, steps:
|
|
41
|
+
constructor(svg: SVGSVGElement, steps: ASTStepItem[], _container?: HTMLElement | undefined, _rc?: any | undefined, _config?: Record<string, string | number | boolean> | undefined);
|
|
42
|
+
/** The narration caption element — mount it anywhere via `yourContainer.appendChild(anim.captionElement)` */
|
|
43
|
+
get captionElement(): HTMLDivElement | null;
|
|
44
|
+
/** Enable/disable browser text-to-speech for narrate steps */
|
|
45
|
+
get tts(): boolean;
|
|
46
|
+
set tts(on: boolean);
|
|
31
47
|
get currentStep(): number;
|
|
32
48
|
get total(): number;
|
|
33
49
|
get canNext(): boolean;
|
|
@@ -36,15 +52,19 @@ export declare class AnimationController {
|
|
|
36
52
|
on(listener: AnimationListener): () => void;
|
|
37
53
|
private emit;
|
|
38
54
|
reset(): void;
|
|
55
|
+
/** Remove caption and annotation layer from the DOM */
|
|
56
|
+
destroy(): void;
|
|
39
57
|
next(): boolean;
|
|
40
58
|
prev(): boolean;
|
|
41
59
|
play(msPerStep?: number): Promise<void>;
|
|
42
60
|
goTo(index: number): void;
|
|
43
61
|
private _clearPendingStepTimers;
|
|
44
62
|
private _scheduleStep;
|
|
63
|
+
private _stepWaitMs;
|
|
45
64
|
private _playbackWaitMs;
|
|
46
65
|
private _clearAll;
|
|
47
66
|
private _applyStep;
|
|
67
|
+
private _runStepItem;
|
|
48
68
|
private _runStep;
|
|
49
69
|
private _doHighlight;
|
|
50
70
|
private _doFade;
|
|
@@ -57,6 +77,26 @@ export declare class AnimationController {
|
|
|
57
77
|
private _doShowHide;
|
|
58
78
|
private _doPulse;
|
|
59
79
|
private _doColor;
|
|
80
|
+
private _initCaption;
|
|
81
|
+
private _doNarrate;
|
|
82
|
+
private _speak;
|
|
83
|
+
private _cancelSpeech;
|
|
84
|
+
/** Pre-warm the speech engine with a silent utterance to eliminate cold-start delay */
|
|
85
|
+
private _warmUpSpeech;
|
|
86
|
+
private _nodeMetrics;
|
|
87
|
+
/**
|
|
88
|
+
* Animate an annotation using the same guide-path approach as node draw:
|
|
89
|
+
* 1. Hide the rough.js element (opacity=0)
|
|
90
|
+
* 2. Create a clean single guide path and animate it with stroke-dashoffset
|
|
91
|
+
* 3. Pointer follows the guide path
|
|
92
|
+
* 4. After guide finishes → fade in rough.js element, remove guide
|
|
93
|
+
*/
|
|
94
|
+
private _animateAnnotation;
|
|
95
|
+
private _doAnnotationCircle;
|
|
96
|
+
private _doAnnotationUnderline;
|
|
97
|
+
private _doAnnotationCrossout;
|
|
98
|
+
private _doAnnotationBracket;
|
|
99
|
+
private _initPointer;
|
|
60
100
|
}
|
|
61
|
-
export declare const ANIMATION_CSS = "\n.ng, .gg, .tg, .ntg, .cg, .eg, .mdg {\n transform-box: fill-box;\n transform-origin: center;\n transition: filter 0.3s, opacity 0.35s;\n}\n\n/* highlight */\n.ng.hl path, .ng.hl rect, .ng.hl ellipse, .ng.hl polygon,\n.tg.hl path, .tg.hl rect,\n.ntg.hl path, .ntg.hl polygon,\n.cg.hl path, .cg.hl rect,\n.mdg.hl text,\n.eg.hl path, .eg.hl line, .eg.hl polygon { stroke-width: 2.8 !important; }\n\n.ng.hl, .tg.hl, .ntg.hl, .cg.hl, .mdg.hl, .eg.hl {\n animation: ng-pulse 1.4s ease-in-out infinite;\n}\n@keyframes ng-pulse {\n 0%, 100% { filter: drop-shadow(0 0 7px rgba(200,84,40,.6)); }\n 50% { filter: drop-shadow(0 0 14px rgba(200,84,40,.9)); }\n}\n\n/* fade */\n.ng.faded, .gg.faded, .tg.faded, .ntg.faded,\n.cg.faded, .eg.faded, .mdg.faded { opacity: 0.22; }\n\n.ng.hidden { opacity: 0; pointer-events: none; }\n.gg.gg-hidden { opacity: 0; }\n.tg.gg-hidden { opacity: 0; }\n.ntg.gg-hidden { opacity: 0; }\n.cg.gg-hidden { opacity: 0; }\n.mdg.gg-hidden { opacity: 0; }\n";
|
|
101
|
+
export declare const ANIMATION_CSS = "\n.ng, .gg, .tg, .ntg, .cg, .eg, .mdg {\n transform-box: fill-box;\n transform-origin: center;\n transition: filter 0.3s, opacity 0.35s;\n}\n\n/* highlight */\n.ng.hl path, .ng.hl rect, .ng.hl ellipse, .ng.hl polygon,\n.tg.hl path, .tg.hl rect,\n.ntg.hl path, .ntg.hl polygon,\n.cg.hl path, .cg.hl rect,\n.mdg.hl text,\n.eg.hl path, .eg.hl line, .eg.hl polygon { stroke-width: 2.8 !important; }\n\n.ng.hl, .tg.hl, .ntg.hl, .cg.hl, .mdg.hl, .eg.hl {\n animation: ng-pulse 1.4s ease-in-out infinite;\n}\n@keyframes ng-pulse {\n 0%, 100% { filter: drop-shadow(0 0 7px rgba(200,84,40,.6)); }\n 50% { filter: drop-shadow(0 0 14px rgba(200,84,40,.9)); }\n}\n\n/* fade */\n.ng.faded, .gg.faded, .tg.faded, .ntg.faded,\n.cg.faded, .eg.faded, .mdg.faded { opacity: 0.22; }\n\n.ng.hidden { opacity: 0; pointer-events: none; }\n.gg.gg-hidden { opacity: 0; }\n.tg.gg-hidden { opacity: 0; }\n.ntg.gg-hidden { opacity: 0; }\n.cg.gg-hidden { opacity: 0; }\n.mdg.gg-hidden { opacity: 0; }\n\n/* narration caption */\n.skm-caption { pointer-events: none; user-select: none; }\n";
|
|
62
102
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/animation/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/animation/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAoB,WAAW,EAAE,MAAM,cAAc,CAAC;AAGlE,MAAM,MAAM,kBAA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' | 'grid';
|
|
4
4
|
export type AlignItems = 'start' | 'center' | 'end';
|
|
5
5
|
export type JustifyContent = 'start' | 'center' | 'end' | 'space-between' | 'space-around';
|
|
6
|
-
export type AnimationAction = 'highlight' | 'fade' | 'unfade' | 'draw' | 'erase' | 'show' | 'hide' | 'pulse' | 'move' | 'color' | 'scale' | 'rotate';
|
|
6
|
+
export type AnimationAction = 'highlight' | 'fade' | 'unfade' | 'draw' | 'erase' | 'show' | 'hide' | 'pulse' | 'move' | 'color' | 'scale' | 'rotate' | 'narrate' | 'circle' | 'underline' | 'crossout' | 'bracket';
|
|
7
7
|
export type AnimationTrigger = 'on-click';
|
|
8
|
+
export type StepPace = 'slow' | 'fast' | 'pause';
|
|
8
9
|
export interface StyleProps {
|
|
9
10
|
fill?: string;
|
|
10
11
|
stroke?: string;
|
|
@@ -112,7 +113,14 @@ export interface ASTStep {
|
|
|
112
113
|
dy?: number;
|
|
113
114
|
factor?: number;
|
|
114
115
|
deg?: number;
|
|
116
|
+
pace?: StepPace;
|
|
117
|
+
target2?: string;
|
|
115
118
|
}
|
|
119
|
+
export interface ASTBeat {
|
|
120
|
+
kind: 'beat';
|
|
121
|
+
children: ASTStep[];
|
|
122
|
+
}
|
|
123
|
+
export type ASTStepItem = ASTStep | ASTBeat;
|
|
116
124
|
export interface ASTChartData {
|
|
117
125
|
headers: string[];
|
|
118
126
|
rows: (string | number)[][];
|
|
@@ -158,7 +166,7 @@ export interface DiagramAST {
|
|
|
158
166
|
edges: ASTEdge[];
|
|
159
167
|
groups: ASTGroup[];
|
|
160
168
|
tables: ASTTable[];
|
|
161
|
-
steps:
|
|
169
|
+
steps: ASTStepItem[];
|
|
162
170
|
charts: ASTChart[];
|
|
163
171
|
markdowns: ASTMarkdown[];
|
|
164
172
|
styles: Record<string, StyleProps>;
|
package/dist/ast/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ast/types.ts"],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U,CAAC;IACpB,EAAE,EAAO,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAG,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAG,MAAM,CAAC;IAChB,KAAK,CAAC,EAAG,UAAU,CAAC;CACrB;AAGD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IACtD,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAG,OAAO,EAAE,CAAC;IAClB,KAAK,EAAG,OAAO,EAAE,CAAC;IAClB,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,KAAK,EAAG,WAAW,EAAE,CAAC;IACtB,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,SAAS,EAAE,WAAW,EAAE,CAAC;IACzB,MAAM,EAAK,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACtC,MAAM,EAAK,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACtC,MAAM,EAAK,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IACrD,SAAS,EAAE,WAAW,EAAE,CAAC;CAC1B"}
|
package/dist/config.d.ts
CHANGED
|
@@ -137,6 +137,18 @@ export declare const ANIMATION: {
|
|
|
137
137
|
readonly fillFadeOffset: -60;
|
|
138
138
|
readonly textDelay: 80;
|
|
139
139
|
readonly chartFade: 500;
|
|
140
|
+
readonly paceSlowMul: 2;
|
|
141
|
+
readonly paceFastMul: 0.5;
|
|
142
|
+
readonly pauseHoldMs: 1500;
|
|
143
|
+
readonly narrationFadeMs: 300;
|
|
144
|
+
readonly narrationTypeMs: 30;
|
|
145
|
+
readonly textRevealMs: 400;
|
|
146
|
+
readonly annotationStrokeDur: 300;
|
|
147
|
+
readonly annotationColor: "#c85428";
|
|
148
|
+
readonly annotationStrokeW: 2.5;
|
|
149
|
+
readonly pointerMoveMs: 350;
|
|
150
|
+
readonly pointerPreStepMs: 120;
|
|
151
|
+
readonly pointerSize: 8;
|
|
140
152
|
};
|
|
141
153
|
export declare const EXPORT: {
|
|
142
154
|
readonly pngScale: 2;
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,MAAM;;;;;;CAMT,CAAC;AAGX,eAAO,MAAM,IAAI;;;;;;CAMP,CAAC;AAGX,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMT,CAAC;AAGX,eAAO,MAAM,KAAK;;;;;;;CAOR,CAAC;AAGX,eAAO,MAAM,IAAI;;;;;;;CAOP,CAAC;AAGX,eAAO,MAAM,UAAU;;;;;;;CAOb,CAAC;AAGX,eAAO,MAAM,KAAK;;;;CAIR,CAAC;AAGX,eAAO,MAAM,WAAW;;;;CAId,CAAC;AAGX,eAAO,MAAM,IAAI;;;;;;0BAMS,SAAS,MAAM,EAAE;CACjC,CAAC;AAGX,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;CAKX,CAAC;AAGX,eAAO,MAAM,KAAK;;;;CAIR,CAAC;AAGX,eAAO,MAAM,KAAK;;;;;;;;;CASR,CAAC;AAGX,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,MAAM;;;;;;CAMT,CAAC;AAGX,eAAO,MAAM,IAAI;;;;;;CAMP,CAAC;AAGX,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMT,CAAC;AAGX,eAAO,MAAM,KAAK;;;;;;;CAOR,CAAC;AAGX,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