feat: Add support SmartSuite embeds
This commit is contained in:
BIN
public/images/smartsuite.png
Normal file
BIN
public/images/smartsuite.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
@@ -45,7 +45,7 @@ const EmbedComponent = ({
|
|||||||
<Frame
|
<Frame
|
||||||
src={src}
|
src={src}
|
||||||
isSelected={isSelected}
|
isSelected={isSelected}
|
||||||
canonicalUrl={node.attrs.href}
|
canonicalUrl={embed.hideToolbar ? undefined : node.attrs.href}
|
||||||
title={embed.title}
|
title={embed.title}
|
||||||
referrerPolicy="origin"
|
referrerPolicy="origin"
|
||||||
border
|
border
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ export class EmbedDescriptor {
|
|||||||
tooltip?: string;
|
tooltip?: string;
|
||||||
/** Whether the embed should be hidden in menus by default */
|
/** Whether the embed should be hidden in menus by default */
|
||||||
defaultHidden?: boolean;
|
defaultHidden?: boolean;
|
||||||
|
/** Whether the bottom toolbar should be hidden – use this when the embed itself includes a footer */
|
||||||
|
hideToolbar?: boolean;
|
||||||
/** A regex that will be used to match the embed when pasting a URL */
|
/** A regex that will be used to match the embed when pasting a URL */
|
||||||
regexMatch?: RegExp[];
|
regexMatch?: RegExp[];
|
||||||
/**
|
/**
|
||||||
@@ -81,6 +83,7 @@ export class EmbedDescriptor {
|
|||||||
this.keywords = options.keywords;
|
this.keywords = options.keywords;
|
||||||
this.tooltip = options.tooltip;
|
this.tooltip = options.tooltip;
|
||||||
this.defaultHidden = options.defaultHidden;
|
this.defaultHidden = options.defaultHidden;
|
||||||
|
this.hideToolbar = options.hideToolbar;
|
||||||
this.regexMatch = options.regexMatch;
|
this.regexMatch = options.regexMatch;
|
||||||
this.transformMatch = options.transformMatch;
|
this.transformMatch = options.transformMatch;
|
||||||
this.attrs = options.attrs;
|
this.attrs = options.attrs;
|
||||||
@@ -512,6 +515,17 @@ const embeds: EmbedDescriptor[] = [
|
|||||||
`https://scribehow.com/embed/${matches[1]}`,
|
`https://scribehow.com/embed/${matches[1]}`,
|
||||||
icon: <Img src="/images/scribe.png" alt="Scribe" />,
|
icon: <Img src="/images/scribe.png" alt="Scribe" />,
|
||||||
}),
|
}),
|
||||||
|
new EmbedDescriptor({
|
||||||
|
title: "SmartSuite",
|
||||||
|
regexMatch: [
|
||||||
|
new RegExp("^https?://app\\.smartsuite\\.com/shared/(.*)(?:\\?)?(?:.*)$"),
|
||||||
|
],
|
||||||
|
icon: <Img src="/images/smartsuite.png" alt="SmartSuite" />,
|
||||||
|
defaultHidden: true,
|
||||||
|
hideToolbar: true,
|
||||||
|
transformMatch: (matches: RegExpMatchArray) =>
|
||||||
|
`https://app.smartsuite.com/shared/${matches[1]}?embed=true&header=false&toolbar=true`,
|
||||||
|
}),
|
||||||
new EmbedDescriptor({
|
new EmbedDescriptor({
|
||||||
title: "Spotify",
|
title: "Spotify",
|
||||||
keywords: "music",
|
keywords: "music",
|
||||||
|
|||||||
Reference in New Issue
Block a user