From 84ab5ceec2ccb3e3e4fb70d137d21a74ea8d1412 Mon Sep 17 00:00:00 2001 From: Simon Farshid Date: Sun, 29 Sep 2024 15:10:37 -0700 Subject: [PATCH] refactor: add deprecation warnings for MessageUtils (#931) --- .changeset/tender-badgers-call.md | 2 +- packages/react/src/context/stores/MessageUtils.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.changeset/tender-badgers-call.md b/.changeset/tender-badgers-call.md index 54803285a..beba7fdb1 100644 --- a/.changeset/tender-badgers-call.md +++ b/.changeset/tender-badgers-call.md @@ -1,5 +1,5 @@ --- -"assistant-ui": patch +"@assistant-ui/react": patch --- feat: mark new runtime API methods as stable diff --git a/packages/react/src/context/stores/MessageUtils.ts b/packages/react/src/context/stores/MessageUtils.ts index 8dcfd0383..c2e92af4b 100644 --- a/packages/react/src/context/stores/MessageUtils.ts +++ b/packages/react/src/context/stores/MessageUtils.ts @@ -4,14 +4,20 @@ import { SpeechSynthesisAdapter } from "../../runtimes/speech/SpeechAdapterTypes export type MessageUtilsState = Readonly<{ isCopied: boolean; setIsCopied: (value: boolean) => void; + isHovering: boolean; setIsHovering: (value: boolean) => void; + /** @deprecated This will be moved to `useMessage().isSpeaking` instead. This will be removed in 0.6.0. */ isSpeaking: boolean; + /** @deprecated This will be moved to `useMessageRuntime().stopSpeaking()` instead. This will be removed in 0.6.0. */ stopSpeaking: () => void; + /** @deprecated This will be moved to `useMessageRuntime().speak()` instead. This will be removed in 0.6.0. */ addUtterance: (utterance: SpeechSynthesisAdapter.Utterance) => void; + /** @deprecated This will be moved to `useMessage().submittedFeedback`. This will be removed in 0.6.0. */ submittedFeedback: "positive" | "negative" | null; + /** @deprecated This will be moved to `useMessageRuntime().submitFeedback()` instead. This will be removed in 0.6.0. */ setSubmittedFeedback: (feedback: "positive" | "negative" | null) => void; }>;