@corti/dictation-web 0.0.1 → 0.0.2
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/dist/{src/index.js → CortiDictation.js} +1 -1
- package/dist/CortiDictation.js.map +1 -0
- package/dist/{src/DictationService.js → DictationService.js} +1 -1
- package/dist/DictationService.js.map +1 -0
- package/dist/RecorderManager.js.map +1 -0
- package/dist/audioService.js.map +1 -0
- package/dist/components/audio-visualiser.js.map +1 -0
- package/dist/components/settings-menu.js.map +1 -0
- package/dist/constants.js.map +1 -0
- package/dist/icons/icons.js.map +1 -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.js.map +1 -0
- package/dist/styles/buttons.js.map +1 -0
- package/dist/styles/callout.js.map +1 -0
- package/dist/styles/select.js.map +1 -0
- package/dist/styles/theme.js.map +1 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.js.map +1 -0
- package/package.json +6 -6
- package/.editorconfig +0 -29
- package/.eslintrc.json +0 -16
- package/.husky/pre-commit +0 -1
- package/.storybook/main.js +0 -8
- package/demo/index.html +0 -98
- package/dist/src/CortiDictation.d.ts +0 -19
- package/dist/src/CortiDictation.js +0 -137
- package/dist/src/CortiDictation.js.map +0 -1
- package/dist/src/DictationService.js.map +0 -1
- package/dist/src/RecorderManager.js.map +0 -1
- package/dist/src/audioRecorderManager.d.ts +0 -17
- package/dist/src/audioRecorderManager.js +0 -78
- package/dist/src/audioRecorderManager.js.map +0 -1
- package/dist/src/audioService.js.map +0 -1
- package/dist/src/componentStyles.d.ts +0 -1
- package/dist/src/componentStyles.js +0 -51
- package/dist/src/componentStyles.js.map +0 -1
- package/dist/src/components/audio-visualiser.js.map +0 -1
- package/dist/src/components/settings-menu.js.map +0 -1
- package/dist/src/components/visualiser.d.ts +0 -7
- package/dist/src/components/visualiser.js +0 -62
- package/dist/src/components/visualiser.js.map +0 -1
- package/dist/src/constants.js.map +0 -1
- package/dist/src/corti-dictation.d.ts +0 -1
- package/dist/src/corti-dictation.js +0 -3
- package/dist/src/corti-dictation.js.map +0 -1
- package/dist/src/dictationService.d.ts +0 -13
- package/dist/src/dictationService.js +0 -70
- package/dist/src/dictationService.js.map +0 -1
- package/dist/src/icons/icons.js.map +0 -1
- package/dist/src/icons/index.js.map +0 -1
- package/dist/src/icons/micOn.d.ts +0 -7
- package/dist/src/icons/micOn.js +0 -25
- package/dist/src/icons/micOn.js.map +0 -1
- package/dist/src/index.js.map +0 -1
- package/dist/src/mediaRecorderService.d.ts +0 -6
- package/dist/src/mediaRecorderService.js +0 -31
- package/dist/src/mediaRecorderService.js.map +0 -1
- package/dist/src/mic-selector.d.ts +0 -18
- package/dist/src/mic-selector.js +0 -131
- package/dist/src/mic-selector.js.map +0 -1
- package/dist/src/settings-menu.d.ts +0 -18
- package/dist/src/settings-menu.js +0 -131
- package/dist/src/settings-menu.js.map +0 -1
- package/dist/src/settings-popover.d.ts +0 -18
- package/dist/src/settings-popover.js +0 -131
- package/dist/src/settings-popover.js.map +0 -1
- package/dist/src/settings.d.ts +0 -18
- package/dist/src/settings.js +0 -131
- package/dist/src/settings.js.map +0 -1
- package/dist/src/styles/ComponentStyles.js.map +0 -1
- package/dist/src/styles/buttons.js.map +0 -1
- package/dist/src/styles/callout.js.map +0 -1
- package/dist/src/styles/select.js.map +0 -1
- package/dist/src/styles/theme.js.map +0 -1
- package/dist/src/types.js.map +0 -1
- package/dist/src/utils.js.map +0 -1
- package/dist/stories/index.stories.d.ts +0 -33
- package/dist/stories/index.stories.js +0 -37
- package/dist/stories/index.stories.js.map +0 -1
- package/dist/test/corti-dictation.test.d.ts +0 -1
- package/dist/test/corti-dictation.test.js +0 -100
- package/dist/test/corti-dictation.test.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/docs/DEV_README.md +0 -80
- package/src/DictationService.ts +0 -99
- package/src/RecorderManager.ts +0 -114
- package/src/audioService.ts +0 -25
- package/src/components/audio-visualiser.ts +0 -56
- package/src/components/settings-menu.ts +0 -152
- package/src/constants.ts +0 -10
- package/src/corti-dictation.ts +0 -3
- package/src/icons/icons.ts +0 -141
- package/src/icons/index.ts +0 -0
- package/src/index.ts +0 -154
- package/src/styles/ComponentStyles.ts +0 -53
- package/src/styles/buttons.ts +0 -59
- package/src/styles/callout.ts +0 -27
- package/src/styles/select.ts +0 -37
- package/src/styles/theme.ts +0 -75
- package/src/types.ts +0 -28
- package/src/utils.ts +0 -83
- package/stories/index.stories.ts +0 -60
- package/test/corti-dictation.test.ts +0 -124
- package/tsconfig.json +0 -22
- package/web-dev-server.config.js +0 -27
- package/web-test-runner.config.js +0 -41
- /package/dist/{src/index.d.ts → CortiDictation.d.ts} +0 -0
- /package/dist/{src/DictationService.d.ts → DictationService.d.ts} +0 -0
- /package/dist/{src/RecorderManager.d.ts → RecorderManager.d.ts} +0 -0
- /package/dist/{src/RecorderManager.js → RecorderManager.js} +0 -0
- /package/dist/{src/audioService.d.ts → audioService.d.ts} +0 -0
- /package/dist/{src/audioService.js → audioService.js} +0 -0
- /package/dist/{src/components → components}/audio-visualiser.d.ts +0 -0
- /package/dist/{src/components → components}/audio-visualiser.js +0 -0
- /package/dist/{src/components → components}/settings-menu.d.ts +0 -0
- /package/dist/{src/components → components}/settings-menu.js +0 -0
- /package/dist/{src/constants.d.ts → constants.d.ts} +0 -0
- /package/dist/{src/constants.js → constants.js} +0 -0
- /package/dist/{src/icons → icons}/icons.d.ts +0 -0
- /package/dist/{src/icons → icons}/icons.js +0 -0
- /package/dist/{src/icons → icons}/index.d.ts +0 -0
- /package/dist/{src/icons → icons}/index.js +0 -0
- /package/dist/{src/styles → styles}/ComponentStyles.d.ts +0 -0
- /package/dist/{src/styles → styles}/ComponentStyles.js +0 -0
- /package/dist/{src/styles → styles}/buttons.d.ts +0 -0
- /package/dist/{src/styles → styles}/buttons.js +0 -0
- /package/dist/{src/styles → styles}/callout.d.ts +0 -0
- /package/dist/{src/styles → styles}/callout.js +0 -0
- /package/dist/{src/styles → styles}/select.d.ts +0 -0
- /package/dist/{src/styles → styles}/select.js +0 -0
- /package/dist/{src/styles → styles}/theme.d.ts +0 -0
- /package/dist/{src/styles → styles}/theme.js +0 -0
- /package/dist/{src/types.d.ts → types.d.ts} +0 -0
- /package/dist/{src/types.js → types.js} +0 -0
- /package/dist/{src/utils.d.ts → utils.d.ts} +0 -0
- /package/dist/{src/utils.js → utils.js} +0 -0
package/dist/src/mic-selector.js
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
// mic-selector.ts
|
|
3
|
-
import { LitElement, html, css } from 'lit';
|
|
4
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
5
|
-
import ButtonStyles from './styles/buttons';
|
|
6
|
-
import SelectStyles from './styles/select';
|
|
7
|
-
let MicSelector = class MicSelector extends LitElement {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...arguments);
|
|
10
|
-
this.devices = [];
|
|
11
|
-
this.selectedDevice = '';
|
|
12
|
-
}
|
|
13
|
-
_selectDevice(device) {
|
|
14
|
-
this.selectedDevice = device.deviceId;
|
|
15
|
-
this.dispatchEvent(new CustomEvent('recording-device-changed', {
|
|
16
|
-
detail: device,
|
|
17
|
-
bubbles: true,
|
|
18
|
-
composed: true,
|
|
19
|
-
}));
|
|
20
|
-
}
|
|
21
|
-
render() {
|
|
22
|
-
return html `
|
|
23
|
-
<div class="mic-selector">
|
|
24
|
-
<button id="settings-popover-button" popovertarget="settings-popover">
|
|
25
|
-
<icon-settings></icon-settings>
|
|
26
|
-
</button>
|
|
27
|
-
<div id="settings-popover" popover>
|
|
28
|
-
<label id="device-select-label" for="device-select">
|
|
29
|
-
Recording Device
|
|
30
|
-
</label>
|
|
31
|
-
<select
|
|
32
|
-
id="device-select"
|
|
33
|
-
aria-labelledby="device-select-label"
|
|
34
|
-
@change=${(e) => {
|
|
35
|
-
const target = e.target;
|
|
36
|
-
const selectedDevice = this.devices.find(device => device.deviceId === target.value);
|
|
37
|
-
if (selectedDevice) {
|
|
38
|
-
this._selectDevice(selectedDevice);
|
|
39
|
-
}
|
|
40
|
-
}}
|
|
41
|
-
>
|
|
42
|
-
${this.devices.map(device => html `
|
|
43
|
-
<option
|
|
44
|
-
value=${device.deviceId}
|
|
45
|
-
?selected=${this.selectedDevice === device.deviceId}
|
|
46
|
-
>
|
|
47
|
-
${device.label || 'Unknown Device'}
|
|
48
|
-
</option>
|
|
49
|
-
`)}
|
|
50
|
-
</select>
|
|
51
|
-
<!-- ${this.devices.map(device => html `
|
|
52
|
-
<div
|
|
53
|
-
class="dropdown-item ${this.selectedDevice === device.deviceId
|
|
54
|
-
? 'selected'
|
|
55
|
-
: ''}"
|
|
56
|
-
@click=${() => this._selectDevice(device)}
|
|
57
|
-
>
|
|
58
|
-
${device.label || 'Unknown Device'}
|
|
59
|
-
</div>
|
|
60
|
-
`)} -->
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
`;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
MicSelector.styles = [
|
|
67
|
-
css `
|
|
68
|
-
:host {
|
|
69
|
-
display: block;
|
|
70
|
-
font-family: var(--component-font-family);
|
|
71
|
-
}
|
|
72
|
-
.label {
|
|
73
|
-
font-size: 0.8rem;
|
|
74
|
-
color: var(--component-text-color);
|
|
75
|
-
margin-bottom: 4px;
|
|
76
|
-
}
|
|
77
|
-
/* Retain the anchor-name styling for this component */
|
|
78
|
-
#settings-popover-button {
|
|
79
|
-
anchor-name: --settings_popover_btn;
|
|
80
|
-
}
|
|
81
|
-
[popover] {
|
|
82
|
-
margin: 0;
|
|
83
|
-
padding: 16px;
|
|
84
|
-
border: 0;
|
|
85
|
-
background: var(--card-background);
|
|
86
|
-
border: 1px solid var(--card-border-color);
|
|
87
|
-
border-radius: var(--card-border-radius);
|
|
88
|
-
box-shadow: var(--card-box-shadow);
|
|
89
|
-
z-index: 1000;
|
|
90
|
-
max-width: 260px;
|
|
91
|
-
position-anchor: --settings_popover_btn;
|
|
92
|
-
position-area: bottom;
|
|
93
|
-
position-visibility: always;
|
|
94
|
-
/* inset: unset; */
|
|
95
|
-
transform: translateX(45%);
|
|
96
|
-
overflow-x: hidden;
|
|
97
|
-
}
|
|
98
|
-
.dropdown-item {
|
|
99
|
-
padding: 8px;
|
|
100
|
-
cursor: pointer;
|
|
101
|
-
font-size: 0.9rem;
|
|
102
|
-
color: var(--component-text-color);
|
|
103
|
-
// allow only a single line of text and truncate the rest
|
|
104
|
-
width: 100%;
|
|
105
|
-
overflow: hidden;
|
|
106
|
-
text-overflow: ellipsis;
|
|
107
|
-
white-space: nowrap;
|
|
108
|
-
opacity: 0.8;
|
|
109
|
-
}
|
|
110
|
-
.dropdown-item:hover {
|
|
111
|
-
background: var(--action-plain-background-hover);
|
|
112
|
-
}
|
|
113
|
-
.dropdown-item.selected {
|
|
114
|
-
font-weight: bold;
|
|
115
|
-
opacity: 1;
|
|
116
|
-
}
|
|
117
|
-
`,
|
|
118
|
-
ButtonStyles,
|
|
119
|
-
SelectStyles,
|
|
120
|
-
];
|
|
121
|
-
__decorate([
|
|
122
|
-
property({ type: Array })
|
|
123
|
-
], MicSelector.prototype, "devices", void 0);
|
|
124
|
-
__decorate([
|
|
125
|
-
property({ type: String })
|
|
126
|
-
], MicSelector.prototype, "selectedDevice", void 0);
|
|
127
|
-
MicSelector = __decorate([
|
|
128
|
-
customElement('mic-selector')
|
|
129
|
-
], MicSelector);
|
|
130
|
-
export { MicSelector };
|
|
131
|
-
//# sourceMappingURL=mic-selector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mic-selector.js","sourceRoot":"","sources":["../../src/mic-selector.ts"],"names":[],"mappings":";AAAA,kBAAkB;AAClB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkC,MAAM,KAAK,CAAC;AAC5E,OAAO,EAAE,aAAa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C,CAAC,UAAU;YACZ,CAAC,CAAC,EAAE;yBACG,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;;kBAEvC,MAAM,CAAC,KAAK,IAAI,gBAAgB;;aAErC,CACF;;;KAGN,CAAC;IACJ,CAAC;;AApHM,kBAAM,GAAmB;IAC9B,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkDF;IACD,YAAY;IACZ,YAAY;CACb,AAtDY,CAsDX;AA3DF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;4CACH;AAGvB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDACC;AALjB,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CA4HvB","sourcesContent":["// mic-selector.ts\nimport { LitElement, html, css, TemplateResult, CSSResultGroup } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport ButtonStyles from './styles/buttons';\nimport SelectStyles from './styles/select';\n\ninterface Device {\n deviceId: string;\n label?: string;\n}\n\n@customElement('mic-selector')\nexport class MicSelector extends LitElement {\n @property({ type: Array })\n devices: Device[] = [];\n\n @property({ type: String })\n selectedDevice: string = '';\n\n static styles: CSSResultGroup = [\n css`\n :host {\n display: block;\n font-family: var(--component-font-family);\n }\n .label {\n font-size: 0.8rem;\n color: var(--component-text-color);\n margin-bottom: 4px;\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 position-anchor: --settings_popover_btn;\n position-area: bottom;\n position-visibility: always;\n /* inset: unset; */\n transform: translateX(45%);\n overflow-x: hidden;\n }\n .dropdown-item {\n padding: 8px;\n cursor: pointer;\n font-size: 0.9rem;\n color: var(--component-text-color);\n // allow only a single line of text and truncate the rest\n width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n opacity: 0.8;\n }\n .dropdown-item:hover {\n background: var(--action-plain-background-hover);\n }\n .dropdown-item.selected {\n font-weight: bold;\n opacity: 1;\n }\n `,\n ButtonStyles,\n SelectStyles,\n ];\n\n private _selectDevice(device: Device): void {\n this.selectedDevice = device.deviceId;\n this.dispatchEvent(\n new CustomEvent('recording-device-changed', {\n detail: device,\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 <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 const target = e.target as HTMLSelectElement;\n const selectedDevice = this.devices.find(\n device => device.deviceId === target.value,\n );\n if (selectedDevice) {\n this._selectDevice(selectedDevice);\n }\n }}\n >\n ${this.devices.map(\n device => html`\n <option\n value=${device.deviceId}\n ?selected=${this.selectedDevice === device.deviceId}\n >\n ${device.label || 'Unknown Device'}\n </option>\n `,\n )}\n </select>\n <!-- ${this.devices.map(\n device => html`\n <div\n class=\"dropdown-item ${this.selectedDevice === device.deviceId\n ? 'selected'\n : ''}\"\n @click=${() => this._selectDevice(device)}\n >\n ${device.label || 'Unknown Device'}\n </div>\n `,\n )} -->\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'mic-selector': MicSelector;\n }\n}\n"]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { LitElement, TemplateResult, CSSResultGroup } from 'lit';
|
|
2
|
-
interface Device {
|
|
3
|
-
deviceId: string;
|
|
4
|
-
label?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare class MicSelector extends LitElement {
|
|
7
|
-
devices: Device[];
|
|
8
|
-
selectedDevice: string;
|
|
9
|
-
static styles: CSSResultGroup;
|
|
10
|
-
private _selectDevice;
|
|
11
|
-
render(): TemplateResult;
|
|
12
|
-
}
|
|
13
|
-
declare global {
|
|
14
|
-
interface HTMLElementTagNameMap {
|
|
15
|
-
'mic-selector': MicSelector;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
// mic-selector.ts
|
|
3
|
-
import { LitElement, html, css } from 'lit';
|
|
4
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
5
|
-
import ButtonStyles from './styles/buttons';
|
|
6
|
-
import SelectStyles from './styles/select';
|
|
7
|
-
let MicSelector = class MicSelector extends LitElement {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...arguments);
|
|
10
|
-
this.devices = [];
|
|
11
|
-
this.selectedDevice = '';
|
|
12
|
-
}
|
|
13
|
-
_selectDevice(device) {
|
|
14
|
-
this.selectedDevice = device.deviceId;
|
|
15
|
-
this.dispatchEvent(new CustomEvent('recording-device-changed', {
|
|
16
|
-
detail: device,
|
|
17
|
-
bubbles: true,
|
|
18
|
-
composed: true,
|
|
19
|
-
}));
|
|
20
|
-
}
|
|
21
|
-
render() {
|
|
22
|
-
return html `
|
|
23
|
-
<div class="mic-selector">
|
|
24
|
-
<button id="settings-popover-button" popovertarget="settings-popover">
|
|
25
|
-
<icon-settings></icon-settings>
|
|
26
|
-
</button>
|
|
27
|
-
<div id="settings-popover" popover>
|
|
28
|
-
<label id="device-select-label" for="device-select">
|
|
29
|
-
Recording Device
|
|
30
|
-
</label>
|
|
31
|
-
<select
|
|
32
|
-
id="device-select"
|
|
33
|
-
aria-labelledby="device-select-label"
|
|
34
|
-
@change=${(e) => {
|
|
35
|
-
const target = e.target;
|
|
36
|
-
const selectedDevice = this.devices.find(device => device.deviceId === target.value);
|
|
37
|
-
if (selectedDevice) {
|
|
38
|
-
this._selectDevice(selectedDevice);
|
|
39
|
-
}
|
|
40
|
-
}}
|
|
41
|
-
>
|
|
42
|
-
${this.devices.map(device => html `
|
|
43
|
-
<option
|
|
44
|
-
value=${device.deviceId}
|
|
45
|
-
?selected=${this.selectedDevice === device.deviceId}
|
|
46
|
-
>
|
|
47
|
-
${device.label || 'Unknown Device'}
|
|
48
|
-
</option>
|
|
49
|
-
`)}
|
|
50
|
-
</select>
|
|
51
|
-
<!-- ${this.devices.map(device => html `
|
|
52
|
-
<div
|
|
53
|
-
class="dropdown-item ${this.selectedDevice === device.deviceId
|
|
54
|
-
? 'selected'
|
|
55
|
-
: ''}"
|
|
56
|
-
@click=${() => this._selectDevice(device)}
|
|
57
|
-
>
|
|
58
|
-
${device.label || 'Unknown Device'}
|
|
59
|
-
</div>
|
|
60
|
-
`)} -->
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
`;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
MicSelector.styles = [
|
|
67
|
-
css `
|
|
68
|
-
:host {
|
|
69
|
-
display: block;
|
|
70
|
-
font-family: var(--component-font-family);
|
|
71
|
-
}
|
|
72
|
-
.label {
|
|
73
|
-
font-size: 0.8rem;
|
|
74
|
-
color: var(--component-text-color);
|
|
75
|
-
margin-bottom: 4px;
|
|
76
|
-
}
|
|
77
|
-
/* Retain the anchor-name styling for this component */
|
|
78
|
-
#settings-popover-button {
|
|
79
|
-
anchor-name: --settings_popover_btn;
|
|
80
|
-
}
|
|
81
|
-
[popover] {
|
|
82
|
-
margin: 0;
|
|
83
|
-
padding: 16px;
|
|
84
|
-
border: 0;
|
|
85
|
-
background: var(--card-background);
|
|
86
|
-
border: 1px solid var(--card-border-color);
|
|
87
|
-
border-radius: var(--card-border-radius);
|
|
88
|
-
box-shadow: var(--card-box-shadow);
|
|
89
|
-
z-index: 1000;
|
|
90
|
-
max-width: 260px;
|
|
91
|
-
position-anchor: --settings_popover_btn;
|
|
92
|
-
position-area: bottom;
|
|
93
|
-
position-visibility: always;
|
|
94
|
-
/* inset: unset; */
|
|
95
|
-
transform: translateX(45%);
|
|
96
|
-
overflow-x: hidden;
|
|
97
|
-
}
|
|
98
|
-
.dropdown-item {
|
|
99
|
-
padding: 8px;
|
|
100
|
-
cursor: pointer;
|
|
101
|
-
font-size: 0.9rem;
|
|
102
|
-
color: var(--component-text-color);
|
|
103
|
-
// allow only a single line of text and truncate the rest
|
|
104
|
-
width: 100%;
|
|
105
|
-
overflow: hidden;
|
|
106
|
-
text-overflow: ellipsis;
|
|
107
|
-
white-space: nowrap;
|
|
108
|
-
opacity: 0.8;
|
|
109
|
-
}
|
|
110
|
-
.dropdown-item:hover {
|
|
111
|
-
background: var(--action-plain-background-hover);
|
|
112
|
-
}
|
|
113
|
-
.dropdown-item.selected {
|
|
114
|
-
font-weight: bold;
|
|
115
|
-
opacity: 1;
|
|
116
|
-
}
|
|
117
|
-
`,
|
|
118
|
-
ButtonStyles,
|
|
119
|
-
SelectStyles,
|
|
120
|
-
];
|
|
121
|
-
__decorate([
|
|
122
|
-
property({ type: Array })
|
|
123
|
-
], MicSelector.prototype, "devices", void 0);
|
|
124
|
-
__decorate([
|
|
125
|
-
property({ type: String })
|
|
126
|
-
], MicSelector.prototype, "selectedDevice", void 0);
|
|
127
|
-
MicSelector = __decorate([
|
|
128
|
-
customElement('mic-selector')
|
|
129
|
-
], MicSelector);
|
|
130
|
-
export { MicSelector };
|
|
131
|
-
//# sourceMappingURL=settings-menu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"settings-menu.js","sourceRoot":"","sources":["../../src/settings-menu.ts"],"names":[],"mappings":";AAAA,kBAAkB;AAClB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkC,MAAM,KAAK,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,YAAY,MAAM,k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,CAAC,aAAa,CAAC,MAAM,CAAC;;kBAEvC,MAAM,CAAC,KAAK,IAAI,gBAAgB;;aAErC,CACF;;;KAGN,CAAC;IACJ,CAAC;;AApHM,kBAAM,GAAmB;IAC9B,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkDF;IACD,YAAY;IACZ,YAAY;CACb,AAtDY,CAsDX;AA3DF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;4CACH;AAGvB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDACC;AALjB,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CA4HvB","sourcesContent":["// mic-selector.ts\nimport { LitElement, html, css, TemplateResult, CSSResultGroup } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport ButtonStyles from './styles/buttons';\nimport SelectStyles from './styles/select';\n\ninterface Device {\n deviceId: string;\n label?: string;\n}\n\n@customElement('mic-selector')\nexport class MicSelector extends LitElement {\n @property({ type: Array })\n devices: Device[] = [];\n\n @property({ type: String })\n selectedDevice: string = '';\n\n static styles: CSSResultGroup = [\n css`\n :host {\n display: block;\n font-family: var(--component-font-family);\n }\n .label {\n font-size: 0.8rem;\n color: var(--component-text-color);\n margin-bottom: 4px;\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 position-anchor: --settings_popover_btn;\n position-area: bottom;\n position-visibility: always;\n /* inset: unset; */\n transform: translateX(45%);\n overflow-x: hidden;\n }\n .dropdown-item {\n padding: 8px;\n cursor: pointer;\n font-size: 0.9rem;\n color: var(--component-text-color);\n // allow only a single line of text and truncate the rest\n width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n opacity: 0.8;\n }\n .dropdown-item:hover {\n background: var(--action-plain-background-hover);\n }\n .dropdown-item.selected {\n font-weight: bold;\n opacity: 1;\n }\n `,\n ButtonStyles,\n SelectStyles,\n ];\n\n private _selectDevice(device: Device): void {\n this.selectedDevice = device.deviceId;\n this.dispatchEvent(\n new CustomEvent('recording-device-changed', {\n detail: device,\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 <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 const target = e.target as HTMLSelectElement;\n const selectedDevice = this.devices.find(\n device => device.deviceId === target.value,\n );\n if (selectedDevice) {\n this._selectDevice(selectedDevice);\n }\n }}\n >\n ${this.devices.map(\n device => html`\n <option\n value=${device.deviceId}\n ?selected=${this.selectedDevice === device.deviceId}\n >\n ${device.label || 'Unknown Device'}\n </option>\n `,\n )}\n </select>\n <!-- ${this.devices.map(\n device => html`\n <div\n class=\"dropdown-item ${this.selectedDevice === device.deviceId\n ? 'selected'\n : ''}\"\n @click=${() => this._selectDevice(device)}\n >\n ${device.label || 'Unknown Device'}\n </div>\n `,\n )} -->\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'mic-selector': MicSelector;\n }\n}\n"]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { LitElement, TemplateResult, CSSResultGroup } from 'lit';
|
|
2
|
-
interface Device {
|
|
3
|
-
deviceId: string;
|
|
4
|
-
label?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare class MicSelector extends LitElement {
|
|
7
|
-
devices: Device[];
|
|
8
|
-
selectedDevice: string;
|
|
9
|
-
static styles: CSSResultGroup;
|
|
10
|
-
private _selectDevice;
|
|
11
|
-
render(): TemplateResult;
|
|
12
|
-
}
|
|
13
|
-
declare global {
|
|
14
|
-
interface HTMLElementTagNameMap {
|
|
15
|
-
'mic-selector': MicSelector;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
// mic-selector.ts
|
|
3
|
-
import { LitElement, html, css } from 'lit';
|
|
4
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
5
|
-
import ButtonStyles from './styles/buttons';
|
|
6
|
-
import SelectStyles from './styles/select';
|
|
7
|
-
let MicSelector = class MicSelector extends LitElement {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...arguments);
|
|
10
|
-
this.devices = [];
|
|
11
|
-
this.selectedDevice = '';
|
|
12
|
-
}
|
|
13
|
-
_selectDevice(device) {
|
|
14
|
-
this.selectedDevice = device.deviceId;
|
|
15
|
-
this.dispatchEvent(new CustomEvent('recording-device-changed', {
|
|
16
|
-
detail: device,
|
|
17
|
-
bubbles: true,
|
|
18
|
-
composed: true,
|
|
19
|
-
}));
|
|
20
|
-
}
|
|
21
|
-
render() {
|
|
22
|
-
return html `
|
|
23
|
-
<div class="mic-selector">
|
|
24
|
-
<button id="settings-popover-button" popovertarget="settings-popover">
|
|
25
|
-
<icon-settings></icon-settings>
|
|
26
|
-
</button>
|
|
27
|
-
<div id="settings-popover" popover>
|
|
28
|
-
<label id="device-select-label" for="device-select">
|
|
29
|
-
Recording Device
|
|
30
|
-
</label>
|
|
31
|
-
<select
|
|
32
|
-
id="device-select"
|
|
33
|
-
aria-labelledby="device-select-label"
|
|
34
|
-
@change=${(e) => {
|
|
35
|
-
const target = e.target;
|
|
36
|
-
const selectedDevice = this.devices.find(device => device.deviceId === target.value);
|
|
37
|
-
if (selectedDevice) {
|
|
38
|
-
this._selectDevice(selectedDevice);
|
|
39
|
-
}
|
|
40
|
-
}}
|
|
41
|
-
>
|
|
42
|
-
${this.devices.map(device => html `
|
|
43
|
-
<option
|
|
44
|
-
value=${device.deviceId}
|
|
45
|
-
?selected=${this.selectedDevice === device.deviceId}
|
|
46
|
-
>
|
|
47
|
-
${device.label || 'Unknown Device'}
|
|
48
|
-
</option>
|
|
49
|
-
`)}
|
|
50
|
-
</select>
|
|
51
|
-
<!-- ${this.devices.map(device => html `
|
|
52
|
-
<div
|
|
53
|
-
class="dropdown-item ${this.selectedDevice === device.deviceId
|
|
54
|
-
? 'selected'
|
|
55
|
-
: ''}"
|
|
56
|
-
@click=${() => this._selectDevice(device)}
|
|
57
|
-
>
|
|
58
|
-
${device.label || 'Unknown Device'}
|
|
59
|
-
</div>
|
|
60
|
-
`)} -->
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
`;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
MicSelector.styles = [
|
|
67
|
-
css `
|
|
68
|
-
:host {
|
|
69
|
-
display: block;
|
|
70
|
-
font-family: var(--component-font-family);
|
|
71
|
-
}
|
|
72
|
-
.label {
|
|
73
|
-
font-size: 0.8rem;
|
|
74
|
-
color: var(--component-text-color);
|
|
75
|
-
margin-bottom: 4px;
|
|
76
|
-
}
|
|
77
|
-
/* Retain the anchor-name styling for this component */
|
|
78
|
-
#settings-popover-button {
|
|
79
|
-
anchor-name: --settings_popover_btn;
|
|
80
|
-
}
|
|
81
|
-
[popover] {
|
|
82
|
-
margin: 0;
|
|
83
|
-
padding: 16px;
|
|
84
|
-
border: 0;
|
|
85
|
-
background: var(--card-background);
|
|
86
|
-
border: 1px solid var(--card-border-color);
|
|
87
|
-
border-radius: var(--card-border-radius);
|
|
88
|
-
box-shadow: var(--card-box-shadow);
|
|
89
|
-
z-index: 1000;
|
|
90
|
-
max-width: 260px;
|
|
91
|
-
position-anchor: --settings_popover_btn;
|
|
92
|
-
position-area: bottom;
|
|
93
|
-
position-visibility: always;
|
|
94
|
-
/* inset: unset; */
|
|
95
|
-
transform: translateX(45%);
|
|
96
|
-
overflow-x: hidden;
|
|
97
|
-
}
|
|
98
|
-
.dropdown-item {
|
|
99
|
-
padding: 8px;
|
|
100
|
-
cursor: pointer;
|
|
101
|
-
font-size: 0.9rem;
|
|
102
|
-
color: var(--component-text-color);
|
|
103
|
-
// allow only a single line of text and truncate the rest
|
|
104
|
-
width: 100%;
|
|
105
|
-
overflow: hidden;
|
|
106
|
-
text-overflow: ellipsis;
|
|
107
|
-
white-space: nowrap;
|
|
108
|
-
opacity: 0.8;
|
|
109
|
-
}
|
|
110
|
-
.dropdown-item:hover {
|
|
111
|
-
background: var(--action-plain-background-hover);
|
|
112
|
-
}
|
|
113
|
-
.dropdown-item.selected {
|
|
114
|
-
font-weight: bold;
|
|
115
|
-
opacity: 1;
|
|
116
|
-
}
|
|
117
|
-
`,
|
|
118
|
-
ButtonStyles,
|
|
119
|
-
SelectStyles,
|
|
120
|
-
];
|
|
121
|
-
__decorate([
|
|
122
|
-
property({ type: Array })
|
|
123
|
-
], MicSelector.prototype, "devices", void 0);
|
|
124
|
-
__decorate([
|
|
125
|
-
property({ type: String })
|
|
126
|
-
], MicSelector.prototype, "selectedDevice", void 0);
|
|
127
|
-
MicSelector = __decorate([
|
|
128
|
-
customElement('mic-selector')
|
|
129
|
-
], MicSelector);
|
|
130
|
-
export { MicSelector };
|
|
131
|
-
//# sourceMappingURL=settings-popover.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"settings-popover.js","sourceRoot":"","sources":["../../src/settings-popover.ts"],"names":[],"mappings":";AAAA,kBAAkB;AAClB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkC,MAAM,KAAK,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAQpC,IAAM,W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AAgB;;aAErC,CACF;;;KAGN,CAAC;IACJ,CAAC;;AApHM,kBAAM,GAAmB;IAC9B,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkDF;IACD,YAAY;IACZ,YAAY;CACb,AAtDY,CAsDX;AA3DF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;4CACH;AAGvB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDACC;AALjB,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CA4HvB","sourcesContent":["// mic-selector.ts\nimport { LitElement, html, css, TemplateResult, CSSResultGroup } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport ButtonStyles from './styles/buttons';\nimport SelectStyles from './styles/select';\n\ninterface Device {\n deviceId: string;\n label?: string;\n}\n\n@customElement('mic-selector')\nexport class MicSelector extends LitElement {\n @property({ type: Array })\n devices: Device[] = [];\n\n @property({ type: String })\n selectedDevice: string = '';\n\n static styles: CSSResultGroup = [\n css`\n :host {\n display: block;\n font-family: var(--component-font-family);\n }\n .label {\n font-size: 0.8rem;\n color: var(--component-text-color);\n margin-bottom: 4px;\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 position-anchor: --settings_popover_btn;\n position-area: bottom;\n position-visibility: always;\n /* inset: unset; */\n transform: translateX(45%);\n overflow-x: hidden;\n }\n .dropdown-item {\n padding: 8px;\n cursor: pointer;\n font-size: 0.9rem;\n color: var(--component-text-color);\n // allow only a single line of text and truncate the rest\n width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n opacity: 0.8;\n }\n .dropdown-item:hover {\n background: var(--action-plain-background-hover);\n }\n .dropdown-item.selected {\n font-weight: bold;\n opacity: 1;\n }\n `,\n ButtonStyles,\n SelectStyles,\n ];\n\n private _selectDevice(device: Device): void {\n this.selectedDevice = device.deviceId;\n this.dispatchEvent(\n new CustomEvent('recording-device-changed', {\n detail: device,\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 <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 const target = e.target as HTMLSelectElement;\n const selectedDevice = this.devices.find(\n device => device.deviceId === target.value,\n );\n if (selectedDevice) {\n this._selectDevice(selectedDevice);\n }\n }}\n >\n ${this.devices.map(\n device => html`\n <option\n value=${device.deviceId}\n ?selected=${this.selectedDevice === device.deviceId}\n >\n ${device.label || 'Unknown Device'}\n </option>\n `,\n )}\n </select>\n <!-- ${this.devices.map(\n device => html`\n <div\n class=\"dropdown-item ${this.selectedDevice === device.deviceId\n ? 'selected'\n : ''}\"\n @click=${() => this._selectDevice(device)}\n >\n ${device.label || 'Unknown Device'}\n </div>\n `,\n )} -->\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'mic-selector': MicSelector;\n }\n}\n"]}
|
package/dist/src/settings.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { LitElement, TemplateResult, CSSResultGroup } from 'lit';
|
|
2
|
-
interface Device {
|
|
3
|
-
deviceId: string;
|
|
4
|
-
label?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare class MicSelector extends LitElement {
|
|
7
|
-
devices: Device[];
|
|
8
|
-
selectedDevice: string;
|
|
9
|
-
static styles: CSSResultGroup;
|
|
10
|
-
private _selectDevice;
|
|
11
|
-
render(): TemplateResult;
|
|
12
|
-
}
|
|
13
|
-
declare global {
|
|
14
|
-
interface HTMLElementTagNameMap {
|
|
15
|
-
'mic-selector': MicSelector;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export {};
|
package/dist/src/settings.js
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
// mic-selector.ts
|
|
3
|
-
import { LitElement, html, css } from 'lit';
|
|
4
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
5
|
-
import ButtonStyles from './styles/buttons';
|
|
6
|
-
import SelectStyles from './styles/select';
|
|
7
|
-
let MicSelector = class MicSelector extends LitElement {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...arguments);
|
|
10
|
-
this.devices = [];
|
|
11
|
-
this.selectedDevice = '';
|
|
12
|
-
}
|
|
13
|
-
_selectDevice(device) {
|
|
14
|
-
this.selectedDevice = device.deviceId;
|
|
15
|
-
this.dispatchEvent(new CustomEvent('recording-device-changed', {
|
|
16
|
-
detail: device,
|
|
17
|
-
bubbles: true,
|
|
18
|
-
composed: true,
|
|
19
|
-
}));
|
|
20
|
-
}
|
|
21
|
-
render() {
|
|
22
|
-
return html `
|
|
23
|
-
<div class="mic-selector">
|
|
24
|
-
<button id="settings-popover-button" popovertarget="settings-popover">
|
|
25
|
-
<icon-settings></icon-settings>
|
|
26
|
-
</button>
|
|
27
|
-
<div id="settings-popover" popover>
|
|
28
|
-
<label id="device-select-label" for="device-select">
|
|
29
|
-
Recording Device
|
|
30
|
-
</label>
|
|
31
|
-
<select
|
|
32
|
-
id="device-select"
|
|
33
|
-
aria-labelledby="device-select-label"
|
|
34
|
-
@change=${(e) => {
|
|
35
|
-
const target = e.target;
|
|
36
|
-
const selectedDevice = this.devices.find(device => device.deviceId === target.value);
|
|
37
|
-
if (selectedDevice) {
|
|
38
|
-
this._selectDevice(selectedDevice);
|
|
39
|
-
}
|
|
40
|
-
}}
|
|
41
|
-
>
|
|
42
|
-
${this.devices.map(device => html `
|
|
43
|
-
<option
|
|
44
|
-
value=${device.deviceId}
|
|
45
|
-
?selected=${this.selectedDevice === device.deviceId}
|
|
46
|
-
>
|
|
47
|
-
${device.label || 'Unknown Device'}
|
|
48
|
-
</option>
|
|
49
|
-
`)}
|
|
50
|
-
</select>
|
|
51
|
-
<!-- ${this.devices.map(device => html `
|
|
52
|
-
<div
|
|
53
|
-
class="dropdown-item ${this.selectedDevice === device.deviceId
|
|
54
|
-
? 'selected'
|
|
55
|
-
: ''}"
|
|
56
|
-
@click=${() => this._selectDevice(device)}
|
|
57
|
-
>
|
|
58
|
-
${device.label || 'Unknown Device'}
|
|
59
|
-
</div>
|
|
60
|
-
`)} -->
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
`;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
MicSelector.styles = [
|
|
67
|
-
css `
|
|
68
|
-
:host {
|
|
69
|
-
display: block;
|
|
70
|
-
font-family: var(--component-font-family);
|
|
71
|
-
}
|
|
72
|
-
.label {
|
|
73
|
-
font-size: 0.8rem;
|
|
74
|
-
color: var(--component-text-color);
|
|
75
|
-
margin-bottom: 4px;
|
|
76
|
-
}
|
|
77
|
-
/* Retain the anchor-name styling for this component */
|
|
78
|
-
#settings-popover-button {
|
|
79
|
-
anchor-name: --settings_popover_btn;
|
|
80
|
-
}
|
|
81
|
-
[popover] {
|
|
82
|
-
margin: 0;
|
|
83
|
-
padding: 16px;
|
|
84
|
-
border: 0;
|
|
85
|
-
background: var(--card-background);
|
|
86
|
-
border: 1px solid var(--card-border-color);
|
|
87
|
-
border-radius: var(--card-border-radius);
|
|
88
|
-
box-shadow: var(--card-box-shadow);
|
|
89
|
-
z-index: 1000;
|
|
90
|
-
max-width: 260px;
|
|
91
|
-
position-anchor: --settings_popover_btn;
|
|
92
|
-
position-area: bottom;
|
|
93
|
-
position-visibility: always;
|
|
94
|
-
/* inset: unset; */
|
|
95
|
-
transform: translateX(45%);
|
|
96
|
-
overflow-x: hidden;
|
|
97
|
-
}
|
|
98
|
-
.dropdown-item {
|
|
99
|
-
padding: 8px;
|
|
100
|
-
cursor: pointer;
|
|
101
|
-
font-size: 0.9rem;
|
|
102
|
-
color: var(--component-text-color);
|
|
103
|
-
// allow only a single line of text and truncate the rest
|
|
104
|
-
width: 100%;
|
|
105
|
-
overflow: hidden;
|
|
106
|
-
text-overflow: ellipsis;
|
|
107
|
-
white-space: nowrap;
|
|
108
|
-
opacity: 0.8;
|
|
109
|
-
}
|
|
110
|
-
.dropdown-item:hover {
|
|
111
|
-
background: var(--action-plain-background-hover);
|
|
112
|
-
}
|
|
113
|
-
.dropdown-item.selected {
|
|
114
|
-
font-weight: bold;
|
|
115
|
-
opacity: 1;
|
|
116
|
-
}
|
|
117
|
-
`,
|
|
118
|
-
ButtonStyles,
|
|
119
|
-
SelectStyles,
|
|
120
|
-
];
|
|
121
|
-
__decorate([
|
|
122
|
-
property({ type: Array })
|
|
123
|
-
], MicSelector.prototype, "devices", void 0);
|
|
124
|
-
__decorate([
|
|
125
|
-
property({ type: String })
|
|
126
|
-
], MicSelector.prototype, "selectedDevice", void 0);
|
|
127
|
-
MicSelector = __decorate([
|
|
128
|
-
customElement('mic-selector')
|
|
129
|
-
], MicSelector);
|
|
130
|
-
export { MicSelector };
|
|
131
|
-
//# sourceMappingURL=settings.js.map
|
package/dist/src/settings.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/settings.ts"],"names":[],"mappings":";AAAA,kBAAkB;AAClB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkC,MAAM,KAAK,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAQpC,IAAM,WAAW,GAAjB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C,CACF;;;KAGN,CAAC;IACJ,CAAC;;AApHM,kBAAM,GAAmB;IAC9B,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkDF;IACD,YAAY;IACZ,YAAY;CACb,AAtDY,CAsDX;AA3DF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;4CACH;AAGvB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDACC;AALjB,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CA4HvB","sourcesContent":["// mic-selector.ts\nimport { LitElement, html, css, TemplateResult, CSSResultGroup } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport ButtonStyles from './styles/buttons';\nimport SelectStyles from './styles/select';\n\ninterface Device {\n deviceId: string;\n label?: string;\n}\n\n@customElement('mic-selector')\nexport class MicSelector extends LitElement {\n @property({ type: Array })\n devices: Device[] = [];\n\n @property({ type: String })\n selectedDevice: string = '';\n\n static styles: CSSResultGroup = [\n css`\n :host {\n display: block;\n font-family: var(--component-font-family);\n }\n .label {\n font-size: 0.8rem;\n color: var(--component-text-color);\n margin-bottom: 4px;\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 position-anchor: --settings_popover_btn;\n position-area: bottom;\n position-visibility: always;\n /* inset: unset; */\n transform: translateX(45%);\n overflow-x: hidden;\n }\n .dropdown-item {\n padding: 8px;\n cursor: pointer;\n font-size: 0.9rem;\n color: var(--component-text-color);\n // allow only a single line of text and truncate the rest\n width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n opacity: 0.8;\n }\n .dropdown-item:hover {\n background: var(--action-plain-background-hover);\n }\n .dropdown-item.selected {\n font-weight: bold;\n opacity: 1;\n }\n `,\n ButtonStyles,\n SelectStyles,\n ];\n\n private _selectDevice(device: Device): void {\n this.selectedDevice = device.deviceId;\n this.dispatchEvent(\n new CustomEvent('recording-device-changed', {\n detail: device,\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 <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 const target = e.target as HTMLSelectElement;\n const selectedDevice = this.devices.find(\n device => device.deviceId === target.value,\n );\n if (selectedDevice) {\n this._selectDevice(selectedDevice);\n }\n }}\n >\n ${this.devices.map(\n device => html`\n <option\n value=${device.deviceId}\n ?selected=${this.selectedDevice === device.deviceId}\n >\n ${device.label || 'Unknown Device'}\n </option>\n `,\n )}\n </select>\n <!-- ${this.devices.map(\n device => html`\n <div\n class=\"dropdown-item ${this.selectedDevice === device.deviceId\n ? 'selected'\n : ''}\"\n @click=${() => this._selectDevice(device)}\n >\n ${device.label || 'Unknown Device'}\n </div>\n `,\n )} -->\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'mic-selector': MicSelector;\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgD1B,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 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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buttons.js","sourceRoot":"","sources":["../../../src/styles/buttons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDvB,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { css } from 'lit';\n\nconst ButtonStyles = css`\n /* Default (plain) button styling */\n button,\n .button {\n background: var(--action-plain-background);\n /* border: 1px solid var(--action-plain-border-color); */\n border: none;\n color: var(--component-text-color);\n cursor: pointer;\n padding: 8px;\n border-radius: var(--card-inner-border-radius);\n display: inline-flex;\n gap: 4px;\n align-items: center;\n justify-content: center;\n transition: background 0.3s ease;\n font-family: var(--component-font-family);\n }\n\n button:hover,\n .button:hover {\n background: var(--action-plain-background-hover);\n }\n\n button:focus-visible {\n outline: 2px solid var(--action-accent-background);\n outline-offset: 2px;\n }\n\n /* Accent variant */\n button.accent,\n .button.accent {\n background: var(--action-accent-background);\n color: var(--action-accent-text-color);\n border: none;\n }\n\n button.accent:hover,\n .button.accent:hover {\n background: var(--action-accent-background-hover);\n }\n\n /* Accent variant */\n button.red,\n .button.red {\n background: var(--action-red-background);\n color: var(--action-red-text-color);\n border: none;\n }\n\n button.red:hover,\n .button.red:hover {\n background: var(--action-red-background-hover);\n }\n`;\n\nexport default ButtonStyles;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"callout.js","sourceRoot":"","sources":["../../../src/styles/callout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,aAAa,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;CAsBxB,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { css } from 'lit';\n\nconst CalloutStyles = css`\n .callout {\n background: var(--callout-accent-background);\n border: 1px solid var(--callout-accent-border);\n color: var(--callout-accent-text);\n padding: 8px;\n border-radius: var(--card-inner-border-radius);\n display: flex;\n font-size: 0.9rem;\n gap: 8px;\n align-items: flex-start;\n &.red {\n background: var(--callout-red-background);\n border: 1px solid var(--callout-red-border);\n color: var(--callout-red-text);\n }\n &.orange {\n background: var(--callout-orange-background);\n border: 1px solid var(--callout-orange-border);\n color: var(--callout-orange-text);\n }\n }\n`;\n\nexport default CalloutStyles;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/styles/select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCvB,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { css } from 'lit';\n\nconst SelectStyles = css`\n label {\n display: block;\n font-size: 0.8rem;\n padding-bottom: 0.5rem;\n font-weight: 500;\n color: var(--component-text-color);\n pointer-events: none;\n }\n select {\n background: var(--card-background);\n color: var(--component-text-color);\n border: 1px solid var(--card-border-color);\n padding: var(--card-padding);\n border-radius: var(--card-inner-border-radius);\n outline: none;\n width: 100%;\n }\n\n select:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n select:hover {\n background: var(--action-plain-background-hover);\n }\n\n select:focus-visible {\n outline: 2px solid var(--action-accent-background);\n /* outline-offset: 2px; */\n }\n`;\n\nexport default SelectStyles;\n"]}
|