Improve legacy iframe/video import + selection parity

This commit is contained in:
clawdbot 2026-01-27 22:37:04 +08:00
parent 502f5ddc69
commit 485af01c17
2 changed files with 17 additions and 5 deletions

View File

@ -430,8 +430,10 @@ export function Canvas(props: CanvasProps) {
// Important: don't collapse a multi-selection on pointerdown.
if (e.button === 2) return;
// ctrl click: multi-select toggle
if (props.keyboard.ctrl) {
const additive = e.ctrlKey || e.metaKey || e.shiftKey;
// Ctrl/Cmd/Shift click: multi-select toggle
if (additive) {
props.onToggleSelect(node.id);
return;
}

View File

@ -106,7 +106,17 @@ function isIframe(c: GoViewComponentLike): boolean {
if (k === 'iframe' || k.includes('iframe')) return true;
// Other names seen in low-code editors for embedded web content.
return k.includes('embed') || k.includes('web') || k.includes('webview') || k.includes('html');
return (
k.includes('embed') ||
k.includes('webview') ||
k.includes('html') ||
k.includes('browser') ||
k.includes('webpage') ||
// keep the plain 'web' check last; it's broad and may overlap other widgets.
k === 'web' ||
k.endsWith('_web') ||
k.startsWith('web_')
);
}
function isVideo(c: GoViewComponentLike): boolean {
@ -146,7 +156,7 @@ function looksLikeIframeOption(option: unknown): boolean {
return (
(/^https?:\/\//i.test(url) || /^data:text\/html/i.test(url)) &&
!/\.(png|jpe?g|gif|webp|bmp|svg)(\?|#|$)/i.test(url) &&
!/\.(mp4|m3u8|flv)(\?|#|$)/i.test(url)
!/\.(mp4|m3u8|flv|webm|mov|m4v|ogv)(\?|#|$)/i.test(url)
);
}
@ -161,7 +171,7 @@ function looksLikeVideoOption(option: unknown): boolean {
if (!url) return false;
// Common direct URL patterns.
if (/\.(mp4|m3u8|flv)(\?|#|$)/i.test(url)) return true;
if (/\.(mp4|m3u8|flv|webm|mov|m4v|ogv)(\?|#|$)/i.test(url)) return true;
if (/\bm3u8\b/i.test(url)) return true;
// Streaming-ish protocols (seen in CCTV/camera widgets).