mirror of
https://github.com/docmost/docmost.git
synced 2026-08-28 17:27:06 +08:00
fix: enhance lightbox (#2429)
* fix: close on click outside; smaller icon size * fix: make ALT more visible
This commit is contained in:
@@ -2,7 +2,7 @@ import { Node, mergeAttributes } from "@tiptap/core";
|
||||
import { ResizableNodeView } from "./resizable-nodeview";
|
||||
import type { ResizableNodeViewDirection } from "./resizable-nodeview";
|
||||
import { ReactNodeViewRenderer } from "@tiptap/react";
|
||||
import { normalizeFileUrl } from "./media-utils";
|
||||
import { normalizeFileUrl, syncAltBadge } from "./media-utils";
|
||||
|
||||
export type ExcalidrawResizeOptions = {
|
||||
enabled: boolean;
|
||||
@@ -293,6 +293,8 @@ export const Excalidraw = Node.create<ExcalidrawOptions>({
|
||||
const container = nodeView.dom as HTMLElement;
|
||||
applyAlignment(container, align);
|
||||
|
||||
syncAltBadge(nodeView.wrapper, updatedNode.attrs.alt);
|
||||
|
||||
currentNode = updatedNode;
|
||||
return true;
|
||||
},
|
||||
@@ -310,6 +312,8 @@ export const Excalidraw = Node.create<ExcalidrawOptions>({
|
||||
|
||||
const dom = nodeView.dom as HTMLElement;
|
||||
|
||||
syncAltBadge(nodeView.wrapper, node.attrs.alt);
|
||||
|
||||
applyAlignment(dom, node.attrs.align || "center");
|
||||
|
||||
// Handle percentage width backward compat
|
||||
|
||||
Reference in New Issue
Block a user