fix: improve goView iframe detection and locked selection parity
This commit is contained in:
parent
4c96177982
commit
d21806c836
@ -465,7 +465,7 @@ export function Canvas(props: CanvasProps) {
|
|||||||
if (props.selectionIds.includes(node.id)) {
|
if (props.selectionIds.includes(node.id)) {
|
||||||
if (node.locked) {
|
if (node.locked) {
|
||||||
// Locked nodes are selectable, but should not start a move drag.
|
// Locked nodes are selectable, but should not start a move drag.
|
||||||
props.onSelectSingle(node.id);
|
// Keep the current selection intact for multi-select parity.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
props.onBeginMove(e);
|
props.onBeginMove(e);
|
||||||
|
|||||||
@ -182,7 +182,12 @@ function looksLikeIframeOption(option: unknown): boolean {
|
|||||||
// If it isn't an obvious media URL, it's often an iframe/embed.
|
// If it isn't an obvious media URL, it's often an iframe/embed.
|
||||||
// (We deliberately keep this conservative; image/video are handled earlier.)
|
// (We deliberately keep this conservative; image/video are handled earlier.)
|
||||||
return (
|
return (
|
||||||
(/^https?:\/\//i.test(url) || /^data:text\/html/i.test(url)) &&
|
(
|
||||||
|
/^https?:\/\//i.test(url) ||
|
||||||
|
// protocol-relative URLs (//example.com)
|
||||||
|
/^\/\//.test(url) ||
|
||||||
|
/^data:text\/html/i.test(url)
|
||||||
|
) &&
|
||||||
!/\.(png|jpe?g|gif|webp|bmp|svg)(\?|#|$)/i.test(url) &&
|
!/\.(png|jpe?g|gif|webp|bmp|svg)(\?|#|$)/i.test(url) &&
|
||||||
// Avoid misclassifying video streams as iframes.
|
// Avoid misclassifying video streams as iframes.
|
||||||
!/\.(mp4|m3u8|flv|webm|mov|m4v|ogv)(\?|#|$)/i.test(url) &&
|
!/\.(mp4|m3u8|flv|webm|mov|m4v|ogv)(\?|#|$)/i.test(url) &&
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user