feat(sdk): can() returns CanResult; T4 dispatch-boundary tests (#1426)

* feat(sdk): can() returns CanResult; T4 dispatch-boundary tests

* fix(sdk): 8 code-review correctness fixes

- setGsapScript: remove element when newScript="" (fixes undo/redo duplicate-script bug)
- parseDeclarations: track quotes so ; inside CSS values (data URIs) doesn't split
- handleRemoveGsapKeyframe: guard against duplicate-percentage ambiguity (return EMPTY)
- resolveKeyframe: return kfs so callers can check uniqueness
- handleSetClassStyle: emit op:"add" (not "replace") when no prior <style> element
- FsAdapter listVersions: Number(f.split("_")[0]) — was NaN due to underscore in key
- FsAdapter doWrite: split try/catch so appendVersion failure doesn't fire error handlers
- FileAdapter playground: add content:"" field to satisfy PersistVersionEntry contract

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(sdk): export CanResult from package root so callers can switch on result.code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Co-authored-by: Miguel Ángel <miguel07alm@protonmail.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Miguel Ángel <miguel07alm@protonmail.com>
This commit is contained in:
Vance Ingalls
2026-06-15 02:02:37 -07:00
committed by GitHub
co-authored by Claude Sonnet 4.6 Miguel Ángel
parent 0a30011abd
commit 5ecaac1fcb
12 changed files with 410 additions and 113 deletions
+6 -1
View File
@@ -177,7 +177,12 @@ export function getGsapScript(document: Document): string | null {
}
export function setGsapScript(document: Document, newScript: string): void {
let el = findGsapScriptElement(document);
const existing = findGsapScriptElement(document);
if (!newScript) {
existing?.remove();
return;
}
let el = existing;
if (!el) {
el = document.createElement("script") as unknown as Element;
const head =