Skip to content

Commit

Permalink
consolidate CodeEditor to components/CodeEditor, allow resize, use gi…
Browse files Browse the repository at this point in the history
…thub themes
  • Loading branch information
notsidney committed Oct 20, 2021
1 parent fdb1a51 commit fe82b15
Show file tree
Hide file tree
Showing 23 changed files with 1,526 additions and 630 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -14,7 +14,7 @@
"@emotion/styled": "^11.3.0",
"@hookform/resolvers": "^2.8.1",
"@mdi/js": "^6.2.95",
"@monaco-editor/react": "^4.1.0",
"@monaco-editor/react": "^4.3.1",
"@mui/icons-material": "^5.0.0",
"@mui/lab": "^5.0.0-alpha.50",
"@mui/material": "^5.0.0",
Expand Down
10 changes: 10 additions & 0 deletions src/assets/icons/ResizeBottomRight.tsx
@@ -0,0 +1,10 @@
import SvgIcon, { SvgIconProps } from "@mui/material/SvgIcon";
import { mdiResizeBottomRight } from "@mdi/js";

export default function ResizeBottomRight(props: SvgIconProps) {
return (
<SvgIcon {...props}>
<path d={mdiResizeBottomRight} />
</SvgIcon>
);
}
114 changes: 0 additions & 114 deletions src/components/CodeEditor.tsx

This file was deleted.

File renamed without changes.
97 changes: 97 additions & 0 deletions src/components/CodeEditor/extensions.d.ts
@@ -0,0 +1,97 @@
type Trigger = "create" | "update" | "delete";
type Triggers = Trigger[];

// function types that defines extension body and should run
type Condition =
| boolean
| ((data: ExtensionContext) => boolean | Promise<boolean>);

// the argument that the extension body takes in
type ExtensionContext = {
row: Row;
ref: FirebaseFirestore.DocumentReference;
storage: firebasestorage.Storage;
db: FirebaseFirestore.Firestore;
auth: adminauth.BaseAuth;
change: any;
triggerType: Triggers;
fieldTypes: any;
extensionConfig: {
label: string;
type: string;
triggers: Trigger[];
conditions: Condition;
requiredFields: string[];
extensionBody: any;
};
utilFns: any;
};

// extension body definition
type slackEmailBody = {
channels?: string[];
text?: string;
emails: string[];
blocks?: object[];
attachments?: any;
};

type slackChannelBody = {
channels: string[];
text?: string;
emails?: string[];
blocks?: object[];
attachments?: any;
};

type DocSyncBody = (context: ExtensionContext) => Promise<{
fieldsToSync: Fields;
row: Row;
targetPath: string;
}>;

type HistorySnapshotBody = (context: ExtensionContext) => Promise<{
trackedFields: Fields;
}>;

type AlgoliaIndexBody = (context: ExtensionContext) => Promise<{
fieldsToSync: Fields;
index: string;
row: Row;
objectID: string;
}>;

type MeiliIndexBody = (context: ExtensionContext) => Promise<{
fieldsToSync: Fields;
index: string;
row: Row;
objectID: string;
}>;

type BigqueryIndexBody = (context: ExtensionContext) => Promise<{
fieldsToSync: Fields;
index: string;
row: Row;
objectID: string;
}>;

type SlackMessageBody = (
context: ExtensionContext
) => Promise<slackEmailBody | slackChannelBody>;

type SendgridEmailBody = (context: ExtensionContext) => Promise<any>;

type ApiCallBody = (context: ExtensionContext) => Promise<{
body: string;
url: string;
method: string;
callback: any;
}>;

type TwilioMessageBody = (context: ExtensionContext) => Promise<{
body: string;
from: string;
to: string;
}>;

type TaskBody = (context: ExtensionContext) => Promise<any>;
File renamed without changes.
File renamed without changes.
Expand Up @@ -844,9 +844,9 @@ declare namespace FirebaseFirestore {
* `exists` property will always be true and `data()` will never return
* 'undefined'.
*/
export class QueryDocumentSnapshot<T = DocumentData> extends DocumentSnapshot<
T
> {
export class QueryDocumentSnapshot<
T = DocumentData
> extends DocumentSnapshot<T> {
private constructor();

/**
Expand Down

0 comments on commit fe82b15

Please sign in to comment.