@burdenoff/website-sdk 2026.828.6 → 2026.828.7
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/components/explore.js +6 -6
- package/dist/components/explore.js.map +1 -1
- package/dist/components/explore.mjs +6 -6
- package/dist/components/explore.mjs.map +1 -1
- package/dist/hooks/index.js +6 -6
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +6 -6
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1500,20 +1500,18 @@ function getRecognitionCtor() {
|
|
|
1500
1500
|
var MIC_DENIED_MESSAGE = "Microphone access was blocked. Allow it in your browser's site settings to dictate.";
|
|
1501
1501
|
async function ensureMicrophoneAccess() {
|
|
1502
1502
|
const media = typeof navigator === "undefined" ? void 0 : navigator.mediaDevices;
|
|
1503
|
-
if (!media?.getUserMedia) return { ok: true };
|
|
1503
|
+
if (!media?.getUserMedia) return { ok: true, confirmed: false };
|
|
1504
1504
|
try {
|
|
1505
1505
|
const status = await navigator.permissions?.query({
|
|
1506
1506
|
name: "microphone"
|
|
1507
1507
|
});
|
|
1508
|
-
if (status?.state === "granted") return { ok: true };
|
|
1509
|
-
if (status?.state === "denied")
|
|
1510
|
-
return { ok: false, message: MIC_DENIED_MESSAGE };
|
|
1508
|
+
if (status?.state === "granted") return { ok: true, confirmed: true };
|
|
1511
1509
|
} catch {
|
|
1512
1510
|
}
|
|
1513
1511
|
try {
|
|
1514
1512
|
const stream = await media.getUserMedia({ audio: true });
|
|
1515
1513
|
for (const track of stream.getTracks()) track.stop();
|
|
1516
|
-
return { ok: true };
|
|
1514
|
+
return { ok: true, confirmed: true };
|
|
1517
1515
|
} catch (error) {
|
|
1518
1516
|
const name = typeof error === "object" && error !== null && "name" in error ? String(error.name) : "";
|
|
1519
1517
|
if (name === "NotAllowedError" || name === "SecurityError") {
|
|
@@ -1556,6 +1554,7 @@ function useSpeechInput({
|
|
|
1556
1554
|
const [error, setError] = useState(null);
|
|
1557
1555
|
const recognitionRef = useRef(null);
|
|
1558
1556
|
const startTokenRef = useRef(0);
|
|
1557
|
+
const micConfirmedRef = useRef(false);
|
|
1559
1558
|
const beginRecognitionRef = useRef(null);
|
|
1560
1559
|
const beginRecognition = useCallback(
|
|
1561
1560
|
(Ctor, token) => {
|
|
@@ -1590,6 +1589,7 @@ function useSpeechInput({
|
|
|
1590
1589
|
const token = startTokenRef.current;
|
|
1591
1590
|
void ensureMicrophoneAccess().then((access) => {
|
|
1592
1591
|
if (token !== startTokenRef.current) return;
|
|
1592
|
+
micConfirmedRef.current = access.ok && access.confirmed;
|
|
1593
1593
|
if (!access.ok) {
|
|
1594
1594
|
setListening(false);
|
|
1595
1595
|
setError(access.message);
|
|
@@ -1625,7 +1625,7 @@ function useSpeechInput({
|
|
|
1625
1625
|
if (settled.trim() !== "") finalRef.current(settled);
|
|
1626
1626
|
};
|
|
1627
1627
|
recognition.onerror = (event) => {
|
|
1628
|
-
const message = describeError(event.error);
|
|
1628
|
+
const message = micConfirmedRef.current && (event.error === "not-allowed" || event.error === "service-not-allowed") ? "Dictation isn't available in this browser. You can type instead." : describeError(event.error);
|
|
1629
1629
|
setListening(false);
|
|
1630
1630
|
setInterim("");
|
|
1631
1631
|
if (message !== "") {
|