-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: Added oscd-edit-completed Event (#1533)
* Chore: Added oscd-edit-completed Event * Added import to initiator * Added import to initiator * Updated event to EditCompletedEvent * Changed DocChangedEvent * Fixed tests * Always emit the editCompletedEvent from the Editor * Fixed tests * Removed @open-wc from core eslint * Removed unused files * Fixed codacy issues * Fixed codacy issue * Fixed review comment * Added import
- Loading branch information
1 parent
38b490d
commit b967902
Showing
15 changed files
with
745 additions
and
661 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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,31 @@ | ||
import { Edit, Initiator } from './edit-event.js'; | ||
|
||
import { EditorAction } from './deprecated/editor.js'; | ||
|
||
export type EditCompletedDetail = { | ||
edit: Edit | EditorAction; | ||
initiator: Initiator; | ||
}; | ||
|
||
/** Represents the intent to open `doc` with filename `docName`. */ | ||
export type EditCompletedEvent = CustomEvent<EditCompletedDetail>; | ||
|
||
export function newEditCompletedEvent( | ||
edit: Edit | EditorAction, | ||
initiator: Initiator = 'user' | ||
): EditCompletedEvent { | ||
return new CustomEvent<EditCompletedDetail>('oscd-edit-completed', { | ||
bubbles: true, | ||
composed: true, | ||
detail: { | ||
edit: edit, | ||
initiator: initiator, | ||
}, | ||
}); | ||
} | ||
|
||
declare global { | ||
interface ElementEventMap { | ||
['oscd-edit-completed']: EditCompletedEvent; | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -78,7 +78,6 @@ | |
] | ||
}, | ||
"extends": [ | ||
"@open-wc", | ||
"prettier" | ||
], | ||
"plugins": [ | ||
|
This file contains 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
Oops, something went wrong.