@corti/dictation-web 0.0.0-rc.359
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +156 -0
- package/dist/CortiDictation.d.ts +51 -0
- package/dist/CortiDictation.js +281 -0
- package/dist/CortiDictation.js.map +1 -0
- package/dist/DictationService.d.ts +16 -0
- package/dist/DictationService.js +88 -0
- package/dist/DictationService.js.map +1 -0
- package/dist/RecorderManager.d.ts +25 -0
- package/dist/RecorderManager.js +145 -0
- package/dist/RecorderManager.js.map +1 -0
- package/dist/audioService.d.ts +6 -0
- package/dist/audioService.js +21 -0
- package/dist/audioService.js.map +1 -0
- package/dist/bundle.js +11064 -0
- package/dist/components/audio-visualiser.d.ts +12 -0
- package/dist/components/audio-visualiser.js +65 -0
- package/dist/components/audio-visualiser.js.map +1 -0
- package/dist/components/settings-menu.d.ts +20 -0
- package/dist/components/settings-menu.js +185 -0
- package/dist/components/settings-menu.js.map +1 -0
- package/dist/constants.d.ts +3 -0
- package/dist/constants.js +16 -0
- package/dist/constants.js.map +1 -0
- package/dist/icons/icons.d.ts +17 -0
- package/dist/icons/icons.js +158 -0
- package/dist/icons/icons.js.map +1 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +2 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/styles/ComponentStyles.d.ts +2 -0
- package/dist/styles/ComponentStyles.js +53 -0
- package/dist/styles/ComponentStyles.js.map +1 -0
- package/dist/styles/buttons.d.ts +2 -0
- package/dist/styles/buttons.js +58 -0
- package/dist/styles/buttons.js.map +1 -0
- package/dist/styles/callout.d.ts +2 -0
- package/dist/styles/callout.js +33 -0
- package/dist/styles/callout.js.map +1 -0
- package/dist/styles/select.d.ts +2 -0
- package/dist/styles/select.js +36 -0
- package/dist/styles/select.js.map +1 -0
- package/dist/styles/theme.d.ts +2 -0
- package/dist/styles/theme.js +56 -0
- package/dist/styles/theme.js.map +1 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +59 -0
- package/dist/utils.js +179 -0
- package/dist/utils.js.map +1 -0
- package/package.json +120 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class AudioVisualiser extends LitElement {
|
|
3
|
+
level: number;
|
|
4
|
+
active: boolean;
|
|
5
|
+
static styles: import("lit").CSSResult;
|
|
6
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
7
|
+
}
|
|
8
|
+
declare global {
|
|
9
|
+
interface HTMLElementTagNameMap {
|
|
10
|
+
'audio-visualiser': AudioVisualiser;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html, css } from 'lit';
|
|
8
|
+
import { property, customElement } from 'lit/decorators.js';
|
|
9
|
+
let AudioVisualiser = class AudioVisualiser extends LitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.level = 0; // expects a value from 0 to 100
|
|
13
|
+
this.active = true;
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
// Each segment represents 20%. Using Math.ceil to fill segments optimistically.
|
|
17
|
+
const activeSegments = Math.round(this.level * 5);
|
|
18
|
+
const segments = [];
|
|
19
|
+
for (let i = 0; i < 5; i += 1) {
|
|
20
|
+
segments.push(html `
|
|
21
|
+
<div class="segment ${i < activeSegments ? 'active' : ''}"></div>
|
|
22
|
+
`);
|
|
23
|
+
}
|
|
24
|
+
return html `
|
|
25
|
+
<div class="container ${this.active ? 'active' : ''}">${segments}</div>
|
|
26
|
+
`;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
AudioVisualiser.styles = css `
|
|
30
|
+
:host {
|
|
31
|
+
height: 100%;
|
|
32
|
+
}
|
|
33
|
+
.container {
|
|
34
|
+
display: flex;
|
|
35
|
+
width: 8px;
|
|
36
|
+
flex-direction: column-reverse; /* Bottom-up stacking */
|
|
37
|
+
height: 100%;
|
|
38
|
+
gap: 1px;
|
|
39
|
+
opacity: 0.5;
|
|
40
|
+
&.active {
|
|
41
|
+
opacity: 1;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
.segment {
|
|
45
|
+
flex: 1;
|
|
46
|
+
background-color: var(--action-accent-text-color);
|
|
47
|
+
transition: background-color 0.25s;
|
|
48
|
+
border-radius: 1px;
|
|
49
|
+
opacity: 0.5;
|
|
50
|
+
}
|
|
51
|
+
.segment.active {
|
|
52
|
+
opacity: 1;
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
__decorate([
|
|
56
|
+
property({ type: Number })
|
|
57
|
+
], AudioVisualiser.prototype, "level", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
property({ type: Boolean })
|
|
60
|
+
], AudioVisualiser.prototype, "active", void 0);
|
|
61
|
+
AudioVisualiser = __decorate([
|
|
62
|
+
customElement('audio-visualiser')
|
|
63
|
+
], AudioVisualiser);
|
|
64
|
+
export { AudioVisualiser };
|
|
65
|
+
//# sourceMappingURL=audio-visualiser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audio-visualiser.js","sourceRoot":"","sources":["../../src/components/audio-visualiser.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGrD,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QACuB,UAAK,GAAG,CAAC,CAAC,CAAC,gCAAgC;QAE1C,WAAM,GAAG,IAAI,CAAC;IA0C7C,CAAC;IAbC,MAAM;QACJ,gFAAgF;QAChF,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAClD,MAAM,QAAQ,GAAG,EAAE,CAAC;QACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAA;8BACM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;OACzD,CAAC,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAA;8BACe,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,QAAQ;KACjE,CAAC;IACJ,CAAC;;AAvCM,sBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBlB,AAzBY,CAyBX;AA7B0B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAW;AAET;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CAAe;AAHhC,eAAe;IAD3B,aAAa,CAAC,kBAAkB,CAAC;GACrB,eAAe,CA6C3B","sourcesContent":["import { LitElement, html, css } from 'lit';\nimport { property, customElement } from 'lit/decorators.js';\n\n@customElement('audio-visualiser')\nexport class AudioVisualiser extends LitElement {\n @property({ type: Number }) level = 0; // expects a value from 0 to 100\n\n @property({ type: Boolean }) active = true;\n\n static styles = css`\n :host {\n height: 100%;\n }\n .container {\n display: flex;\n width: 8px;\n flex-direction: column-reverse; /* Bottom-up stacking */\n height: 100%;\n gap: 1px;\n opacity: 0.5;\n &.active {\n opacity: 1;\n }\n }\n .segment {\n flex: 1;\n background-color: var(--action-accent-text-color);\n transition: background-color 0.25s;\n border-radius: 1px;\n opacity: 0.5;\n }\n .segment.active {\n opacity: 1;\n }\n `;\n\n render() {\n // Each segment represents 20%. Using Math.ceil to fill segments optimistically.\n const activeSegments = Math.round(this.level * 5);\n const segments = [];\n for (let i = 0; i < 5; i += 1) {\n segments.push(html`\n <div class=\"segment ${i < activeSegments ? 'active' : ''}\"></div>\n `);\n }\n return html`\n <div class=\"container ${this.active ? 'active' : ''}\">${segments}</div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'audio-visualiser': AudioVisualiser;\n }\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LitElement, TemplateResult, CSSResultGroup } from 'lit';
|
|
2
|
+
export declare class SettingsMenu extends LitElement {
|
|
3
|
+
selectedDevice: MediaDeviceInfo | undefined;
|
|
4
|
+
selectedLanguage: string;
|
|
5
|
+
settingsDisabled: boolean;
|
|
6
|
+
private _devices;
|
|
7
|
+
get effectiveSelectedLanguage(): string;
|
|
8
|
+
constructor();
|
|
9
|
+
connectedCallback(): Promise<void>;
|
|
10
|
+
private handleDevicesChange;
|
|
11
|
+
static styles: CSSResultGroup;
|
|
12
|
+
private _selectDevice;
|
|
13
|
+
private _selectLanguage;
|
|
14
|
+
render(): TemplateResult;
|
|
15
|
+
}
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
'settings-menu': SettingsMenu;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
// mic-selector.ts
|
|
8
|
+
import { LitElement, html, css } from 'lit';
|
|
9
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
10
|
+
import ButtonStyles from '../styles/buttons.js';
|
|
11
|
+
import SelectStyles from '../styles/select.js';
|
|
12
|
+
import { LANGUAGES_SUPPORTED } from '../constants.js';
|
|
13
|
+
import { getAudioDevices, getLanguageName } from '../utils.js';
|
|
14
|
+
import CalloutStyles from '../styles/callout.js';
|
|
15
|
+
let SettingsMenu = class SettingsMenu extends LitElement {
|
|
16
|
+
get effectiveSelectedLanguage() {
|
|
17
|
+
return this.selectedLanguage || LANGUAGES_SUPPORTED[0] || '';
|
|
18
|
+
}
|
|
19
|
+
constructor() {
|
|
20
|
+
super();
|
|
21
|
+
this.selectedLanguage = '';
|
|
22
|
+
this.settingsDisabled = false;
|
|
23
|
+
this._devices = [];
|
|
24
|
+
navigator.mediaDevices.addEventListener('devicechange', this.handleDevicesChange.bind(this));
|
|
25
|
+
}
|
|
26
|
+
// on load, get the available devices
|
|
27
|
+
async connectedCallback() {
|
|
28
|
+
super.connectedCallback();
|
|
29
|
+
const deviceResponse = await getAudioDevices();
|
|
30
|
+
this._devices = deviceResponse.devices;
|
|
31
|
+
}
|
|
32
|
+
async handleDevicesChange() {
|
|
33
|
+
const deviceResponse = await getAudioDevices();
|
|
34
|
+
this._devices = deviceResponse.devices;
|
|
35
|
+
}
|
|
36
|
+
_selectDevice(deviceId) {
|
|
37
|
+
// Find the device object
|
|
38
|
+
const device = this._devices.find(d => d.deviceId === deviceId);
|
|
39
|
+
if (!device) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this.selectedDevice = device;
|
|
43
|
+
this.dispatchEvent(new CustomEvent('recording-devices-changed', {
|
|
44
|
+
detail: {
|
|
45
|
+
devices: this._devices,
|
|
46
|
+
selectedDevice: device,
|
|
47
|
+
},
|
|
48
|
+
bubbles: true,
|
|
49
|
+
composed: true,
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
_selectLanguage(language) {
|
|
53
|
+
if (!LANGUAGES_SUPPORTED.includes(language)) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
this.selectedLanguage = language;
|
|
57
|
+
this.dispatchEvent(new CustomEvent('language-changed', {
|
|
58
|
+
detail: {
|
|
59
|
+
language: language,
|
|
60
|
+
},
|
|
61
|
+
bubbles: true,
|
|
62
|
+
composed: true,
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
render() {
|
|
66
|
+
return html `
|
|
67
|
+
<div class="mic-selector">
|
|
68
|
+
<button id="settings-popover-button" popovertarget="settings-popover">
|
|
69
|
+
<icon-settings></icon-settings>
|
|
70
|
+
</button>
|
|
71
|
+
<div id="settings-popover" popover>
|
|
72
|
+
<div class="settings-wrapper">
|
|
73
|
+
${this.settingsDisabled
|
|
74
|
+
? html `
|
|
75
|
+
<div class="callout warn">
|
|
76
|
+
Recording is in progress. Stop recording to change settings.
|
|
77
|
+
</div>
|
|
78
|
+
`
|
|
79
|
+
: ''}
|
|
80
|
+
<div class="form-group">
|
|
81
|
+
<label id="device-select-label" for="device-select">
|
|
82
|
+
Recording Device
|
|
83
|
+
</label>
|
|
84
|
+
<select
|
|
85
|
+
id="device-select"
|
|
86
|
+
aria-labelledby="device-select-label"
|
|
87
|
+
@change=${(e) => {
|
|
88
|
+
this._selectDevice(e.target.value);
|
|
89
|
+
}}
|
|
90
|
+
?disabled=${this.settingsDisabled}
|
|
91
|
+
>
|
|
92
|
+
${this._devices.map(device => html `
|
|
93
|
+
<option
|
|
94
|
+
value=${device.deviceId}
|
|
95
|
+
?selected=${this.selectedDevice?.deviceId ===
|
|
96
|
+
device.deviceId}
|
|
97
|
+
>
|
|
98
|
+
${device.label || 'Unknown Device'}
|
|
99
|
+
</option>
|
|
100
|
+
`)}
|
|
101
|
+
</select>
|
|
102
|
+
</div>
|
|
103
|
+
<div class="form-group">
|
|
104
|
+
<label id="language-select-label" for="language-select">
|
|
105
|
+
Dictation Language
|
|
106
|
+
</label>
|
|
107
|
+
<select
|
|
108
|
+
id="language-select"
|
|
109
|
+
aria-labelledby="language-select-label"
|
|
110
|
+
@change=${(e) => {
|
|
111
|
+
this._selectLanguage(e.target.value);
|
|
112
|
+
}}
|
|
113
|
+
?disabled=${this.settingsDisabled}
|
|
114
|
+
>
|
|
115
|
+
${LANGUAGES_SUPPORTED.map(language => html `
|
|
116
|
+
<option
|
|
117
|
+
value=${language}
|
|
118
|
+
?selected=${this.effectiveSelectedLanguage === language}
|
|
119
|
+
>
|
|
120
|
+
${getLanguageName(language)}
|
|
121
|
+
</option>
|
|
122
|
+
`)}
|
|
123
|
+
</select>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
`;
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
SettingsMenu.styles = [
|
|
132
|
+
css `
|
|
133
|
+
:host {
|
|
134
|
+
display: block;
|
|
135
|
+
font-family: var(--component-font-family);
|
|
136
|
+
}
|
|
137
|
+
/* Retain the anchor-name styling for this component */
|
|
138
|
+
#settings-popover-button {
|
|
139
|
+
anchor-name: --settings_popover_btn;
|
|
140
|
+
}
|
|
141
|
+
[popover] {
|
|
142
|
+
margin: 0;
|
|
143
|
+
padding: 16px;
|
|
144
|
+
border: 0;
|
|
145
|
+
background: var(--card-background);
|
|
146
|
+
border: 1px solid var(--card-border-color);
|
|
147
|
+
border-radius: var(--card-border-radius);
|
|
148
|
+
box-shadow: var(--card-box-shadow);
|
|
149
|
+
z-index: 1000;
|
|
150
|
+
max-width: 260px;
|
|
151
|
+
width: 100%;
|
|
152
|
+
min-width: 200px;
|
|
153
|
+
position-anchor: --settings_popover_btn;
|
|
154
|
+
position-area: bottom span-right;
|
|
155
|
+
position-visibility: always;
|
|
156
|
+
position-try-fallbacks: flip-inline;
|
|
157
|
+
overflow-x: hidden;
|
|
158
|
+
}
|
|
159
|
+
.settings-wrapper {
|
|
160
|
+
display: flex;
|
|
161
|
+
flex-direction: column;
|
|
162
|
+
gap: 20px;
|
|
163
|
+
}
|
|
164
|
+
`,
|
|
165
|
+
ButtonStyles,
|
|
166
|
+
SelectStyles,
|
|
167
|
+
CalloutStyles,
|
|
168
|
+
];
|
|
169
|
+
__decorate([
|
|
170
|
+
property({ type: Object })
|
|
171
|
+
], SettingsMenu.prototype, "selectedDevice", void 0);
|
|
172
|
+
__decorate([
|
|
173
|
+
property({ type: String })
|
|
174
|
+
], SettingsMenu.prototype, "selectedLanguage", void 0);
|
|
175
|
+
__decorate([
|
|
176
|
+
property({ type: Boolean })
|
|
177
|
+
], SettingsMenu.prototype, "settingsDisabled", void 0);
|
|
178
|
+
__decorate([
|
|
179
|
+
state()
|
|
180
|
+
], SettingsMenu.prototype, "_devices", void 0);
|
|
181
|
+
SettingsMenu = __decorate([
|
|
182
|
+
customElement('settings-menu')
|
|
183
|
+
], SettingsMenu);
|
|
184
|
+
export { SettingsMenu };
|
|
185
|
+
//# sourceMappingURL=settings-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-menu.js","sourceRoot":"","sources":["../../src/components/settings-menu.ts"],"names":[],"mappings":"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","sourcesContent":["// mic-selector.ts\nimport { LitElement, html, css, TemplateResult, CSSResultGroup } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\n\nimport ButtonStyles from '../styles/buttons.js';\nimport SelectStyles from '../styles/select.js';\nimport { LANGUAGES_SUPPORTED } from '../constants.js';\nimport { getAudioDevices, getLanguageName } from '../utils.js';\nimport CalloutStyles from '../styles/callout.js';\n\n@customElement('settings-menu')\nexport class SettingsMenu extends LitElement {\n @property({ type: Object })\n selectedDevice: MediaDeviceInfo | undefined;\n\n @property({ type: String })\n selectedLanguage: string = '';\n\n @property({ type: Boolean })\n settingsDisabled: boolean = false;\n\n @state()\n private _devices: MediaDeviceInfo[] = [];\n\n get effectiveSelectedLanguage(): string {\n return this.selectedLanguage || LANGUAGES_SUPPORTED[0] || '';\n }\n\n constructor() {\n super();\n navigator.mediaDevices.addEventListener(\n 'devicechange',\n this.handleDevicesChange.bind(this),\n );\n }\n\n // on load, get the available devices\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n const deviceResponse = await getAudioDevices();\n this._devices = deviceResponse.devices;\n }\n\n private async handleDevicesChange() {\n const deviceResponse = await getAudioDevices();\n this._devices = deviceResponse.devices;\n }\n\n static styles: CSSResultGroup = [\n css`\n :host {\n display: block;\n font-family: var(--component-font-family);\n }\n /* Retain the anchor-name styling for this component */\n #settings-popover-button {\n anchor-name: --settings_popover_btn;\n }\n [popover] {\n margin: 0;\n padding: 16px;\n border: 0;\n background: var(--card-background);\n border: 1px solid var(--card-border-color);\n border-radius: var(--card-border-radius);\n box-shadow: var(--card-box-shadow);\n z-index: 1000;\n max-width: 260px;\n width: 100%;\n min-width: 200px;\n position-anchor: --settings_popover_btn;\n position-area: bottom span-right;\n position-visibility: always;\n position-try-fallbacks: flip-inline;\n overflow-x: hidden;\n }\n .settings-wrapper {\n display: flex;\n flex-direction: column;\n gap: 20px;\n }\n `,\n ButtonStyles,\n SelectStyles,\n CalloutStyles,\n ];\n private _selectDevice(deviceId: string): void {\n // Find the device object\n const device = this._devices.find(d => d.deviceId === deviceId);\n if (!device) {\n return;\n }\n this.selectedDevice = device;\n this.dispatchEvent(\n new CustomEvent('recording-devices-changed', {\n detail: {\n devices: this._devices,\n selectedDevice: device,\n },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _selectLanguage(language: string): void {\n if (!LANGUAGES_SUPPORTED.includes(language)) {\n return;\n }\n this.selectedLanguage = language;\n this.dispatchEvent(\n new CustomEvent('language-changed', {\n detail: {\n language: language,\n },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n render(): TemplateResult {\n return html`\n <div class=\"mic-selector\">\n <button id=\"settings-popover-button\" popovertarget=\"settings-popover\">\n <icon-settings></icon-settings>\n </button>\n <div id=\"settings-popover\" popover>\n <div class=\"settings-wrapper\">\n ${this.settingsDisabled\n ? html`\n <div class=\"callout warn\">\n Recording is in progress. Stop recording to change settings.\n </div>\n `\n : ''}\n <div class=\"form-group\">\n <label id=\"device-select-label\" for=\"device-select\">\n Recording Device\n </label>\n <select\n id=\"device-select\"\n aria-labelledby=\"device-select-label\"\n @change=${(e: Event) => {\n this._selectDevice((e.target as HTMLSelectElement).value);\n }}\n ?disabled=${this.settingsDisabled}\n >\n ${this._devices.map(\n device => html`\n <option\n value=${device.deviceId}\n ?selected=${this.selectedDevice?.deviceId ===\n device.deviceId}\n >\n ${device.label || 'Unknown Device'}\n </option>\n `,\n )}\n </select>\n </div>\n <div class=\"form-group\">\n <label id=\"language-select-label\" for=\"language-select\">\n Dictation Language\n </label>\n <select\n id=\"language-select\"\n aria-labelledby=\"language-select-label\"\n @change=${(e: Event) => {\n this._selectLanguage((e.target as HTMLSelectElement).value);\n }}\n ?disabled=${this.settingsDisabled}\n >\n ${LANGUAGES_SUPPORTED.map(\n language => html`\n <option\n value=${language}\n ?selected=${this.effectiveSelectedLanguage === language}\n >\n ${getLanguageName(language)}\n </option>\n `,\n )}\n </select>\n </div>\n </div>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'settings-menu': SettingsMenu;\n }\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const LANGUAGES_SUPPORTED = [
|
|
2
|
+
'en',
|
|
3
|
+
'en-GB',
|
|
4
|
+
'da',
|
|
5
|
+
'de',
|
|
6
|
+
'fr',
|
|
7
|
+
'sv',
|
|
8
|
+
'nl',
|
|
9
|
+
'no',
|
|
10
|
+
];
|
|
11
|
+
export const DEFAULT_DICTATION_CONFIG = {
|
|
12
|
+
primaryLanguage: 'en',
|
|
13
|
+
spokenPunctuation: true,
|
|
14
|
+
automaticPunctuation: true,
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,mBAAmB,GAAwC;IACtE,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACL,CAAC;AACF,MAAM,CAAC,MAAM,wBAAwB,GAA2B;IAC9D,eAAe,EAAE,IAAI;IACrB,iBAAiB,EAAE,IAAI;IACvB,oBAAoB,EAAE,IAAI;CAC3B,CAAC","sourcesContent":["import { Corti } from '@corti/sdk';\n\nexport const LANGUAGES_SUPPORTED: Corti.TranscribeSupportedLanguage[] = [\n 'en',\n 'en-GB',\n 'da',\n 'de',\n 'fr',\n 'sv',\n 'nl',\n 'no',\n];\nexport const DEFAULT_DICTATION_CONFIG: Corti.TranscribeConfig = {\n primaryLanguage: 'en',\n spokenPunctuation: true,\n automaticPunctuation: true,\n};\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class IconMicOn extends LitElement {
|
|
3
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
4
|
+
}
|
|
5
|
+
export declare class IconMicOff extends LitElement {
|
|
6
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
7
|
+
}
|
|
8
|
+
export declare class IconRecording extends LitElement {
|
|
9
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
10
|
+
}
|
|
11
|
+
export declare class IconSettings extends LitElement {
|
|
12
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
+
}
|
|
14
|
+
export declare class IconLoadingSpinner extends LitElement {
|
|
15
|
+
static styles: import("lit").CSSResult;
|
|
16
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
/* eslint-disable max-classes-per-file */
|
|
8
|
+
import { LitElement, css, html } from 'lit';
|
|
9
|
+
import { customElement } from 'lit/decorators.js';
|
|
10
|
+
let IconMicOn = class IconMicOn extends LitElement {
|
|
11
|
+
render() {
|
|
12
|
+
return html `
|
|
13
|
+
<div style="display: flex">
|
|
14
|
+
<svg
|
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
+
width="20"
|
|
17
|
+
height="20"
|
|
18
|
+
viewBox="0 0 24 24"
|
|
19
|
+
fill="none"
|
|
20
|
+
stroke="currentColor"
|
|
21
|
+
stroke-width="2"
|
|
22
|
+
stroke-linecap="round"
|
|
23
|
+
stroke-linejoin="round"
|
|
24
|
+
class="lucide lucide-mic"
|
|
25
|
+
>
|
|
26
|
+
<path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z" />
|
|
27
|
+
<path d="M19 10v2a7 7 0 0 1-14 0v-2" />
|
|
28
|
+
<line x1="12" x2="12" y1="19" y2="22" />
|
|
29
|
+
</svg>
|
|
30
|
+
</div>
|
|
31
|
+
`;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
IconMicOn = __decorate([
|
|
35
|
+
customElement('icon-mic-on')
|
|
36
|
+
], IconMicOn);
|
|
37
|
+
export { IconMicOn };
|
|
38
|
+
let IconMicOff = class IconMicOff extends LitElement {
|
|
39
|
+
render() {
|
|
40
|
+
return html ` <div style="display: flex">
|
|
41
|
+
<svg
|
|
42
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
43
|
+
width="20"
|
|
44
|
+
height="20"
|
|
45
|
+
viewBox="0 0 24 24"
|
|
46
|
+
fill="none"
|
|
47
|
+
stroke="currentColor"
|
|
48
|
+
stroke-width="2"
|
|
49
|
+
stroke-linecap="round"
|
|
50
|
+
stroke-linejoin="round"
|
|
51
|
+
class="lucide lucide-mic-off"
|
|
52
|
+
>
|
|
53
|
+
<line x1="2" x2="22" y1="2" y2="22" />
|
|
54
|
+
<path d="M18.89 13.23A7.12 7.12 0 0 0 19 12v-2" />
|
|
55
|
+
<path d="M5 10v2a7 7 0 0 0 12 5" />
|
|
56
|
+
<path d="M15 9.34V5a3 3 0 0 0-5.68-1.33" />
|
|
57
|
+
<path d="M9 9v3a3 3 0 0 0 5.12 2.12" />
|
|
58
|
+
<line x1="12" x2="12" y1="19" y2="22" />
|
|
59
|
+
</svg>
|
|
60
|
+
</div>`;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
IconMicOff = __decorate([
|
|
64
|
+
customElement('icon-mic-off')
|
|
65
|
+
], IconMicOff);
|
|
66
|
+
export { IconMicOff };
|
|
67
|
+
let IconRecording = class IconRecording extends LitElement {
|
|
68
|
+
render() {
|
|
69
|
+
return html `
|
|
70
|
+
<div style="display: flex;">
|
|
71
|
+
<svg
|
|
72
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
73
|
+
width="20"
|
|
74
|
+
height="20"
|
|
75
|
+
viewBox="0 0 24 24"
|
|
76
|
+
fill="none"
|
|
77
|
+
stroke="currentColor"
|
|
78
|
+
stroke-width="2"
|
|
79
|
+
stroke-linecap="round"
|
|
80
|
+
stroke-linejoin="round"
|
|
81
|
+
class="lucide lucide-circle-stop"
|
|
82
|
+
>
|
|
83
|
+
<circle cx="12" cy="12" r="10" />
|
|
84
|
+
<rect x="9" y="9" width="6" height="6" rx="1" fill="currentColor" />
|
|
85
|
+
</svg>
|
|
86
|
+
</div>
|
|
87
|
+
`;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
IconRecording = __decorate([
|
|
91
|
+
customElement('icon-recording')
|
|
92
|
+
], IconRecording);
|
|
93
|
+
export { IconRecording };
|
|
94
|
+
let IconSettings = class IconSettings extends LitElement {
|
|
95
|
+
render() {
|
|
96
|
+
return html `<div style="display: flex">
|
|
97
|
+
<svg
|
|
98
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
99
|
+
width="20"
|
|
100
|
+
height="20"
|
|
101
|
+
viewBox="0 0 24 24"
|
|
102
|
+
fill="none"
|
|
103
|
+
stroke="currentColor"
|
|
104
|
+
stroke-width="2"
|
|
105
|
+
stroke-linecap="round"
|
|
106
|
+
stroke-linejoin="round"
|
|
107
|
+
class="lucide lucide-settings-2"
|
|
108
|
+
>
|
|
109
|
+
<path d="M20 7h-9" />
|
|
110
|
+
<path d="M14 17H5" />
|
|
111
|
+
<circle cx="17" cy="17" r="3" />
|
|
112
|
+
<circle cx="7" cy="7" r="3" />
|
|
113
|
+
</svg>
|
|
114
|
+
</div>`;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
IconSettings = __decorate([
|
|
118
|
+
customElement('icon-settings')
|
|
119
|
+
], IconSettings);
|
|
120
|
+
export { IconSettings };
|
|
121
|
+
let IconLoadingSpinner = class IconLoadingSpinner extends LitElement {
|
|
122
|
+
render() {
|
|
123
|
+
return html `<div style="display: flex">
|
|
124
|
+
<svg
|
|
125
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
126
|
+
width="20"
|
|
127
|
+
height="20"
|
|
128
|
+
viewBox="0 0 24 24"
|
|
129
|
+
fill="none"
|
|
130
|
+
stroke="currentColor"
|
|
131
|
+
stroke-width="2"
|
|
132
|
+
stroke-linecap="round"
|
|
133
|
+
stroke-linejoin="round"
|
|
134
|
+
class="lucide lucide-loader-circle spin"
|
|
135
|
+
>
|
|
136
|
+
<path d="M21 12a9 9 0 1 1-6.219-8.56" />
|
|
137
|
+
</svg>
|
|
138
|
+
</div>`;
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
IconLoadingSpinner.styles = css `
|
|
142
|
+
@keyframes spin {
|
|
143
|
+
0% {
|
|
144
|
+
transform: rotate(0deg);
|
|
145
|
+
}
|
|
146
|
+
100% {
|
|
147
|
+
transform: rotate(360deg);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
.spin {
|
|
151
|
+
animation: spin 1s linear infinite;
|
|
152
|
+
}
|
|
153
|
+
`;
|
|
154
|
+
IconLoadingSpinner = __decorate([
|
|
155
|
+
customElement('icon-loading-spinner')
|
|
156
|
+
], IconLoadingSpinner);
|
|
157
|
+
export { IconLoadingSpinner };
|
|
158
|
+
//# sourceMappingURL=icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../src/icons/icons.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAyC;AACzC,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAG3C,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IACvC,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;;;;;;;;;;;;;;KAmBV,CAAC;IACJ,CAAC;CACF,CAAA;AAvBY,SAAS;IADrB,aAAa,CAAC,aAAa,CAAC;GAChB,SAAS,CAuBrB;;AAGM,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IACxC,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;WAoBJ,CAAC;IACV,CAAC;CACF,CAAA;AAxBY,UAAU;IADtB,aAAa,CAAC,cAAc,CAAC;GACjB,UAAU,CAwBtB;;AAGM,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAC3C,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;;;;;;;;;;;;;KAkBV,CAAC;IACJ,CAAC;CACF,CAAA;AAtBY,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CAsBzB;;AAEM,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,UAAU;IAC1C,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;;;;;;;;;;;;;WAkBJ,CAAC;IACV,CAAC;CACF,CAAA;AAtBY,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAsBxB;;AAGM,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,UAAU;IAehD,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;;;;;;;;;;WAeJ,CAAC;IACV,CAAC;;AA/BM,yBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;GAYlB,AAZY,CAYX;AAbS,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CAiC9B","sourcesContent":["/* eslint-disable max-classes-per-file */\nimport { LitElement, css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\n@customElement('icon-mic-on')\nexport class IconMicOn extends LitElement {\n render() {\n return html`\n <div style=\"display: flex\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"lucide lucide-mic\"\n >\n <path d=\"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z\" />\n <path d=\"M19 10v2a7 7 0 0 1-14 0v-2\" />\n <line x1=\"12\" x2=\"12\" y1=\"19\" y2=\"22\" />\n </svg>\n </div>\n `;\n }\n}\n\n@customElement('icon-mic-off')\nexport class IconMicOff extends LitElement {\n render() {\n return html` <div style=\"display: flex\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"lucide lucide-mic-off\"\n >\n <line x1=\"2\" x2=\"22\" y1=\"2\" y2=\"22\" />\n <path d=\"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2\" />\n <path d=\"M5 10v2a7 7 0 0 0 12 5\" />\n <path d=\"M15 9.34V5a3 3 0 0 0-5.68-1.33\" />\n <path d=\"M9 9v3a3 3 0 0 0 5.12 2.12\" />\n <line x1=\"12\" x2=\"12\" y1=\"19\" y2=\"22\" />\n </svg>\n </div>`;\n }\n}\n\n@customElement('icon-recording')\nexport class IconRecording extends LitElement {\n render() {\n return html`\n <div style=\"display: flex;\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"lucide lucide-circle-stop\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <rect x=\"9\" y=\"9\" width=\"6\" height=\"6\" rx=\"1\" fill=\"currentColor\" />\n </svg>\n </div>\n `;\n }\n}\n@customElement('icon-settings')\nexport class IconSettings extends LitElement {\n render() {\n return html`<div style=\"display: flex\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"lucide lucide-settings-2\"\n >\n <path d=\"M20 7h-9\" />\n <path d=\"M14 17H5\" />\n <circle cx=\"17\" cy=\"17\" r=\"3\" />\n <circle cx=\"7\" cy=\"7\" r=\"3\" />\n </svg>\n </div>`;\n }\n}\n\n@customElement('icon-loading-spinner')\nexport class IconLoadingSpinner extends LitElement {\n static styles = css`\n @keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n .spin {\n animation: spin 1s linear infinite;\n }\n `;\n\n render() {\n return html`<div style=\"display: flex\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"lucide lucide-loader-circle spin\"\n >\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n </div>`;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/icons/index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE,CAAC;IAC3C,cAAc,CAAC,MAAM,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC;AAC3D,CAAC;AAED,eAAe,cAAc,CAAC","sourcesContent":["import CortiDictation from './CortiDictation.js';\n\nif (!customElements.get('corti-dictation')) {\n customElements.define('corti-dictation', CortiDictation);\n}\n\nexport default CortiDictation;\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
const ComponentStyles = css `
|
|
3
|
+
.wrapper {
|
|
4
|
+
background-color: var(--card-background);
|
|
5
|
+
border: 1px solid var(--card-border-color);
|
|
6
|
+
border-radius: var(--card-border-radius);
|
|
7
|
+
box-shadow: var(--card-box-shadow);
|
|
8
|
+
padding: var(--card-padding);
|
|
9
|
+
display: flex;
|
|
10
|
+
width: min-content;
|
|
11
|
+
gap: 4px;
|
|
12
|
+
height: 46px;
|
|
13
|
+
width: 98px;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
}
|
|
17
|
+
h2 {
|
|
18
|
+
margin: 0 0 10px;
|
|
19
|
+
font-size: 1rem;
|
|
20
|
+
font-weight: 500;
|
|
21
|
+
}
|
|
22
|
+
label {
|
|
23
|
+
font-size: 0.9rem;
|
|
24
|
+
margin-right: 8px;
|
|
25
|
+
}
|
|
26
|
+
select {
|
|
27
|
+
padding: 4px 6px;
|
|
28
|
+
font-size: 0.9rem;
|
|
29
|
+
border: 1px solid var(--card-border-color);
|
|
30
|
+
border-radius: 4px;
|
|
31
|
+
background-color: var(--card-background);
|
|
32
|
+
color: inherit;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.visualiser {
|
|
36
|
+
width: 16px;
|
|
37
|
+
height: 100%;
|
|
38
|
+
background: var(--visualiser-background);
|
|
39
|
+
margin-top: 8px;
|
|
40
|
+
border-radius: 5px;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: flex-end;
|
|
44
|
+
}
|
|
45
|
+
.level {
|
|
46
|
+
height: 100%;
|
|
47
|
+
width: 100%;
|
|
48
|
+
background: var(--visualiser-level-color);
|
|
49
|
+
transition: width 0.1s ease-in-out;
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
export default ComponentStyles;
|
|
53
|
+
//# sourceMappingURL=ComponentStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComponentStyles.js","sourceRoot":"","sources":["../../src/styles/ComponentStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,eAAe,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiD1B,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { css } from 'lit';\n\nconst ComponentStyles = css`\n .wrapper {\n background-color: var(--card-background);\n border: 1px solid var(--card-border-color);\n border-radius: var(--card-border-radius);\n box-shadow: var(--card-box-shadow);\n padding: var(--card-padding);\n display: flex;\n width: min-content;\n gap: 4px;\n height: 46px;\n width: 98px;\n box-sizing: border-box;\n overflow: hidden;\n }\n h2 {\n margin: 0 0 10px;\n font-size: 1rem;\n font-weight: 500;\n }\n label {\n font-size: 0.9rem;\n margin-right: 8px;\n }\n select {\n padding: 4px 6px;\n font-size: 0.9rem;\n border: 1px solid var(--card-border-color);\n border-radius: 4px;\n background-color: var(--card-background);\n color: inherit;\n }\n\n .visualiser {\n width: 16px;\n height: 100%;\n background: var(--visualiser-background);\n margin-top: 8px;\n border-radius: 5px;\n overflow: hidden;\n display: flex;\n align-items: flex-end;\n }\n .level {\n height: 100%;\n width: 100%;\n background: var(--visualiser-level-color);\n transition: width 0.1s ease-in-out;\n }\n`;\n\nexport default ComponentStyles;\n"]}
|