Skip to content

feat: Excalidraw embed + bidirectional blog-link cards - #111

Merged
wutongyuonce merged 18 commits into
mainfrom
feat/excalidraw-blog-link-card
Oct 15, 2026
Merged

wutongyuonce merged 18 commits into
mainfrom
feat/excalidraw-blog-link-card

Conversation

@wutongyuonce

@wutongyuonce wutongyuonce commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • :::excalidraw:用 React 岛接官方 @excalidraw/excalidraw(viewMode)渲染 .excalidraw;预览图改为可选降级,不再当主展示。
  • 正文嵌入:单指拖动画布、双指捏合缩放;区域自适应。
  • 展开/外链页:定框画布;单指不平移,双指可缩放;底部缩放指示条(放大变短、缩小变长)。
  • 下载:按钮指向静态 /_media/…/*.excalidraw(不用永久 blob:)。
  • :::blog-link{slug}:构建期标题/描述;圆角方头像;双向靠两边手写卡片。
  • 演示:image-layout-demo.md;文档与 blog-content-publisher skill 已同步。

Verify

  • pnpm format / pnpm check / pnpm build(Node ≥22)
  • 手机上看正文拖移+捏合;展开页定框+底条+下载

Review notes

  • 模块:remark 语法/media-paths 镜像/React 岛画布/prose 样式
  • 请瑀合并(不自动 merge)

Add :::excalidraw (static preview + pan-zoom toolbar + /_media source URL)
and :::blog-link (build-time slug metadata, square-rounded author avatar).
Demo both in the MD custom styles post; document module ownership.
@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
wutong-yu-blog Ready Ready Preview Oct 15, 2026 10:38am UTC

Format the new plugins, viewer CSS, image-interactions, and tests so
CI format check passes. Extend blog-content-publisher skill with
:::excalidraw / :::blog-link placement, preview, and reciprocal-link
authoring notes; tighten 项目解析 wording.
Satisfy eslint no-useless-assignment after Format CI passed.
MIRROR_EXTENSIONS error text dropped「的媒体」; keep assertion flexible.
Replace SVG/PNG-preview-primary viewer with a viewMode canvas island
(like Shiro). Embed allows single-finger pan + pinch; expand locks
single-finger pan, keeps pinch, and shows an inverse zoom bar.
Download uses static /_media URLs; preview image is optional fallback.
Pin @excalidraw/excalidraw@0.17 (same as Shiro), viewMode+zenMode,
hide leftover editor chrome, use 16:9 landscape footprint (max ~500px),
restore zoom%/reset/download toolbars above canvas, sync fonts to
/excalidraw-assets via media-sync.
Rewrite canvas/viewer/CSS to match Shiro Excalidraw.tsx (viewMode+zen,
h-[500px], native pinch/zoom pill, no pointer capture hacks). Keep
dialog expand instead of mobile blob:, add static /_media download.
Zoom bar starts full-width at fit and shortens when zooming in.
Add subtle light/dark shadows on :::blog-link cards.
Hide all native Excalidraw chrome. Custom bottom-right pill with
even icons (−/%/+/reset/expand/download). Card uses ~16:10 with
max-height min(42vh,420px). Expand dialog keeps L–R zoom bar,
download, and single-finger pan lock.
Toolbar ± now sets zoom with scroll offsets so the viewport-center
scene point stays fixed (plain updateScene zoom was origin-anchored
and drifted). Drop expand panLocked so one-finger/mouse pan + pinch
match the embed. SPEC wording updated.
Aspect 16/9 (ref ~871×490); desktop max-height min(36vh, 490px);
mobile ≤640px min(28vh, 240px); pill inset 7px. Docs/demo copy
aligned. Zoom-center and expand pan unchanged.
Bare `16:9` was parsed as text directive `:9`, rendering as 16<9>.
Use ratio character 16∶9 in the custom-styles demo copy.
Replace incorrect sceneX/sceneY scroll rewrite with Excalidraw-native
viewport-center formula (scroll += c * (1/next - 1/prev)). Enable
detectScroll so embed pinch offsets stay fresh. Align pill and expand
zoom-bar clamps with library getNormalizedZoom (0.1–30).
Capture scene-space content center after fitToContent and zoom
multiplicatively (×1.2/÷1.2) while forcing that anchor back to the
viewport center, matching innei-style “always same center” expectation.
Replace the mounted editor with a lazy exporter and a centered custom viewport, and keep the original source download. Also resolve nested blog links, reject unusable drawing libraries, and stop Bilibili autoplay.
Keep both unreleased changelog entries and the shared lockfile entry so the drawing viewer and comments can land together.
@wutongyuonce
wutongyuonce merged commit 346970f into main Oct 15, 2026
2 of 3 checks passed
@wutongyuonce
wutongyuonce deleted the feat/excalidraw-blog-link-card branch October 15, 2026 10:32

This branch was successfully deployed

1 active deployment
Preview — 25180cd8 Deployed Oct 15, 2026 by vercel[bot]
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