New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-text-to-speech

Package Overview
Dependencies
Maintainers
1
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-text-to-speech - npm Package Compare versions

Comparing version 0.13.0 to 0.13.1

12

dist/hooks.js

@@ -52,3 +52,3 @@ import React, { cloneElement, isValidElement, useEffect, useMemo, useRef, useState } from "react";

setSpeechStatus("stopped");
setSpeakingWord(undefined);
setSpeakingWord(null);
utterance.onstart = null;

@@ -60,3 +60,3 @@ utterance.onresume = null;

utterance.onboundary = null;
removeFromQueue(onQueueChange);
removeFromQueue(null, onQueueChange);
speakFromQueue();

@@ -86,4 +86,4 @@ onStop === null || onStop === void 0 ? void 0 : onStop(event);

if (!preserveUtteranceQueue)
clearQueue(onQueueChange);
addToQueue(onQueueChange, utterance);
clearQueue();
addToQueue(utterance, onQueueChange);
if (synth.speaking) {

@@ -112,3 +112,3 @@ if (preserveUtteranceQueue && speechStatus !== "started")

return cancel();
removeFromQueue(onQueueChange, utteranceRef.current);
removeFromQueue(utteranceRef.current, onQueueChange);
setSpeechStatus("stopped");

@@ -118,3 +118,3 @@ }

var _a;
if (!isParent(speakingWord === null || speakingWord === void 0 ? void 0 : speakingWord.index, parentIndex))
if (!isParent(parentIndex, speakingWord === null || speakingWord === void 0 ? void 0 : speakingWord.index))
return element;

@@ -121,0 +121,0 @@ if (Array.isArray(element))

export type SpeechUtterancesQueue = SpeechSynthesisUtterance[];
export type QueueChangeEventHandler = (queue: SpeechUtterancesQueue) => any;
export declare function addToQueue(callback: QueueChangeEventHandler | undefined, utterance: SpeechSynthesisUtterance): void;
export declare function removeFromQueue(callback?: QueueChangeEventHandler, utterance?: SpeechSynthesisUtterance): void;
export declare function clearQueue(callback?: QueueChangeEventHandler): void;
export declare function addToQueue(utterance: SpeechSynthesisUtterance, callback?: QueueChangeEventHandler): void;
export declare function removeFromQueue(utterance?: SpeechSynthesisUtterance | null, callback?: QueueChangeEventHandler): void;
export declare function clearQueue(): void;
export declare function speakFromQueue(): void;
let queue = [];
export function addToQueue(callback, utterance) {
export function addToQueue(utterance, callback) {
queue.push(utterance);
callback === null || callback === void 0 ? void 0 : callback(queue);
}
export function removeFromQueue(callback, utterance) {
export function removeFromQueue(utterance, callback) {
if (!utterance)

@@ -13,5 +13,4 @@ queue.shift();

}
export function clearQueue(callback) {
export function clearQueue() {
queue = [];
callback === null || callback === void 0 ? void 0 : callback(queue);
}

@@ -18,0 +17,0 @@ export function speakFromQueue() {

@@ -9,2 +9,2 @@ import { ReactNode } from "react";

export declare function findCharIndex(characters: StringArray, index: number): string;
export declare function isParent(index: string | undefined, parentIndex: string): boolean;
export declare function isParent(parentIndex: string, index?: string): boolean;

@@ -43,3 +43,3 @@ import { isValidElement } from "react";

}
export function isParent(index, parentIndex) {
export function isParent(parentIndex, index) {
if (!(index === null || index === void 0 ? void 0 : index.startsWith(parentIndex)))

@@ -46,0 +46,0 @@ return false;

{
"name": "react-text-to-speech",
"version": "0.13.0",
"version": "0.13.1",
"description": "An easy to use react component for the Web Speech API.",

@@ -5,0 +5,0 @@ "type": "module",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc