Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion middleware.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.50.3
0.50.4
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "anytype",
"version": "0.55.3",
"version": "0.55.4",
"description": "Anytype",
"main": "electron.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/json/text.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",

Expand Down
15 changes: 11 additions & 4 deletions src/ts/component/block/embed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ const BlockEmbed = forwardRef<I.BlockRef, I.BlockComponent>((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: '' };
Expand Down Expand Up @@ -753,16 +755,21 @@ const BlockEmbed = forwardRef<I.BlockRef, I.BlockComponent>((props, ref) => {
};

const onEdit = (e: any) => {
if (isExcalidrawProcessor) {
e.preventDefault();
e.stopPropagation();
Preview.toastShow({ text: translate('blockEmbedExcalidrawReadonly') });
return;
};

if (readonly) {
return;
};

e.preventDefault();
e.stopPropagation();

if (processor != I.EmbedProcessor.Excalidraw) {
setIsEditing(true);
};
setIsEditing(true);
};

const save = (update: boolean, callBack?: (message: any) => void) => {
Expand Down
3 changes: 2 additions & 1 deletion src/ts/lib/util/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down
Loading