chore: More type improvements

This commit is contained in:
Tom Moor
2021-12-12 18:44:32 -08:00
parent 46f839431b
commit 0340149457
8 changed files with 176 additions and 209 deletions

View File

@@ -1,4 +1,5 @@
import * as React from "react";
import { EmbedDescriptor } from "rich-markdown-editor/dist/types";
import styled from "styled-components";
import Abstract from "./Abstract";
import Airtable from "./Airtable";
@@ -43,7 +44,7 @@ export type EmbedProps = {
};
function matcher(Component: React.ComponentType<EmbedProps>) {
return (url: string) => {
return (url: string): boolean | [] | RegExpMatchArray => {
// @ts-expect-error not aware of static
const regexes = Component.ENABLED;
@@ -55,7 +56,7 @@ function matcher(Component: React.ComponentType<EmbedProps>) {
}
}
return undefined;
return false;
};
}
@@ -65,7 +66,7 @@ const Img = styled(Image)`
height: 18px;
`;
export default [
const embeds: EmbedDescriptor[] = [
{
title: "Abstract",
keywords: "design",
@@ -162,6 +163,7 @@ export default [
},
{
title: "Google Docs",
keywords: "documents word",
icon: () => <Img src="/images/google-docs.png" alt="Google Docs" />,
component: GoogleDocs,
matcher: matcher(GoogleDocs),
@@ -298,3 +300,5 @@ export default [
matcher: matcher(YouTube),
},
];
export default embeds;

View File

@@ -88,65 +88,6 @@
"Currently editing": "Currently editing",
"Currently viewing": "Currently viewing",
"Viewed {{ timeAgo }} ago": "Viewed {{ timeAgo }} ago",
"Insert column after": "Insert column after",
"Insert column before": "Insert column before",
"Insert row after": "Insert row after",
"Insert row before": "Insert row before",
"Align center": "Align center",
"Align left": "Align left",
"Align right": "Align right",
"Bulleted list": "Bulleted list",
"Todo list": "Task list",
"Code block": "Code block",
"Copied to clipboard": "Copied to clipboard",
"Code": "Code",
"Create link": "Create link",
"Sorry, an error occurred creating the link": "Sorry, an error occurred creating the link",
"Create a new doc": "Create a new doc",
"Delete column": "Delete column",
"Delete row": "Delete row",
"Delete table": "Delete table",
"Delete image": "Delete image",
"Download image": "Download image",
"Float left": "Float left",
"Float right": "Float right",
"Center large": "Center large",
"Italic": "Italic",
"Sorry, that link wont work for this embed type": "Sorry, that link wont work for this embed type",
"Find or create a doc": "Find or create a doc",
"Big heading": "Big heading",
"Medium heading": "Medium heading",
"Small heading": "Small heading",
"Heading": "Heading",
"Divider": "Divider",
"Image": "Image",
"Sorry, an error occurred uploading the image": "Sorry, an error occurred uploading the image",
"Write a caption": "Write a caption",
"Info": "Info",
"Info notice": "Info notice",
"Link": "Link",
"Link copied to clipboard": "Link copied to clipboard",
"Highlight": "Highlight",
"Type '/' to insert": "Type '/' to insert",
"Keep typing to filter": "Keep typing to filter",
"No results": "No results",
"Open link": "Open link",
"Ordered list": "Ordered list",
"Page break": "Page break",
"Paste a link": "Paste a link",
"Paste a {{service}} link…": "Paste a {{service}} link…",
"Placeholder": "Placeholder",
"Quote": "Quote",
"Remove link": "Remove link",
"Search or paste a link": "Search or paste a link",
"Strikethrough": "Strikethrough",
"Bold": "Bold",
"Subheading": "Subheading",
"Table": "Table",
"Tip": "Tip",
"Tip notice": "Tip notice",
"Warning": "Warning",
"Warning notice": "Warning notice",
"Module failed to load": "Module failed to load",
"Loading Failed": "Loading Failed",
"Sorry, part of the application failed to load. This may be because it was updated since you opened the tab or because of a failed network request. Please try reloading.": "Sorry, part of the application failed to load. This may be because it was updated since you opened the tab or because of a failed network request. Please try reloading.",
@@ -209,8 +150,68 @@
"Export": "Export",
"Integrations": "Integrations",
"Installation": "Installation",
"No results": "No results",
"Previous page": "Previous page",
"Next page": "Next page",
"Insert column after": "Insert column after",
"Insert column before": "Insert column before",
"Insert row after": "Insert row after",
"Insert row before": "Insert row before",
"Align center": "Align center",
"Align left": "Align left",
"Align right": "Align right",
"Bulleted list": "Bulleted list",
"Todo list": "Task list",
"Code block": "Code block",
"Copied to clipboard": "Copied to clipboard",
"Code": "Code",
"Create link": "Create link",
"Sorry, an error occurred creating the link": "Sorry, an error occurred creating the link",
"Create a new doc": "Create a new doc",
"Delete column": "Delete column",
"Delete row": "Delete row",
"Delete table": "Delete table",
"Delete image": "Delete image",
"Download image": "Download image",
"Replace image": "Replace image",
"Float left": "Float left",
"Float right": "Float right",
"Center large": "Center large",
"Italic": "Italic",
"Sorry, that link wont work for this embed type": "Sorry, that link wont work for this embed type",
"Find or create a doc": "Find or create a doc",
"Big heading": "Big heading",
"Medium heading": "Medium heading",
"Small heading": "Small heading",
"Heading": "Heading",
"Divider": "Divider",
"Image": "Image",
"Sorry, an error occurred uploading the image": "Sorry, an error occurred uploading the image",
"Write a caption": "Write a caption",
"Info": "Info",
"Info notice": "Info notice",
"Link": "Link",
"Link copied to clipboard": "Link copied to clipboard",
"Highlight": "Highlight",
"Type '/' to insert": "Type '/' to insert",
"Keep typing to filter": "Keep typing to filter",
"Open link": "Open link",
"Ordered list": "Ordered list",
"Page break": "Page break",
"Paste a link": "Paste a link",
"Paste a {{service}} link…": "Paste a {{service}} link…",
"Placeholder": "Placeholder",
"Quote": "Quote",
"Remove link": "Remove link",
"Search or paste a link": "Search or paste a link",
"Strikethrough": "Strikethrough",
"Bold": "Bold",
"Subheading": "Subheading",
"Table": "Table",
"Tip": "Tip",
"Tip notice": "Tip notice",
"Warning": "Warning",
"Warning notice": "Warning notice",
"Could not import file": "Could not import file",
"Switch team": "Switch team",
"Show path to document": "Show path to document",