1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-10 18:10:54 +09:00

JS-3342: basic

This commit is contained in:
Mike Mhlv 2023-11-30 15:29:39 +00:00
parent c59fe496cd
commit fae564c7fb
No known key found for this signature in database
GPG key ID: 82F8AC181346CE7F
5 changed files with 12 additions and 4 deletions

View file

@ -462,6 +462,7 @@
"blockTextVimeo": "...",
"blockTextChart": "...",
"blockTextSoundcloud": "...",
"blockTextGoogleMaps": "...",
"blockLinkSyncing": "Syncing...",
"blockLinkArchived": "Deleted",

View file

@ -410,7 +410,8 @@ const BlockEmbed = observer(class BlockEmbedIndex extends React.Component<I.Bloc
case I.EmbedProcessor.Mermaid: return 'yaml';
case I.EmbedProcessor.Chart: return 'js';
case I.EmbedProcessor.Youtube:
case I.EmbedProcessor.Vimeo: return 'html';
case I.EmbedProcessor.Vimeo:
case I.EmbedProcessor.GoogleMaps: return 'html';
};
};
@ -591,4 +592,4 @@ const BlockEmbed = observer(class BlockEmbedIndex extends React.Component<I.Bloc
});
export default BlockEmbed;
export default BlockEmbed;

View file

@ -7,6 +7,7 @@ export enum EmbedProcessor {
Youtube = 3,
Vimeo = 4,
Soundcloud = 5,
GoogleMaps = 6,
};
export interface ContentEmbed {
@ -16,4 +17,4 @@ export interface ContentEmbed {
export interface BlockEmbed extends I.Block {
content: ContentEmbed;
};
};

View file

@ -19,6 +19,10 @@ class UtilEmbed {
return `<iframe src="${content}" width="640" height="360" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>`;
};
getGoogleMapsHtml (content: string): string {
return `<iframe src="${content}" width="640" height="360" frameborder="0" allowfullscreen loading="lazy"></iframe>`;
};
getProcessorByUrl (url: string): I.EmbedProcessor {
let p = null;
for (let i in DOMAINS) {
@ -53,4 +57,4 @@ class UtilEmbed {
};
export default new UtilEmbed();
export default new UtilEmbed();

View file

@ -60,6 +60,7 @@ class UtilMenu {
{ type: I.BlockType.Embed, id: I.EmbedProcessor.Youtube, icon: 'youtube', name: 'Youtube' },
{ type: I.BlockType.Embed, id: I.EmbedProcessor.Vimeo, icon: 'vimeo', name: 'Vimeo' },
{ type: I.BlockType.Embed, id: I.EmbedProcessor.Soundcloud, icon: 'soundcloud', name: 'Soundcloud' },
{ type: I.BlockType.Embed, id: I.EmbedProcessor.GoogleMaps, icon: 'googleMaps', name: 'Google maps' },
].map(this.mapperBlock).map(it => {
it.icon = UtilCommon.toCamelCase(`embed-${it.icon}`);
return it;