Skip to content

Commit 9fb05ed

Browse files
committed
feat(docs): share-URL permalinks + copy-as-Mermaid + copy-as-Go-builder
Viral primitive that turns the visualizer into a sharable artifact. - New utils/share-url.ts: - encodeMachine / decodeMachine (URL-safe base64 over JSON) - readMachineFromHash() inspects #m=... on load - buildPermalink(machine) emits a self-referential URL - machineToMermaid generates a stateDiagram-v2 snippet - machineToGoBuilder synthesizes a NewMachine[struct{}] chain - JsonImporter.vue: on mount, prefer machine in URL hash before the first-visit sample. Permalinks always land on the shared machine. - MachineJson.vue: panel grows three new copy buttons (Permalink, Mermaid, Go) alongside Copy JSON. State tracking switched from boolean to a CopyKind discriminator so the right button shows "Copied!". 2x2 grid layout via .share-actions. - ARIA: panel-header collapse button now exposes aria-expanded; decorative SVGs marked aria-hidden. - Clipboard refactored into a single copyText helper that retains the navigator.clipboard → execCommand fallback path. Source: 4-expert website review — Product dimension top-3 ROI move ("share-URL + LZ-compressed JSON in hash" + "copy as Mermaid" + "copy as Go builder"). Compression deferred until size becomes a concrete issue.
1 parent 29db71c commit 9fb05ed

9 files changed

Lines changed: 259 additions & 28 deletions

File tree

docs/dist/_astro/Visualizer.DaxdaO-Q.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/dist/_astro/Visualizer.ygFTUKj5.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/dist/_astro/runtime-dom.esm-bundler.RaxKAfIK.js renamed to docs/dist/_astro/runtime-dom.esm-bundler.WwE3ir1L.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)