-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from 10play/doc-p1
doc p1
- Loading branch information
Showing
13 changed files
with
94 additions
and
24 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
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
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,36 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
# EditorBridge | ||
|
||
interface of all the interactions you can do with the editor on the react native side, can be extendable with BrideExtension, with tentapStarterkit enable (also when simple usage) the EditorBridge will have: | ||
|
||
| name | type | description | BrideExtension | | ||
| ------------------------------ | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | | ||
| focus | (pos?: 'start' \| 'end' \| 'all' \| number \| boolean \| null) => void | a function that will focus the editor and make sure to open keyboard | core | | ||
| webviewRef | RefObject\<WebView\> | a ref for the webview that show the editor | core | | ||
| getEditorState | () => BridgeState | a function that will return the most up to date BridgeState | core | | ||
| getContent | () => Promise\<string\> | an async function that will return the content of the editor | core | | ||
| setContent | (content: string) => void | a function that get html as string and set the editor content by that | core | | ||
| setSelection | (from: number, to: number) => void | a function that get position and set the selection | core | | ||
| updateScrollThresholdAndMargin | (offset: number) => void | a function that get offset in px and change [scrollThreshold](https://prosemirror.net/docs/ref/#view.EditorProps.scrollThreshold) [scrollMargin](https://prosemirror.net/docs/ref/#view.EditorProps.scrollMargin) | core | | ||
| toggleBlockquote | () => void | will toggle bold on the editor if possible | staterKit | | ||
| toggleCodeBlock | () => void | will toggle code block on the editor if possible | staterKit | | ||
| toggleItalic | () => void | will toggle italic on the editor if possible | staterKit | | ||
| toggleStrikethrough | () => void | will toggle strikethrough on the editor if possible | staterKit | | ||
| toggleBulletList | () => void | will toggle bullet list on the editor if possible | staterKit | | ||
| toggleOrderedList | () => void | will toggle order list on the editor if possible | staterKit | | ||
| toggleHeading | (level: number) => void | will get level and will toggle heading on the editor if possible | staterKit | | ||
| lift | () => void | will lift p on the editor if possible | staterKit | | ||
| sink | () => void | will sink p on the editor if possible | staterKit | | ||
| undo | () => void | will undo the last history transaction if possible | staterKit | | ||
| redo | () => void | will redo the last undo transaction if possible | staterKit | | ||
| setColor | (color: string) => void | get color string and set it for the editor | color | | ||
| setHighlight | (color: string) => void | get color string and set highlight for the editor | highlight | | ||
| setImage | (src: string) => void | get image url string and set image | image | | ||
| setLink | (link: string \| null) => void | get link url as string and set link, in case of null it will remove the link | link | | ||
| toggleTaskList | () => void | will toggle task list on the editor if possible | tasklist | | ||
| toggleUnderline | () => void | will toggle underline on the editor if possible | underline | | ||
|
||
<!-- toggleUnderline: () => void; --> |
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,7 @@ | ||
{ | ||
"label": "API", | ||
"position": 3, | ||
"link": { | ||
"type": "generated-index" | ||
} | ||
} |
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,17 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# useNativeEditor | ||
|
||
a react hook that will return [EditorBridge](./EditorBridge) | ||
|
||
| name | type | default | description | | ||
| ---------------- | ----------------- | ------------------------ | --------------------------------------------------------------------------------------------------------- | | ||
| bridgeExtensions | BridgeExtension[] | undefind | A list of BridgeExtensions that will be add to the editor on the native side | | ||
| initialContent | string | undefind | initial content that will be loaded first on the editor | | ||
| autofocus | boolean | false | when true the editor will auto focus | | ||
| avoidIosKeyboard | boolean | false | On iOS help to handle follow cursor when the editor is fullpage and the iOS keyboard hide the bottom part | | ||
| customSource | string | SimpleEditorBundleString | prop that can help for advance usage, an HTML string that will replace the default simple editor | | ||
| DEV | boolean | false | prop that can help for advance usage, when true editor will be loaded by DEV_SERVER_URL | | ||
| DEV_SERVER_URL | string | http://localhost:3000 | prop that can help for advance usage, a url string that point to the editor dev server | |
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