@corti/dictation-web
Version:
Web component for Corti Dictation
53 lines • 2.52 kB
JavaScript
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { consume } from "@lit/context";
import { html, LitElement } from "lit";
import { customElement, property, state } from "lit/decorators.js";
import { pushToTalkKeybindingContext, toggleToTalkKeybindingContext, } from "../contexts/dictation-context.js";
import KeybindingSelectorStyles from "../styles/keybinding-selector.js";
import "./keybinding-input.js";
let DictationKeybindingSelector = class DictationKeybindingSelector extends LitElement {
constructor() {
super(...arguments);
this.disabled = false;
}
render() {
return html `
<div class="settings-group">
<dictation-keybinding-input
keybindingType="toggle-to-talk"
?disabled=${this.disabled}
></dictation-keybinding-input>
<dictation-keybinding-input
keybindingType="push-to-talk"
?disabled=${this.disabled}
></dictation-keybinding-input>
${(this._toggleToTalkKeybinding || this._pushToTalkKeybinding) &&
html `<p class="keybinding-help">
${html `Press ${[this._toggleToTalkKeybinding, this._pushToTalkKeybinding].join(" or ")} to start/stop recording`}
</p>`}
</div>
`;
}
};
DictationKeybindingSelector.styles = KeybindingSelectorStyles;
__decorate([
consume({ context: pushToTalkKeybindingContext, subscribe: true }),
state()
], DictationKeybindingSelector.prototype, "_pushToTalkKeybinding", void 0);
__decorate([
consume({ context: toggleToTalkKeybindingContext, subscribe: true }),
state()
], DictationKeybindingSelector.prototype, "_toggleToTalkKeybinding", void 0);
__decorate([
property({ type: Boolean })
], DictationKeybindingSelector.prototype, "disabled", void 0);
DictationKeybindingSelector = __decorate([
customElement("dictation-keybinding-selector")
], DictationKeybindingSelector);
export { DictationKeybindingSelector };
//# sourceMappingURL=keybinding-selector.js.map