import { LitElementWw } from '@webwriter/lit' import { TemplateResult, html } from 'lit' import { customElement } from 'lit/decorators.js' import { consume } from '@lit/context' import { globalStyles } from '@/global_styles' import { editableContext } from '@/contexts/editable_context' import type { Settings } from '@/types/settings' import { settingsContext } from '@/contexts/settings_context' import { CCard } from '../reusables/c-card' import SlTag from '@shoelace-style/shoelace/dist/components/tag/tag.component.js' import { msg } from '@lit/localize' export class HelpKeyboardShortcutsCard extends LitElementWw { static scopedElements = { 'c-card': CCard, 'sl-tag': SlTag, } @consume({ context: editableContext, subscribe: true }) accessor editable: boolean @consume({ context: settingsContext, subscribe: true }) accessor settings: Settings // RENDER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - static styles = globalStyles // RENDER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - render(): TemplateResult<1> { return html`
${msg('Keyboard shortcuts')}

${msg('Layer')}

${this.editable || this.settings.mayAddAndRemoveLayers ? html`
CTRL + SHIFT + BACKSPACE${msg('Deletes the currently selected layer')}
` : html``} ${this.editable || this.settings.mayAddAndRemoveLayers ? html`
CTRL + SHIFT + K${msg( 'Duplicates the currently selected layer', )}
` : html``}
CTRL + SHIFT + ARROW${msg( 'Moves the currently selected layer', )}
` } }