@editora/core 1.0.33 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -99,7 +99,7 @@ Set options as attributes:
99
99
 
100
100
  | Attribute | |
101
101
  | --- | --- |
102
- | `plugins` | The plugins to load, separated by spaces (see [the plugin list](https://www.npmjs.com/package/@editora/plugins#plugin-catalog), column *Name*). |
102
+ | `plugins` | The plugins to load, separated by spaces (see [the plugin list](https://www.npmjs.com/package/@editora/plugins#plugin-catalog), column *Name*). `all` loads every plugin in the bundle. Leave it out for [the default set](#default-plugins). |
103
103
  | `toolbar` | The toolbar items, with `\|` between groups: `"undo redo \| bold italic"`. `"false"` hides the toolbar. |
104
104
  | `height` | The height in pixels. Default `400`. |
105
105
  | `width` | The width in pixels. By default the editor fills its parent. |
@@ -177,7 +177,8 @@ disables the toolbar buttons and takes the editor out of the tab order. Both wor
177
177
  ### Toolbar items
178
178
 
179
179
  `toolbar` takes names separated by spaces, with `|` between groups. The names are camelCase and case-sensitive
180
- (`textColor`, not `textcolor`), and each one needs its plugin in `plugins`:
180
+ (`textColor`, not `textcolor`). Each one needs its plugin: if you set `plugins`, list it there; if you don't, the
181
+ editor loads it for you (see [Default plugins](#default-plugins)).
181
182
 
182
183
  | Name | Plugin |
183
184
  | --- | --- |
@@ -251,7 +252,7 @@ loaded by, is in [`@editora/plugins`](https://www.npmjs.com/package/@editora/plu
251
252
 
252
253
  | File | Contains |
253
254
  | --- | --- |
254
- | `dist/webcomponent.js` | Every plugin. List the ones you want in `plugins`; leave it out and all load except `collaboration`, which needs a server. |
255
+ | `dist/webcomponent.js` | Every plugin, each fetched only when an editor uses it. Without `plugins`, an editor loads [the default set](#default-plugins). |
255
256
  | `dist/webcomponent-core.js` | Ten essentials: `bold`, `italic`, `underline`, `strikethrough`, `clearFormatting`, `heading`, `blockquote`, `code`, `list` and `history`. |
256
257
 
257
258
  Each has its own stylesheet (`webcomponent.min.css`, `webcomponent-core.min.css`).
@@ -265,12 +266,31 @@ Each has its own stylesheet (`webcomponent.min.css`, `webcomponent-core.min.css`
265
266
  </editora-editor>
266
267
  ```
267
268
 
268
- > [!NOTE]
269
- > List the plugins you want. If you leave `plugins` out, every plugin in the bundle is loaded **except `collaboration`**,
270
- > because it sends the document to a server. It loads only when you name it in `plugins` (or configure it under
271
- > `pluginConfig`), and then stays off until you give it your own `websocketUrl` or a `provider`. Earlier versions loaded
272
- > it by default and synced through a public Yjs demo server, in a room shared by every default editor. See
273
- > [`@editora/plugins`](https://www.npmjs.com/package/@editora/plugins#collaboration).
269
+ ## Default plugins
270
+
271
+ Without a `plugins` attribute, `<editora-editor>` loads a small default set: `bold`, `italic`, `underline`,
272
+ `strikethrough`, `clearFormatting`, `heading`, `blockquote`, `list`, `link`, `table` and `history`. That is about
273
+ 68 KB gzipped of JavaScript for a page with nothing but the tag, against about 437 KB when it loaded every plugin.
274
+
275
+ The editor also loads any other plugin the page asks for:
276
+
277
+ - a toolbar item: `toolbar="undo redo | bold italic | fontSize textColor | insertImage"` loads `fontSize`,
278
+ `textColor` and `image` as well;
279
+ - an entry under `pluginConfig`, such as `pluginConfig: { mentions: { ... } }`;
280
+ - `accessibility: { checker: true }`, which loads `a11yChecker`;
281
+ - a plugin you registered yourself, or loaded with `EditoraPlugins.loadPlugins()`.
282
+
283
+ To get every plugin, as a bare tag did before 1.1.0, ask for all of them:
284
+
285
+ ```html
286
+ <editora-editor plugins="all"></editora-editor>
287
+ ```
288
+
289
+ `all` can be combined with other names (`plugins="all collaboration"`). It never includes `collaboration` on its own,
290
+ because that plugin sends the document to a server: it loads only when you name it in `plugins` or configure it under
291
+ `pluginConfig`, and then stays off until you give it your own `websocketUrl` or a `provider`. Earlier versions loaded
292
+ it by default and synced through a public Yjs demo server, in a room shared by every default editor. See
293
+ [`@editora/plugins`](https://www.npmjs.com/package/@editora/plugins#collaboration).
274
294
 
275
295
  ## Security
276
296