` element. Editing operations performed by end users are
handled in simple ways to generate the final HTML.
-To view the sample site, please click the link below:
+Rooster is working on top of a middle layer data structure called "Content Model".
+All format API and editing operation are using this Content Model layer as content format,
+and finally convert to HTML and show it in editor.
-[RoosterJs Sample Site](https://microsoft.github.io/roosterjs/index.html).
+To view the demo site, please click the link below:
-## Upgrade from RoosterJs 7.\*
+[RoosterJs Demo Site](https://microsoft.github.io/roosterjs/index.html).
-Please see [here](https://github.com/microsoft/roosterjs/wiki/RoosterJs-8).
+## Upgrade from RoosterJs 8.\*
+
+Please see [here](https://github.com/microsoft/roosterjs/wiki/RoosterJs-9).
## Features
@@ -25,24 +29,22 @@ Rooster contains 6 basic packages.
`createEditor()` function in roosterjs to create an editor with default
configurations.
-2. [roosterjs-editor-core](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_core.html):
- Defines the core editor and plugin infrastructure. Use `roosterjs-editor-core`
+2. [roosterjs-content-model-core](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_core.html):
+ Defines the core editor and plugin infrastructure. Use `roosterjs-content-model-core`
instead of `roosterjs` to build and customize your own editor.
-3. [roosterjs-editor-api](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_api.html):
+3. [roosterjs-content-model-api](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_api.html):
Defines APIs for editor operations. Use these APIs to modify content and
- formatting in the editor you built using `roosterjs-editor-core`.
+ formatting in the editor you built using `roosterjs-content-model-core`.
-4. [roosterjs-editor-dom](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_dom.html):
- Defines APIs for DOM operations. Use `roosterjs-editor-api` instead unless
- you want to access DOM API directly.
+4. [roosterjs-content-model-dom](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_dom.html):
+ Defines APIs for Content Model and DOM operations. This package do conversion between DOM tree and roosterjs Content Model.
-5. [roosterjs-editor-plugins](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_plugins.html):
- Defines basic plugins for common features. Examples: making hyperlinks,
- pasting HTML content, inserting inline images.
+5. [roosterjs-content-model-plugins](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_plugins.html):
+ Defines basic plugins for common features.
-6. [roosterjs-editor-types](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_types.html):
- Defines public interfaces and enumerations.
+6. [roosterjs-content-model-types](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_types.html):
+ Defines public interfaces and enumerations, including Content Model types, API parameters and other types.
There are also some extension packages to provide additional functionalities.
@@ -52,30 +54,38 @@ There are also some extension packages to provide additional functionalities.
2. [roosterjs-react](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_react.html):
Provide a React wrapper of roosterjs so it can be easily used with React.
-3. [roosterjs-editor-types-compatible](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_types_compatible.html):
- Provide types that are compatible with isolatedModules mode. When using isolatedModules mode,
- "const enum" will not work correctly, this package provides enums with prefix "Compatible" in
- their names and they have the same value with const enums in roosterjs-editor-types package
+To be compatible with old (8.\*) versions, you can use `EditorAdapter` class from the following package which can act as a 8.\* Editor:
+
+1. [roosterjs-editor-adapter](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_adapter.html):
+ Provide a adapter class `EditorAdapter` to work with Editor (9.\*) and legacy plugins (via [EditorAdapterOptions.legacyPlugins](https://microsoft.github.io/roosterjs/docs/interfaces/roosterjs_editor_adapter.editoradapteroptions.html#legacyplugins))
+
+And the following packages are for old (8.\*) compatibility:
+
+1. [roosterjs-editor-core](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_core.html):
+2. [roosterjs-editor-api](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_api.html):
+3. [roosterjs-editor-dom](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_dom.html):
+4. [roosterjs-editor-plugins](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_plugins.html):
+5. [roosterjs-editor-types](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_types.html):
+6. [roosterjs-editor-types-compatible](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_types_compatible.html):
### APIs
-Rooster provides DOM level APIs (in `roosterjs-editor-dom`), core APIs (in `roosterjs-editor-core`), and formatting APIs
-(in `roosterjs-editor-api`) to perform editing operations.
+Rooster provides Content Model level APIs (in `roosterjs-content-model-dom`), core APIs (in `roosterjs-content-model-core`), and formatting APIs
+(in `roosterjs-content-modelapi`) to perform editing operations.
-`roosterjs-editor-dom` provides several levels of DOM operations:
+`roosterjs-content-model-dom` provides several levels of Content Model operations:
-- Perform basic DOM operations such as `wrap()`, `unwrap()`, ...
-- Wrap a given DOM node with `InlineElement` or `BlockElement` and perform
- operations with DOM Walker API.
-- Perform DOM operations on a given scope using scopers.
-- Travel among `InlineElements` and `BlockElements` with scope using
- ContentTraverser API.
+- Create Content Model elements
+- Convert DOM tree to Content Model
+- Convert Content Model to DOM tree
+- Format handlers
+- A few DOM level API
-`roosterjs-editor-core` provides APIs for editor core. Editor class will call such
-APIs to perform basic editor operations. These APIs are overridable by specifying
+`roosterjs-content-model-core` provides APIs for editor core. Editor class will call such
+APIs to perform basic editor operations. These APIs can be overridden by specifying
API overrides in Editor options when creating the editor.
-`roosterjs-editor-api` provides APIs for scenario-based operations triggered by
+`roosterjs-content-model-api` provides APIs for scenario-based operations triggered by
user interaction.
## Plugins
@@ -99,7 +109,7 @@ class HelloRooster implements EditorPlugin {
dispose() {}
onPluginEvent(e: PluginEvent) {
- if (e.eventType == PluginEventType.KeyPress && e.rawEvent.which == 65) {
+ if (e.eventType == 'input' && e.rawEvent.which == 65) {
alert('Hello Rooster');
}
}
@@ -114,9 +124,9 @@ Install via NPM or Yarn:
You can also install sub packages separately:
-`yarn add roosterjs-editor-core`
+`yarn add roosterjs-content-model-core`
-`yarn add roosterjs-editor-api`
+`yarn add roosterjs-content-model-api`
`...`
@@ -161,9 +171,9 @@ In order to run the code below, you may also need to install [webpack](https://w
## Sample code
-To view the sample site, please click [here](https://microsoft.github.io/roosterjs/index.html).
+To view the demo site, please click [here](https://microsoft.github.io/roosterjs/index.html).
-To build the sample site code yourself, follow these instructions:
+To build the demo site code yourself, follow these instructions:
1. Get dependencies using [yarn](https://yarnpkg.com) or [npm](https://www.npmjs.com/):
diff --git a/demo/index.html b/demo/index.html
index b63af748584..8dbbf68981c 100644
--- a/demo/index.html
+++ b/demo/index.html
@@ -21,8 +21,8 @@
+
-
diff --git a/demo/scripts/controls/sidePane/editorOptions/OptionsPane.tsx b/demo/scripts/controls/sidePane/editorOptions/OptionsPane.tsx
index 88183cdbf93..3716c3b8831 100644
--- a/demo/scripts/controls/sidePane/editorOptions/OptionsPane.tsx
+++ b/demo/scripts/controls/sidePane/editorOptions/OptionsPane.tsx
@@ -23,7 +23,7 @@ const htmlButtons =
'\n';
const darkButton = '\n';
const htmlEnd =
- '\n' +
+ '\n' +
'