Skip to content

Commit

Permalink
fix: Add review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
clepski committed Nov 13, 2024
1 parent c23c849 commit 26a01eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 7 additions & 10 deletions docs/core-api/edit-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,21 +148,18 @@ someComponent.dispatchEvent(complexEditEvent);

All edit events with initiator `user` will create a history log entry and can be undone and redone through the history addon.


## Editor Action API (deprecated)

## Breaking changes due to migration
Before the edit event API the editor action API was used to edit the `doc`. It is also custom event based and listens to the events of the type `editor-action`.

For backwards compatibility the API is still supported, but it is recommended to use the edit event API instead. Internally editor actions are converted to edit events.

### Breaking changes due to migration

With open SCD version **v0.36.0** and higher some editor action features are no longer supported.

* The edtior action properties `derived` and `checkValidity` do not have any effect.
With open SCD version **v0.36.0** and higher some editor action features are no longer supported see [Deprecated Editor Action API](#archives---editor-action-api-deprecated).
* The editor action properties `derived` and `checkValidity` do not have any effect.
* All validation checks have been removed (i.e. check for unique `id` attribute on element before create).
* The `title` for `ComplexAction` does not have any effect.

---

# Archives - Editor Action API (deprecated)

### Event factory

```ts
Expand Down
2 changes: 2 additions & 0 deletions packages/openscd/src/addons/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ export class OscdEditor extends LitElement {
connectedCallback(): void {
super.connectedCallback();

// Deprecated editor action API, use 'oscd-edit' instead.
this.host.addEventListener('editor-action', this.onAction.bind(this));

this.host.addEventListener('oscd-edit', event => this.handleEditEvent(event));
this.host.addEventListener('open-doc', this.onOpenDoc);
this.host.addEventListener('oscd-open', this.handleOpenDoc);
Expand Down

0 comments on commit 26a01eb

Please sign in to comment.