forked from remirror/remirror
-
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.
docs: initial improvements after v1 (remirror#1010)
- Loading branch information
Showing
324 changed files
with
5,460 additions
and
31,284 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": ["@changesets/changelog-github", { "repo": "remirror/remirror" }], | ||
"ignore": ["storybook-react", "support", "testing", "website", "with-next", "with-react-native"], | ||
"ignore": ["storybook-react", "support", "testing", "website"], | ||
"updateInternalDependencies": "patch", | ||
"commit": false, | ||
"linked": [], | ||
|
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,5 @@ | ||
--- | ||
'@remirror/core-utils': patch | ||
--- | ||
|
||
`isDomNode` returns false when `document` is not defined. |
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,19 @@ | ||
--- | ||
'create-context-state': patch | ||
'@remirror/dev': patch | ||
'@remirror/extension-react-component': patch | ||
'@remirror/extension-react-native-bridge': patch | ||
'@remirror/extension-react-ssr': patch | ||
'@remirror/extension-react-tables': patch | ||
'@remirror/react-components': patch | ||
'@remirror/react-core': patch | ||
'@remirror/react-editors': patch | ||
'@remirror/react-hooks': patch | ||
'@remirror/react-native': patch | ||
'@remirror/react-renderer': patch | ||
'@remirror/react-ssr': patch | ||
'@remirror/react-utils': patch | ||
'@remirror/styles': patch | ||
--- | ||
|
||
Add support for `react@18` in peer dependencies. |
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,13 @@ | ||
--- | ||
'jest-prosemirror': patch | ||
'jest-remirror': patch | ||
'multishift': patch | ||
'prosemirror-paste-rules': patch | ||
'prosemirror-resizable-view': patch | ||
'prosemirror-suggest': patch | ||
'prosemirror-trailing-node': patch | ||
'remirror': patch | ||
'@remirror/cli': patch | ||
--- | ||
|
||
Upgrade dependencies. |
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,8 @@ | ||
--- | ||
hide_title: true | ||
title: API | ||
--- | ||
|
||
# API | ||
|
||
Explore the `remirror` API. |
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,8 @@ | ||
--- | ||
hide_title: true | ||
title: 'blur' | ||
--- | ||
|
||
# `blur` | ||
|
||
Blur focus from the editor and also update the selection at the same time. |
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,24 @@ | ||
--- | ||
hide_title: true | ||
title: 'focus' | ||
--- | ||
|
||
# `focus` | ||
|
||
Set the focus for the editor. | ||
|
||
If using this with chaining this should only be placed at the end of the chain. It can cause hard to debug issues when used in the middle of a chain. | ||
|
||
```tsx | ||
import { useCallback } from 'react'; | ||
import { useRemirrorContext } from '@remirror/react'; | ||
|
||
const MenuButton = () => { | ||
const { chain } = useRemirrorContext(); | ||
const onClick = useCallback(() => { | ||
chain.toggleBold().focus('end').run(); | ||
}, [chain]); | ||
|
||
return <button onClick={onClick}>Bold</button>; | ||
}; | ||
``` |
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
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,103 @@ | ||
--- | ||
hide_title: true | ||
title: MarkdownExtension | ||
--- | ||
|
||
import { Example } from '@components'; | ||
|
||
# `MarkdownExtension` | ||
|
||
## Summary | ||
|
||
This extension transforms the **ProseMirror** content of your editor to markdown syntax. It also transforms markdown syntax into a **ProseMirror** document. | ||
|
||
## Features | ||
|
||
### Reduced Storage | ||
|
||
Markdown can be used to reduce the storage needed for your documents. It takes less space than a JSON object describing the same editor content. | ||
|
||
The following example shows a hook which can be used to automatically persist content as markdown. | ||
|
||
<Example name="" /> | ||
|
||
```ts | ||
import delay from 'delay'; | ||
import { useCallback, useState } from 'react'; | ||
import { useHelpers, useKeymap } from '@remirror/react'; | ||
|
||
async function saveContent(content: string) { | ||
// Fake API call | ||
await delay(1000); | ||
} | ||
|
||
interface UseSaveHook { | ||
saving: boolean; | ||
error: Error | undefined; | ||
} | ||
|
||
// Create a hook which saves the content as markdown whenever `Ctrl-s` on Mac `Cmd-s` is pressed. | ||
function useSaveHook() { | ||
const helpers = useHelpers(); | ||
const [state, setState] = useState<UseSaveHook>({ saving: false, error: undefined }); | ||
|
||
useKeymap( | ||
'Mod-s', | ||
useCallback(() => { | ||
// Convert the editor content to markdown. | ||
const markdown = helpers.getMarkdown(); | ||
|
||
setState({ saving: true, error: undefined }); | ||
|
||
saveContent(markdown) | ||
.then(() => { | ||
setState({ saving: false, error: undefined }); | ||
}) | ||
.catch((error) => { | ||
setState({ saving: true, error }); | ||
}); | ||
|
||
return true; | ||
}, [helpers]), | ||
); | ||
|
||
return state; | ||
} | ||
``` | ||
|
||
### Transform existing Markdown | ||
|
||
If you already have a lot of markdown content this can be used to transform the markdown content into a ProseMirror `doc` node for your editor. | ||
|
||
- The entire document can be set with a markdown string. | ||
- Insert any markdown content into the document at any insertion point. | ||
|
||
## Usage | ||
|
||
### Installation | ||
|
||
This extension is installed for you when you install the main `remirror` package. | ||
|
||
You can use the imports in the following way. | ||
|
||
```ts | ||
import { MarkdownExtension, MarkdownOptions } from 'remirror/extensions'; | ||
``` | ||
|
||
To install it directly you can use | ||
|
||
The extension is provided by the `@remirror/extension-markdown` package. There are two ways of pulling it into your project. | ||
|
||
### Examples | ||
|
||
#### A pure markdown editor | ||
|
||
#### A dual editor with markdown | ||
|
||
## API | ||
|
||
### Options | ||
|
||
### Commands | ||
|
||
### Helpers |
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,22 @@ | ||
--- | ||
hide_title: true | ||
title: 'useCommands' | ||
--- | ||
|
||
# `useCommands` | ||
|
||
A core hook which provides the commands for usage in your editor. | ||
|
||
```tsx | ||
import { useCommands } from '@remirror/react'; | ||
|
||
const EditorButton = () => { | ||
const commands = useCommands(); | ||
|
||
return ( | ||
<> | ||
<button onClick={() => commands.toggleBold()}>Click me!</button> | ||
</> | ||
); | ||
}; | ||
``` |
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,14 @@ | ||
--- | ||
hide_title: true | ||
title: '@remirror/extension-markdown' | ||
--- | ||
|
||
# `remirror__extension-markdown` | ||
|
||
## Summary | ||
|
||
<!-- Provide a concise summary of what the documentation is about. --> | ||
|
||
## Features | ||
|
||
<!-- Each feature should be placed under a sub-heading. Begin with problems this extension solves. --> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.