@speechos/client 0.2.7 → 0.2.8

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/index.cjs CHANGED
@@ -7140,6 +7140,8 @@ let SpeechOSWidget = class SpeechOSWidget extends i$1 {
7140
7140
  const originalContent = this.getElementContent(target) || "";
7141
7141
  if (tagName === "input" || tagName === "textarea") {
7142
7142
  const inputEl = target;
7143
+ // Ensure DOM focus is on the input before inserting
7144
+ inputEl.focus();
7143
7145
  // Restore cursor position before inserting
7144
7146
  const start = this.dictationCursorStart ?? inputEl.value.length;
7145
7147
  const end = this.dictationCursorEnd ?? inputEl.value.length;
@@ -7476,8 +7478,6 @@ let SpeechOSWidget = class SpeechOSWidget extends i$1 {
7476
7478
  // Note: command:complete event is already emitted by the backend
7477
7479
  // when the command_result message is received, so we don't emit here
7478
7480
  core.state.completeRecording();
7479
- // Keep widget visible but collapsed (just mic button, no action bubbles)
7480
- core.state.setState({ isExpanded: false });
7481
7481
  // Show command feedback
7482
7482
  this.showActionFeedback(result ? "command-success" : "command-none");
7483
7483
  backend.disconnect().catch(() => { });
@@ -7635,6 +7635,8 @@ let SpeechOSWidget = class SpeechOSWidget extends i$1 {
7635
7635
  if (tagName === "input" || tagName === "textarea") {
7636
7636
  const inputEl = target;
7637
7637
  originalContent = inputEl.value;
7638
+ // Ensure DOM focus is on the input before editing
7639
+ inputEl.focus();
7638
7640
  // Restore the original selection/cursor position
7639
7641
  const selectionStart = this.editSelectionStart ?? 0;
7640
7642
  const selectionEnd = this.editSelectionEnd ?? inputEl.value.length;