Skip to content

Commit e1bd13f

Browse files
committed
Edits from reviewing public events page
1 parent c74f7cc commit e1bd13f

2 files changed

Lines changed: 12 additions & 13 deletions

File tree

dev/docs/javascript-code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,6 @@ window.$components.firstOnElement(element, name);
158158

159159
## Public Events
160160

161-
There are a range of available events that are emitted as part of a public & supported API for accessing or extending JavaScript libraries and components used in the system.
161+
There are a range of available events that are emitted as part of a public & supported API for accessing or extending JavaScript libraries & components used in the system.
162162

163163
Details on these events can be found in the [JavaScript Public Events file](javascript-public-events.md).

dev/docs/javascript-public-events.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# JavaScript Public Events
22

3-
There are a range of available events that are emitted as part of a public & supported API for accessing or extending JavaScript libraries and components used in the system.
4-
These are emitted via standard DOM events so can be listened to using standard APIs like so:
3+
There are a range of available events emitted as part of a public & [supported](#support) API for accessing or extending JavaScript libraries and components used in the system.
4+
These are emitted via standard DOM events so can be consumed using standard DOM APIs like so:
55

66
```javascript
77
window.addEventListener('event-name', event => {
@@ -15,8 +15,8 @@ For most use-cases you can probably just listen on the `window` as shown above.
1515
## Support
1616

1717
This event system, and the events emitted, are considered semi-supported.
18-
Breaking changes of the event API, event names or event properties, will be documented in update notes but may change.
19-
Upon that, the detail provided within the events, and the libraries made accessible, are not considered supported nor stable, and changes to these won't be clearly documented within changelogs.
18+
Breaking changes of the event API, event names, or event properties, are possible but will be documented in update notes.
19+
The detail provided within the events, and the libraries made accessible, are not considered supported nor stable, and changes to these won't be clearly documented changelogs.
2020

2121
## Event Naming Scheme
2222

@@ -30,9 +30,9 @@ editor-tinymce::setup
3030
library-cm6::configure-theme
3131
```
3232

33-
If the event is generic in use but specific to a library, the name `<context>` will start with `library-` followed by the library name. Otherwise `<context>` may reflect the UI context/component.
33+
If the event is generic in use but specific to a library, the `<context>` will start with `library-` followed by the library name. Otherwise `<context>` may reflect the UI context/component.
3434

35-
The `<action/lifecycle>` reflects the lifecycle stage of the context, or a specific action to perform if the event is very specific to a certain use-case.
35+
The `<action/lifecycle>` reflects the lifecycle stage of the context, or a specific action to perform if the event is specific to a certain use-case.
3636

3737
## Event Listing
3838

@@ -61,7 +61,7 @@ This event is called when the markdown editor loads, post configuration but befo
6161
#### Event Data
6262

6363
- `markdownIt` - A references to the [MarkdownIt](https://markdown-it.github.io/markdown-it/#MarkdownIt) instance used to render markdown to HTML (Just for the preview).
64-
- `displayEl` - The DOM Element that wraps the HTML preview display.
64+
- `displayEl` - The IFrame Element that wraps the HTML preview display.
6565
- `cmEditorView` - The CodeMirror [EditorView](https://codemirror.net/docs/ref/#view.EditorView) instance used for the markdown input editor.
6666

6767
##### Example
@@ -70,14 +70,13 @@ This event is called when the markdown editor loads, post configuration but befo
7070
// Set all text in the display to be red by default.
7171
window.addEventListener('editor-markdown::setup', event => {
7272
const display = event.detail.displayEl;
73-
display.style.color = 'red';
73+
display.contentDocument.body.style.color = 'red';
7474
});
7575
```
7676

7777
### `editor-drawio::configure`
7878

79-
This event is called as the embedded diagrams.net drawing editor loads, as a means to allow configuration of the diagrams.net interface.
80-
79+
This event is called as the embedded diagrams.net drawing editor loads, to allow configuration of the diagrams.net interface.
8180
See [this diagrams.net page](https://www.diagrams.net/doc/faq/configure-diagram-editor) for details on the available options for the configure event.
8281

8382
If using a custom diagrams.net instance, via the `DRAWIO` option, you will need to ensure your DRAWIO option URL has the `configure=1` query parameter.
@@ -93,7 +92,7 @@ If using a custom diagrams.net instance, via the `DRAWIO` option, you will need
9392
// Set only the "general" and "android" libraries to show by default
9493
window.addEventListener('editor-drawio::configure', event => {
9594
const config = event.detail.config;
96-
config.defaultLibraries = "general;android";
95+
config.enabledLibraries = ["general", "android"];
9796
});
9897
```
9998

@@ -117,7 +116,7 @@ window.addEventListener('editor-tinymce::pre-init', event => {
117116

118117
### `editor-tinymce::setup`
119118

120-
This event is called during the `setup` lifecycle stage of the TinyMCE editor used as the BookStack WYSIWYG editor. This is post configuration, but before the editor is typically visible.
119+
This event is called during the `setup` lifecycle stage of the TinyMCE editor used as the BookStack WYSIWYG editor. This is after configuration, but before the editor is fully loaded and ready to use.
121120

122121
##### Event Data
123122

0 commit comments

Comments
 (0)