You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/sdk-playground/README.md
+43-25Lines changed: 43 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,19 @@ bun run --cwd packages/sdk-playground dev
10
10
11
11
Serves at `http://localhost:5173`. On first load it reads `packages/sdk-playground/composition.html` from disk (if present) or falls back to a built-in demo composition.
12
12
13
+
## What this demonstrates
14
+
15
+
The playground exercises the full SDK surface end-to-end in a real browser against a
16
+
file-backed persist adapter. It was built to verify SDK stages 3b and 4 before Studio
| Box |`comp.setStyle(id, { background, opacity, left, top })`|
53
+
| Attributes |`comp.element(id).setAttribute(name, value)` — all non-internal attrs|
41
54
| Danger |`comp.element(id).removeElement()`|
42
-
| Animations |`comp.setTiming(id, { start, duration })` — inline form per GSAP tween|
55
+
| Animations |Lists tween IDs + inline "Add tween" form via `comp.addGsapTween(id, spec)`|
43
56
44
57
### Timeline
45
58
46
-
DAW-style per-element tween blocks. Drag handles to trim start/end; drag body to move. All edits go through `comp.setTiming(id, { start, duration })` which keeps the GSAP script and DOM attributes in sync.
59
+
DAW-style per-element tween blocks. Drag handles to trim start/end; drag body to move. All edits go through `comp.setTiming(id, { start, duration })`, which keeps the GSAP script and `data-start`/`data-end` attributes in sync.
`can(op)` returns a `CanResult`: `{ok: true}` or `{ok: false, code, message, hint?}`. The ops panel logs the full result object so you can inspect validation failures in real time.
68
82
69
83
### Editor modal
70
84
71
-
Click "Open editor" to view and directly edit the raw composition HTML. Saving re-opens the composition through the SDK.
85
+
Click "Open editor" to view and directly edit the raw composition HTML. Saving re-opens the composition through the SDK, so all patches and history are reset cleanly.
86
+
87
+
### Event log
88
+
89
+
Every `patch`, `undo`, `redo`, `selectionchange`, and `persist:error` event is logged with its payload. Useful for verifying RFC 6902 patch shape and override-set accumulation.
72
90
73
91
---
74
92
75
93
## Planned / not yet wired
76
94
95
+
-`addGsapKeyframe` / `setGsapKeyframe` / `removeGsapKeyframe` — ops are implemented in the SDK; not yet exposed in the UI
77
96
-`comp.setTrackVariable(trackId, variableId)` — variable binding per track
78
97
-`comp.addElement(spec)` — create new elements from the UI
79
98
-`comp.duplicateElement(id)` — duplicate with offset
- Timeline zoom and horizontal scroll for long compositions
82
-
- Version history browser — list/preview/restore past versions inline (API is implemented; UI shows only list + load-oldest)
83
-
-`comp.on('change', cb)` live event log fed from SDK event stream
101
+
- Version history browser — list/preview/restore past versions inline (listVersions/loadFrom API is implemented; UI shows raw list + load-oldest button only)
84
102
- Render to video via `@hyperframes/producer` integration
0 commit comments