Skip to content

Commit

Permalink
Merge pull request transitive-bullshit#102 from NotionX/excalidraw-cl…
Browse files Browse the repository at this point in the history
…oudapp

Added support for excalidraw blocks and cloudapp videos
  • Loading branch information
normdoow committed Jul 8, 2021
2 parents e36785a + da9185d commit 3107d9b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions packages/notion-types/src/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type BlockType =
| 'video'
| 'figma'
| 'typeform'
| 'excalidraw'
| 'tweet'
| 'maps'
| 'pdf'
Expand Down Expand Up @@ -59,6 +60,7 @@ export type Block =
| VideoBlock
| FigmaBlock
| TypeformBlock
| ExcalidrawBlock
| TweetBlock
| PdfBlock
| MapsBlock
Expand Down Expand Up @@ -268,6 +270,10 @@ export interface TypeformBlock extends BaseContentBlock {
type: 'typeform'
}

export interface ExcalidrawBlock extends BaseContentBlock {
type: 'excalidraw'
}

export interface TweetBlock extends BaseContentBlock {
type: 'tweet'
}
Expand Down
2 changes: 2 additions & 0 deletions packages/react-notion-x/src/block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,8 @@ export const Block: React.FC<BlockProps> = (props) => {
// fallthrough
case 'typeform':
// fallthrough
case 'excalidraw':
// fallthrough
case 'image':
// fallthrough
case 'gist':
Expand Down
7 changes: 5 additions & 2 deletions packages/react-notion-x/src/components/asset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const types = [
'embed',
'figma',
'typeform',
'excalidraw',
'maps',
'tweet',
'pdf',
Expand Down Expand Up @@ -132,7 +133,8 @@ export const Asset: React.FC<{
block.type === 'figma' ||
block.type === 'typeform' ||
block.type === 'gist' ||
block.type === 'maps'
block.type === 'maps' ||
block.type === 'excalidraw'
) {
const signedUrl = recordMap.signed_urls[block.id]

Expand All @@ -144,7 +146,8 @@ export const Asset: React.FC<{
signedUrl.indexOf('vimeo') < 0 &&
signedUrl.indexOf('wistia') < 0 &&
signedUrl.indexOf('loom') < 0 &&
signedUrl.indexOf('videoask') < 0
signedUrl.indexOf('videoask') < 0 &&
signedUrl.indexOf('getcloudapp') < 0
) {
content = (
<video
Expand Down

0 comments on commit 3107d9b

Please sign in to comment.