diff --git a/middleware.version b/middleware.version index c321211375..438394ed0d 100644 --- a/middleware.version +++ b/middleware.version @@ -1 +1 @@ -0.50.3 \ No newline at end of file +0.50.4 diff --git a/package.json b/package.json index db4dba76b6..1523f20abf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anytype", - "version": "0.55.3", + "version": "0.55.4", "description": "Anytype", "main": "electron.js", "scripts": { diff --git a/src/json/text.json b/src/json/text.json index 14cb7cc593..f2482a09e7 100644 --- a/src/json/text.json +++ b/src/json/text.json @@ -825,6 +825,7 @@ "blockEmbedOffline": "You are not connected to the Internet", "blockEmbedUnsupported": "Unsupported embed. Please update the app.", "blockEmbedExternalImage": "External image", + "blockEmbedExcalidrawReadonly": "Excalidraw editing has been disabled due to performance issues. Existing diagrams remain viewable.", "blockTableOfContentsAdd": "Add headings to create a table of contents", diff --git a/src/ts/component/block/embed.tsx b/src/ts/component/block/embed.tsx index f935c09b69..aadec35bd6 100644 --- a/src/ts/component/block/embed.tsx +++ b/src/ts/component/block/embed.tsx @@ -54,9 +54,11 @@ const BlockEmbed = forwardRef((props, ref) => { const [ isShowing, setIsShowing ] = useState(false); const [ isEditing, setIsEditing ] = useState(false); const [ isFullScreen, setIsFullScreen ] = useState(false); - const { rootId, block, readonly, isPopup, onKeyDown, onKeyUp } = props; + const { rootId, block, isPopup, onKeyDown, onKeyUp } = props; const { content, fields, hAlign } = block; const { processor } = content; + const isExcalidrawProcessor = processor == I.EmbedProcessor.Excalidraw; + const readonly = props.readonly || isExcalidrawProcessor; const { width, type, height: fieldHeight } = fields || {}; const cn = [ 'wrap', 'focusable', `c${block.id}` ]; const menuItem: any = U.Menu.getBlockEmbed().find(it => it.id == processor) || { name: '' }; @@ -753,6 +755,13 @@ const BlockEmbed = forwardRef((props, ref) => { }; const onEdit = (e: any) => { + if (isExcalidrawProcessor) { + e.preventDefault(); + e.stopPropagation(); + Preview.toastShow({ text: translate('blockEmbedExcalidrawReadonly') }); + return; + }; + if (readonly) { return; }; @@ -760,9 +769,7 @@ const BlockEmbed = forwardRef((props, ref) => { e.preventDefault(); e.stopPropagation(); - if (processor != I.EmbedProcessor.Excalidraw) { - setIsEditing(true); - }; + setIsEditing(true); }; const save = (update: boolean, callBack?: (message: any) => void) => { diff --git a/src/ts/lib/util/menu.ts b/src/ts/lib/util/menu.ts index fc6e9dfbd3..15ce41a436 100644 --- a/src/ts/lib/util/menu.ts +++ b/src/ts/lib/util/menu.ts @@ -173,7 +173,8 @@ class UtilMenu { { id: I.EmbedProcessor.Graphviz, name: 'Graphviz' }, { id: I.EmbedProcessor.Sketchfab, name: 'Sketchfab' }, { id: I.EmbedProcessor.Drawio, name: 'Draw.io' }, - { id: I.EmbedProcessor.Excalidraw, name: 'Excalidraw' }, + // disabled because of possible performance issues + // { id: I.EmbedProcessor.Excalidraw, name: 'Excalidraw' }, { id: I.EmbedProcessor.Spotify, name: 'Spotify' }, { id: I.EmbedProcessor.AppleMusic, name: 'Apple Music' }, { id: I.EmbedProcessor.Bandcamp, name: 'Bandcamp' },