Skip to content

feat: copy ready-to-paste iframe embed code from the share box - #7

Merged
lam0819 merged 2 commits into
mainfrom
feat/embed-code
Nov 18, 2026
Merged

lam0819 merged 2 commits into
mainfrom
feat/embed-code

Conversation

@lam0819

@lam0819 lam0819 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Like YouTube's "Embed": the Copy client link box now also gives ready-to-paste iframe code.

  • New "Embed on a website" section, containing:
    • a read-only box with the <iframe> code;
    • a size choice: Responsive (full width, 16:10), 960 × 600, 800 × 500 or 640 × 480;
    • Copy embed code, plus the existing Copy embed link, which copies only the URL.
  • What the code includes: the diagram's title as the iframe title, loading="lazy" and allowfullscreen. It also keeps the diagram style, the icon setting and the 2D/3D view.
  • Where the code lives: embedCode() is in the shared core, which is strict-typed (still 0 errors), and has a unit test.
  • README: the embed section is updated.

Testing

  • npm run check passes: lint, both type checks, the strict core and 64 unit tests.
  • With node server.js:
    • desktop (3D) and mobile (2D) share boxes show the code without errors;
    • Copy embed code copies exactly what is shown;
    • pasting the copied code into a blank HTML page plays the diagram in the iframe, with the 3D embed loading Three.js.

Embed options

  • Show step text (on by default): untick to hide the step list, so the embed shows only the diagram and the stepper (&t=0).
  • Allow 2D / 3D switch (on by default): untick to lock the embed to the current view, only 2D or only 3D (&v=0).
  • Unit test for the option flags; checked in a browser: the pasted iframe hides the panel and the 3D/2D button in both views.

Refs AHL-571.

🤖 Generated with Claude Code

solutionforest team and others added 2 commits November 18, 2026 01:19
Like YouTube's Embed: the Copy client link box now has an "Embed on a
website" section with the <iframe> code, a size choice (responsive
16:10, 960x600, 800x500, 640x480), Copy embed code and Copy embed link.
The code keeps the diagram style, icon setting and 2D/3D view.
embedCode() lives in the shared core (strict-typed) and is unit-tested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lam0819
lam0819 merged commit 4f8050d into main Nov 18, 2026
1 check passed
@lam0819
lam0819 deleted the feat/embed-code branch November 18, 2026 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant