-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add @udecode/plate library and migrate various custom slate code to it (closes #68 ) - add toolbar and various wysiwyg shortcuts - add fancy code blocks - add list support (through shortcuts only) - remove markdown support - add a test for the parse step, even though i cannot get it to run :| - add a top-level ErrorBoundary - update remark related dependencies - organize and refactor remark usage post upgrade #49 - clean-out a few other unused dependencies #38 - move rebuild from postinstall to specific command (avoids rebuilding every dependency change)
- Loading branch information
Showing
37 changed files
with
4,381 additions
and
1,503 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,3 @@ tmp/ | |
# build output | ||
dist/ | ||
packaged/ | ||
|
||
# Generated prisma client | ||
# Configured in schema.prisma | ||
prisma/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import React from "react"; | ||
import { Pane, Alert } from "evergreen-ui"; | ||
|
||
interface State { | ||
hasError: boolean; | ||
error: any; | ||
} | ||
|
||
export default class ErrorBoundary extends React.Component<any, State> { | ||
constructor(props: any) { | ||
super(props); | ||
this.state = { hasError: false, error: null }; | ||
} | ||
|
||
static getDerivedStateFromError(error: any) { | ||
// Update state so the next render will show the fallback UI. | ||
return { hasError: true, error }; | ||
} | ||
|
||
componentDidCatch(error: any, errorInfo: any) { | ||
// You can also log the error to an error reporting service | ||
console.error("top level error boundary reached:", error, errorInfo); | ||
} | ||
|
||
renderError() { | ||
let errStr: string = "Unable to parse error for display. Check console? :|"; | ||
let stack: string = ""; | ||
try { | ||
if (this.state.error instanceof Error) { | ||
errStr = this.state.error.message; | ||
stack = this.state.error.stack || ""; | ||
} else if (typeof this.state.error === "string") { | ||
errStr = this.state.error; | ||
} else { | ||
errStr = JSON.stringify(this.state.error, null, 2); | ||
} | ||
errStr = JSON.stringify(this.state.error, null, 2); | ||
} catch (err) { | ||
console.error( | ||
"Error parsing error to string in top-level Error boundary" | ||
); | ||
} | ||
|
||
return ( | ||
<Pane padding={50}> | ||
<Alert intent="danger" title="Unhandled Error" overflow="auto"> | ||
<p>There was an unhandled error that crashed the app</p> | ||
<pre>{errStr}</pre> | ||
<pre>{stack}</pre> | ||
</Alert> | ||
</Pane> | ||
); | ||
} | ||
|
||
render() { | ||
if (this.state.hasError) { | ||
return this.renderError(); | ||
} | ||
|
||
return this.props.children; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.