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
|
||||
src={src}
|
||||
isSelected={isSelected}
|
||||
canonicalUrl={node.attrs.href}
|
||||
canonicalUrl={embed.hideToolbar ? undefined : node.attrs.href}
|
||||
title={embed.title}
|
||||
referrerPolicy="origin"
|
||||
border
|
||||
|
||||
@@ -51,6 +51,8 @@ export class EmbedDescriptor {
|
||||
tooltip?: string;
|
||||
/** Whether the embed should be hidden in menus by default */
|
||||
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 */
|
||||
regexMatch?: RegExp[];
|
||||
/**
|
||||
@@ -81,6 +83,7 @@ export class EmbedDescriptor {
|
||||
this.keywords = options.keywords;
|
||||
this.tooltip = options.tooltip;
|
||||
this.defaultHidden = options.defaultHidden;
|
||||
this.hideToolbar = options.hideToolbar;
|
||||
this.regexMatch = options.regexMatch;
|
||||
this.transformMatch = options.transformMatch;
|
||||
this.attrs = options.attrs;
|
||||
@@ -512,6 +515,17 @@ const embeds: EmbedDescriptor[] = [
|
||||
`https://scribehow.com/embed/${matches[1]}`,
|
||||
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({
|
||||
title: "Spotify",
|
||||
keywords: "music",
|
||||
|
||||
Reference in New Issue
Block a user