-
Notifications
You must be signed in to change notification settings - Fork 0
[update] RichText 2.0 #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
778f6e9
[update] RichText 2.0
serhiipylypchuk1991 aba23eb
[dev] refactoring
serhiipylypchuk1991 88b3de8
Add properties description
serhiipylypchuk1991 1bf2916
Add basic methods description
serhiipylypchuk1991 dea2f9e
Update configs
serhiipylypchuk1991 0875364
Update methods
serhiipylypchuk1991 7af7071
Update internal methods
serhiipylypchuk1991 8b3e514
Update internal methods
serhiipylypchuk1991 b573291
Add minor fixes
serhiipylypchuk1991 403e3a6
[update] events description
serhiipylypchuk1991 b7d727a
[update] minor fixes
serhiipylypchuk1991 727cb94
[add] screenshots for guides
serhiipylypchuk1991 b5ab5f2
[update] react, angular, vue guides
serhiipylypchuk1991 eca2cda
[update] how to start and overview guides
serhiipylypchuk1991 8580bbc
[update] svelte integration guide
serhiipylypchuk1991 9cadff4
[update] initialization guide + sidebar
serhiipylypchuk1991 9ba8e4e
[add] TypeScript document
serhiipylypchuk1991 49ca2ea
[update] link events
serhiipylypchuk1991 b291b29
[add] show popup
serhiipylypchuk1991 293b304
[update] screenshots
serhiipylypchuk1991 2b8eb42
[update] fullscreen mode
serhiipylypchuk1991 e87ed57
[update] minor style changes
serhiipylypchuk1991 a2144e3
[update] config and methods
serhiipylypchuk1991 642ac26
[update] localization
serhiipylypchuk1991 6a2caf2
[update] wn and migration
serhiipylypchuk1991 91deb5f
[update] minor changes
serhiipylypchuk1991 f0c26fe
[update] migration links
serhiipylypchuk1991 a4f3209
[update] links
serhiipylypchuk1991 40eee13
[update] minor changes
serhiipylypchuk1991 ccff048
[update] wn and minor fixes
serhiipylypchuk1991 fe53831
[update] minor fixes
serhiipylypchuk1991 6e0f7b8
[update] minor fixes
serhiipylypchuk1991 0d1d113
[update] wn (new style and extended description)
serhiipylypchuk1991 f453269
[update] wn and screenshots
serhiipylypchuk1991 ecda638
[text] migration
serhiipylypchuk1991 929b14c
[update] shortcuts
serhiipylypchuk1991 5316a2c
[update] migration
serhiipylypchuk1991 50fa416
[update] minor changes after review (developer)
serhiipylypchuk1991 41055e3
[update] typos
serhiipylypchuk1991 b640ca7
[update] Whats new and migration
serhiipylypchuk1991 9d09b77
[update] deprecated - removed
serhiipylypchuk1991 52593c5
[add] overview pages
serhiipylypchuk1991 547e1bd
[update] add stylisation guides
serhiipylypchuk1991 751e132
[update] minor fixes
serhiipylypchuk1991 7330386
[update] minor changes after review
serhiipylypchuk1991 2cc3816
Update Integration duides
serhiipylypchuk1991 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,144 @@ | ||
| --- | ||
| sidebar_label: defaultStyles | ||
| title: defaultStyles Config | ||
| description: You can learn about the defaultStyles config in the documentation of the DHTMLX JavaScript RichText library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX RichText. | ||
| --- | ||
|
|
||
| # defaultStyles | ||
|
|
||
| ### Description | ||
|
|
||
| @short: Optional. Specifies default style values for specific block types | ||
|
|
||
| ### Usage | ||
|
|
||
| ~~~jsx {} | ||
| defaultStyles?: { | ||
| "*"?: { // affects all blocks, allowing you to set common properties for all of these blocks | ||
| "font-family"?: string; // "Roboto"| "Arial" | "Georgia" | "Tahoma" | "Times New Roman" | "Verdana" | ||
| "font-size"?: string; // "12px" | "14px" | "16px" | "18px" | "20px" | "24px" | "28px" | "32px" | "36px" | ||
| color?: string; | ||
| background?: string; | ||
| }, | ||
| p?: { | ||
| "font-family"?: string; // "Roboto"| "Arial" | "Georgia" | "Tahoma" | "Times New Roman" | "Verdana" | ||
| "font-size"?: string; // "12px" | "14px" | "16px" | "18px" | "20px" | "24px" | "28px" | "32px" | "36px" | ||
| color?: string; | ||
| background?: string; | ||
| }, | ||
| blockquote?: { | ||
| "font-family"?: string; // "Roboto"| "Arial" | "Georgia" | "Tahoma" | "Times New Roman" | "Verdana" | ||
| "font-size"?: string; // "12px" | "14px" | "16px" | "18px" | "20px" | "24px" | "28px" | "32px" | "36px" | ||
| color?: string; | ||
| background?: string; | ||
| }, | ||
| h1?: { | ||
| "font-family"?: string; // "Roboto"| "Arial" | "Georgia" | "Tahoma" | "Times New Roman" | "Verdana" | ||
| "font-size"?: string; // "12px" | "14px" | "16px" | "18px" | "20px" | "24px" | "28px" | "32px" | "36px" | ||
| color?: string; | ||
| background?: string; | ||
| }, | ||
| h2?: { | ||
| "font-family"?: string; // "Roboto"| "Arial" | "Georgia" | "Tahoma" | "Times New Roman" | "Verdana" | ||
| "font-size"?: string; // "12px" | "14px" | "16px" | "18px" | "20px" | "24px" | "28px" | "32px" | "36px" | ||
| color?: string; | ||
| background?: string; | ||
| }, | ||
| h3?: { | ||
| "font-family"?: string; // "Roboto"| "Arial" | "Georgia" | "Tahoma" | "Times New Roman" | "Verdana" | ||
| "font-size"?: string; // "12px" | "14px" | "16px" | "18px" | "20px" | "24px" | "28px" | "32px" | "36px" | ||
| color?: string; | ||
| background?: string; | ||
| }, | ||
| h4?: { | ||
| "font-family"?: string; // "Roboto"| "Arial" | "Georgia" | "Tahoma" | "Times New Roman" | "Verdana" | ||
| "font-size"?: string; // "12px" | "14px" | "16px" | "18px" | "20px" | "24px" | "28px" | "32px" | "36px" | ||
| color?: string; | ||
| background?: string; | ||
| }, | ||
| h5?: { | ||
| "font-family"?: string; // "Roboto"| "Arial" | "Georgia" | "Tahoma" | "Times New Roman" | "Verdana" | ||
| "font-size"?: string; // "12px" | "14px" | "16px" | "18px" | "20px" | "24px" | "28px" | "32px" | "36px" | ||
| color?: string; | ||
| background?: string; | ||
| }, | ||
| h6?: { | ||
| "font-family"?: string; // "Roboto"| "Arial" | "Georgia" | "Tahoma" | "Times New Roman" | "Verdana" | ||
| "font-size"?: string; // "12px" | "14px" | "16px" | "18px" | "20px" | "24px" | "28px" | "32px" | "36px" | ||
| color?: string; | ||
| background?: string; | ||
| } | ||
| }; | ||
| ~~~ | ||
|
|
||
| :::important | ||
| The `defaultStyles` property DOES NOT set the actual CSS to the affected blocks. CSS styles have to be applied separately: | ||
|
|
||
| ```jsx title="index.js" | ||
| new richtext.Richtext("#root", { | ||
| defaultStyles: { | ||
| h2: { | ||
| "font-family": "Roboto", | ||
| "font-size": "28px", | ||
| color: "purple", | ||
| background: "#FFC0CB" | ||
| } | ||
| } | ||
| }); | ||
| ``` | ||
|
|
||
| ```css title="index.css" | ||
| <style> | ||
| #root h2 { | ||
| font-family: Roboto; | ||
| font-size: 28px; | ||
| color: purple; | ||
| background: #FFC0CB; | ||
| } | ||
| </style> | ||
| ``` | ||
|
|
||
| In this example, all `h2` blocks are assigned to the `"Roboto"` font-family with a font-size of 28px with both the foreground and the background colors changed as well. Css styles assigned to `h2` blocks as well. | ||
| ::: | ||
|
|
||
| ### Default config | ||
|
|
||
| ~~~jsx | ||
| const defaultStyles = { | ||
| "*": { "font-family": "Arial" }, | ||
| p: { "font-size": "14px" }, | ||
| blockquote: { "font-size": "14px" }, | ||
| h1: { "font-size": "32px" }, | ||
| h2: { "font-size": "24px" }, | ||
| h3: { "font-size": "18px" }, | ||
| h4: { "font-size": "16px" }, | ||
| h5: { "font-size": "14px" }, | ||
| h6: { "font-size": "12px" } | ||
| }; | ||
| ~~~ | ||
|
|
||
| ### Example | ||
|
|
||
| ~~~jsx {3-13} | ||
| // initialize RichText | ||
| new richtext.Richtext("#root", { | ||
| defaultStyles: { | ||
| h4: { | ||
| "font-family": "Roboto" | ||
| }, | ||
| h5: { | ||
| "font-family": "Roboto" | ||
| }, | ||
| h6: { | ||
| "font-family": "Roboto" | ||
| } | ||
| }, | ||
| // other configuration properties | ||
| }); | ||
| ~~~ | ||
|
|
||
| **Change log:** The property was updated in v2.0 | ||
|
|
||
| **Related articles:** [Configuration](guides/configuration.md) | ||
|
|
||
| **Related sample:** [RichText. Changing the default value for typography (font, font size, etc.)](https://snippet.dhtmlx.com/6u3ti01s) |
This file contains hidden or 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,39 @@ | ||
| --- | ||
| sidebar_label: fullscreenMode | ||
| title: fullscreenMode Config | ||
| description: You can learn about the fullscreenMode config in the documentation of the DHTMLX JavaScript RichText library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX RichText. | ||
| --- | ||
|
|
||
| # fullscreenMode | ||
|
|
||
| ### Description | ||
|
|
||
| @short: Optional. Enables the RichText fullscreen mode | ||
|
|
||
| ### Usage | ||
|
|
||
| ~~~jsx {} | ||
| fullscreenMode?: boolean; | ||
| ~~~ | ||
|
|
||
| ### Default config | ||
|
|
||
| ~~~jsx | ||
| fullscreenMode: false; | ||
| ~~~ | ||
|
|
||
| ### Example | ||
|
|
||
| ~~~jsx {3} | ||
| // initialize RichText | ||
| new richtext.Richtext("#root", { | ||
| fullscreenMode: true | ||
| // other configuration properties | ||
| }); | ||
| ~~~ | ||
|
|
||
| **Change log:** The property was added in v2.0 | ||
|
|
||
| **Related articles:** [Configuration](guides/configuration.md) | ||
|
|
||
| **Related sample:** [RichText. Full toolbar](https://snippet.dhtmlx.com/ziynafp7) |
This file contains hidden or 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,33 @@ | ||
| --- | ||
| sidebar_label: imageUploadUrl | ||
| title: imageUploadUrl Config | ||
| description: You can learn about the imageUploadUrl config in the documentation of the DHTMLX JavaScript RichText library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX RichText. | ||
| --- | ||
|
|
||
| # imageUploadUrl | ||
|
|
||
| ### Description | ||
|
|
||
| @short: Optional. Specifies the URL which will be used for image upload | ||
|
|
||
| ### Usage | ||
|
|
||
| ~~~jsx {} | ||
| imageUploadUrl?: string; | ||
| ~~~ | ||
|
|
||
| ### Example | ||
|
|
||
| ~~~jsx {3} | ||
| // initialize RichText | ||
| new richtext.Richtext("#root", { | ||
| imageUploadUrl: "some URL" | ||
| // other configuration properties | ||
| }); | ||
| ~~~ | ||
|
|
||
| **Change log:** The property was added in v2.0 | ||
|
|
||
| **Related articles:** [Configuration](guides/configuration.md) | ||
|
|
||
| **Related sample:** [RichText. Initialization](https://snippet.dhtmlx.com/t55alxiy) |
This file contains hidden or 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,41 @@ | ||
| --- | ||
| sidebar_label: layoutMode | ||
| title: layoutMode Config | ||
| description: You can learn about the layoutMode config in the documentation of the DHTMLX JavaScript RichText library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX RichText. | ||
| --- | ||
|
|
||
| # layoutMode | ||
|
|
||
| ### Description | ||
|
|
||
| @short: Optional. Specifies the layout mode for the main editor area | ||
|
|
||
| ### Usage | ||
|
|
||
| ~~~jsx {} | ||
| layoutMode: "classic" | "document"; | ||
| ~~~ | ||
|
|
||
| The `"classic"` mode represents the edit area that fits the entire page. The `"document"` mode closely represent the real document sizes (sizes used: A4, A5, A6, A7). | ||
|
|
||
| ### Default config | ||
|
|
||
| ~~~jsx | ||
| layoutMode: "classic"; | ||
| ~~~ | ||
|
|
||
| ### Example | ||
|
|
||
| ~~~jsx {3} | ||
| // initialize RichText | ||
| new richtext.Richtext("#root", { | ||
| layoutMode: "document" // initializes RichText with "document" mode by default | ||
| // other configuration properties | ||
| }); | ||
| ~~~ | ||
|
|
||
| **Change log:** The property was added in v2.0 instead of the removed `mode` property | ||
|
|
||
| **Related articles:** [Configuration](guides/configuration.md) | ||
|
|
||
| **Related sample:** [RichText. Initialization](https://snippet.dhtmlx.com/t55alxiy) |
This file contains hidden or 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,47 @@ | ||
| --- | ||
| sidebar_label: locale | ||
| title: locale Config | ||
| description: You can learn about the locale config in the documentation of the DHTMLX JavaScript RichText library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX RichText. | ||
| --- | ||
|
|
||
| # locale | ||
|
|
||
| ### Description | ||
|
|
||
| @short: Optional. An object that includes localization labels of RichText | ||
|
|
||
| :::info | ||
| The **locale** object needs to include all labels of RichText with the corresponding translations. | ||
| ::: | ||
|
|
||
| ### Usage | ||
|
|
||
| ~~~jsx {} | ||
| locale?: object; | ||
| ~~~ | ||
|
|
||
| ### Default config | ||
|
|
||
| By default, RichText uses the **English** locale. You can set it to the custom locale as well. | ||
|
|
||
| :::tip | ||
| To change the current locale dynamically, you can use the [**setLocale()**](api/methods/set-locale.md) method of RichText | ||
| ::: | ||
|
|
||
| ### Example | ||
|
|
||
| ~~~jsx {3} | ||
| // initialize RichText | ||
| const editor = new richtext.RichText("#root", { | ||
| locale: richtext.locales.cn // the Chineese locale will be set initially | ||
| // locale: richtext.locales.en // the English locale will be set initially | ||
| // locale: richtext.locales.de // the Germany locale will be set initially | ||
| // other configuration properties | ||
| }); | ||
| ~~~ | ||
|
|
||
| **Change log:** The property was added in v2.0 | ||
|
|
||
| **Related articles:** [Localization](guides/localization.md) | ||
|
|
||
| **Related sample:** [RichText. Localization](https://snippet.dhtmlx.com/zxjrin3i) | ||
This file contains hidden or 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,33 @@ | ||
| --- | ||
| sidebar_label: menubar | ||
| title: menubar Config | ||
| description: You can learn about the menubar config in the documentation of the DHTMLX JavaScript RichText library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX RichText. | ||
| --- | ||
|
|
||
| # menubar | ||
|
|
||
| ### Description | ||
|
|
||
| @short: Optional. Enables the top menubar of RichText | ||
|
|
||
| ### Usage | ||
|
|
||
| ~~~jsx {} | ||
| menubar?: boolean; | ||
| ~~~ | ||
|
|
||
| ### Example | ||
|
|
||
| ~~~jsx {3} | ||
| // initialize RichText | ||
| new richtext.Richtext("#root", { | ||
| menubar: true | ||
| // other configuration properties | ||
| }); | ||
| ~~~ | ||
|
|
||
| **Change log:** The property was added in v2.0 | ||
|
|
||
| **Related articles:** [Configuration](guides/configuration.md) | ||
|
|
||
| **Related sample:** [RichText. Initialization with menubar](https://snippet.dhtmlx.com/tjryzka7) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.