Ghost/ghost/admin/lib/koenig-editor/addon/services/koenig-ui.js
Kevin Ansfield 07d89262f1 Prototyped component based atoms in the editor
refs https://github.com/TryGhost/Team/issues/931

- adds handling for component atoms
- add prototype button atom to test atom behaviour
- add `Cmd+Shift+B` keyboard shortcut to create a dummy button atom when the `emailCardSegments` feature is enabled
2021-07-22 18:54:46 +01:00

25 lines
595 B
JavaScript

import Service from '@ember/service';
import {tracked} from '@glimmer/tracking';
export default class KoenigUiService extends Service {
@tracked captionHasFocus = false;
@tracked inputHasFocus = false;
@tracked isDragging = false;
buttonCount = 0;
#focusedCaption = null;
captionGainedFocus(caption) {
this.captionHasFocus = true;
this.#focusedCaption = caption;
}
captionLostFocus(caption) {
if (this.#focusedCaption === caption) {
this.captionHasFocus = false;
this.#focusedCaption = null;
}
}
}