diff --git a/.circleci/continue-config.yml b/.circleci/continue-config.yml
index dcc9db1c55..423267c19a 100644
--- a/.circleci/continue-config.yml
+++ b/.circleci/continue-config.yml
@@ -106,11 +106,6 @@ jobs:
from: packages/react-chat/dist
to: s3://cdn.voiceflow.com/widget
clean_destination: false
- - vfcommon/clone_s3_assets:
- step_name: Uploading New React Chat to CDN
- from: packages/chat/dist
- to: s3://cdn.voiceflow.com/widget-next
- clean_destination: false
workflows:
test-and-release:
diff --git a/apps/documentation/.gitignore b/apps/documentation/.gitignore
deleted file mode 100644
index 4d5b8ed843..0000000000
--- a/apps/documentation/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-# next.js
-/out/
-.next
-
-# vercel
-.vercel
-
-# typescript
-*.tsbuildinfo
-next-env.d.ts
-
-# Bundled chat package
-public/bundle
diff --git a/apps/documentation/CHANGELOG.md b/apps/documentation/CHANGELOG.md
deleted file mode 100644
index d56429c161..0000000000
--- a/apps/documentation/CHANGELOG.md
+++ /dev/null
@@ -1,665 +0,0 @@
-# Change Log
-
-All notable changes to this project will be documented in this file.
-See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-
-## [0.35.8](https://github.com/voiceflow/react-chat/compare/documentation@0.35.7...documentation@0.35.8) (2025-01-13)
-
-**Note:** Version bump only for package documentation
-
-## [0.35.7](https://github.com/voiceflow/react-chat/compare/documentation@0.35.6...documentation@0.35.7) (2025-01-10)
-
-### Bug Fixes
-
-* hide/show chat callbacks (DSN-2664) ([#514](https://github.com/voiceflow/react-chat/issues/514)) ([c183dad](https://github.com/voiceflow/react-chat/commit/c183dad69d9e91cf2aa15092da12d6f8269d66a9))
-
-## [0.35.6](https://github.com/voiceflow/react-chat/compare/documentation@0.35.5...documentation@0.35.6) (2025-01-10)
-
-**Note:** Version bump only for package documentation
-
-## [0.35.5](https://github.com/voiceflow/react-chat/compare/documentation@0.35.4...documentation@0.35.5) (2025-01-10)
-
-**Note:** Version bump only for package documentation
-
-## [0.35.4](https://github.com/voiceflow/react-chat/compare/documentation@0.35.3...documentation@0.35.4) (2025-01-10)
-
-**Note:** Version bump only for package documentation
-
-## [0.35.3](https://github.com/voiceflow/react-chat/compare/documentation@0.35.2...documentation@0.35.3) (2025-01-08)
-
-**Note:** Version bump only for package documentation
-
-## [0.35.2](https://github.com/voiceflow/react-chat/compare/documentation@0.35.1...documentation@0.35.2) (2025-01-08)
-
-**Note:** Version bump only for package documentation
-
-## [0.35.1](https://github.com/voiceflow/react-chat/compare/documentation@0.35.0...documentation@0.35.1) (2025-01-08)
-
-**Note:** Version bump only for package documentation
-
-# [0.35.0](https://github.com/voiceflow/react-chat/compare/documentation@0.34.5...documentation@0.35.0) (2025-01-07)
-
-### Features
-
-* use new test-env (COR-0000) ([#494](https://github.com/voiceflow/react-chat/issues/494)) ([f3676ec](https://github.com/voiceflow/react-chat/commit/f3676ec3856cff82bc90f0ad70aa3c5ceba4f100))
-
-## [0.34.5](https://github.com/voiceflow/react-chat/compare/documentation@0.34.4...documentation@0.34.5) (2025-01-07)
-
-**Note:** Version bump only for package documentation
-
-## [0.34.4](https://github.com/voiceflow/react-chat/compare/documentation@0.34.3...documentation@0.34.4) (2025-01-07)
-
-**Note:** Version bump only for package documentation
-
-## [0.34.3](https://github.com/voiceflow/react-chat/compare/documentation@0.34.2...documentation@0.34.3) (2025-01-07)
-
-**Note:** Version bump only for package documentation
-
-## [0.34.2](https://github.com/voiceflow/react-chat/compare/documentation@0.34.1...documentation@0.34.2) (2025-01-03)
-
-### Bug Fixes
-
-* carousel hitbox edges fix (COR-4364) ([#486](https://github.com/voiceflow/react-chat/issues/486)) ([eb119f0](https://github.com/voiceflow/react-chat/commit/eb119f0aaa94065196c130cb3da26299cc6fbdbd))
-
-## [0.34.1](https://github.com/voiceflow/react-chat/compare/documentation@0.34.0...documentation@0.34.1) (2025-01-03)
-
-**Note:** Version bump only for package documentation
-
-# [0.34.0](https://github.com/voiceflow/react-chat/compare/documentation@0.33.18...documentation@0.34.0) (2024-12-18)
-
-### Features
-
-* add animations to proactive messages (COR-4271) ([#471](https://github.com/voiceflow/react-chat/issues/471)) ([04c0363](https://github.com/voiceflow/react-chat/commit/04c0363ac04ec34147941beef3443643e7e3ba6b))
-
-## [0.33.18](https://github.com/voiceflow/react-chat/compare/documentation@0.33.17...documentation@0.33.18) (2024-12-18)
-
-**Note:** Version bump only for package documentation
-
-## [0.33.17](https://github.com/voiceflow/react-chat/compare/documentation@0.33.16...documentation@0.33.17) (2024-12-17)
-
-**Note:** Version bump only for package documentation
-
-## [0.33.16](https://github.com/voiceflow/react-chat/compare/documentation@0.33.15...documentation@0.33.16) (2024-12-16)
-
-**Note:** Version bump only for package documentation
-
-## [0.33.15](https://github.com/voiceflow/react-chat/compare/documentation@0.33.14...documentation@0.33.15) (2024-12-16)
-
-### Bug Fixes
-
-* Launcher with label only spacing (COR-4241) ([#464](https://github.com/voiceflow/react-chat/issues/464)) ([3e0ba57](https://github.com/voiceflow/react-chat/commit/3e0ba57c526086927936d3bde946b581df516d5f))
-
-## [0.33.14](https://github.com/voiceflow/react-chat/compare/documentation@0.33.13...documentation@0.33.14) (2024-12-13)
-
-**Note:** Version bump only for package documentation
-
-## [0.33.13](https://github.com/voiceflow/react-chat/compare/documentation@0.33.12...documentation@0.33.13) (2024-12-13)
-
-### Bug Fixes
-
-* fixing the docs app (COR-4237) ([#460](https://github.com/voiceflow/react-chat/issues/460)) ([378e328](https://github.com/voiceflow/react-chat/commit/378e328b2a98c478ca44b68985b5c8714b10f314))
-
-## [0.33.12](https://github.com/voiceflow/react-chat/compare/documentation@0.33.11...documentation@0.33.12) (2024-12-13)
-
-**Note:** Version bump only for package documentation
-
-## [0.33.11](https://github.com/voiceflow/react-chat/compare/documentation@0.33.10...documentation@0.33.11) (2024-12-12)
-
-**Note:** Version bump only for package documentation
-
-## [0.33.10](https://github.com/voiceflow/react-chat/compare/documentation@0.33.9...documentation@0.33.10) (2024-12-12)
-
-**Note:** Version bump only for package documentation
-
-## [0.33.9](https://github.com/voiceflow/react-chat/compare/documentation@0.33.8...documentation@0.33.9) (2024-12-12)
-
-**Note:** Version bump only for package documentation
-
-## [0.33.8](https://github.com/voiceflow/react-chat/compare/documentation@0.33.7...documentation@0.33.8) (2024-12-12)
-
-**Note:** Version bump only for package documentation
-
-## [0.33.7](https://github.com/voiceflow/react-chat/compare/documentation@0.33.6...documentation@0.33.7) (2024-12-12)
-
-**Note:** Version bump only for package documentation
-
-## [0.33.6](https://github.com/voiceflow/react-chat/compare/documentation@0.33.5...documentation@0.33.6) (2024-12-11)
-
-**Note:** Version bump only for package documentation
-
-## [0.33.5](https://github.com/voiceflow/react-chat/compare/documentation@0.33.4...documentation@0.33.5) (2024-12-11)
-
-**Note:** Version bump only for package documentation
-
-## [0.33.4](https://github.com/voiceflow/react-chat/compare/documentation@0.33.3...documentation@0.33.4) (2024-12-11)
-
-**Note:** Version bump only for package documentation
-
-## [0.33.3](https://github.com/voiceflow/react-chat/compare/documentation@0.33.2...documentation@0.33.3) (2024-12-09)
-
-**Note:** Version bump only for package documentation
-
-## [0.33.2](https://github.com/voiceflow/react-chat/compare/documentation@0.33.1...documentation@0.33.2) (2024-12-09)
-
-**Note:** Version bump only for package documentation
-
-## [0.33.1](https://github.com/voiceflow/react-chat/compare/documentation@0.33.0...documentation@0.33.1) (2024-12-09)
-
-**Note:** Version bump only for package documentation
-
-# [0.33.0](https://github.com/voiceflow/react-chat/compare/documentation@0.32.5...documentation@0.33.0) (2024-12-09)
-
-### Features
-
-* Improve Launcher w/ Label animations (DSN-2522) ([#424](https://github.com/voiceflow/react-chat/issues/424)) ([40e4512](https://github.com/voiceflow/react-chat/commit/40e451219eee93641a878ad2529fec9ef60d2b74))
-
-## [0.32.5](https://github.com/voiceflow/react-chat/compare/documentation@0.32.4...documentation@0.32.5) (2024-12-06)
-
-**Note:** Version bump only for package documentation
-
-## [0.32.4](https://github.com/voiceflow/react-chat/compare/documentation@0.32.3...documentation@0.32.4) (2024-12-06)
-
-**Note:** Version bump only for package documentation
-
-## [0.32.3](https://github.com/voiceflow/react-chat/compare/documentation@0.32.2...documentation@0.32.3) (2024-12-06)
-
-**Note:** Version bump only for package documentation
-
-## [0.32.2](https://github.com/voiceflow/react-chat/compare/documentation@0.32.1...documentation@0.32.2) (2024-12-06)
-
-**Note:** Version bump only for package documentation
-
-## [0.32.1](https://github.com/voiceflow/react-chat/compare/documentation@0.32.0...documentation@0.32.1) (2024-12-06)
-
-**Note:** Version bump only for package documentation
-
-# [0.32.0](https://github.com/voiceflow/react-chat/compare/documentation@0.31.7...documentation@0.32.0) (2024-12-06)
-
-### Features
-
-* use test-env general-runtime url (COR-0000) ([#412](https://github.com/voiceflow/react-chat/issues/412)) ([ebd6d49](https://github.com/voiceflow/react-chat/commit/ebd6d4971cd6c020201fa255f7427f7c477f4314))
-
-## [0.31.7](https://github.com/voiceflow/react-chat/compare/documentation@0.31.6...documentation@0.31.7) (2024-12-05)
-
-**Note:** Version bump only for package documentation
-
-## [0.31.6](https://github.com/voiceflow/react-chat/compare/documentation@0.31.5...documentation@0.31.6) (2024-12-05)
-
-**Note:** Version bump only for package documentation
-
-## [0.31.5](https://github.com/voiceflow/react-chat/compare/documentation@0.31.4...documentation@0.31.5) (2024-12-04)
-
-**Note:** Version bump only for package documentation
-
-## [0.31.4](https://github.com/voiceflow/react-chat/compare/documentation@0.31.3...documentation@0.31.4) (2024-12-04)
-
-**Note:** Version bump only for package documentation
-
-## [0.31.3](https://github.com/voiceflow/react-chat/compare/documentation@0.31.2...documentation@0.31.3) (2024-12-04)
-
-**Note:** Version bump only for package documentation
-
-## [0.31.2](https://github.com/voiceflow/react-chat/compare/documentation@0.31.1...documentation@0.31.2) (2024-12-03)
-
-**Note:** Version bump only for package documentation
-
-## [0.31.1](https://github.com/voiceflow/react-chat/compare/documentation@0.31.0...documentation@0.31.1) (2024-12-03)
-
-**Note:** Version bump only for package documentation
-
-# [0.31.0](https://github.com/voiceflow/react-chat/compare/documentation@0.30.24...documentation@0.31.0) (2024-12-03)
-
-### Features
-
-* use new WidgetSettings object for chat configuration ([#376](https://github.com/voiceflow/react-chat/issues/376)) ([43ebd19](https://github.com/voiceflow/react-chat/commit/43ebd19bf4e8d31fbddd8c39a05335d25056ad31))
-
-## [0.30.24](https://github.com/voiceflow/react-chat/compare/documentation@0.30.23...documentation@0.30.24) (2024-12-03)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.23](https://github.com/voiceflow/react-chat/compare/documentation@0.30.22...documentation@0.30.23) (2024-11-28)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.22](https://github.com/voiceflow/react-chat/compare/documentation@0.30.21...documentation@0.30.22) (2024-11-28)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.21](https://github.com/voiceflow/react-chat/compare/documentation@0.30.20...documentation@0.30.21) (2024-11-28)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.20](https://github.com/voiceflow/react-chat/compare/documentation@0.30.19...documentation@0.30.20) (2024-11-27)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.19](https://github.com/voiceflow/react-chat/compare/documentation@0.30.18...documentation@0.30.19) (2024-11-26)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.18](https://github.com/voiceflow/react-chat/compare/documentation@0.30.17...documentation@0.30.18) (2024-11-26)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.17](https://github.com/voiceflow/react-chat/compare/documentation@0.30.16...documentation@0.30.17) (2024-11-25)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.16](https://github.com/voiceflow/react-chat/compare/documentation@0.30.15...documentation@0.30.16) (2024-11-25)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.15](https://github.com/voiceflow/react-chat/compare/documentation@0.30.14...documentation@0.30.15) (2024-11-25)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.14](https://github.com/voiceflow/react-chat/compare/documentation@0.30.13...documentation@0.30.14) (2024-11-25)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.13](https://github.com/voiceflow/react-chat/compare/documentation@0.30.12...documentation@0.30.13) (2024-11-25)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.12](https://github.com/voiceflow/react-chat/compare/documentation@0.30.11...documentation@0.30.12) (2024-11-25)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.11](https://github.com/voiceflow/react-chat/compare/documentation@0.30.10...documentation@0.30.11) (2024-11-25)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.10](https://github.com/voiceflow/react-chat/compare/documentation@0.30.9...documentation@0.30.10) (2024-11-25)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.9](https://github.com/voiceflow/react-chat/compare/documentation@0.30.8...documentation@0.30.9) (2024-11-21)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.8](https://github.com/voiceflow/react-chat/compare/documentation@0.30.7...documentation@0.30.8) (2024-11-20)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.7](https://github.com/voiceflow/react-chat/compare/documentation@0.30.6...documentation@0.30.7) (2024-11-20)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.6](https://github.com/voiceflow/react-chat/compare/documentation@0.30.5...documentation@0.30.6) (2024-11-19)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.5](https://github.com/voiceflow/react-chat/compare/documentation@0.30.4...documentation@0.30.5) (2024-11-19)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.4](https://github.com/voiceflow/react-chat/compare/documentation@0.30.3...documentation@0.30.4) (2024-11-19)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.3](https://github.com/voiceflow/react-chat/compare/documentation@0.30.2...documentation@0.30.3) (2024-11-19)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.2](https://github.com/voiceflow/react-chat/compare/documentation@0.30.1...documentation@0.30.2) (2024-11-19)
-
-**Note:** Version bump only for package documentation
-
-## [0.30.1](https://github.com/voiceflow/react-chat/compare/documentation@0.30.0...documentation@0.30.1) (2024-11-18)
-
-**Note:** Version bump only for package documentation
-
-# [0.30.0](https://github.com/voiceflow/react-chat/compare/documentation@0.29.9...documentation@0.30.0) (2024-11-18)
-
-### Features
-
-* release next react-chat library (DSN-2545) ([#316](https://github.com/voiceflow/react-chat/issues/316)) ([65722df](https://github.com/voiceflow/react-chat/commit/65722dfb438bc918bfb4fbb33aa0fc7c730eac38))
-
-## [0.29.9](https://github.com/voiceflow/react-chat/compare/documentation@0.29.8...documentation@0.29.9) (2024-11-15)
-
-**Note:** Version bump only for package documentation
-
-## [0.29.8](https://github.com/voiceflow/react-chat/compare/documentation@0.29.7...documentation@0.29.8) (2024-11-15)
-
-### Bug Fixes
-
-* message container and feedback button fixes (COR-0000) ([#317](https://github.com/voiceflow/react-chat/issues/317)) ([bac51a5](https://github.com/voiceflow/react-chat/commit/bac51a550357092a5d2e40a1cda37b09d0fc2394))
-
-## [0.29.7](https://github.com/voiceflow/react-chat/compare/documentation@0.29.6...documentation@0.29.7) (2024-11-14)
-
-### Bug Fixes
-
-* Random fixes (DSN-000) ([#309](https://github.com/voiceflow/react-chat/issues/309)) ([e8cdd6e](https://github.com/voiceflow/react-chat/commit/e8cdd6eeaba2075f28d8bd2443b85b3c98d0963e))
-
-## [0.29.6](https://github.com/voiceflow/react-chat/compare/documentation@0.29.5...documentation@0.29.6) (2024-11-14)
-
-**Note:** Version bump only for package documentation
-
-## [0.29.5](https://github.com/voiceflow/react-chat/compare/documentation@0.29.4...documentation@0.29.5) (2024-11-14)
-
-**Note:** Version bump only for package documentation
-
-## [0.29.4](https://github.com/voiceflow/react-chat/compare/documentation@0.29.3...documentation@0.29.4) (2024-11-13)
-
-**Note:** Version bump only for package documentation
-
-## [0.29.3](https://github.com/voiceflow/react-chat/compare/documentation@0.29.2...documentation@0.29.3) (2024-11-13)
-
-**Note:** Version bump only for package documentation
-
-## [0.29.2](https://github.com/voiceflow/react-chat/compare/documentation@0.29.1...documentation@0.29.2) (2024-11-13)
-
-### Bug Fixes
-
-* docs dark mode (DSN-2542) ([#304](https://github.com/voiceflow/react-chat/issues/304)) ([1deeb5a](https://github.com/voiceflow/react-chat/commit/1deeb5aedaae2b38cc6f7c740148f8d845577d55))
-
-## [0.29.1](https://github.com/voiceflow/react-chat/compare/documentation@0.29.0...documentation@0.29.1) (2024-11-12)
-
-**Note:** Version bump only for package documentation
-
-# [0.29.0](https://github.com/voiceflow/react-chat/compare/documentation@0.28.2...documentation@0.29.0) (2024-11-12)
-
-### Features
-
-* cross browser stuff (COR-3860) ([#301](https://github.com/voiceflow/react-chat/issues/301)) ([10587c3](https://github.com/voiceflow/react-chat/commit/10587c31a6c5e97687f0b0d0282bdf7c369bd785))
-
-## [0.28.2](https://github.com/voiceflow/react-chat/compare/documentation@0.28.1...documentation@0.28.2) (2024-11-12)
-
-**Note:** Version bump only for package documentation
-
-## [0.28.1](https://github.com/voiceflow/react-chat/compare/documentation@0.28.0...documentation@0.28.1) (2024-11-12)
-
-**Note:** Version bump only for package documentation
-
-# [0.28.0](https://github.com/voiceflow/react-chat/compare/documentation@0.27.0...documentation@0.28.0) (2024-11-11)
-
-### Features
-
-* Feedback + Copy Button (DSN-2499) ([#290](https://github.com/voiceflow/react-chat/issues/290)) ([a0c4649](https://github.com/voiceflow/react-chat/commit/a0c4649eb0e8b53ef3321cb5f10b31ef593d31c3))
-
-# [0.27.0](https://github.com/voiceflow/react-chat/compare/documentation@0.26.0...documentation@0.27.0) (2024-11-11)
-
-### Features
-
-* adjust chat to work in embedded mode as well (COR-3851) ([#293](https://github.com/voiceflow/react-chat/issues/293)) ([cdcaaf9](https://github.com/voiceflow/react-chat/commit/cdcaaf97b98851068af74672f3d38ab98f0c72c2))
-
-# [0.26.0](https://github.com/voiceflow/react-chat/compare/documentation@0.25.1...documentation@0.26.0) (2024-11-11)
-
-### Features
-
-* import built chat instead of building ourselves (COR-0000) ([#291](https://github.com/voiceflow/react-chat/issues/291)) ([1fd9e37](https://github.com/voiceflow/react-chat/commit/1fd9e371a12fe02207660d3907b3a27dc5ca6b95))
-
-## [0.25.1](https://github.com/voiceflow/react-chat/compare/documentation@0.25.0...documentation@0.25.1) (2024-11-08)
-
-### Bug Fixes
-
-* button wrapping behaviour (DSN-2510) ([#280](https://github.com/voiceflow/react-chat/issues/280)) ([9a74dc7](https://github.com/voiceflow/react-chat/commit/9a74dc79eebf3bdd2521b5922807eda9202c8bc5))
-
-# [0.25.0](https://github.com/voiceflow/react-chat/compare/documentation@0.24.4...documentation@0.25.0) (2024-11-08)
-
-### Features
-
-* add TypingIndicator to the docs (COR-0000) ([#276](https://github.com/voiceflow/react-chat/issues/276)) ([205e910](https://github.com/voiceflow/react-chat/commit/205e910f3b5672a7598ffb2e0682e2178d059b16))
-* powered by Voiceflow is a link now (DSN-2505) ([#285](https://github.com/voiceflow/react-chat/issues/285)) ([7d4ea15](https://github.com/voiceflow/react-chat/commit/7d4ea15eefc9c5ce5c4c11c3aea8f3985df72ebc))
-* ui review for footer (COR-3751) ([#273](https://github.com/voiceflow/react-chat/issues/273)) ([235debb](https://github.com/voiceflow/react-chat/commit/235debb51219f196867b146adf1395603fa7128b))
-
-## [0.24.4](https://github.com/voiceflow/react-chat/compare/documentation@0.24.3...documentation@0.24.4) (2024-11-08)
-
-**Note:** Version bump only for package documentation
-
-## [0.24.3](https://github.com/voiceflow/react-chat/compare/documentation@0.24.2...documentation@0.24.3) (2024-11-07)
-
-**Note:** Version bump only for package documentation
-
-## [0.24.2](https://github.com/voiceflow/react-chat/compare/documentation@0.24.1...documentation@0.24.2) (2024-11-07)
-
-### Bug Fixes
-
-* header actions (COR-3811) ([#278](https://github.com/voiceflow/react-chat/issues/278)) ([95cc945](https://github.com/voiceflow/react-chat/commit/95cc945f1f79c81da3932bbb0c1f8f2ad094b008))
-
-## [0.24.1](https://github.com/voiceflow/react-chat/compare/documentation@0.24.0...documentation@0.24.1) (2024-11-06)
-
-### Bug Fixes
-
-* Agent Message and Chat Docs (DSN-000) ([#277](https://github.com/voiceflow/react-chat/issues/277)) ([4293ddf](https://github.com/voiceflow/react-chat/commit/4293ddfc0878beeeadbaf1fdb0283eafa487fe42))
-
-# [0.24.0](https://github.com/voiceflow/react-chat/compare/documentation@0.23.1...documentation@0.24.0) (2024-11-04)
-
-### Features
-
-* ui review for carousel component (COR-0000) ([#275](https://github.com/voiceflow/react-chat/issues/275)) ([b310606](https://github.com/voiceflow/react-chat/commit/b3106063f4ede9ff57f3fe2398ad4ae5b89edc7e))
-
-## [0.23.1](https://github.com/voiceflow/react-chat/compare/documentation@0.23.0...documentation@0.23.1) (2024-11-01)
-
-### Bug Fixes
-
-* ProjectID configurable Chat on Docs (DSN-000) ([#274](https://github.com/voiceflow/react-chat/issues/274)) ([d566fc4](https://github.com/voiceflow/react-chat/commit/d566fc449f9d8fca1bb08419c40f5729cea4378d))
-
-# [0.23.0](https://github.com/voiceflow/react-chat/compare/documentation@0.22.0...documentation@0.23.0) (2024-11-01)
-
-### Features
-
-* a few more examples to look at (COR-0000) ([#270](https://github.com/voiceflow/react-chat/issues/270)) ([ee4c6d9](https://github.com/voiceflow/react-chat/commit/ee4c6d9d361fddb7dd0c0b74906c5ea5eda747b1))
-
-# [0.22.0](https://github.com/voiceflow/react-chat/compare/documentation@0.21.2...documentation@0.22.0) (2024-10-31)
-
-### Features
-
-* Misc 💅 polish + fixes (DSN-000) ([#269](https://github.com/voiceflow/react-chat/issues/269)) ([0622974](https://github.com/voiceflow/react-chat/commit/0622974b43294fc477fd2899e5b2a861a406bc5b))
-
-## [0.21.2](https://github.com/voiceflow/react-chat/compare/documentation@0.21.1...documentation@0.21.2) (2024-10-31)
-
-**Note:** Version bump only for package documentation
-
-## [0.21.1](https://github.com/voiceflow/react-chat/compare/documentation@0.21.0...documentation@0.21.1) (2024-10-31)
-
-### Bug Fixes
-
-* sorting out the docs pages (COR-0000) ([#267](https://github.com/voiceflow/react-chat/issues/267)) ([1c6d4b9](https://github.com/voiceflow/react-chat/commit/1c6d4b9b76094817d17a22663e9ca04ae4ba9af3))
-
-# [0.21.0](https://github.com/voiceflow/react-chat/compare/documentation@0.20.5...documentation@0.21.0) (2024-10-31)
-
-### Features
-
-* Chat for review on documentation (DSN-000) ([#265](https://github.com/voiceflow/react-chat/issues/265)) ([bbc3d4f](https://github.com/voiceflow/react-chat/commit/bbc3d4f225f0d9edc18f4214f01d49f52be713ab))
-
-## [0.20.5](https://github.com/voiceflow/react-chat/compare/documentation@0.20.4...documentation@0.20.5) (2024-10-31)
-
-**Note:** Version bump only for package documentation
-
-## [0.20.4](https://github.com/voiceflow/react-chat/compare/documentation@0.20.3...documentation@0.20.4) (2024-10-31)
-
-**Note:** Version bump only for package documentation
-
-## [0.20.3](https://github.com/voiceflow/react-chat/compare/documentation@0.20.2...documentation@0.20.3) (2024-10-30)
-
-**Note:** Version bump only for package documentation
-
-## [0.20.2](https://github.com/voiceflow/react-chat/compare/documentation@0.20.1...documentation@0.20.2) (2024-10-30)
-
-**Note:** Version bump only for package documentation
-
-## [0.20.1](https://github.com/voiceflow/react-chat/compare/documentation@0.20.0...documentation@0.20.1) (2024-10-29)
-
-**Note:** Version bump only for package documentation
-
-# [0.20.0](https://github.com/voiceflow/react-chat/compare/documentation@0.19.6...documentation@0.20.0) (2024-10-28)
-
-### Features
-
-* add Prompt to docs (COR-0000) ([#247](https://github.com/voiceflow/react-chat/issues/247)) ([9eaa655](https://github.com/voiceflow/react-chat/commit/9eaa6551d44f6328d7ba37a57a8ef3770c324a49))
-
-## [0.19.6](https://github.com/voiceflow/react-chat/compare/documentation@0.19.5...documentation@0.19.6) (2024-10-28)
-
-**Note:** Version bump only for package documentation
-
-## [0.19.5](https://github.com/voiceflow/react-chat/compare/documentation@0.19.4...documentation@0.19.5) (2024-10-28)
-
-**Note:** Version bump only for package documentation
-
-## [0.19.4](https://github.com/voiceflow/react-chat/compare/documentation@0.19.3...documentation@0.19.4) (2024-10-28)
-
-**Note:** Version bump only for package documentation
-
-## [0.19.3](https://github.com/voiceflow/react-chat/compare/documentation@0.19.2...documentation@0.19.3) (2024-10-28)
-
-**Note:** Version bump only for package documentation
-
-## [0.19.2](https://github.com/voiceflow/react-chat/compare/documentation@0.19.1...documentation@0.19.2) (2024-10-25)
-
-**Note:** Version bump only for package documentation
-
-## [0.19.1](https://github.com/voiceflow/react-chat/compare/documentation@0.19.0...documentation@0.19.1) (2024-10-25)
-
-**Note:** Version bump only for package documentation
-
-# [0.19.0](https://github.com/voiceflow/react-chat/compare/documentation@0.18.0...documentation@0.19.0) (2024-10-24)
-
-### Features
-
-* add CarouselButton component (COR-3656) ([#228](https://github.com/voiceflow/react-chat/issues/228)) ([7d3a65e](https://github.com/voiceflow/react-chat/commit/7d3a65ea41a0ca5318ea6eccec5b3afe3abd8785))
-
-# [0.18.0](https://github.com/voiceflow/react-chat/compare/documentation@0.17.0...documentation@0.18.0) (2024-10-24)
-
-### Features
-
-* Widget Composition (DSN-000) ([#231](https://github.com/voiceflow/react-chat/issues/231)) ([2966da3](https://github.com/voiceflow/react-chat/commit/2966da31b6105e221729bc84f11e10a39ddc648c))
-
-# [0.17.0](https://github.com/voiceflow/react-chat/compare/documentation@0.16.0...documentation@0.17.0) (2024-10-22)
-
-### Features
-
-* add LinkPreview component (COR-3594) ([#222](https://github.com/voiceflow/react-chat/issues/222)) ([660b02f](https://github.com/voiceflow/react-chat/commit/660b02fea855e9c8a2e1c09c586c3bf8db8a8cc7))
-* add Primary/Secondary buttons to the docs for review (COR-3533) ([#226](https://github.com/voiceflow/react-chat/issues/226)) ([8df4f46](https://github.com/voiceflow/react-chat/commit/8df4f466a3bf418f2b96cddf9e64ebac5e1e4755))
-
-# [0.16.0](https://github.com/voiceflow/react-chat/compare/documentation@0.15.0...documentation@0.16.0) (2024-10-17)
-
-### Features
-
-* touch ups for the launcher button (COR-0000) ([#221](https://github.com/voiceflow/react-chat/issues/221)) ([4175b8f](https://github.com/voiceflow/react-chat/commit/4175b8fd0fc20d86740c34635851ff6271a79fde))
-
-# [0.15.0](https://github.com/voiceflow/react-chat/compare/documentation@0.14.0...documentation@0.15.0) (2024-10-17)
-
-### Features
-
-* add Card component (COR-2149) ([#223](https://github.com/voiceflow/react-chat/issues/223)) ([1a4e1b8](https://github.com/voiceflow/react-chat/commit/1a4e1b8bcabe539cc5d71bbaabbb8e92e6e25f14))
-
-# [0.14.0](https://github.com/voiceflow/react-chat/compare/documentation@0.13.0...documentation@0.14.0) (2024-10-16)
-
-### Features
-
-* cleaning up (COR-0000) ([#218](https://github.com/voiceflow/react-chat/issues/218)) ([0fc8593](https://github.com/voiceflow/react-chat/commit/0fc8593d299dcffe6f0995b2d022f63b98ca403c))
-
-# [0.13.0](https://github.com/voiceflow/react-chat/compare/documentation@0.12.0...documentation@0.13.0) (2024-10-15)
-
-### Features
-
-* UserMessage (DX-2138) ([#213](https://github.com/voiceflow/react-chat/issues/213)) ([97fcc7b](https://github.com/voiceflow/react-chat/commit/97fcc7b1d806cbb430daf29157d5610396935841))
-
-# [0.12.0](https://github.com/voiceflow/react-chat/compare/documentation@0.11.0...documentation@0.12.0) (2024-10-15)
-
-### Features
-
-* WelcomeMessage (DX-2153) ([#214](https://github.com/voiceflow/react-chat/issues/214)) ([12d5b9d](https://github.com/voiceflow/react-chat/commit/12d5b9dfd8046bfe0d7f987674af39995a762ae0))
-
-# [0.11.0](https://github.com/voiceflow/react-chat/compare/documentation@0.10.1...documentation@0.11.0) (2024-10-11)
-
-### Features
-
-* add Header component (COR-3545) ([#215](https://github.com/voiceflow/react-chat/issues/215)) ([0a893b6](https://github.com/voiceflow/react-chat/commit/0a893b65f7634d7ffca622c77bcc62af4514490c))
-
-## [0.10.1](https://github.com/voiceflow/react-chat/compare/documentation@0.10.0...documentation@0.10.1) (2024-10-11)
-
-**Note:** Version bump only for package documentation
-
-# [0.10.0](https://github.com/voiceflow/react-chat/compare/documentation@0.9.1...documentation@0.10.0) (2024-10-11)
-
-### Features
-
-* Agent Message (DX-2415) ([#212](https://github.com/voiceflow/react-chat/issues/212)) ([9c599f6](https://github.com/voiceflow/react-chat/commit/9c599f618ade9aea29e866a5a0c9ee602ef78a8f))
-
-## [0.9.1](https://github.com/voiceflow/react-chat/compare/documentation@0.9.0...documentation@0.9.1) (2024-10-11)
-
-### Bug Fixes
-
-* force light theme and show selector (COR-0000) ([#217](https://github.com/voiceflow/react-chat/issues/217)) ([90ca7d4](https://github.com/voiceflow/react-chat/commit/90ca7d4b4f85ef96557ca8b99f07eae90486c0d0))
-
-# [0.9.0](https://github.com/voiceflow/react-chat/compare/documentation@0.8.1...documentation@0.9.0) (2024-10-07)
-
-### Features
-
-* add Launcher button to the mix (COR-3541) ([#211](https://github.com/voiceflow/react-chat/issues/211)) ([4c23a31](https://github.com/voiceflow/react-chat/commit/4c23a3168deb21e8e08dd26713aaca882f7a1184))
-
-## [0.8.1](https://github.com/voiceflow/react-chat/compare/documentation@0.8.0...documentation@0.8.1) (2024-10-07)
-
-**Note:** Version bump only for package documentation
-
-# [0.8.0](https://github.com/voiceflow/react-chat/compare/documentation@0.7.1...documentation@0.8.0) (2024-10-04)
-
-### Features
-
-* add SendButton to docs (COR-0000) ([#207](https://github.com/voiceflow/react-chat/issues/207)) ([c952373](https://github.com/voiceflow/react-chat/commit/c952373e37458e0a17867b5f743cbaa434bac67a))
-
-## [0.7.1](https://github.com/voiceflow/react-chat/compare/documentation@0.7.0...documentation@0.7.1) (2024-10-04)
-
-**Note:** Version bump only for package documentation
-
-# [0.7.0](https://github.com/voiceflow/react-chat/compare/documentation@0.6.1...documentation@0.7.0) (2024-10-04)
-
-### Features
-
-* add InlineButton to docs (COR-0000) ([#206](https://github.com/voiceflow/react-chat/issues/206)) ([a3f0596](https://github.com/voiceflow/react-chat/commit/a3f0596abb474252158ef13f6dfad80bc67b2fae))
-
-### Reverts
-
-* Revert "chore(release): publish --skip-ci" ([9c2e101](https://github.com/voiceflow/react-chat/commit/9c2e101ed74959ea1db75f29fa0276e3ebbd35e8))
-
-# [0.6.0](https://github.com/voiceflow/react-chat/compare/documentation@0.5.0...documentation@0.6.0) (2024-10-03)
-
-### Features
-
-* FeedbackButton (DX-2405) ([#200](https://github.com/voiceflow/react-chat/issues/200)) ([46752af](https://github.com/voiceflow/react-chat/commit/46752afca27a0b2b8388b3241cc9d2c130c84688))
-
-# [0.5.0](https://github.com/voiceflow/react-chat/compare/documentation@0.4.0...documentation@0.5.0) (2024-10-02)
-
-### Features
-
-* add Avatar component to docs (COR-3369) ([#199](https://github.com/voiceflow/react-chat/issues/199)) ([6dd7c26](https://github.com/voiceflow/react-chat/commit/6dd7c262e3c8014405b2e380bb6c465487c36b20))
-
-# [0.4.0](https://github.com/voiceflow/react-chat/compare/documentation@0.3.5...documentation@0.4.0) (2024-10-01)
-
-### Features
-
-* add nextra theme to docs app (COR-0000) ([#198](https://github.com/voiceflow/react-chat/issues/198)) ([4216a67](https://github.com/voiceflow/react-chat/commit/4216a678a3602aa8e0a83e141077ad0e62984338))
-
-## [0.3.5](https://github.com/voiceflow/react-chat/compare/documentation@0.3.4...documentation@0.3.5) (2024-10-01)
-
-**Note:** Version bump only for package documentation
-
-## [0.3.4](https://github.com/voiceflow/react-chat/compare/documentation@0.3.3...documentation@0.3.4) (2024-10-01)
-
-**Note:** Version bump only for package documentation
-
-## [0.3.3](https://github.com/voiceflow/react-chat/compare/documentation@0.3.2...documentation@0.3.3) (2024-10-01)
-
-**Note:** Version bump only for package documentation
-
-## [0.3.2](https://github.com/voiceflow/react-chat/compare/documentation@0.3.1...documentation@0.3.2) (2024-10-01)
-
-**Note:** Version bump only for package documentation
-
-## [0.3.1](https://github.com/voiceflow/react-chat/compare/documentation@0.3.0...documentation@0.3.1) (2024-10-01)
-
-**Note:** Version bump only for package documentation
-
-# [0.3.0](https://github.com/voiceflow/react-chat/compare/documentation@0.2.0...documentation@0.3.0) (2024-10-01)
-
-### Features
-
-* UI export to docs (DX-000) ([#193](https://github.com/voiceflow/react-chat/issues/193)) ([83d3ef9](https://github.com/voiceflow/react-chat/commit/83d3ef93390ff8d98681c9dec129133f21a8e6bd))
-
-# 0.2.0 (2024-09-30)
-
-### Features
-
-* Docs (DX-000) ([#192](https://github.com/voiceflow/react-chat/issues/192)) ([7fd2e96](https://github.com/voiceflow/react-chat/commit/7fd2e96de26ba42b7a243af8131a8f4ecfa02c60))
diff --git a/apps/documentation/README.md b/apps/documentation/README.md
deleted file mode 100644
index 06114c138d..0000000000
--- a/apps/documentation/README.md
+++ /dev/null
@@ -1,11 +0,0 @@
-This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
-
-## Getting Started
-
-First, run the development server:
-
-```bash
-yarn dev
-```
-
-To update the ChatKit in app, copy the /dist directory from the chatkit into the /public directory of the app.
diff --git a/apps/documentation/next.config.mjs b/apps/documentation/next.config.mjs
deleted file mode 100644
index c96be73863..0000000000
--- a/apps/documentation/next.config.mjs
+++ /dev/null
@@ -1,13 +0,0 @@
-import nextra from 'nextra';
-
-const nextConfig = {
- reactStrictMode: false,
- distDir: 'build',
-};
-
-const withNextra = nextra({
- theme: 'nextra-theme-docs',
- themeConfig: './src/theme.config.tsx',
-});
-
-export default withNextra(nextConfig);
diff --git a/apps/documentation/package.json b/apps/documentation/package.json
deleted file mode 100644
index d3f975158e..0000000000
--- a/apps/documentation/package.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "name": "documentation",
- "version": "0.35.8",
- "private": true,
- "scripts": {
- "build": "yarn g:turbo run build:cmd --filter=documentation...",
- "build:chat": "./src/scripts/import-chat.sh",
- "build:cmd": "next build",
- "dev": "next dev",
- "lint": "yarn g:run-p -c lint:eslint lint:prettier",
- "lint:eslint": "yarn g:eslint",
- "lint:fix": "yarn g:run-p -c \"lint:eslint --fix\" \"lint:prettier --write\"",
- "lint:prettier": "yarn g:prettier --check",
- "start": "next start"
- },
- "dependencies": {
- "@voiceflow/react-chat": "workspace:*",
- "next": "14.2.13",
- "react": "18.2.0",
- "react-dom": "18.2.0",
- "regenerator-runtime": "0.13.11"
- },
- "devDependencies": {
- "@types/node": "20.12.7",
- "@types/react": "18.2.8",
- "@types/react-dom": "18.2.4",
- "@vanilla-extract/next-plugin": "^2.4.6",
- "nextra": "^3.0.2",
- "nextra-theme-docs": "^3.0.2"
- }
-}
diff --git a/apps/documentation/public/favicon.ico b/apps/documentation/public/favicon.ico
deleted file mode 100644
index 718d6fea48..0000000000
Binary files a/apps/documentation/public/favicon.ico and /dev/null differ
diff --git a/apps/documentation/public/fonts/UCityProWeb-Bold.woff b/apps/documentation/public/fonts/UCityProWeb-Bold.woff
deleted file mode 100644
index 14bb018650..0000000000
Binary files a/apps/documentation/public/fonts/UCityProWeb-Bold.woff and /dev/null differ
diff --git a/apps/documentation/public/fonts/UCityProWeb-Bold.woff2 b/apps/documentation/public/fonts/UCityProWeb-Bold.woff2
deleted file mode 100644
index a6bc5d1247..0000000000
Binary files a/apps/documentation/public/fonts/UCityProWeb-Bold.woff2 and /dev/null differ
diff --git a/apps/documentation/public/fonts/UCityProWeb-Regular.woff b/apps/documentation/public/fonts/UCityProWeb-Regular.woff
deleted file mode 100644
index 88f2a66c5a..0000000000
Binary files a/apps/documentation/public/fonts/UCityProWeb-Regular.woff and /dev/null differ
diff --git a/apps/documentation/public/fonts/UCityProWeb-Regular.woff2 b/apps/documentation/public/fonts/UCityProWeb-Regular.woff2
deleted file mode 100644
index 43f69dd5b7..0000000000
Binary files a/apps/documentation/public/fonts/UCityProWeb-Regular.woff2 and /dev/null differ
diff --git a/apps/documentation/public/fonts/UCityProWeb-Semibold.woff b/apps/documentation/public/fonts/UCityProWeb-Semibold.woff
deleted file mode 100644
index 140ecb7ff0..0000000000
Binary files a/apps/documentation/public/fonts/UCityProWeb-Semibold.woff and /dev/null differ
diff --git a/apps/documentation/public/fonts/UCityProWeb-Semibold.woff2 b/apps/documentation/public/fonts/UCityProWeb-Semibold.woff2
deleted file mode 100644
index 5da6b5df93..0000000000
Binary files a/apps/documentation/public/fonts/UCityProWeb-Semibold.woff2 and /dev/null differ
diff --git a/apps/documentation/src/components/ChatScript/embedded.tsx b/apps/documentation/src/components/ChatScript/embedded.tsx
deleted file mode 100644
index c7a57fcbed..0000000000
--- a/apps/documentation/src/components/ChatScript/embedded.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import Head from 'next/head';
-
-export const ChatEmbedded = ({ projectID }: { projectID: string }) => {
- if (!projectID) {
- return null;
- }
-
- const script = `
- (function (d, t) {
- const v = d.createElement(t);
- const s = d.getElementsByTagName(t)[0];
- v.onload = function () {
- window.voiceflow.chat.load({
- verify: { projectID: "${projectID}" },
- assistant: {
- stylesheet: '../../bundle/style.css',
- }
- });
- };
- v.src = '../../bundle/bundle.mjs';
- v.type = 'text/javascript';
- s.parentNode.insertBefore(v, s);
- })(document, 'script');
- `;
-
- return (
-
-
-
- );
-};
diff --git a/apps/documentation/src/components/ChatScript/index.tsx b/apps/documentation/src/components/ChatScript/index.tsx
deleted file mode 100644
index 1475e21070..0000000000
--- a/apps/documentation/src/components/ChatScript/index.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import { useEffect } from 'react';
-
-export const ChatScript = ({ projectID, embedded = false }: { projectID: string; embedded?: boolean }) => {
- if (!projectID) {
- return null;
- }
-
- const loadScript = `
- (function (d, t) {
- const v = d.createElement(t);
- const s = d.getElementsByTagName(t)[0];
- v.onload = function () {
- window.voiceflow.chat.load({
- url: 'https://general-runtime-review-damp-haze.us-2.development.voiceflow.com',
- verify: { projectID: "${projectID}" },
- assistant: {
- stylesheet: '../../bundle/style.css',
- },
- versionID: 'production'
- ${embedded ? ', render: { mode: "embedded", target: document.getElementById("chat_embed") }' : ''}
- });
- };
- v.src = '../../bundle/bundle.mjs';
- v.type = 'text/javascript';
- s.parentNode.insertBefore(v, s);
- })(document, 'script');
- `;
-
- useEffect(() => {
- const script = document.createElement('script');
- script.text = loadScript;
- document.getElementsByTagName('head')[0].appendChild(script);
- }, []);
-
- return null;
-};
diff --git a/apps/documentation/src/components/ClientRenderer/index.tsx b/apps/documentation/src/components/ClientRenderer/index.tsx
deleted file mode 100644
index 8825acd484..0000000000
--- a/apps/documentation/src/components/ClientRenderer/index.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import { useEffect, useState } from 'react';
-
-interface IClientRenderer {
- children: React.ReactNode;
-}
-
-export const ClientRenderer: React.FC = ({ children }) => {
- const [isClient, setIsClient] = useState(false);
-
- useEffect(() => {
- setIsClient(true);
- }, []);
-
- if (!isClient) {
- return null;
- }
-
- return <>{children}>;
-};
diff --git a/apps/documentation/src/components/StoryEmbed.tsx b/apps/documentation/src/components/StoryEmbed.tsx
deleted file mode 100644
index 2819822f56..0000000000
--- a/apps/documentation/src/components/StoryEmbed.tsx
+++ /dev/null
@@ -1,64 +0,0 @@
-import type { StoryObj } from '@storybook/react';
-import type { DecoratorFunction } from '@storybook/types';
-import { useEffect, useMemo, useState } from 'react';
-
-const ComponentNotFound: React.FC = () => 🚨 Component not found! 🚨 ;
-
-export interface IStoryEmbed {
- for: string; // This should be `keyof type Stories` but we load this dynamically
- name: string;
- props?: Record;
- clientOnly?: boolean;
-}
-
-export const StoryEmbed: React.FC = ({ for: componentName, name, props, clientOnly = false }) => {
- const [shouldRender, setShouldRender] = useState(!clientOnly);
- const [stories, setStories] = useState();
-
- useEffect(() => {
- const initStories = async () => {
- setStories(await import('@voiceflow/react-chat/stories'));
- };
- initStories();
- }, []);
-
- useEffect(() => setShouldRender(true), []);
- if (!stories) return null;
-
- const module = stories[componentName] as any;
- const target = (module as any)?.[name] as StoryObj;
-
- const decorators = (target?.decorators || module?.default.decorators || []) as DecoratorFunction[];
-
- if (!shouldRender) return null;
-
- if (!module || !target) return ;
-
- const Component: React.ComponentType =
- target.render ?? module.default.render ?? module.default.component ?? ComponentNotFound;
-
- const args = {
- ...module.default.args,
- ...target.args,
- ...props,
- };
-
- if (!decorators.length) {
- return ;
- }
-
- const Decorated: React.FC = () => {
- const Story = useMemo(
- () =>
- decorators.reduce>[0]>(
- (acc, decorator) => (config: any) => decorator(acc, config),
- ({ args } = {}) =>
- ),
- [decorators]
- );
-
- return ;
- };
-
- return ;
-};
diff --git a/apps/documentation/src/fonts/GeistMonoVF.woff b/apps/documentation/src/fonts/GeistMonoVF.woff
deleted file mode 100644
index f2ae185cbf..0000000000
Binary files a/apps/documentation/src/fonts/GeistMonoVF.woff and /dev/null differ
diff --git a/apps/documentation/src/fonts/GeistVF.woff b/apps/documentation/src/fonts/GeistVF.woff
deleted file mode 100644
index 1b62daacff..0000000000
Binary files a/apps/documentation/src/fonts/GeistVF.woff and /dev/null differ
diff --git a/apps/documentation/src/pages/ProactiveMessage.tsx b/apps/documentation/src/pages/ProactiveMessage.tsx
deleted file mode 100644
index 8fc00a6d7d..0000000000
--- a/apps/documentation/src/pages/ProactiveMessage.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import { useState } from 'react';
-
-const inputStyle = {
- border: 'solid 1px black',
- borderRadius: '4px',
- padding: '2px',
-};
-
-export const sendButtonStyle = {
- background: '#e8e8e8',
- borderRadius: '4px',
- padding: '4px 8px',
- marginLeft: '4px',
-};
-
-export default function ProactiveMessage() {
- const [message, setMessage] = useState('');
-
- const send = () => {
- (window as any).voiceflow.chat.proactive.push({ type: 'text', payload: { message } });
- setMessage('');
- };
-
- return (
-
- Add proactive message:
- setMessage(e.target.value)} />
-
- Send
-
-
- );
-}
diff --git a/apps/documentation/src/pages/_app.tsx b/apps/documentation/src/pages/_app.tsx
deleted file mode 100644
index ed966a69d1..0000000000
--- a/apps/documentation/src/pages/_app.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import 'regenerator-runtime/runtime';
-import '@/styles/globals.css';
-import '@voiceflow/react-chat/dist/style.css';
-
-import type { AppProps } from 'next/app';
-
-export default function App({ Component, pageProps }: AppProps) {
- return (
-
-
-
- );
-}
diff --git a/apps/documentation/src/pages/_document.tsx b/apps/documentation/src/pages/_document.tsx
deleted file mode 100644
index 660b1ba485..0000000000
--- a/apps/documentation/src/pages/_document.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import 'regenerator-runtime/runtime';
-
-import { Head, Html, Main, NextScript } from 'next/document';
-
-export default function Document() {
- return (
-
-
-
-
-
-
-
- );
-}
diff --git a/apps/documentation/src/pages/_meta.js b/apps/documentation/src/pages/_meta.js
deleted file mode 100644
index 0aa0088c6c..0000000000
--- a/apps/documentation/src/pages/_meta.js
+++ /dev/null
@@ -1,11 +0,0 @@
-export default {
- index: {
- title: 'Home',
- },
- chat: {
- title: 'Chat',
- type: 'page',
- // eslint-disable-next-line no-secrets/no-secrets
- href: '/chat?projectID=672a5d31e7c18363c7363e3f',
- },
-};
diff --git a/apps/documentation/src/pages/api/hello.ts b/apps/documentation/src/pages/api/hello.ts
deleted file mode 100644
index 46af6a68d5..0000000000
--- a/apps/documentation/src/pages/api/hello.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
-import type { NextApiRequest, NextApiResponse } from 'next';
-
-interface Data {
- name: string;
-}
-
-export default function handler(req: NextApiRequest, res: NextApiResponse) {
- res.status(200).json({ name: 'John Doe' });
-}
diff --git a/apps/documentation/src/pages/atomic/_meta.js b/apps/documentation/src/pages/atomic/_meta.js
deleted file mode 100644
index 4fe8f006e1..0000000000
--- a/apps/documentation/src/pages/atomic/_meta.js
+++ /dev/null
@@ -1,5 +0,0 @@
-export default {
- 'agent-message': {
- title: 'Agent Message',
- },
-};
diff --git a/apps/documentation/src/pages/atomic/agent-message.mdx b/apps/documentation/src/pages/atomic/agent-message.mdx
deleted file mode 100644
index 0e07e55347..0000000000
--- a/apps/documentation/src/pages/atomic/agent-message.mdx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { StoryEmbed } from '../../components/StoryEmbed';
-
-
-# Agent Message
-
-## Base
-
-
-
-
-## AI Generated Chin
-
-
-
-
-## Text Treatment
-
-
-
-
-## Code Response
-
-
-
-
-## Inline Code Response
-
-
-
-
-## Tables
-
-
-
-
-## Lists
-
-
-
-
-
diff --git a/apps/documentation/src/pages/atomic/avatar.mdx b/apps/documentation/src/pages/atomic/avatar.mdx
deleted file mode 100644
index 2656e8ac83..0000000000
--- a/apps/documentation/src/pages/atomic/avatar.mdx
+++ /dev/null
@@ -1,11 +0,0 @@
-import { StoryEmbed } from '../../components/StoryEmbed';
-
-# Avatar component
-
-## Small
-
-
-
-## Large
-
-
diff --git a/apps/documentation/src/pages/atomic/buttons.mdx b/apps/documentation/src/pages/atomic/buttons.mdx
deleted file mode 100644
index a982582612..0000000000
--- a/apps/documentation/src/pages/atomic/buttons.mdx
+++ /dev/null
@@ -1,38 +0,0 @@
-import { StoryEmbed } from '../../components/StoryEmbed';
-
-# Buttons
-
-
-## Inline button
-
-Used to show actions coming from the chat response.
-
-
-
-## Primary button
-
-This is used in the 'exit prompt' (when user closes the chat) and in the disclaimer (if set).
-
-Added a mock container (width: 224px)
-
-
-
-
-
-
-
-
-## Secondary button
-
-Added a mock container (width: 224px)
-
-
-
-
-
-
-
-
-Inside a card it will look like this:
-
-
diff --git a/apps/documentation/src/pages/atomic/carousel-button.mdx b/apps/documentation/src/pages/atomic/carousel-button.mdx
deleted file mode 100644
index 5a159b8771..0000000000
--- a/apps/documentation/src/pages/atomic/carousel-button.mdx
+++ /dev/null
@@ -1,11 +0,0 @@
-import { StoryEmbed } from '../../components/StoryEmbed';
-
-# Carousel Button
-
-## Right
-
-
-
-## Left
-
-
diff --git a/apps/documentation/src/pages/atomic/feedback-button.mdx b/apps/documentation/src/pages/atomic/feedback-button.mdx
deleted file mode 100644
index e38d4579db..0000000000
--- a/apps/documentation/src/pages/atomic/feedback-button.mdx
+++ /dev/null
@@ -1,11 +0,0 @@
-import { StoryEmbed } from '../../components/StoryEmbed';
-
-# FeedbackButton
-
-## Previous Response
-
-
-
-## Last Response
-
-
diff --git a/apps/documentation/src/pages/atomic/launcher.mdx b/apps/documentation/src/pages/atomic/launcher.mdx
deleted file mode 100644
index 319160e3a9..0000000000
--- a/apps/documentation/src/pages/atomic/launcher.mdx
+++ /dev/null
@@ -1,25 +0,0 @@
-import { StoryEmbed } from '../../components/StoryEmbed';
-
-# Launcher component
-
-## Default
-
-A launcher button with the default icon and no label.
-
-
-
-## With custom label
-
-
-
-## With label & icon
-
-
-
-## With Custom Icon
-
-
-
-## With Custom Icon Positioned Right
-
-
diff --git a/apps/documentation/src/pages/atomic/message-input.mdx b/apps/documentation/src/pages/atomic/message-input.mdx
deleted file mode 100644
index 19865528ae..0000000000
--- a/apps/documentation/src/pages/atomic/message-input.mdx
+++ /dev/null
@@ -1,16 +0,0 @@
-import 'regenerator-runtime/runtime';
-
-import { StoryEmbed } from '../../components/StoryEmbed';
-import { ClientRenderer } from '../../components/ClientRenderer';
-
-# Message Input
-
-## Base
-
-
-
-
-
-## With audio input
-
-
diff --git a/apps/documentation/src/pages/atomic/send-button.mdx b/apps/documentation/src/pages/atomic/send-button.mdx
deleted file mode 100644
index d203ba6db2..0000000000
--- a/apps/documentation/src/pages/atomic/send-button.mdx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { StoryEmbed } from '../../components/StoryEmbed';
-
-# Send Button
-
-
-## Disabled
-
-
-
-## Enabled
-
-
diff --git a/apps/documentation/src/pages/atomic/typing-indicator.mdx b/apps/documentation/src/pages/atomic/typing-indicator.mdx
deleted file mode 100644
index 488e84a1b3..0000000000
--- a/apps/documentation/src/pages/atomic/typing-indicator.mdx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { StoryEmbed } from '../../components/StoryEmbed';
-
-# Typing Indicator
-
-
-## Default
-
-
-
-
-## Inside a chat widget
-
-
diff --git a/apps/documentation/src/pages/atomic/welcome-message.mdx b/apps/documentation/src/pages/atomic/welcome-message.mdx
deleted file mode 100644
index f30d635a3c..0000000000
--- a/apps/documentation/src/pages/atomic/welcome-message.mdx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { StoryEmbed } from '../../components/StoryEmbed';
-import { ClientRenderer } from '../../components/ClientRenderer';
-
-# WelcomeMessage
-
-## Base
-
-
-
-## Long Content
-
-
diff --git a/apps/documentation/src/pages/chat.tsx b/apps/documentation/src/pages/chat.tsx
deleted file mode 100644
index c88ee0a2b1..0000000000
--- a/apps/documentation/src/pages/chat.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-import 'regenerator-runtime/runtime';
-
-import { ChatScript } from '@/components/ChatScript';
-
-import ProactiveMessage, { sendButtonStyle } from './ProactiveMessage';
-
-export const getServerSideProps = async (context: any) => ({
- // will be passed to the page component as props.
- props: {
- projectID: context.query.projectID,
- embedded: !!context.query.embed,
- },
-});
-
-export default function ChatPage(props: any) {
- const hideChat = () => {
- (window as any).voiceflow.chat.hide();
- };
-
- const showChat = () => {
- (window as any).voiceflow.chat.show();
- };
-
- return (
- <>
-
-
- You can switch projects by changing the URL `projectID=...`
- {props.projectID && }
-
-
-
-
-
- Chat Controls
-
- Hide Chat
-
-
- Show Chat
-
-
-
-
-
-
- >
- );
-}
diff --git a/apps/documentation/src/pages/compositions/footer.mdx b/apps/documentation/src/pages/compositions/footer.mdx
deleted file mode 100644
index 78efa03d11..0000000000
--- a/apps/documentation/src/pages/compositions/footer.mdx
+++ /dev/null
@@ -1,35 +0,0 @@
-import { StoryEmbed } from '../../components/StoryEmbed';
-
-# Chat Demo
-
-## Default
-
-
-
-
-
-## Only 'Privacy' link
-
-
-
-
-
-## Only 'Powered by' link
-
-
-
-
-
-## No Footer links
-
-
-
-
-
-## Chat ended
-
-
-
-
-
-
diff --git a/apps/documentation/src/pages/compositions/voice-widget.mdx b/apps/documentation/src/pages/compositions/voice-widget.mdx
deleted file mode 100644
index fd76124e5c..0000000000
--- a/apps/documentation/src/pages/compositions/voice-widget.mdx
+++ /dev/null
@@ -1,33 +0,0 @@
-import { StoryEmbed } from '../../components/StoryEmbed';
-
-# Voice Widget
-
-## Default
-
-
-
-
-
-## Listening
-
-
-
-
-
-## Talking
-
-
-
-
-
-## Compact
-
-
-
-
-
-## Expanded
-
-
-
-
diff --git a/apps/documentation/src/pages/compositions/widget-page-component.tsx b/apps/documentation/src/pages/compositions/widget-page-component.tsx
deleted file mode 100644
index 8133ccbbee..0000000000
--- a/apps/documentation/src/pages/compositions/widget-page-component.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-'use client';
-
-import { useEffect, useState } from 'react';
-
-import { StoryEmbed } from '../../components/StoryEmbed';
-
-export default function ChatWidgetStories() {
- const [shouldRender, setShouldRender] = useState(false);
-
- useEffect(() => {
- setShouldRender(true);
- }, []);
-
- if (!shouldRender) {
- return null;
- }
-
- return (
-
- # Chat Demo ## Base
-
-
-
- ## Themed
-
- ## No Powered By
-
-
- ### No Footer at all
-
- ### Chat ended
-
-
-
- );
-}
diff --git a/apps/documentation/src/pages/compositions/widget.mdx b/apps/documentation/src/pages/compositions/widget.mdx
deleted file mode 100644
index 69aa4230e6..0000000000
--- a/apps/documentation/src/pages/compositions/widget.mdx
+++ /dev/null
@@ -1,5 +0,0 @@
-import ChatWidgetStories from './widget-page-component.tsx';
-
-## Chat Widget
-
-
diff --git a/apps/documentation/src/pages/index.mdx b/apps/documentation/src/pages/index.mdx
deleted file mode 100644
index b727c04f40..0000000000
--- a/apps/documentation/src/pages/index.mdx
+++ /dev/null
@@ -1 +0,0 @@
-# Welcome to the Voiceflow ChatKit
diff --git a/apps/documentation/src/pages/molecules/card.mdx b/apps/documentation/src/pages/molecules/card.mdx
deleted file mode 100644
index 76a9936788..0000000000
--- a/apps/documentation/src/pages/molecules/card.mdx
+++ /dev/null
@@ -1,31 +0,0 @@
-import { StoryEmbed } from '../../components/StoryEmbed';
-
-# Card
-
-## Simple
-
-
-
-## Only title
-
-
-
-## Only description
-
-
-
-## With image
-
-
-
-## With buttons
-
-
-
-## Only buttons
-
-
-
-## Long labels
-
-
diff --git a/apps/documentation/src/pages/molecules/carousel.mdx b/apps/documentation/src/pages/molecules/carousel.mdx
deleted file mode 100644
index 12c7468509..0000000000
--- a/apps/documentation/src/pages/molecules/carousel.mdx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { StoryEmbed } from '../../components/StoryEmbed';
-
-
-# Carousel
-
-
-
-
diff --git a/apps/documentation/src/pages/molecules/header.mdx b/apps/documentation/src/pages/molecules/header.mdx
deleted file mode 100644
index ae0acf3451..0000000000
--- a/apps/documentation/src/pages/molecules/header.mdx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { StoryEmbed } from '../../components/StoryEmbed';
-
-
-
-# Header
-
-## Base
-
-
-
-## Muted
-
-
-
-## Without an image
-
-
-
-## Mobile
-
-
-
-
diff --git a/apps/documentation/src/pages/molecules/link-preview.mdx b/apps/documentation/src/pages/molecules/link-preview.mdx
deleted file mode 100644
index 9a6576a8b8..0000000000
--- a/apps/documentation/src/pages/molecules/link-preview.mdx
+++ /dev/null
@@ -1,35 +0,0 @@
-import { StoryEmbed } from '../../components/StoryEmbed';
-
-# Header
-
-## Default
-
-
-
-## Loading
-
-
-
-## Url
-
-
-
-## Pdf
-
-
-
-## Inline
-
-
-
-## Inline Loading
-
-
-
-## Url
-
-
-
-## Pdf
-
-
diff --git a/apps/documentation/src/pages/molecules/prompt.mdx b/apps/documentation/src/pages/molecules/prompt.mdx
deleted file mode 100644
index 158d66eb38..0000000000
--- a/apps/documentation/src/pages/molecules/prompt.mdx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { StoryEmbed } from '../../components/StoryEmbed';
-
-# Prompt
-
-
diff --git a/apps/documentation/src/pages/theme/color.mdx b/apps/documentation/src/pages/theme/color.mdx
deleted file mode 100644
index 04b669518e..0000000000
--- a/apps/documentation/src/pages/theme/color.mdx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { StoryEmbed } from '../../components/StoryEmbed';
-
-# FeedbackButton
-
-## Base
-
-
diff --git a/apps/documentation/src/scripts/import-chat.sh b/apps/documentation/src/scripts/import-chat.sh
deleted file mode 100755
index a66cb717fe..0000000000
--- a/apps/documentation/src/scripts/import-chat.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-# Build chat package
-cd ../../packages/chat
-yarn install
-yarn build
-
-# Copy bundled files
-mkdir -p ../../apps/documentation/public/bundle
-cp ./dist/bundle.mjs ../../apps/documentation/public/bundle/bundle.mjs
-cp ./dist/style.css ../../apps/documentation/public/bundle/style.css
-
-# Go back to previous working directory
-cd ../../packages/chat
diff --git a/apps/documentation/src/styles/Home.module.css b/apps/documentation/src/styles/Home.module.css
deleted file mode 100644
index ee9b8e6339..0000000000
--- a/apps/documentation/src/styles/Home.module.css
+++ /dev/null
@@ -1,168 +0,0 @@
-.page {
- --gray-rgb: 0, 0, 0;
- --gray-alpha-200: rgba(var(--gray-rgb), 0.08);
- --gray-alpha-100: rgba(var(--gray-rgb), 0.05);
-
- --button-primary-hover: #383838;
- --button-secondary-hover: #f2f2f2;
-
- display: grid;
- grid-template-rows: 20px 1fr 20px;
- align-items: center;
- justify-items: center;
- min-height: 100svh;
- padding: 80px;
- gap: 64px;
- font-family: var(--font-geist-sans);
-}
-
-@media (prefers-color-scheme: dark) {
- .page {
- --gray-rgb: 255, 255, 255;
- --gray-alpha-200: rgba(var(--gray-rgb), 0.145);
- --gray-alpha-100: rgba(var(--gray-rgb), 0.06);
-
- --button-primary-hover: #ccc;
- --button-secondary-hover: #1a1a1a;
- }
-}
-
-.main {
- display: flex;
- flex-direction: column;
- gap: 32px;
- grid-row-start: 2;
-}
-
-.main ol {
- font-family: var(--font-geist-mono);
- padding-left: 0;
- margin: 0;
- font-size: 14px;
- line-height: 24px;
- letter-spacing: -0.01em;
- list-style-position: inside;
-}
-
-.main li:not(:last-of-type) {
- margin-bottom: 8px;
-}
-
-.main code {
- font-family: inherit;
- background: var(--gray-alpha-100);
- padding: 2px 4px;
- border-radius: 4px;
- font-weight: 600;
-}
-
-.ctas {
- display: flex;
- gap: 16px;
-}
-
-.ctas a {
- appearance: none;
- border-radius: 128px;
- height: 48px;
- padding: 0 20px;
- border: none;
- border: 1px solid transparent;
- transition:
- background 0.2s,
- color 0.2s,
- border-color 0.2s;
- cursor: pointer;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 16px;
- line-height: 20px;
- font-weight: 500;
-}
-
-a.primary {
- background: var(--foreground);
- color: var(--background);
- gap: 8px;
-}
-
-a.secondary {
- border-color: var(--gray-alpha-200);
- min-width: 180px;
-}
-
-.footer {
- grid-row-start: 3;
- display: flex;
- gap: 24px;
-}
-
-.footer a {
- display: flex;
- align-items: center;
- gap: 8px;
-}
-
-.footer img {
- flex-shrink: 0;
-}
-
-/* Enable hover only on non-touch devices */
-@media (hover: hover) and (pointer: fine) {
- a.primary:hover {
- background: var(--button-primary-hover);
- border-color: transparent;
- }
-
- a.secondary:hover {
- background: var(--button-secondary-hover);
- border-color: transparent;
- }
-
- .footer a:hover {
- text-decoration: underline;
- text-underline-offset: 4px;
- }
-}
-
-@media (max-width: 600px) {
- .page {
- padding: 32px;
- padding-bottom: 80px;
- }
-
- .main {
- align-items: center;
- }
-
- .main ol {
- text-align: center;
- }
-
- .ctas {
- flex-direction: column;
- }
-
- .ctas a {
- font-size: 14px;
- height: 40px;
- padding: 0 16px;
- }
-
- a.secondary {
- min-width: auto;
- }
-
- .footer {
- flex-wrap: wrap;
- align-items: center;
- justify-content: center;
- }
-}
-
-@media (prefers-color-scheme: dark) {
- .logo {
- filter: invert();
- }
-}
diff --git a/apps/documentation/src/styles/globals.css b/apps/documentation/src/styles/globals.css
deleted file mode 100644
index 431db288fe..0000000000
--- a/apps/documentation/src/styles/globals.css
+++ /dev/null
@@ -1,69 +0,0 @@
-:root {
- --background: #ffffff;
- --foreground: #171717;
-}
-
-@media (prefers-color-scheme: dark) {
- :root {
- --background: #0a0a0a;
- --foreground: #ededed;
- }
-}
-
-html,
-body {
- max-width: 100vw;
- overflow-x: hidden;
-}
-
-body {
- color: #0a0a0a;
- background: white;
- font-family: Arial, Helvetica, sans-serif;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-
-* {
- box-sizing: border-box;
- padding: 0;
- margin: 0;
-}
-
-a {
- color: inherit;
- text-decoration: none;
-}
-
-h2 {
- margin-bottom: 12px;
-}
-
-@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@450&display=swap');
-
-@font-face {
- font-family: 'UCityProWeb';
- src:
- local('UCityProWeb'),
- url('/fonts/UCityProWeb-Regular.woff') format('woff'),
- url('/fonts/UCityProWeb-Regular.woff2') format('woff2');
- font-weight: 400;
-}
-
-@font-face {
- font-family: 'UCityProWeb';
- src:
- local('UCityProWeb'),
- url('/fonts/UCityProWeb-Semibold.woff') format('woff'),
- url('/fonts/UCityProWeb-Semibold.woff2') format('woff2');
- font-weight: 600;
-}
-
-@font-face {
- font-family: 'UCityProWeb';
- src:
- local('UCityProWeb'),
- url('/fonts/UCityProWeb-Bold.woff') format('woff'),
- url('/fonts/UCityProWeb-Bold.woff2') format('woff2');
- font-weight: 700;
-}
diff --git a/apps/documentation/src/theme.config.tsx b/apps/documentation/src/theme.config.tsx
deleted file mode 100644
index f70bf1f876..0000000000
--- a/apps/documentation/src/theme.config.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import type { DocsThemeConfig } from 'nextra-theme-docs';
-import React from 'react';
-
-const config: DocsThemeConfig = {
- logo: (
- <>
-
-
-
- ChatKit UI Documentation
- >
- ),
- project: {
- link: 'https://github.com/voiceflow/react-chat',
- },
- docsRepositoryBase: 'https://github.com/voiceflow/react-chat',
- footer: {
- content: 'Made with ❤️ by Voiceflow',
- },
- sidebar: {
- defaultMenuCollapseLevel: 1,
- },
-};
-
-export default config;
diff --git a/apps/documentation/tsconfig.build.json b/apps/documentation/tsconfig.build.json
deleted file mode 100644
index 7f214fd5e8..0000000000
--- a/apps/documentation/tsconfig.build.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "$schema": "https://json.schemastore.org/tsconfig",
- "extends": "./tsconfig.json",
- "compilerOptions": {
- "target": "es5"
- },
- "include": ["src", "next-env.d.ts"]
-}
diff --git a/apps/documentation/tsconfig.json b/apps/documentation/tsconfig.json
deleted file mode 100644
index db9ea66257..0000000000
--- a/apps/documentation/tsconfig.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "extends": "@voiceflow/tsconfig",
- "compilerOptions": {
- "moduleResolution": "bundler",
- "incremental": true,
- "noEmit": true,
- "allowJs": true,
- "esModuleInterop": true,
- "resolveJsonModule": true,
- "jsx": "preserve",
- "lib": ["dom", "dom.iterable", "esnext"],
- "baseUrl": ".",
- "paths": {
- "@/*": ["src/*"]
- }
- },
- "exclude": ["node_modules", "build"],
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "src/pages/_app.tsx"]
-}
diff --git a/examples/live-agent/package.json b/examples/live-agent/package.json
index 5d65d7089e..6e01331c49 100644
--- a/examples/live-agent/package.json
+++ b/examples/live-agent/package.json
@@ -13,7 +13,7 @@
"dependencies": {
"@voiceflow/exception": "1.4.0",
"@voiceflow/fetch": "1.5.2",
- "@voiceflow/react-chat-legacy": "workspace:*",
+ "@voiceflow/react-chat": "workspace:*",
"@voiceflow/slate-serializer": "1.4.2",
"nanoevents": "8.0.0",
"react": "18.2.0",
diff --git a/examples/live-agent/src/config.ts b/examples/live-agent/src/config.ts
index defdacebe5..35bfe5589c 100644
--- a/examples/live-agent/src/config.ts
+++ b/examples/live-agent/src/config.ts
@@ -1,4 +1,4 @@
-import { AssistantOptions, ChatConfig } from '@voiceflow/react-chat-legacy';
+import { AssistantOptions, ChatConfig } from '@voiceflow/react-chat';
const IMAGE = 'https://picsum.photos/seed/1/200/300';
const AVATAR = 'https://picsum.photos/seed/1/80/80';
diff --git a/examples/live-agent/src/context.tsx b/examples/live-agent/src/context.tsx
index bd3d2cc545..9668585158 100644
--- a/examples/live-agent/src/context.tsx
+++ b/examples/live-agent/src/context.tsx
@@ -1,4 +1,4 @@
-import { RuntimeProvider as BaseProvider } from '@voiceflow/react-chat-legacy';
+import { RuntimeProvider as BaseProvider } from '@voiceflow/react-chat';
import { createNanoEvents } from 'nanoevents';
import { useMemo } from 'react';
diff --git a/examples/live-agent/src/main.tsx b/examples/live-agent/src/main.tsx
index 5154f03981..7d1c89bc81 100644
--- a/examples/live-agent/src/main.tsx
+++ b/examples/live-agent/src/main.tsx
@@ -1,4 +1,4 @@
-import { ChatWidget } from '@voiceflow/react-chat-legacy';
+import { ChatWidget } from '@voiceflow/react-chat';
import { createRoot } from 'react-dom/client';
import { RuntimeProvider } from './context';
diff --git a/examples/live-agent/src/traces/LiveAgent.trace.ts b/examples/live-agent/src/traces/LiveAgent.trace.ts
index 9b58342e45..15d88eae0c 100644
--- a/examples/live-agent/src/traces/LiveAgent.trace.ts
+++ b/examples/live-agent/src/traces/LiveAgent.trace.ts
@@ -1,4 +1,4 @@
-import type { TraceHandler } from '@voiceflow/react-chat-legacy';
+import type { TraceHandler } from '@voiceflow/react-chat';
import type { LiveAgentPlatform } from '../../shared/live-agent-platform.enum';
diff --git a/examples/live-agent/src/use-live-agent.hook.ts b/examples/live-agent/src/use-live-agent.hook.ts
index 4f809fb0bd..c37cdbbe30 100644
--- a/examples/live-agent/src/use-live-agent.hook.ts
+++ b/examples/live-agent/src/use-live-agent.hook.ts
@@ -1,6 +1,6 @@
import { FetchClient } from '@voiceflow/fetch';
-import type { RuntimeState } from '@voiceflow/react-chat-legacy';
-import { TurnType } from '@voiceflow/react-chat-legacy';
+import type { RuntimeState } from '@voiceflow/react-chat';
+import { TurnType } from '@voiceflow/react-chat';
import { serializeToText } from '@voiceflow/slate-serializer/text';
import type { Emitter } from 'nanoevents';
import { useMemo } from 'react';
diff --git a/examples/live-chat/CHANGELOG.md b/examples/live-chat/CHANGELOG.md
deleted file mode 100644
index ef39ad9c23..0000000000
--- a/examples/live-chat/CHANGELOG.md
+++ /dev/null
@@ -1,328 +0,0 @@
-# Change Log
-
-All notable changes to this project will be documented in this file.
-See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-
-## [0.5.8](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.5.7...@voiceflow-example/live-chat@0.5.8) (2025-01-13)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.5.7](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.5.6...@voiceflow-example/live-chat@0.5.7) (2025-01-10)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.5.6](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.5.5...@voiceflow-example/live-chat@0.5.6) (2025-01-10)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.5.5](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.5.4...@voiceflow-example/live-chat@0.5.5) (2025-01-10)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.5.4](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.5.3...@voiceflow-example/live-chat@0.5.4) (2025-01-10)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.5.3](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.5.2...@voiceflow-example/live-chat@0.5.3) (2025-01-08)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.5.2](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.5.1...@voiceflow-example/live-chat@0.5.2) (2025-01-08)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.5.1](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.5.0...@voiceflow-example/live-chat@0.5.1) (2025-01-08)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-# [0.5.0](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.35...@voiceflow-example/live-chat@0.5.0) (2025-01-07)
-
-### Features
-
-* update voice widget (COR-4323) ([#482](https://github.com/voiceflow/react-chat/issues/482)) ([cfc70e5](https://github.com/voiceflow/react-chat/commit/cfc70e52061ad764017d7fe19fbadb8044fed0c1))
-
-## [0.4.35](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.34...@voiceflow-example/live-chat@0.4.35) (2025-01-07)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.34](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.33...@voiceflow-example/live-chat@0.4.34) (2025-01-07)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.33](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.32...@voiceflow-example/live-chat@0.4.33) (2025-01-03)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.32](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.31...@voiceflow-example/live-chat@0.4.32) (2025-01-03)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.31](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.30...@voiceflow-example/live-chat@0.4.31) (2024-12-18)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.30](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.29...@voiceflow-example/live-chat@0.4.30) (2024-12-18)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.29](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.28...@voiceflow-example/live-chat@0.4.29) (2024-12-17)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.28](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.27...@voiceflow-example/live-chat@0.4.28) (2024-12-16)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.27](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.26...@voiceflow-example/live-chat@0.4.27) (2024-12-16)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.26](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.25...@voiceflow-example/live-chat@0.4.26) (2024-12-13)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.25](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.24...@voiceflow-example/live-chat@0.4.25) (2024-12-13)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.24](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.23...@voiceflow-example/live-chat@0.4.24) (2024-12-12)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.23](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.22...@voiceflow-example/live-chat@0.4.23) (2024-12-12)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.22](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.21...@voiceflow-example/live-chat@0.4.22) (2024-12-12)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.21](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.20...@voiceflow-example/live-chat@0.4.21) (2024-12-12)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.20](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.19...@voiceflow-example/live-chat@0.4.20) (2024-12-12)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.19](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.18...@voiceflow-example/live-chat@0.4.19) (2024-12-11)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.18](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.17...@voiceflow-example/live-chat@0.4.18) (2024-12-11)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.17](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.16...@voiceflow-example/live-chat@0.4.17) (2024-12-11)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.16](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.15...@voiceflow-example/live-chat@0.4.16) (2024-12-09)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.15](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.14...@voiceflow-example/live-chat@0.4.15) (2024-12-09)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.14](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.13...@voiceflow-example/live-chat@0.4.14) (2024-12-09)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.13](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.12...@voiceflow-example/live-chat@0.4.13) (2024-12-09)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.12](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.11...@voiceflow-example/live-chat@0.4.12) (2024-12-06)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.11](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.10...@voiceflow-example/live-chat@0.4.11) (2024-12-06)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.10](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.9...@voiceflow-example/live-chat@0.4.10) (2024-12-06)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.9](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.8...@voiceflow-example/live-chat@0.4.9) (2024-12-06)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.8](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.7...@voiceflow-example/live-chat@0.4.8) (2024-12-06)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.7](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.6...@voiceflow-example/live-chat@0.4.7) (2024-12-05)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.6](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.5...@voiceflow-example/live-chat@0.4.6) (2024-12-05)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.5](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.4...@voiceflow-example/live-chat@0.4.5) (2024-12-04)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.4](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.3...@voiceflow-example/live-chat@0.4.4) (2024-12-04)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.3](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.2...@voiceflow-example/live-chat@0.4.3) (2024-12-04)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.2](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.1...@voiceflow-example/live-chat@0.4.2) (2024-12-03)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.4.1](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.4.0...@voiceflow-example/live-chat@0.4.1) (2024-12-03)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-# [0.4.0](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.24...@voiceflow-example/live-chat@0.4.0) (2024-12-03)
-
-### Features
-
-* use new WidgetSettings object for chat configuration ([#376](https://github.com/voiceflow/react-chat/issues/376)) ([43ebd19](https://github.com/voiceflow/react-chat/commit/43ebd19bf4e8d31fbddd8c39a05335d25056ad31))
-
-## [0.3.24](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.23...@voiceflow-example/live-chat@0.3.24) (2024-12-03)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.23](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.22...@voiceflow-example/live-chat@0.3.23) (2024-11-28)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.22](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.21...@voiceflow-example/live-chat@0.3.22) (2024-11-28)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.21](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.20...@voiceflow-example/live-chat@0.3.21) (2024-11-28)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.20](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.19...@voiceflow-example/live-chat@0.3.20) (2024-11-27)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.19](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.18...@voiceflow-example/live-chat@0.3.19) (2024-11-26)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.18](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.17...@voiceflow-example/live-chat@0.3.18) (2024-11-26)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.17](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.16...@voiceflow-example/live-chat@0.3.17) (2024-11-25)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.16](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.15...@voiceflow-example/live-chat@0.3.16) (2024-11-25)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.15](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.14...@voiceflow-example/live-chat@0.3.15) (2024-11-25)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.14](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.13...@voiceflow-example/live-chat@0.3.14) (2024-11-25)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.13](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.12...@voiceflow-example/live-chat@0.3.13) (2024-11-25)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.12](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.11...@voiceflow-example/live-chat@0.3.12) (2024-11-25)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.11](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.10...@voiceflow-example/live-chat@0.3.11) (2024-11-25)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.10](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.9...@voiceflow-example/live-chat@0.3.10) (2024-11-25)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.9](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.8...@voiceflow-example/live-chat@0.3.9) (2024-11-21)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.8](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.7...@voiceflow-example/live-chat@0.3.8) (2024-11-20)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.7](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.6...@voiceflow-example/live-chat@0.3.7) (2024-11-20)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.6](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.5...@voiceflow-example/live-chat@0.3.6) (2024-11-19)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.5](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.4...@voiceflow-example/live-chat@0.3.5) (2024-11-19)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.4](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.3...@voiceflow-example/live-chat@0.3.4) (2024-11-19)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.3](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.2...@voiceflow-example/live-chat@0.3.3) (2024-11-19)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.2](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.1...@voiceflow-example/live-chat@0.3.2) (2024-11-19)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.3.1](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.3.0...@voiceflow-example/live-chat@0.3.1) (2024-11-18)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-# [0.3.0](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.2.3...@voiceflow-example/live-chat@0.3.0) (2024-11-18)
-
-### Features
-
-* release next react-chat library (DSN-2545) ([#316](https://github.com/voiceflow/react-chat/issues/316)) ([65722df](https://github.com/voiceflow/react-chat/commit/65722dfb438bc918bfb4fbb33aa0fc7c730eac38))
-
-## [0.2.3](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.2.2...@voiceflow-example/live-chat@0.2.3) (2024-11-07)
-
-### Bug Fixes
-
-* add regenerator-runtime to the live-chat example (COR-0000) ([#286](https://github.com/voiceflow/react-chat/issues/286)) ([7a97a6d](https://github.com/voiceflow/react-chat/commit/7a97a6d1cf979bb79bce4f273696178a18d6aa8a))
-
-## [0.2.2](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.2.1...@voiceflow-example/live-chat@0.2.2) (2024-10-24)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.2.1](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.2.0...@voiceflow-example/live-chat@0.2.1) (2024-10-16)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-# [0.2.0](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.1.3...@voiceflow-example/live-chat@0.2.0) (2024-10-01)
-
-### Features
-
-* add vanilla-extract to the new chat package (COR-3282) ([#183](https://github.com/voiceflow/react-chat/issues/183)) ([0816086](https://github.com/voiceflow/react-chat/commit/081608647896bdfdf832e61e580bcfcc25a3b93e))
-
-## [0.1.3](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.1.2...@voiceflow-example/live-chat@0.1.3) (2024-09-27)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.1.2](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.1.1...@voiceflow-example/live-chat@0.1.2) (2024-09-25)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-## [0.1.1](https://github.com/voiceflow/react-chat/compare/@voiceflow-example/live-chat@0.1.0...@voiceflow-example/live-chat@0.1.1) (2024-09-25)
-
-**Note:** Version bump only for package @voiceflow-example/live-chat
-
-# 0.1.0 (2024-09-25)
-
-### Features
-
-* add live-chat for the new chat package (COR-0000) ([#177](https://github.com/voiceflow/react-chat/issues/177)) ([ed3c0a9](https://github.com/voiceflow/react-chat/commit/ed3c0a9ab4a9b65b6473299f0dbaa3c2e4e1f41e))
diff --git a/examples/live-chat/README.md b/examples/live-chat/README.md
deleted file mode 100644
index cad2b1e69c..0000000000
--- a/examples/live-chat/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-# Live Chat Example
-
-## 🚧 WIP 🚧
-
-This is an example showing the new `chat` package.
-It is under construction, not nearly stable and shouldn't be used in any context.
-
-In order to run this example, from the project root directory, run:
-
-```
-yarn run dev:chat
-```
-
-## Install Dependencies
-
-```sh
-yarn install
-```
-
-## Import Example Project
-
-Import this [project with custom actions](example_project.vf) into your Voiceflow workspace.
-It includes custom `account_info`, `calendar` and `video` actions.
-
-## Configure Environment
-
-Follow [these instructions](https://docs.voiceflow.com/docs/publishing-environments-backups) to publish your Voiceflow Assistant.
-
-Copy the project ID from the Assistant Settings and write it to a `.env.local` file.
-
-```sh
-# replace `XXX` with your project ID key
-echo 'VF_PROJECT_ID=XXX` > .env.local
-```
-
-## Run Dev Server
-
-The demo app will be available locally at .
-
-This will also start the WebSocket server located in `server/` to interact with Intercom's APIs.
-See the [README](server/README.md) for more information.
-
-For convenience you can run both the chat widget and the WebSocket server at the same time with this command.
-
-```sh
-yarn dev
-```
-
-
-
-## Invoke Custom Actions
-
-### `talk_to_agent`
-
-- "I want to talk to a human"
-- "Please connect me to a human"
-
-This will switch the conversation into a mode that emulates talking with a live agent.
-New messages will skip the Voiceflow logic and be sent directly to the agent.
-You can also end the live conversation and return to talking with the Voiceflow bot.
-Make sure to run the server in `./server` with the command `yarn dev`.
diff --git a/examples/live-chat/example_project.vf b/examples/live-chat/example_project.vf
deleted file mode 100644
index ae6127edca..0000000000
--- a/examples/live-chat/example_project.vf
+++ /dev/null
@@ -1,1518 +0,0 @@
-{
- "version": {
- "variables": [
- "sessions",
- "user_id",
- "timestamp",
- "platform",
- "locale",
- "appointment_date",
- "pretty_date",
- "intent_confidence",
- "last_response",
- "last_event",
- "last_utterance",
- "vf_memory",
- "vf_chunks"
- ],
- "platformData": {
- "slots": [],
- "intents": [
- {
- "key": "VF.HELP",
- "name": "VF.HELP",
- "slots": [],
- "inputs": [],
- "noteID": null
- },
- {
- "key": "60gy3iks",
- "name": "talk_to_agent",
- "slots": [],
- "inputs": [
- {
- "text": "I want to talk to a human",
- "slots": []
- },
- {
- "text": "I want to speak to an agent",
- "slots": []
- },
- {
- "text": "I'd like to talk to a real person",
- "slots": []
- },
- {
- "text": "I need to talk to someone right now",
- "slots": []
- },
- {
- "text": "I want to speak with a customer service representative",
- "slots": []
- },
- {
- "text": "I need to converse with a representative",
- "slots": []
- }
- ],
- "noteID": null
- },
- {
- "key": "VF.STOP",
- "name": "VF.STOP",
- "slots": [],
- "inputs": [],
- "noteID": null
- },
- {
- "key": "None",
- "name": "None",
- "slots": [],
- "inputs": [],
- "noteID": null
- }
- ],
- "settings": {
- "restart": true,
- "repeat": 100,
- "locales": [
- "en-US"
- ],
- "globalNoMatch": {
- "type": "static",
- "prompt": {
- "id": "cli96kttc00xd3b777rclbb0n",
- "content": [
- {
- "children": [
- {
- "text": "Sorry, I can only answer questions our services and your account or help you to book an appointment."
- }
- ]
- }
- ]
- }
- }
- },
- "publishing": {
- "avatar": "https://cdn.voiceflow.com/assets/logo.png",
- "color": "#2E7FF1",
- "description": "Our virtual assistant is here to help you.",
- "image": "https://cdn.voiceflow.com/assets/logo.png",
- "persistence": "localStorage",
- "position": "right",
- "spacing": {
- "side": 24,
- "bottom": 24
- },
- "title": "Custom Action Demo",
- "watermark": true,
- "feedback": false
- },
- "platform": "webchat"
- },
- "_version": 7.02,
- "name": "Initial Version",
- "manualSave": false,
- "autoSaveFromRestore": true,
- "topics": [
- {
- "sourceID": "64890a7a34f66300070f648b",
- "type": "DIAGRAM"
- }
- ],
- "components": [
- {
- "type": "DIAGRAM",
- "sourceID": "64890a7a34f66300070f648c"
- }
- ],
- "canvasTemplates": [
- {
- "id": "sg9zy34i0",
- "name": "Basic Conversation Path",
- "color": "#5b9fd7",
- "nodeIDs": [
- "643872d482cf9d2273b905df",
- "643872d482cf9d2273b905e1",
- "643872d482cf9d2273b905e3"
- ]
- },
- {
- "id": "5bgq3341p",
- "name": "Save Information",
- "color": "#000000",
- "nodeIDs": [
- "6438784f82cf9d2273b90dd4",
- "6438784f82cf9d2273b90dd6",
- "6438784f82cf9d2273b90dd8",
- "6438784f82cf9d2273b90dda"
- ]
- },
- {
- "id": "byav33785",
- "name": "API Call Example",
- "color": null,
- "nodeIDs": [
- "645d718f83103cca7a3cecc1",
- "645d718f83103cca7a3cecc3",
- "645d718f83103cca7a3cecc5",
- "645d718f83103cca7a3cecc7"
- ]
- }
- ],
- "creatorID": 10585,
- "prototype": {
- "type": "chat",
- "data": {
- "name": "Live Agent Demo",
- "locales": [
- "en-US"
- ]
- },
- "model": {
- "intents": [
- {
- "key": "60gy3iks",
- "name": "talk_to_agent",
- "slots": [],
- "inputs": [
- {
- "text": "I want to talk to a human",
- "slots": []
- },
- {
- "text": "I want to speak to an agent",
- "slots": []
- },
- {
- "text": "I'd like to talk to a real person",
- "slots": []
- },
- {
- "text": "I need to talk to someone right now",
- "slots": []
- },
- {
- "text": "I want to speak with a customer service representative",
- "slots": []
- },
- {
- "text": "I need to converse with a representative",
- "slots": []
- }
- ],
- "noteID": null
- },
- {
- "key": "VF.STOP",
- "name": "VF.STOP",
- "slots": [],
- "inputs": [
- {
- "text": "stop"
- }
- ],
- "noteID": null
- },
- {
- "key": "None",
- "name": "None",
- "slots": [],
- "inputs": [
- {
- "text": "None"
- }
- ],
- "noteID": null
- }
- ],
- "slots": []
- },
- "context": {
- "stack": [
- {
- "programID": "64890a7a34f66300070f648b",
- "storage": {},
- "variables": {},
- "diagramID": "64890a7a34f66300070f648b"
- }
- ],
- "variables": {}
- },
- "surveyorContext": {
- "functionDefinitions": {},
- "slotsMap": {},
- "platform": "webchat",
- "products": {},
- "extraSlots": [],
- "interfaces": [],
- "permissions": [],
- "extraIntents": [],
- "usedEventsSet": [],
- "usedIntentsSet": [
- "60gy3iks",
- "VF.STOP"
- ],
- "goToIntentsSet": [],
- "cmsVariables": {
- "sessions": {
- "isSystem": true,
- "defaultValue": ""
- },
- "user_id": {
- "isSystem": true,
- "defaultValue": ""
- },
- "timestamp": {
- "isSystem": true,
- "defaultValue": ""
- },
- "platform": {
- "isSystem": true,
- "defaultValue": ""
- },
- "locale": {
- "isSystem": true,
- "defaultValue": ""
- },
- "intent_confidence": {
- "isSystem": true,
- "defaultValue": ""
- },
- "last_response": {
- "isSystem": true,
- "defaultValue": ""
- },
- "last_event": {
- "isSystem": true,
- "defaultValue": ""
- },
- "last_utterance": {
- "isSystem": true,
- "defaultValue": ""
- },
- "vf_memory": {
- "isSystem": true,
- "defaultValue": ""
- },
- "vf_chunks": {
- "isSystem": true,
- "defaultValue": ""
- }
- }
- },
- "settings": {},
- "platform": "webchat"
- },
- "_id": "660d79bc92a590da360b72fc",
- "updatedAt": "2024-04-08T15:52:31.097Z",
- "domains": [
- {
- "id": "cla06iyr900b206pkh8d4ap8n",
- "name": "Home",
- "live": true,
- "topicIDs": [
- "64890a7a34f66300070f648b",
- "64890a7a34f66300070f648d"
- ],
- "rootDiagramID": "64890a7a34f66300070f648b",
- "updatedBy": 10585,
- "updatedAt": "2024-04-03T16:04:20.869Z"
- }
- ],
- "projectID": "660d79bc92a590da360b72fb",
- "rootDiagramID": "64890a7a34f66300070f648b",
- "templateDiagramID": "64890212ed237e5214bba301"
- },
- "diagrams": {
- "64890a7a34f66300070f648d": {
- "name": "Live Agent",
- "type": "TOPIC",
- "zoom": 100,
- "offsetX": 0,
- "offsetY": 0,
- "modified": 1686700609,
- "variables": [],
- "menuItems": [
- {
- "type": "NODE",
- "sourceID": "648cbeee63d33f8c51024391"
- }
- ],
- "creatorID": 10585,
- "intentStepIDs": [
- "64890241d98e65000721c6d8"
- ],
- "nodes": {
- "648cbeee63d33f8c51024391": {
- "type": "intent",
- "data": {
- "name": "",
- "intent": "60gy3iks",
- "mappings": [],
- "availability": "GLOBAL",
- "portsV2": {
- "byKey": {},
- "builtIn": {
- "next": {
- "type": "next",
- "target": "64c972e405358f03eec358a2",
- "id": "648cbeee63d33f8c51024392",
- "data": {
- "points": [
- {
- "point": [
- 494.66,
- 559.25
- ]
- },
- {
- "point": [
- 698,
- 559.75
- ]
- }
- ]
- }
- }
- },
- "dynamic": []
- }
- },
- "nodeID": "648cbeee63d33f8c51024391"
- },
- "648cbeee63d33f8c51024393": {
- "type": "block",
- "data": {
- "name": "",
- "steps": [
- "648cbeee63d33f8c51024391"
- ]
- },
- "nodeID": "648cbeee63d33f8c51024393",
- "coords": [
- 399.49999999999994,
- 537.2500610351562
- ]
- },
- "648cbf1163d33f8c51024397": {
- "type": "text",
- "data": {
- "name": "Text",
- "texts": [
- {
- "id": "x9h53iko",
- "content": [
- {
- "children": [
- {
- "text": "Transferring you to an agent now..."
- }
- ]
- }
- ]
- }
- ],
- "canvasVisibility": "preview",
- "portsV2": {
- "byKey": {},
- "builtIn": {
- "next": {
- "type": "next",
- "target": null,
- "id": "648cbf1163d33f8c51024398"
- }
- },
- "dynamic": []
- }
- },
- "nodeID": "648cbf1163d33f8c51024397"
- },
- "648cbf1163d33f8c51024399": {
- "type": "block",
- "data": {
- "name": "Intercom",
- "steps": [
- "648cbf1163d33f8c51024397",
- "648cbf1f63d33f8c510243a0",
- "648cbf2e63d33f8c510243ab"
- ],
- "color": "#74a2b5"
- },
- "nodeID": "648cbf1163d33f8c51024399",
- "coords": [
- 1282,
- 713.5000610351562
- ]
- },
- "648cbf1f63d33f8c510243a0": {
- "type": "trace",
- "data": {
- "name": "talk_to_agent",
- "_v": 1,
- "paths": [
- {
- "label": "continue",
- "isDefault": true
- }
- ],
- "payload": {
- "name": "talk_to_agent",
- "body": "{ \"platform\": \"intercom\" }",
- "bodyType": "json",
- "scope": "local",
- "isBlocking": true
- },
- "defaultPath": 0,
- "portsV2": {
- "byKey": {},
- "builtIn": {},
- "dynamic": [
- {
- "type": "",
- "target": null,
- "id": "648cbf1f63d33f8c510243a1"
- }
- ]
- }
- },
- "nodeID": "648cbf1f63d33f8c510243a0"
- },
- "648cbf2e63d33f8c510243ab": {
- "type": "component",
- "data": {
- "name": "",
- "diagramID": "64890a7a34f66300070f648c",
- "portsV2": {
- "byKey": {},
- "builtIn": {
- "next": {
- "type": "next",
- "target": null,
- "id": "648cbf2e63d33f8c510243ac"
- }
- },
- "dynamic": []
- }
- },
- "nodeID": "648cbf2e63d33f8c510243ab"
- },
- "64c972e405358f03eec358a0": {
- "type": "text",
- "data": {
- "name": "Text",
- "texts": [
- {
- "id": "jh2m93bnj",
- "content": [
- {
- "children": [
- {
- "text": "Which platform do you want to use?"
- }
- ]
- }
- ]
- }
- ],
- "canvasVisibility": "preview",
- "portsV2": {
- "byKey": {},
- "builtIn": {
- "next": {
- "type": "next",
- "target": null,
- "id": "64c972e405358f03eec358a1"
- }
- },
- "dynamic": []
- }
- },
- "nodeID": "64c972e405358f03eec358a0"
- },
- "64c972e405358f03eec358a2": {
- "type": "block",
- "data": {
- "name": "Live Agent",
- "steps": [
- "64c972e405358f03eec358a0",
- "64c9730105358f03eec358a8"
- ],
- "color": ""
- },
- "nodeID": "64c972e405358f03eec358a2",
- "coords": [
- 862.9999694824219,
- 532.7498779296874
- ]
- },
- "64c9730105358f03eec358a8": {
- "type": "carousel",
- "data": {
- "name": "Card",
- "cards": [
- {
- "id": "sz2my3b40",
- "title": "Intercom",
- "description": [
- {
- "children": [
- {
- "text": ""
- }
- ]
- }
- ],
- "imageUrl": "https://www.intercom.com/_next/static/images/intercom-logo-7b36b3b2916d7eaacad8cbcec92ead24.png",
- "buttons": [
- {
- "id": "p02o83b4y",
- "name": "Use Intercom",
- "intent": null
- }
- ]
- },
- {
- "id": "4h2ow3buz",
- "title": "More coming soon...",
- "description": [
- {
- "children": [
- {
- "text": ""
- }
- ]
- }
- ],
- "imageUrl": "https://cm4-production-assets.s3.amazonaws.com/1690924147514-screenshot-2023-08-01-at-5.08.54-pm.png",
- "buttons": []
- }
- ],
- "layout": "Carousel",
- "portsV2": {
- "byKey": {
- "p02o83b4y": {
- "id": "64c9735105358f03eec358b2",
- "target": "648cbf1163d33f8c51024399",
- "type": "",
- "data": {}
- }
- },
- "builtIn": {
- "next": {
- "type": "next",
- "target": null,
- "id": "64c9730105358f03eec358a9"
- },
- "else": {
- "type": "else",
- "target": null,
- "id": "64c9730105358f03eec358aa"
- }
- },
- "dynamic": []
- }
- },
- "nodeID": "64c9730105358f03eec358a8",
- "coords": [
- 0,
- 0
- ]
- }
- },
- "_id": "660d79bc92a590da360b7300",
- "diagramID": "64890a7a34f66300070f648d",
- "versionID": "660d79bc92a590da360b72fc"
- },
- "64890a7a34f66300070f648c": {
- "name": "Continue Conversation",
- "type": "COMPONENT",
- "zoom": 100,
- "offsetX": 272,
- "offsetY": 204,
- "modified": 1686700562,
- "variables": [],
- "menuItems": [],
- "creatorID": 10585,
- "nodes": {
- "647b946344f7392360f9146c": {
- "type": "start",
- "nodeID": "647b946344f7392360f9146c",
- "coords": [
- 360,
- 120
- ],
- "data": {
- "name": "Continue",
- "color": "#43494E",
- "portsV2": {
- "byKey": {},
- "builtIn": {
- "next": {
- "id": "647b946344f7392360f9146d",
- "type": "next",
- "target": "6489035f6b7bd27de5defb66",
- "data": {
- "points": [
- {
- "point": [
- 440,
- 142
- ]
- },
- {
- "point": [
- 464,
- 142
- ]
- },
- {
- "point": [
- 464,
- 178.7
- ]
- },
- {
- "point": [
- 367.17,
- 178.7
- ]
- },
- {
- "point": [
- 367.17,
- 215.4
- ],
- "toTop": true,
- "allowedToTop": true
- }
- ]
- }
- }
- },
- "dynamic": []
- },
- "steps": []
- }
- },
- "6489035f6b7bd27de5defb64": {
- "type": "text",
- "data": {
- "name": "Text",
- "texts": [
- {
- "id": "cp24639tm",
- "content": [
- {
- "children": [
- {
- "text": "Thanks for choosing Voiceflow!"
- }
- ]
- },
- {
- "children": [
- {
- "text": ""
- }
- ]
- },
- {
- "children": [
- {
- "text": "What else can I help you with?"
- }
- ]
- }
- ]
- }
- ],
- "canvasVisibility": "preview",
- "portsV2": {
- "byKey": {},
- "builtIn": {
- "next": {
- "type": "next",
- "target": null,
- "id": "6489035f6b7bd27de5defb65"
- }
- },
- "dynamic": []
- }
- },
- "nodeID": "6489035f6b7bd27de5defb64"
- },
- "6489035f6b7bd27de5defb66": {
- "type": "block",
- "data": {
- "name": "What Next?",
- "steps": [
- "6489035f6b7bd27de5defb64",
- "648907a96b7bd27de5defd15"
- ],
- "color": ""
- },
- "nodeID": "6489035f6b7bd27de5defb66",
- "coords": [
- 367.17176464239935,
- 215.3984410256298
- ]
- },
- "648907a96b7bd27de5defd15": {
- "type": "interaction",
- "data": {
- "name": "Choice",
- "choices": [],
- "intentScope": "GLOBAL",
- "portsV2": {
- "byKey": {},
- "builtIn": {
- "else": {
- "type": "",
- "target": null,
- "id": "648907a96b7bd27de5defd17"
- }
- },
- "dynamic": []
- }
- },
- "nodeID": "648907a96b7bd27de5defd15"
- }
- },
- "_id": "660d79bc92a590da360b7301",
- "diagramID": "64890a7a34f66300070f648c",
- "versionID": "660d79bc92a590da360b72fc"
- },
- "64890a7a34f66300070f648b": {
- "offsetX": 660.3784532606145,
- "offsetY": 881.3489202677721,
- "zoom": 100,
- "variables": [],
- "name": "ROOT",
- "creatorID": 10585,
- "modified": 1686700562,
- "intentStepIDs": [],
- "type": "TOPIC",
- "menuNodeIDs": [],
- "menuItems": [
- {
- "type": "NODE",
- "sourceID": "start00000000000000000000"
- },
- {
- "type": "NODE",
- "sourceID": "64d25f7034919d3fde829adf"
- }
- ],
- "nodes": {
- "start00000000000000000000": {
- "nodeID": "start00000000000000000000",
- "type": "start",
- "coords": [
- -125.47306657576806,
- -726.6861503347151
- ],
- "data": {
- "name": "Start",
- "color": "#56b365",
- "steps": [
- "647de9d45aa2408bc3cfd991"
- ],
- "portsV2": {
- "byKey": {},
- "builtIn": {
- "next": {
- "type": "next",
- "target": "646187c35b0afc227e84c8e0",
- "id": "6032afcf359e8c14c06c0319",
- "data": {
- "points": [
- {
- "point": [
- -60.84,
- -704.69
- ]
- },
- {
- "point": [
- 284.24,
- -708.43
- ]
- }
- ]
- }
- }
- },
- "dynamic": []
- },
- "label": "Start"
- }
- },
- "646187c35b0afc227e84c8e0": {
- "type": "block",
- "data": {
- "name": "Welcome",
- "color": "",
- "steps": [
- "646187c35b0afc227e84c8f8",
- "648904096b7bd27de5defbbe"
- ]
- },
- "nodeID": "646187c35b0afc227e84c8e0",
- "coords": [
- 449.2446938673405,
- -735.4280555562118
- ]
- },
- "646187c35b0afc227e84c8f8": {
- "type": "text",
- "data": {
- "name": "Text",
- "texts": [
- {
- "id": "73r23sar",
- "content": [
- {
- "children": [
- {
- "text": "Welcome to the voiceflow live agent demo, what can I help you with today?"
- }
- ]
- },
- {
- "children": [
- {
- "text": ""
- }
- ]
- },
- {
- "children": [
- {
- "text": "To talk to a live agent say \"I want to talk to a human\""
- }
- ]
- }
- ]
- }
- ],
- "canvasVisibility": "preview",
- "portsV2": {
- "byKey": {},
- "builtIn": {
- "next": {
- "type": "next",
- "target": null,
- "id": "646187c35b0afc227e84c8f9",
- "data": {}
- }
- },
- "dynamic": []
- }
- },
- "nodeID": "646187c35b0afc227e84c8f8"
- },
- "647de9d45aa2408bc3cfd991": {
- "type": "command",
- "data": {
- "name": "Deprecated Block",
- "portsV2": {
- "byKey": {},
- "builtIn": {},
- "dynamic": []
- }
- },
- "nodeID": "647de9d45aa2408bc3cfd991"
- },
- "648904096b7bd27de5defbbe": {
- "type": "interaction",
- "data": {
- "name": "Choice",
- "choices": [],
- "intentScope": "GLOBAL",
- "portsV2": {
- "byKey": {},
- "builtIn": {
- "else": {
- "type": "else",
- "target": null,
- "id": "648904096b7bd27de5defbc0"
- }
- },
- "dynamic": []
- }
- },
- "nodeID": "648904096b7bd27de5defbbe",
- "coords": [
- 0,
- 0
- ]
- },
- "64d25f7034919d3fde829adf": {
- "type": "intent",
- "data": {
- "name": "",
- "intent": "VF.STOP",
- "mappings": [],
- "availability": "GLOBAL",
- "portsV2": {
- "byKey": {},
- "builtIn": {
- "next": {
- "type": "next",
- "target": "64d25f7b34919d3fde829ae7",
- "id": "64d25f7034919d3fde829ae0",
- "data": {
- "points": [
- {
- "point": [
- -60.61,
- -270.92
- ]
- },
- {
- "point": [
- 279.57,
- -273.96
- ]
- }
- ]
- }
- }
- },
- "dynamic": []
- }
- },
- "nodeID": "64d25f7034919d3fde829adf"
- },
- "64d25f7034919d3fde829ae1": {
- "type": "block",
- "data": {
- "name": "",
- "steps": [
- "64d25f7034919d3fde829adf"
- ]
- },
- "nodeID": "64d25f7034919d3fde829ae1",
- "coords": [
- -123.94085005833655,
- -292.9226438971365
- ]
- },
- "64d25f7b34919d3fde829ae5": {
- "type": "text",
- "data": {
- "name": "Text",
- "texts": [
- {
- "id": "r8eu3b23",
- "content": [
- {
- "children": [
- {
- "text": "Thanks for visiting!"
- }
- ]
- }
- ]
- }
- ],
- "canvasVisibility": "preview",
- "portsV2": {
- "byKey": {},
- "builtIn": {
- "next": {
- "type": "next",
- "target": null,
- "id": "64d25f7b34919d3fde829ae6"
- }
- },
- "dynamic": []
- }
- },
- "nodeID": "64d25f7b34919d3fde829ae5"
- },
- "64d25f7b34919d3fde829ae7": {
- "type": "block",
- "data": {
- "name": "Goodbye",
- "steps": [
- "64d25f7b34919d3fde829ae5",
- "64d2600434919d3fde829aef"
- ],
- "color": ""
- },
- "nodeID": "64d25f7b34919d3fde829ae7",
- "coords": [
- 444.57358917186417,
- -300.9581836742418
- ]
- },
- "64d2600434919d3fde829aef": {
- "type": "exit",
- "data": {
- "name": "",
- "portsV2": {
- "byKey": {},
- "builtIn": {},
- "dynamic": []
- }
- },
- "nodeID": "64d2600434919d3fde829aef"
- }
- },
- "_id": "660d79bc92a590da360b7302",
- "diagramID": "64890a7a34f66300070f648b",
- "versionID": "660d79bc92a590da360b72fc"
- }
- },
- "flows": [
- {
- "id": "65fd27c87c1fd10007dc8465",
- "name": "Continue Conversation",
- "createdByID": 10585,
- "folderID": null,
- "diagramID": "64890a7a34f66300070f648c",
- "description": null,
- "createdAt": "2024-03-22T06:40:08.000Z",
- "updatedAt": "2024-03-22T06:40:08.000Z",
- "updatedByID": 10585
- }
- ],
- "entities": [],
- "entityVariants": [],
- "intents": [
- {
- "id": "VF.HELP",
- "name": "VF.HELP",
- "createdByID": 10585,
- "folderID": null,
- "description": null,
- "automaticReprompt": false,
- "entityOrder": [],
- "createdAt": "2023-12-20T17:59:31.000Z",
- "updatedAt": "2023-12-20T17:59:31.000Z",
- "updatedByID": 10585
- },
- {
- "id": "60gy3iks",
- "name": "talk_to_agent",
- "createdByID": 10585,
- "folderID": null,
- "description": null,
- "automaticReprompt": false,
- "entityOrder": [],
- "createdAt": "2023-12-20T17:59:31.000Z",
- "updatedAt": "2023-12-20T17:59:31.000Z",
- "updatedByID": 10585
- },
- {
- "id": "VF.STOP",
- "name": "VF.STOP",
- "createdByID": 10585,
- "folderID": null,
- "description": null,
- "automaticReprompt": false,
- "entityOrder": [],
- "createdAt": "2023-12-20T17:59:31.000Z",
- "updatedAt": "2023-12-20T17:59:31.000Z",
- "updatedByID": 10585
- },
- {
- "id": "None",
- "name": "None",
- "createdByID": 10585,
- "folderID": null,
- "description": null,
- "automaticReprompt": false,
- "entityOrder": [],
- "createdAt": "2023-12-20T17:59:31.000Z",
- "updatedAt": "2023-12-20T17:59:31.000Z",
- "updatedByID": 10585
- }
- ],
- "utterances": [
- {
- "id": "65832b82ed842400074a0c6c",
- "text": [
- {
- "text": [
- "I want to talk to a human"
- ]
- }
- ],
- "intentID": "60gy3iks",
- "language": "en-us",
- "createdAt": "2023-12-20T17:59:31.000Z"
- },
- {
- "id": "65832b82ed842400074a0c6d",
- "text": [
- {
- "text": [
- "I want to speak to an agent"
- ]
- }
- ],
- "intentID": "60gy3iks",
- "language": "en-us",
- "createdAt": "2023-12-20T17:59:31.000Z"
- },
- {
- "id": "65832b82ed842400074a0c6e",
- "text": [
- {
- "text": [
- "I'd like to talk to a real person"
- ]
- }
- ],
- "intentID": "60gy3iks",
- "language": "en-us",
- "createdAt": "2023-12-20T17:59:31.000Z"
- },
- {
- "id": "65832b82ed842400074a0c6f",
- "text": [
- {
- "text": [
- "I need to talk to someone right now"
- ]
- }
- ],
- "intentID": "60gy3iks",
- "language": "en-us",
- "createdAt": "2023-12-20T17:59:31.000Z"
- },
- {
- "id": "65832b82ed842400074a0c70",
- "text": [
- {
- "text": [
- "I want to speak with a customer service representative"
- ]
- }
- ],
- "intentID": "60gy3iks",
- "language": "en-us",
- "createdAt": "2023-12-20T17:59:31.000Z"
- },
- {
- "id": "65832b82ed842400074a0c71",
- "text": [
- {
- "text": [
- "I need to converse with a representative"
- ]
- }
- ],
- "intentID": "60gy3iks",
- "language": "en-us",
- "createdAt": "2023-12-20T17:59:31.000Z"
- }
- ],
- "requiredEntities": [],
- "folders": [],
- "responses": [
- {
- "id": "65832b82ed842400074a0c7a",
- "name": "Required Entity's Reprompt",
- "createdByID": 10585,
- "folderID": null,
- "createdAt": "2023-12-20T17:59:31.000Z",
- "updatedAt": "2023-12-20T17:59:31.000Z",
- "updatedByID": 10585
- },
- {
- "id": "65832b82ed842400074a0c81",
- "name": "Required Entity's Reprompt",
- "createdByID": 10585,
- "folderID": null,
- "createdAt": "2023-12-20T17:59:31.000Z",
- "updatedAt": "2023-12-20T17:59:31.000Z",
- "updatedByID": 10585
- }
- ],
- "responseVariants": [
- {
- "id": "65832b82ed842400074a0c7c",
- "conditionID": null,
- "discriminatorID": "65832b82ed842400074a0c7b",
- "attachmentOrder": [],
- "text": [
- {
- "text": [
- "What plugin are you trying to activate?"
- ]
- }
- ],
- "speed": null,
- "cardLayout": "carousel",
- "createdAt": "2023-12-20T17:59:31.000Z",
- "type": "text"
- },
- {
- "id": "65832b82ed842400074a0c83",
- "conditionID": null,
- "discriminatorID": "65832b82ed842400074a0c82",
- "attachmentOrder": [],
- "text": [
- {
- "text": [
- "That's great, what do you want on the pizza? we have pepperoni or hawaiian as options."
- ]
- }
- ],
- "speed": null,
- "cardLayout": "carousel",
- "createdAt": "2023-12-20T17:59:31.000Z",
- "type": "text"
- }
- ],
- "responseAttachments": [],
- "responseDiscriminators": [
- {
- "id": "65832b82ed842400074a0c7b",
- "channel": "default",
- "language": "en-us",
- "responseID": "65832b82ed842400074a0c7a",
- "variantOrder": [
- "65832b82ed842400074a0c7c"
- ],
- "createdAt": "2023-12-20T17:59:31.000Z"
- },
- {
- "id": "65832b82ed842400074a0c82",
- "channel": "default",
- "language": "en-us",
- "responseID": "65832b82ed842400074a0c81",
- "variantOrder": [
- "65832b82ed842400074a0c83"
- ],
- "createdAt": "2023-12-20T17:59:31.000Z"
- }
- ],
- "variables": [
- {
- "id": "sessions",
- "name": "sessions",
- "createdByID": 10585,
- "folderID": null,
- "color": "#515A63",
- "isArray": false,
- "isSystem": true,
- "datatype": "number",
- "description": "The number of times a particular user has opened the app.",
- "defaultValue": null,
- "createdAt": "2024-03-22T06:40:08.000Z",
- "updatedAt": "2024-03-22T06:40:08.000Z",
- "updatedByID": 10585
- },
- {
- "id": "user_id",
- "name": "user_id",
- "createdByID": 10585,
- "folderID": null,
- "color": "#515A63",
- "isArray": false,
- "isSystem": true,
- "datatype": "text",
- "description": "The user's unique ID.",
- "defaultValue": null,
- "createdAt": "2024-03-22T06:40:08.000Z",
- "updatedAt": "2024-03-22T06:40:08.000Z",
- "updatedByID": 10585
- },
- {
- "id": "timestamp",
- "name": "timestamp",
- "createdByID": 10585,
- "folderID": null,
- "color": "#515A63",
- "isArray": false,
- "isSystem": true,
- "datatype": "text",
- "description": "UNIX timestamp (number of seconds since January 1st, 1970 at UTC).",
- "defaultValue": null,
- "createdAt": "2024-03-22T06:40:08.000Z",
- "updatedAt": "2024-03-22T06:40:08.000Z",
- "updatedByID": 10585
- },
- {
- "id": "platform",
- "name": "platform",
- "createdByID": 10585,
- "folderID": null,
- "color": "#515A63",
- "isArray": false,
- "isSystem": true,
- "datatype": "text",
- "description": "The platform your agent is running on (e.g. \"voiceflow\").",
- "defaultValue": null,
- "createdAt": "2024-03-22T06:40:08.000Z",
- "updatedAt": "2024-03-22T06:40:08.000Z",
- "updatedByID": 10585
- },
- {
- "id": "locale",
- "name": "locale",
- "createdByID": 10585,
- "folderID": null,
- "color": "#515A63",
- "isArray": false,
- "isSystem": true,
- "datatype": "text",
- "description": "The locale of the user (eg. en-US, en-CA, it-IT, fr-FR, ...).",
- "defaultValue": null,
- "createdAt": "2024-03-22T06:40:08.000Z",
- "updatedAt": "2024-03-22T06:40:08.000Z",
- "updatedByID": 10585
- },
- {
- "id": "intent_confidence",
- "name": "intent_confidence",
- "createdByID": 10585,
- "folderID": null,
- "color": "#515A63",
- "isArray": false,
- "isSystem": true,
- "datatype": "number",
- "description": "The confidence interval (measured as a value from 0 to 100) for the most recently matched intent.",
- "defaultValue": null,
- "createdAt": "2024-03-22T06:40:08.000Z",
- "updatedAt": "2024-03-22T06:40:08.000Z",
- "updatedByID": 10585
- },
- {
- "id": "last_response",
- "name": "last_response",
- "createdByID": 10585,
- "folderID": null,
- "color": "#515A63",
- "isArray": false,
- "isSystem": true,
- "datatype": "text",
- "description": "The agent's last response (text/speak) in a string.",
- "defaultValue": null,
- "createdAt": "2024-03-22T06:40:08.000Z",
- "updatedAt": "2024-03-22T06:40:08.000Z",
- "updatedByID": 10585
- },
- {
- "id": "last_event",
- "name": "last_event",
- "createdByID": 10585,
- "folderID": null,
- "color": "#515A63",
- "isArray": false,
- "isSystem": true,
- "datatype": "any",
- "description": "The object containing the last event that the user client has triggered.",
- "defaultValue": null,
- "createdAt": "2024-03-22T06:40:08.000Z",
- "updatedAt": "2024-03-22T06:40:08.000Z",
- "updatedByID": 10585
- },
- {
- "id": "last_utterance",
- "name": "last_utterance",
- "createdByID": 10585,
- "folderID": null,
- "color": "#515A63",
- "isArray": false,
- "isSystem": true,
- "datatype": "text",
- "description": "The user's last utterance in a text string.",
- "defaultValue": null,
- "createdAt": "2024-03-22T06:40:08.000Z",
- "updatedAt": "2024-03-22T06:40:08.000Z",
- "updatedByID": 10585
- },
- {
- "id": "vf_memory",
- "name": "vf_memory",
- "createdByID": 10585,
- "folderID": null,
- "color": "#515A63",
- "isArray": false,
- "isSystem": true,
- "datatype": "text",
- "description": "Last 10 user inputs and agent responses in a string (e.g. \"agent: How can i help?\"\nuser: What's the weather today?).",
- "defaultValue": null,
- "createdAt": "2024-03-22T06:40:08.000Z",
- "updatedAt": "2024-03-22T06:40:08.000Z",
- "updatedByID": 10585
- },
- {
- "id": "vf_chunks",
- "name": "vf_chunks",
- "createdByID": 10585,
- "folderID": null,
- "color": "#515A63",
- "isArray": true,
- "isSystem": true,
- "datatype": "any",
- "description": "Dynamically stores the last chunks retrieved from the Knowledge Base whenever calling the KB from the canvas.",
- "defaultValue": null,
- "createdAt": "2024-03-22T06:40:08.000Z",
- "updatedAt": "2024-03-22T06:40:08.000Z",
- "updatedByID": 10585
- }
- ],
- "workflows": [],
- "attachments": [],
- "cardButtons": [],
- "functions": [],
- "functionPaths": [],
- "functionVariables": [],
- "project": {
- "name": "Live Agent Demo",
- "teamID": "NyEPoVenxR",
- "platform": "webchat",
- "type": "chat",
- "platformData": {
- "invocationName": "template project general"
- },
- "members": [],
- "linkType": "STRAIGHT",
- "image": "",
- "customThemes": [],
- "aiAssistSettings": {
- "aiPlayground": true
- },
- "_version": 1.2,
- "updatedBy": 10585,
- "creatorID": 10585,
- "apiPrivacy": "public",
- "_id": "660d79bc92a590da360b72fb",
- "updatedAt": "2024-04-03T16:04:20.867Z",
- "knowledgeBase": {
- "settings": {
- "chunkStrategy": {
- "type": "recursive_text_splitter",
- "size": 1200,
- "overlap": 200
- },
- "search": {
- "limit": 3,
- "metric": "IP"
- },
- "summarization": {
- "prompt": "",
- "mode": "prompt",
- "model": "claude-v1",
- "temperature": 0.1,
- "system": "You are an FAQ AI chat assistant. Information will be provided to help answer the user's questions. Always summarize your response to be as brief as possible and be extremely concise. Your responses should be fewer than a couple of sentences."
- }
- },
- "tags": {},
- "faqSets": {},
- "documents": {}
- },
- "devVersion": "660d79bc92a590da360b72fc",
- "liveVersion": "660d7a4416318fbc2bf9d07c"
- },
- "_version": "1.2",
- "variableStates": []
-}
\ No newline at end of file
diff --git a/examples/live-chat/index.html b/examples/live-chat/index.html
deleted file mode 100644
index 40d35f4e21..0000000000
--- a/examples/live-chat/index.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
- Example - Live Agent
-
-
-
-
-
-
-
diff --git a/examples/live-chat/package.json b/examples/live-chat/package.json
deleted file mode 100644
index 39a6934868..0000000000
--- a/examples/live-chat/package.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "name": "@voiceflow-example/live-chat",
- "version": "0.5.8",
- "private": true,
- "license": "MIT",
- "scripts": {
- "dev": "yarn g:run-p dev:app dev:server",
- "dev:app": "vite --force",
- "dev:server": "cd ../live-agent/server && yarn dev",
- "test:types": "yarn g:tsc --noEmit"
- },
- "prettier": "@voiceflow/prettier-config",
- "dependencies": {
- "@voiceflow/exception": "1.4.0",
- "@voiceflow/fetch": "1.5.2",
- "@voiceflow/react-chat": "workspace:*",
- "@voiceflow/slate-serializer": "1.4.2",
- "nanoevents": "8.0.0",
- "react": "18.2.0",
- "react-calendar": "4.3.0",
- "react-dom": "18.2.0",
- "regenerator-runtime": "0.13.11",
- "styled-components": "6.0.3",
- "ts-pattern": "4.3.0"
- },
- "devDependencies": {
- "@types/node": "20.12.7",
- "@types/react": "18.2.8",
- "@types/react-dom": "18.2.4",
- "vite": "4.3.9"
- },
- "volta": {
- "extends": "../../package.json"
- }
-}
diff --git a/examples/live-chat/shared/live-agent-platform.enum.ts b/examples/live-chat/shared/live-agent-platform.enum.ts
deleted file mode 100644
index 0fd2008aa0..0000000000
--- a/examples/live-chat/shared/live-agent-platform.enum.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export enum LiveAgentPlatform {
- INTERCOM = 'intercom',
-}
diff --git a/examples/live-chat/shared/socket-event.enum.ts b/examples/live-chat/shared/socket-event.enum.ts
deleted file mode 100644
index aebe8add44..0000000000
--- a/examples/live-chat/shared/socket-event.enum.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-export enum SocketEvent {
- // server-sent events
- LIVE_AGENT_CONNECT = 'live_agent.connect',
- LIVE_AGENT_DISCONNECT = 'live_agent.disconnect',
- LIVE_AGENT_MESSAGE = 'live_agent.message',
-
- // client-sent events
- USER_MESSAGE = 'user.message',
-}
diff --git a/examples/live-chat/src/config.ts b/examples/live-chat/src/config.ts
deleted file mode 100644
index 8387c573d9..0000000000
--- a/examples/live-chat/src/config.ts
+++ /dev/null
@@ -1,84 +0,0 @@
-import { ChatConfig } from '@voiceflow/react-chat';
-import type { ChatWidgetSettings } from '@voiceflow/react-chat/build/types';
-
-export const ASSISTANT: ChatWidgetSettings = {
- type: 'voice',
- chat: {
- voiceInput: true,
- voiceOutput: true,
- renderMode: 'widget',
- headerImage: {
- enabled: true,
- },
- agentImage: {
- enabled: true,
- },
- banner: {
- enabled: true,
- title: 'Your AI agent',
- description: 'How can I help you today?',
- },
- placeholderText: 'Message...',
- aiDisclaimer: {
- enabled: true,
- text: 'Generated by AI, double-check for accuracy.',
- },
- handoffToAgentImageURL: '',
- },
- common: {
- fontFamily: 'UCity Pro',
- launcher: {
- text: 'Your text',
- type: 'both',
- },
- poweredBy: true,
- footerLink: {
- enabled: true,
- },
- position: 'right',
- sideSpacing: '20px',
- bottomSpacing: '20px',
- primaryColor: {
- color: '#397DFF',
- palette: {
- 50: '#E7F5FD',
- 100: '#C6E4FB',
- 200: '#A2D2FA',
- 300: '#87BFFB',
- 400: '#659FFD',
- 500: '#397DFF',
- 600: '#2F68DB',
- 700: '#264EB4',
- 800: '#1C368E',
- 900: '#0F1E61',
- },
- },
- persistence: 'localStorage',
- },
- voice: {
- renderMode: 'full',
- content: {
- callToActionText: 'How can I help you?',
- startButtonText: 'Start a call',
- listeningText: 'Listening',
- talkingText: 'Talk to interrupt',
- endButtonText: 'End',
- },
- },
-
- stylesheet: '',
- extensions: [],
-};
-
-export const CONFIG = ChatConfig.parse({
- url: import.meta.env.VF_RUNTIME_URL ?? undefined,
- versionID: import.meta.env.VF_VERSION_ID,
- verify: {
- projectID: import.meta.env.VF_PROJECT_ID,
- versionID: import.meta.env.VF_VERSION_ID,
- },
- voice: {
- url: import.meta.env.VF_RUNTIME_API_URL,
- accessToken: import.meta.env.VF_ACCESS_TOKEN,
- },
-});
diff --git a/examples/live-chat/src/context.tsx b/examples/live-chat/src/context.tsx
deleted file mode 100644
index 9668585158..0000000000
--- a/examples/live-chat/src/context.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { RuntimeProvider as BaseProvider } from '@voiceflow/react-chat';
-import { createNanoEvents } from 'nanoevents';
-import { useMemo } from 'react';
-
-import { ASSISTANT, CONFIG } from './config';
-import { LiveAgent } from './traces/LiveAgent.trace';
-import type { LiveAgentEvents } from './use-live-agent.hook';
-import { useLiveAgent } from './use-live-agent.hook';
-
-export const RuntimeProvider: React.FC = ({ children }) => {
- const emitter = useMemo(() => createNanoEvents(), []);
- const liveAgent = useLiveAgent(emitter);
-
- return (
- emitter.emit('live_agent', platform))]}
- extend={liveAgent.extend}
- >
- {children}
-
- );
-};
diff --git a/examples/live-chat/src/main.tsx b/examples/live-chat/src/main.tsx
deleted file mode 100644
index ebe6cfa762..0000000000
--- a/examples/live-chat/src/main.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import 'regenerator-runtime/runtime';
-import '@voiceflow/react-chat/dist/style.css';
-
-import { ChatWidget } from '@voiceflow/react-chat';
-import { createRoot } from 'react-dom/client';
-
-import { RuntimeProvider } from './context';
-
-createRoot(document.getElementById('root')!).render(
-
-
-
-);
diff --git a/examples/live-chat/src/traces/LiveAgent.trace.ts b/examples/live-chat/src/traces/LiveAgent.trace.ts
deleted file mode 100644
index 15d88eae0c..0000000000
--- a/examples/live-chat/src/traces/LiveAgent.trace.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import type { TraceHandler } from '@voiceflow/react-chat';
-
-import type { LiveAgentPlatform } from '../../shared/live-agent-platform.enum';
-
-export const LiveAgent = (handoff: (platform: LiveAgentPlatform) => void): TraceHandler => ({
- canHandle: ({ type }) => (type as string) === 'talk_to_agent',
- handle: ({ context }, trace) => {
- handoff(trace.payload.platform);
- return context;
- },
-});
diff --git a/examples/live-chat/src/use-live-agent.hook.ts b/examples/live-chat/src/use-live-agent.hook.ts
deleted file mode 100644
index c37cdbbe30..0000000000
--- a/examples/live-chat/src/use-live-agent.hook.ts
+++ /dev/null
@@ -1,141 +0,0 @@
-import { FetchClient } from '@voiceflow/fetch';
-import type { RuntimeState } from '@voiceflow/react-chat';
-import { TurnType } from '@voiceflow/react-chat';
-import { serializeToText } from '@voiceflow/slate-serializer/text';
-import type { Emitter } from 'nanoevents';
-import { useMemo } from 'react';
-import { match } from 'ts-pattern';
-
-import type { LiveAgentPlatform } from '../shared/live-agent-platform.enum';
-import { SocketEvent } from '../shared/socket-event.enum';
-
-const SESSION_USER_ID_KEY = 'session:user_id';
-const SESSION_CONVERSATION_ID_KEY = 'session:conversation_id';
-
-export interface LiveAgentEvents {
- live_agent: (platform: LiveAgentPlatform) => void;
-}
-
-const createTurn = (type: Type) => ({
- type,
- id: `${Math.random()}-${Date.now()}`,
- timestamp: Date.now(),
-});
-
-const extractHistory = (api: RuntimeState['api']) =>
- api.getTurns().flatMap((turn) =>
- match(turn)
- .with({ type: TurnType.USER }, (turn) => ({ author: 'user', text: turn.message }))
- .with({ type: TurnType.SYSTEM }, (turn) =>
- turn.messages.flatMap((message) =>
- match(message)
- .with({ type: 'text' }, (message) => ({
- author: 'bot',
- text: typeof message.text === 'string' ? message.text : serializeToText(message.text),
- }))
- .otherwise(() => [])
- )
- )
- .exhaustive()
- );
-
-export const useLiveAgent = (emitter: Emitter) => {
- return useMemo(() => {
- const client = new FetchClient({ baseURL: 'http://localhost:9099' });
-
- let socket: WebSocket | null = null;
- let isEnabled = false;
-
- return {
- extend: (api: RuntimeState['api']): RuntimeState['api'] => {
- const addSystemTurn = (message: string) =>
- api.addTurn({
- ...createTurn(TurnType.SYSTEM),
- messages: [{ type: 'text', text: message }],
- });
-
- const addUserTurn = async (message: string) => {
- api.addTurn({ ...createTurn(TurnType.USER), message });
-
- socket?.send(JSON.stringify({ type: SocketEvent.USER_MESSAGE, data: { message } }));
- };
-
- const continueConversation = () => {
- socket?.close();
- socket = null;
- api.interact({ type: 'continue' });
- };
-
- const subscribeToConversation = (platform: LiveAgentPlatform, userID: string, conversationID: string) => {
- socket = new WebSocket(
- `ws://localhost:9099/${platform}/user/${userID}/conversation/${conversationID}/socket`
- );
- socket.onmessage = (message) => {
- const event = JSON.parse(message.data);
-
- match(event)
- .with({ type: SocketEvent.LIVE_AGENT_CONNECT }, () =>
- addSystemTurn(`connecting you with ${event.data.agent.name}`)
- )
- .with({ type: SocketEvent.LIVE_AGENT_MESSAGE }, () => addSystemTurn(event.data.message))
- .with({ type: SocketEvent.LIVE_AGENT_DISCONNECT }, () => {
- addSystemTurn(`${event.data.agent.name} has left the chat`);
- talkToRobot();
- })
- .otherwise(() => console.error('unexpected event', event));
- };
- };
-
- const talkToRobot = () => {
- isEnabled = false;
- addSystemTurn('Returning you to the Voiceflow bot...');
- continueConversation();
- };
-
- const talkToHuman = async (platform: LiveAgentPlatform) => {
- const isPlatformEnabled = await client
- .head(`/${platform}`)
- .then(() => true)
- .catch(() => false);
-
- if (!isPlatformEnabled) {
- addSystemTurn(
- `Sorry, it appears that ${platform} has not been configured. Make sure to create a "./server/.env" file that contains the environment variable "${platform.toUpperCase()}_TOKEN" and that the value is a valid ${platform} API key. You also should run the server located in "./server" with the "yarn dev" command.`
- );
- continueConversation();
- return;
- }
-
- isEnabled = true;
-
- const history = extractHistory(api);
- const prevUserID = sessionStorage.getItem(SESSION_USER_ID_KEY);
-
- const { userID, conversationID } = await client
- .post(`/${platform}/conversation`, {
- json: { userID: prevUserID, history },
- })
- .json();
-
- sessionStorage.setItem(SESSION_USER_ID_KEY, userID);
- sessionStorage.setItem(SESSION_CONVERSATION_ID_KEY, conversationID);
-
- subscribeToConversation(platform, userID, conversationID);
- };
-
- emitter.on('live_agent', talkToHuman);
-
- return {
- ...api,
- reply: (message) => {
- if (isEnabled) {
- return addUserTurn(message);
- }
-
- return api.reply(message);
- },
- };
- },
- };
- }, []);
-};
diff --git a/examples/live-chat/tsconfig.json b/examples/live-chat/tsconfig.json
deleted file mode 100644
index 7f19d575f3..0000000000
--- a/examples/live-chat/tsconfig.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "compilerOptions": {
- "target": "esnext",
- "module": "esnext",
- "moduleResolution": "node",
- "lib": ["dom"],
- "jsx": "react-jsx",
- "esModuleInterop": true,
- "forceConsistentCasingInFileNames": true,
- "strict": true,
- "skipLibCheck": true
- }
-}
diff --git a/examples/live-chat/types/env.d.ts b/examples/live-chat/types/env.d.ts
deleted file mode 100644
index bf6c2cdba4..0000000000
--- a/examples/live-chat/types/env.d.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-///
-
-interface ImportMetaEnv {
- readonly VF_PROJECT_ID: string;
- readonly VF_RUNTIME_URL: string;
- readonly VF_VERSION_ID: string;
- readonly VF_ACCESS_TOKEN: string;
- readonly VF_RUNTIME_API_URL: string;
-}
-
-interface ImportMeta {
- readonly env: ImportMetaEnv;
-}
diff --git a/examples/live-chat/vite.config.ts b/examples/live-chat/vite.config.ts
deleted file mode 100644
index f1e18bc803..0000000000
--- a/examples/live-chat/vite.config.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { defineConfig } from 'vite';
-
-export default defineConfig({
- build: {
- outDir: 'build',
- },
- define: {
- 'import.meta.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
- },
- envPrefix: 'VF_',
- server: {
- port: 3006,
- },
-});
diff --git a/package.json b/package.json
index e38eaae5b3..acbac0e93f 100644
--- a/package.json
+++ b/package.json
@@ -14,15 +14,13 @@
"workspaces": [
"packages/*",
"examples/*",
- "examples/live-agent/server",
- "apps/documentation"
+ "examples/live-agent/server"
],
"scripts": {
"build": "turbo run build:cmd",
"build:all": "yarn build",
"clean": "turbo run clean && rimraf node_modules",
"dev": "turbo run dev --no-cache --parallel --continue",
- "dev:chat": "NODE_ENV=development turbo run dev --no-cache --parallel --continue --filter=!react-chat --filter=!live-agent",
"lint": "run-p -c lint:eslint lint:prettier",
"local": "cd packages/react-chat; yarn local",
"lint:eslint": "yarn g:eslint",
diff --git a/packages/chat/.babelrc.json b/packages/chat/.babelrc.json
deleted file mode 100644
index f406f678e7..0000000000
--- a/packages/chat/.babelrc.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"]
-}
diff --git a/packages/chat/.dependency-cruiser.mjs b/packages/chat/.dependency-cruiser.mjs
deleted file mode 100644
index 60fb4aa01b..0000000000
--- a/packages/chat/.dependency-cruiser.mjs
+++ /dev/null
@@ -1,12 +0,0 @@
-import { createConfig } from '@voiceflow/dependency-cruiser-config';
-
-export default createConfig({
- allowTypeCycles: true,
- orphans: {
- ignore: [
- 'src/components/VoiceWidget/WaveformVisualizer.component.tsx',
- 'src/components/VoiceWidget/MovingGradient.component.tsx',
- 'src/components/VoiceWidget/MockVoiceWidgetImage.tsx',
- ],
- },
-});
diff --git a/packages/chat/.gitignore b/packages/chat/.gitignore
deleted file mode 100644
index 12b46b848a..0000000000
--- a/packages/chat/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/test-results/
diff --git a/packages/chat/.storybook/assets/fonts/ABCMaxiRound-Light.woff b/packages/chat/.storybook/assets/fonts/ABCMaxiRound-Light.woff
deleted file mode 100644
index 2384891e15..0000000000
Binary files a/packages/chat/.storybook/assets/fonts/ABCMaxiRound-Light.woff and /dev/null differ
diff --git a/packages/chat/.storybook/assets/fonts/ABCMaxiRound-Light.woff2 b/packages/chat/.storybook/assets/fonts/ABCMaxiRound-Light.woff2
deleted file mode 100644
index cbda6b13da..0000000000
Binary files a/packages/chat/.storybook/assets/fonts/ABCMaxiRound-Light.woff2 and /dev/null differ
diff --git a/packages/chat/.storybook/assets/fonts/UCityProWeb-Bold.woff b/packages/chat/.storybook/assets/fonts/UCityProWeb-Bold.woff
deleted file mode 100644
index 14bb018650..0000000000
Binary files a/packages/chat/.storybook/assets/fonts/UCityProWeb-Bold.woff and /dev/null differ
diff --git a/packages/chat/.storybook/assets/fonts/UCityProWeb-Bold.woff2 b/packages/chat/.storybook/assets/fonts/UCityProWeb-Bold.woff2
deleted file mode 100644
index a6bc5d1247..0000000000
Binary files a/packages/chat/.storybook/assets/fonts/UCityProWeb-Bold.woff2 and /dev/null differ
diff --git a/packages/chat/.storybook/assets/fonts/UCityProWeb-Regular.woff b/packages/chat/.storybook/assets/fonts/UCityProWeb-Regular.woff
deleted file mode 100644
index 88f2a66c5a..0000000000
Binary files a/packages/chat/.storybook/assets/fonts/UCityProWeb-Regular.woff and /dev/null differ
diff --git a/packages/chat/.storybook/assets/fonts/UCityProWeb-Regular.woff2 b/packages/chat/.storybook/assets/fonts/UCityProWeb-Regular.woff2
deleted file mode 100644
index 43f69dd5b7..0000000000
Binary files a/packages/chat/.storybook/assets/fonts/UCityProWeb-Regular.woff2 and /dev/null differ
diff --git a/packages/chat/.storybook/assets/fonts/UCityProWeb-Semibold.woff b/packages/chat/.storybook/assets/fonts/UCityProWeb-Semibold.woff
deleted file mode 100644
index 140ecb7ff0..0000000000
Binary files a/packages/chat/.storybook/assets/fonts/UCityProWeb-Semibold.woff and /dev/null differ
diff --git a/packages/chat/.storybook/assets/fonts/UCityProWeb-Semibold.woff2 b/packages/chat/.storybook/assets/fonts/UCityProWeb-Semibold.woff2
deleted file mode 100644
index 5da6b5df93..0000000000
Binary files a/packages/chat/.storybook/assets/fonts/UCityProWeb-Semibold.woff2 and /dev/null differ
diff --git a/packages/chat/.storybook/assets/fonts/fonts.css b/packages/chat/.storybook/assets/fonts/fonts.css
deleted file mode 100644
index 6c69fd0ca0..0000000000
--- a/packages/chat/.storybook/assets/fonts/fonts.css
+++ /dev/null
@@ -1,37 +0,0 @@
-@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@450&display=swap');
-
-@font-face {
- font-family: 'UCityProWeb';
- src:
- local('UCityProWeb'),
- url('./UCityProWeb-Regular.woff') format('woff'),
- url('./UCityProWeb-Regular.woff2') format('woff2');
- font-weight: 400;
-}
-
-@font-face {
- font-family: 'UCityProWeb';
- src:
- local('UCityProWeb'),
- url('./UCityProWeb-Semibold.woff') format('woff'),
- url('./UCityProWeb-Semibold.woff2') format('woff2');
- font-weight: 600;
-}
-
-@font-face {
- font-family: 'UCityProWeb';
- src:
- local('UCityProWeb'),
- url('./UCityProWeb-Bold.woff') format('woff'),
- url('./UCityProWeb-Bold.woff2') format('woff2');
- font-weight: 700;
-}
-
-@font-face {
- font-family: 'ABCMaxiRound';
- src:
- local('ABCMaxiRound-Light'),
- url('./ABCMaxiRound-Light.woff') format('woff'),
- url('./ABCMaxiRound-Light.woff') format('woff2');
- font-weight: 700;
-}
diff --git a/packages/chat/.storybook/main.ts b/packages/chat/.storybook/main.ts
deleted file mode 100644
index b5bcf33b71..0000000000
--- a/packages/chat/.storybook/main.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-/* eslint-disable sonarjs/prefer-single-boolean-return */
-import type { StorybookConfig } from '@storybook/react-vite';
-import { mergeConfig } from 'vite';
-import svgr from 'vite-plugin-svgr';
-
-import { createPlugins } from '../vite.widget.config';
-
-const config: StorybookConfig = {
- stories: ['../src/**/*.story.@(js|jsx|ts|tsx)'],
- addons: [
- '@storybook/addon-links',
- '@storybook/addon-essentials',
- '@storybook/addon-interactions',
- 'storybook-dark-mode',
- ],
- framework: '@storybook/react-vite',
- core: {
- builder: '@storybook/builder-vite',
- },
- typescript: {
- check: true,
- reactDocgen: 'react-docgen-typescript',
- reactDocgenTypescriptOptions: {
- shouldExtractLiteralValuesFromEnum: true,
- propFilter: (prop: { name: string; parent?: { fileName: string } }): boolean => {
- if (['ref', 'css'].includes(prop.name)) return false;
- if (prop.parent && /node_modules/.test(prop.parent.fileName)) return false;
-
- return true;
- },
- },
- },
-
- viteFinal: (config) => {
- return mergeConfig(config, {
- plugins: [...createPlugins(), svgr()],
- define: {
- __USE_SHADOW_ROOT__: false,
- },
- });
- },
-};
-
-export default config;
diff --git a/packages/chat/.storybook/preview-head.html b/packages/chat/.storybook/preview-head.html
deleted file mode 100644
index a73317e951..0000000000
--- a/packages/chat/.storybook/preview-head.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
diff --git a/packages/chat/.storybook/preview.tsx b/packages/chat/.storybook/preview.tsx
deleted file mode 100644
index e9307c3088..0000000000
--- a/packages/chat/.storybook/preview.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import 'regenerator-runtime/runtime';
-import './assets/fonts/fonts.css';
-
-import type { Preview } from '@storybook/react';
-
-const preview: Preview = {
- parameters: {
- controls: {
- matchers: {
- color: /(background|color)$/i,
- date: /Date$/,
- fontFamily: 'sans-serif',
- },
- },
- },
-};
-
-export default preview;
diff --git a/packages/chat/CHANGELOG.md b/packages/chat/CHANGELOG.md
deleted file mode 100644
index f109f0e97f..0000000000
--- a/packages/chat/CHANGELOG.md
+++ /dev/null
@@ -1,888 +0,0 @@
-# Change Log
-
-All notable changes to this project will be documented in this file.
-See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-
-# [2.31.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.30.2...@voiceflow/react-chat@2.31.0) (2025-01-13)
-
-### Features
-
-* add loading state to launcher with label (COR-4435) ([#523](https://github.com/voiceflow/react-chat/issues/523)) ([08fd1b2](https://github.com/voiceflow/react-chat/commit/08fd1b2a67b2e776fe1c9ffe16fdd315cc6dad65))
-* expose voice api (COR-4463) ([#524](https://github.com/voiceflow/react-chat/issues/524)) ([ed0befc](https://github.com/voiceflow/react-chat/commit/ed0befc1da00ba0fdc0e69531b5e9821c0493719))
-
-## [2.30.2](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.30.1...@voiceflow/react-chat@2.30.2) (2025-01-10)
-
-### Bug Fixes
-
-* hide/show chat callbacks (DSN-2664) ([#514](https://github.com/voiceflow/react-chat/issues/514)) ([c183dad](https://github.com/voiceflow/react-chat/commit/c183dad69d9e91cf2aa15092da12d6f8269d66a9))
-
-## [2.30.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.30.0...@voiceflow/react-chat@2.30.1) (2025-01-10)
-
-### Bug Fixes
-
-* fix loading indicator when chat ends (COR-4425) ([#512](https://github.com/voiceflow/react-chat/issues/512)) ([6ea3505](https://github.com/voiceflow/react-chat/commit/6ea35057d0d3aec9c6e8aee5d667d7ad8b2659d7))
-
-# [2.30.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.29.1...@voiceflow/react-chat@2.30.0) (2025-01-10)
-
-### Features
-
-* bump dtos interact (COR-4422) ([#510](https://github.com/voiceflow/react-chat/issues/510)) ([6d10023](https://github.com/voiceflow/react-chat/commit/6d10023aa764c2d905fc7ccee5397b1782e11cd2))
-
-## [2.29.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.29.0...@voiceflow/react-chat@2.29.1) (2025-01-10)
-
-### Bug Fixes
-
-* change header image background (COR-4419) ([#508](https://github.com/voiceflow/react-chat/issues/508)) ([e19d970](https://github.com/voiceflow/react-chat/commit/e19d97058e8d216d5e7ccd6d5c1ddfa5a335a22b))
-
-# [2.29.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.28.0...@voiceflow/react-chat@2.29.0) (2025-01-08)
-
-### Features
-
-* add disabled and loading states to launcher (COR-4421) ([#503](https://github.com/voiceflow/react-chat/issues/503)) ([af83dbf](https://github.com/voiceflow/react-chat/commit/af83dbf6249a320f69cd365b09a1e037770acfdb))
-
-# [2.28.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.27.0...@voiceflow/react-chat@2.28.0) (2025-01-08)
-
-### Features
-
-* unsubscribe from all services on end conversation (COR-4408) ([#500](https://github.com/voiceflow/react-chat/issues/500)) ([faf691f](https://github.com/voiceflow/react-chat/commit/faf691f5b53cd95e56a9a51811f6518a4b9db4c9))
-
-# [2.27.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.26.0...@voiceflow/react-chat@2.27.0) (2025-01-08)
-
-### Features
-
-* expose widget settings type (COR-4405) ([#498](https://github.com/voiceflow/react-chat/issues/498)) ([51b719d](https://github.com/voiceflow/react-chat/commit/51b719d49e4827dd1c122787bfe513c803d95761))
-
-# [2.26.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.25.1...@voiceflow/react-chat@2.26.0) (2025-01-07)
-
-### Features
-
-* update voice widget (COR-4323) ([#482](https://github.com/voiceflow/react-chat/issues/482)) ([cfc70e5](https://github.com/voiceflow/react-chat/commit/cfc70e52061ad764017d7fe19fbadb8044fed0c1))
-
-## [2.25.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.25.0...@voiceflow/react-chat@2.25.1) (2025-01-07)
-
-### Bug Fixes
-
-* really minor ui issues (COR-4380, COR-4177) ([#490](https://github.com/voiceflow/react-chat/issues/490)) ([795f259](https://github.com/voiceflow/react-chat/commit/795f259b08ba15a02e756659d2c64ee8b843b3be))
-
-# [2.25.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.24.1...@voiceflow/react-chat@2.25.0) (2025-01-07)
-
-### Features
-
-* bump dto interact (COR-4274) ([#478](https://github.com/voiceflow/react-chat/issues/478)) ([8ac190d](https://github.com/voiceflow/react-chat/commit/8ac190d1f45df9c9f84e5df3eb9759ad75c21b25))
-
-## [2.24.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.24.0...@voiceflow/react-chat@2.24.1) (2025-01-03)
-
-### Bug Fixes
-
-* carousel hitbox edges fix (COR-4364) ([#486](https://github.com/voiceflow/react-chat/issues/486)) ([eb119f0](https://github.com/voiceflow/react-chat/commit/eb119f0aaa94065196c130cb3da26299cc6fbdbd))
-
-# [2.24.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.23.0...@voiceflow/react-chat@2.24.0) (2025-01-03)
-
-### Features
-
-* change padding on welcome banner (COR-4248) ([#479](https://github.com/voiceflow/react-chat/issues/479)) ([f186c2e](https://github.com/voiceflow/react-chat/commit/f186c2e6f08d188772f81c364b57fd3bd8f8865e))
-* make launcher image undraggable (COR-4295) ([#480](https://github.com/voiceflow/react-chat/issues/480)) ([4327a42](https://github.com/voiceflow/react-chat/commit/4327a42c5587a743708b0227734c63fa73407eb5))
-
-# [2.23.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.22.2...@voiceflow/react-chat@2.23.0) (2024-12-18)
-
-### Features
-
-* add animations to proactive messages (COR-4271) ([#471](https://github.com/voiceflow/react-chat/issues/471)) ([04c0363](https://github.com/voiceflow/react-chat/commit/04c0363ac04ec34147941beef3443643e7e3ba6b))
-
-## [2.22.2](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.22.1...@voiceflow/react-chat@2.22.2) (2024-12-18)
-
-### Bug Fixes
-
-* launcher spacing to chat (COR-4256) ([#472](https://github.com/voiceflow/react-chat/issues/472)) ([7cd52c4](https://github.com/voiceflow/react-chat/commit/7cd52c457ec0756b0a22ff808b1fa8aef2c55af6))
-
-## [2.22.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.22.0...@voiceflow/react-chat@2.22.1) (2024-12-17)
-
-**Note:** Version bump only for package @voiceflow/react-chat
-
-# [2.22.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.21.2...@voiceflow/react-chat@2.22.0) (2024-12-16)
-
-### Features
-
-* show default banner image (COR-4235) ([#466](https://github.com/voiceflow/react-chat/issues/466)) ([ed42b9c](https://github.com/voiceflow/react-chat/commit/ed42b9c1a68ea6b8dd5a8105f4d3f6b42c3c8ea4))
-
-## [2.21.2](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.21.1...@voiceflow/react-chat@2.21.2) (2024-12-16)
-
-### Bug Fixes
-
-* Launcher with label only spacing (COR-4241) ([#464](https://github.com/voiceflow/react-chat/issues/464)) ([3e0ba57](https://github.com/voiceflow/react-chat/commit/3e0ba57c526086927936d3bde946b581df516d5f))
-
-## [2.21.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.21.0...@voiceflow/react-chat@2.21.1) (2024-12-13)
-
-### Bug Fixes
-
-* actually pass in the disclaimer props (COR-4228) ([#462](https://github.com/voiceflow/react-chat/issues/462)) ([120ea01](https://github.com/voiceflow/react-chat/commit/120ea01aac0745b65989409cd8e33f908a898312))
-
-# [2.21.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.20.0...@voiceflow/react-chat@2.21.0) (2024-12-13)
-
-### Features
-
-* sync some missing settings (COR-4228) ([#458](https://github.com/voiceflow/react-chat/issues/458)) ([9dc48da](https://github.com/voiceflow/react-chat/commit/9dc48daa887280fe49b577eef1dc43ee5294a586))
-
-# [2.20.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.19.0...@voiceflow/react-chat@2.20.0) (2024-12-12)
-
-### Features
-
-* update widget when settings are updated (COR-4159) ([#456](https://github.com/voiceflow/react-chat/issues/456)) ([690b0f1](https://github.com/voiceflow/react-chat/commit/690b0f103f2aa56f2d24eb76119d006699c0aaa0))
-
-# [2.19.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.18.0...@voiceflow/react-chat@2.19.0) (2024-12-12)
-
-### Features
-
-* mobile & responsiveness adjustments (COR-4185) ([#448](https://github.com/voiceflow/react-chat/issues/448)) ([392bee9](https://github.com/voiceflow/react-chat/commit/392bee9a9cdf4720274bedadb60d4e69cd568c34))
-
-# [2.18.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.17.2...@voiceflow/react-chat@2.18.0) (2024-12-12)
-
-### Features
-
-* Google Font Support (DSN-2621) ([#447](https://github.com/voiceflow/react-chat/issues/447)) ([eb94f97](https://github.com/voiceflow/react-chat/commit/eb94f97c0e876de2263b563f93719f20693b06d0))
-
-## [2.17.2](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.17.1...@voiceflow/react-chat@2.17.2) (2024-12-12)
-
-### Bug Fixes
-
-* Launcher spacing, icon (DSN-2616) ([#442](https://github.com/voiceflow/react-chat/issues/442)) ([71c68c4](https://github.com/voiceflow/react-chat/commit/71c68c434a04bf5da226898d3aafb0aee5630835))
-
-## [2.17.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.17.0...@voiceflow/react-chat@2.17.1) (2024-12-12)
-
-### Bug Fixes
-
-* make footer link optionally just text (DSN-2613) ([#434](https://github.com/voiceflow/react-chat/issues/434)) ([d1b80d9](https://github.com/voiceflow/react-chat/commit/d1b80d98c156b3fba81ded4de529a0f79bdce3ef))
-
-# [2.17.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.16.2...@voiceflow/react-chat@2.17.0) (2024-12-11)
-
-### Features
-
-* adjust popover height by content (COR-4186) ([#436](https://github.com/voiceflow/react-chat/issues/436)) ([98c12c4](https://github.com/voiceflow/react-chat/commit/98c12c434c1654402dbbd99a373fd6ff22eb4bf7))
-* default launcher icon (COR-4181) ([#439](https://github.com/voiceflow/react-chat/issues/439)) ([e162f16](https://github.com/voiceflow/react-chat/commit/e162f167cc1cd505a1e883604530c4463cd2cff1))
-
-## [2.16.2](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.16.1...@voiceflow/react-chat@2.16.2) (2024-12-11)
-
-### Bug Fixes
-
-* adjust placeholder font size (COR-4169) ([#437](https://github.com/voiceflow/react-chat/issues/437)) ([182ab0c](https://github.com/voiceflow/react-chat/commit/182ab0c401ac39853aafa13a4c4a50471b1fe4d4))
-
-## [2.16.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.16.0...@voiceflow/react-chat@2.16.1) (2024-12-11)
-
-### Bug Fixes
-
-* adjust feedback buttons (COR-4173) ([#438](https://github.com/voiceflow/react-chat/issues/438)) ([364795f](https://github.com/voiceflow/react-chat/commit/364795fd4daaa4b9d76ee46c21ee6b2524dd2455))
-
-# [2.16.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.15.1...@voiceflow/react-chat@2.16.0) (2024-12-09)
-
-### Features
-
-* remove audio output widget from header (DSN-000) ([#432](https://github.com/voiceflow/react-chat/issues/432)) ([5c31e5e](https://github.com/voiceflow/react-chat/commit/5c31e5e4c3b81d39a9d0c339021690ed55048222))
-
-## [2.15.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.15.0...@voiceflow/react-chat@2.15.1) (2024-12-09)
-
-### Bug Fixes
-
-* animation timing consistency (DSN-2598) ([#429](https://github.com/voiceflow/react-chat/issues/429)) ([6f93399](https://github.com/voiceflow/react-chat/commit/6f9339969c03c59901ff0dfc0a0429383bf75a9f))
-
-# [2.15.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.14.0...@voiceflow/react-chat@2.15.0) (2024-12-09)
-
-### Features
-
-* show feedback buttons on last text message (COR-4153) ([#428](https://github.com/voiceflow/react-chat/issues/428)) ([a7b5b1e](https://github.com/voiceflow/react-chat/commit/a7b5b1ea9703628870f71219a52660c4f024f888))
-
-# [2.14.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.13.1...@voiceflow/react-chat@2.14.0) (2024-12-09)
-
-### Bug Fixes
-
-* spacing for cards with only buttons (COR-2603) ([#425](https://github.com/voiceflow/react-chat/issues/425)) ([4418099](https://github.com/voiceflow/react-chat/commit/4418099a926c7d541f05712a688539420b400311))
-
-### Features
-
-* Improve Launcher w/ Label animations (DSN-2522) ([#424](https://github.com/voiceflow/react-chat/issues/424)) ([40e4512](https://github.com/voiceflow/react-chat/commit/40e451219eee93641a878ad2529fec9ef60d2b74))
-
-## [2.13.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.13.0...@voiceflow/react-chat@2.13.1) (2024-12-06)
-
-### Bug Fixes
-
-* limit footer link space (COR-4140) ([#422](https://github.com/voiceflow/react-chat/issues/422)) ([926d9b3](https://github.com/voiceflow/react-chat/commit/926d9b3da3f65afdb7a748949059f60a1bb5319d))
-
-# [2.13.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.12.4...@voiceflow/react-chat@2.13.0) (2024-12-06)
-
-### Features
-
-* show default avatar from cdn (COR-0000) ([#411](https://github.com/voiceflow/react-chat/issues/411)) ([ced7ce8](https://github.com/voiceflow/react-chat/commit/ced7ce8f41b05e691448edebbd69db8182f4d109))
-
-## [2.12.4](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.12.3...@voiceflow/react-chat@2.12.4) (2024-12-06)
-
-### Bug Fixes
-
-* apply launcher settings (COR-0000) ([#419](https://github.com/voiceflow/react-chat/issues/419)) ([ff55766](https://github.com/voiceflow/react-chat/commit/ff55766cd677673c8b4346432e1d1135dc9808e3))
-
-## [2.12.3](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.12.2...@voiceflow/react-chat@2.12.3) (2024-12-06)
-
-### Bug Fixes
-
-* change entry animation (DSN-2521) ([#414](https://github.com/voiceflow/react-chat/issues/414)) ([0bf6f73](https://github.com/voiceflow/react-chat/commit/0bf6f73c6879fed18c569baef0e379758adc2393))
-
-## [2.12.2](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.12.1...@voiceflow/react-chat@2.12.2) (2024-12-06)
-
-### Bug Fixes
-
-* spacing of widget depending on launcher style (DSN-2597) ([#415](https://github.com/voiceflow/react-chat/issues/415)) ([d909a5e](https://github.com/voiceflow/react-chat/commit/d909a5ef541aa085c7b00c5d469edd49a1e5cf83))
-
-## [2.12.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.12.0...@voiceflow/react-chat@2.12.1) (2024-12-05)
-
-### Bug Fixes
-
-* pass ai generated message to message component (DSN-000) ([#406](https://github.com/voiceflow/react-chat/issues/406)) ([499d3b2](https://github.com/voiceflow/react-chat/commit/499d3b29ae87148f6dcc016629aba4dc99d6b57a))
-
-# [2.12.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.11.2...@voiceflow/react-chat@2.12.0) (2024-12-05)
-
-### Features
-
-* deploy image asset to cdn (COR-0000) ([#407](https://github.com/voiceflow/react-chat/issues/407)) ([1990586](https://github.com/voiceflow/react-chat/commit/1990586446f481e1ea9ee963caa31df897c93d05))
-
-## [2.11.2](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.11.1...@voiceflow/react-chat@2.11.2) (2024-12-04)
-
-### Bug Fixes
-
-* embedded view is always open (COR-0000) ([#404](https://github.com/voiceflow/react-chat/issues/404)) ([6871dfb](https://github.com/voiceflow/react-chat/commit/6871dfbcd2451ec930c06dc47e27a186ab884061))
-
-## [2.11.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.11.0...@voiceflow/react-chat@2.11.1) (2024-12-04)
-
-### Bug Fixes
-
-* Mobile height/width issues (DSN-2417) ([#394](https://github.com/voiceflow/react-chat/issues/394)) ([1c81dd7](https://github.com/voiceflow/react-chat/commit/1c81dd7b035b99e468107a234cf5e2cf3012a07f))
-
-# [2.11.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.10.0...@voiceflow/react-chat@2.11.0) (2024-12-04)
-
-### Features
-
-* styling proactive messages (COR-0000) ([#397](https://github.com/voiceflow/react-chat/issues/397)) ([c2ab9a0](https://github.com/voiceflow/react-chat/commit/c2ab9a09d92779082e9ca63f0800aa668ea54688))
-
-# [2.10.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.9.1...@voiceflow/react-chat@2.10.0) (2024-12-03)
-
-### Features
-
-* add popover modality (COR-0000) ([#398](https://github.com/voiceflow/react-chat/issues/398)) ([c2a225d](https://github.com/voiceflow/react-chat/commit/c2a225d7137620612fbe97f4a02ffe139ff56234))
-
-## [2.9.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.9.0...@voiceflow/react-chat@2.9.1) (2024-12-03)
-
-### Bug Fixes
-
-* pass hasEnded prop to footer (COR-0000) ([#399](https://github.com/voiceflow/react-chat/issues/399)) ([41dbcc7](https://github.com/voiceflow/react-chat/commit/41dbcc71a5c6bfb00e8f5298955264769de479e6))
-
-# [2.9.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.8.1...@voiceflow/react-chat@2.9.0) (2024-12-03)
-
-### Bug Fixes
-
-* remove margin from first/last p elements (COR-0000) ([#387](https://github.com/voiceflow/react-chat/issues/387)) ([d77433f](https://github.com/voiceflow/react-chat/commit/d77433f66ecb8cd88ae7b5cf89b501e6e78fb95a))
-
-### Features
-
-* use new WidgetSettings object for chat configuration ([#376](https://github.com/voiceflow/react-chat/issues/376)) ([43ebd19](https://github.com/voiceflow/react-chat/commit/43ebd19bf4e8d31fbddd8c39a05335d25056ad31))
-
-## [2.8.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.8.0...@voiceflow/react-chat@2.8.1) (2024-12-03)
-
-### Bug Fixes
-
-* move feedback buttons with carousel (COR-4091) ([#386](https://github.com/voiceflow/react-chat/issues/386)) ([4fe7b4f](https://github.com/voiceflow/react-chat/commit/4fe7b4f4bafccb02c9ac348b4bad014da61218d6))
-* scroll down button position on chat end (COR-4092) ([#388](https://github.com/voiceflow/react-chat/issues/388)) ([b3c0154](https://github.com/voiceflow/react-chat/commit/b3c01542df29f2b5904ae96d098bdd3f5dfdc3bb))
-
-# [2.8.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.7.2...@voiceflow/react-chat@2.8.0) (2024-11-28)
-
-### Bug Fixes
-
-* copy icon transitions when clicked (DSN-2583) ([#374](https://github.com/voiceflow/react-chat/issues/374)) ([761f7b3](https://github.com/voiceflow/react-chat/commit/761f7b37b71df1550639ffadfb108b83a4217a27))
-* paragraph spacing (DSN-2582) ([#377](https://github.com/voiceflow/react-chat/issues/377)) ([1ed7cfb](https://github.com/voiceflow/react-chat/commit/1ed7cfb0a7d999a86ebb262b88b37abd0b4058ae))
-
-### Features
-
-* Audio input button transition (DSN-2581) ([#375](https://github.com/voiceflow/react-chat/issues/375)) ([19c6207](https://github.com/voiceflow/react-chat/commit/19c6207801822c146320c335a938a60f143b4ad8))
-
-## [2.7.2](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.7.1...@voiceflow/react-chat@2.7.2) (2024-11-28)
-
-### Bug Fixes
-
-* Launcher hitbox and entry animation (DSN-2523) ([#373](https://github.com/voiceflow/react-chat/issues/373)) ([a873882](https://github.com/voiceflow/react-chat/commit/a873882e22867bb6bdfb79d298ab309838d6e004))
-
-## [2.7.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.7.0...@voiceflow/react-chat@2.7.1) (2024-11-28)
-
-### Bug Fixes
-
-* Entry Animation (DSN-2566) ([#372](https://github.com/voiceflow/react-chat/issues/372)) ([c8d1c9e](https://github.com/voiceflow/react-chat/commit/c8d1c9e77df6aaa2b480af5a284fd4ea48b7b8d7))
-
-# [2.7.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.6.4...@voiceflow/react-chat@2.7.0) (2024-11-27)
-
-### Features
-
-* expose chat container (DX-000) ([#352](https://github.com/voiceflow/react-chat/issues/352)) ([8863615](https://github.com/voiceflow/react-chat/commit/88636157292c4cf28b8047a9da68c31a82d65b30))
-
-## [2.6.4](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.6.3...@voiceflow/react-chat@2.6.4) (2024-11-26)
-
-### Bug Fixes
-
-* limit the width of user messages (COR-0000) ([#367](https://github.com/voiceflow/react-chat/issues/367)) ([461ea70](https://github.com/voiceflow/react-chat/commit/461ea7028af9537fdd56e7219e60b0b35cd86e6a))
-
-## [2.6.3](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.6.2...@voiceflow/react-chat@2.6.3) (2024-11-26)
-
-### Bug Fixes
-
-* animation synced up (DSN-2567) ([#363](https://github.com/voiceflow/react-chat/issues/363)) ([4c40948](https://github.com/voiceflow/react-chat/commit/4c409481d2372af8e11f3859cf8a5f635fa2cf95))
-
-## [2.6.2](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.6.1...@voiceflow/react-chat@2.6.2) (2024-11-25)
-
-### Bug Fixes
-
-* dont jank when user starts new chat (COR-4010) ([#362](https://github.com/voiceflow/react-chat/issues/362)) ([dfab0ce](https://github.com/voiceflow/react-chat/commit/dfab0cea6baf283e9a52595fe1d816aad17b89bc))
-
-## [2.6.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.6.0...@voiceflow/react-chat@2.6.1) (2024-11-25)
-
-### Bug Fixes
-
-* glitches with MessageInput behavior (COR-4014) ([#359](https://github.com/voiceflow/react-chat/issues/359)) ([a66e842](https://github.com/voiceflow/react-chat/commit/a66e8426d12990a5bf156af28a40e10ffb08cf27))
-
-# [2.6.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.5.2...@voiceflow/react-chat@2.6.0) (2024-11-25)
-
-### Features
-
-* no bottom margin if list element is last in message (DSN-2562) ([#360](https://github.com/voiceflow/react-chat/issues/360)) ([625f7bf](https://github.com/voiceflow/react-chat/commit/625f7bf2c950b75b99c98df8be68ff71782aac48))
-
-## [2.5.2](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.5.1...@voiceflow/react-chat@2.5.2) (2024-11-25)
-
-### Bug Fixes
-
-* review updates (COR-0000) ([#350](https://github.com/voiceflow/react-chat/issues/350)) ([4856dd4](https://github.com/voiceflow/react-chat/commit/4856dd471d39cdb7391989be66788f803bf3281d))
-
-## [2.5.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.5.0...@voiceflow/react-chat@2.5.1) (2024-11-25)
-
-### Bug Fixes
-
-* appearence behaviour of feedback (DSN-2527) ([#354](https://github.com/voiceflow/react-chat/issues/354)) ([4efbbcb](https://github.com/voiceflow/react-chat/commit/4efbbcbecf4656ce0f3af591faf4d535a168f9e1))
-
-# [2.5.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.4.1...@voiceflow/react-chat@2.5.0) (2024-11-25)
-
-### Features
-
-* Copy improvements (DSN-2559) ([#347](https://github.com/voiceflow/react-chat/issues/347)) ([4eceddc](https://github.com/voiceflow/react-chat/commit/4eceddc13f8b31777430b449d9014366376e71fd))
-
-## [2.4.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.4.0...@voiceflow/react-chat@2.4.1) (2024-11-25)
-
-### Bug Fixes
-
-* avatar moves with Carousel cards (COR-0000) ([#349](https://github.com/voiceflow/react-chat/issues/349)) ([bb82258](https://github.com/voiceflow/react-chat/commit/bb822589699dbd0627be66c96581b1fc18782b3e))
-
-# [2.4.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.3.1...@voiceflow/react-chat@2.4.0) (2024-11-25)
-
-### Features
-
-* pass chat window prop to chat widget component to render custom chat window ([#348](https://github.com/voiceflow/react-chat/issues/348)) ([41f00ed](https://github.com/voiceflow/react-chat/commit/41f00ed7c0ce17d896d89edcd3c33a9e94fa1a6e))
-
-## [2.3.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.3.0...@voiceflow/react-chat@2.3.1) (2024-11-21)
-
-### Bug Fixes
-
-* Animation + Spacing improvements (DSN-000) ([#345](https://github.com/voiceflow/react-chat/issues/345)) ([1a69699](https://github.com/voiceflow/react-chat/commit/1a69699df1a0512306ed6f50cfaa759d04057449))
-
-# [2.3.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.2.5...@voiceflow/react-chat@2.3.0) (2024-11-20)
-
-### Features
-
-* Launcher revisions (DSN-2520) ([#303](https://github.com/voiceflow/react-chat/issues/303)) ([6f19cb5](https://github.com/voiceflow/react-chat/commit/6f19cb5e2d35b76768adc7f0f89cad76148e3684))
-* New Widget launch animation (DSN-2521) ([#322](https://github.com/voiceflow/react-chat/issues/322)) ([03fb0d9](https://github.com/voiceflow/react-chat/commit/03fb0d98a7a5b653f2af3100ae002192eea0a202))
-
-## [2.2.5](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.2.4...@voiceflow/react-chat@2.2.5) (2024-11-20)
-
-### Bug Fixes
-
-* show Prompt over scroll down button (COR-3947) ([#337](https://github.com/voiceflow/react-chat/issues/337)) ([87d829d](https://github.com/voiceflow/react-chat/commit/87d829dc4462028c670721e71179be5c942843f0))
-
-## [2.2.4](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.2.3...@voiceflow/react-chat@2.2.4) (2024-11-19)
-
-### Bug Fixes
-
-* adjust bottom spacer of chat messages (COR-3977) ([#338](https://github.com/voiceflow/react-chat/issues/338)) ([356f0e7](https://github.com/voiceflow/react-chat/commit/356f0e76cfb4d183d9085a97a0625b9a3f3bf83e))
-
-## [2.2.3](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.2.2...@voiceflow/react-chat@2.2.3) (2024-11-19)
-
-### Bug Fixes
-
-* Audio Input appearing and submission (DSN-2553) ([#332](https://github.com/voiceflow/react-chat/issues/332)) ([af233c8](https://github.com/voiceflow/react-chat/commit/af233c8274bdb773a9549d3030c0bbdc17916a20))
-* Message animation speed + checkmark colour (DSN-2555) ([#325](https://github.com/voiceflow/react-chat/issues/325)) ([eba9f80](https://github.com/voiceflow/react-chat/commit/eba9f809ac1afad2de9f013fc4899cc65d505ce5))
-* minor UI issues ([#326](https://github.com/voiceflow/react-chat/issues/326)) ([5be3f51](https://github.com/voiceflow/react-chat/commit/5be3f51e85fb16e4107690509a4dc90e3f993860))
-
-## [2.2.2](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.2.1...@voiceflow/react-chat@2.2.2) (2024-11-19)
-
-### Bug Fixes
-
-* carousel background against avatar (DSN-2538) ([#328](https://github.com/voiceflow/react-chat/issues/328)) ([9e601bc](https://github.com/voiceflow/react-chat/commit/9e601bc1647eea2ed39376b9f77a418ca53b757a))
-
-## [2.2.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.2.0...@voiceflow/react-chat@2.2.1) (2024-11-19)
-
-### Bug Fixes
-
-* wrap typing indicator with MessageContainer (COR-3952) ([#327](https://github.com/voiceflow/react-chat/issues/327)) ([d371598](https://github.com/voiceflow/react-chat/commit/d3715981abdc94dcefd203f2ce2862a51e350590))
-
-# [2.2.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.1.1...@voiceflow/react-chat@2.2.0) (2024-11-19)
-
-### Features
-
-* expose user response component (DX-000) ([#329](https://github.com/voiceflow/react-chat/issues/329)) ([9ec5685](https://github.com/voiceflow/react-chat/commit/9ec56853ff27efc592b3fef9b7acfe8922b4a203))
-
-## [2.1.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@2.1.0...@voiceflow/react-chat@2.1.1) (2024-11-18)
-
-### Bug Fixes
-
-* Chat Ended Spacing (DSN-2543) ([#323](https://github.com/voiceflow/react-chat/issues/323)) ([e975fd2](https://github.com/voiceflow/react-chat/commit/e975fd23fc84ff520fff9eb7900c5bad6f516708))
-
-# [2.1.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/react-chat@1.65.2...@voiceflow/react-chat@2.1.0) (2024-11-18)
-
-### Bug Fixes
-
-* add top margin to the loading state (DSN-2511) ([#284](https://github.com/voiceflow/react-chat/issues/284)) ([da6c2ce](https://github.com/voiceflow/react-chat/commit/da6c2ce19859a504b1825aaf8799a3e90c90a0bb))
-* add white background to carousel (DSN-2538) ([#308](https://github.com/voiceflow/react-chat/issues/308)) ([be4aa7c](https://github.com/voiceflow/react-chat/commit/be4aa7c30aa25a88abf05f4cae84f57c18ef737c))
-* Agent Message and Chat Docs (DSN-000) ([#277](https://github.com/voiceflow/react-chat/issues/277)) ([4293ddf](https://github.com/voiceflow/react-chat/commit/4293ddfc0878beeeadbaf1fdb0283eafa487fe42))
-* button reveal animation (DSN-2529) ([#315](https://github.com/voiceflow/react-chat/issues/315)) ([035d9c8](https://github.com/voiceflow/react-chat/commit/035d9c8face3f4ec716b8504c1d5c27dcccdb3f8))
-* button wrapping behaviour (DSN-2510) ([#280](https://github.com/voiceflow/react-chat/issues/280)) ([9a74dc7](https://github.com/voiceflow/react-chat/commit/9a74dc79eebf3bdd2521b5922807eda9202c8bc5))
-* conditionally executed hook (DSN-000) ([#298](https://github.com/voiceflow/react-chat/issues/298)) ([fc60962](https://github.com/voiceflow/react-chat/commit/fc609626ed167c937323040291c2d5cbc0a7c664))
-* default message for AI generated message (DSN-2504) ([#282](https://github.com/voiceflow/react-chat/issues/282)) ([fea80ca](https://github.com/voiceflow/react-chat/commit/fea80caefd6635e63153ba6389997612fca8992f))
-* Feedback fixes (DSN-2527) ([#306](https://github.com/voiceflow/react-chat/issues/306)) ([8626fa1](https://github.com/voiceflow/react-chat/commit/8626fa1316954486d7a24fa04bae9c3535873367))
-* fix inline buttons class and minor styling (COR-0000) ([#255](https://github.com/voiceflow/react-chat/issues/255)) ([38b1c1a](https://github.com/voiceflow/react-chat/commit/38b1c1a63af90bec1163491a5beeadd95ace4e9b))
-* font weight of headers should be 600 (DSN-2507) ([#283](https://github.com/voiceflow/react-chat/issues/283)) ([366b859](https://github.com/voiceflow/react-chat/commit/366b8598f52cd881054bf2d0f17300f13e24012c))
-* header actions (COR-3811) ([#278](https://github.com/voiceflow/react-chat/issues/278)) ([95cc945](https://github.com/voiceflow/react-chat/commit/95cc945f1f79c81da3932bbb0c1f8f2ad094b008))
-* lots of ui fixes ([#305](https://github.com/voiceflow/react-chat/issues/305)) ([ca192d2](https://github.com/voiceflow/react-chat/commit/ca192d2bb2c337641ac1a9d8ea7c3e405b662f0e))
-* message container and feedback button fixes (COR-0000) ([#317](https://github.com/voiceflow/react-chat/issues/317)) ([bac51a5](https://github.com/voiceflow/react-chat/commit/bac51a550357092a5d2e40a1cda37b09d0fc2394))
-* Mic button active state + dynamic border radius (DSN-2518) ([#302](https://github.com/voiceflow/react-chat/issues/302)) ([f902868](https://github.com/voiceflow/react-chat/commit/f9028689b6bb83b6658b1f9c489ff06c97a6fd64))
-* minor inline-buttons adjustment (COR-0000) ([#258](https://github.com/voiceflow/react-chat/issues/258)) ([ac3e92d](https://github.com/voiceflow/react-chat/commit/ac3e92d492743f91d582ac5bee95415f68608dfc))
-* place Scroll to bottom button in footer component (COR-3827) ([#288](https://github.com/voiceflow/react-chat/issues/288)) ([f583dac](https://github.com/voiceflow/react-chat/commit/f583dac07cecfcfb9b0200f1958967807dfe4d6b))
-* Random fixes (DSN-000) ([#309](https://github.com/voiceflow/react-chat/issues/309)) ([e8cdd6e](https://github.com/voiceflow/react-chat/commit/e8cdd6eeaba2075f28d8bd2443b85b3c98d0963e))
-* scroll to bottom button (COR-3903) ([#310](https://github.com/voiceflow/react-chat/issues/310)) ([67c14e4](https://github.com/voiceflow/react-chat/commit/67c14e46bcbc8c4c2783702139370b08ebe95396))
-* themed link on footer (DSN-2536) ([#307](https://github.com/voiceflow/react-chat/issues/307)) ([4aaa0b8](https://github.com/voiceflow/react-chat/commit/4aaa0b83c2ccb17356c01fab1d3a0752c01dd55c))
-* ui glitch (COR-0000) ([#311](https://github.com/voiceflow/react-chat/issues/311)) ([6d69cb9](https://github.com/voiceflow/react-chat/commit/6d69cb91ca925e624ee1b6aa555012ca72046d9d))
-* User Message Gap + Bottom Padding (DSN-2502) ([#289](https://github.com/voiceflow/react-chat/issues/289)) ([48d9906](https://github.com/voiceflow/react-chat/commit/48d990699e5a420ae163d95397107ce39f5229be))
-* user message text colour should be themed (DSN-2512) ([#279](https://github.com/voiceflow/react-chat/issues/279)) ([fbfbb41](https://github.com/voiceflow/react-chat/commit/fbfbb4125a113e6eb455150ab88b2d0dc13aea06))
-* widget width (DSN-2509) ([#281](https://github.com/voiceflow/react-chat/issues/281)) ([431b81c](https://github.com/voiceflow/react-chat/commit/431b81c654db39bc15d95942b1da5f0645f4d390))
-
-### Features
-
-* a few more examples to look at (COR-0000) ([#270](https://github.com/voiceflow/react-chat/issues/270)) ([ee4c6d9](https://github.com/voiceflow/react-chat/commit/ee4c6d9d361fddb7dd0c0b74906c5ea5eda747b1))
-* add 'Start new chat' button (COR-0000) ([#257](https://github.com/voiceflow/react-chat/issues/257)) ([d5e8c0e](https://github.com/voiceflow/react-chat/commit/d5e8c0e0b02c76592250528ba2c9f9c81c986cef))
-* add CarouselButton component (COR-3656) ([#228](https://github.com/voiceflow/react-chat/issues/228)) ([7d3a65e](https://github.com/voiceflow/react-chat/commit/7d3a65ea41a0ca5318ea6eccec5b3afe3abd8785))
-* add TypingIndicator to the docs (COR-0000) ([#276](https://github.com/voiceflow/react-chat/issues/276)) ([205e910](https://github.com/voiceflow/react-chat/commit/205e910f3b5672a7598ffb2e0682e2178d059b16))
-* adjust chat to work in embedded mode as well (COR-3851) ([#293](https://github.com/voiceflow/react-chat/issues/293)) ([cdcaaf9](https://github.com/voiceflow/react-chat/commit/cdcaaf97b98851068af74672f3d38ab98f0c72c2))
-* Animate in widget components (DSN-2530) ([#312](https://github.com/voiceflow/react-chat/issues/312)) ([d06153e](https://github.com/voiceflow/react-chat/commit/d06153eeb2588596a5479baa5743c09e87c761fb))
-* Chat for review on documentation (DSN-000) ([#265](https://github.com/voiceflow/react-chat/issues/265)) ([bbc3d4f](https://github.com/voiceflow/react-chat/commit/bbc3d4f225f0d9edc18f4214f01d49f52be713ab))
-* convert ChatWidget to vanilla-extract (COR-0000) ([#254](https://github.com/voiceflow/react-chat/issues/254)) ([277a914](https://github.com/voiceflow/react-chat/commit/277a914f92f90fbafa82d6b903b85eb02ac2d88f))
-* convert Image component to vanilla-extract (COR-0000) ([#245](https://github.com/voiceflow/react-chat/issues/245)) ([e8836c6](https://github.com/voiceflow/react-chat/commit/e8836c6f76b50eb117345abac6a2f95e0e83b661))
-* convert Proactive component (COR-3710) ([#249](https://github.com/voiceflow/react-chat/issues/249)) ([5616d10](https://github.com/voiceflow/react-chat/commit/5616d100885778604600f0a63b3b9356736055c9))
-* convert Prompt component (COR-0000) ([#246](https://github.com/voiceflow/react-chat/issues/246)) ([5d70e21](https://github.com/voiceflow/react-chat/commit/5d70e21b3d04e65090dc43caa91b845a48e4a448))
-* cross browser stuff (COR-3860) ([#301](https://github.com/voiceflow/react-chat/issues/301)) ([10587c3](https://github.com/voiceflow/react-chat/commit/10587c31a6c5e97687f0b0d0282bdf7c369bd785))
-* extract ScrollToBottom component (COR-0000) ([#251](https://github.com/voiceflow/react-chat/issues/251)) ([06dacbc](https://github.com/voiceflow/react-chat/commit/06dacbcac246d066d14304f2a9641b3f2b45cfad))
-* Feedback + Copy Button (DSN-2499) ([#290](https://github.com/voiceflow/react-chat/issues/290)) ([a0c4649](https://github.com/voiceflow/react-chat/commit/a0c4649eb0e8b53ef3321cb5f10b31ef593d31c3))
-* goodbye stitches, we'll always have react-chat (COR-0000) ([#264](https://github.com/voiceflow/react-chat/issues/264)) ([f866cb3](https://github.com/voiceflow/react-chat/commit/f866cb3a2da470d8a025458237664a5e9b528bf8))
-* Misc 💅 polish + fixes (DSN-000) ([#269](https://github.com/voiceflow/react-chat/issues/269)) ([0622974](https://github.com/voiceflow/react-chat/commit/0622974b43294fc477fd2899e5b2a861a406bc5b))
-* powered by Voiceflow is a link now (DSN-2505) ([#285](https://github.com/voiceflow/react-chat/issues/285)) ([7d4ea15](https://github.com/voiceflow/react-chat/commit/7d4ea15eefc9c5ce5c4c11c3aea8f3985df72ebc))
-* release next react-chat library (DSN-2545) ([#316](https://github.com/voiceflow/react-chat/issues/316)) ([65722df](https://github.com/voiceflow/react-chat/commit/65722dfb438bc918bfb4fbb33aa0fc7c730eac38))
-* Removing a lot of react-stitches usages (DSN-000) ([#263](https://github.com/voiceflow/react-chat/issues/263)) ([265124e](https://github.com/voiceflow/react-chat/commit/265124eef53e59fd79ea7001400c3c75191dedaf))
-* ui review for carousel component (COR-0000) ([#275](https://github.com/voiceflow/react-chat/issues/275)) ([b310606](https://github.com/voiceflow/react-chat/commit/b3106063f4ede9ff57f3fe2398ad4ae5b89edc7e))
-* ui review for footer (COR-3751) ([#273](https://github.com/voiceflow/react-chat/issues/273)) ([235debb](https://github.com/voiceflow/react-chat/commit/235debb51219f196867b146adf1395603fa7128b))
-* Widget Composition (DSN-000) ([#231](https://github.com/voiceflow/react-chat/issues/231)) ([2966da3](https://github.com/voiceflow/react-chat/commit/2966da31b6105e221729bc84f11e10a39ddc648c))
-* working on UserResponse component (COR-0000) ([#253](https://github.com/voiceflow/react-chat/issues/253)) ([5026d2f](https://github.com/voiceflow/react-chat/commit/5026d2f7aff2325f4af59093f34df89662c475c8))
-
-## [0.42.3](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.42.2...@voiceflow/chat@0.42.3) (2024-11-15)
-
-### Bug Fixes
-
-* button reveal animation (DSN-2529) ([#315](https://github.com/voiceflow/react-chat/issues/315)) ([035d9c8](https://github.com/voiceflow/react-chat/commit/035d9c8face3f4ec716b8504c1d5c27dcccdb3f8))
-
-## [0.42.2](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.42.1...@voiceflow/chat@0.42.2) (2024-11-15)
-
-### Bug Fixes
-
-* message container and feedback button fixes (COR-0000) ([#317](https://github.com/voiceflow/react-chat/issues/317)) ([bac51a5](https://github.com/voiceflow/react-chat/commit/bac51a550357092a5d2e40a1cda37b09d0fc2394))
-
-## [0.42.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.42.0...@voiceflow/chat@0.42.1) (2024-11-14)
-
-### Bug Fixes
-
-* Random fixes (DSN-000) ([#309](https://github.com/voiceflow/react-chat/issues/309)) ([e8cdd6e](https://github.com/voiceflow/react-chat/commit/e8cdd6eeaba2075f28d8bd2443b85b3c98d0963e))
-
-# [0.42.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.41.4...@voiceflow/chat@0.42.0) (2024-11-14)
-
-### Bug Fixes
-
-* scroll to bottom button (COR-3903) ([#310](https://github.com/voiceflow/react-chat/issues/310)) ([67c14e4](https://github.com/voiceflow/react-chat/commit/67c14e46bcbc8c4c2783702139370b08ebe95396))
-
-### Features
-
-* Animate in widget components (DSN-2530) ([#312](https://github.com/voiceflow/react-chat/issues/312)) ([d06153e](https://github.com/voiceflow/react-chat/commit/d06153eeb2588596a5479baa5743c09e87c761fb))
-
-## [0.41.4](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.41.3...@voiceflow/chat@0.41.4) (2024-11-14)
-
-### Bug Fixes
-
-* ui glitch (COR-0000) ([#311](https://github.com/voiceflow/react-chat/issues/311)) ([6d69cb9](https://github.com/voiceflow/react-chat/commit/6d69cb91ca925e624ee1b6aa555012ca72046d9d))
-
-## [0.41.3](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.41.2...@voiceflow/chat@0.41.3) (2024-11-13)
-
-### Bug Fixes
-
-* add white background to carousel (DSN-2538) ([#308](https://github.com/voiceflow/react-chat/issues/308)) ([be4aa7c](https://github.com/voiceflow/react-chat/commit/be4aa7c30aa25a88abf05f4cae84f57c18ef737c))
-* Feedback fixes (DSN-2527) ([#306](https://github.com/voiceflow/react-chat/issues/306)) ([8626fa1](https://github.com/voiceflow/react-chat/commit/8626fa1316954486d7a24fa04bae9c3535873367))
-* themed link on footer (DSN-2536) ([#307](https://github.com/voiceflow/react-chat/issues/307)) ([4aaa0b8](https://github.com/voiceflow/react-chat/commit/4aaa0b83c2ccb17356c01fab1d3a0752c01dd55c))
-
-## [0.41.2](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.41.1...@voiceflow/chat@0.41.2) (2024-11-13)
-
-### Bug Fixes
-
-* lots of ui fixes ([#305](https://github.com/voiceflow/react-chat/issues/305)) ([ca192d2](https://github.com/voiceflow/react-chat/commit/ca192d2bb2c337641ac1a9d8ea7c3e405b662f0e))
-
-## [0.41.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.41.0...@voiceflow/chat@0.41.1) (2024-11-12)
-
-### Bug Fixes
-
-* Mic button active state + dynamic border radius (DSN-2518) ([#302](https://github.com/voiceflow/react-chat/issues/302)) ([f902868](https://github.com/voiceflow/react-chat/commit/f9028689b6bb83b6658b1f9c489ff06c97a6fd64))
-
-# [0.41.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.40.2...@voiceflow/chat@0.41.0) (2024-11-12)
-
-### Features
-
-* cross browser stuff (COR-3860) ([#301](https://github.com/voiceflow/react-chat/issues/301)) ([10587c3](https://github.com/voiceflow/react-chat/commit/10587c31a6c5e97687f0b0d0282bdf7c369bd785))
-
-## [0.40.2](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.40.1...@voiceflow/chat@0.40.2) (2024-11-12)
-
-### Bug Fixes
-
-* User Message Gap + Bottom Padding (DSN-2502) ([#289](https://github.com/voiceflow/react-chat/issues/289)) ([48d9906](https://github.com/voiceflow/react-chat/commit/48d990699e5a420ae163d95397107ce39f5229be))
-
-## [0.40.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.40.0...@voiceflow/chat@0.40.1) (2024-11-12)
-
-### Bug Fixes
-
-* conditionally executed hook (DSN-000) ([#298](https://github.com/voiceflow/react-chat/issues/298)) ([fc60962](https://github.com/voiceflow/react-chat/commit/fc609626ed167c937323040291c2d5cbc0a7c664))
-
-# [0.40.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.39.0...@voiceflow/chat@0.40.0) (2024-11-11)
-
-### Features
-
-* Feedback + Copy Button (DSN-2499) ([#290](https://github.com/voiceflow/react-chat/issues/290)) ([a0c4649](https://github.com/voiceflow/react-chat/commit/a0c4649eb0e8b53ef3321cb5f10b31ef593d31c3))
-
-# [0.39.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.38.1...@voiceflow/chat@0.39.0) (2024-11-11)
-
-### Features
-
-* adjust chat to work in embedded mode as well (COR-3851) ([#293](https://github.com/voiceflow/react-chat/issues/293)) ([cdcaaf9](https://github.com/voiceflow/react-chat/commit/cdcaaf97b98851068af74672f3d38ab98f0c72c2))
-
-## [0.38.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.38.0...@voiceflow/chat@0.38.1) (2024-11-08)
-
-### Bug Fixes
-
-* button wrapping behaviour (DSN-2510) ([#280](https://github.com/voiceflow/react-chat/issues/280)) ([9a74dc7](https://github.com/voiceflow/react-chat/commit/9a74dc79eebf3bdd2521b5922807eda9202c8bc5))
-* place Scroll to bottom button in footer component (COR-3827) ([#288](https://github.com/voiceflow/react-chat/issues/288)) ([f583dac](https://github.com/voiceflow/react-chat/commit/f583dac07cecfcfb9b0200f1958967807dfe4d6b))
-
-# [0.38.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.37.4...@voiceflow/chat@0.38.0) (2024-11-08)
-
-### Features
-
-* add TypingIndicator to the docs (COR-0000) ([#276](https://github.com/voiceflow/react-chat/issues/276)) ([205e910](https://github.com/voiceflow/react-chat/commit/205e910f3b5672a7598ffb2e0682e2178d059b16))
-* powered by Voiceflow is a link now (DSN-2505) ([#285](https://github.com/voiceflow/react-chat/issues/285)) ([7d4ea15](https://github.com/voiceflow/react-chat/commit/7d4ea15eefc9c5ce5c4c11c3aea8f3985df72ebc))
-* ui review for footer (COR-3751) ([#273](https://github.com/voiceflow/react-chat/issues/273)) ([235debb](https://github.com/voiceflow/react-chat/commit/235debb51219f196867b146adf1395603fa7128b))
-
-## [0.37.4](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.37.3...@voiceflow/chat@0.37.4) (2024-11-08)
-
-### Bug Fixes
-
-* user message text colour should be themed (DSN-2512) ([#279](https://github.com/voiceflow/react-chat/issues/279)) ([fbfbb41](https://github.com/voiceflow/react-chat/commit/fbfbb4125a113e6eb455150ab88b2d0dc13aea06))
-
-## [0.37.3](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.37.2...@voiceflow/chat@0.37.3) (2024-11-07)
-
-### Bug Fixes
-
-* add top margin to the loading state (DSN-2511) ([#284](https://github.com/voiceflow/react-chat/issues/284)) ([da6c2ce](https://github.com/voiceflow/react-chat/commit/da6c2ce19859a504b1825aaf8799a3e90c90a0bb))
-* default message for AI generated message (DSN-2504) ([#282](https://github.com/voiceflow/react-chat/issues/282)) ([fea80ca](https://github.com/voiceflow/react-chat/commit/fea80caefd6635e63153ba6389997612fca8992f))
-* font weight of headers should be 600 (DSN-2507) ([#283](https://github.com/voiceflow/react-chat/issues/283)) ([366b859](https://github.com/voiceflow/react-chat/commit/366b8598f52cd881054bf2d0f17300f13e24012c))
-* widget width (DSN-2509) ([#281](https://github.com/voiceflow/react-chat/issues/281)) ([431b81c](https://github.com/voiceflow/react-chat/commit/431b81c654db39bc15d95942b1da5f0645f4d390))
-
-## [0.37.2](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.37.1...@voiceflow/chat@0.37.2) (2024-11-07)
-
-### Bug Fixes
-
-* header actions (COR-3811) ([#278](https://github.com/voiceflow/react-chat/issues/278)) ([95cc945](https://github.com/voiceflow/react-chat/commit/95cc945f1f79c81da3932bbb0c1f8f2ad094b008))
-
-## [0.37.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.37.0...@voiceflow/chat@0.37.1) (2024-11-06)
-
-### Bug Fixes
-
-* Agent Message and Chat Docs (DSN-000) ([#277](https://github.com/voiceflow/react-chat/issues/277)) ([4293ddf](https://github.com/voiceflow/react-chat/commit/4293ddfc0878beeeadbaf1fdb0283eafa487fe42))
-
-# [0.37.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.36.0...@voiceflow/chat@0.37.0) (2024-11-04)
-
-### Features
-
-* ui review for carousel component (COR-0000) ([#275](https://github.com/voiceflow/react-chat/issues/275)) ([b310606](https://github.com/voiceflow/react-chat/commit/b3106063f4ede9ff57f3fe2398ad4ae5b89edc7e))
-
-# [0.36.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.35.0...@voiceflow/chat@0.36.0) (2024-11-01)
-
-### Features
-
-* a few more examples to look at (COR-0000) ([#270](https://github.com/voiceflow/react-chat/issues/270)) ([ee4c6d9](https://github.com/voiceflow/react-chat/commit/ee4c6d9d361fddb7dd0c0b74906c5ea5eda747b1))
-
-# [0.35.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.34.1...@voiceflow/chat@0.35.0) (2024-10-31)
-
-### Features
-
-* Misc 💅 polish + fixes (DSN-000) ([#269](https://github.com/voiceflow/react-chat/issues/269)) ([0622974](https://github.com/voiceflow/react-chat/commit/0622974b43294fc477fd2899e5b2a861a406bc5b))
-
-## [0.34.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.34.0...@voiceflow/chat@0.34.1) (2024-10-31)
-
-**Note:** Version bump only for package @voiceflow/chat
-
-# [0.34.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.33.1...@voiceflow/chat@0.34.0) (2024-10-31)
-
-### Features
-
-* Chat for review on documentation (DSN-000) ([#265](https://github.com/voiceflow/react-chat/issues/265)) ([bbc3d4f](https://github.com/voiceflow/react-chat/commit/bbc3d4f225f0d9edc18f4214f01d49f52be713ab))
-
-## [0.33.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.33.0...@voiceflow/chat@0.33.1) (2024-10-31)
-
-**Note:** Version bump only for package @voiceflow/chat
-
-# [0.33.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.32.0...@voiceflow/chat@0.33.0) (2024-10-31)
-
-### Features
-
-* goodbye stitches, we'll always have react-chat (COR-0000) ([#264](https://github.com/voiceflow/react-chat/issues/264)) ([f866cb3](https://github.com/voiceflow/react-chat/commit/f866cb3a2da470d8a025458237664a5e9b528bf8))
-
-# [0.32.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.31.1...@voiceflow/chat@0.32.0) (2024-10-30)
-
-### Features
-
-* Removing a lot of react-stitches usages (DSN-000) ([#263](https://github.com/voiceflow/react-chat/issues/263)) ([265124e](https://github.com/voiceflow/react-chat/commit/265124eef53e59fd79ea7001400c3c75191dedaf))
-
-## [0.31.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.31.0...@voiceflow/chat@0.31.1) (2024-10-30)
-
-### Bug Fixes
-
-* minor inline-buttons adjustment (COR-0000) ([#258](https://github.com/voiceflow/react-chat/issues/258)) ([ac3e92d](https://github.com/voiceflow/react-chat/commit/ac3e92d492743f91d582ac5bee95415f68608dfc))
-
-# [0.31.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.30.0...@voiceflow/chat@0.31.0) (2024-10-29)
-
-### Features
-
-* add 'Start new chat' button (COR-0000) ([#257](https://github.com/voiceflow/react-chat/issues/257)) ([d5e8c0e](https://github.com/voiceflow/react-chat/commit/d5e8c0e0b02c76592250528ba2c9f9c81c986cef))
-
-# [0.30.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.29.0...@voiceflow/chat@0.30.0) (2024-10-28)
-
-### Bug Fixes
-
-* fix inline buttons class and minor styling (COR-0000) ([#255](https://github.com/voiceflow/react-chat/issues/255)) ([38b1c1a](https://github.com/voiceflow/react-chat/commit/38b1c1a63af90bec1163491a5beeadd95ace4e9b))
-
-### Features
-
-* convert Proactive component (COR-3710) ([#249](https://github.com/voiceflow/react-chat/issues/249)) ([5616d10](https://github.com/voiceflow/react-chat/commit/5616d100885778604600f0a63b3b9356736055c9))
-
-# [0.29.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.28.0...@voiceflow/chat@0.29.0) (2024-10-28)
-
-### Features
-
-* convert ChatWidget to vanilla-extract (COR-0000) ([#254](https://github.com/voiceflow/react-chat/issues/254)) ([277a914](https://github.com/voiceflow/react-chat/commit/277a914f92f90fbafa82d6b903b85eb02ac2d88f))
-
-# [0.28.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.27.0...@voiceflow/chat@0.28.0) (2024-10-28)
-
-### Features
-
-* working on UserResponse component (COR-0000) ([#253](https://github.com/voiceflow/react-chat/issues/253)) ([5026d2f](https://github.com/voiceflow/react-chat/commit/5026d2f7aff2325f4af59093f34df89662c475c8))
-
-# [0.27.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.26.1...@voiceflow/chat@0.27.0) (2024-10-28)
-
-### Features
-
-* extract ScrollToBottom component (COR-0000) ([#251](https://github.com/voiceflow/react-chat/issues/251)) ([06dacbc](https://github.com/voiceflow/react-chat/commit/06dacbcac246d066d14304f2a9641b3f2b45cfad))
-
-## [0.26.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.26.0...@voiceflow/chat@0.26.1) (2024-10-28)
-
-**Note:** Version bump only for package @voiceflow/chat
-
-# [0.26.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.25.1...@voiceflow/chat@0.26.0) (2024-10-25)
-
-### Features
-
-* convert Image component to vanilla-extract (COR-0000) ([#245](https://github.com/voiceflow/react-chat/issues/245)) ([e8836c6](https://github.com/voiceflow/react-chat/commit/e8836c6f76b50eb117345abac6a2f95e0e83b661))
-* convert Prompt component (COR-0000) ([#246](https://github.com/voiceflow/react-chat/issues/246)) ([5d70e21](https://github.com/voiceflow/react-chat/commit/5d70e21b3d04e65090dc43caa91b845a48e4a448))
-
-## [0.25.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.25.0...@voiceflow/chat@0.25.1) (2024-10-25)
-
-**Note:** Version bump only for package @voiceflow/chat
-
-# [0.25.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.24.0...@voiceflow/chat@0.25.0) (2024-10-24)
-
-### Features
-
-* add CarouselButton component (COR-3656) ([#228](https://github.com/voiceflow/react-chat/issues/228)) ([7d3a65e](https://github.com/voiceflow/react-chat/commit/7d3a65ea41a0ca5318ea6eccec5b3afe3abd8785))
-
-# [0.24.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.23.0...@voiceflow/chat@0.24.0) (2024-10-24)
-
-### Features
-
-* Widget Composition (DSN-000) ([#231](https://github.com/voiceflow/react-chat/issues/231)) ([2966da3](https://github.com/voiceflow/react-chat/commit/2966da31b6105e221729bc84f11e10a39ddc648c))
-
-# [0.23.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.22.0...@voiceflow/chat@0.23.0) (2024-10-22)
-
-### Features
-
-* add LinkPreview component (COR-3594) ([#222](https://github.com/voiceflow/react-chat/issues/222)) ([660b02f](https://github.com/voiceflow/react-chat/commit/660b02fea855e9c8a2e1c09c586c3bf8db8a8cc7))
-* add Primary/Secondary buttons to the docs for review (COR-3533) ([#226](https://github.com/voiceflow/react-chat/issues/226)) ([8df4f46](https://github.com/voiceflow/react-chat/commit/8df4f466a3bf418f2b96cddf9e64ebac5e1e4755))
-* aligning theme colors across components (COR-0000) ([#233](https://github.com/voiceflow/react-chat/issues/233)) ([ccf9dbb](https://github.com/voiceflow/react-chat/commit/ccf9dbb646a4dba8583e3c15b97567852750794b))
-
-# [0.22.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.21.0...@voiceflow/chat@0.22.0) (2024-10-17)
-
-### Features
-
-* touch ups for the launcher button (COR-0000) ([#221](https://github.com/voiceflow/react-chat/issues/221)) ([4175b8f](https://github.com/voiceflow/react-chat/commit/4175b8fd0fc20d86740c34635851ff6271a79fde))
-
-# [0.21.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.20.0...@voiceflow/chat@0.21.0) (2024-10-17)
-
-### Features
-
-* add Card component (COR-2149) ([#223](https://github.com/voiceflow/react-chat/issues/223)) ([1a4e1b8](https://github.com/voiceflow/react-chat/commit/1a4e1b8bcabe539cc5d71bbaabbb8e92e6e25f14))
-
-# [0.20.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.19.0...@voiceflow/chat@0.20.0) (2024-10-16)
-
-### Features
-
-* cleaning up (COR-0000) ([#218](https://github.com/voiceflow/react-chat/issues/218)) ([0fc8593](https://github.com/voiceflow/react-chat/commit/0fc8593d299dcffe6f0995b2d022f63b98ca403c))
-
-# [0.19.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.18.0...@voiceflow/chat@0.19.0) (2024-10-15)
-
-### Features
-
-* UserMessage (DX-2138) ([#213](https://github.com/voiceflow/react-chat/issues/213)) ([97fcc7b](https://github.com/voiceflow/react-chat/commit/97fcc7b1d806cbb430daf29157d5610396935841))
-
-# [0.18.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.17.0...@voiceflow/chat@0.18.0) (2024-10-15)
-
-### Features
-
-* WelcomeMessage (DX-2153) ([#214](https://github.com/voiceflow/react-chat/issues/214)) ([12d5b9d](https://github.com/voiceflow/react-chat/commit/12d5b9dfd8046bfe0d7f987674af39995a762ae0))
-
-# [0.17.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.16.1...@voiceflow/chat@0.17.0) (2024-10-11)
-
-### Features
-
-* add Header component (COR-3545) ([#215](https://github.com/voiceflow/react-chat/issues/215)) ([0a893b6](https://github.com/voiceflow/react-chat/commit/0a893b65f7634d7ffca622c77bcc62af4514490c))
-
-## [0.16.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.16.0...@voiceflow/chat@0.16.1) (2024-10-11)
-
-### Bug Fixes
-
-* lots o UI fixes (COR-0000) ([#216](https://github.com/voiceflow/react-chat/issues/216)) ([a267a7c](https://github.com/voiceflow/react-chat/commit/a267a7c5cfc899e5a79cb47f265f5b6b1eeeb7a0))
-
-# [0.16.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.15.0...@voiceflow/chat@0.16.0) (2024-10-11)
-
-### Features
-
-* Agent Message (DX-2415) ([#212](https://github.com/voiceflow/react-chat/issues/212)) ([9c599f6](https://github.com/voiceflow/react-chat/commit/9c599f618ade9aea29e866a5a0c9ee602ef78a8f))
-
-# [0.15.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.14.0...@voiceflow/chat@0.15.0) (2024-10-07)
-
-### Features
-
-* add Launcher button to the mix (COR-3541) ([#211](https://github.com/voiceflow/react-chat/issues/211)) ([4c23a31](https://github.com/voiceflow/react-chat/commit/4c23a3168deb21e8e08dd26713aaca882f7a1184))
-
-# [0.14.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.13.0...@voiceflow/chat@0.14.0) (2024-10-07)
-
-### Features
-
-* add Primary/Secondary buttons (COR-3533) ([#210](https://github.com/voiceflow/react-chat/issues/210)) ([d8ff4ff](https://github.com/voiceflow/react-chat/commit/d8ff4ff8bb3383e13d9aebec47e8e597efde6b61))
-
-# [0.13.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.12.0...@voiceflow/chat@0.13.0) (2024-10-04)
-
-### Features
-
-* add SendButton to docs (COR-0000) ([#207](https://github.com/voiceflow/react-chat/issues/207)) ([c952373](https://github.com/voiceflow/react-chat/commit/c952373e37458e0a17867b5f743cbaa434bac67a))
-
-# [0.12.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.11.0...@voiceflow/chat@0.12.0) (2024-10-04)
-
-### Features
-
-* adjust palette colors (COR-0000) ([#209](https://github.com/voiceflow/react-chat/issues/209)) ([16a443e](https://github.com/voiceflow/react-chat/commit/16a443e1b0cc7fb3308f81fbfd6098b2b0f10ead))
-
-# [0.11.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.10.0...@voiceflow/chat@0.11.0) (2024-10-04)
-
-### Features
-
-* add InlineButton to docs (COR-0000) ([#206](https://github.com/voiceflow/react-chat/issues/206)) ([a3f0596](https://github.com/voiceflow/react-chat/commit/a3f0596abb474252158ef13f6dfad80bc67b2fae))
-
-### Reverts
-
-* Revert "chore(release): publish --skip-ci" ([9c2e101](https://github.com/voiceflow/react-chat/commit/9c2e101ed74959ea1db75f29fa0276e3ebbd35e8))
-
-# [0.9.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.8.0...@voiceflow/chat@0.9.0) (2024-10-03)
-
-### Features
-
-* FeedbackButton (DX-2405) ([#200](https://github.com/voiceflow/react-chat/issues/200)) ([46752af](https://github.com/voiceflow/react-chat/commit/46752afca27a0b2b8388b3241cc9d2c130c84688))
-
-# [0.8.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.7.1...@voiceflow/chat@0.8.0) (2024-10-02)
-
-### Features
-
-* add Avatar component to docs (COR-3369) ([#199](https://github.com/voiceflow/react-chat/issues/199)) ([6dd7c26](https://github.com/voiceflow/react-chat/commit/6dd7c262e3c8014405b2e380bb6c465487c36b20))
-
-## [0.7.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.7.0...@voiceflow/chat@0.7.1) (2024-10-01)
-
-### Bug Fixes
-
-* export dist css file ([#196](https://github.com/voiceflow/react-chat/issues/196)) ([f3433b9](https://github.com/voiceflow/react-chat/commit/f3433b9db1e31fa531813f67ce52852cc6e032b0))
-
-# [0.7.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.6.0...@voiceflow/chat@0.7.0) (2024-10-01)
-
-### Features
-
-* add InlineButton component (COR-2143) ([#189](https://github.com/voiceflow/react-chat/issues/189)) ([6f9cf01](https://github.com/voiceflow/react-chat/commit/6f9cf0139a52c9f3c8efdba4232003b4d75c5e75))
-* rewrite Avatar component (COR-3369) ([#188](https://github.com/voiceflow/react-chat/issues/188)) ([b831ee8](https://github.com/voiceflow/react-chat/commit/b831ee84d244e79dafc7a26eebc6db81f91922f6))
-
-# [0.6.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.5.1...@voiceflow/chat@0.6.0) (2024-10-01)
-
-### Features
-
-* add Storybook configuration for chat package ([#185](https://github.com/voiceflow/react-chat/issues/185)) ([79a809c](https://github.com/voiceflow/react-chat/commit/79a809c5ca7596003701ff3f4bfc9a3536745c88))
-
-## [0.5.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.5.0...@voiceflow/chat@0.5.1) (2024-10-01)
-
-**Note:** Version bump only for package @voiceflow/chat
-
-# [0.5.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.4.0...@voiceflow/chat@0.5.0) (2024-10-01)
-
-### Features
-
-* add vanilla-extract to the new chat package (COR-3282) ([#183](https://github.com/voiceflow/react-chat/issues/183)) ([0816086](https://github.com/voiceflow/react-chat/commit/081608647896bdfdf832e61e580bcfcc25a3b93e))
-
-# [0.4.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.3.0...@voiceflow/chat@0.4.0) (2024-10-01)
-
-### Features
-
-* UI export to docs (DX-000) ([#193](https://github.com/voiceflow/react-chat/issues/193)) ([83d3ef9](https://github.com/voiceflow/react-chat/commit/83d3ef93390ff8d98681c9dec129133f21a8e6bd))
-
-# [0.3.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.2.0...@voiceflow/chat@0.3.0) (2024-09-27)
-
-### Features
-
-* add setOpen to the api (COR-000) ([#190](https://github.com/voiceflow/react-chat/issues/190)) ([a509a96](https://github.com/voiceflow/react-chat/commit/a509a96a132d9f0f2644293eb0d6cb9ebb40d6c1))
-
-# [0.2.0](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.1.1...@voiceflow/chat@0.2.0) (2024-09-25)
-
-### Features
-
-* add live-chat for the new chat package (COR-0000) ([#177](https://github.com/voiceflow/react-chat/issues/177)) ([ed3c0a9](https://github.com/voiceflow/react-chat/commit/ed3c0a9ab4a9b65b6473299f0dbaa3c2e4e1f41e))
-
-## [0.1.1](https://github.com/voiceflow/react-chat/compare/@voiceflow/chat@0.1.0...@voiceflow/chat@0.1.1) (2024-09-24)
-
-### Bug Fixes
-
-* fix lock file (COR-000) ([#180](https://github.com/voiceflow/react-chat/issues/180)) ([80cadc1](https://github.com/voiceflow/react-chat/commit/80cadc151df41a8dfdbb2d926e4135c9c1fdc75d))
-
-# 0.1.0 (2024-09-20)
-
-### Features
-
-* new voiceflow chat - initial commit ([#176](https://github.com/voiceflow/react-chat/issues/176)) ([9198d6b](https://github.com/voiceflow/react-chat/commit/9198d6be30a54ad7efc5513ef83b91b1a169550c))
diff --git a/packages/chat/README.md b/packages/chat/README.md
deleted file mode 100644
index ecdd3b7485..0000000000
--- a/packages/chat/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# chat
-
-## 🚧 WIP - Under Construction 🚧
-
-This is going to be a totally redesigned and renewed version of the `react-chat` package.
-It is definitely not ready to be used for any use-case.
-Do not use this.
-
-More details will come...
diff --git a/packages/chat/__mocks__/@voiceflow/stitches-react.ts b/packages/chat/__mocks__/@voiceflow/stitches-react.ts
deleted file mode 100644
index 60f9d10ef4..0000000000
--- a/packages/chat/__mocks__/@voiceflow/stitches-react.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { vi } from 'vitest';
-
-export const createStitches = vi.fn().mockReturnValue({
- styled: vi.fn().mockImplementation((el) => el),
- keyframes: vi.fn(),
-});
-
-export const keyframes = vi.fn();
diff --git a/packages/chat/chromatic.config.json b/packages/chat/chromatic.config.json
deleted file mode 100644
index e7b7ba637b..0000000000
--- a/packages/chat/chromatic.config.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "outputDir": "./storybook-static"
-}
diff --git a/packages/chat/config/test/setup.ts b/packages/chat/config/test/setup.ts
deleted file mode 100644
index bb02c60cd0..0000000000
--- a/packages/chat/config/test/setup.ts
+++ /dev/null
@@ -1 +0,0 @@
-import '@testing-library/jest-dom/vitest';
diff --git a/packages/chat/e2e/embedded.html b/packages/chat/e2e/embedded.html
deleted file mode 100644
index b744c60881..0000000000
--- a/packages/chat/e2e/embedded.html
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
- Embedded Mode
-
-
-
-
-
-
-
-
-
diff --git a/packages/chat/e2e/embedded.spec.ts b/packages/chat/e2e/embedded.spec.ts
deleted file mode 100644
index 6a0b38b066..0000000000
--- a/packages/chat/e2e/embedded.spec.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { expect, test } from '@playwright/test';
-
-test('renders embedded webchat and starts automatically', async ({ page }) => {
- await page.goto('embedded');
-
- const chat = page.locator('.vfrc-chat');
- await chat.waitFor({ state: 'visible' });
- expect(chat).toBeInViewport();
- page.locator('.vfrc-footer .vfrc-button').click();
-
- await page.locator('.vfrc-chat-input').waitFor({ state: 'visible' });
-});
diff --git a/packages/chat/e2e/extensions.html b/packages/chat/e2e/extensions.html
deleted file mode 100644
index 1e5710ec1c..0000000000
--- a/packages/chat/e2e/extensions.html
+++ /dev/null
@@ -1,122 +0,0 @@
-
-
-
- Embedded Mode
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/chat/e2e/extensions.spec.ts b/packages/chat/e2e/extensions.spec.ts
deleted file mode 100644
index ee3a9a6347..0000000000
--- a/packages/chat/e2e/extensions.spec.ts
+++ /dev/null
@@ -1,118 +0,0 @@
-import { expect, test } from '@playwright/test';
-
-import { slateMessage } from './utils';
-
-const RUNTIME_URL = 'https://general-runtime.voiceflow.com/public/projectID/state/user/*/interact';
-
-test('trigger effect extension on incoming trace', async ({ page }) => {
- const systemMessages = [
- 'Welcome to the pizza palace!',
- 'What kind of pizza do you want?',
- 'One cheese pizza coming right up',
- ];
- const userMessages = ['I want to order a pizza', 'Cheese please'];
- const traceType = 'update_order_status';
- let count = 0;
-
- // eslint-disable-next-line consistent-return
- await page.route(RUNTIME_URL, async (route) => {
- count++;
-
- switch (count) {
- case 1:
- return route.fulfill({
- json: {
- trace: [{ type: traceType, payload: 'idle' }, slateMessage(systemMessages[0])],
- },
- });
-
- case 2:
- return route.fulfill({
- json: {
- trace: [{ type: traceType, payload: 'in progress' }, slateMessage(systemMessages[1])],
- },
- });
-
- case 3:
- return route.fulfill({
- json: {
- trace: [{ type: traceType, payload: 'ordered' }, slateMessage(systemMessages[2])],
- },
- });
-
- default:
- }
- });
-
- await page.goto('extensions');
-
- const chat = page.locator('.vfrc-chat');
- await chat.waitFor({ state: 'visible' });
- expect(chat).toBeInViewport();
-
- await page.locator('[data-testid="status"]', { hasText: 'idle' }).waitFor({ state: 'visible' });
- await page.locator('.vfrc-message', { hasText: systemMessages[0] }).waitFor({ state: 'visible' });
-
- const input = page.locator('.vfrc-chat-input textarea');
- await input.waitFor({ state: 'visible' });
- await input.fill(userMessages[0]);
-
- const submit = page.locator('.vfrc-chat-input .vfrc-bubble');
- await submit.click();
-
- await page.locator('.vfrc-message', { hasText: userMessages[0] }).waitFor({ state: 'visible' });
- await page.locator('.vfrc-message', { hasText: systemMessages[1] }).waitFor({ state: 'visible' });
- await page.locator('[data-testid="status"]', { hasText: 'in progress' }).waitFor({ state: 'visible' });
-
- await input.fill(userMessages[1]);
- await submit.click();
-
- await page.locator('.vfrc-message', { hasText: userMessages[1] }).waitFor({ state: 'visible' });
- await page.locator('.vfrc-message', { hasText: systemMessages[2] }).waitFor({ state: 'visible' });
- await page.locator('[data-testid="status"]', { hasText: 'ordered' }).waitFor({ state: 'visible' });
-});
-
-test('render response extension from incoming trace', async ({ page }) => {
- let count = 0;
-
- await page.route(RUNTIME_URL, (route) => {
- count++;
-
- switch (count) {
- case 1:
- return route.fulfill({
- json: {
- trace: [slateMessage("Welcome to Sal's Salon! Tell me about yourself."), { type: 'onboarding' }],
- },
- });
- case 2:
- default:
- expect(route.request().postDataJSON()).toEqual({
- action: {
- type: 'submit',
- payload: { name: 'Alex', hair: 'curly' },
- },
- });
-
- return route.fulfill({ json: { trace: [] } });
- }
- });
-
- await page.goto('extensions');
-
- const chat = page.locator('.vfrc-chat');
- await chat.waitFor({ state: 'visible' });
- expect(chat).toBeInViewport();
-
- await page.locator('.vfrc-message').waitFor({ state: 'visible' });
-
- const extensionMessage = page.locator('.vfrc-message--extension-onboarding_form');
- await extensionMessage.waitFor({ state: 'visible' });
-
- await extensionMessage.locator('[name="name"]').fill('Alex');
- await extensionMessage.locator('[name="hair"][id="curly"]').click();
- await extensionMessage.getByRole('button').click();
- await page
- .locator('.vfrc-message--extension-onboarding_form', { hasText: 'submitted ✅' })
- .waitFor({ state: 'visible' });
-});
diff --git a/packages/chat/e2e/overlay.html b/packages/chat/e2e/overlay.html
deleted file mode 100644
index e8bbeb3c94..0000000000
--- a/packages/chat/e2e/overlay.html
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
- Overlay mode
-
-
-
-
-
-
-
diff --git a/packages/chat/e2e/overlay.spec.ts b/packages/chat/e2e/overlay.spec.ts
deleted file mode 100644
index da293c0903..0000000000
--- a/packages/chat/e2e/overlay.spec.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import { expect, test } from '@playwright/test';
-
-test('renders launcher and widget appears on click', async ({ page }) => {
- await page.goto('overlay');
-
- const launcher = page.locator('.vfrc-launcher');
- await launcher.waitFor({ state: 'visible' });
- await launcher.click();
- const chat = page.locator('.vfrc-chat');
-
- await chat.waitFor({ state: 'visible' });
- await page.locator('.vfrc-chat-input').waitFor({ state: 'visible' });
-});
-
-test('control widget visibility and open state', async ({ page }) => {
- await page.goto('overlay');
-
- const launcher = page.locator('.vfrc-launcher');
- const chat = page.locator('.vfrc-chat');
-
- await launcher.waitFor({ state: 'visible' });
-
- await page.evaluate(() => window.voiceflow?.chat?.open());
-
- await chat.waitFor({ state: 'visible' });
-
- await page.evaluate(() => window.voiceflow?.chat?.close());
-
- expect(chat).not.toBeInViewport();
-
- await page.evaluate(() => window.voiceflow?.chat?.hide());
-
- await launcher.waitFor({ state: 'hidden' });
-
- await page.evaluate(() => window.voiceflow?.chat?.show());
-
- await launcher.waitFor({ state: 'visible' });
-});
diff --git a/packages/chat/e2e/proactive.html b/packages/chat/e2e/proactive.html
deleted file mode 100644
index 60cd68a723..0000000000
--- a/packages/chat/e2e/proactive.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
- Overlay mode - proactive messages
-
-
-
-
-
-
-
diff --git a/packages/chat/e2e/proactive.spec.ts b/packages/chat/e2e/proactive.spec.ts
deleted file mode 100644
index bd94491263..0000000000
--- a/packages/chat/e2e/proactive.spec.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { test } from '@playwright/test';
-import type { Trace } from '@voiceflow/base-types';
-
-test('renders launcher and widget appears on click', async ({ page }) => {
- const message = 'Welcome to our chat';
-
- await page.goto('proactive');
-
- await page.locator('.vfrc-launcher').waitFor({ state: 'visible' });
-
- await page.evaluate(
- ([message]) =>
- window.voiceflow?.chat?.proactive.push({
- type: 'text' as Trace.TraceType.TEXT,
- payload: { slate: { id: '', content: [] }, message },
- }),
- [message]
- );
-
- await page.waitForSelector(`text=${message}`);
-});
diff --git a/packages/chat/e2e/utils.ts b/packages/chat/e2e/utils.ts
deleted file mode 100644
index 2308dc7bff..0000000000
--- a/packages/chat/e2e/utils.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-export const slateMessage = (text: string) => ({
- type: 'text',
- payload: {
- slate: {
- id: text,
- content: [{ children: [{ text }] }],
- messageDelayMilliseconds: 100,
- },
- message: text,
- delay: 100,
- },
-});
diff --git a/packages/chat/examples/index.html b/packages/chat/examples/index.html
deleted file mode 100644
index 7df86a8c9f..0000000000
--- a/packages/chat/examples/index.html
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
- Example Page
-
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/chat/package.json b/packages/chat/package.json
deleted file mode 100644
index f9e1f0e0e2..0000000000
--- a/packages/chat/package.json
+++ /dev/null
@@ -1,158 +0,0 @@
-{
- "name": "@voiceflow/react-chat",
- "version": "2.31.0",
- "description": "voiceflow chat ui",
- "keywords": [
- "chat",
- "chat widget",
- "ai chat bot",
- "voiceflow"
- ],
- "homepage": "https://github.com/voiceflow/react-chat#readme",
- "bugs": {
- "url": "https://github.com/voiceflow/react-chat/issues"
- },
- "license": "MIT",
- "author": "Ben Teichman, Tyler Han",
- "type": "module",
- "exports": {
- ".": {
- "import": "./build/main.es.js",
- "require": "./build/main.cjs.js",
- "types": "./build/main.d.ts"
- },
- "./ui": {
- "import": "./build/ui.es.js",
- "require": "./build/ui.cjs.js",
- "types": "./build/ui.d.ts"
- },
- "./stories": {
- "import": "./build/stories.es.js",
- "require": "./build/stories.cjs.js",
- "types": "./build/stories.d.ts"
- },
- "./dist/*.css": {
- "import": "./dist/*.css",
- "require": "./dist/*.css"
- }
- },
- "main": "build/main.es.js",
- "types": "build/main.d.ts",
- "typesVersions": {
- "*": {
- "ui": [
- "./build/ui.d.ts"
- ],
- "stories": [
- "./build/stories.d.ts"
- ]
- }
- },
- "files": [
- "build",
- "dist"
- ],
- "scripts": {
- "build": "yarn g:turbo run build:cmd --filter=@voiceflow/react-chat...",
- "build:cmd": "yarn g:run-p build:package build:widget",
- "build:package": "NODE_ENV=production vite --config vite.package.config.ts build && yarn g:tsc-alias -p tsconfig.build.json",
- "build:storybook": "storybook build -o docs",
- "build:widget": "NODE_ENV=production vite --config vite.widget.config.ts build",
- "chromatic:publish": "npx chromatic --project-token $CHROMATIC_PROJECT_TOKEN --build-script-name build:storybook",
- "clean": "yarn g:rimraf build dist",
- "dev": "storybook dev -p 6006",
- "lint": "yarn g:run-p -c lint:eslint lint:prettier",
- "lint:eslint": "yarn g:eslint",
- "lint:fix": "yarn g:run-p -c \"lint:eslint --fix\" \"lint:prettier --write\"",
- "lint:prettier": "yarn g:prettier --check",
- "local": "NODE_ENV=development vite",
- "start:e2e": "http-server -o e2e",
- "tdd": "yarn g:vitest",
- "test": "yarn g:run-p -c test:dependencies test:types test:unit",
- "test:dependencies": "yarn g:depcruise",
- "test:e2e": "yarn playwright test",
- "test:types": "yarn g:tsc --noEmit",
- "test:unit": "yarn g:vitest run --coverage"
- },
- "dependencies": {
- "@vanilla-extract/css": "1.16.1",
- "@vanilla-extract/recipes": "0.5.5",
- "@voiceflow/base-types": "2.113.1",
- "@voiceflow/dtos-interact": "1.12.0",
- "@voiceflow/sdk-runtime": "workspace:*",
- "@voiceflow/slate-serializer": "1.5.5",
- "@voiceflow/voiceflow-types": "3.32.1",
- "bowser": "2.11.0",
- "chroma-js": "2.4.2",
- "clsx": "1.2.1",
- "cuid": "2.1.8",
- "react": "18.2.0",
- "react-dom": "18.2.0",
- "react-markdown": "9.0.0",
- "react-speech-recognition": "3.10.0",
- "react-syntax-highlighter": "15.5.0",
- "react-textarea-autosize": "8.5.3",
- "regenerator-runtime": "0.13.11",
- "remark-gfm": "4.0.0",
- "slate": "0.94.1",
- "ts-pattern": "4.3.0",
- "zod": "3.22.4"
- },
- "devDependencies": {
- "@babel/core": "7.18.10",
- "@babel/preset-env": "7.24.1",
- "@babel/preset-react": "7.24.1",
- "@babel/preset-typescript": "7.24.1",
- "@emotion/core": "10.1.1",
- "@playwright/test": "1.43.1",
- "@storybook/addon-actions": "8.0.2",
- "@storybook/addon-essentials": "8.0.2",
- "@storybook/addon-interactions": "8.0.2",
- "@storybook/addon-links": "8.0.2",
- "@storybook/builder-vite": "8.0.2",
- "@storybook/eslint-config-storybook": "3.1.2",
- "@storybook/react": "8.0.2",
- "@storybook/react-vite": "8.0.2",
- "@storybook/testing-library": "0.0.13",
- "@testing-library/jest-dom": "6.4.2",
- "@testing-library/react": "15.0.2",
- "@types/chroma-js": "2.1.4",
- "@types/node": "20.12.7",
- "@types/react": "18.2.8",
- "@types/react-dom": "18.2.4",
- "@types/react-speech-recognition": "^3.9.5",
- "@types/react-syntax-highlighter": "15.5.13",
- "@vanilla-extract/dynamic": "2.1.2",
- "@vanilla-extract/vite-plugin": "4.0.18",
- "@vitejs/plugin-react": "4.2.1",
- "@voiceflow/test-common": "1.10.3",
- "chromatic": "11.2.0",
- "eslint-plugin-mdx": "3.1.5",
- "eslint-plugin-storybook": "0.8.0",
- "happy-dom": "14.7.1",
- "http-server": "14.1.1",
- "react": "18.2.0",
- "react-dom": "18.2.0",
- "storybook": "8.0.2",
- "storybook-dark-mode": "1.1.0",
- "tsc-alias": "1.8.8",
- "type-fest": "2.18.1",
- "unplugin-fonts": "^1.3.1",
- "vite": "5.2.9",
- "vite-plugin-dts": "3.8.3",
- "vite-plugin-html": "3.2.2",
- "vite-plugin-static-copy": "^2.2.0",
- "vite-plugin-svgr": "4.2.0",
- "vite-tsconfig-paths": "4.3.2"
- },
- "peerDependencies": {
- "react": "^18",
- "react-dom": "^18"
- },
- "volta": {
- "extends": "../../package.json"
- },
- "publishConfig": {
- "tag": "next"
- }
-}
diff --git a/packages/chat/playwright.config.ts b/packages/chat/playwright.config.ts
deleted file mode 100644
index 61470cf0db..0000000000
--- a/packages/chat/playwright.config.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { cpus } from 'node:os';
-
-import { defineConfig, devices } from '@playwright/test';
-
-export default defineConfig({
- testDir: './e2e',
- fullyParallel: true,
- forbidOnly: !!process.env.CI,
- retries: 0,
- workers: process.env.CI ? 1 : cpus().length - 1,
- reporter: [['junit', { outputFile: 'e2e.report.xml' }]],
- timeout: 5000,
- use: {
- baseURL: 'http://127.0.0.1:8080/e2e/',
-
- trace: 'retain-on-failure',
- screenshot: 'only-on-failure',
- video: 'on',
- },
-
- projects: [
- {
- name: 'chromium',
- use: { ...devices['Desktop Chrome'] },
- },
- ],
-
- webServer: {
- command: 'yarn start:e2e',
- url: 'http://127.0.0.1:8080',
- reuseExistingServer: !process.env.CI,
- },
-});
diff --git a/packages/chat/sonar-project.properties b/packages/chat/sonar-project.properties
deleted file mode 100644
index 6b99d146f3..0000000000
--- a/packages/chat/sonar-project.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-sonar.projectName=chat
-sonar.sources=src/
-sonar.tests=src/
-sonar.exclusions=src/**/*.test.*,src/**/*.story.tsx
-sonar.test.inclusions=src/**/*.test.*
-sonar.cpd.exclusions=src/**/*.test.*,src/**/*.story.tsx
-sonar.typescript.tsconfigPath=tsconfig.json
-sonar.javascript.lcov.reportPaths=sonar/coverage/lcov.info
diff --git a/packages/chat/src/__fixtures__/colors.ts b/packages/chat/src/__fixtures__/colors.ts
deleted file mode 100644
index e8ac877c3b..0000000000
--- a/packages/chat/src/__fixtures__/colors.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-export const COLOR_FIXTURE = [
- 'orange',
- '#397DFF',
- '#A3E4D7',
- 'red',
- '#F1948A',
- '#0000FF',
- '#85C1E9',
- '#F7DC6F',
- '#BB8FCE',
- 'green',
- 'black',
- 'yellow',
- 'purple',
-];
diff --git a/packages/chat/src/__fixtures__/default-launcher-image.png b/packages/chat/src/__fixtures__/default-launcher-image.png
deleted file mode 100644
index 617fd6538c..0000000000
Binary files a/packages/chat/src/__fixtures__/default-launcher-image.png and /dev/null differ
diff --git a/packages/chat/src/__fixtures__/empty-image.png b/packages/chat/src/__fixtures__/empty-image.png
deleted file mode 100644
index af27d4fe57..0000000000
Binary files a/packages/chat/src/__fixtures__/empty-image.png and /dev/null differ
diff --git a/packages/chat/src/__fixtures__/markdown/code-response.md b/packages/chat/src/__fixtures__/markdown/code-response.md
deleted file mode 100644
index 2aeb634e46..0000000000
--- a/packages/chat/src/__fixtures__/markdown/code-response.md
+++ /dev/null
@@ -1,15 +0,0 @@
-```javascript
-
-```
diff --git a/packages/chat/src/__fixtures__/markdown/inline-code.md b/packages/chat/src/__fixtures__/markdown/inline-code.md
deleted file mode 100644
index 755538f3b5..0000000000
--- a/packages/chat/src/__fixtures__/markdown/inline-code.md
+++ /dev/null
@@ -1,38 +0,0 @@
-# Code and Syntax Highlighting
-
-```javascript
-
-```
-
-```css
-@font-face {
- font-family: Chunkfive;
- src: url('Chunkfive.otf');
-}
-
-body,
-.usertext {
- color: #f0f0f0;
- background: #600;
- font-family: Chunkfive, sans;
-}
-
-@import url(print.css);
-@media print {
- a[href^='http']::after {
- content: attr(href);
- }
-}
-```
diff --git a/packages/chat/src/__fixtures__/markdown/lists.md b/packages/chat/src/__fixtures__/markdown/lists.md
deleted file mode 100644
index 9595672060..0000000000
--- a/packages/chat/src/__fixtures__/markdown/lists.md
+++ /dev/null
@@ -1,106 +0,0 @@
-# Lists
-
-1. First ordered list item
-2. Another item
-3. Actual numbers don't matter, just that it's a number
-4. And another item.
-
-- Unordered list can use asterisks
-
-* Or minuses
-
-- Or pluses
-
-1. Make my changes
- 1. Fix bug
- 2. Improve formatting
- - Make the headings bigger
-2. Push my commits to GitHub
-3. Open a pull request
- - Describe my changes
- - Mention all the members of my team
- - Ask for feedback
-
----
-
-# Task lists
-
-- [x] Finish my changes
-- [ ] Push my commits to GitHub
-- [ ] Open a pull request
-- [x] @mentions, #refs, [links](), **formatting**, and tags supported
-- [x] list syntax required (any unordered or ordered list supported)
-- [ ] this is a complete item
-- [ ] this is an incomplete item
-
----
-
-# Ignoring Markdown formatting
-
-You can tell GitHub to ignore (or escape) Markdown formatting by using \ before the Markdown character.
-
-Let's rename \*our-new-project\* to \*our-old-project\*.
-
----
-
-# Links
-
-[I'm an inline-style link](https://www.google.com)
-
-[I'm an inline-style link with title](https://www.google.com "Google's Homepage")
-
-[I'm a reference-style link][Arbitrary case-insensitive reference text]
-
-[I'm a relative reference to a repository file](../blob/master/LICENSE)
-
-[You can use numbers for reference-style link definitions][1]
-
-Or leave it empty and use the [link text itself].
-
-URLs and URLs in angle brackets will automatically get turned into links.
-http://www.example.com or and sometimes
-example.com (but not on Github, for example).
-
-Some text to show that the reference links can follow later.
-
-[arbitrary case-insensitive reference text]: https://www.mozilla.org
-[1]: http://slashdot.org
-[link text itself]: http://www.reddit.com
-
-# Images
-
-Here's our logo (hover to see the title text):
-
-Inline-style:
-
-
-Reference-style:
-![alt text][logo]
-
-[logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png 'Logo Title Text 2'
-
-Like links, Images also have a footnote style syntax
-
-![Alt text][id]
-
-With a reference later in the document defining the URL location:
-
----
-
-# [Footnotes](https://github.com/markdown-it/markdown-it-footnote)
-
-Footnote 1 link[^first].
-
-Footnote 2 link[^second].
-
-Inline footnote^[Text of inline footnote] definition.
-
-Duplicated footnote reference[^second].
-
-[^first]: Footnote **can have markup**
-
- and multiple paragraphs.
-
-[^second]: Footnote text.
-
----
diff --git a/packages/chat/src/__fixtures__/markdown/tables-quotes-rules.md b/packages/chat/src/__fixtures__/markdown/tables-quotes-rules.md
deleted file mode 100644
index cf9222ccd4..0000000000
--- a/packages/chat/src/__fixtures__/markdown/tables-quotes-rules.md
+++ /dev/null
@@ -1,90 +0,0 @@
-# Tables
-
-Colons can be used to align columns.
-
-| Tables | Are | Cool |
-| ------------- | :-----------: | ----: |
-| col 3 is | right-aligned | $1600 |
-| col 2 is | centered | $12 |
-| zebra stripes | are neat | $1 |
-
-There must be at least 3 dashes separating each header cell.
-The outer pipes (|) are optional, and you don't need to make the
-raw Markdown line up prettily. You can also use inline Markdown.
-
-| Markdown | Less | Pretty |
-| -------- | --------- | ---------- |
-| _Still_ | `renders` | **nicely** |
-| 1 | 2 | 3 |
-
-| First Header | Second Header |
-| ------------ | ------------- |
-| Content Cell | Content Cell |
-| Content Cell | Content Cell |
-
-| Command | Description |
-| ---------- | ---------------------------------------------- |
-| git status | List all new or modified files |
-| git diff | Show file differences that haven't been staged |
-
-| Command | Description |
-| ------------ | -------------------------------------------------- |
-| `git status` | List all _new or modified_ files |
-| `git diff` | Show file differences that **haven't been** staged |
-
-| Left-aligned | Center-aligned | Right-aligned |
-| :----------- | :------------: | ------------: |
-| git status | git status | git status |
-| git diff | git diff | git diff |
-
-| Name | Character |
-| -------- | --------- |
-| Backtick | ` |
-| Pipe | \| |
-
----
-
-# Blockquotes
-
-> Blockquotes are very handy in email to emulate reply text.
-> This line is part of the same quote.
-> Quote break.
-
-> This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can _put_ **Markdown** into a blockquote.
-> Blockquotes can also be nested...
->
-> > ...by using additional greater-than signs right next to each other...
-> >
-> > > ...or with spaces between arrows.
-
----
-
-# Inline HTML
-
-
- Definition list
- Is something people use sometimes.
-
- Markdown in HTML
- Does *not* work **very** well. Use HTML tags .
-
-
----
-
-# Horizontal Rules
-
-Three or more...
-
----
-
-Hyphens
-
----
-
-Asterisks
-
----
-
-Underscores
-
----
diff --git a/packages/chat/src/__fixtures__/markdown/text-treatment.md b/packages/chat/src/__fixtures__/markdown/text-treatment.md
deleted file mode 100644
index 579656e02b..0000000000
--- a/packages/chat/src/__fixtures__/markdown/text-treatment.md
+++ /dev/null
@@ -1,39 +0,0 @@
-# Howdy!
-
-# h1 Voiceflow
-
-## h2 Voiceflow
-
-### h3 Voiceflow
-
-#### h4 Voiceflow
-
-##### h5 Voiceflow
-
-###### h6 Voiceflow
-
-# Alt-H1
-
-## Alt-H2
-
----
-
-What does a really long block of text look like? Well, it looks like this. And there's even more of it than you could ever imagine. We want to see how this wraps and displays line height properly. So we're going to keep going. What does a really long block of text look like? Well, it looks like this. And there's even more of it than you could ever imagine. We want to see how this wraps and displays line height properly. So we're going to keep going.
-
-What does a really long block of text look like? Well, it looks like this. And there's even more of it than you could ever imagine. We want to see how this wraps and displays line height properly. So we're going to keep going. What does a really long block of text look like? Well, it looks like this. And there's even more of it than you could ever imagine. We want to see how this wraps and displays line height properly. So we're going to keep going.
-
----
-
-# Emphasis
-
-Emphasis, aka italics, with _asterisks_ or _underscores_.
-
-Strong emphasis, aka bold, with **asterisks** or **underscores**.
-
-Combined emphasis with **asterisks and _underscores_**.
-
-**This is bold text**
-
-_This is italic text_
-
-~~Strikethrough~~
diff --git a/packages/chat/src/__fixtures__/messages.ts b/packages/chat/src/__fixtures__/messages.ts
deleted file mode 100644
index 77e2deb8d3..0000000000
--- a/packages/chat/src/__fixtures__/messages.ts
+++ /dev/null
@@ -1,94 +0,0 @@
-import type { Text, Trace } from '@voiceflow/base-types';
-
-import CODE_RESPONSE_FIXTURE from '@/__fixtures__/markdown/code-response.md?raw';
-import type { MessageProps } from '@/components/SystemResponse';
-import { MessageType } from '@/components/SystemResponse/constants';
-import { ExtensionType, type ResponseExtension } from '@/dtos/Extension.dto';
-
-// Example text content for Text.SlateTextValue
-export const SAMPLE_SLATE_TEXT: Text.SlateTextValue = [{ type: 'paragraph', children: [{ text: 'Hello, world!' }] }];
-const sampleTrace: Trace.AnyTrace = { type: 'speak', payload: { message: 'End of conversation.' } } as Trace.AnyTrace;
-const sampleExtension: ResponseExtension = {
- name: 'SampleExtension',
- type: ExtensionType.RESPONSE,
- match(): boolean {
- throw new Error('Function not implemented.');
- },
-};
-
-export const textMessageFixture: MessageProps[] = [
- {
- type: MessageType.TEXT,
- text: SAMPLE_SLATE_TEXT,
- delay: 500,
- ai: true,
- },
-];
-
-export const codeMessageFixture: MessageProps[] = [
- {
- type: MessageType.TEXT,
- text: CODE_RESPONSE_FIXTURE,
- delay: 500,
- ai: true,
- },
-];
-
-export const imageMessageFixture: MessageProps = {
- type: MessageType.IMAGE,
- url: 'https://example.com/image.png',
- delay: 200,
- ai: false,
-};
-
-export const cardMessageFixture: MessageProps = {
- type: MessageType.CARD,
- title: 'Sample Card Title',
- description: 'Sample Subtitle',
- image: 'https://example.com/card-image.png',
- delay: 300,
- ai: true,
-};
-
-export const carouselMessageFixture: MessageProps = {
- type: MessageType.CAROUSEL,
- cards: [
- {
- title: 'Card 1',
- description: 'First Card in Carousel',
- image: 'https://example.com/card1.png',
- },
- {
- title: 'Card 2',
- description: 'Second Card in Carousel',
- image: 'https://example.com/card2.png',
- },
- ],
- delay: 400,
- ai: false,
-};
-
-export const endMessageFixture: MessageProps = {
- type: MessageType.END,
- delay: 100,
- ai: true,
-};
-
-export const extensionMessageFixture: MessageProps = {
- type: MessageType.EXTENSION,
- payload: {
- trace: sampleTrace,
- extension: sampleExtension,
- },
- delay: 500,
- ai: true,
-};
-
-export const customMessageFixture: MessageProps = {
- type: 'custom_greeting',
- payload: {
- greeting: 'Hello, custom world!',
- },
- delay: 600,
- ai: true,
-};
diff --git a/packages/chat/src/__fixtures__/mock-assistant.ts b/packages/chat/src/__fixtures__/mock-assistant.ts
deleted file mode 100644
index 3493b78c6a..0000000000
--- a/packages/chat/src/__fixtures__/mock-assistant.ts
+++ /dev/null
@@ -1,73 +0,0 @@
-import {
- WIDGET_SETTINGS_DEFAULT_MAIN_COLOR,
- WIDGET_SETTINGS_DEFAULT_PALETTE,
- WidgetSettingsChatRenderMode,
- WidgetSettingsLauncherType,
- WidgetSettingsVoiceRenderMode,
- WidgetSettingsWidgetPosition,
- WidgetSettingsWidgetType,
-} from '@voiceflow/dtos-interact';
-import { ChatPersistence } from '@voiceflow/voiceflow-types/build/cjs/version';
-
-import type { ChatWidgetSettings } from '@/types/settings';
-
-export const DEFAULT_WIDGET_SETTINGS: ChatWidgetSettings = {
- type: WidgetSettingsWidgetType.CHAT,
-
- chat: {
- voiceInput: true,
- voiceOutput: true,
-
- renderMode: WidgetSettingsChatRenderMode.WIDGET,
-
- headerImage: {
- enabled: true,
- },
- agentImage: {
- enabled: true,
- },
- banner: {
- enabled: true,
- title: 'Your AI agent',
- description: 'How can I help you today?',
- },
- placeholderText: 'Message...',
- aiDisclaimer: {
- enabled: true,
- text: 'Generated by AI, double-check for accuracy.',
- },
- handoffToAgentImageURL: '',
- },
- voice: {
- renderMode: WidgetSettingsVoiceRenderMode.FULL,
- content: {
- callToActionText: 'How can I help you?',
- startButtonText: 'Start a call',
- listeningText: 'Listening',
- talkingText: 'Talk to interrupt',
- endButtonText: 'End',
- },
- },
- common: {
- fontFamily: 'UCity Pro',
- launcher: {
- text: 'Your text',
- type: WidgetSettingsLauncherType.ICON,
- },
- poweredBy: true,
- footerLink: {
- enabled: true,
- text: 'Privacy',
- },
- position: WidgetSettingsWidgetPosition.RIGHT,
- sideSpacing: '20',
- bottomSpacing: '20',
- primaryColor: {
- color: WIDGET_SETTINGS_DEFAULT_MAIN_COLOR,
- palette: WIDGET_SETTINGS_DEFAULT_PALETTE,
- },
- persistence: ChatPersistence.LOCAL_STORAGE,
- },
- stylesheet: '',
- extensions: [],
-};
diff --git a/packages/chat/src/__fixtures__/tiled-bg.png b/packages/chat/src/__fixtures__/tiled-bg.png
deleted file mode 100644
index d643f272e2..0000000000
Binary files a/packages/chat/src/__fixtures__/tiled-bg.png and /dev/null differ
diff --git a/packages/chat/src/assets/blank-image.png b/packages/chat/src/assets/blank-image.png
deleted file mode 100644
index bade0cbac1..0000000000
Binary files a/packages/chat/src/assets/blank-image.png and /dev/null differ
diff --git a/packages/chat/src/assets/message.png b/packages/chat/src/assets/message.png
deleted file mode 100644
index b9d2eb42bc..0000000000
Binary files a/packages/chat/src/assets/message.png and /dev/null differ
diff --git a/packages/chat/src/assets/svg/ai.svg b/packages/chat/src/assets/svg/ai.svg
deleted file mode 100644
index 1e1dfabb4b..0000000000
--- a/packages/chat/src/assets/svg/ai.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/packages/chat/src/assets/svg/arrow-down.svg b/packages/chat/src/assets/svg/arrow-down.svg
deleted file mode 100644
index fd5babb74a..0000000000
--- a/packages/chat/src/assets/svg/arrow-down.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/packages/chat/src/assets/svg/arrow-right.svg b/packages/chat/src/assets/svg/arrow-right.svg
deleted file mode 100644
index bb29943bac..0000000000
--- a/packages/chat/src/assets/svg/arrow-right.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/packages/chat/src/assets/svg/checkmark.svg b/packages/chat/src/assets/svg/checkmark.svg
deleted file mode 100644
index cdc69daa9b..0000000000
--- a/packages/chat/src/assets/svg/checkmark.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/packages/chat/src/assets/svg/close.svg b/packages/chat/src/assets/svg/close.svg
deleted file mode 100644
index ef01b1522c..0000000000
--- a/packages/chat/src/assets/svg/close.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/packages/chat/src/assets/svg/closeV2.svg b/packages/chat/src/assets/svg/closeV2.svg
deleted file mode 100644
index 6793e0e907..0000000000
--- a/packages/chat/src/assets/svg/closeV2.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/packages/chat/src/assets/svg/copy.svg b/packages/chat/src/assets/svg/copy.svg
deleted file mode 100644
index 30ab2591f3..0000000000
--- a/packages/chat/src/assets/svg/copy.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/packages/chat/src/assets/svg/document-pdf.svg b/packages/chat/src/assets/svg/document-pdf.svg
deleted file mode 100644
index a4849397a9..0000000000
--- a/packages/chat/src/assets/svg/document-pdf.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/packages/chat/src/assets/svg/document-url.svg b/packages/chat/src/assets/svg/document-url.svg
deleted file mode 100644
index c18197d560..0000000000
--- a/packages/chat/src/assets/svg/document-url.svg
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/chat/src/assets/svg/end-call.svg b/packages/chat/src/assets/svg/end-call.svg
deleted file mode 100644
index 31f5364454..0000000000
--- a/packages/chat/src/assets/svg/end-call.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/packages/chat/src/assets/svg/index.ts b/packages/chat/src/assets/svg/index.ts
deleted file mode 100644
index 711f41f0ef..0000000000
--- a/packages/chat/src/assets/svg/index.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-export { default as ai } from './ai.svg?react';
-export { default as arrowDown } from './arrow-down.svg?react';
-export { default as arrowRight } from './arrow-right.svg?react';
-export { default as checkmark } from './checkmark.svg?react';
-export { default as close } from './close.svg?react';
-export { default as closeV2 } from './closeV2.svg?react';
-export { default as copy } from './copy.svg?react';
-export { default as documentPdf } from './document-pdf.svg?react';
-export { default as documentUrl } from './document-url.svg?react';
-export { default as endCall } from './end-call.svg?react';
-export { default as largeArrowLeft } from './large-arrow-left.svg?react';
-export { default as microphone } from './microphone.svg?react';
-export { default as minus } from './minus.svg?react';
-export { default as mute } from './mute.svg?react';
-export { default as phone } from './phone.svg?react';
-export { default as reset } from './reset.svg?react';
-export { default as smallArrowUp } from './small-arrow-up.svg?react';
-export { default as sound } from './sound.svg?react';
-export { default as soundOff } from './sound-off.svg?react';
-export { default as stop } from './stop.svg?react';
-export { default as thumbsUp } from './thumbs-up.svg?react';
-export { default as topCaret } from './top-caret.svg?react';
-export { default as voice } from './voice.svg?react';
-export { default as volume } from './volume.svg?react';
diff --git a/packages/chat/src/assets/svg/large-arrow-left.svg b/packages/chat/src/assets/svg/large-arrow-left.svg
deleted file mode 100644
index 426a7f1123..0000000000
--- a/packages/chat/src/assets/svg/large-arrow-left.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/packages/chat/src/assets/svg/microphone.svg b/packages/chat/src/assets/svg/microphone.svg
deleted file mode 100644
index 0fd21b925c..0000000000
--- a/packages/chat/src/assets/svg/microphone.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/packages/chat/src/assets/svg/minus.svg b/packages/chat/src/assets/svg/minus.svg
deleted file mode 100644
index 02d44e18e5..0000000000
--- a/packages/chat/src/assets/svg/minus.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/packages/chat/src/assets/svg/mute.svg b/packages/chat/src/assets/svg/mute.svg
deleted file mode 100644
index c4512d0ebc..0000000000
--- a/packages/chat/src/assets/svg/mute.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/packages/chat/src/assets/svg/phone.svg b/packages/chat/src/assets/svg/phone.svg
deleted file mode 100644
index 66b7a69310..0000000000
--- a/packages/chat/src/assets/svg/phone.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/packages/chat/src/assets/svg/reset.svg b/packages/chat/src/assets/svg/reset.svg
deleted file mode 100644
index 593cf57f48..0000000000
--- a/packages/chat/src/assets/svg/reset.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/packages/chat/src/assets/svg/small-arrow-up.svg b/packages/chat/src/assets/svg/small-arrow-up.svg
deleted file mode 100644
index 5ad300f687..0000000000
--- a/packages/chat/src/assets/svg/small-arrow-up.svg
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/chat/src/assets/svg/sound-off.svg b/packages/chat/src/assets/svg/sound-off.svg
deleted file mode 100644
index bbeecb19b1..0000000000
--- a/packages/chat/src/assets/svg/sound-off.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/chat/src/assets/svg/sound.svg b/packages/chat/src/assets/svg/sound.svg
deleted file mode 100644
index fb3e50c34a..0000000000
--- a/packages/chat/src/assets/svg/sound.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/chat/src/assets/svg/stop.svg b/packages/chat/src/assets/svg/stop.svg
deleted file mode 100644
index 7b0c4ba0f3..0000000000
--- a/packages/chat/src/assets/svg/stop.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/packages/chat/src/assets/svg/thumbs-up.svg b/packages/chat/src/assets/svg/thumbs-up.svg
deleted file mode 100644
index 38ae1b2276..0000000000
--- a/packages/chat/src/assets/svg/thumbs-up.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
diff --git a/packages/chat/src/assets/svg/top-caret.svg b/packages/chat/src/assets/svg/top-caret.svg
deleted file mode 100644
index 11a25a6b8e..0000000000
--- a/packages/chat/src/assets/svg/top-caret.svg
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/chat/src/assets/svg/voice.svg b/packages/chat/src/assets/svg/voice.svg
deleted file mode 100644
index 531dc78c58..0000000000
--- a/packages/chat/src/assets/svg/voice.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/packages/chat/src/assets/svg/volume.svg b/packages/chat/src/assets/svg/volume.svg
deleted file mode 100644
index c674024423..0000000000
--- a/packages/chat/src/assets/svg/volume.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/packages/chat/src/assets/vf_chat.png b/packages/chat/src/assets/vf_chat.png
deleted file mode 100644
index 2c3c7a1c0d..0000000000
Binary files a/packages/chat/src/assets/vf_chat.png and /dev/null differ
diff --git a/packages/chat/src/assets/vf_logo.png b/packages/chat/src/assets/vf_logo.png
deleted file mode 100644
index 9273a59602..0000000000
Binary files a/packages/chat/src/assets/vf_logo.png and /dev/null differ
diff --git a/packages/chat/src/components/AgentMessage/AgentMessage.css.ts b/packages/chat/src/components/AgentMessage/AgentMessage.css.ts
deleted file mode 100644
index 0ab5a1dcbf..0000000000
--- a/packages/chat/src/components/AgentMessage/AgentMessage.css.ts
+++ /dev/null
@@ -1,145 +0,0 @@
-import { style } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { COLORS } from '@/styles/colors';
-import { THEME } from '@/styles/colors.css';
-import { BREAKPOINTS, SIZES } from '@/styles/sizes';
-import { transition } from '@/styles/transitions';
-
-import { messageContainer } from '../MessageContainer/styles.css';
-import { systemMessageContainer } from '../SystemResponse/styles.css';
-
-export const agentMessageContainer = style({
- backgroundColor: COLORS.NEUTRAL_LIGHT[50],
- color: COLORS.NEUTRAL_DARK[900],
- fontFamily: THEME.fontFamily,
- position: 'relative',
- fontSize: '14px',
- lineHeight: '20px',
- borderRadius: SIZES.radius.sm,
- width: 'fit-content',
-});
-
-export const contentStyle = recipe({
- base: {
- whiteSpace: 'normal',
- },
- variants: {
- isCodeBlock: {
- true: {
- padding: 0,
- },
- false: {
- padding: '11px 16px 10px',
- },
- },
- },
-});
-
-export const embeddedContent = style({
- padding: '0 16px 12px',
- display: 'flex',
- flexDirection: 'column',
- gap: '6px',
-});
-
-export const generatedChin = style({
- display: 'flex',
- alignItems: 'center',
- padding: '10px 16px 9px',
- backgroundColor: COLORS.NEUTRAL_LIGHT[100],
- left: 0,
- right: 0,
- bottom: 0,
- color: COLORS.NEUTRAL_DARK[200],
- fontFamily: THEME.fontFamily,
- fontSize: '12px',
- whiteSpace: 'nowrap',
- lineHeight: '17px',
- gap: '10px',
- fontWeight: 600,
- borderRadius: '0 0 10px 10px',
-});
-
-export const generatedChinContent = style({
- '@media': {
- [`screen and (max-width: ${BREAKPOINTS.mobile})`]: {
- maxWidth: '233px',
- overflow: 'hidden',
- textOverflow: 'ellipsis',
- whiteSpace: 'nowrap',
- },
- },
-});
-
-export const aiIconModifier = style({
- color: COLORS.NEUTRAL_DARK[100],
- height: '16px',
-});
-
-export const codeBlockContainer = style({
- position: 'relative',
-});
-
-export const copyButton = style({
- position: 'absolute',
- right: '12px',
- top: '12px',
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- transition: transition(['opacity', 'background-color', 'color']),
- zIndex: 2,
- opacity: 0,
- selectors: {
- [`${codeBlockContainer}:hover &`]: {
- opacity: 1,
- },
- '&:hover': {
- backgroundColor: COLORS.NEUTRAL_DARK[200],
- color: COLORS.NEUTRAL_LIGHT[50],
- },
- '&:active': {},
- },
-});
-
-export const feedbackButtonContainer = style({
- opacity: 0,
- position: 'absolute',
- right: '-6px',
- bottom: '-14px',
- transition: transition(['opacity']),
- zIndex: 10,
- selectors: {
- [`${systemMessageContainer}:hover &`]: {
- opacity: 1,
- },
- [`${messageContainer()}:hover &`]: {
- opacity: 1,
- },
- },
-});
-
-export const lastListItem = style({
- marginBottom: 0,
-});
-
-export const lastPElement = style({
- ':last-child': {
- marginBottom: 0,
- },
-});
-
-export const markdownParagraph = recipe({
- base: {
- marginBottom: '8px',
- marginTop: '8px',
- },
- variants: {
- first: {
- true: {
- marginTop: 0,
- },
- },
- },
-});
diff --git a/packages/chat/src/components/AgentMessage/AgentMessage.story.tsx b/packages/chat/src/components/AgentMessage/AgentMessage.story.tsx
deleted file mode 100644
index 1fa1b3b0b3..0000000000
--- a/packages/chat/src/components/AgentMessage/AgentMessage.story.tsx
+++ /dev/null
@@ -1,143 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-import { useEffect, useState } from 'react';
-
-import CODE_RESPONSE_FIXTURE from '@/__fixtures__/markdown/code-response.md?raw';
-import CODE_SNIPPET_FIXTURE from '@/__fixtures__/markdown/inline-code.md?raw';
-import LISTS_FIXTURE from '@/__fixtures__/markdown/lists.md?raw';
-import TABLES_QUOTES_RULES from '@/__fixtures__/markdown/tables-quotes-rules.md?raw';
-import TEXT_TREATMENT_MARKDOWN from '@/__fixtures__/markdown/text-treatment.md?raw';
-import { SAMPLE_SLATE_TEXT } from '@/__fixtures__/messages';
-
-import tiledBg from '../../__fixtures__/tiled-bg.png';
-import { LinkPreview } from '../LinkPreview';
-import { AgentMessage } from '.';
-
-type Story = StoryObj;
-
-const shortMessage = 'Howdy folks how yall doing out there?';
-
-const meta: Meta = {
- title: 'Core/AgentMessage',
- component: AgentMessage,
-};
-export default meta;
-
-export const Small: Story = {
- args: {
- text: SAMPLE_SLATE_TEXT,
- },
-};
-
-export const AIGenerated: Story = {
- args: {
- text: SAMPLE_SLATE_TEXT as unknown as string,
- ai: true,
- disclaimerMessage: 'Generated by AI, double-check for accuracy.',
- },
-};
-
-export const WithLink: Story = {
- args: {
- text: SAMPLE_SLATE_TEXT,
- ai: true,
- disclaimerMessage: 'Generated by AI, double-check for accuracy.',
- children: (
- <>
-
-
-
- >
- ),
- },
-};
-
-export const Markdown: Story = {
- args: {
- text: TEXT_TREATMENT_MARKDOWN,
- },
-};
-
-export const InlineCode: Story = {
- args: {
- text: CODE_SNIPPET_FIXTURE,
- },
-};
-
-export const CodeResponse: Story = {
- args: {
- text: CODE_RESPONSE_FIXTURE,
- },
- render: ({ children, ...rest }) => {
- return (
-
- );
- },
-};
-
-export const Tables: Story = {
- args: {
- text: TABLES_QUOTES_RULES,
- },
-};
-
-export const Lists: Story = {
- args: {
- text: LISTS_FIXTURE,
- },
-};
-
-const StreamingExample = ({ message }: { message: string }) => {
- const [text, setText] = useState('');
-
- useEffect(() => {
- let index = 0;
- const interval = setInterval(() => {
- setText(message.slice(0, index + 1));
- index++;
- if (index === message.length) {
- clearInterval(interval);
- }
- }, 5);
-
- return () => clearInterval(interval);
- }, [message]);
-
- return ;
-};
-
-export const Streaming: Story = {
- render: () => ,
- parameters: {
- chromatic: { disableSnapshot: true },
- },
-};
-
-export const StreamingFullMarkdown: Story = {
- render: () => ,
- parameters: {
- chromatic: { disableSnapshot: true },
- },
-};
diff --git a/packages/chat/src/components/AgentMessage/CopyButton/CopyButton.css.ts b/packages/chat/src/components/AgentMessage/CopyButton/CopyButton.css.ts
deleted file mode 100644
index 41692ac152..0000000000
--- a/packages/chat/src/components/AgentMessage/CopyButton/CopyButton.css.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { style } from '@vanilla-extract/css';
-
-import { COLORS } from '@/styles/colors';
-import { SIZES } from '@/styles/sizes';
-
-export const copyButton = style({
- width: 36,
- height: 36,
- borderRadius: SIZES.radius.xs,
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- color: COLORS.NEUTRAL_LIGHT[300],
- backgroundColor: COLORS.NEUTRAL_DARK[400],
- right: 12,
- top: 12,
- outline: 'none',
- border: 'none',
- cursor: 'pointer',
- zIndex: 2,
-});
diff --git a/packages/chat/src/components/AgentMessage/CopyButton/index.tsx b/packages/chat/src/components/AgentMessage/CopyButton/index.tsx
deleted file mode 100644
index cc472c7828..0000000000
--- a/packages/chat/src/components/AgentMessage/CopyButton/index.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import clsx from 'clsx';
-import { useState } from 'react';
-
-import { Icon } from '@/components/Icon';
-
-import { copyButton } from './CopyButton.css';
-
-export const CopyButton = ({ value = '', className }: { value: React.ReactNode; className: string }) => {
- const [isCopied, setIsCopied] = useState(false);
- const handleClick = () => {
- if (value) {
- navigator.clipboard.writeText(value.toString()).catch((err) => {
- console.error('Failed to copy text: ', err);
- });
- }
- };
-
- const handleMouseDown = () => {
- setIsCopied(true);
- };
-
- return (
- setIsCopied(false)}
- >
-
-
- );
-};
diff --git a/packages/chat/src/components/AgentMessage/code-theme.ts b/packages/chat/src/components/AgentMessage/code-theme.ts
deleted file mode 100644
index b65f45ea2c..0000000000
--- a/packages/chat/src/components/AgentMessage/code-theme.ts
+++ /dev/null
@@ -1,159 +0,0 @@
-import { COLORS } from '@/styles/colors';
-
-export default {
- 'code[class*="language-"]': {
- color: '#F1F2F2',
- textShadow: '0 1px rgba(0, 0, 0, 0.3)',
- fontFamily: 'Fira Code, monospace',
- fontSize: '12px',
- direction: 'ltr',
- textAlign: 'left',
- whiteSpace: 'pre',
- wordSpacing: 'normal',
- wordBreak: 'normal',
- lineHeight: '1.5',
- MozTabSize: '4',
- OTabSize: '4',
- tabSize: '4',
- WebkitHyphens: 'none',
- MozHyphens: 'none',
- msHyphens: 'none',
- hyphens: 'none',
- },
- 'pre[class*="language-"]': {
- color: '#F1F2F2',
- textShadow: '0 1px rgba(0, 0, 0, 0.3)',
- fontFamily: 'Fira Code, monospace',
- direction: 'ltr',
- textAlign: 'left',
- whiteSpace: 'pre',
- wordSpacing: 'normal',
- wordBreak: 'normal',
- lineHeight: '1.5',
- fontSize: '12px',
- MozTabSize: '4',
- OTabSize: '4',
- tabSize: '4',
- WebkitHyphens: 'none',
- MozHyphens: 'none',
- msHyphens: 'none',
- hyphens: 'none',
- padding: '1em',
- margin: '.5em 0',
- overflow: 'auto',
- borderRadius: '10px',
- background: COLORS.NEUTRAL_DARK[600],
- },
- ':not(pre) > code[class*="language-"]': {
- background: '#1d1f21',
- padding: '.1em',
- borderRadius: '10px',
- },
- comment: {
- color: '#F1F2F2',
- },
- prolog: {
- color: '#F1F2F2',
- },
- doctype: {
- color: '#F1F2F2',
- },
- cdata: {
- color: '#F1F2F2',
- },
- punctuation: {
- color: '#c5c8c6',
- },
- '.namespace': {
- Opacity: '.7',
- },
- property: {
- color: '#F1F2F2',
- },
- keyword: {
- color: '#96CBFE',
- },
- tag: {
- color: '#96CBFE',
- },
- 'class-name': {
- color: '#FFFFB6',
- textDecoration: 'underline',
- },
- boolean: {
- color: '#99CC99',
- },
- constant: {
- color: '#99CC99',
- },
- symbol: {
- color: '#f92672',
- },
- deleted: {
- color: '#f92672',
- },
- number: {
- color: '#FF73FD',
- },
- selector: {
- color: '#A8FF60',
- },
- 'attr-name': {
- color: '#A8FF60',
- },
- string: {
- color: '#B4D6E4',
- },
- char: {
- color: '#A8FF60',
- },
- builtin: {
- color: '#A8FF60',
- },
- inserted: {
- color: '#A8FF60',
- },
- variable: {
- color: '#C6C5FE',
- },
- operator: {
- color: '#EDEDED',
- },
- entity: {
- color: '#FFFFB6',
- cursor: 'help',
- },
- url: {
- color: '#96CBFE',
- },
- '.language-css .token.string': {
- color: '#87C38A',
- },
- '.style .token.string': {
- color: '#87C38A',
- },
- atrule: {
- color: '#F9EE98',
- },
- 'attr-value': {
- color: '#F9EE98',
- },
- function: {
- color: '#8ACD6F',
- },
- regex: {
- color: '#E9C062',
- },
- important: {
- color: '#fd971f',
- fontWeight: 'bold',
- },
- bold: {
- fontWeight: 'bold',
- },
- italic: {
- fontStyle: 'italic',
- },
-} as {
- [key: string]: React.CSSProperties;
-};
diff --git a/packages/chat/src/components/AgentMessage/index.tsx b/packages/chat/src/components/AgentMessage/index.tsx
deleted file mode 100644
index 972cd4db9c..0000000000
--- a/packages/chat/src/components/AgentMessage/index.tsx
+++ /dev/null
@@ -1,128 +0,0 @@
-import '../../styles.css';
-
-import type { Text } from '@voiceflow/base-types';
-import { serializeToMarkdown } from '@voiceflow/slate-serializer/markdown';
-import clsx from 'clsx';
-import Markdown from 'react-markdown';
-import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
-import remarkGfm from 'remark-gfm';
-
-import { FeedbackButton } from '../FeedbackButton';
-import { FeedbackButtonVariant, type IFeedbackButton } from '../FeedbackButton/FeedbackButton.interface';
-import { Icon } from '../Icon';
-import {
- agentMessageContainer,
- aiIconModifier,
- codeBlockContainer,
- contentStyle,
- copyButton,
- embeddedContent,
- feedbackButtonContainer,
- generatedChin,
- generatedChinContent,
- lastListItem,
- lastPElement,
- markdownParagraph,
-} from './AgentMessage.css';
-import codeTheme from './code-theme';
-import { CopyButton } from './CopyButton';
-
-interface IAgentMessage {
- text: string | Text.SlateTextValue;
- children?: React.ReactNode;
- ai?: boolean;
- disclaimerMessage?: string;
-
- isLast?: boolean;
- feedback?: IFeedbackButton | undefined;
-
- debug?: boolean;
- textContent?: string;
-}
-
-export const AgentMessage: React.FC = ({
- text,
- children,
- ai,
- disclaimerMessage = 'Generated by AI, double-check for accuracy.',
- isLast,
- feedback,
- textContent,
-}) => {
- const content = typeof text === 'string' ? text : serializeToMarkdown(text);
-
- const isCodeBlock = content?.startsWith('```javascript');
-
- return (
-
-
-
-
-
- ) : (
-
- {children}
-
- );
- },
- li: ({ children, ...props }) => {
- // NOTE: this accounts for when the last item in a response is a li and we remove the bottom margin from that.
- const position = props.node?.position;
- if (position && position.end.offset === text.length - 1) {
- return (
-
- {children}
-
- );
- }
- return {children} ;
- },
- p: ({ children, ...props }) => {
- const position = props.node?.position;
- const isFirst = position && position.start.offset === 0;
- const isLast = position && position.end.offset === text.length - 1;
- return (
-
- {children}
-
- );
- },
- }}
- />
- {children && {children}
}
- {ai && (
-
-
- {disclaimerMessage}
-
- )}
- {feedback && !isLast && (
-
-
-
- )}
-
- );
-};
diff --git a/packages/chat/src/components/Avatar/Avatar.story.tsx b/packages/chat/src/components/Avatar/Avatar.story.tsx
deleted file mode 100644
index 8ffc2710e1..0000000000
--- a/packages/chat/src/components/Avatar/Avatar.story.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import EMPTY_IMAGE from '../../__fixtures__/empty-image.png';
-import { Avatar } from '.';
-
-type Story = StoryObj;
-
-const meta: Meta = {
- title: 'Core/Avatar',
- component: Avatar,
- argTypes: {
- size: {
- options: ['small', 'large'],
- control: { type: 'radio' },
- defaultValue: 'small',
- },
- },
- args: {
- avatar: EMPTY_IMAGE,
- },
-};
-export default meta;
-
-export const Small: Story = {
- args: {
- size: 'small',
- },
-};
-
-export const Large: Story = {
- args: {
- size: 'large',
- },
-};
diff --git a/packages/chat/src/components/Avatar/index.tsx b/packages/chat/src/components/Avatar/index.tsx
deleted file mode 100644
index 55bb9497c5..0000000000
--- a/packages/chat/src/components/Avatar/index.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-import type { RecipeVariants } from '@vanilla-extract/recipes';
-import clsx from 'clsx';
-
-import { ClassName } from '@/constants';
-
-import { avatarStyles } from './styles.css';
-
-type AvatarVariants = NonNullable>;
-
-export interface AvatarProps {
- /**
- * An image URL which will be rendered as the background.
- */
- avatar: string;
-
- /**
- * Pre-defined size variants.
- *
- * @default 'small'
- */
- size?: AvatarVariants['size'];
-
- /**
- * Class name to pass into the Avatar component.
- */
- className?: string;
-
- /**
- * Flag to remove the background from the Avatar.
- */
- withoutBackground?: boolean;
-}
-
-/**
- * Displays an image in a circular frame.
- *
- * @see {@link https://voiceflow.github.io/react-chat/?path=/story/core-avatar--small}
- */
-export const Avatar: React.FC = ({ avatar, size, className, withoutBackground = false }) => (
-
-);
diff --git a/packages/chat/src/components/Avatar/styles.css.ts b/packages/chat/src/components/Avatar/styles.css.ts
deleted file mode 100644
index c6408f6392..0000000000
--- a/packages/chat/src/components/Avatar/styles.css.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-import { recipe } from '@vanilla-extract/recipes';
-
-import { COLORS } from '@/styles/colors';
-import { SIZES } from '@/styles/sizes';
-
-export const SMALL_AVATAR_SIZE = parseInt(SIZES.sm, 10);
-
-export const avatarStyles = recipe({
- base: {
- flexShrink: 0,
- borderRadius: SIZES.radius.round,
- backgroundColor: COLORS.white,
- backgroundPosition: 'center',
- backgroundRepeat: 'no-repeat',
- backgroundSize: 'cover',
- },
-
- variants: {
- size: {
- small: {
- height: SMALL_AVATAR_SIZE,
- width: SMALL_AVATAR_SIZE,
- },
-
- large: {
- height: SIZES.xxl,
- width: SIZES.xxl,
- boxSizing: 'border-box',
- boxShadow:
- '0px 0px 0px 1px rgba(22, 26, 30, 0.06), 0px 1px 1px 0px rgba(22, 26, 30, 0.01), 0px 4px 8px -18px rgba(22, 26, 30, 0.04), 0px 8px 12px -18px rgba(22, 26, 30, 0.04), 0px 10px 16px -18px rgba(22, 26, 30, 0.08), 0px 12px 20px -18px rgba(22, 26, 30, 0.08), 0px 16px 28px -18px rgba(22, 26, 30, 0.12), 0px 20px 44px -18px rgba(22, 26, 30, 0.12)',
- },
- },
-
- withoutBackground: {
- true: {
- backgroundColor: 'transparent',
- },
- },
- },
-
- defaultVariants: {
- size: 'small',
- },
-});
diff --git a/packages/chat/src/components/Button/Button.story.tsx b/packages/chat/src/components/Button/Button.story.tsx
deleted file mode 100644
index c8eca82294..0000000000
--- a/packages/chat/src/components/Button/Button.story.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import { WithDefaultPalette } from '@/storybook/decorators';
-
-import { Button } from '.';
-import { ButtonVariant } from './constants';
-
-const TEST_ID = 'test-id';
-
-type Story = StoryObj;
-const meta: Meta = {
- title: 'Core/Button',
- component: Button,
- argTypes: {
- variant: {
- options: Object.values(ButtonVariant),
- control: { type: 'radio' },
- defaultValue: ButtonVariant.PRIMARY,
- },
- },
- args: {
- children: 'Button label',
- round: false,
- onClick: () => {
- alert('Button clicked');
- },
- testID: TEST_ID,
- },
- decorators: [WithDefaultPalette],
-};
-
-export default meta;
-
-export const Primary: Story = {
- args: {
- variant: ButtonVariant.PRIMARY,
- },
-};
-
-export const PrimaryLarge: Story = {
- args: {
- variant: ButtonVariant.PRIMARY,
- large: 'true',
- },
-};
-
-export const Secondary: Story = {
- args: {
- variant: ButtonVariant.SECONDARY,
- },
-};
-
-export const SecondaryLarge: Story = {
- args: {
- variant: ButtonVariant.SECONDARY,
- large: 'true',
- },
-};
-
-export const Inline: Story = {
- args: {
- variant: ButtonVariant.INLINE,
- },
-};
-
-export const InlineWrapped: Story = {
- args: {
- variant: ButtonVariant.INLINE,
- children: 'Button label that is very long and should wrap. Button label that is very long and should wrap.',
- },
- render: () => {
- return (
-
-
- Button label that is very long and should wrap. Button label that is very long and should wrap.
-
-
- );
- },
-};
diff --git a/packages/chat/src/components/Button/Button.test.tsx b/packages/chat/src/components/Button/Button.test.tsx
deleted file mode 100644
index 48404a1aa0..0000000000
--- a/packages/chat/src/components/Button/Button.test.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { render, screen } from '@testing-library/react';
-import { describe, expect, it } from 'vitest';
-
-import { Button } from '.';
-
-describe('Button', () => {
- it('should render a button with a label', async () => {
- const label = 'Button Label';
-
- render({label} );
-
- expect(screen.getByText(label)).toBeInTheDocument();
- expect(screen.getByRole('button')).toBeInTheDocument();
- });
-});
diff --git a/packages/chat/src/components/Button/ButtonIcon/ButtonIcon.css.ts b/packages/chat/src/components/Button/ButtonIcon/ButtonIcon.css.ts
deleted file mode 100644
index 1a7698fa76..0000000000
--- a/packages/chat/src/components/Button/ButtonIcon/ButtonIcon.css.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { style } from '@vanilla-extract/css';
-
-import { COLORS } from '@/styles/colors';
-import { transition } from '@/styles/transitions';
-
-import { buttonStyles } from '../styles.css';
-
-const PRIMARY_BUTTON = buttonStyles.classNames.variants.type.primary;
-const SECONDARY_BUTTON = buttonStyles.classNames.variants.type.secondary;
-
-export const buttonIconStyles = style({
- transition: transition(['color']),
- selectors: {
- [`${PRIMARY_BUTTON} &`]: {
- color: COLORS.ACCENT[50],
- },
- [`${SECONDARY_BUTTON} &`]: {
- color: COLORS.NEUTRAL_DARK[400],
- },
- [`${SECONDARY_BUTTON}:active &`]: {
- color: COLORS.NEUTRAL_DARK[800],
- },
- },
-});
diff --git a/packages/chat/src/components/Button/ButtonIcon/index.tsx b/packages/chat/src/components/Button/ButtonIcon/index.tsx
deleted file mode 100644
index 9c5de5a3c0..0000000000
--- a/packages/chat/src/components/Button/ButtonIcon/index.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import clsx from 'clsx';
-
-import type { IconProps } from '../../Icon';
-import { Icon } from '../../Icon';
-import { buttonIconStyles } from './ButtonIcon.css';
-
-interface IButtonIcon {
- svg: IconProps['svg'];
- className?: string;
-}
-
-export const ButtonIcon: React.FC = ({ svg, className, ...props }) => {
- return ;
-};
diff --git a/packages/chat/src/components/Button/constants.ts b/packages/chat/src/components/Button/constants.ts
deleted file mode 100644
index 415c32a361..0000000000
--- a/packages/chat/src/components/Button/constants.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export enum ButtonVariant {
- PRIMARY = 'primary',
- SECONDARY = 'secondary',
- INLINE = 'inline',
-}
diff --git a/packages/chat/src/components/Button/index.tsx b/packages/chat/src/components/Button/index.tsx
deleted file mode 100644
index 7b75e0bbb3..0000000000
--- a/packages/chat/src/components/Button/index.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import clsx from 'clsx';
-import { type ComponentPropsWithRef, forwardRef, type PropsWithChildren } from 'react';
-
-import { ClassName } from '@/constants';
-
-import { ButtonVariant } from './constants';
-import { buttonStyles } from './styles.css';
-
-interface ButtonProps extends ComponentPropsWithRef<'button'> {
- variant?: ButtonVariant;
- large?: 'true';
- round?: boolean;
- testID?: string;
- className?: string;
-}
-
-export const Button = forwardRef>(({ children, ...props }, ref) => {
- const { variant: type, large, round } = props;
-
- return (
-
- {children}
-
- );
-});
diff --git a/packages/chat/src/components/Button/reset.css.ts b/packages/chat/src/components/Button/reset.css.ts
deleted file mode 100644
index 6ae66b51dd..0000000000
--- a/packages/chat/src/components/Button/reset.css.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { style } from '@vanilla-extract/css';
-
-export const buttonReset = style({
- border: 0,
- padding: 0,
- outline: 'transparent 0px',
- ':focus': {
- outline: 0,
- },
- ':hover': {
- cursor: 'pointer',
- },
-});
diff --git a/packages/chat/src/components/Button/styles.css.ts b/packages/chat/src/components/Button/styles.css.ts
deleted file mode 100644
index be0dfb3b59..0000000000
--- a/packages/chat/src/components/Button/styles.css.ts
+++ /dev/null
@@ -1,113 +0,0 @@
-import { recipe } from '@vanilla-extract/recipes';
-
-import { COLORS } from '@/styles/colors';
-import { THEME } from '@/styles/colors.css';
-import { hideTextOverflow } from '@/styles/font';
-import { SIZES } from '@/styles/sizes';
-import { transition } from '@/styles/transitions';
-
-import { cardContainer } from '../Card/styles.css';
-import { buttonReset } from './reset.css';
-
-export const buttonStyles = recipe({
- base: [
- buttonReset,
- {
- fontFamily: THEME.fontFamily,
- fontSize: '14px',
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- padding: '0 14px',
- transition: transition(['background-color', 'color']),
- borderRadius: SIZES.radius.sm,
- fontWeight: '400',
- overflowWrap: 'anywhere',
- ...hideTextOverflow(),
- },
- ],
-
- variants: {
- type: {
- inline: {
- borderRadius: SIZES.radius.xs,
- color: THEME.colors[500],
- backgroundColor: THEME.colors[50],
- lineHeight: '20px',
- padding: '7px 12px 6px 12px',
- whiteSpace: 'normal',
- wordBreak: 'break-word',
- textAlign: 'left',
- height: 'fit-content',
- ':hover': {
- color: THEME.colors[700],
- backgroundColor: THEME.colors[100],
- },
- ':active': {
- color: THEME.colors[800],
- backgroundColor: THEME.colors[200],
- },
- },
- primary: {
- paddingTop: 2,
- color: COLORS.white,
- backgroundColor: THEME.colors[500],
- borderRadius: SIZES.radius.xxs,
- height: SIZES.sm,
- fontWeight: 600,
- display: 'block',
- width: '100%',
- ':hover': {
- backgroundColor: THEME.colors[600],
- },
- ':active': {
- backgroundColor: THEME.colors[700],
- },
- },
- secondary: {
- paddingTop: 2,
- color: COLORS.NEUTRAL_DARK[500],
- backgroundColor: COLORS.NEUTRAL_DARK[9008],
- borderRadius: SIZES.radius.xxs,
- height: SIZES.sm,
- fontWeight: 600,
- display: 'block',
- width: '100%',
- ':hover': {
- color: COLORS.NEUTRAL_DARK[700],
- backgroundColor: COLORS.NEUTRAL_DARK[90012],
- },
- ':active': {
- color: COLORS.NEUTRAL_DARK[900],
- backgroundColor: COLORS.NEUTRAL_DARK[90020],
- },
-
- selectors: {
- // Specific styles for buttons inside the Card component
- [`.${cardContainer} &`]: {
- display: 'block',
- width: '100%',
- },
- },
- },
- },
-
- large: {
- true: {
- borderRadius: SIZES.radius.xs,
- padding: '11px 16px 9px 16px',
- height: 'auto',
- display: 'flex',
- alignItems: 'center',
- lineHeight: '20px',
- justifyContent: 'center',
- },
- },
-
- round: {
- true: {
- borderRadius: 9999,
- },
- },
- },
-});
diff --git a/packages/chat/src/components/Buttons/SquareButton/SquareButton.component.tsx b/packages/chat/src/components/Buttons/SquareButton/SquareButton.component.tsx
deleted file mode 100644
index bfd01935e0..0000000000
--- a/packages/chat/src/components/Buttons/SquareButton/SquareButton.component.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import clsx from 'clsx';
-
-import * as SVGs from '@/assets/svg';
-
-import { squareButtonStyles } from './styles/SquareButton.css';
-import * as SquareButtonTheme from './styles/SquareButtonTheme.css';
-import type { ISquareButton } from './types';
-
-export const SquareButton: React.FC = ({
- size = 'small',
- variant = 'light',
- iconName,
- isLoading,
- isActive,
- iconClassName,
- className,
- ...props
-}) => {
- const icon = SVGs[iconName];
- return (
-
- {icon({ title: iconName })}
-
- );
-};
diff --git a/packages/chat/src/components/Buttons/SquareButton/index.ts b/packages/chat/src/components/Buttons/SquareButton/index.ts
deleted file mode 100644
index 8eb169aef2..0000000000
--- a/packages/chat/src/components/Buttons/SquareButton/index.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import { SquareButton as SquareButtonComponent } from './SquareButton.component';
-import * as css from './styles/SquareButton.css';
-
-export type { ISquareButton } from './types';
-
-export const SquareButton = Object.assign(SquareButtonComponent, { css });
diff --git a/packages/chat/src/components/Buttons/SquareButton/styles/SquareButton.css.ts b/packages/chat/src/components/Buttons/SquareButton/styles/SquareButton.css.ts
deleted file mode 100644
index 402a4a5c39..0000000000
--- a/packages/chat/src/components/Buttons/SquareButton/styles/SquareButton.css.ts
+++ /dev/null
@@ -1,109 +0,0 @@
-import { style, styleVariants } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { transition } from '@/styles/transitions';
-
-import * as SquareButtonTheme from './SquareButtonTheme.css';
-
-const xLargeSize = '40px';
-const largeSize = '36px';
-const mediumSize = '32px';
-const smallSize = '24px';
-
-const hoveringStyles = {
- backgroundColor: SquareButtonTheme.contract.backgroundColor.hover,
- color: SquareButtonTheme.contract.color.hover,
-};
-
-const activeStyles = {
- backgroundColor: SquareButtonTheme.contract.backgroundColor.active,
- color: SquareButtonTheme.contract.color.active,
-};
-
-const baseSquareButtonStyles = style({
- border: '0',
- transition: transition(['background-color', 'color']),
- cursor: 'pointer',
- background: 'transparent',
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- color: SquareButtonTheme.contract.color.default,
-
- selectors: {
- '&:enabled:hover:not(:active)': hoveringStyles,
-
- '&:enabled:active:hover': {
- backgroundColor: SquareButtonTheme.contract.backgroundColor.active,
- color: SquareButtonTheme.contract.color.active,
- },
-
- '&:enabled:active': {
- backgroundColor: SquareButtonTheme.contract.backgroundColor.active,
- color: SquareButtonTheme.contract.color.active,
- },
- '&:disabled': {
- backgroundColor: SquareButtonTheme.contract.backgroundColor.disabled,
- color: SquareButtonTheme.contract.color.disabled,
- cursor: 'not-allowed',
- },
- },
-});
-
-export const squareButtonSizeVariants = styleVariants({
- xlarge: {
- height: xLargeSize,
- width: xLargeSize,
- borderRadius: '10px',
- padding: '8px',
- },
- large: {
- height: largeSize,
- width: largeSize,
- borderRadius: '8px',
- padding: '6px',
- },
- medium: {
- height: mediumSize,
- width: mediumSize,
- borderRadius: '7px',
- padding: '4px',
- },
- small: {
- height: smallSize,
- width: smallSize,
- borderRadius: '6px',
- padding: '0',
- },
-});
-
-export const squareButtonStyles = recipe({
- base: baseSquareButtonStyles,
- variants: {
- size: squareButtonSizeVariants,
- isHovering: {
- true: {
- selectors: {
- '&:enabled': hoveringStyles,
- },
- },
- },
- isActive: {
- true: {
- selectors: {
- '&:enabled': activeStyles,
- '&:enabled:hover': activeStyles,
- '&:enabled:hover:not(:active)': {
- backgroundColor: SquareButtonTheme.contract.backgroundColor.active,
- color: SquareButtonTheme.contract.color.active,
- },
- },
- },
- },
- },
-});
-
-export const loadingSpinnerStyles = style({
- // top: 1.5,
- position: 'relative',
-});
diff --git a/packages/chat/src/components/Buttons/SquareButton/styles/SquareButtonTheme.css.ts b/packages/chat/src/components/Buttons/SquareButton/styles/SquareButtonTheme.css.ts
deleted file mode 100644
index bd517ee2a9..0000000000
--- a/packages/chat/src/components/Buttons/SquareButton/styles/SquareButtonTheme.css.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import { createTheme } from '@vanilla-extract/css';
-
-import { COLORS } from '@/styles/colors';
-
-export const [light, contract] = createTheme({
- color: {
- default: COLORS.NEUTRAL_DARK[100],
- hover: COLORS.NEUTRAL_DARK[600],
- active: COLORS.NEUTRAL_DARK[800],
- disabled: COLORS.NEUTRAL_LIGHT[600],
- },
- backgroundColor: {
- hover: COLORS.NEUTRAL_DARK[900_6],
- active: COLORS.NEUTRAL_DARK[900_12],
- disabled: COLORS.white[100],
- },
-});
-
-export const dark = createTheme(contract, {
- color: {
- default: COLORS.NEUTRAL_LIGHT[600],
- hover: COLORS.NEUTRAL_LIGHT[300],
- active: COLORS.NEUTRAL_LIGHT[50],
- disabled: COLORS.NEUTRAL_DARK[200],
- },
- backgroundColor: {
- hover: COLORS.NEUTRAL_DARK[400],
- active: COLORS.NEUTRAL_DARK[200],
- disabled: COLORS.NEUTRAL_DARK[600],
- },
-});
diff --git a/packages/chat/src/components/Buttons/SquareButton/types.ts b/packages/chat/src/components/Buttons/SquareButton/types.ts
deleted file mode 100644
index 061590efc4..0000000000
--- a/packages/chat/src/components/Buttons/SquareButton/types.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import type { SVG } from '@/components/Icon';
-
-export interface ISquareButton {
- iconName: SVG;
- disabled?: boolean;
- size: 'small' | 'medium' | 'large';
- isLoading?: boolean;
- onClick: () => void;
- iconClassName?: string;
- isActive?: boolean;
- className?: string;
- variant?: 'light' | 'dark';
- ref?: React.Ref;
-}
diff --git a/packages/chat/src/components/Card/Card.story.tsx b/packages/chat/src/components/Card/Card.story.tsx
deleted file mode 100644
index cc23394dcc..0000000000
--- a/packages/chat/src/components/Card/Card.story.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import tiledBg from '../../__fixtures__/tiled-bg.png';
-import { Card } from '.';
-
-type Story = StoryObj;
-
-const meta: Meta = {
- title: 'Components/Card',
- component: Card,
- args: {
- title: 'Title',
- image: '',
- description: 'Description.',
- actions: [],
- },
-};
-export default meta;
-
-export const Simple: Story = {};
-
-export const OnlyTitle: Story = {
- args: {
- description: undefined,
- },
-};
-
-export const OnlyDescription: Story = {
- args: {
- title: undefined,
- },
-};
-
-export const WithImage: Story = {
- args: {
- image: tiledBg,
- },
-};
-
-export const Actionable: Story = {
- args: {
- ...WithImage.args,
- actions: [
- { request: {} as any, name: 'Label' },
- { request: {} as any, name: 'Label' },
- { request: {} as any, name: 'Label' },
- ],
- },
-};
-
-export const OnlyActions: Story = {
- args: {
- title: undefined,
- description: undefined,
- actions: [
- { request: {} as any, name: 'Label' },
- { request: {} as any, name: 'Label' },
- { request: {} as any, name: 'Label' },
- ],
- },
-};
-
-export const WithLongLabels: Story = {
- args: {
- ...WithImage.args,
- actions: [
- { request: {} as any, name: 'First Button with a very long long long wrapping label' },
- { request: {} as any, name: 'Second Button with a shorter text' },
- { request: {} as any, name: 'Third button, also with a shorter text' },
- ],
- },
-};
-
-export const WithLongTitle: Story = {
- args: {
- ...WithImage.args,
- title: 'Long card title to wrap inside the card. Some more text to test the growth of card.',
- actions: [{ request: {} as any, name: 'First Button' }],
- },
-};
diff --git a/packages/chat/src/components/Card/index.tsx b/packages/chat/src/components/Card/index.tsx
deleted file mode 100644
index d29d0fa932..0000000000
--- a/packages/chat/src/components/Card/index.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-import clsx from 'clsx';
-import { useContext, useMemo } from 'react';
-
-import { ClassName } from '@/constants';
-import { RuntimeStateAPIContext } from '@/contexts';
-import { fadeInAndUp } from '@/styles/animation-utils.css';
-
-import { Button } from '../Button';
-import { ButtonVariant } from '../Button/constants';
-import {
- buttonSpacer,
- cardActions,
- cardContainer,
- cardContent,
- cardDescription,
- cardImage,
- cardTitle,
-} from './styles.css';
-import type { CardProps } from './types';
-
-/**
- * A titled card with content and optional controls.
- *
- * @see {@link https://voiceflow.github.io/react-chat/?path=/story/components-card--simple}
- */
-export const Card: React.FC = ({ title, description, image, actions = [], className = '' }) => {
- const runtime = useContext(RuntimeStateAPIContext);
-
- const buttons = useMemo(() => actions.filter(({ name }) => !!name), [actions]);
-
- return (
-
- {!!image &&
}
- {(title || description) && (
-
- {title &&
{title}
}
- {description &&
{description}
}
-
- )}
- {!title && !description && !!buttons?.length &&
}
- {!!buttons?.length && (
-
- {buttons.map(({ request, name }, index) => (
- runtime.interact(request, name)} key={index}>
- {name}
-
- ))}
-
- )}
-
- );
-};
diff --git a/packages/chat/src/components/Card/styles.css.ts b/packages/chat/src/components/Card/styles.css.ts
deleted file mode 100644
index bd8c5f2a18..0000000000
--- a/packages/chat/src/components/Card/styles.css.ts
+++ /dev/null
@@ -1,61 +0,0 @@
-import { style } from '@vanilla-extract/css';
-
-import { COLORS } from '@/styles/colors';
-import { THEME } from '@/styles/colors.css';
-import { SIZES } from '@/styles/sizes';
-
-export const CARD_WIDTH = 256;
-
-export const cardContainer = style({
- display: 'inline-flex',
- flexDirection: 'column',
- width: CARD_WIDTH,
- minWidth: CARD_WIDTH,
- boxSizing: 'content-box',
- overflow: 'hidden',
- borderRadius: SIZES.radius.sm,
- backgroundColor: COLORS.NEUTRAL_LIGHT[50],
-});
-
-export const cardImage = style({
- display: 'inline-block',
- width: '100%',
-});
-
-export const cardContent = style({
- display: 'flex',
- flexDirection: 'column',
- gap: 4,
- fontFamily: THEME.fontFamily,
- lineHeight: '20px',
- padding: '11px 16px 10px 16px',
-});
-
-export const cardActions = style({
- display: 'flex',
- flexDirection: 'column',
- padding: '0 16px 15px 16px',
- gap: 4,
- ':only-child': {
- marginTop: 16,
- },
-});
-
-export const cardTitle = style({
- fontSize: '14px',
- fontWeight: 600,
- color: COLORS.NEUTRAL_DARK[900],
- whiteSpace: 'normal',
-});
-
-export const cardDescription = style({
- fontSize: '14px',
- fontWeight: 400,
- color: COLORS.NEUTRAL_DARK[400],
- whiteSpace: 'normal',
-});
-
-export const buttonSpacer = style({
- height: 16,
- width: '100%',
-});
diff --git a/packages/chat/src/components/Card/types.ts b/packages/chat/src/components/Card/types.ts
deleted file mode 100644
index 9a0e88e080..0000000000
--- a/packages/chat/src/components/Card/types.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-import type { RuntimeAction } from '@voiceflow/sdk-runtime';
-
-export interface CardActionProps {
- /**
- * The label that will appear on the button.
- */
- name: string;
-
- /**
- * the request that will be sent by the runtime when the button is clicked.
- */
- request: RuntimeAction;
-}
-
-export interface CardProps {
- /**
- * The title of the card.
- */
- title: string;
-
- /**
- * Text content of the card.
- */
- description: string;
-
- /**
- * An image URL that will render at the top of the card if provided.
- */
- image?: string | undefined | null;
-
- /**
- * A list of actions that will appear as button controls at the bottom of the card.
- */
- actions?: CardActionProps[] | undefined;
-
- /**
- * Extra className to add to this component.
- */
- className?: string;
-}
diff --git a/packages/chat/src/components/Carousel/Carousel.story.tsx b/packages/chat/src/components/Carousel/Carousel.story.tsx
deleted file mode 100644
index 55948668fa..0000000000
--- a/packages/chat/src/components/Carousel/Carousel.story.tsx
+++ /dev/null
@@ -1,166 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import { DEFAULT_WIDGET_SETTINGS } from '@/__fixtures__/mock-assistant';
-import { RuntimeProvider } from '@/contexts';
-import { MOCK_IMAGE } from '@/fixtures';
-import { DEFAULT_AVATAR, RenderMode } from '@/main';
-import { WithDefaultPalette } from '@/storybook/decorators';
-import { widgetContainer } from '@/views/ChatWidget/styles.css';
-
-import { NewChat } from '../NewChat';
-import { MessageType } from '../SystemResponse/constants';
-import { SystemMessage } from '../SystemResponse/SystemMessage';
-import { Carousel } from '.';
-
-const meta: Meta = {
- component: Carousel,
- title: 'Components/Carousel',
- decorators: [
- (Story) => (
-
-
- Promise.resolve(),
- placeholder: 'Message...',
- },
- }}
- isLoading={false}
- hasEnded={false}
- >
- {Story()}
-
-
-
- ),
- WithDefaultPalette,
- ],
-};
-type Story = StoryObj;
-
-export default meta;
-
-const IMAGE = MOCK_IMAGE;
-const FIRST_CARD = {
- title: 'First Card',
- description: 'Lorem ipsum dolor sit amet',
- image: IMAGE,
- actions: [
- { request: {} as any, name: 'First Button' },
- { request: {} as any, name: 'Second Button' },
- { request: {} as any, name: 'Third Button' },
- ],
-};
-
-const MULTIPLE_CARDS = [
- FIRST_CARD,
- {
- title: 'Second Card',
- description:
- 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Exercitationem voluptas perspiciatis est quis dolores!',
- image: IMAGE,
- },
- {
- title: 'Third Card with a long title that wraps',
- description: 'Lorem ipsum dolor sit amet consectetur adipisicing elit.',
- actions: [
- { request: {} as any, name: 'Fourth Button with a long label that wraps' },
- { request: {} as any, name: 'Fifth Button' },
- ],
- },
-];
-
-export const Default: Story = {
- render: () => (
- <>
-
-
- >
- ),
-};
-
-export const SingleCard: Story = {
- render: () => (
- <>
-
-
- >
- ),
-};
-
-export const MultipleCards: Story = {
- render: () => (
- <>
-
-
- >
- ),
-};
diff --git a/packages/chat/src/components/Carousel/CarouselButton.story.tsx b/packages/chat/src/components/Carousel/CarouselButton.story.tsx
deleted file mode 100644
index 0466cc677a..0000000000
--- a/packages/chat/src/components/Carousel/CarouselButton.story.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import { CarouselButton } from './CarouselButton';
-
-type Story = StoryObj;
-const meta: Meta = {
- title: 'Core/Carousel Button',
- component: CarouselButton,
- args: {
- visible: true,
- },
-};
-
-export default meta;
-
-export const Right: Story = {
- args: {
- direction: 'right',
- },
-};
-
-export const Left: Story = {
- args: {
- direction: 'left',
- },
-};
diff --git a/packages/chat/src/components/Carousel/CarouselButton.tsx b/packages/chat/src/components/Carousel/CarouselButton.tsx
deleted file mode 100644
index f938deb7c2..0000000000
--- a/packages/chat/src/components/Carousel/CarouselButton.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import clsx from 'clsx';
-import type { MouseEventHandler } from 'react';
-import { forwardRef } from 'react';
-
-import { Icon } from '@/components/Icon';
-
-import { buttonReset } from '../Button/reset.css';
-import { buttonWrapper, carouselButton, rotate180 } from './carouselButtonStyles.css';
-
-export interface CarouselButtonProps {
- /**
- * If true then the button will be visible, otherwise hidden.
- */
- visible: boolean;
-
- /**
- * Which direction the button should point.
- */
- direction: 'right' | 'left';
-
- /**
- * If true, it means the user doesn't want to show the agent's avatar
- * so we need to move the buttons accordingly.
- */
- noAvatar: boolean;
-
- /**
- * A click handler for the button.
- */
- onClick?: MouseEventHandler;
-}
-
-/**
- * A button used to scroll to the previous or next Card in a Carousel.
- */
-export const CarouselButton = forwardRef(
- ({ onClick, visible, direction, noAvatar }, ref) => (
-
-
-
-
-
- )
-);
diff --git a/packages/chat/src/components/Carousel/carouselButtonStyles.css.ts b/packages/chat/src/components/Carousel/carouselButtonStyles.css.ts
deleted file mode 100644
index 1d0a936cb6..0000000000
--- a/packages/chat/src/components/Carousel/carouselButtonStyles.css.ts
+++ /dev/null
@@ -1,186 +0,0 @@
-import { keyframes, style } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { COLORS } from '@/styles/colors';
-import { transition } from '@/styles/transitions';
-
-import { SMALL_AVATAR_SIZE } from '../Avatar/styles.css';
-import { buttonStyles } from '../Button/styles.css';
-import { CARD_WIDTH } from '../Card/styles.css';
-import { MESSAGE_PADDING } from '../SystemResponse/styles.css';
-import { BUTTON_SIZE, carouselContainer } from './styles.css';
-
-const xOrigin = 'translateX(0)';
-const fadeInFromLeft = keyframes({
- from: {
- opacity: 0,
- transform: 'translateX(-10px)',
- },
- to: {
- opacity: 1,
- transform: xOrigin,
- },
-});
-
-const fadeOutToLeft = keyframes({
- from: {
- opacity: 1,
- transform: xOrigin,
- },
- to: {
- opacity: 0,
- transform: 'translateX(-10px)',
- },
-});
-
-const fadeInFromRight = keyframes({
- from: {
- opacity: 0,
- transform: 'translateX(10px)',
- },
- to: {
- opacity: 1,
- transform: xOrigin,
- },
-});
-
-const fadeOutToRight = keyframes({
- from: {
- opacity: 1,
- transform: xOrigin,
- },
- to: {
- opacity: 0,
- transform: 'translateX(10px)',
- },
-});
-
-export const buttonWrapper = recipe({
- base: {
- backgroundColor: 'transparent',
- height: BUTTON_SIZE + 6,
- width: BUTTON_SIZE + 6,
- padding: 2,
- position: 'absolute',
- top: '64px',
- },
-
- variants: {
- direction: {
- right: {
- [`.${carouselContainer} &`]: {
- left: `${SMALL_AVATAR_SIZE + MESSAGE_PADDING + (CARD_WIDTH - BUTTON_SIZE / 2) - 2}px`,
- },
- },
- left: {
- [`.${carouselContainer} &`]: {
- left: `${-(BUTTON_SIZE / 2) + SMALL_AVATAR_SIZE + MESSAGE_PADDING - 2}px`,
- },
- },
- },
- visible: {
- true: {
- opacity: 1,
- pointerEvents: 'auto',
- },
- false: {
- opacity: 0,
- pointerEvents: 'none',
- },
- },
- withAvatar: {
- false: {},
- },
- },
- compoundVariants: [
- {
- variants: {
- visible: true,
- direction: 'left',
- },
- style: {
- opacity: 1,
- animation: `${fadeInFromLeft} .15s ease-in`,
- },
- },
- {
- variants: {
- direction: 'left',
- withAvatar: false,
- },
- style: {
- [`.${carouselContainer} &`]: {
- left: `${-(BUTTON_SIZE / 2) - 2}px`,
- },
- },
- },
- {
- variants: {
- visible: false,
- direction: 'left',
- },
- style: {
- opacity: 0,
- animation: `${fadeOutToLeft} .15s ease-in`,
- },
- },
-
- {
- variants: {
- visible: true,
- direction: 'right',
- },
- style: {
- opacity: 1,
- animation: `${fadeInFromRight} .15s ease-in`,
- },
- },
- {
- variants: {
- direction: 'right',
- withAvatar: false,
- },
- style: {
- [`.${carouselContainer} &`]: {
- left: `${CARD_WIDTH - BUTTON_SIZE / 2 - 2}px`,
- },
- },
- },
- {
- variants: {
- visible: false,
- direction: 'right',
- },
- style: {
- opacity: 0,
- animation: `${fadeOutToRight} .15s ease-in`,
- },
- },
- ],
-});
-
-export const carouselButton = recipe({
- base: [
- buttonStyles({ round: true }),
- {
- borderRadius: '50%',
- color: COLORS.NEUTRAL_DARK[100],
- border: `solid 1px ${COLORS.NEUTRAL_LIGHT[100]}`,
- backgroundColor: COLORS.white,
- boxShadow: '0px 3px 4px 0px rgba(0, 0, 0, 0.02), 0px 8px 42px -16px rgba(0, 0, 0, 0.06)',
- transition: transition(['opacity', 'color', 'transform']),
- ':hover': {
- color: COLORS.NEUTRAL_DARK[600],
- transform: 'scale(1.15)',
- },
- ':active': {
- color: COLORS.NEUTRAL_DARK[800],
- transform: 'scale(0.8)',
- },
- },
- ],
-});
-
-export const rotate180 = style({
- transform: 'rotate(180deg)',
-});
diff --git a/packages/chat/src/components/Carousel/hooks.ts b/packages/chat/src/components/Carousel/hooks.ts
deleted file mode 100644
index c8184c85ab..0000000000
--- a/packages/chat/src/components/Carousel/hooks.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-import type { RefObject } from 'react';
-import { useEffect, useState } from 'react';
-
-import { CARD_WIDTH } from '../Card/styles.css';
-import type { CardProps } from '../Card/types';
-import { GUTTER_WIDTH } from './styles.css';
-
-export const useScrollTo =
- (ref: RefObject | undefined, getNextIndex: (el: T) => number) =>
- () => {
- const el = ref?.current;
- if (!el) return;
-
- const index = getNextIndex(el);
-
- el.scrollTo({
- left: index && index * (CARD_WIDTH + GUTTER_WIDTH),
- behavior: 'smooth',
- });
- };
-
-export const useScrollObserver = (containerRef: RefObject | undefined, cards: CardProps[]) => {
- const [showPreviousButton, setShowPreviousButton] = useState(false);
- const [showNextButton, setShowNextButton] = useState(false);
- const hasMultipleCards = cards.length > 1;
-
- useEffect(() => {
- if (!hasMultipleCards) return;
-
- setShowNextButton(true);
- }, []);
-
- useEffect(() => {
- const containerEl = containerRef?.current;
- if (!containerEl || !hasMultipleCards) return undefined;
-
- const trackWidth = (CARD_WIDTH + GUTTER_WIDTH) * cards.length - GUTTER_WIDTH;
-
- const handleScroll = (): void => {
- const { scrollLeft } = containerEl;
-
- setShowPreviousButton(scrollLeft >= CARD_WIDTH);
- setShowNextButton(scrollLeft <= trackWidth - (CARD_WIDTH + GUTTER_WIDTH));
- };
-
- containerEl.addEventListener('scroll', handleScroll);
-
- return () => {
- containerEl.removeEventListener('scroll', handleScroll);
- };
- }, []);
-
- return {
- showPreviousButton,
- showNextButton,
- };
-};
diff --git a/packages/chat/src/components/Carousel/index.tsx b/packages/chat/src/components/Carousel/index.tsx
deleted file mode 100644
index 45a33eb94d..0000000000
--- a/packages/chat/src/components/Carousel/index.tsx
+++ /dev/null
@@ -1,90 +0,0 @@
-import clsx from 'clsx';
-import { useRef } from 'react';
-
-import { ClassName } from '@/constants';
-import { fadeInAndUp } from '@/styles/animation-utils.css';
-
-import { Avatar } from '../Avatar';
-import { Card } from '../Card';
-import { CARD_WIDTH } from '../Card/styles.css';
-import type { CardProps } from '../Card/types';
-import { FeedbackButton } from '../FeedbackButton';
-import { FeedbackButtonVariant, type IFeedbackButton } from '../FeedbackButton/FeedbackButton.interface';
-import { feedbackContainer, hide, responseAvatar } from '../SystemResponse/styles.css';
-import { CarouselButton } from './CarouselButton';
-import { useScrollObserver, useScrollTo } from './hooks';
-import {
- avatarStyle,
- cardsContainer,
- cardsInnerContainer,
- carouselContainer,
- firstCard,
- GUTTER_WIDTH,
- lastCardSpacer,
-} from './styles.css';
-
-const CARD_WITH_GUTTER = CARD_WIDTH + GUTTER_WIDTH;
-
-export interface CarouselProps {
- /**
- * A list of props objects which will be passed to {@link Card} components.
- */
- cards: CardProps[];
-
- /**
- * An image URL for an avatar to associate this message with.
- */
- avatar?: string;
-
- /**
- * If true, renders an avatar next to the message.
- */
- withImage: boolean;
-
- /**
- * If provided, will display {@link FeedbackButton} component.
- * @default false
- */
- feedback?: IFeedbackButton | undefined;
-}
-
-/**
- * A carousel of {@link Card} components that can be scrolled natively or with buttons.
- *
- * @see {@link https://voiceflow.github.io/react-chat/?path=/story/components-carousel--single-card}
- */
-export const Carousel: React.FC = ({ cards, avatar, withImage, feedback }) => {
- const scrollContainerRef = useRef(null);
- const { showPreviousButton, showNextButton } = useScrollObserver(scrollContainerRef, cards);
- const scrollToPrevious = useScrollTo(scrollContainerRef, (el) => Math.ceil(el.scrollLeft / CARD_WITH_GUTTER) - 1);
- const scrollToNext = useScrollTo(scrollContainerRef, (el) => Math.floor(el.scrollLeft / CARD_WITH_GUTTER) + 1);
-
- return (
-
-
-
- {avatar &&
}
- {cards.map((card, i) => (
-
-
-
- ))}
-
-
- {feedback && (
-
-
-
- )}
-
-
-
-
- );
-};
diff --git a/packages/chat/src/components/Carousel/styles.css.ts b/packages/chat/src/components/Carousel/styles.css.ts
deleted file mode 100644
index 55fd7e1205..0000000000
--- a/packages/chat/src/components/Carousel/styles.css.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import { style } from '@vanilla-extract/css';
-
-import { DIALOG_PADDING } from '../NewChat/NewChat.css';
-
-export const BUTTON_SIZE = 42;
-export const GUTTER_WIDTH = 10;
-
-export const avatarStyle = style({
- alignSelf: 'flex-end',
-});
-
-export const cardsContainer = style({
- position: 'relative',
- whiteSpace: 'nowrap',
- overflow: 'hidden',
- marginLeft: `-${DIALOG_PADDING}px`,
- paddingLeft: `${DIALOG_PADDING}px`,
- marginRight: `-${DIALOG_PADDING}px`,
- paddingRight: `${DIALOG_PADDING}px`,
-});
-
-export const firstCard = style({
- marginLeft: 2,
-});
-
-export const cardsInnerContainer = style({
- display: 'flex',
- alignItems: 'start',
- gap: `${GUTTER_WIDTH}px`,
-});
-
-export const carouselContainer = style({
- position: 'relative',
- width: '100%',
- display: 'flex',
-});
-
-export const lastCardSpacer = style({
- display: 'inline-flex',
- height: 1,
- // This is larger than the 'space' at the end, but is ok
- // since we need it to be good for popover mode as well.
- width: 600,
- minWidth: 600,
-});
diff --git a/packages/chat/src/components/ColorTheme/ColorTheme.component.tsx b/packages/chat/src/components/ColorTheme/ColorTheme.component.tsx
deleted file mode 100644
index 019dee283d..0000000000
--- a/packages/chat/src/components/ColorTheme/ColorTheme.component.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { createPalette } from '@/styles/colors';
-
-import { container, derivativeColor, derivativeColorContainer, primaryColorBlock } from './ColorTheme.css';
-
-export const ColorTheme = ({ color }: { color: string }) => {
- const palette = createPalette(color);
- return (
-
-
-
500
- {color}
-
-
- {Object.entries(palette).map(([key, value]) => (
-
-
{key}
- {value}
-
- ))}
-
-
- );
-};
diff --git a/packages/chat/src/components/ColorTheme/ColorTheme.css.ts b/packages/chat/src/components/ColorTheme/ColorTheme.css.ts
deleted file mode 100644
index 5b0c6a80cf..0000000000
--- a/packages/chat/src/components/ColorTheme/ColorTheme.css.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { style } from '@vanilla-extract/css';
-
-export const container = style({
- display: 'inline-flex',
- flexDirection: 'row',
- gap: '1rem',
-});
-
-export const primaryColorBlock = style({
- width: '250px',
- height: '250px',
- color: 'white',
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- flexDirection: 'column',
- gap: '1rem',
-});
-
-export const derivativeColorContainer = style({
- display: 'flex',
- gap: '1rem',
-});
-
-export const derivativeColor = style({
- display: 'flex',
- gap: '1rem',
- flexDirection: 'column',
- color: 'white',
- padding: '1rem',
- justifyContent: 'center',
- alignItems: 'center',
-});
diff --git a/packages/chat/src/components/ColorTheme/ColorTheme.story.tsx b/packages/chat/src/components/ColorTheme/ColorTheme.story.tsx
deleted file mode 100644
index 2758db25df..0000000000
--- a/packages/chat/src/components/ColorTheme/ColorTheme.story.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import { COLOR_FIXTURE } from '@/__fixtures__/colors';
-
-import { ColorTheme } from './ColorTheme.component';
-
-type Story = StoryObj;
-const meta: Meta = {
- title: 'Theme/Colors',
- component: ColorTheme,
-};
-
-export default meta;
-
-export const Primary: Story = {
- render: () => {
- return (
-
- {COLOR_FIXTURE.map((color, index) => (
-
-
-
- ))}
-
- );
- },
-};
diff --git a/packages/chat/src/components/DebugMessage/index.tsx b/packages/chat/src/components/DebugMessage/index.tsx
deleted file mode 100644
index a5d2deaa90..0000000000
--- a/packages/chat/src/components/DebugMessage/index.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import clsx from 'clsx';
-
-import { topCaret as TopCaret } from '@/assets/svg';
-
-import { caretStyles, debugContainerStyles } from './styles.css';
-
-export interface DebugMessageProps extends React.PropsWithChildren {
- /**
- * The end of the message where the arrow is rendered.
- *
- * @default 'left'
- */
- orientation?: 'left' | 'right';
-}
-
-export const DebugMessage: React.FC = ({ children, orientation = 'left' }) => {
- return (
-
-
- {children}
-
- );
-};
diff --git a/packages/chat/src/components/DebugMessage/styled.css.ts b/packages/chat/src/components/DebugMessage/styled.css.ts
deleted file mode 100644
index 06b252bcad..0000000000
--- a/packages/chat/src/components/DebugMessage/styled.css.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import { style } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { COLORS } from '@/styles/colors';
-
-const CARET_HEIGHT = 6;
-const OFFSET = 32;
-
-export const debugContainerStyles = style({
- position: 'relative',
- marginTop: CARET_HEIGHT,
- border: '1px solid #dfdfdf',
- padding: '10px 14px',
- backgroundColor: COLORS.white,
- boxShadow: '0 1px 2px rgba(0,0,0,0.02)',
-});
-
-export const caretStyles = recipe({
- base: {
- position: 'absolute',
- top: -CARET_HEIGHT,
- },
- variants: {
- orientation: {
- left: {
- left: OFFSET,
- right: 'unset',
- },
- right: {
- right: OFFSET,
- left: 'unset',
- },
- },
- },
- defaultVariants: {
- orientation: 'left',
- },
-});
diff --git a/packages/chat/src/components/DebugMessage/styles.css.ts b/packages/chat/src/components/DebugMessage/styles.css.ts
deleted file mode 100644
index 06b252bcad..0000000000
--- a/packages/chat/src/components/DebugMessage/styles.css.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import { style } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { COLORS } from '@/styles/colors';
-
-const CARET_HEIGHT = 6;
-const OFFSET = 32;
-
-export const debugContainerStyles = style({
- position: 'relative',
- marginTop: CARET_HEIGHT,
- border: '1px solid #dfdfdf',
- padding: '10px 14px',
- backgroundColor: COLORS.white,
- boxShadow: '0 1px 2px rgba(0,0,0,0.02)',
-});
-
-export const caretStyles = recipe({
- base: {
- position: 'absolute',
- top: -CARET_HEIGHT,
- },
- variants: {
- orientation: {
- left: {
- left: OFFSET,
- right: 'unset',
- },
- right: {
- right: OFFSET,
- left: 'unset',
- },
- },
- },
- defaultVariants: {
- orientation: 'left',
- },
-});
diff --git a/packages/chat/src/components/FeedbackButton/CopyButtonIcon.component.tsx b/packages/chat/src/components/FeedbackButton/CopyButtonIcon.component.tsx
deleted file mode 100644
index ee11ef201d..0000000000
--- a/packages/chat/src/components/FeedbackButton/CopyButtonIcon.component.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import type { SVGProps } from 'react';
-export const CopyButtonIcon = (props: SVGProps) => (
-
-
-
-);
diff --git a/packages/chat/src/components/FeedbackButton/FeedbackButton.css.ts b/packages/chat/src/components/FeedbackButton/FeedbackButton.css.ts
deleted file mode 100644
index 419ee305dc..0000000000
--- a/packages/chat/src/components/FeedbackButton/FeedbackButton.css.ts
+++ /dev/null
@@ -1,116 +0,0 @@
-import { createVar, style } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { SHADOWS } from '@/styles/box-shadows';
-import { COLORS } from '@/styles/colors';
-import { THEME } from '@/styles/colors.css';
-import { transition } from '@/styles/transitions';
-
-export const activeBackground = createVar();
-export const activeIconColor = createVar();
-
-export const feedbackContainer = recipe({
- base: {
- display: 'flex',
- flexDirection: 'row',
- gap: '4px',
- borderRadius: '7px',
- padding: '2px',
- boxShadow: SHADOWS.Z1_Light,
- width: 'fit-content',
- },
- variants: {
- previousResponse: {
- true: {
- backgroundColor: COLORS.white,
- },
- false: {
- backgroundColor: 'transparent',
- boxShadow: 'none',
- gap: '6px',
- },
- },
- },
-});
-
-export const feedbackButtonStyles = recipe({
- base: {
- borderRadius: '5px',
- height: '24px',
- width: '24px',
- cursor: 'pointer',
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- border: 'none',
- position: 'relative',
- backgroundColor: 'transparent',
- transition: transition(['background-color', 'color']),
- color: COLORS.NEUTRAL_DARK[100],
- outline: 'transparent 0px',
- selectors: {
- '&:hover': {
- backgroundColor: COLORS.NEUTRAL_DARK[9006],
- color: COLORS.NEUTRAL_DARK[600],
- },
- '&:active': {
- backgroundColor: COLORS.NEUTRAL_DARK[90012],
- color: COLORS.NEUTRAL_DARK[800],
- },
- },
- },
- variants: {
- isSelected: {
- true: {
- color: THEME.colors[500],
- selectors: {
- '&:hover': {
- backgroundColor: 'transparent',
- color: THEME.colors[500],
- },
- '&:active': {
- backgroundColor: 'transparent',
- color: THEME.colors[500],
- },
- },
- },
- },
- isCopied: {
- true: {
- selectors: {
- '&:hover': {
- backgroundColor: 'transparent',
- color: COLORS.NEUTRAL_DARK[100],
- },
- },
- },
- },
- },
-});
-
-export const iconStyle = style({
- flex: 'none',
-});
-
-export const checkedIcon = style({
- color: THEME.colors[500],
-});
-
-export const copyButtonStyles = recipe({
- base: {
- position: 'absolute',
- top: '0',
- right: '0',
- transition: transition(['opacity']),
- },
- variants: {
- isVisible: {
- true: {
- opacity: 1,
- },
- false: {
- opacity: 0,
- },
- },
- },
-});
diff --git a/packages/chat/src/components/FeedbackButton/FeedbackButton.interface.ts b/packages/chat/src/components/FeedbackButton/FeedbackButton.interface.ts
deleted file mode 100644
index 582a9d77a1..0000000000
--- a/packages/chat/src/components/FeedbackButton/FeedbackButton.interface.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import type { FeedbackName } from '@/contexts/RuntimeContext/useRuntimeAPI';
-
-/**
- * Feedback buttons look different if they're on the last response from the agent
- * or if they're on a previous response from the agent, so we need this to
- * distinguish between them.
- */
-export enum FeedbackButtonVariant {
- LAST_RESPONSE = 'last_response',
- PREVIOUS_RESPONSE = 'previous_response',
-}
-
-export interface IFeedbackButton {
- onClick: (feedback: FeedbackName) => void;
- variant?: FeedbackButtonVariant;
- active?: boolean;
- textContent?: string;
- testID?: string;
-}
diff --git a/packages/chat/src/components/FeedbackButton/FeedbackButton.story.tsx b/packages/chat/src/components/FeedbackButton/FeedbackButton.story.tsx
deleted file mode 100644
index 342e30b411..0000000000
--- a/packages/chat/src/components/FeedbackButton/FeedbackButton.story.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-import { assignInlineVars } from '@vanilla-extract/dynamic';
-
-import { createPalette } from '@/styles/colors';
-import { THEME } from '@/styles/colors.css';
-import { FAMILY } from '@/styles/font';
-
-import { FeedbackButton } from '.';
-import { FeedbackButtonVariant } from './FeedbackButton.interface';
-
-const meta: Meta = {
- title: 'Button/FeedbackButton',
- component: FeedbackButton,
- args: {},
-};
-
-export default meta;
-type Story = StoryObj;
-
-export const PreviousResponse: Story = {
- render: () => (
-
- null} variant={FeedbackButtonVariant.PREVIOUS_RESPONSE} />
-
- ),
-};
-
-export const LastResponse: Story = {
- render: () => (
-
- null} variant={FeedbackButtonVariant.LAST_RESPONSE} />
-
- ),
-};
diff --git a/packages/chat/src/components/FeedbackButton/FeedbackButton.test.tsx b/packages/chat/src/components/FeedbackButton/FeedbackButton.test.tsx
deleted file mode 100644
index 6fdc90e996..0000000000
--- a/packages/chat/src/components/FeedbackButton/FeedbackButton.test.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { render, screen } from '@testing-library/react';
-import { describe, expect, it, vi } from 'vitest';
-
-import { FeedbackButton } from '.';
-
-describe('Button', () => {
- it('onClick callback fires properly', async () => {
- const onClick = vi.fn();
- const testID = 'button';
- render( );
- screen.getByTestId(`${testID}--positive`).click();
-
- expect(onClick).toHaveBeenCalledTimes(1);
- });
-});
diff --git a/packages/chat/src/components/FeedbackButton/ThumbsDownIcon.component.tsx b/packages/chat/src/components/FeedbackButton/ThumbsDownIcon.component.tsx
deleted file mode 100644
index 0fdf34943f..0000000000
--- a/packages/chat/src/components/FeedbackButton/ThumbsDownIcon.component.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import type { SVGProps } from 'react';
-export const ThumbsDownIcon = (props: SVGProps) => (
-
-
-
-);
diff --git a/packages/chat/src/components/FeedbackButton/ThumbsUpIcon.component.tsx b/packages/chat/src/components/FeedbackButton/ThumbsUpIcon.component.tsx
deleted file mode 100644
index ae5ff329c1..0000000000
--- a/packages/chat/src/components/FeedbackButton/ThumbsUpIcon.component.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import type { SVGProps } from 'react';
-export const ThumbsUpIcon = (props: SVGProps) => (
-
-
-
-);
diff --git a/packages/chat/src/components/FeedbackButton/index.tsx b/packages/chat/src/components/FeedbackButton/index.tsx
deleted file mode 100644
index d34d7fc58b..0000000000
--- a/packages/chat/src/components/FeedbackButton/index.tsx
+++ /dev/null
@@ -1,88 +0,0 @@
-import { assignInlineVars } from '@vanilla-extract/dynamic';
-import clsx from 'clsx';
-import { useEffect, useState } from 'react';
-
-import { ClassName } from '@/constants';
-import { FeedbackName } from '@/contexts/RuntimeContext/useRuntimeAPI';
-import { THEME } from '@/styles/colors.css';
-
-import { Icon } from '../Icon';
-import { CopyButtonIcon } from './CopyButtonIcon.component';
-import {
- activeBackground,
- activeIconColor,
- checkedIcon,
- copyButtonStyles,
- feedbackButtonStyles,
- feedbackContainer,
- iconStyle,
-} from './FeedbackButton.css';
-import { FeedbackButtonVariant, type IFeedbackButton } from './FeedbackButton.interface';
-import { ThumbsDownIcon } from './ThumbsDownIcon.component';
-import { ThumbsUpIcon } from './ThumbsUpIcon.component';
-
-export const FeedbackButton: React.FC = ({ variant, onClick, testID, textContent }) => {
- const buttonActiveColor = THEME.colors[500];
- const iconActiveColor = THEME.colors[50];
- const [hasCopied, setHasCopied] = useState(false);
- const [isPositiveOrNegativeSelected, setIsPositiveOrNegativeSelected] = useState(null);
-
- const onCopyClick = () => {
- setHasCopied(true);
- if (!textContent) return;
- navigator.clipboard.writeText(textContent);
- };
-
- const handleOnClick = (type: FeedbackName) => {
- onClick(type);
- setIsPositiveOrNegativeSelected(type);
- };
-
- // eslint-disable-next-line consistent-return
- useEffect(() => {
- if (hasCopied) {
- const timeout = setTimeout(() => {
- setHasCopied(false);
- }, 1000);
- return () => clearTimeout(timeout);
- }
- }, [hasCopied]);
-
- return (
-
- {textContent && (
-
-
-
-
- )}
- handleOnClick(FeedbackName.POSITIVE)}
- data-testid={`${testID}--positive`}
- >
-
-
- handleOnClick(FeedbackName.NEGATIVE)}
- data-testid={`${testID}--negative`}
- >
-
-
-
- );
-};
diff --git a/packages/chat/src/components/Header/Header.story.tsx b/packages/chat/src/components/Header/Header.story.tsx
deleted file mode 100644
index aba3a92fc4..0000000000
--- a/packages/chat/src/components/Header/Header.story.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import EMPTY_IMAGE from '@/__fixtures__/empty-image.png';
-import { WithDefaultPalette } from '@/storybook/decorators';
-
-import { Header } from '.';
-
-const meta: Meta = {
- title: 'Components/Chat/Header',
- component: Header,
- args: {
- title: 'Agent name',
- image: EMPTY_IMAGE,
- actions: [],
- showImage: true,
- },
- render: (args) => ,
- decorators: [WithDefaultPalette],
-};
-
-export default meta;
-
-type Story = StoryObj;
-
-export const Base: Story = {};
-
-export const Actionable: Story = {
- args: {
- actions: [{ svg: 'volume' }, { svg: 'reset' }],
- },
-};
-
-export const Muted: Story = {
- args: {
- actions: [{ svg: 'mute' }, { svg: 'reset' }],
- },
-};
-
-export const Themed: Story = {
- args: {
- actions: [{ svg: 'volume' }, { svg: 'reset' }],
- },
- decorators: [WithDefaultPalette],
-};
-
-export const NoImage: Story = {
- args: {
- actions: [{ svg: 'volume' }, { svg: 'reset' }],
- image: undefined,
- },
- decorators: [WithDefaultPalette],
-};
-
-export const Mobile: Story = {
- args: {
- actions: [{ svg: 'volume' }, { svg: 'reset' }, { svg: 'close' }],
- },
- decorators: [WithDefaultPalette],
-};
diff --git a/packages/chat/src/components/Header/index.tsx b/packages/chat/src/components/Header/index.tsx
deleted file mode 100644
index f4692b0212..0000000000
--- a/packages/chat/src/components/Header/index.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import clsx from 'clsx';
-
-import { Avatar } from '@/components/Avatar';
-import { ClassName } from '@/constants';
-import { DEFAULT_CHAT_AVATAR } from '@/dtos/AssistantOptions.dto';
-
-import { Button } from '../Button';
-import { Icon, type IconProps } from '../Icon';
-import { headerActionButton, headerActions, headerContainer, headerInnerContainer, headerTitle } from './styles.css';
-
-export interface HeaderActionProps {
- /**
- * The name of the SVG icon that will be used for the button or a React component.
- *
- * @see {@link https://github.com/voiceflow/react-chat/tree/master/packages/react-chat/src/assets/svg the available icons}
- */
- svg: IconProps['svg'];
-
- /**
- * A callback that is executed when the button is clicked.
- */
- onClick?: React.MouseEventHandler | undefined;
-}
-
-export interface HeaderProps {
- /**
- * The name of your assistant or title of the conversation.
- */
- title: string;
-
- /**
- * Should we show the image in the header.
- */
- showImage: boolean;
-
- /**
- * An image URL that will be rendered as a small {@link Avatar}.
- */
- image?: string;
-
- /**
- * A list of actions that will appear as icon buttons.
- */
- actions?: HeaderActionProps[];
-}
-
-/**
- * Header for the chat widget with image, title and controls.
- *
- * @see {@link https://voiceflow.github.io/react-chat/?path=/docs/components-chat-header--simple}
- */
-export const Header: React.FC = ({ title, showImage, image, actions = [] }) => {
- return (
-
- {showImage &&
}
-
-
{title}
-
- {actions.map(({ svg, onClick }, index) => (
-
-
-
- ))}
-
-
-
- );
-};
diff --git a/packages/chat/src/components/Header/styles.css.ts b/packages/chat/src/components/Header/styles.css.ts
deleted file mode 100644
index f62a4ca683..0000000000
--- a/packages/chat/src/components/Header/styles.css.ts
+++ /dev/null
@@ -1,112 +0,0 @@
-import { keyframes, style } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { timingFunction } from '@/styles/animations';
-import { COLORS } from '@/styles/colors';
-import { THEME } from '@/styles/colors.css';
-import { hideTextOverflow } from '@/styles/font';
-import { SIZES } from '@/styles/sizes';
-import { transition } from '@/styles/transitions';
-import { chatIsClosed, chatIsOpen } from '@/views/ChatWidget/styles.css';
-
-import { buttonReset } from '../Button/reset.css';
-export const fadeIn = keyframes({
- from: {
- opacity: 0,
- transform: 'translateY(-10px)',
- },
- to: {
- opacity: 1,
- transform: 'translateY(0)',
- },
-});
-
-export const fadeOut = keyframes({
- from: {
- opacity: 1,
- transform: 'translateY(0)',
- },
- to: {
- opacity: 0,
- transform: 'translateY(-10px)',
- },
-});
-
-export const headerContainer = style({
- display: 'flex',
- alignItems: 'center',
- backgroundColor: THEME.colors[500],
- padding: '12px 16px 12px 20px',
- height: parseInt(SIZES.sm, 10) + 24, // Add the top and bottom padding
- opacity: 0,
- selectors: {
- [`.${chatIsOpen} &`]: {
- animation: `${fadeIn} .4s ${timingFunction.gentle} forwards`,
- animationDelay: '.2s',
- },
- [`.${chatIsClosed} &`]: {
- animation: `${fadeOut} .3s ${timingFunction.gentle} forwards`,
- },
- },
-});
-
-export const headerInnerContainer = style({
- display: 'flex',
- alignItems: 'center',
- flexGrow: 1,
- justifyContent: 'space-between',
- minWidth: 0,
-});
-
-export const headerTitle = recipe({
- base: {
- fontFamily: THEME.fontFamily,
- fontSize: 16,
- color: COLORS.white,
- fontWeight: 700,
- lineHeight: '23px',
- margin: '0 12px',
- minWidth: 0,
- ...hideTextOverflow(),
- },
-
- variants: {
- hasAvatar: {
- false: {
- marginLeft: 0,
- },
- },
- },
-});
-
-export const headerActions = style({
- display: 'flex',
- gap: '6px',
- flexShrink: 0,
- minWidth: 0,
-});
-
-export const headerActionButton = recipe({
- base: [
- buttonReset,
- {
- justifyContent: 'center',
- alignItems: 'center',
- width: 32,
- height: 32,
- borderRadius: SIZES.radius.xs,
- padding: 4,
- color: '#ffffffcc',
- backgroundColor: 'transparent',
- transition: transition(['color', 'background-color']),
- ':hover': {
- color: COLORS.white,
- backgroundColor: '#ffffff29',
- },
- ':active': {
- color: COLORS.white,
- backgroundColor: '#ffffff52',
- },
- },
- ],
-});
diff --git a/packages/chat/src/components/Icon/Icon.story.tsx b/packages/chat/src/components/Icon/Icon.story.tsx
deleted file mode 100644
index 1af0da380a..0000000000
--- a/packages/chat/src/components/Icon/Icon.story.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import * as SVGs from '@/assets/svg';
-
-import { Icon } from '.';
-
-type Story = StoryObj;
-
-const meta: Meta = {
- title: 'Core/Icon',
- component: Icon,
- argTypes: {
- svg: {
- options: Object.keys(SVGs).filter((svg) => svg !== 'topCaret'),
- control: { type: 'radio' },
- },
- },
- parameters: {
- controls: { include: ['svg'] },
- },
-};
-
-export default meta;
-export const Default: Story = {
- args: {
- svg: 'close',
- },
-};
diff --git a/packages/chat/src/components/Icon/index.tsx b/packages/chat/src/components/Icon/index.tsx
deleted file mode 100644
index ed76115c2c..0000000000
--- a/packages/chat/src/components/Icon/index.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import clsx from 'clsx';
-
-import * as SVGs from '@/assets/svg';
-import { ClassName } from '@/constants';
-
-import { iconClassName } from './styles.css';
-
-export type SVG = keyof typeof SVGs;
-
-export interface IconProps extends React.ComponentPropsWithoutRef<'div'> {
- /**
- * The name of the SVG icon to be rendered or a React component.
- *
- * @see {@link https://github.com/voiceflow/react-chat/tree/master/packages/react-chat/src/assets/svg the available icons}
- */
- svg: SVG | React.ComponentType;
-
- className?: string;
-}
-
-/**
- * A component for rendering a pre-packaged SVG icon.
- *
- * @see {@link https://voiceflow.github.io/react-chat/?path=/story/core-icon--default}
- */
-export const Icon: React.FC = ({ svg, className, ...props }) => {
- const SVG = typeof svg === 'string' ? SVGs[svg] : svg;
-
- return (
-
-
-
- );
-};
diff --git a/packages/chat/src/components/Icon/styles.css.ts b/packages/chat/src/components/Icon/styles.css.ts
deleted file mode 100644
index 563e2e859e..0000000000
--- a/packages/chat/src/components/Icon/styles.css.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import { style } from '@vanilla-extract/css';
-
-export const iconClassName = style({
- display: 'flex',
-});
diff --git a/packages/chat/src/components/Image/Image.story.tsx b/packages/chat/src/components/Image/Image.story.tsx
deleted file mode 100644
index 0367345674..0000000000
--- a/packages/chat/src/components/Image/Image.story.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import { MOCK_IMAGE } from '@/fixtures';
-
-import { Image } from '.';
-
-type Story = StoryObj;
-
-const meta: Meta = {
- title: 'Core/Image',
- component: Image,
- args: {
- image: MOCK_IMAGE,
- isRounded: true,
- },
-};
-
-export default meta;
-
-export const RoundCorners: Story = {};
-
-export const StraightCorners: Story = {
- args: {
- isRounded: false,
- },
-};
diff --git a/packages/chat/src/components/Image/index.tsx b/packages/chat/src/components/Image/index.tsx
deleted file mode 100644
index 50657c6f92..0000000000
--- a/packages/chat/src/components/Image/index.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import clsx from 'clsx';
-
-import { ClassName } from '@/constants';
-import type { RenderMode } from '@/main';
-
-import { imageStyles } from './styles.css';
-
-export interface DefaultImageProps {
- /**
- * A URL for the image to render.
- */
- image: string | null;
-
- /**
- * The mode which we're rendering the chat widget.
- * This effects the way we show images.
- */
- mode?: RenderMode;
-
- /**
- * If true, rounds the corners of the image border.
- *
- * @default true
- */
- isRounded?: boolean;
-}
-
-/**
- * An image rendered as the `src` of an ` `.
- *
- * @see {@link https://voiceflow.github.io/react-chat/?path=/story/core-image--round-corners}
- */
-export const Image: React.FC = ({ image, ...props }) => (
-
-);
diff --git a/packages/chat/src/components/Image/styles.css.ts b/packages/chat/src/components/Image/styles.css.ts
deleted file mode 100644
index 75aa4dfe7c..0000000000
--- a/packages/chat/src/components/Image/styles.css.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { recipe } from '@vanilla-extract/recipes';
-
-import { SIZES } from '@/styles/sizes';
-
-export const imageStyles = recipe({
- base: [],
- variants: {
- rounded: {
- true: {
- borderRadius: SIZES.radius.sm,
- },
- },
- mode: {
- overlay: {
- width: 248,
- },
- embedded: {
- width: '100%',
- maxWidth: 512,
- },
- },
- },
- defaultVariants: {
- rounded: true,
- mode: 'overlay',
- },
-});
diff --git a/packages/chat/src/components/Launcher/ChevronIcon.tsx b/packages/chat/src/components/Launcher/ChevronIcon.tsx
deleted file mode 100644
index ceeb073618..0000000000
--- a/packages/chat/src/components/Launcher/ChevronIcon.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import type { SVGProps } from 'react';
-export const ChevronIcon = (props: SVGProps) => (
-
-
-
-);
diff --git a/packages/chat/src/components/Launcher/Launcher.story.tsx b/packages/chat/src/components/Launcher/Launcher.story.tsx
deleted file mode 100644
index 9cf30667ef..0000000000
--- a/packages/chat/src/components/Launcher/Launcher.story.tsx
+++ /dev/null
@@ -1,89 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-import { useState } from 'react';
-
-import { WithDefaultPalette } from '@/storybook/decorators';
-
-import defaultLauncherImage from '../../__fixtures__/default-launcher-image.png';
-import tiledBg from '../../__fixtures__/tiled-bg.png';
-import { Launcher } from '.';
-
-type Story = StoryObj;
-
-const meta: Meta = {
- title: 'Components/Launcher',
- component: Launcher,
- parameters: {
- controls: { hideNoControlsWarning: true },
- },
- decorators: [WithDefaultPalette],
-};
-
-export default meta;
-
-const CollapsableLauncher = (props: any) => {
- const [isOpen, setIsOpen] = useState(false);
- const [counter, setCounter] = useState(0);
- const [isDisabled, setIsDisabled] = useState(false);
-
- return (
- {
- setIsOpen((prev) => !prev);
-
- setCounter((prev) => prev + 1);
-
- if (counter % 3 === 0) return;
-
- setIsDisabled(!isDisabled);
- }}
- />
- );
-};
-
-export const Base: Story = {
- render: () => ,
-};
-
-export const WithDefaultImage: Story = {
- render: () => ,
-};
-
-export const WithCustomIcon: Story = { render: () => };
-
-export const Disabled: Story = { render: () => };
-
-export const Loading: Story = { render: () => };
-
-export const DisabledAndLoading: Story = {
- render: () => {
- return ;
- },
-};
-
-export const WithLabel: Story = {
- render: () => (
-
-
-
- ),
-};
-
-export const WithLabelAndIcon: Story = {
- render: () => (
-
-
-
- ),
-};
-
-export const WithLabelOnRight: Story = {
- render: () => (
-
-
-
- ),
-};
diff --git a/packages/chat/src/components/Launcher/LauncherWithLabel/index.tsx b/packages/chat/src/components/Launcher/LauncherWithLabel/index.tsx
deleted file mode 100644
index b3705591cb..0000000000
--- a/packages/chat/src/components/Launcher/LauncherWithLabel/index.tsx
+++ /dev/null
@@ -1,116 +0,0 @@
-import clsx from 'clsx';
-import type { MouseEventHandler } from 'react';
-import React from 'react';
-
-import { Button } from '@/components/Button';
-import { ClassName } from '@/constants';
-
-import { LoadingSpinner } from '../../LoadingSpinner/LoadingSpinner';
-import { ChevronIcon } from '../ChevronIcon';
-import { DEFAULT_ICON } from '../constant';
-import { PhoneIcon } from '../PhoneIcon';
-import {
- closeChevron,
- containerLoaderStyles,
- imageIconStyle,
- imageIconWrapper,
- launcherLabelStyles,
- launcherStyles,
- loadingSpinnerStyles,
-} from './styles.css';
-
-export interface LauncherProps {
- /**
- * An image URL to be rendered as the icon.
- * Defaults to the "launch" SVG if not provided.
- */
- image?: string | undefined;
-
- /**
- * A label that will be displayed on the launcher button.
- * If empty or undefined then the user will only see the icon.
- */
- label?: string | undefined;
-
- /**
- * Is the Chat widget opened ?
- * If it's opened then we only show the close icon.
- */
- isOpen: boolean;
-
- /**
- * A callback that will be executed when the button is clicked.
- */
- onClick: MouseEventHandler;
-
- /**
- * Flag to use the default phone icon.
- */
- isVoice?: boolean;
-
- /**
- * Flag to use image.
- */
- withIcon?: boolean;
-
- /**
- * Flag to show loader in the launcher.
- */
- isLoading?: boolean;
-
- /**
- * Flag to disable the launcher.
- */
- isDisabled?: boolean;
-}
-
-/**
- * A floating action button used to launch the chat widget.
- *
- * @see {@link https://voiceflow.github.io/react-chat/?path=/story/components-launcher--default}
- */
-export const LauncherWithLabel: React.FC = ({
- isVoice,
- withIcon,
- image,
- isOpen,
- label,
- onClick,
- isLoading,
- isDisabled,
-}) => {
- const showDefaultPhoneIcon = !image && isVoice;
-
- const loader = (
-
-
-
- );
-
- return (
-
-
- {withIcon && (
- <>
- {isLoading && loader}
-
- {showDefaultPhoneIcon &&
}
-
- {!showDefaultPhoneIcon && (
-
- )}
- >
- )}
-
-
-
-
- {isLoading && !withIcon && loader}
-
- {label}
-
- );
-};
diff --git a/packages/chat/src/components/Launcher/LauncherWithLabel/styles.css.ts b/packages/chat/src/components/Launcher/LauncherWithLabel/styles.css.ts
deleted file mode 100644
index d0dcf3b7c3..0000000000
--- a/packages/chat/src/components/Launcher/LauncherWithLabel/styles.css.ts
+++ /dev/null
@@ -1,262 +0,0 @@
-import { keyframes, style, styleVariants } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { fadeInSlideUp } from '@/components/UserResponse/styles.css';
-import { duration } from '@/styles/animations';
-import { THEME } from '@/styles/colors.css';
-import { transition } from '@/styles/transitions';
-
-const LAUNCHER_WITH_LABEL_SIZE = 40;
-const BEZIER = 'cubic-bezier(0.4, 0, 0.2, 1)';
-
-const loadingVariant = styleVariants({
- true: {},
-});
-
-const noImageVariant = styleVariants({
- true: {},
-});
-
-export const launcherStyles = recipe({
- base: {
- borderRadius: '9999px',
- transition: `all ${duration.mid} ${BEZIER}`,
- overflow: 'hidden',
- whiteSpace: 'nowrap',
- textOverflow: 'ellipsis',
- color: THEME.colors[50],
- willChange: 'max-width, transform',
- height: LAUNCHER_WITH_LABEL_SIZE,
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- gap: '6px',
- fontFamily: THEME.fontFamily,
- fontSize: '14px',
- lineHeight: '20px',
- animation: `${fadeInSlideUp} ${duration.fast} ease-out`,
-
- boxShadow:
- '0px 1px 0px 0px rgba(22, 26, 30, 0.02), 0px 0px 0px 1px rgba(22, 26, 30, 0.04), 0px 1px 5px -4px rgba(22, 26, 30, 0.08), 0px 4px 8px -6px rgba(22, 26, 30, 0.08), 0px 1px 3px 1px rgba(22, 26, 30, 0.01)',
- fontWeight: '600',
- overflowWrap: 'anywhere',
- backgroundColor: THEME.colors[500],
- maxWidth: '500px',
- ':hover': {
- transform: 'scale(1.1)',
- backgroundColor: THEME.colors[600],
- },
- ':active': {
- transform: 'scale(0.8)',
- backgroundColor: THEME.colors[700],
- },
-
- '::before': {
- content: '""',
- top: '-4px',
- position: 'absolute',
- bottom: '-4px',
- left: '-4px',
- right: '-4px',
- borderRadius: 'inherit',
- backgroundColor: 'transparent',
- zIndex: -1,
- },
- },
- variants: {
- isOpen: {
- true: {
- maxWidth: LAUNCHER_WITH_LABEL_SIZE,
- filter: 'drop-shadow(rgba(0, 0, 0, 0.06) 0px 1px 6px) drop-shadow(rgba(0, 0, 0, 0.16) 0px 2px 32px)',
- gap: 0,
- padding: '8px',
- },
- false: {
- maxWidth: '500px',
- padding: '8px 16px 8px 12px',
- },
- },
- isDisabled: {
- true: {
- backgroundColor: THEME.colors[300],
-
- ':hover': {
- transform: 'none',
- backgroundColor: THEME.colors[300],
- },
- ':active': {
- transform: 'none',
- backgroundColor: THEME.colors[300],
- },
- },
- },
-
- noImage: noImageVariant,
- isLoading: loadingVariant,
- },
- compoundVariants: [
- {
- variants: {
- isOpen: false,
- noImage: true,
- },
- style: {
- paddingLeft: '10px',
- },
- },
- ],
-});
-
-export const launcherLabelStyles = style({
- overflow: 'hidden',
- whiteSpace: 'nowrap',
- textOverflow: 'ellipsis',
- textAlign: 'left',
- padding: '3px 0 1px 0',
- transition: `all ${duration.mid} ${BEZIER}`,
-
- selectors: {
- [`${loadingVariant.true}${noImageVariant.true} &`]: {
- opacity: 0,
- },
- },
-});
-
-export const twistInAnimation = keyframes({
- '0%': {
- opacity: 0,
- transform: 'rotate(-45deg)',
- },
- '100%': {
- opacity: 1,
- transform: 'rotate(0deg)',
- },
-});
-
-export const twistOutAnimation = keyframes({
- '0%': {
- transform: 'rotate(0deg)',
- },
- '100%': {
- opacity: 0,
- transform: 'rotate(-45deg)',
- },
-});
-
-export const closeChevron = recipe({
- base: {
- transform: 'rotate(0deg)',
- transition: transition(['width', 'opacity']),
- position: 'absolute',
- width: '32px',
- height: '32px',
- left: 0,
- opacity: 0,
-
- selectors: {
- [`${loadingVariant.true} &`]: {
- opacity: '0 !important',
- },
- },
- },
- variants: {
- isOpen: {
- true: {
- animation: `${twistInAnimation} 0.2s ease-in-out forwards`,
- animationDelay: '0.2s',
- },
- false: {
- animation: `${twistOutAnimation} 0.2s ease-in-out forwards`,
- pointerEvents: 'none',
- },
- },
- },
-});
-
-export const imageIconStyle = recipe({
- base: {
- height: '24px',
- width: '24px',
- position: 'absolute',
- borderRadius: 2,
- left: 0,
- pointerEvents: 'none',
-
- flexShrink: 0,
- transition: transition(['opacity']),
-
- selectors: {
- [`${loadingVariant.true} &`]: {
- opacity: 0,
- },
- },
- },
- variants: {
- isOpen: {
- true: {
- opacity: 0,
- transitionDelay: '0.2s',
- },
- false: {
- opacity: 1,
- },
- },
- },
-});
-
-export const imageIconWrapper = recipe({
- base: {
- position: 'relative',
- transition: transition(['min-width', 'min-height']),
- },
- variants: {
- noImage: { true: {}, false: {} },
- isOpen: {
- true: {
- transitionDelay: '0.2s',
- minWidth: '32px',
- minHeight: '32px',
- },
- false: {
- minWidth: '24px',
- minHeight: '24px',
- },
- },
- },
- compoundVariants: [
- {
- variants: {
- noImage: true,
- isOpen: false,
- },
- style: {
- minWidth: '0 !important',
- },
- },
- {
- variants: {
- noImage: true,
- isOpen: true,
- },
- style: {
- minWidth: '32px',
- },
- },
- ],
-});
-
-export const loadingSpinnerStyles = style({
- color: 'white',
- height: '24px',
- width: '24px',
-});
-
-export const containerLoaderStyles = style({
- position: 'absolute',
- top: '50%',
- left: '50%',
-
- height: '24px',
-
- transform: 'translate(-50%, -50%)',
-});
diff --git a/packages/chat/src/components/Launcher/PhoneIcon.tsx b/packages/chat/src/components/Launcher/PhoneIcon.tsx
deleted file mode 100644
index 720ccb2b34..0000000000
--- a/packages/chat/src/components/Launcher/PhoneIcon.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import type { SVGProps } from 'react';
-
-export const PhoneIcon = (props: SVGProps) => (
-
-
-
-);
diff --git a/packages/chat/src/components/Launcher/constant.ts b/packages/chat/src/components/Launcher/constant.ts
deleted file mode 100644
index 5be15c9a1d..0000000000
--- a/packages/chat/src/components/Launcher/constant.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const DEFAULT_ICON = 'https://cdn.voiceflow.com/widget-next/message.png';
diff --git a/packages/chat/src/components/Launcher/index.tsx b/packages/chat/src/components/Launcher/index.tsx
deleted file mode 100644
index 2c3c4716cd..0000000000
--- a/packages/chat/src/components/Launcher/index.tsx
+++ /dev/null
@@ -1,134 +0,0 @@
-import type { WidgetSettingsLauncherType } from '@voiceflow/dtos-interact';
-import clsx from 'clsx';
-import type { MouseEventHandler } from 'react';
-import React from 'react';
-
-import { ClassName } from '@/constants';
-
-import { Button } from '../Button';
-import { LoadingSpinner } from '../LoadingSpinner/LoadingSpinner';
-import { ChevronIcon } from './ChevronIcon';
-import { DEFAULT_ICON } from './constant';
-import { LauncherWithLabel } from './LauncherWithLabel';
-import { PhoneIcon } from './PhoneIcon';
-import {
- closeChevron,
- closeIconStyles,
- iconContainer,
- imageStyles,
- launcherContainer,
- launcherIconStyles,
- launcherStyles,
- loadingSpinnerStyles,
-} from './styles.css';
-
-export { DEFAULT_ICON };
-
-export interface LauncherProps {
- /**
- * The type of launcher we show.
- */
- type: WidgetSettingsLauncherType;
-
- /**
- * An image URL to be rendered as the icon.
- * Defaults to the "launch" SVG if not provided.
- */
- image?: string | undefined;
-
- /**
- * A label that will be displayed on the launcher button.
- * If empty or undefined then the user will only see the icon.
- */
- label?: string | undefined;
-
- /**
- * Is the Chat widget opened ?
- * If it's opened then we only show the close icon.
- */
- isOpen: boolean;
-
- /**
- * A callback that will be executed when the button is clicked.
- */
- onClick: MouseEventHandler;
-
- /**
- * Flag to use the default phone icon.
- */
- isVoice?: boolean;
-
- /**
- * Flag to show loader in the launcher.
- */
- isLoading?: boolean;
-
- /**
- * Flag to disable the launcher.
- */
- isDisabled?: boolean;
-}
-
-/**
- * A floating action button used to launch the chat widget.
- *
- * @see {@link https://voiceflow.github.io/react-chat/?path=/story/components-launcher--default}
- */
-export const Launcher: React.FC = ({
- image,
- type,
- isVoice,
- isOpen,
- label,
- onClick,
- isLoading = false,
- isDisabled = false,
-}) => {
- const withIcon = type !== 'label';
- const withLabel = type !== 'icon' && !!label?.length;
-
- if (withLabel) {
- return (
-
- );
- }
-
- const showDefaultPhoneIcon = !image && isVoice;
-
- return (
-
-
-
-
-
- {isLoading &&
}
-
- {withIcon && (
- <>
- {showDefaultPhoneIcon && (
-
- )}
-
- {!showDefaultPhoneIcon && (
-
- )}
- >
- )}
-
-
-
- );
-};
diff --git a/packages/chat/src/components/Launcher/styles.css.ts b/packages/chat/src/components/Launcher/styles.css.ts
deleted file mode 100644
index 83fd5130b0..0000000000
--- a/packages/chat/src/components/Launcher/styles.css.ts
+++ /dev/null
@@ -1,303 +0,0 @@
-import { keyframes, style } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { duration } from '@/styles/animations';
-import { THEME } from '@/styles/colors.css';
-import { transition } from '@/styles/transitions';
-
-import { buttonStyles } from '../Button/styles.css';
-import { fadeInSlideUp } from '../UserResponse/styles.css';
-
-export const LAUNCHER_SIZE = 48;
-export const LAUNCHER_WITH_LABEL_SIZE = 40;
-
-export const launcherContainer = style({
- width: 'fit-content',
-});
-
-export const launcherStyles = recipe({
- base: [
- buttonStyles({ round: true }),
- {
- display: 'flex',
- height: LAUNCHER_SIZE,
- minWidth: '48px',
- backgroundColor: THEME.colors[500],
- position: 'relative', // Establish positioning context
- transition: 'all 0.15s ease-in-out',
- boxShadow:
- '0px 1px 0px 0px rgba(22, 26, 30, 0.02), 0px 0px 0px 1px rgba(22, 26, 30, 0.04), 0px 1px 5px -4px rgba(22, 26, 30, 0.08), 0px 4px 8px -6px rgba(22, 26, 30, 0.08), 0px 1px 3px 1px rgba(22, 26, 30, 0.01)',
-
- animation: `${fadeInSlideUp} ${duration.fast} ease-out`,
- width: LAUNCHER_SIZE,
- padding: '8px',
- ':hover': {
- transform: 'scale(1.1)',
- backgroundColor: THEME.colors[600],
- },
- ':active': {
- transform: 'scale(0.8)',
- backgroundColor: THEME.colors[700],
- },
-
- '::before': {
- content: '""',
- top: '-4px',
- position: 'absolute',
- bottom: '-4px',
- left: '-4px',
- right: '-4px',
- borderRadius: 'inherit',
- backgroundColor: 'transparent',
- zIndex: -1,
- },
- },
- ],
-
- variants: {
- isOpen: {
- true: {
- filter: 'drop-shadow(rgba(0, 0, 0, 0.06) 0px 1px 6px) drop-shadow(rgba(0, 0, 0, 0.16) 0px 2px 32px)',
- overflow: 'initial',
- height: '48px',
- width: '48px',
- },
- },
-
- isDisabled: {
- true: {
- backgroundColor: THEME.colors[300],
-
- ':hover': {
- transform: 'none',
- backgroundColor: THEME.colors[300],
- },
- ':active': {
- transform: 'none',
- backgroundColor: THEME.colors[300],
- },
- },
- },
-
- isLoading: {
- true: {},
- },
- },
-});
-
-export const loadingSpinnerStyles = style({
- color: 'white',
- height: '24px',
- width: '24px',
-});
-
-export const iconContainer = recipe({
- base: {
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- position: 'relative',
- width: '32px',
- height: '32px',
- },
- variants: {
- isOpen: {
- true: {},
- false: {
- width: '24px',
- height: '24px',
- },
- },
- withIcon: { false: {} },
- },
- compoundVariants: [
- {
- variants: {
- withIcon: false,
- isOpen: false,
- },
- style: {
- width: 0,
- height: 0,
- },
- },
- ],
-});
-
-export const launcherLabelStyles = recipe({
- base: {
- fontSize: '14px',
- fontWeight: 600,
- color: THEME.colors[50],
- lineHeight: '20px',
- marginLeft: '6px',
- paddingTop: 1,
- opacity: 1,
- width: 'fit-content',
- transition: 'opacity 50ms, max-width 100ms, margin-left 300ms',
- },
- variants: {
- isOpen: {
- true: {
- opacity: 0,
- maxWidth: 0,
- width: 0,
- marginLeft: 0,
- },
- false: {
- opacity: 1,
- maxWidth: 'fit-content',
- width: 'fit-content',
- },
- },
- },
-});
-
-export const closeIconStyles = recipe({
- base: {
- color: THEME.colors[50],
- width: 32,
- height: 32,
- borderRadius: 2,
- flexShrink: 0,
- },
- variants: {
- withLabel: {
- true: {
- width: 24,
- height: 24,
- },
- },
- },
-});
-
-export const launcherIconStyles = recipe({
- base: {
- width: 32,
- height: 32,
- borderRadius: 2,
- position: 'absolute',
- flexShrink: 0,
- transition: transition(['opacity']),
- animationDelay: '0.1s',
- },
- variants: {
- isOpen: {
- true: {
- opacity: 0,
- },
- false: {
- opacity: 1,
- },
- },
- },
-});
-
-export const twistInAnimation = keyframes({
- '0%': {
- opacity: 0,
- transform: 'rotate(-45deg)',
- },
- '100%': {
- opacity: 1,
- transform: 'rotate(0deg)',
- },
-});
-
-export const twistOutAnimation = keyframes({
- '0%': {
- transform: 'rotate(0deg)',
- },
- '100%': {
- opacity: 0,
- transform: 'rotate(-45deg)',
- },
-});
-
-export const closeChevron = recipe({
- base: {
- transform: 'rotate(0deg)',
- transition: transition(['width', 'opacity']),
- position: 'absolute',
- width: '32px',
- opacity: 0,
- },
- variants: {
- isOpen: {
- true: {},
- false: {},
- },
-
- isLoading: {
- true: {},
- },
- },
-
- compoundVariants: [
- {
- variants: {
- isOpen: true,
- isLoading: false,
- },
- style: {
- animation: `${twistInAnimation} 0.2s ease-in-out`,
- opacity: 1,
- },
- },
- {
- variants: {
- isOpen: false,
- isLoading: false,
- },
- style: {
- animation: `${twistOutAnimation} 0.2s ease-in-out`,
- opacity: 0,
- pointerEvents: 'none',
- },
- },
- {
- variants: {
- isLoading: true,
- isOpen: true,
- },
- style: {
- opacity: 0,
- },
- },
- {
- variants: {
- isLoading: true,
- isOpen: false,
- },
- style: {
- opacity: 0,
- },
- },
- ],
-});
-
-export const imageStyles = recipe({
- base: {
- transition: transition(['opacity', 'width']),
- height: '32px',
- width: '32px',
- minWidth: '32px',
- pointerEvents: 'none',
- },
- variants: {
- isOpen: {
- true: {
- opacity: 0,
- width: 0,
- },
- false: {
- opacity: 1,
- },
- },
- isLoading: {
- true: {
- opacity: 0,
- },
- },
- },
-});
diff --git a/packages/chat/src/components/LinkPreview/LinkPreview.story.tsx b/packages/chat/src/components/LinkPreview/LinkPreview.story.tsx
deleted file mode 100644
index 7d6ff755c3..0000000000
--- a/packages/chat/src/components/LinkPreview/LinkPreview.story.tsx
+++ /dev/null
@@ -1,85 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import tiledBg from '../../__fixtures__/tiled-bg.png';
-import { LinkPreview } from '.';
-type Story = StoryObj;
-
-const meta: Meta = {
- title: 'Components/LinkPreview',
- component: LinkPreview,
- parameters: {
- controls: { hideNoControlsWarning: true },
- },
-};
-
-export default meta;
-
-export const Default: Story = {
- args: {
- image: tiledBg,
- title:
- 'Lorem ipsum dolor sit amet consectetur. Quis risus nibh tincidunt platea. A donec amet gravida aliquam sed eget aliquet sollicitudin turpis.',
- link: 'websiteexample.com',
- },
-};
-
-export const Loading: Story = {
- args: {
- title:
- 'Lorem ipsum dolor sit amet consectetur. Quis risus nibh tincidunt platea. A donec amet gravida aliquam sed eget aliquet sollicitudin turpis.',
- link: 'websiteexample.com',
- },
-};
-
-export const DocumentUrl: Story = {
- args: {
- title:
- 'Lorem ipsum dolor sit amet consectetur. Quis risus nibh tincidunt platea. A donec amet gravida aliquam sed eget aliquet sollicitudin turpis.',
- link: 'https://google.com',
- },
-};
-
-export const DocumentPdf: Story = {
- args: {
- title:
- 'Lorem ipsum dolor sit amet consectetur. Quis risus nibh tincidunt platea. A donec amet gravida aliquam sed eget aliquet sollicitudin turpis.',
- link: 'some_guide.pdf',
- },
-};
-
-export const Inline: Story = {
- args: {
- inline: true,
- image: tiledBg,
- title:
- 'Lorem ipsum dolor sit amet consectetur. Quis risus nibh tincidunt platea. A donec amet gravida aliquam sed eget aliquet sollicitudin turpis.',
- link: 'websiteexample.com',
- },
-};
-
-export const LoadingInline: Story = {
- args: {
- inline: true,
- title:
- 'Lorem ipsum dolor sit amet consectetur. Quis risus nibh tincidunt platea. A donec amet gravida aliquam sed eget aliquet sollicitudin turpis.',
- link: 'websiteexample.com',
- },
-};
-
-export const InlineDocumentUrl: Story = {
- args: {
- inline: true,
- title:
- 'Lorem ipsum dolor sit amet consectetur. Quis risus nibh tincidunt platea. A donec amet gravida aliquam sed eget aliquet sollicitudin turpis.',
- link: 'https://google.com',
- },
-};
-
-export const InlineDocumentPdf: Story = {
- args: {
- inline: true,
- title:
- 'Lorem ipsum dolor sit amet consectetur. Quis risus nibh tincidunt platea. A donec amet gravida aliquam sed eget aliquet sollicitudin turpis.',
- link: 'some_guide.pdf',
- },
-};
diff --git a/packages/chat/src/components/LinkPreview/index.tsx b/packages/chat/src/components/LinkPreview/index.tsx
deleted file mode 100644
index 9ad0781aa2..0000000000
--- a/packages/chat/src/components/LinkPreview/index.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { forwardRef, type PropsWithRef } from 'react';
-
-import { Icon } from '../Icon';
-import { LoadingSpinner } from '../LoadingSpinner/LoadingSpinner';
-import {
- linkPreviewContainer,
- linkPreviewDetails,
- linkPreviewImage,
- linkPreviewImageContainer,
- linkPreviewTitle,
- linkPreviewUrl,
-} from './styles.css';
-import { getImageTypeFromUrl } from './utils';
-
-interface ILinkPreviewProps {
- image?: string;
- title: string;
- link: string;
- inline?: boolean;
-}
-
-export const LinkPreview = forwardRef>((props: any, ref) => {
- const { image, title, link, inline } = props;
- const linkType = getImageTypeFromUrl(link);
- const shadow = linkType === 'custom' && !image;
-
- return (
-
-
- {linkType === 'pdf' &&
}
- {linkType === 'url' &&
}
- {linkType === 'custom' && !image &&
}
- {linkType === 'custom' && image &&
}
-
-
-
- );
-});
diff --git a/packages/chat/src/components/LinkPreview/styles.css.ts b/packages/chat/src/components/LinkPreview/styles.css.ts
deleted file mode 100644
index 9ccd801be3..0000000000
--- a/packages/chat/src/components/LinkPreview/styles.css.ts
+++ /dev/null
@@ -1,167 +0,0 @@
-import { style } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { COLORS } from '@/styles/colors';
-import { THEME } from '@/styles/colors.css';
-import { hideTextOverflow, lineClamp } from '@/styles/font';
-import { SIZES } from '@/styles/sizes';
-import { transition } from '@/styles/transitions';
-
-export const linkPreviewContainer = recipe({
- base: [
- {
- display: 'flex',
- borderRadius: SIZES.radius.sm,
- padding: '6px 8px 6px 6px',
- backgroundColor: COLORS.NEUTRAL_LIGHT[50],
- fontFamily: THEME.fontFamily,
- transition: transition(['color', 'background-color']),
- ':hover': {
- cursor: 'pointer',
- backgroundColor: COLORS.NEUTRAL_LIGHT[100],
- },
- ':active': {
- backgroundColor: COLORS.NEUTRAL_LIGHT[200],
- },
- },
- ],
-
- variants: {
- inline: {
- true: {
- padding: '4px 8px 4px 4px',
- borderRadius: SIZES.radius.xs,
- backgroundColor: COLORS.NEUTRAL_LIGHT[100],
- ':hover': {
- backgroundColor: COLORS.NEUTRAL_LIGHT[200],
- },
- ':active': {
- backgroundColor: COLORS.NEUTRAL_LIGHT[300],
- },
- },
- },
- },
-});
-
-export const linkPreviewImageContainer = recipe({
- base: {
- position: 'relative',
- width: 52,
- height: 52,
- flexShrink: 0,
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- borderRadius: SIZES.radius.xxxs,
- marginRight: 8,
- backgroundColor: COLORS.NEUTRAL_DARK[9006],
- overflow: 'hidden',
- ':hover': {
- backgroundColor: COLORS.NEUTRAL_DARK[9008],
- },
- ':active': {
- backgroundColor: COLORS.NEUTRAL_DARK[90012],
- },
- },
-
- variants: {
- inline: {
- true: {
- width: 35,
- height: 35,
- color: COLORS.NEUTRAL_DARK[300],
- backgroundColor: COLORS.NEUTRAL_DARK[9008],
- ':hover': {
- color: COLORS.NEUTRAL_DARK[500],
- backgroundColor: COLORS.NEUTRAL_DARK[90012],
- },
- ':active': {
- color: COLORS.NEUTRAL_DARK[700],
- backgroundColor: COLORS.NEUTRAL_DARK[90016],
- },
- },
- },
- shadow: {
- true: {
- boxShadow: 'none',
- },
- false: {
- // Creates an inset box-shadow over an image
- '::after': {
- content: '',
- position: 'absolute',
- height: '100%',
- width: '100%',
- top: 0,
- right: 0,
- display: 'block',
- boxShadow: '0px -1px 0px 0px rgba(0, 0, 0, 0.08) inset',
- },
- },
- },
- },
-});
-
-export const linkPreviewImage = style({
- width: '100%',
-});
-
-export const linkPreviewDetails = style({
- fontSize: '12px',
- fontWeight: 600,
- lineHeight: '17px',
- overflow: 'hidden',
-});
-
-export const linkPreviewTitle = recipe({
- base: {
- flexGrow: 1,
- color: COLORS.NEUTRAL_DARK[900],
- maxHeight: '34px',
- ...lineClamp(2),
- },
- variants: {
- inline: {
- true: {
- display: 'block',
- maxHeight: '17px',
- ...hideTextOverflow(),
- },
- },
- },
-});
-
-export const linkPreviewUrl = recipe({
- base: {
- flexShrink: 0,
- color: COLORS.NEUTRAL_DARK[100],
- ':hover': {
- color: COLORS.NEUTRAL_DARK[200],
- },
- ':active': {
- color: COLORS.NEUTRAL_DARK[200],
- },
- },
- variants: {
- loading: {
- true: {
- ':hover': {
- color: COLORS.NEUTRAL_DARK[100],
- },
- ':active': {
- color: COLORS.NEUTRAL_DARK[100],
- },
- },
- },
- inline: {
- true: {
- ':hover': {
- color: COLORS.NEUTRAL_DARK[100],
- },
- ':active': {
- color: COLORS.NEUTRAL_DARK[100],
- },
- },
- },
- },
-});
diff --git a/packages/chat/src/components/LinkPreview/utils.ts b/packages/chat/src/components/LinkPreview/utils.ts
deleted file mode 100644
index dc474d3f0b..0000000000
--- a/packages/chat/src/components/LinkPreview/utils.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-type LinkType = 'pdf' | 'url' | 'custom';
-
-const isValidHttpUrl = (value: string) => {
- let url;
-
- try {
- url = new URL(value);
- } catch (_) {
- return false;
- }
- return url.protocol === 'http:' || url.protocol === 'https:';
-};
-
-export const getImageTypeFromUrl = (value: string): LinkType => {
- if (value.endsWith('.pdf')) {
- return 'pdf';
- }
-
- if (isValidHttpUrl(value)) {
- return 'url';
- }
-
- return 'custom';
-};
diff --git a/packages/chat/src/components/LoadingSpinner/LoadingSpinner.tsx b/packages/chat/src/components/LoadingSpinner/LoadingSpinner.tsx
deleted file mode 100644
index 5043b895c4..0000000000
--- a/packages/chat/src/components/LoadingSpinner/LoadingSpinner.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-import clsx from 'clsx';
-
-import type { VariantProps } from '@/types/variants';
-
-import { rectStyles, spinnerRecipe, spinnerStyle } from './styles.css';
-
-export interface ILoadingSpinner extends VariantProps {
- testID?: string;
- className?: string;
-}
-
-export const LoadingSpinner: React.FC = ({ className, testID, size = 'medium', variant = 'dark' }) => {
- const isLarge = size === 'large';
- const height = isLarge ? 6 : 4;
-
- const smallCoordinates: Array<{ x?: number; y?: number; transform?: string }> = [
- { x: 7.25 },
- { x: 13.1265, y: 1.81281, transform: 'rotate(45 13.1265 1.81281)' },
- { x: 16, y: 7.25, transform: 'rotate(90 16 7.25)' },
- { x: 14.1873, y: 13.1265, transform: 'rotate(135 14.1873 13.1265)' },
- { x: 8.75, y: 16, transform: 'rotate(180 8.75 16)' },
- { x: 2.87354, y: 14.1872, transform: 'rotate(-135 2.87354 14.1872)' },
- { y: 8.75, transform: 'rotate(-90 0 8.75)' },
- { x: 1.8, y: 2.873, transform: 'rotate(-45 1.81274 2.87347)' },
- ];
-
- const largeCoordinates: Array<{ x?: number; y?: number; transform?: string }> = [
- { x: 11.25, y: 2 },
- { x: 18.54, y: 4.39, transform: 'rotate(45 18.5408 4.39862)' },
- { x: 22, y: 11.25, transform: 'rotate(90 22 11.25)' },
- { x: 19.61, y: 18.54, transform: 'rotate(135 19.61 18.54)' },
- { x: 12.75, y: 22, transform: 'rotate(180 12.75 22)' },
- { x: 5.46, y: 19.61, transform: 'rotate(-135 5.46 19.6)' },
- { x: 2, y: 12.75, transform: 'rotate(-90 2 12.75)' },
- { x: 4.39, y: 5.46, transform: 'rotate(-45 4.39 5.45)' },
- ];
-
- return (
-
- {(isLarge ? largeCoordinates : smallCoordinates).map((args, index) => (
-
- ))}
-
- );
-};
diff --git a/packages/chat/src/components/LoadingSpinner/styles.css.ts b/packages/chat/src/components/LoadingSpinner/styles.css.ts
deleted file mode 100644
index 8fd4b01702..0000000000
--- a/packages/chat/src/components/LoadingSpinner/styles.css.ts
+++ /dev/null
@@ -1,121 +0,0 @@
-import { keyframes, style, styleVariants } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { COLORS } from '@/styles/colors';
-
-const spinnerScaleAnimation = keyframes({
- '0%': {
- transform: 'scale(0.4, 0.4) rotate(0)',
- opacity: 0,
- },
- '100%': {
- transform: 'scale(1.4, 1.4) rotate(0)',
- opacity: 1,
- },
-});
-
-const spinnerAnimation = keyframes({
- '0%': {
- transform: 'rotate(0)',
- },
- '100%': {
- transform: 'rotate(360deg)',
- },
-});
-
-const fadeAnimation = keyframes({
- '0%': {
- opacity: '0',
- },
- '100%': {
- opacity: '1',
- },
-});
-
-export const spinnerStyle = style({
- height: '16px',
- animation: `${spinnerScaleAnimation} .75s linear forwards, ${spinnerAnimation} 1.25s linear forwards`,
-});
-
-const RECT_ANIMATION_PROPERTIES = [
- {
- opacity: '1.12',
- animationDelay: '-0.96s',
- },
- {
- opacity: '1',
- animationDelay: '-0.84s',
- },
- {
- opacity: '0.88',
- animationDelay: '-0.72s',
- },
- {
- opacity: '0.76',
- animationDelay: '-0.6s',
- },
- {
- opacity: '0.64',
- animationDelay: '-0.48s',
- },
- {
- opacity: '0.52',
- animationDelay: '-0.36s',
- },
- {
- opacity: '0.4',
- animationDelay: '-0.24s',
- },
- {
- opacity: '0.28',
- animationDelay: '-0.12s',
- },
- {
- opacity: '0.16',
- animationDelay: '0s',
- },
-];
-
-const produceSpinnerAnimationSelectors = () => {
- return RECT_ANIMATION_PROPERTIES.reduce((accum, element, index) => {
- return {
- ...accum,
- [`${spinnerStyle} &:nth-child(${index + 1})`]: {
- animation: `${fadeAnimation} 1s linear infinite`,
- animationDelay: element.animationDelay,
- opacity: element.opacity,
- },
- };
- }, {});
-};
-
-export const rectStyles = style({
- selectors: produceSpinnerAnimationSelectors(),
-});
-
-export const spinnerSizeVariants = styleVariants({
- large: {
- height: '24px',
- width: 'auto',
- },
- medium: {
- height: '16px',
- width: 'auto',
- },
-});
-
-export const spinnerThemeVariants = styleVariants({
- light: {
- color: COLORS.white,
- },
- dark: {
- color: COLORS.NEUTRAL_DARK[900],
- },
-});
-
-export const spinnerRecipe = recipe({
- variants: {
- size: spinnerSizeVariants,
- variant: spinnerThemeVariants,
- },
-});
diff --git a/packages/chat/src/components/MessageContainer/index.tsx b/packages/chat/src/components/MessageContainer/index.tsx
deleted file mode 100644
index 775532c168..0000000000
--- a/packages/chat/src/components/MessageContainer/index.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import clsx from 'clsx';
-import React, { type PropsWithChildren } from 'react';
-
-import { messageContainer } from './styles.css';
-
-/**
- * Used to wrap a `SystemResponse` or a `UserResponse` object.
- * A `SystemResponse` can have multiple messages in it.
- */
-export const MessageContainer: React.FC> = ({
- children,
- className,
- isLast,
-}) => {
- return {children}
;
-};
diff --git a/packages/chat/src/components/MessageContainer/styles.css.ts b/packages/chat/src/components/MessageContainer/styles.css.ts
deleted file mode 100644
index 49acf7dad0..0000000000
--- a/packages/chat/src/components/MessageContainer/styles.css.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { recipe } from '@vanilla-extract/recipes';
-
-export const messageContainer = recipe({
- base: {
- position: 'relative',
-
- width: '100%',
- margin: '16px 0',
- },
- variants: {
- isLast: {
- true: {
- marginBottom: 0,
- },
- },
- },
-});
diff --git a/packages/chat/src/components/MessageInput/AudioInputButton.tsx b/packages/chat/src/components/MessageInput/AudioInputButton.tsx
deleted file mode 100644
index e73ff2f117..0000000000
--- a/packages/chat/src/components/MessageInput/AudioInputButton.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import clsx from 'clsx';
-
-import { squareButtonStyles } from '../Buttons/SquareButton/styles/SquareButton.css';
-import * as SquareButtonTheme from '../Buttons/SquareButton/styles/SquareButtonTheme.css';
-import { Icon } from '../Icon';
-import { audioInputButton } from './MessageInput.css';
-
-interface AudioInputButtonProps {
- onStop?: () => void;
- onStart?: () => void;
- listening?: boolean;
- processing?: boolean;
- initializing?: boolean;
- showButton?: boolean;
-}
-
-export const AudioInputButton: React.FC = ({
- onStop,
- onStart,
- listening,
- processing,
- initializing,
- showButton,
-}) => {
- return (
-
- {listening ? : }
-
- );
-};
diff --git a/packages/chat/src/components/MessageInput/MessageInput.css.ts b/packages/chat/src/components/MessageInput/MessageInput.css.ts
deleted file mode 100644
index 5a0800baa6..0000000000
--- a/packages/chat/src/components/MessageInput/MessageInput.css.ts
+++ /dev/null
@@ -1,144 +0,0 @@
-import { createVar, style } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { COLORS } from '@/styles/colors';
-import { THEME } from '@/styles/colors.css';
-import { BREAKPOINTS } from '@/styles/sizes';
-import { transition } from '@/styles/transitions';
-
-export const themedFocusRing = createVar();
-
-export const inputContainer = recipe({
- base: {
- position: 'relative',
- borderRadius: '25px',
- display: 'flex',
- zIndex: 1,
- justifyContent: 'space-between',
- padding: '7px 7px 7px 20px',
- boxSizing: 'border-box',
- border: `1px solid ${COLORS.NEUTRAL_LIGHT[100]}`,
- backgroundColor: COLORS.white,
- boxShadow: '0px 3px 4px 0px rgba(0, 0, 0, 0.02), 0px 8px 42px -16px rgba(0, 0, 0, 0.08)',
- transition: transition(['border', 'box-shadow', 'border-radius', 'opacity']),
- selectors: {
- '&:hover': {
- cursor: 'text',
- border: `1px solid ${COLORS.NEUTRAL_LIGHT[200]}`,
- },
- },
- },
- variants: {
- multiline: {
- true: {
- borderRadius: '20px',
- },
- },
- hasEnded: {
- true: {
- opacity: 0,
- },
- },
- },
-});
-
-export const mockFocusRing = recipe({
- base: {
- position: 'absolute',
- top: '-1px',
- left: '-1px',
- right: '-1px',
- bottom: '-1px',
- borderRadius: '25px',
- pointerEvents: 'none',
- opacity: 0,
- boxShadow: `inset 0 0 0 0px ${THEME.colors[500]}`,
- transition: transition(['opacity', 'box-shadow', 'border-radius']),
- selectors: {
- [`${inputContainer()}:focus-within &`]: {
- opacity: 1,
- boxShadow: `inset 0 0 0 2px ${THEME.colors[500]}`,
- },
- },
- },
- variants: {
- multiline: {
- true: {
- borderRadius: '20px',
- },
- },
- },
-});
-
-export const input = style({
- width: '100%',
- scrollbarWidth: 'none',
- borderColor: 'transparent',
- resize: 'none',
- fontFamily: THEME.fontFamily,
- fontSize: '14px',
- boxSizing: 'border-box',
- outline: 'transparent 0px',
-
- padding: '0',
- lineHeight: '20px',
- paddingTop: '2px',
- color: COLORS.NEUTRAL_DARK[900],
- selectors: {
- '&::placeholder': {
- color: COLORS.NEUTRAL_DARK[100],
- fontSize: '14px',
- },
- },
- '@media': {
- [`screen and (max-width: ${BREAKPOINTS.mobile})`]: {
- fontSize: '16px',
- },
- },
-});
-
-export const multilineInput = style({
- borderRadius: '25px',
-});
-
-export const inputBlock = style({
- width: '100%',
- display: 'flex',
- flexDirection: 'column',
- alignItems: 'center',
- margin: 'auto',
- marginRight: '8px',
-});
-
-export const buttonContainer = style({
- display: 'flex',
- alignItems: 'flex-start',
- justifyContent: 'center',
- gap: '8px',
- height: '100%',
-});
-
-export const audioInputButton = recipe({
- base: {
- display: 'flex',
- borderRadius: 100,
- overflow: 'hidden',
- transition: transition(['opacity', 'width', 'background-color', 'color']),
- },
- variants: {
- disabled: {
- true: {
- cursor: 'not-allowed',
- },
- },
- hidden: {
- true: {
- opacity: 0,
- width: 0,
- },
- false: {
- opacity: 1,
- },
- },
- },
-});
diff --git a/packages/chat/src/components/MessageInput/MessageInput.story.tsx b/packages/chat/src/components/MessageInput/MessageInput.story.tsx
deleted file mode 100644
index 7ccf38f8fc..0000000000
--- a/packages/chat/src/components/MessageInput/MessageInput.story.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-import { useState } from 'react';
-
-import { WithDefaultPalette } from '@/storybook/decorators';
-
-import { MessageInput } from '.';
-import { chatContainer } from './MessageInputTestStyles.css';
-
-type Story = StoryObj;
-
-const meta: Meta = {
- title: 'Core/MessageInput',
- component: MessageInput,
- decorators: [
- WithDefaultPalette,
- (Story) => (
-
-
-
- ),
- ],
-};
-
-export default meta;
-
-const MockComponent = () => {
- return (
-
- Promise.resolve()} />
-
- );
-};
-
-export const Base: Story = {
- render: () => ,
-};
-
-export const WithAudioInput: Story = {
- render: () => (
-
- Promise.resolve()}
- />
-
- ),
-};
-
-const AnimationTestsComponent = () => {
- const [isOpen, setIsOpen] = useState(false);
- return (
- <>
-
- Promise.resolve()}
- />
-
- setIsOpen(!isOpen)}>
- Toggle
-
- >
- );
-};
-export const AnimationTest: Story = {
- render: () => ,
-};
diff --git a/packages/chat/src/components/MessageInput/MessageInputTestStyles.css.ts b/packages/chat/src/components/MessageInput/MessageInputTestStyles.css.ts
deleted file mode 100644
index 8061e06641..0000000000
--- a/packages/chat/src/components/MessageInput/MessageInputTestStyles.css.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { recipe } from '@vanilla-extract/recipes';
-
-export const chatContainer = recipe({
- base: {
- maxHeight: 400,
- pointerEvents: 'auto',
- opacity: 0,
- width: 0,
- transition: 'opacity 300ms cubic-bezier(0.85, 0, 0.6, 1), width 300ms cubic-bezier(0.85, 0, 0.6, 1)',
- transformOrigin: 'right center',
- position: 'absolute',
- },
- variants: {
- isOpen: {
- true: {
- opacity: 1,
- pointerEvents: 'auto',
- width: 400,
- },
- false: {
- opacity: 0,
- pointerEvents: 'none',
- width: 0,
- },
- },
- },
-});
diff --git a/packages/chat/src/components/MessageInput/hooks.ts b/packages/chat/src/components/MessageInput/hooks.ts
deleted file mode 100644
index e623a6252b..0000000000
--- a/packages/chat/src/components/MessageInput/hooks.ts
+++ /dev/null
@@ -1,105 +0,0 @@
-import { useEffect, useLayoutEffect, useRef, useState } from 'react';
-import ReactSpeechRecognition, { useSpeechRecognition as useReactSpeechRecognition } from 'react-speech-recognition';
-
-import { isChrome } from '@/device';
-import type { ChatSpeechRecognitionConfig, ChatSpeechRecognitionState } from '@/dtos/ChatConfig.dto';
-
-export const useSpeechRecognition = ({
- onValueChange,
- customSpeechRecognition,
-}: {
- onValueChange: (value: string) => void;
- customSpeechRecognition?: ChatSpeechRecognitionConfig;
-}) => {
- const textareaRef = useRef(null);
- const reactSpeechRecognition = useReactSpeechRecognition({ clearTranscriptOnListen: true });
-
- const browserSupportsSpeechRecognition = reactSpeechRecognition.browserSupportsSpeechRecognition && isChrome();
- const customSpeechRecognitionEnabled =
- !!customSpeechRecognition && (customSpeechRecognition.overrideNative || !browserSupportsSpeechRecognition);
-
- const prevListening = useRef(
- customSpeechRecognitionEnabled ? customSpeechRecognition.initialState.listening : reactSpeechRecognition.listening
- );
- const prevProcessing = useRef(
- customSpeechRecognitionEnabled ? customSpeechRecognition.initialState.processing : false
- );
-
- const [customSpeechRecognitionState, setCustomSpeechRecognitionState] = useState(
- customSpeechRecognitionEnabled
- ? customSpeechRecognition.initialState
- : {
- listening: reactSpeechRecognition.listening,
- transcript: reactSpeechRecognition.transcript,
- processing: false,
- initializing: false,
- microphoneAvailable: reactSpeechRecognition.isMicrophoneAvailable,
- }
- );
-
- const onStartListening = (): void => {
- if (customSpeechRecognitionEnabled) {
- customSpeechRecognition.resetTranscript();
- customSpeechRecognition.startListening();
- } else {
- reactSpeechRecognition.resetTranscript();
- ReactSpeechRecognition.startListening({ continuous: true });
- }
- };
-
- const onStopListening = (): void => {
- if (customSpeechRecognitionEnabled) {
- customSpeechRecognition.stopListening();
- } else {
- ReactSpeechRecognition.stopListening();
- }
- };
-
- useLayoutEffect(() => {
- if (customSpeechRecognitionEnabled || !reactSpeechRecognition.listening) return;
-
- onValueChange(reactSpeechRecognition.transcript);
- }, [customSpeechRecognitionEnabled, reactSpeechRecognition.transcript]);
-
- useEffect(() => {
- if (customSpeechRecognitionEnabled) {
- if (prevProcessing.current && !customSpeechRecognitionState.processing) {
- customSpeechRecognition.resetTranscript();
- textareaRef.current?.focus();
- }
-
- prevProcessing.current = customSpeechRecognitionState.processing;
- } else {
- if (prevListening.current && !reactSpeechRecognition.listening) {
- reactSpeechRecognition.resetTranscript();
- textareaRef.current?.focus();
- }
-
- prevListening.current = reactSpeechRecognition.listening;
- }
- }, [customSpeechRecognitionEnabled, reactSpeechRecognition.listening, customSpeechRecognitionState.processing]);
-
- useEffect(() => {
- if (!customSpeechRecognitionEnabled) return undefined;
-
- return customSpeechRecognition.onStateChange((nextState) => {
- onValueChange(nextState.transcript);
- setCustomSpeechRecognitionState(nextState);
- });
- }, [customSpeechRecognitionEnabled]);
-
- return {
- available: customSpeechRecognitionEnabled || browserSupportsSpeechRecognition,
- listening: customSpeechRecognitionEnabled
- ? customSpeechRecognitionState.listening
- : reactSpeechRecognition.listening,
- processing: customSpeechRecognitionEnabled ? customSpeechRecognitionState.processing : false,
- textareaRef,
- initializing: customSpeechRecognitionEnabled ? customSpeechRecognitionState.initializing : false,
- stopListening: onStopListening,
- startListening: onStartListening,
- microphoneAvailable: customSpeechRecognitionEnabled
- ? customSpeechRecognitionState.microphoneAvailable
- : reactSpeechRecognition.isMicrophoneAvailable,
- };
-};
diff --git a/packages/chat/src/components/MessageInput/index.tsx b/packages/chat/src/components/MessageInput/index.tsx
deleted file mode 100644
index 54941bbee0..0000000000
--- a/packages/chat/src/components/MessageInput/index.tsx
+++ /dev/null
@@ -1,104 +0,0 @@
-import { useRef, useState } from 'react';
-import TextareaAutosize from 'react-textarea-autosize';
-
-import type { ChatSpeechRecognitionConfig } from '@/main';
-
-import { SendButton } from '../SendButton';
-import { AudioInputButton } from './AudioInputButton';
-import { useSpeechRecognition } from './hooks';
-import { buttonContainer, input, inputBlock, inputContainer, mockFocusRing } from './MessageInput.css';
-
-export interface IMessageInput {
- onDictationClick?: () => void;
- placeholder?: string;
- onSubmit?: (message: string) => Promise;
- disableSend?: boolean | undefined;
- audioInterface?: boolean | undefined;
- speechRecognition?: ChatSpeechRecognitionConfig;
- hasEnded?: boolean;
-}
-
-export const MessageInput: React.FC = ({
- onSubmit,
- disableSend,
- audioInterface,
- placeholder = 'Message...',
- speechRecognition: customSpeechRecognition,
- hasEnded,
-}) => {
- const [message, setMessage] = useState('');
- const [isMultiLine, setIsMultiLine] = useState(false);
- const containerRef = useRef(null);
-
- const speechRecognition = useSpeechRecognition({
- onValueChange: setMessage,
- customSpeechRecognition,
- });
- const withSendButton = !!message?.length && !disableSend && !speechRecognition.listening;
- const withAudioInput =
- audioInterface && speechRecognition.available && speechRecognition.microphoneAvailable && !withSendButton;
-
- const handleContainerClick = () => {
- speechRecognition.textareaRef.current?.focus();
- };
-
- const sendMessage = async () => {
- if (!message || disableSend) return;
-
- speechRecognition.stopListening();
- setMessage('');
- await onSubmit?.(message);
- };
-
- const handleKeyPress = (event: React.KeyboardEvent) => {
- event.stopPropagation();
-
- const { shiftKey } = event;
-
- if (event.key !== 'Enter') return;
- if (event.key === 'Enter' && !shiftKey) {
- event.preventDefault();
- sendMessage();
- }
- };
-
- const onHeightChange = (height: number) => {
- setIsMultiLine(height > 24);
- };
-
- return (
-
-
-
- setMessage(event.target.value)}
- />
-
-
-
- );
-};
diff --git a/packages/chat/src/components/NewChat/ChatContainer/ChatContainer.component.tsx b/packages/chat/src/components/NewChat/ChatContainer/ChatContainer.component.tsx
deleted file mode 100644
index a0830336b0..0000000000
--- a/packages/chat/src/components/NewChat/ChatContainer/ChatContainer.component.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import { assignInlineVars } from '@vanilla-extract/dynamic';
-import type { WidgetSettingsColorPalette } from '@voiceflow/dtos-interact';
-import clsx from 'clsx';
-
-import { THEME } from '@/styles/colors.css';
-import { FAMILY } from '@/styles/font';
-import { chatIsOpen } from '@/views/ChatWidget/styles.css';
-
-import { chatWindowStyle } from './ChatContainer.css';
-
-export interface IChatContainer {
- palette: WidgetSettingsColorPalette;
- fontFamily?: string;
- children?: React.ReactNode;
- embedded?: boolean;
- isPopover?: boolean;
-}
-
-export const ChatContainer: React.FC = ({ palette, fontFamily, children, embedded, isPopover }) => {
- return (
-
- {children}
-
- );
-};
diff --git a/packages/chat/src/components/NewChat/ChatContainer/ChatContainer.css.tsx b/packages/chat/src/components/NewChat/ChatContainer/ChatContainer.css.tsx
deleted file mode 100644
index 0f7fde7756..0000000000
--- a/packages/chat/src/components/NewChat/ChatContainer/ChatContainer.css.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import { recipe } from '@vanilla-extract/recipes';
-
-import { BREAKPOINTS } from '@/styles/sizes';
-
-export const chatWindowStyle = recipe({
- base: {
- height: '100%',
- maxHeight: '800px',
-
- '@media': {
- [`(max-width: ${BREAKPOINTS.mobile})`]: {
- height: '100%',
- maxHeight: '100vh',
- },
- },
- },
-
- variants: {
- popover: {
- true: {
- height: 'auto',
- minHeight: '400px',
- maxHeight: '100%',
- boxSizing: 'border-box',
- pointerEvents: 'all',
- },
- },
- },
-});
diff --git a/packages/chat/src/components/NewChat/NewChat.css.ts b/packages/chat/src/components/NewChat/NewChat.css.ts
deleted file mode 100644
index 82f452124d..0000000000
--- a/packages/chat/src/components/NewChat/NewChat.css.ts
+++ /dev/null
@@ -1,82 +0,0 @@
-import { globalStyle, style } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { duration, timingFunction } from '@/styles/animations';
-import { COLORS } from '@/styles/colors';
-import { BREAKPOINTS } from '@/styles/sizes';
-import { transition } from '@/styles/transitions';
-import { chatIsClosed, chatIsOpen } from '@/views/ChatWidget/styles.css';
-
-import { fadeIn, fadeOut } from '../Header/styles.css';
-
-export const DIALOG_PADDING = 20;
-
-export const chatContainer = style({
- height: '100%',
- display: 'flex',
- flexDirection: 'column',
- borderRadius: '16px',
- backgroundColor: COLORS.white,
- position: 'relative',
- boxShadow: '0 0 0 1px rgb(22 26 30 / 6%), rgba(22, 26, 30, 0.16) 0px 8px 80px',
- overflow: 'hidden',
-
- '@media': {
- [`(max-width: ${BREAKPOINTS.mobile})`]: {
- borderRadius: 0,
- },
- },
-});
-
-globalStyle(`${chatContainer} *`, {
- boxSizing: 'border-box',
-});
-
-export const dialogContainer = style({
- position: 'relative',
- padding: `0 ${DIALOG_PADDING}px ${DIALOG_PADDING}px ${DIALOG_PADDING}px`,
- marginBottom: `-${DIALOG_PADDING}px`,
- overflow: 'hidden',
- scrollbarWidth: 'none',
- flexGrow: 1,
- overflowY: 'auto',
- width: '100%',
-});
-
-export const bottomSpacer = recipe({
- base: {
- display: 'block',
- width: '100%',
- transition: transition(['height']),
- },
- variants: {
- hasEnded: {
- true: {
- height: '0px',
- },
- false: {
- height: '20px',
- },
- },
- },
-});
-
-export const chatEndedContainer = style({
- padding: '4px 0',
-});
-
-export const chatContentWrapper = style({
- opacity: 0,
- width: '100%',
- selectors: {
- [`.${chatIsOpen} &`]: {
- animation: `${fadeIn} ${duration.slow} ${timingFunction.gentle} forwards`,
- animationDelay: '.6s',
- pointerEvents: 'auto',
- },
- [`.${chatIsClosed} &`]: {
- animation: `${fadeOut} ${duration.slow} ease-out`,
- pointerEvents: 'none',
- },
- },
-});
diff --git a/packages/chat/src/components/NewChat/NewChat.story.tsx b/packages/chat/src/components/NewChat/NewChat.story.tsx
deleted file mode 100644
index d6d00318cf..0000000000
--- a/packages/chat/src/components/NewChat/NewChat.story.tsx
+++ /dev/null
@@ -1,340 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-import { assignInlineVars } from '@vanilla-extract/dynamic';
-import { useState } from 'react';
-
-import EMPTY_IMAGE from '@/__fixtures__/empty-image.png';
-import { SystemResponse } from '@/components';
-import { WithDefaultPalette, WithRuntimeProvider } from '@/storybook/decorators';
-import { createPalette } from '@/styles/colors';
-import { THEME } from '@/styles/colors.css';
-
-import Indicator from '../SystemResponse/Indicator/Indicator';
-import { UserResponse } from '../UserResponse';
-import { NewChat } from '.';
-
-const meta: Meta = {
- title: 'Widget',
-
- parameters: {
- layout: 'centered',
- },
- decorators: [WithRuntimeProvider, WithDefaultPalette],
-};
-
-type Story = StoryObj;
-
-export default meta;
-
-const AgentSays = (messages: string[]) => (
- ({ type: 'text', text: m }))}
- />
-);
-const UserSays = (text: string) => ;
-
-const MockBaseComponent = ({ isLoading }: { isLoading?: boolean }) => {
- const [messages, setMessages] = useState([
- { type: 'User', text: 'Cool, great weather ☀️' },
- {
- type: 'User',
- text: 'How bout you? What about Bob? How has he been. Is he ok. Should I separate these messages?',
- },
- { type: 'Agent', text: 'Howdy, great to meet you!' },
- { type: 'Agent', text: 'What up' },
- { type: 'User', text: 'How bout you?' },
- { type: 'Agent', text: 'Howdy, great to meet you!' },
- { type: 'Agent', text: 'What up' },
- { type: 'User', text: 'How bout you?' },
- { type: 'Agent', text: 'Howdy, great to meet you!' },
- { type: 'Agent', text: 'What up' },
- { type: 'User', text: 'How bout you? Hows it going does this hit the loading state at the bottom of the chat?' },
- ]);
-
- const agentResponses = [
- 'How are you today?',
- 'Nice to hear from you!',
- 'I’m here to help!',
- 'What can I do for you?',
- 'Good to see you!',
- ];
-
- const handleSubmit = async (userText: string): Promise => {
- if (!userText) return;
-
- // Add the new User message
- const newMessages = [...messages];
-
- // Add a random Agent response
- const randomResponse = agentResponses[Math.floor(Math.random() * agentResponses.length)];
- newMessages.push({ type: 'Agent', text: randomResponse });
-
- setMessages(newMessages);
- };
-
- return (
- handleSubmit(text),
- placeholder: 'Message...',
- },
- }}
- isLoading={false}
- hasEnded={false}
- >
- {messages.map((msg) => (msg.type === 'Agent' ? AgentSays([msg.text]) : UserSays(msg.text)))}
- {isLoading && }
-
- );
-};
-
-export const Base = {
- render: () => ,
-};
-
-export const BaseThemed = {
- render: () => (
-
-
-
- ),
-};
-
-export const LoadingState = {
- render: () => ,
-};
-
-export const Themed: Story = {
- render: () => (
-
-
- Promise.resolve(),
- placeholder: 'Message...',
- },
- }}
- isLoading={false}
- hasEnded={false}
- />
-
-
-
- Promise.resolve(),
- placeholder: 'Message...',
- },
- }}
- isLoading={false}
- hasEnded={false}
- />
-
-
-
- Promise.resolve(),
- placeholder: 'Message...',
- },
- }}
- isLoading={false}
- hasEnded={false}
- />
-
-
- ),
-};
-
-export const NoPoweredBy = {
- render: () => (
- Promise.resolve(),
- placeholder: 'Message...',
- },
- }}
- isLoading={false}
- hasEnded={false}
- />
- ),
-};
-
-export const OnlyPoweredBy = {
- render: () => (
- Promise.resolve(),
- placeholder: 'Message...',
- },
- }}
- isLoading={false}
- hasEnded={false}
- />
- ),
-};
-
-export const NoFooterLinks = {
- render: () => (
- Promise.resolve(),
- placeholder: 'Message...',
- },
- }}
- isLoading={false}
- hasEnded={false}
- >
- {AgentSays(['👋🏻 Good morning!', 'How are you today?', 'How can I help you ?'])}
- {UserSays('How bout you?')}
- {AgentSays(['Thanks for asking', 'here are some cool emojis:', '😝 ✌️ ☎️ 🤦🏼♀️ 🤯'])}
- {AgentSays(['Anything else I can do to help you today?'])}
- {UserSays('Dont think so. Everything else is amazing!')}
- {AgentSays(['ok, so bye for now'])}
-
- ),
-};
-
-export const ChatEnded = {
- render: () => (
- Promise.resolve(),
- placeholder: 'Message...',
- },
- }}
- isLoading={false}
- hasEnded={true}
- >
- {AgentSays(['👋🏻 Good morning!', 'How are you today?', 'How can I help you ?'])}
- {UserSays('How bout you?')}
- {AgentSays(['Thanks for asking', 'here are some cool emojis:', '😝 ✌️ ☎️ 🤦🏼♀️ 🤯'])}
- {UserSays('Cool, I *LOVE* emojis!')}
- {AgentSays(["I know.\nThat's why I sent you some."])}
- {UserSays('🤯')}
- {AgentSays(['Anything else I can do to help you today?'])}
- {UserSays('Dont think so. Everything else is amazing!')}
- {AgentSays(['ok, so bye for now'])}
-
- ),
-};
diff --git a/packages/chat/src/components/NewChat/index.tsx b/packages/chat/src/components/NewChat/index.tsx
deleted file mode 100644
index 4f0f959e50..0000000000
--- a/packages/chat/src/components/NewChat/index.tsx
+++ /dev/null
@@ -1,132 +0,0 @@
-import clsx from 'clsx';
-import { useContext, useMemo, useRef, useState } from 'react';
-
-import { ClassName } from '@/constants';
-import { AutoScrollProvider, RuntimeStateAPIContext, RuntimeStateContext } from '@/contexts';
-import type { Nullish } from '@/types';
-import { chain } from '@/utils/functional';
-
-import { Header, type HeaderActionProps, type HeaderProps } from '../Header';
-import { type INewFooter, NewFooter } from '../NewFooter';
-import { Prompt } from '../Prompt';
-import { Separator } from '../Separator';
-import { type IWelcomeMessage, WelcomeMessage } from '../WelcomeMessage';
-import { ChatContainer } from './ChatContainer/ChatContainer.component';
-import { bottomSpacer, chatContainer, chatContentWrapper, chatEndedContainer, dialogContainer } from './NewChat.css';
-
-export interface INewChat extends React.PropsWithChildren {
- welcomeMessageProps: IWelcomeMessage;
- headerProps: HeaderProps;
- footerProps: Omit;
-
- /**
- * If true, shows a loading indicator.
- */
- isLoading: boolean;
-
- /**
- * If true, shows audio interface controls.
- */
- audioInterface?: boolean;
-
- /**
- * If true, the user is using a mobile device.
- */
- isMobile?: boolean;
-
- /**
- * A unix timestamp indicating the start of the conversation.
- */
- startTime?: Nullish;
-
- /**
- * A callback that is executed when the chat widget is minimized.
- */
- onMinimize?: React.MouseEventHandler;
-
- /**
- * A callback that is executed when the conversation ends.
- */
- onEnd?: React.MouseEventHandler;
-
- /**
- * If true, the conversation was ended by the agent.
- */
- hasEnded: boolean;
-
- /**
- * A callback to start a new conversation.
- */
- onStart?: (() => Promise) | undefined;
-}
-
-const Chat: React.FC = ({
- headerProps,
- welcomeMessageProps,
- footerProps,
- hasEnded,
- onStart,
- onMinimize,
- onEnd,
- children,
- audioInterface,
- isMobile,
-}) => {
- const [hasAlert, setAlert] = useState(false);
-
- const { config } = useContext(RuntimeStateAPIContext);
- const state = useContext(RuntimeStateContext);
-
- const handleClose = (event: React.MouseEvent): void => {
- if (hasEnded) {
- onEnd?.(event);
- } else {
- setAlert(true);
- }
- };
-
- const handleResume = (_: any): void => setAlert(false);
-
- const headerActions = useMemo(() => {
- const items: HeaderActionProps[] = [{ svg: 'reset', onClick: handleClose }];
- if (isMobile) {
- items.push({ svg: 'close', onClick: onMinimize });
- }
-
- return items;
- }, [config.render, handleClose, onMinimize, state.audioOutput, audioInterface]);
-
- const scrollableAreaRef = useRef(null);
-
- return (
-
-
-
-
-
-
- {children}
-
- {hasEnded && !!state.session.turns.length && (
-
-
-
- )}
-
-
-
-
-
-
-
- );
-};
-
-export const NewChat = Object.assign(Chat, {
- Container: ChatContainer,
-});
diff --git a/packages/chat/src/components/NewFooter/BottomLinks/BottomLinks.css.ts b/packages/chat/src/components/NewFooter/BottomLinks/BottomLinks.css.ts
deleted file mode 100644
index d1aa3a78dd..0000000000
--- a/packages/chat/src/components/NewFooter/BottomLinks/BottomLinks.css.ts
+++ /dev/null
@@ -1,88 +0,0 @@
-import { style } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { COLORS } from '@/styles/colors';
-import { THEME } from '@/styles/colors.css';
-import { hideTextOverflow } from '@/styles/font';
-import { SIZES } from '@/styles/sizes';
-import { transition } from '@/styles/transitions';
-
-export const smallStyle = style({});
-
-export const footerLinksContainer = recipe({
- base: {
- color: COLORS.NEUTRAL_DARK[100],
- fontFamily: THEME.fontFamily,
- width: '100%',
- padding: '10px 0',
- fontSize: '12px',
- lineHeight: '17px',
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- gap: '8px',
- },
- variants: {
- small: {
- true: {
- fontSize: '11px',
- lineHeight: '15px',
- },
- false: {},
- },
- },
-});
-
-export const separator = style({
- height: '2px',
- width: '2px',
- borderRadius: SIZES.radius.round,
- backgroundColor: COLORS.NEUTRAL_LIGHT[500],
-});
-
-export const extraLinkStyles = style({
- color: COLORS.NEUTRAL_DARK[100],
- fontFamily: THEME.fontFamily,
- fontSize: 'inherit',
- lineHeight: 'inherit',
- textDecorationColor: 'transparent',
- transition: transition(['color', 'text-decoration-color']),
- selectors: {
- '&:hover': {
- textDecoration: 'underline',
- color: THEME.colors[500],
- textDecorationColor: THEME.colors[500],
- },
- '&:active': {
- color: THEME.colors[600],
- textDecorationColor: THEME.colors[600],
- },
- },
-});
-
-export const voiceflowLink = style({
- color: COLORS.NEUTRAL_DARK[100],
- textDecoration: 'underline',
- textDecorationColor: 'transparent',
- transition: transition(['color', 'text-decoration-color']),
- selectors: {
- '&:hover': {
- color: THEME.colors[500],
- textDecorationColor: THEME.colors[500],
- },
- '&:active': {
- color: THEME.colors[600],
- textDecorationColor: 'transparent',
- },
- },
-});
-
-export const footerNote = style({
- color: COLORS.NEUTRAL_DARK[100],
- fontFamily: THEME.fontFamily,
- fontSize: 'inherit',
- lineHeight: 'inherit',
- textDecorationColor: 'transparent',
- transition: transition(['color', 'text-decoration-color']),
- ...hideTextOverflow(),
-});
diff --git a/packages/chat/src/components/NewFooter/BottomLinks/index.tsx b/packages/chat/src/components/NewFooter/BottomLinks/index.tsx
deleted file mode 100644
index 5b21ec447e..0000000000
--- a/packages/chat/src/components/NewFooter/BottomLinks/index.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import clsx from 'clsx';
-
-import { extraLinkStyles, footerLinksContainer, footerNote, separator, voiceflowLink } from './BottomLinks.css';
-
-const VOICEFLOW_URL = 'https://www.voiceflow.com/';
-
-interface IBottomLinks {
- isSmall?: boolean;
- className?: string;
- extraLinkUrl?: string;
- showPoweredBy?: boolean;
- extraLinkText?: string;
-}
-
-export const BottomLinks: React.FC = ({
- isSmall = false,
- className,
- extraLinkUrl,
- extraLinkText,
- showPoweredBy,
-}) => {
- const showExtraLink = !!extraLinkText && !!extraLinkUrl;
- const showExtraText = !!extraLinkText && !extraLinkUrl;
-
- const showSeparator = showPoweredBy && (showExtraLink || showExtraText);
-
- return (
-
- {showPoweredBy && (
-
- )}
-
- {showSeparator &&
}
-
- {showExtraText &&
{extraLinkText}
}
-
- {showExtraLink && (
-
- {extraLinkText}
-
- )}
-
- );
-};
diff --git a/packages/chat/src/components/NewFooter/NewFooter.css.ts b/packages/chat/src/components/NewFooter/NewFooter.css.ts
deleted file mode 100644
index 42ddacd131..0000000000
--- a/packages/chat/src/components/NewFooter/NewFooter.css.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-import { keyframes, style } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { duration, timingFunction } from '@/styles/animations';
-import { chatIsClosed, chatIsOpen } from '@/views/ChatWidget/styles.css';
-
-const BUTTON_ROW_MARGIN = 10;
-
-const fadeInAndSlideUp = keyframes({
- from: {
- opacity: 0,
- transform: 'translateY(40px)',
- },
- to: {
- opacity: 1,
- transform: 'translateY(0)',
- },
-});
-
-const fadeOutSlideDown = keyframes({
- from: {
- opacity: 1,
- transform: 'translateY(0)',
- },
- to: {
- opacity: 0,
- transform: 'translateY(40px)',
- },
-});
-
-export const footerContainer = style({
- width: '100%',
- selectors: {
- [`.${chatIsOpen} &`]: {
- animation: `${fadeInAndSlideUp} .6s ${timingFunction.gentle} forwards`,
- },
- [`.${chatIsClosed} &`]: {
- animationDelay: duration.slow,
- animation: `${fadeOutSlideDown} 300ms ${timingFunction.gentle} forwards`,
- },
- },
-});
-
-export const buttonsContainer = style({
- display: 'flex',
- gap: '8px',
- flexWrap: 'nowrap',
- marginBottom: `${BUTTON_ROW_MARGIN}px`,
- overflow: 'hidden',
- overflowX: 'scroll',
- scrollbarWidth: 'none',
- padding: '0 20px',
-});
-
-export const inputContainer = style({
- padding: '0 20px',
-});
-
-export const messageContainer = recipe({
- base: {
- padding: '0 20px',
- position: 'relative',
- background:
- 'linear-gradient(180deg, rgba(255, 255, 255, 0.00) 0%, rgba(255, 255, 255, 0.00) 29.49%, #FFF 29.5%, #F8F8F8 100%)',
- },
-});
-
-export const hasEnded = style({
- top: '-24px',
-});
diff --git a/packages/chat/src/components/NewFooter/NewFooter.story.tsx b/packages/chat/src/components/NewFooter/NewFooter.story.tsx
deleted file mode 100644
index de2b564c19..0000000000
--- a/packages/chat/src/components/NewFooter/NewFooter.story.tsx
+++ /dev/null
@@ -1,104 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import { WithDefaultPalette } from '@/storybook/decorators';
-import { widgetContainer } from '@/views/ChatWidget/styles.css';
-
-import type { INewFooter } from '.';
-import { NewFooter } from '.';
-
-type Story = StoryObj;
-
-const buttons = [
- {
- label: 'Label',
- onClick: () => alert('Button 1 clicked'),
- },
- {
- label: 'Label',
- onClick: () => alert('Button 2 clicked'),
- },
- {
- label: 'Label',
- onClick: () => alert('Button 3 clicked'),
- },
- {
- label: 'Label',
- onClick: () => alert('Button 4 clicked'),
- },
- {
- label: 'Label',
- onClick: () => alert('Button 5 clicked'),
- },
- {
- label: 'Label',
- onClick: () => alert('Button 6 clicked'),
- },
- {
- label: 'Label',
- onClick: () => alert('Button 6 clicked'),
- },
-];
-
-const meta: Meta = {
- title: 'Components/Chat/NewFooter',
- component: NewFooter,
- decorators: [
- WithDefaultPalette,
- (Story) => (
-
-
-
- ),
- ],
-};
-
-export default meta;
-
-const MockComponent = (props: Omit) => {
- return ;
-};
-
-export const Default: Story = {
- args: {
- buttons: [],
- showPoweredBy: false,
- },
- render: (args) => ,
-};
-
-export const Everything: Story = {
- ...Default,
- args: {
- buttons,
- showPoweredBy: true,
- },
-};
-
-export const WithScrollButton: Story = {
- ...Default,
- args: {},
-};
-
-export const WithButtons: Story = {
- ...Default,
- args: {
- buttons,
- },
-};
-
-export const WithPoweredByAndText: Story = {
- ...Default,
- args: {
- showPoweredBy: true,
- extraLinkText: 'Extra Link',
- },
-};
-
-export const WithPoweredByAndLink: Story = {
- ...Default,
- args: {
- showPoweredBy: true,
- extraLinkText: 'Extra Link',
- extraLinkUrl: 'https://voiceflow.com',
- },
-};
diff --git a/packages/chat/src/components/NewFooter/ScrollButton/ScrollButton.css.ts b/packages/chat/src/components/NewFooter/ScrollButton/ScrollButton.css.ts
deleted file mode 100644
index 18aff37d6b..0000000000
--- a/packages/chat/src/components/NewFooter/ScrollButton/ScrollButton.css.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { style } from '@vanilla-extract/css';
-
-import { COLORS } from '@/styles/colors';
-import { transition } from '@/styles/transitions';
-
-export const BUTTON_SIZE = 32;
-
-export const scrollButton = style({
- width: BUTTON_SIZE,
- height: BUTTON_SIZE,
- borderRadius: '50%',
- display: 'flex',
- flex: 'none',
- alignItems: 'center',
- justifyContent: 'center',
- border: `1px solid ${COLORS.NEUTRAL_LIGHT[100]}`,
- background: COLORS.white,
- color: COLORS.NEUTRAL_DARK[100],
- transition: transition(['color', 'scale']),
- cursor: 'pointer',
- selectors: {
- '&:hover': {
- color: COLORS.NEUTRAL_DARK[600],
- scale: 1.1,
- },
- '&:active': {
- color: COLORS.NEUTRAL_DARK[800],
- scale: 0.8,
- },
- },
-});
-
-export const scrollIcon = style({
- width: BUTTON_SIZE,
- height: BUTTON_SIZE,
-});
diff --git a/packages/chat/src/components/NewFooter/ScrollButton/index.tsx b/packages/chat/src/components/NewFooter/ScrollButton/index.tsx
deleted file mode 100644
index 0fb9cb5e76..0000000000
--- a/packages/chat/src/components/NewFooter/ScrollButton/index.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import clsx from 'clsx';
-
-import { arrowDown } from '@/assets/svg';
-
-import { scrollButton, scrollIcon } from './ScrollButton.css';
-
-export const ScrollButton = ({ onClick, className }: { onClick?: () => void; className?: string }) => {
- return (
-
- {arrowDown({ title: 'scroll' })}
-
- );
-};
diff --git a/packages/chat/src/components/NewFooter/index.tsx b/packages/chat/src/components/NewFooter/index.tsx
deleted file mode 100644
index 64f81f2e64..0000000000
--- a/packages/chat/src/components/NewFooter/index.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-import clsx from 'clsx';
-import type { RefObject } from 'react';
-
-import { ClassName } from '@/constants';
-
-import { Button } from '../Button';
-import { ButtonVariant } from '../Button/constants';
-import type { IMessageInput } from '../MessageInput';
-import { MessageInput } from '../MessageInput';
-import { promptContainer } from '../Prompt/styles.css';
-import { ScrollToBottom } from '../ScrollToBottom';
-import { BottomLinks } from './BottomLinks';
-import { buttonsContainer, footerContainer, hasEnded, messageContainer } from './NewFooter.css';
-
-export interface INewFooter {
- buttons?: { label: string; onClick: () => void }[];
- showPoweredBy?: boolean;
- messageInputProps: IMessageInput;
- extraLinkText?: string;
- extraLinkUrl?: string;
- scrollableAreaRef: RefObject;
-
- /**
- * A callback to submit a user response.
- */
- onSend?: ((message: string) => Promise) | undefined;
-
- /**
- * A callback to start a new conversation.
- */
- onStart?: (() => Promise) | undefined;
-}
-
-export const NewFooter: React.FC = ({
- buttons,
- showPoweredBy,
- messageInputProps,
- extraLinkText,
- extraLinkUrl,
- scrollableAreaRef,
- onStart,
-}) => {
- return (
-
-
-
- Start new chat
-
-
-
- {(buttons?.length ?? 0) > 0 && (
-
- {buttons?.map((button) => (
-
- {button.label}
-
- ))}
-
- )}
-
-
-
-
-
-
-
- );
-};
diff --git a/packages/chat/src/components/Proactive/index.tsx b/packages/chat/src/components/Proactive/index.tsx
deleted file mode 100644
index 5294aee4d1..0000000000
--- a/packages/chat/src/components/Proactive/index.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-import { Trace } from '@voiceflow/base-types';
-import type { WidgetSettingsWidgetPosition } from '@voiceflow/dtos-interact';
-import clsx from 'clsx';
-import { useEffect, useMemo, useState } from 'react';
-import { match } from 'ts-pattern';
-
-import { ClassName } from '@/constants';
-import { fadeInAndUp } from '@/styles/animation-utils.css';
-
-import { Button } from '../Button';
-import { Icon } from '../Icon';
-import {
- closeButton,
- closeButtonIcon,
- closed,
- messageContainer,
- proactiveContainer,
- singleMessage,
-} from './styles.css';
-
-interface ProactiveQueueProps {
- side: WidgetSettingsWidgetPosition;
- messages: Trace.AnyTrace[];
-}
-
-export const Proactive: React.FC = ({ side, messages }) => {
- const [isClosed, setIsClosed] = useState(false);
-
- const queue = useMemo(
- () =>
- messages.map((message, index) =>
- match(message)
- .with({ type: Trace.TraceType.TEXT }, ({ payload }) => (
-
- {String(payload.message)}
-
- ))
- .otherwise(() => null)
- ),
- [messages]
- );
-
- useEffect(() => {
- if (!queue.length) return;
- setIsClosed(false);
- }, [queue]);
-
- const close = () => {
- setIsClosed(true);
- };
-
- if (!queue.length) return null;
-
- return (
-
-
close()}>
-
-
-
{queue}
-
- );
-};
diff --git a/packages/chat/src/components/Proactive/styles.css.ts b/packages/chat/src/components/Proactive/styles.css.ts
deleted file mode 100644
index de6a47fea7..0000000000
--- a/packages/chat/src/components/Proactive/styles.css.ts
+++ /dev/null
@@ -1,92 +0,0 @@
-import { style } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { COLORS } from '@/styles/colors';
-import { THEME } from '@/styles/colors.css';
-import { SIZES } from '@/styles/sizes';
-import { transition } from '@/styles/transitions';
-
-export const proactiveContainer = recipe({
- base: {
- position: 'absolute',
- bottom: '100%',
- width: 256,
- display: 'flex',
- flexDirection: 'column',
- transition: transition(['opacity']),
- },
-
- variants: {
- side: {
- right: {
- right: 0,
- alignItems: 'end',
- },
- left: {
- left: 0,
- alignItems: 'start',
- },
- },
- },
-});
-
-export const singleMessage = style({
- padding: '11px 16px 10px 16px',
- maxWidth: 256,
- color: COLORS.NEUTRAL_DARK[900],
- boxShadow:
- '0px 1px 0px 0px rgba(22, 26, 30, 0.02), 0px 0px 0px 1px rgba(22, 26, 30, 0.04), 0px 1px 5px -4px rgba(22, 26, 30, 0.08), 0px 4px 8px -6px rgba(22, 26, 30, 0.08), 0px 1px 3px 1px rgba(22, 26, 30, 0.01)',
- borderRadius: SIZES.radius.xs,
- backgroundColor: COLORS.white,
- fontSize: 14,
- lineHeight: '20px',
- fontFamily: THEME.fontFamily,
- opacity: 0,
- transition: transition(['opacity']),
-});
-
-export const messageContainer = style({
- display: 'flex',
- flexDirection: 'column',
- gap: 8,
- margin: '16px 0',
- alignItems: 'inherit',
-});
-
-export const closeButton = style({
- width: SIZES.sm,
- height: SIZES.sm,
- borderRadius: SIZES.radius.round,
- borderWidth: 1,
- borderStyle: 'solid',
- borderColor: COLORS.NEUTRAL_LIGHT[100],
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- color: '#656D75',
- cursor: 'pointer',
- backgroundColor: COLORS.white,
- boxShadow: '0px 3px 4px 0px rgba(0, 0, 0, 0.02), 0px 8px 42px -16px rgba(0, 0, 0, 0.06)',
- transition: transition(['opacity', 'color', 'transform']),
- ':hover': {
- backgroundColor: COLORS.white,
- color: COLORS.NEUTRAL_DARK[600],
- transform: 'scale(1.15)',
- },
- ':active': {
- backgroundColor: COLORS.white,
- color: COLORS.NEUTRAL_DARK[800],
- transform: 'scale(0.8)',
- },
-});
-
-export const closeButtonIcon = style({
- width: 10,
- height: 10,
- marginBottom: 2,
-});
-
-export const closed = style({
- opacity: 0,
- pointerEvents: 'none',
-});
diff --git a/packages/chat/src/components/Prompt/Prompt.story.tsx b/packages/chat/src/components/Prompt/Prompt.story.tsx
deleted file mode 100644
index 1d3a90ed55..0000000000
--- a/packages/chat/src/components/Prompt/Prompt.story.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-import { useState } from 'react';
-
-import { WithDefaultPalette } from '@/storybook/decorators';
-
-import { Prompt } from '.';
-
-type Story = StoryObj;
-
-const InteractiveMock = (args: any) => {
- const [visible, setVisible] = useState(true);
- return (
- <>
-
- setVisible((prev) => !prev)}>Show Prompt
-
- >
- );
-};
-
-const meta: Meta = {
- title: 'Components/Chat/Prompt',
- component: Prompt,
- args: {
- cancel: { label: 'Cancel' },
- },
- render: (args) => ,
- decorators: [WithDefaultPalette],
-};
-
-export default meta;
-
-export const Base: Story = {
- args: {
- visible: true,
- accept: { label: 'Primary Action' },
- },
-};
-
-export const Dangerous: Story = {
- args: {
- visible: true,
- accept: { label: 'Dangerous Action' },
- },
-};
diff --git a/packages/chat/src/components/Prompt/index.tsx b/packages/chat/src/components/Prompt/index.tsx
deleted file mode 100644
index 1b42883a2e..0000000000
--- a/packages/chat/src/components/Prompt/index.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-import clsx from 'clsx';
-
-import { Button } from '@/components/Button';
-import { ClassName } from '@/constants';
-
-import { ButtonVariant } from '../Button/constants';
-import { chatOverlay, promptContainer } from './styles.css';
-
-export interface PromptOptionProps extends React.ComponentProps {
- /**
- * The label that will appear on the action button.
- */
- label: string;
-}
-
-export interface PromptProps {
- /**
- * Is the prompt visible.
- */
- visible: boolean;
-
- /**
- * Should we show an overlay over the dialog area.
- */
- showOverlay: boolean;
-
- /**
- * Configuration for the "accept" action.
- */
- accept: PromptOptionProps;
-
- /**
- * Configuration for the "cancel" action.
- */
- cancel: PromptOptionProps;
-}
-
-/**
- * A popup that prompts the user with cancel and accept actions.
- *
- * @see {@link https://voiceflow.github.io/react-chat/?path=/story/components-chat-prompt--default}
- */
-export const Prompt: React.FC = ({ visible, showOverlay, accept, cancel }) => {
- return (
- <>
- cancel?.onClick?.(e)}
- >
-
-
- {accept.label}
-
-
- {cancel.label}
-
-
- >
- );
-};
diff --git a/packages/chat/src/components/Prompt/styles.css.ts b/packages/chat/src/components/Prompt/styles.css.ts
deleted file mode 100644
index 19180637f9..0000000000
--- a/packages/chat/src/components/Prompt/styles.css.ts
+++ /dev/null
@@ -1,66 +0,0 @@
-import { recipe } from '@vanilla-extract/recipes';
-
-import { componentAnimations, timingFunction } from '@/styles/animations';
-import { COLORS } from '@/styles/colors';
-import { SIZES } from '@/styles/sizes';
-import { transition } from '@/styles/transitions';
-
-export const promptContainer = recipe({
- base: {
- position: 'absolute',
- bottom: 0,
- width: '100%',
- boxSizing: 'border-box',
- transition: `transform ${componentAnimations.endChat.transform} ${timingFunction.gentle}, box-shadow ${componentAnimations.endChat.boxShadow} ease, opacity ${componentAnimations.endChat.opacity} ease`,
- transform: 'translateY(130px)',
- padding: '12px 12px 30px 12px',
- borderRadius: SIZES.radius.lg,
- backgroundColor: COLORS.white,
- boxShadow: '0px 0px 0px 1px rgba(0, 0, 0, 0.06), 0px 0px 32px 0px rgba(0, 0, 0, 0.08)',
- display: 'flex',
- flexDirection: 'column',
- gap: 8,
- zIndex: 300,
- opacity: 0,
- pointerEvents: 'none',
- },
-
- variants: {
- visible: {
- true: {
- transform: 'translateY(18px)',
- opacity: 1,
- pointerEvents: 'auto',
- },
- false: {
- transform: 'translateY(130px)',
- transition: `all 0.25s ${timingFunction.gentle}`,
- opacity: 0,
- },
- },
- },
-});
-
-export const chatOverlay = recipe({
- base: {
- position: 'absolute',
- top: 0,
- bottom: 0,
- left: 0,
- right: 0,
- backgroundColor: 'rgba(0,0,0,0.16)',
- opacity: 0,
- transition: transition(['opacity']),
- pointerEvents: 'none',
- },
- variants: {
- visible: {
- true: {
- display: 'block',
- opacity: 1,
- zIndex: 200,
- pointerEvents: 'auto',
- },
- },
- },
-});
diff --git a/packages/chat/src/components/ScrollToBottom/index.tsx b/packages/chat/src/components/ScrollToBottom/index.tsx
deleted file mode 100644
index 9e6ae5930a..0000000000
--- a/packages/chat/src/components/ScrollToBottom/index.tsx
+++ /dev/null
@@ -1,81 +0,0 @@
-import clsx from 'clsx';
-import { type RefObject, useContext, useEffect, useRef, useState } from 'react';
-
-import { IsAutoScrollingContext } from '@/contexts';
-
-import { ScrollButton } from '../NewFooter/ScrollButton';
-import { scrollToBottomButton, scrollToButtonContainer } from './styles.css';
-
-interface ScrollToBottomProps {
- scrollableAreaRef: RefObject;
- className?: string;
-}
-
-export const ScrollToBottom: React.FC = ({ scrollableAreaRef, className }) => {
- const autoScrolling = useContext(IsAutoScrollingContext);
- const [atBottom, setAtBottom] = useState(true);
- const prevScrollPosition = useRef();
- const pauseCheck = useRef(false);
-
- useEffect(() => {
- const currentRef = scrollableAreaRef?.current;
- if (currentRef) {
- currentRef.addEventListener('scroll', handleScroll);
- }
- return () => {
- if (currentRef) {
- currentRef.removeEventListener('scroll', handleScroll);
- }
- };
- }, []);
-
- useEffect(() => {
- // If it's auto scrolling, then immediately hide the button and pause checking
- // for a bit.
- pauseCheck.current = autoScrolling;
- if (autoScrolling) setAtBottom(true);
- }, [autoScrolling]);
-
- const handleScroll = () => {
- if (!scrollableAreaRef?.current || !prevScrollPosition) return;
- if (pauseCheck.current) {
- return;
- }
-
- const { scrollTop, scrollHeight, clientHeight } = scrollableAreaRef.current;
-
- const buffer = 10;
- const isAboveBottom = scrollTop + clientHeight < scrollHeight - buffer;
-
- setAtBottom(!isAboveBottom);
- prevScrollPosition.current = scrollTop;
- };
-
- const scrollToBottom = () => {
- if (!scrollableAreaRef?.current) return;
-
- // We know that it will reach the bottom, so we call `setAtBottom(true)` cause we want
- // to immediately hide the button while it scrolls down.
- // ...and there's no reliable way of knowing when the scroll action finished, so we
- // just use a timer.
- setAtBottom(true);
- pauseCheck.current = true;
- setTimeout(() => {
- pauseCheck.current = false;
- }, 700);
-
- scrollableAreaRef.current.scrollTo({
- top: scrollableAreaRef.current.scrollHeight,
- behavior: 'smooth',
- });
- };
-
- return (
-
-
-
- );
-};
diff --git a/packages/chat/src/components/ScrollToBottom/styles.css.ts b/packages/chat/src/components/ScrollToBottom/styles.css.ts
deleted file mode 100644
index 0d72f572ca..0000000000
--- a/packages/chat/src/components/ScrollToBottom/styles.css.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-import { keyframes, style } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { BUTTON_SIZE } from '../NewFooter/ScrollButton/ScrollButton.css';
-
-const fadeIn = keyframes({
- from: {
- opacity: 0,
- transform: 'translateY(10px)',
- },
- to: {
- opacity: 1,
- transform: 'translateY(0)',
- },
-});
-
-const fadeOut = keyframes({
- from: {
- opacity: 1,
- transform: 'translateY(0)',
- },
- to: {
- opacity: 0,
- transform: 'translateY(10px)',
- },
-});
-
-export const scrollToButtonContainer = style({
- height: 0,
- width: '100%',
- position: 'relative',
- zIndex: 12,
-});
-
-export const scrollToBottomButton = recipe({
- base: {
- opacity: 1,
- position: 'absolute',
- left: `calc(50% - ${BUTTON_SIZE / 2}px)`,
- top: `-${BUTTON_SIZE + 12}px`,
- animation: `${fadeIn} .15s ease-in`,
- outline: 'none',
- },
- variants: {
- hidden: {
- true: {
- opacity: 0,
- animation: `${fadeOut} .15s ease-in`,
- },
- },
- },
-});
diff --git a/packages/chat/src/components/SendButton/SendButton.story.tsx b/packages/chat/src/components/SendButton/SendButton.story.tsx
deleted file mode 100644
index 0f1c4b7bc6..0000000000
--- a/packages/chat/src/components/SendButton/SendButton.story.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import { WithDefaultPalette } from '@/storybook/decorators';
-
-import { SendButton } from '.';
-
-type Story = StoryObj;
-
-const meta: Meta = {
- title: 'Core/Send Button',
- component: SendButton,
- decorators: [WithDefaultPalette],
-};
-export default meta;
-
-export const Default: Story = {
- args: {
- disabled: false,
- color: '#387dff',
- },
-};
-
-export const Disabled: Story = {
- args: {
- disabled: true,
- color: '#387dff',
- },
-};
diff --git a/packages/chat/src/components/SendButton/SendIcon.tsx b/packages/chat/src/components/SendButton/SendIcon.tsx
deleted file mode 100644
index b58a83b1bd..0000000000
--- a/packages/chat/src/components/SendButton/SendIcon.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import type { SVGProps } from 'react';
-
-export const SendIcon = (props: SVGProps) => (
-
-
-
-);
diff --git a/packages/chat/src/components/SendButton/index.tsx b/packages/chat/src/components/SendButton/index.tsx
deleted file mode 100644
index 7c87008a25..0000000000
--- a/packages/chat/src/components/SendButton/index.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import clsx from 'clsx';
-import { type ComponentPropsWithRef, forwardRef } from 'react';
-
-import { ClassName } from '@/constants';
-
-import { Button } from '../Button';
-import { SendIcon } from './SendIcon';
-import { sendButtonStyle, sendIconStyle } from './styles.css';
-
-interface SendButtonProps extends ComponentPropsWithRef<'button'> {
- disabled?: boolean;
- testID?: string;
-}
-
-export const SendButton: React.FC = forwardRef(
- ({ disabled, testID, ...props }, ref) => (
-
-
-
- )
-);
diff --git a/packages/chat/src/components/SendButton/styles.css.ts b/packages/chat/src/components/SendButton/styles.css.ts
deleted file mode 100644
index f69ab21a98..0000000000
--- a/packages/chat/src/components/SendButton/styles.css.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-import { recipe } from '@vanilla-extract/recipes';
-
-import { COLORS } from '@/styles/colors';
-import { THEME } from '@/styles/colors.css';
-import { transition } from '@/styles/transitions';
-
-import { buttonStyles } from '../Button/styles.css';
-
-export const sendButtonStyle = recipe({
- base: [
- buttonStyles({ round: true }),
- {
- display: 'flex',
- height: 32,
- width: 32,
- padding: 0,
- boxShadow: '0px -1px 0px 0px rgba(0, 0, 0, 0.16) inset',
- transition: transition(['color', 'background-color', 'transform']),
- },
- ],
- variants: {
- disabled: {
- true: {
- boxShadow: 'none',
- backgroundColor: COLORS.NEUTRAL_LIGHT[50],
- ':hover': {
- cursor: 'not-allowed',
- backgroundColor: COLORS.NEUTRAL_LIGHT[50],
- },
- },
- false: {
- backgroundColor: THEME.colors[500],
- ':hover': {
- transform: 'scale(1.15)',
- backgroundColor: THEME.colors[600],
- },
- ':active': {
- transform: 'scale(1)',
- backgroundColor: THEME.colors[700],
- },
- },
- },
- },
-});
-
-export const sendIconStyle = recipe({
- variants: {
- disabled: {
- true: {
- color: COLORS.NEUTRAL_DARK[100],
- },
- false: {
- color: THEME.colors[50],
- },
- },
- },
-});
diff --git a/packages/chat/src/components/Separator/Separator.story.tsx b/packages/chat/src/components/Separator/Separator.story.tsx
deleted file mode 100644
index f286b6260a..0000000000
--- a/packages/chat/src/components/Separator/Separator.story.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import { Separator } from '.';
-
-type Story = StoryObj;
-
-const meta: Meta = {
- title: 'Components/Chat/Separator',
- component: Separator,
-};
-
-export default meta;
-
-export const Default: Story = {
- args: {
- text: 'Chat has ended',
- },
-};
diff --git a/packages/chat/src/components/Separator/index.tsx b/packages/chat/src/components/Separator/index.tsx
deleted file mode 100644
index a86f5e507b..0000000000
--- a/packages/chat/src/components/Separator/index.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { line, separatorContainer, separatorText } from './styles.css';
-
-export const Separator = ({ text }: { text: string }) => (
-
-);
diff --git a/packages/chat/src/components/Separator/styles.css.ts b/packages/chat/src/components/Separator/styles.css.ts
deleted file mode 100644
index 95ce8bf287..0000000000
--- a/packages/chat/src/components/Separator/styles.css.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { style } from '@vanilla-extract/css';
-
-import { COLORS } from '@/styles/colors';
-import { THEME } from '@/styles/colors.css';
-
-export const separatorContainer = style({
- height: 17,
- display: 'flex',
- gap: 12,
- alignItems: 'center',
- padding: '4px 0',
-});
-
-export const line = style({
- backgroundColor: COLORS.NEUTRAL_LIGHT[50],
- height: 1,
- flexGrow: 1,
-});
-
-export const separatorText = style({
- backgroundColor: COLORS.white,
- color: COLORS.NEUTRAL_DARK[200],
- fontFamily: THEME.fontFamily,
- fontSize: '12px',
- lineHeight: '17px',
- fontWeight: 600,
- flexShrink: 0,
-});
diff --git a/packages/chat/src/components/SystemResponse/ExtensionMessage.tsx b/packages/chat/src/components/SystemResponse/ExtensionMessage.tsx
deleted file mode 100644
index b973eaef67..0000000000
--- a/packages/chat/src/components/SystemResponse/ExtensionMessage.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import type { Trace } from '@voiceflow/base-types';
-import clsx from 'clsx';
-import { useEffect, useRef } from 'react';
-
-import { ClassName } from '@/constants';
-import type { ResponseExtension } from '@/dtos/Extension.dto';
-
-import { extensionMessageContainer } from './styles.css';
-
-export interface ExtensionMessageProps {
- extension: ResponseExtension;
- trace: Trace.AnyTrace;
-}
-
-export const ExtensionMessage: React.FC = ({ extension, trace }) => {
- const ref = useRef(null);
-
- useEffect(() => {
- try {
- const unmount = extension.render?.({ trace, element: ref.current as HTMLElement });
- if (!unmount) return undefined;
-
- return () => {
- try {
- unmount?.();
- } catch (e) {
- console.error(`Extension '${extension.name}' threw an error while unmounting: ${e}`);
- }
- };
- } catch (e) {
- console.error(`Extension '${extension.name}' threw an error while mounting: ${e}`);
- return undefined;
- }
- }, []);
-
- return (
-
-
-
- );
-};
diff --git a/packages/chat/src/components/SystemResponse/Indicator/Indicator.css.ts b/packages/chat/src/components/SystemResponse/Indicator/Indicator.css.ts
deleted file mode 100644
index a18ae0dd52..0000000000
--- a/packages/chat/src/components/SystemResponse/Indicator/Indicator.css.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { style } from '@vanilla-extract/css';
-
-export const indicatorContainer = style({
- display: 'flex',
- alignItems: 'center',
- gap: '12px',
-});
diff --git a/packages/chat/src/components/SystemResponse/Indicator/Indicator.story.tsx b/packages/chat/src/components/SystemResponse/Indicator/Indicator.story.tsx
deleted file mode 100644
index bfcd5fe5f9..0000000000
--- a/packages/chat/src/components/SystemResponse/Indicator/Indicator.story.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import EMPTY_IMAGE from '@/__fixtures__/empty-image.png';
-
-import Indicator from './Indicator';
-
-type Story = StoryObj;
-
-const meta: Meta = {
- title: 'Components/Chat/Indicator',
- component: Indicator,
- args: {
- avatar: EMPTY_IMAGE,
- },
- argTypes: {},
- excludeStories: ['RawTemplate'],
- render: (args) => ,
-};
-
-export default meta;
-
-export const SimpleText: Story = {
- args: {
- avatar: EMPTY_IMAGE,
- },
-};
diff --git a/packages/chat/src/components/SystemResponse/Indicator/Indicator.tsx b/packages/chat/src/components/SystemResponse/Indicator/Indicator.tsx
deleted file mode 100644
index 00f9975ee9..0000000000
--- a/packages/chat/src/components/SystemResponse/Indicator/Indicator.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import clsx from 'clsx';
-
-import { Avatar } from '@/components/Avatar';
-import { MessageContainer } from '@/components/MessageContainer';
-import { TypingIndicator } from '@/components/TypingIndicator';
-
-import { indicatorContainer } from './Indicator.css';
-
-export interface IndicatorProps {
- avatar?: string;
- isLast?: boolean;
- className?: string;
-}
-
-const Indicator: React.FC = ({ avatar, isLast, className }) => (
-
- {avatar && }
-
-
-);
-
-export default Indicator;
diff --git a/packages/chat/src/components/SystemResponse/SystemMessage.tsx b/packages/chat/src/components/SystemResponse/SystemMessage.tsx
deleted file mode 100644
index 5b3dd38ea1..0000000000
--- a/packages/chat/src/components/SystemResponse/SystemMessage.tsx
+++ /dev/null
@@ -1,114 +0,0 @@
-import clsx from 'clsx';
-import { useContext } from 'react';
-import * as R from 'remeda';
-import { match } from 'ts-pattern';
-
-import { ClassName } from '@/constants';
-import { RuntimeStateAPIContext } from '@/contexts';
-
-import { AgentMessage } from '../AgentMessage';
-import { Avatar } from '../Avatar';
-import { Card } from '../Card';
-import { Carousel } from '../Carousel';
-import { FeedbackButton } from '../FeedbackButton';
-import { type IFeedbackButton } from '../FeedbackButton/FeedbackButton.interface';
-import { Image } from '../Image';
-import { MessageType } from './constants';
-import { ExtensionMessage } from './ExtensionMessage';
-import { hide, messageContainer, responseAvatar, systemMessageContainer } from './styles.css';
-import type { MessageProps } from './types';
-
-export interface AIDisclaimerProps {
- enabled?: boolean;
- text?: string;
-}
-
-export interface SystemMessageProps {
- /**
- * An image URL for an avatar to associate this message with.
- */
- avatar?: string;
-
- /**
- * A unix timestamp indicating when this message was sent.
- */
- timestamp?: number;
-
- /**
- * A single message to render.
- */
- message?: MessageProps;
-
- /**
- * If true, renders an avatar next to the message.
- */
- withImage: boolean;
-
- /**
- * If provided, will display {@link FeedbackButton} component.
- * @default false
- */
- feedback?: IFeedbackButton | undefined;
-
- /**
- * If this is the last message recieved
- */
- isLast?: boolean;
-
- /**
- * The entire text content of a response over a number of responses
- */
- textContent?: string;
-
- aiDisclaimer?: AIDisclaimerProps;
-}
-
-/**
- * An individual message within a system response
- */
-export const SystemMessage: React.FC = ({
- avatar,
- message,
- feedback,
- isLast,
- withImage,
- textContent,
- aiDisclaimer,
-}) => {
- const { config } = useContext(RuntimeStateAPIContext);
-
- return (
-
- {match(message)
- // We check for `MessageType.CAROUSEL` before all the others, because a Carousel will take care
- // of rendering the Avatar itself
- .with({ type: MessageType.CAROUSEL }, (props) => (
-
- ))
- .otherwise((message) => (
- <>
- {avatar &&
}
-
- {match(message)
- .with({ type: MessageType.TEXT }, ({ text, ai }) => (
-
- ))
- .with({ type: MessageType.IMAGE }, ({ url }) =>
)
- .with({ type: MessageType.CARD }, (props) =>
)
- .with({ type: MessageType.EXTENSION }, ({ payload }) => (
-
- ))
- .otherwise(() => null)}
-
- >
- ))}
-
- );
-};
diff --git a/packages/chat/src/components/SystemResponse/SystemResponse.story.tsx b/packages/chat/src/components/SystemResponse/SystemResponse.story.tsx
deleted file mode 100644
index 190c590f13..0000000000
--- a/packages/chat/src/components/SystemResponse/SystemResponse.story.tsx
+++ /dev/null
@@ -1,197 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import EMPTY_IMAGE from '@/__fixtures__/empty-image.png';
-import CODE_RESPONSE_FIXTURE from '@/__fixtures__/markdown/code-response.md?raw';
-import { MOCK_IMAGE, VF_ICON } from '@/fixtures';
-
-import { FeedbackButtonVariant } from '../FeedbackButton/FeedbackButton.interface';
-import type { MessageProps } from '.';
-import { SystemResponse } from '.';
-
-type Story = StoryObj;
-
-const CARD_IMAGE = MOCK_IMAGE;
-const TEXT_MESSAGE: MessageProps = {
- type: 'text',
- text: 'Lorem ipsum dolor sit amet consectetur voluptas perspiciatis est quis dolores',
-};
-const CARD: MessageProps = {
- type: 'card',
- title: 'Card Message',
- description:
- 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Exercitationem voluptas perspiciatis est quis dolores!',
- image: CARD_IMAGE,
-};
-
-const meta: Meta = {
- title: 'Components/Chat/SystemResponse',
- component: SystemResponse,
- args: {
- timestamp: Date.now(),
- avatar: VF_ICON,
- isLast: true,
- },
- argTypes: {
- timestamp: {
- control: { type: 'date' },
- },
- },
- excludeStories: ['RawTemplate'],
- render: (args) => ,
-};
-
-export default meta;
-
-export const SimpleText: Story = {
- args: {
- avatar: EMPTY_IMAGE,
- messages: [{ type: 'text', text: 'Lorem ipsum dolor' }],
- },
-};
-
-export const SimpleTextWithoutAvatar: Story = {
- args: {
- messages: [{ type: 'text', text: 'Lorem ipsum dolor' }],
- },
-};
-
-export const TypingState: Story = {
- args: {
- avatar: EMPTY_IMAGE,
- messages: [{ type: 'text', text: 'Lorem ipsum dolor', delay: 10000 }],
- isLast: true,
- },
-};
-
-export const WrappingText: Story = {
- args: {
- messages: [{ type: 'text', text: 'consecteturaconsecteturaconsecteturaconsecteturaconsecteturaconsectetura' }],
- },
-};
-
-export const CodeResponse: Story = {
- args: {
- avatar: EMPTY_IMAGE,
- messages: [{ type: 'text', text: CODE_RESPONSE_FIXTURE }],
- },
-};
-
-export const MultilineText: Story = {
- args: {
- messages: [TEXT_MESSAGE],
- },
-};
-
-export const ActionableText: Story = {
- args: {
- messages: [TEXT_MESSAGE, TEXT_MESSAGE, TEXT_MESSAGE],
- isLast: true,
- actions: [
- { request: {} as any, name: 'Button One' },
- { request: {} as any, name: 'Button Two' },
- { request: {} as any, name: 'Button Three' },
- ],
- },
-};
-
-export const Image: Story = {
- args: {
- messages: [{ type: 'image', url: CARD_IMAGE }],
- },
-};
-
-export const Card: Story = {
- args: {
- messages: [CARD],
- },
-};
-
-export const ActionableCard: Story = {
- args: {
- messages: [
- {
- ...CARD,
- actions: [
- { request: {} as any, name: 'First Button' },
- { request: {} as any, name: 'Second Button' },
- { request: {} as any, name: 'Third Button' },
- ],
- },
- ],
- },
-};
-
-export const Carousel: Story = {
- args: {
- avatar: EMPTY_IMAGE,
- messages: [
- {
- type: 'carousel',
- cards: [
- {
- title: 'First Card',
- description:
- 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Exercitationem voluptas perspiciatis est quis dolores!',
- image: CARD_IMAGE,
- actions: [
- { request: {} as any, name: 'First Button' },
- { request: {} as any, name: 'Second Button' },
- { request: {} as any, name: 'Third Button' },
- ],
- },
- {
- title: 'Second Card',
- description: 'Lorem ipsum dolor sit amet consectetur adipisicing elit.',
- image: CARD_IMAGE,
- actions: [
- { request: {} as any, name: 'First Button' },
- { request: {} as any, name: 'Second Button' },
- ],
- },
- {
- title: 'Third Card',
- description: 'Lorem ipsum dolor sit amet',
- image: CARD_IMAGE,
- },
- ],
- },
- ],
- },
-};
-
-export const Multiple: Story = {
- args: {
- messages: [CARD, TEXT_MESSAGE],
- },
-};
-
-export const MultipleWithFeedback: Story = {
- args: {
- feedback: {
- onClick: () => null,
- },
- isLast: true,
- messages: [CARD, TEXT_MESSAGE],
- },
-};
-
-export const MultipleWithFeedbackAI: Story = {
- args: {
- feedback: {
- onClick: () => null,
- },
- isLast: true,
- messages: [CARD, { ...TEXT_MESSAGE, ai: true }],
- },
-};
-
-export const PreviousMultipleWithFeedback: Story = {
- args: {
- feedback: {
- onClick: () => null,
- variant: FeedbackButtonVariant.PREVIOUS_RESPONSE,
- },
- isLast: false,
- messages: [CARD, TEXT_MESSAGE],
- },
-};
diff --git a/packages/chat/src/components/SystemResponse/constants.ts b/packages/chat/src/components/SystemResponse/constants.ts
deleted file mode 100644
index 35e496fd94..0000000000
--- a/packages/chat/src/components/SystemResponse/constants.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-export enum MessageType {
- TEXT = 'text',
- IMAGE = 'image',
- CARD = 'card',
- CAROUSEL = 'carousel',
- END = 'END',
- EXTENSION = 'EXTENSION',
-}
-
-export const DEFAULT_MESSAGE_DELAY = 1000;
diff --git a/packages/chat/src/components/SystemResponse/hooks.ts b/packages/chat/src/components/SystemResponse/hooks.ts
deleted file mode 100644
index cfdf121d06..0000000000
--- a/packages/chat/src/components/SystemResponse/hooks.ts
+++ /dev/null
@@ -1,106 +0,0 @@
-import { useCallback, useEffect, useRef, useState } from 'react';
-import { match } from 'ts-pattern';
-
-import { useDidUpdateEffect } from '@/hooks/useDidUpdateEffect';
-
-import { DEFAULT_MESSAGE_DELAY, MessageType } from './constants';
-import type { MessageProps } from './types';
-
-export * from './types';
-
-enum AnimationType {
- MESSAGE = 'message',
- INDICATOR = 'indicator',
-}
-
-type Animation = {
- [AnimationType.MESSAGE]: { type: AnimationType.MESSAGE; message: MessageProps };
- [AnimationType.INDICATOR]: { type: AnimationType.INDICATOR; messageDelay: number };
-}[T];
-
-const createAnimateIndicator = (messageDelay: number = DEFAULT_MESSAGE_DELAY): Animation => ({
- type: AnimationType.INDICATOR,
- messageDelay,
-});
-
-export const useAnimatedMessages = ({
- messages,
- isLast,
-}: {
- messages: MessageProps[];
- isLast: boolean | undefined;
-}) => {
- const shouldAnimate = useRef(isLast && !!messages.length);
- const [complete, setComplete] = useState(!shouldAnimate.current);
- const [showIndicator, setShowIndicator] = useState(shouldAnimate.current);
- const [visibleMessages, setVisibleMessages] = useState(shouldAnimate.current ? [] : messages);
-
- const endAnimation = useCallback(() => {
- setComplete(true);
- setShowIndicator(false);
- }, []);
-
- useEffect(() => {
- if (!shouldAnimate) return undefined;
-
- const animations = messages.flatMap((message) =>
- message.type === MessageType.END
- ? [{ type: AnimationType.MESSAGE, message }]
- : [createAnimateIndicator(message.delay), { type: AnimationType.MESSAGE, message }]
- );
-
- let timer: NodeJS.Timeout;
- const setTimer = (callback: VoidFunction, messageDelay: number) => {
- if (messageDelay === 0) {
- callback();
- return;
- }
-
- timer = setTimeout(() => {
- callback();
- }, messageDelay);
- };
-
- const animate = () => {
- if (!shouldAnimate.current) return;
-
- const next = animations.shift();
- if (!next) {
- endAnimation();
- return;
- }
-
- match(next)
- .with({ type: AnimationType.MESSAGE }, ({ message }) => {
- setShowIndicator(false);
- setVisibleMessages((prev) => [...prev, message]);
- setTimer(animate, DEFAULT_MESSAGE_DELAY);
- })
- .with({ type: AnimationType.INDICATOR }, ({ messageDelay = DEFAULT_MESSAGE_DELAY }) => {
- setShowIndicator(true);
- setTimer(animate, messageDelay);
- })
- .exhaustive();
- };
-
- animate();
-
- return () => {
- clearTimeout(timer);
- };
- }, []);
-
- useDidUpdateEffect(() => {
- if (!isLast) {
- shouldAnimate.current = false;
- endAnimation();
- setVisibleMessages(messages);
- }
- }, [isLast]);
-
- return {
- complete,
- showIndicator,
- visibleMessages,
- };
-};
diff --git a/packages/chat/src/components/SystemResponse/index.tsx b/packages/chat/src/components/SystemResponse/index.tsx
deleted file mode 100644
index 8cfaf49302..0000000000
--- a/packages/chat/src/components/SystemResponse/index.tsx
+++ /dev/null
@@ -1,182 +0,0 @@
-import type { RuntimeAction } from '@voiceflow/sdk-runtime';
-import { serializeToText } from '@voiceflow/slate-serializer/text';
-import { useContext } from 'react';
-
-import { RuntimeStateAPIContext } from '@/contexts';
-import { useAutoScroll } from '@/hooks/useAutoScroll';
-import { fadeInAndUp } from '@/styles/animation-utils.css';
-
-import { Button } from '../Button';
-import { ButtonVariant } from '../Button/constants';
-import { FeedbackButton } from '../FeedbackButton';
-import { FeedbackButtonVariant, type IFeedbackButton } from '../FeedbackButton/FeedbackButton.interface';
-import { MessageContainer } from '../MessageContainer';
-import { MessageType } from './constants';
-import { useAnimatedMessages } from './hooks';
-import Indicator from './Indicator/Indicator';
-import EndState from './state/end';
-import { actionsContainer, feedbackContainer } from './styles.css';
-import type { AIDisclaimerProps, SystemMessageProps } from './SystemMessage';
-import { SystemMessage } from './SystemMessage';
-import type { MessageProps } from './types';
-
-export * from './types';
-
-export interface ResponseActionProps {
- name: string;
- request: RuntimeAction;
-}
-
-export interface SystemResponseProps {
- /**
- * An image URL for an avatar to associate the messages with.
- * If we don't have an avatar here or got `undefined` it means that
- * this setting is disabled. If it wasn't disabled we would have an
- * avatar here given by the user, or the default avatar.
- */
- avatar?: string;
-
- /**
- * A unix timestamp indicating when the messages were sent.
- */
- timestamp: number;
-
- /**
- * A list of messages that will be rendered as {@link SystemMessage} components.
- */
- messages: MessageProps[];
-
- /**
- * A list of actions that will be rendered as buttons.
- */
- actions?: ResponseActionProps[];
-
- /**
- * If true, allows actions to appear after this message.
- * Only the last system message in a row can show actions.
- */
- isLast?: boolean;
-
- /**
- * If true, the system message is the first in a chat.
- */
- isFirst?: boolean;
-
- /**
- * If provided, will display {@link FeedbackButton} component under the last message.
- * @default false
- */
- feedback?: IFeedbackButton | undefined;
-
- aiDisclaimer?: AIDisclaimerProps;
-
- /**
- * Override the rendering of individual messages.
- */
- Message?: React.ComponentType;
-}
-
-/**
- * A dynamic component capable of displaying all standard system responses.
- *
- * @see {@link https://voiceflow.github.io/react-chat/?path=/story/components-chat-systemresponse--simple-text}
- */
-export const SystemResponse: React.FC = ({
- feedback,
- avatar,
- timestamp,
- messages,
- actions = [],
- isLast,
- aiDisclaimer,
- Message = SystemMessage,
-}) => {
- const runtime = useContext(RuntimeStateAPIContext);
-
- const { showIndicator, visibleMessages, complete } = useAnimatedMessages({
- messages,
- isLast,
- });
-
- useAutoScroll([showIndicator, complete, visibleMessages.length]);
-
- if (!messages.length && !actions.length) return null;
-
- const getLastTextMessageIndex = (messages: MessageProps[]) => {
- for (let i = messages.length - 1; i >= 0; i--) {
- if (messages[i].type === MessageType.TEXT) return i;
- }
- return -1;
- };
- const lastTextMessageIndex = getLastTextMessageIndex(visibleMessages);
-
- const allTextContentForMessage = visibleMessages.reduce((acc, message) => {
- if (message.type === MessageType.TEXT) {
- return (
- acc + (acc ? '\n' : '') + (typeof message.text !== 'string' ? serializeToText(message.text) : message.text)
- );
- }
- return acc;
- }, '');
-
- return (
-
- {visibleMessages.map((message, index) => {
- const endConversation = message?.type === MessageType.END;
- if (endConversation) {
- return ;
- }
-
- const lastMessageInGroup = index === visibleMessages.length - 1;
-
- // Showing feedback on previous messages that were in the chat
- const showFeedback = index === lastTextMessageIndex; // lastMessageInGroup && message.type === MessageType.TEXT;
-
- // Showing feedback on the most recent system message of the chat
- const addFeedback = feedback && isLast && complete && lastMessageInGroup;
-
- return (
- <>
-
- {addFeedback && message.type !== MessageType.CAROUSEL && (
-
-
-
- )}
- >
- );
- })}
- {isLast && complete && !!actions.length && (
-
- {actions.map(({ request, name }, index) => (
-
- runtime?.interact(request, name)} key={index}>
- {name}
-
-
- ))}
-
- )}
- {showIndicator && }
-
- );
-};
diff --git a/packages/chat/src/components/SystemResponse/state/end.tsx b/packages/chat/src/components/SystemResponse/state/end.tsx
deleted file mode 100644
index d8ddd45c3c..0000000000
--- a/packages/chat/src/components/SystemResponse/state/end.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { useContext, useEffect } from 'react';
-
-import { RuntimeStateAPIContext } from '@/contexts';
-import { SessionStatus } from '@/types';
-
-const EndState: React.FC = () => {
- const runtime = useContext(RuntimeStateAPIContext);
-
- useEffect(() => {
- runtime.setStatus(SessionStatus.ENDED);
- }, []);
-
- return null;
-};
-
-export default EndState;
diff --git a/packages/chat/src/components/SystemResponse/styles.css.ts b/packages/chat/src/components/SystemResponse/styles.css.ts
deleted file mode 100644
index 7910877e2f..0000000000
--- a/packages/chat/src/components/SystemResponse/styles.css.ts
+++ /dev/null
@@ -1,91 +0,0 @@
-import { keyframes, style } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { duration } from '@/styles/animations';
-import { SIZES } from '@/styles/sizes';
-
-import { SMALL_AVATAR_SIZE } from '../Avatar/styles.css';
-
-export const MESSAGE_PADDING = 12;
-
-export const hide = style({
- visibility: 'hidden',
-});
-
-const fadeInSlideUp = keyframes({
- from: {
- opacity: 0,
- transform: 'translateY(5px)',
- },
- to: {
- opacity: 1,
- transform: 'translateY(0)',
- },
-});
-
-export const systemMessageContainer = style({
- display: 'flex',
- alignItems: 'flex-end',
- marginBottom: 4,
- animation: `${fadeInSlideUp} ${duration.fast} ease-in`,
-});
-
-export const responseAvatar = style({
- marginBottom: 4,
-});
-
-export const messageContainer = recipe({
- base: {
- width: `calc(100% - ${MESSAGE_PADDING + SMALL_AVATAR_SIZE}px)`,
- marginLeft: MESSAGE_PADDING,
- },
- variants: {
- withAvatar: {
- false: {
- marginLeft: 0,
- },
- },
- },
-});
-
-export const actionsContainer = recipe({
- base: {
- display: 'flex',
- flexWrap: 'wrap',
- gap: 8,
- margin: '16px 0 8px 0',
- paddingLeft: 44,
- },
- variants: {
- withAvatar: {
- false: {
- paddingLeft: 0,
- },
- },
- },
-});
-
-export const extensionMessageContainer = style({
- display: 'inline-block',
- boxSizing: 'border-box',
- padding: '10px 14px',
- borderRadius: SIZES.radius.sm,
- overflowWrap: 'anywhere',
- color: '#000',
- backgroundColor: '#f4f4f4',
-});
-
-export const feedbackContainer = recipe({
- base: {
- marginTop: 6,
- zIndex: 1,
- marginLeft: MESSAGE_PADDING + SMALL_AVATAR_SIZE - 6,
- },
- variants: {
- withAvatar: {
- false: {
- marginLeft: -6,
- },
- },
- },
-});
diff --git a/packages/chat/src/components/SystemResponse/types.ts b/packages/chat/src/components/SystemResponse/types.ts
deleted file mode 100644
index faad5a2ee8..0000000000
--- a/packages/chat/src/components/SystemResponse/types.ts
+++ /dev/null
@@ -1,58 +0,0 @@
-import type { Text, Trace } from '@voiceflow/base-types';
-
-import type { CardProps } from '@/components/Card/types';
-import type { ResponseExtension } from '@/dtos/Extension.dto';
-import type { StringifiedEnum } from '@/types/util';
-
-import type { MessageType } from './constants';
-
-export interface BaseMessageProps {
- delay?: number | undefined;
- ai?: boolean;
-}
-
-export interface TextMessageProps extends BaseMessageProps {
- type: StringifiedEnum;
- text: string | Text.SlateTextValue;
- audio?: { src: string };
-}
-
-export interface ImageMessageProps extends BaseMessageProps {
- type: StringifiedEnum;
- url: string | null;
-}
-
-export interface CardMessageProps extends CardProps, BaseMessageProps {
- type: StringifiedEnum;
-}
-
-export interface CarouselMessageProps extends BaseMessageProps {
- type: StringifiedEnum;
- cards: CardProps[];
-}
-
-export interface EndMessage extends BaseMessageProps {
- type: StringifiedEnum;
-}
-
-export interface ExtensionMessage extends BaseMessageProps {
- type: StringifiedEnum;
- payload: {
- trace: Trace.AnyTrace;
- extension: ResponseExtension;
- };
-}
-
-export interface CustomMessage extends BaseMessageProps {
- type: `custom_${string}`;
- payload: any;
-}
-
-export type MessageProps =
- | TextMessageProps
- | ImageMessageProps
- | CardMessageProps
- | CarouselMessageProps
- | EndMessage
- | ExtensionMessage
- | CustomMessage;
diff --git a/packages/chat/src/components/Tooltip/Tooltip.story.tsx b/packages/chat/src/components/Tooltip/Tooltip.story.tsx
deleted file mode 100644
index 4fb51a5aa7..0000000000
--- a/packages/chat/src/components/Tooltip/Tooltip.story.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import { Tooltip } from '.';
-
-type Story = StoryObj;
-const meta: Meta = {
- title: 'Components/Tooltip',
- component: Tooltip,
- argTypes: {
- onClick: { table: { disable: true } },
- orientation: {
- options: ['left', 'right'],
- control: { type: 'radio' },
- defaultValue: 'left',
- },
- },
- args: {
- children: 'Lorem ipsum dolor sit amet consectetur adipisicing elit.',
- },
-};
-
-export default meta;
-
-export const LeftOrientation: Story = {
- args: {
- orientation: 'left',
- },
-};
-
-export const RightOrientation: Story = {
- args: {
- orientation: 'right',
- },
-};
-
-export const Actionable: Story = {
- args: {
- label: 'Action Label',
- },
-};
diff --git a/packages/chat/src/components/Tooltip/index.tsx b/packages/chat/src/components/Tooltip/index.tsx
deleted file mode 100644
index 7f7ec31223..0000000000
--- a/packages/chat/src/components/Tooltip/index.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-import { DebugMessage, type DebugMessageProps } from '../DebugMessage';
-import { buttonStyle, containerStyle } from './styles.css';
-
-export interface ActionMessageProps extends DebugMessageProps {
- /**
- * If provided, this will render an action button within the tooltip.
- */
- label?: string | undefined;
-
- /**
- * A callback handler for the action button.
- */
- onClick?: React.MouseEventHandler | undefined;
-}
-
-/**
- * Renders a tooltip, optionally with an action button attached to it.
- *
- * @see {@link https://voiceflow.github.io/react-chat/?path=/story/components-tooltip--left-orientation}
- */
-export const Tooltip: React.FC = ({ label, onClick, children, ...props }) => (
-
- {children}
- {label && (
-
- {label}
-
- )}
-
-);
diff --git a/packages/chat/src/components/Tooltip/styled.css.ts b/packages/chat/src/components/Tooltip/styled.css.ts
deleted file mode 100644
index 2c8a3a0721..0000000000
--- a/packages/chat/src/components/Tooltip/styled.css.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { style, styleVariants } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { THEME } from '@/styles/colors.css';
-import { SIZES } from '@/styles/sizes';
-
-export const buttonStyle = style({
- height: SIZES.m,
- border: '1px solid #dfdfdf',
- borderTopColor: 'rgba(223,223,223,0.5)',
- borderRadius: SIZES.radius.xs,
- borderTopLeftRadius: 0,
- borderTopRightRadius: 0,
- fontWeight: 600,
- color: THEME.colors[500],
- backgroundColor: '#fbfbfb',
-});
-
-export const withActionVariant = styleVariants({
- true: {
- boxShadow: '0 1px 2px rgba(0,0,0,0.02)',
- borderBottomLeftRadius: 0,
- borderBottomRightRadius: 0,
- },
-});
-
-export const containerStyle = recipe({
- base: {
- fontFamily: THEME.fontFamily,
- fontSize: '12px',
- display: 'inline-flex',
- flexDirection: 'column',
- },
- variants: {
- withActionVariant,
- },
-});
diff --git a/packages/chat/src/components/Tooltip/styles.css.ts b/packages/chat/src/components/Tooltip/styles.css.ts
deleted file mode 100644
index 2c8a3a0721..0000000000
--- a/packages/chat/src/components/Tooltip/styles.css.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { style, styleVariants } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { THEME } from '@/styles/colors.css';
-import { SIZES } from '@/styles/sizes';
-
-export const buttonStyle = style({
- height: SIZES.m,
- border: '1px solid #dfdfdf',
- borderTopColor: 'rgba(223,223,223,0.5)',
- borderRadius: SIZES.radius.xs,
- borderTopLeftRadius: 0,
- borderTopRightRadius: 0,
- fontWeight: 600,
- color: THEME.colors[500],
- backgroundColor: '#fbfbfb',
-});
-
-export const withActionVariant = styleVariants({
- true: {
- boxShadow: '0 1px 2px rgba(0,0,0,0.02)',
- borderBottomLeftRadius: 0,
- borderBottomRightRadius: 0,
- },
-});
-
-export const containerStyle = recipe({
- base: {
- fontFamily: THEME.fontFamily,
- fontSize: '12px',
- display: 'inline-flex',
- flexDirection: 'column',
- },
- variants: {
- withActionVariant,
- },
-});
diff --git a/packages/chat/src/components/TypingIndicator/TypingIndicator.story.tsx b/packages/chat/src/components/TypingIndicator/TypingIndicator.story.tsx
deleted file mode 100644
index 7e7ba68d2b..0000000000
--- a/packages/chat/src/components/TypingIndicator/TypingIndicator.story.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import { DEFAULT_AVATAR, NewChat } from '@/main';
-import { WithDefaultPalette, WithRuntimeProvider } from '@/storybook/decorators';
-
-import Indicator from '../SystemResponse/Indicator/Indicator';
-import { SystemMessage } from '../SystemResponse/SystemMessage';
-import { TypingIndicator } from '.';
-
-type Story = StoryObj;
-const meta: Meta = {
- title: 'Components/TypingIndicator',
- component: TypingIndicator,
- decorators: [WithRuntimeProvider, WithDefaultPalette],
-};
-
-export default meta;
-
-export const Default: Story = {
- args: {},
-};
-
-export const InsideChat: Story = {
- render: () => (
-
- Promise.resolve(),
- placeholder: 'Message...',
- },
- }}
- isLoading={false}
- hasEnded={false}
- >
-
-
-
-
- ),
-};
diff --git a/packages/chat/src/components/TypingIndicator/index.tsx b/packages/chat/src/components/TypingIndicator/index.tsx
deleted file mode 100644
index a3ff66cf9a..0000000000
--- a/packages/chat/src/components/TypingIndicator/index.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import clsx from 'clsx';
-
-import { ClassName } from '@/constants';
-
-import { dot, indicatorContainer } from './styles.css';
-
-/**
- * An animated indicator to show that the system is preparing a response.
- *
- * @see {@link https://voiceflow.github.io/react-chat/?path=/docs/components-typingindicator--default}
- */
-export const TypingIndicator: React.FC = () => (
-
-
-
-
-
-);
diff --git a/packages/chat/src/components/TypingIndicator/styles.css.ts b/packages/chat/src/components/TypingIndicator/styles.css.ts
deleted file mode 100644
index 46b3c3940e..0000000000
--- a/packages/chat/src/components/TypingIndicator/styles.css.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-import { keyframes, style } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { COLORS } from '@/styles/colors';
-import { SIZES } from '@/styles/sizes';
-import { transition } from '@/styles/transitions';
-
-const ANIMATION_DURATION = 1000;
-
-const pulseAnimation = keyframes({
- '25%': {
- backgroundColor: COLORS.NEUTRAL_LIGHT[900],
- scale: 1.2,
- },
- '50%': {
- scale: 1,
- backgroundColor: COLORS.NEUTRAL_LIGHT[600],
- },
- '75%': {
- backgroundColor: COLORS.NEUTRAL_LIGHT[300],
- },
- '100%': {
- backgroundColor: COLORS.NEUTRAL_LIGHT[600],
- },
-});
-
-export const indicatorContainer = style({
- display: 'inline-flex',
- gap: '5px',
-});
-
-export const dot = recipe({
- base: {
- width: 7,
- height: 7,
- borderRadius: SIZES.radius.round,
- transition: transition(['background-color', 'scale']),
- backgroundColor: COLORS.NEUTRAL_LIGHT[600],
- animation: `${pulseAnimation} ${ANIMATION_DURATION}ms`,
- animationIterationCount: 'infinite',
- },
-
- variants: {
- dot: {
- first: {
- animationDelay: '333ms',
- },
- second: {
- animationDelay: '666ms',
- },
- third: {
- animationDelay: '999ms',
- },
- },
- },
-});
diff --git a/packages/chat/src/components/UserResponse/UserResponse.story.tsx b/packages/chat/src/components/UserResponse/UserResponse.story.tsx
deleted file mode 100644
index 9aacdd2eee..0000000000
--- a/packages/chat/src/components/UserResponse/UserResponse.story.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import { UserResponse } from '.';
-
-type Story = StoryObj;
-const meta: Meta = {
- title: 'Components/Chat/UserResponse',
- component: UserResponse,
- args: {
- timestamp: Date.now(),
- },
- render: (args) => ,
-};
-
-export default meta;
-
-export const PlainText: Story = {
- args: {
- message: 'Lorem ipsum dolor',
- },
-};
-
-export const Wrapping: Story = {
- args: {
- message:
- 'consecteturaconse cteturaconsecteturaconsecteturaconsecteturaconsectetura consecteturaconsecteturaconsecteturaconsecteturaconsecteturaconsectetura',
- },
-};
-
-export const Debug: Story = {
- args: {
- message: 'Lorem ipsum dolor',
- debug: {
- message: 'Intent Name (97%)',
- },
- },
-};
-
-export const DebugReason: Story = {
- args: {
- message: 'Lorem ipsum dolor',
- debug: {
- message: 'Intent Name (97%)',
- reason: 'Voluptatum quae, accusamus excepturi inventore ex quos veritatis eaque ab non?',
- },
- },
-};
-
-export const ActionableDebugReason: Story = {
- args: {
- ...DebugReason.args,
- debug: {
- message: 'Intent Name (97%)',
- action: { label: 'Add Missing Utterance' },
- },
- },
-};
diff --git a/packages/chat/src/components/UserResponse/index.tsx b/packages/chat/src/components/UserResponse/index.tsx
deleted file mode 100644
index 206de764ed..0000000000
--- a/packages/chat/src/components/UserResponse/index.tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-import clsx from 'clsx';
-
-import { ClassName } from '@/constants';
-import { useAutoScroll } from '@/hooks/useAutoScroll';
-
-import { MessageContainer } from '../MessageContainer';
-import { Tooltip } from '../Tooltip';
-import { debugMessage, messageContainer, userResponse } from './styles.css';
-
-export interface DebugActionProps {
- label: string;
- onClick?: React.MouseEventHandler;
-}
-
-export interface DebugResponseProps {
- message: string;
- reason?: string;
- action?: DebugActionProps;
-}
-
-export interface UserResponseProps {
- /**
- * The message text to display.
- */
- message: string;
-
- /**
- * A unix timestamp indicating when this response was sent.
- */
- timestamp: number;
-
- /**
- * If provided, adds a caption and optional "debug" message with an action.
- */
- debug?: DebugResponseProps;
-
- /**
- * If true, this is the last message in the chat.
- */
- isLast?: boolean;
-}
-
-/**
- * A user-sent text response.
- *
- * @see {@link https://voiceflow.github.io/react-chat/?path=/story/components-chat-userresponse--simple}
- */
-
-export const UserResponse: React.FC = ({ message, debug, isLast }) => {
- useAutoScroll();
-
- return (
-
- {message}
- {debug && (
- <>
-
- {debug.reason && (
-
- {debug.reason}
-
- )}
- >
- )}
-
- );
-};
diff --git a/packages/chat/src/components/UserResponse/styles.css.ts b/packages/chat/src/components/UserResponse/styles.css.ts
deleted file mode 100644
index 637808424f..0000000000
--- a/packages/chat/src/components/UserResponse/styles.css.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-import { keyframes, style } from '@vanilla-extract/css';
-
-import { duration } from '@/styles/animations';
-import { COLORS } from '@/styles/colors';
-import { THEME } from '@/styles/colors.css';
-import { SIZES } from '@/styles/sizes';
-
-import { SMALL_AVATAR_SIZE } from '../Avatar/styles.css';
-
-const LEFT_MARGIN = SMALL_AVATAR_SIZE + 12;
-
-export const fadeInSlideUp = keyframes({
- from: {
- opacity: 0,
- transform: 'translateY(10px)',
- },
- to: {
- opacity: 1,
- transform: 'translateY(0)',
- },
-});
-
-export const messageContainer = style({
- backgroundColor: THEME.colors[500],
- color: THEME.colors[50],
- padding: '11px 16px 10px',
- fontFamily: THEME.fontFamily,
- position: 'relative',
- fontSize: '14px',
- lineHeight: '20px',
- justifySelf: 'flex-end',
- width: 'fit-content',
- maxWidth: `calc(100% - ${LEFT_MARGIN}px)`,
- wordWrap: 'break-word',
- borderRadius: SIZES.radius.sm,
- marginLeft: LEFT_MARGIN,
- animation: `${fadeInSlideUp} ${duration.fast} ease-out`,
-});
-
-export const userResponse = style({
- display: 'flex',
- justifyContent: 'flex-end',
-});
-
-export const debugMessage = style({
- fontSize: '12px',
- lineHeight: '17px',
- color: COLORS.NEUTRAL_DARK[200],
- marginTop: SIZES.m,
-});
diff --git a/packages/chat/src/components/VoiceWidget/MockVoiceWidgetImage.tsx b/packages/chat/src/components/VoiceWidget/MockVoiceWidgetImage.tsx
deleted file mode 100644
index c306db57f4..0000000000
--- a/packages/chat/src/components/VoiceWidget/MockVoiceWidgetImage.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-/* eslint-disable no-secrets/no-secrets */
-export const MockImage = () => {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-};
diff --git a/packages/chat/src/components/VoiceWidget/MovingGradient.component.tsx b/packages/chat/src/components/VoiceWidget/MovingGradient.component.tsx
deleted file mode 100644
index 27cc0bfa96..0000000000
--- a/packages/chat/src/components/VoiceWidget/MovingGradient.component.tsx
+++ /dev/null
@@ -1,133 +0,0 @@
-import React from 'react';
-
-const randomizeDuration = (base: number) => `${(Math.random() * 2 + base).toFixed(1)}s`;
-
-export const MovingGradient = ({ speedVector = 1 }) => {
- // Calculate animation durations based on the speed vector
- const duration1 = randomizeDuration(6 * speedVector);
- const duration2 = randomizeDuration(8 * speedVector);
- const duration3 = randomizeDuration(7 * speedVector);
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {/*
-
- */}
- {/* */}
-
-
-
-
- {/* Circle 1 */}
-
-
-
-
-
-
- {/* Circle 2 */}
-
-
-
-
-
-
-
- {/* Circle 3 */}
-
-
-
-
-
-
-
- );
-};
diff --git a/packages/chat/src/components/VoiceWidget/ShrinkingCircle.component.tsx b/packages/chat/src/components/VoiceWidget/ShrinkingCircle.component.tsx
deleted file mode 100644
index 79a3dae3ce..0000000000
--- a/packages/chat/src/components/VoiceWidget/ShrinkingCircle.component.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import { useEffect, useRef, useState } from 'react';
-
-import { shrinkingCircle } from './ShrinkingCircle.css';
-
-export const ShrinkingCircle = () => {
- const [radius, setRadius] = useState(54);
- const audioContextRef = useRef(null);
- const analyserRef = useRef(null);
-
- useEffect(() => {
- const initAudio = async () => {
- if (audioContextRef.current) return;
-
- audioContextRef.current = new AudioContext();
- const analyser = audioContextRef.current.createAnalyser();
- analyser.fftSize = 256;
- analyserRef.current = analyser;
-
- const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
- const source = audioContextRef.current.createMediaStreamSource(stream);
- source.connect(analyser);
-
- const bufferLength = analyser.frequencyBinCount;
- const dataArray = new Uint8Array(bufferLength);
-
- const animate = () => {
- if (!analyserRef.current) return;
-
- analyserRef.current.getByteFrequencyData(dataArray);
- const avgVolume = dataArray.reduce((sum, value) => sum + value, 0) / bufferLength;
-
- const newRadius = Math.min(avgVolume, 54);
- setRadius(newRadius);
-
- requestAnimationFrame(animate);
- };
-
- animate();
- };
-
- initAudio();
-
- return () => {
- audioContextRef.current?.close();
- };
- }, []);
-
- return (
-
- );
-};
diff --git a/packages/chat/src/components/VoiceWidget/ShrinkingCircle.css.ts b/packages/chat/src/components/VoiceWidget/ShrinkingCircle.css.ts
deleted file mode 100644
index 55bbe54cd0..0000000000
--- a/packages/chat/src/components/VoiceWidget/ShrinkingCircle.css.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { style } from '@vanilla-extract/css';
-
-export const shrinkingCircle = style({
- height: '54px',
- width: '54px',
- minWidth: '54px',
- minHeight: '54px',
- background: 'blue',
- borderRadius: '50%',
- transition: 'transform 0.2s',
-});
diff --git a/packages/chat/src/components/VoiceWidget/VoiceWidget.css.ts b/packages/chat/src/components/VoiceWidget/VoiceWidget.css.ts
deleted file mode 100644
index 075af3bec5..0000000000
--- a/packages/chat/src/components/VoiceWidget/VoiceWidget.css.ts
+++ /dev/null
@@ -1,236 +0,0 @@
-import { style, styleVariants } from '@vanilla-extract/css';
-import { recipe } from '@vanilla-extract/recipes';
-
-import { SHADOWS } from '@/styles/box-shadows';
-import { COLORS } from '@/styles/colors';
-import { THEME } from '@/styles/colors.css';
-import { transition } from '@/styles/transitions';
-
-export const voiceWrapper = style({
- display: 'flex',
- // justifyContent: 'center',
- alignItems: 'center',
- flexDirection: 'column',
- width: 'fit-content',
-});
-
-const loadingVariant = styleVariants({
- true: {},
-});
-
-export const voiceWidgetContainer = recipe({
- base: {
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- padding: '16px 20px',
- background: 'white',
- borderRadius: '16px',
- boxShadow: SHADOWS.Z32_Light,
- overflow: 'hidden',
- width: 'fit-content',
- position: 'relative',
- zIndex: 1,
- userSelect: 'none',
- },
- variants: {
- type: {
- full: {},
- expand: {
- boxShadow: SHADOWS.Z64_Light,
- flexDirection: 'column',
- padding: '32px 24px 24px 24px',
- },
- compact: {
- borderRadius: '100px',
- boxShadow: SHADOWS.Z16_Light,
- gap: '8px',
- padding: '8px',
- },
- },
-
- isLoading: loadingVariant,
- },
-});
-
-export const controlSection = recipe({
- base: {
- display: 'flex',
- flexDirection: 'column',
- alignItems: 'flex-start',
- gap: '8px',
- width: '100%',
- },
- variants: {
- type: {
- full: {
- gap: '6px',
- },
- expand: {
- alignItems: 'center',
- paddingTop: '12px',
- gap: '12px',
- },
- compact: {
- gap: '4px',
- },
- },
- },
-});
-
-export const titleStyle = style({
- fontFamily: THEME.fontFamily,
- fontSize: '14px',
- fontWeight: 400,
-
- lineHeight: '20px',
- color: COLORS.NEUTRAL_DARK[900],
- textAlign: 'center',
-});
-
-export const buttonModifier = recipe({
- base: {
- width: '158px',
- position: 'relative',
- borderRadius: '8px',
- padding: '16px 4px',
-
- selectors: {
- [`${loadingVariant.true} &`]: {
- cursor: 'default',
- backgroundColor: THEME.colors[300],
- },
- [`${loadingVariant.true} &:active`]: {
- backgroundColor: THEME.colors[300],
- },
- [`${loadingVariant.true} &:hover`]: {
- backgroundColor: THEME.colors[300],
- },
- },
- },
- variants: {
- type: {
- full: {},
- expand: {
- width: '182px',
- },
- compact: {
- borderRadius: '100px',
- width: '194px',
- },
- },
- },
-});
-
-export const circle = recipe({
- base: {
- borderRadius: '50%',
- height: '54px',
- width: '54px',
- minWidth: '54px',
- minHeight: '54px',
- background: 'rgba(0, 0, 0, 0.06)',
- },
- variants: {
- type: {
- full: {
- height: '58px',
- width: '58px',
- minWidth: '58px',
- minHeight: '58px',
- marginRight: '16px',
- },
- expand: {
- height: '80px',
- width: '80px',
- minWidth: '80px',
- minHeight: '80px',
- marginBottom: '8px',
- },
- compact: {
- height: '32px',
- width: '32px',
- minWidth: '32px',
- minHeight: '32px',
- },
- },
- },
-});
-
-export const imageStyles = style({
- borderRadius: '50%',
- height: '100%',
- width: '100%',
- objectFit: 'cover',
- transition: 'transform .5s',
-});
-
-export const buttonContent = recipe({
- base: {
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- borderRadius: '8px',
- top: '50%',
- left: '50%',
- fontFamily: THEME.fontFamily,
-
- transform: 'translate(-50%, -50%)',
-
- position: 'absolute',
- gap: '6px',
- lineHeight: '20px',
- transition: transition(['opacity']),
-
- selectors: {
- [`${loadingVariant.true} &`]: {
- opacity: 0,
- },
- },
- },
- variants: {
- isVisible: {
- true: {
- opacity: 1,
- },
- false: {
- opacity: 0,
- },
- },
- },
-});
-
-export const buttonText = style({
- paddingTop: '2px',
- fontFamily: THEME.fontFamily,
-});
-
-export const linkSectionModifier = style({
- paddingBottom: '0 !important',
-});
-
-export const loaderStyles = style({
- color: 'white',
- height: '20px',
- width: '20px',
-});
-
-export const containerLoaderStyles = style({
- position: 'absolute',
- top: '50%',
- left: '50%',
-
- width: '20px',
- height: '20px',
-
- transform: 'translate(-50%, -50%)',
- transition: transition(['opacity']),
-
- opacity: 0,
-
- selectors: {
- [`${loadingVariant.true} &`]: {
- opacity: 1,
- },
- },
-});
diff --git a/packages/chat/src/components/VoiceWidget/VoiceWidget.story.tsx b/packages/chat/src/components/VoiceWidget/VoiceWidget.story.tsx
deleted file mode 100644
index 403ce04fc4..0000000000
--- a/packages/chat/src/components/VoiceWidget/VoiceWidget.story.tsx
+++ /dev/null
@@ -1,99 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-import { useState } from 'react';
-
-import { WithDefaultPalette } from '@/storybook/decorators';
-
-import logo from '../../assets/vf_logo.png';
-import { VoiceWidget } from '.';
-
-type Story = StoryObj;
-const meta: Meta = {
- title: 'Components/VoiceWidget',
- component: VoiceWidget,
-
- decorators: [WithDefaultPalette],
-};
-
-export default meta;
-
-const CustomVoiceWidget = (args: React.ComponentProps) => {
- const [isLoading, setIsLoading] = useState(false);
-
- return setIsLoading((prev) => !prev)} />;
-};
-
-export const Base: Story = {
- args: {
- state: 'listening',
- settings: {
- content: {
- talkingText: '',
- endButtonText: '',
- listeningText: '',
- startButtonText: '',
- callToActionText: '',
- imageURL: logo,
- },
- renderMode: 'full',
- },
- footer: {
- text: 'Privacy',
- url: 'https://www.google.com',
- enabled: true,
- },
- },
-
- render: CustomVoiceWidget,
-};
-
-export const Listening: Story = {
- args: {
- ...Base.args,
- state: 'LISTENING',
- },
- render: CustomVoiceWidget,
-};
-
-export const Talking: Story = {
- args: {
- ...Base.args,
- state: 'TALKING',
- },
- render: CustomVoiceWidget,
-};
-
-export const Compact: Story = {
- args: {
- ...Base.args,
- settings: {
- content: {
- talkingText: '',
- endButtonText: '',
- listeningText: '',
- startButtonText: '',
- callToActionText: '',
- },
- renderMode: 'compact',
- },
- state: 'IDLE',
- },
- render: CustomVoiceWidget,
-};
-
-export const Expand: Story = {
- args: {
- ...Base.args,
- settings: {
- content: {
- talkingText: '',
- endButtonText: '',
- listeningText: '',
- startButtonText: '',
- callToActionText: '',
- },
- renderMode: 'expand',
- },
- state: 'IDLE',
- },
- render: CustomVoiceWidget,
-};
diff --git a/packages/chat/src/components/VoiceWidget/WaveformVisualizer.component.tsx b/packages/chat/src/components/VoiceWidget/WaveformVisualizer.component.tsx
deleted file mode 100644
index daad0db558..0000000000
--- a/packages/chat/src/components/VoiceWidget/WaveformVisualizer.component.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-import { useEffect, useRef } from 'react';
-
-export const WaveFormVisualizer = () => {
- const canvasRef = useRef(null);
- const audioContextRef = useRef(null);
- const analyserRef = useRef(null);
- const dataArrayRef = useRef(null);
-
- useEffect(() => {
- const startAudio = async () => {
- audioContextRef.current = new AudioContext();
- const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
- const source = audioContextRef.current.createMediaStreamSource(stream);
- analyserRef.current = audioContextRef.current.createAnalyser();
- analyserRef.current.fftSize = 1024;
-
- const bufferLength = analyserRef.current.frequencyBinCount;
- dataArrayRef.current = new Uint8Array(bufferLength);
-
- source.connect(analyserRef.current);
-
- let previousTimestamp = 0;
- const smoothingFactor = 0.1;
-
- const draw = (timestamp: number) => {
- if (!canvasRef.current || !analyserRef.current || !dataArrayRef.current) return;
-
- const canvas = canvasRef.current;
- const canvasCtx = canvas.getContext('2d');
- const { width, height } = canvas;
- const centerX = width / 2;
- const centerY = height / 2;
- const radius = Math.min(width, height) / 2;
-
- analyserRef.current.getByteTimeDomainData(dataArrayRef.current);
-
- // Time-based smoothing
- const deltaTime = timestamp - previousTimestamp;
- previousTimestamp = timestamp;
- const smoothing = Math.min(1, deltaTime * smoothingFactor);
-
- if (canvasCtx) {
- canvasCtx.clearRect(0, 0, width, height);
-
- // Draw the circle
- canvasCtx.beginPath();
- canvasCtx.arc(centerX, centerY, radius, 0, 2 * Math.PI);
- canvasCtx.fillStyle = 'white';
- canvasCtx.fill();
- canvasCtx.lineWidth = 6;
- canvasCtx.strokeStyle = '#0099cc';
- canvasCtx.stroke();
-
- // Draw the smoothed waveform
- canvasCtx.beginPath();
- dataArrayRef.current.forEach((value, i) => {
- const angle = (i / (dataArrayRef?.current?.length || 1)) * 2 * Math.PI;
- const amplitude = (value / 128.0 - 1) * 40;
-
- // Apply smoothing to amplitude
- const smoothedAmplitude = amplitude * smoothing;
-
- const x = centerX + (radius + smoothedAmplitude) * Math.cos(angle);
- const y = centerY + (radius + smoothedAmplitude) * Math.sin(angle);
-
- if (i === 0) {
- canvasCtx.moveTo(x, y);
- } else {
- canvasCtx.lineTo(x, y);
- }
- });
-
- // Close the path and stroke the waveform
- canvasCtx.closePath();
- canvasCtx.stroke();
- }
-
- requestAnimationFrame(draw);
- };
-
- requestAnimationFrame(draw);
- };
-
- startAudio();
-
- return () => {
- audioContextRef.current?.close();
- };
- }, []);
-
- return ;
-};
diff --git a/packages/chat/src/components/VoiceWidget/index.tsx b/packages/chat/src/components/VoiceWidget/index.tsx
deleted file mode 100644
index 2f6c336c9a..0000000000
--- a/packages/chat/src/components/VoiceWidget/index.tsx
+++ /dev/null
@@ -1,149 +0,0 @@
-import type { WidgetSettingsCommonSettingsFooterLink, WidgetSettingsVoiceSettings } from '@voiceflow/dtos-interact';
-import { WidgetSettingsVoiceRenderMode } from '@voiceflow/dtos-interact';
-
-import type { VoiceState } from '@/constant/voice.constant';
-import { VOICE_STATE } from '@/constant/voice.constant';
-import { DEFAULT_CHAT_AVATAR } from '@/dtos/AssistantOptions.dto';
-
-import { Button } from '../Button';
-import { ButtonIcon } from '../Button/ButtonIcon';
-import { ButtonVariant } from '../Button/constants';
-import { LoadingSpinner } from '../LoadingSpinner/LoadingSpinner';
-import { BottomLinks } from '../NewFooter/BottomLinks';
-import useMicrophoneAmplitude from './use-microphone-amplitude';
-import {
- buttonContent,
- buttonModifier,
- buttonText,
- circle,
- containerLoaderStyles,
- controlSection,
- imageStyles,
- linkSectionModifier,
- loaderStyles,
- titleStyle,
- voiceWidgetContainer,
- voiceWrapper,
-} from './VoiceWidget.css';
-
-interface IVoiceWidget {
- state: VoiceState;
- footer?: WidgetSettingsCommonSettingsFooterLink;
- settings?: WidgetSettingsVoiceSettings;
- poweredBy?: boolean;
- isLoading: boolean;
- onStartCall?: () => void;
- onEndCall?: () => void;
-}
-
-export const VoiceWidget: React.FC = ({
- state,
- settings,
- footer,
- onEndCall,
- poweredBy,
- isLoading,
- onStartCall,
-}) => {
- const { content, renderMode = WidgetSettingsVoiceRenderMode.FULL } = settings ?? {};
-
- const startCall = () => {
- onStartCall?.();
- };
-
- const endCall = () => {
- onEndCall?.();
- };
-
- const isIdle = state === VOICE_STATE.IDLE;
- const isEnded = state === VOICE_STATE.ENDED;
- const isTalking = state === VOICE_STATE.TALKING;
- const isListening = state === VOICE_STATE.LISTENING;
- const isInitializing = state === VOICE_STATE.INITIALIZING;
- const isCalling = isTalking || isListening || isInitializing;
-
- const handleButtonClick = () => {
- if (isLoading) return;
-
- if (isCalling) {
- endCall();
- } else {
- startCall();
- }
- };
-
- const getTitle = () => {
- if (isIdle || isEnded) {
- return content?.callToActionText ?? 'How can I help you?';
- }
-
- if (isInitializing) {
- return 'Connecting...';
- }
-
- if (isListening) {
- return content?.listeningText ?? 'Listening...';
- }
-
- return content?.talkingText ?? 'Talk to interrupt';
- };
-
- const amplitude = useMicrophoneAmplitude();
-
- const isCompact = renderMode === WidgetSettingsVoiceRenderMode.COMPACT;
- const isExpanded = renderMode === WidgetSettingsVoiceRenderMode.EXPAND;
-
- const bottomLinks = (
-
- );
-
- return (
-
-
-
-
-
-
-
- {!isCompact &&
{getTitle()}
}
-
-
-
-
-
-
-
-
- {content?.endButtonText ?? 'End'}
-
-
-
-
-
- {content?.startButtonText ?? 'Start a call'}
-
-
-
-
- {isExpanded && bottomLinks}
-
-
- {!isExpanded && bottomLinks}
-
- );
-};
diff --git a/packages/chat/src/components/VoiceWidget/use-microphone-amplitude.tsx b/packages/chat/src/components/VoiceWidget/use-microphone-amplitude.tsx
deleted file mode 100644
index ab1d302d19..0000000000
--- a/packages/chat/src/components/VoiceWidget/use-microphone-amplitude.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-import { useEffect, useState } from 'react';
-
-const useMicrophoneAmplitude = (): number => {
- const [amplitude, setAmplitude] = useState(0);
- const [_, setAudioContext] = useState(null);
-
- useEffect(() => {
- let audioContext: AudioContext;
- let analyser: AnalyserNode;
- let dataArray: Uint8Array;
- let microphone: MediaStreamAudioSourceNode | null = null;
-
- const initMicrophone = async () => {
- try {
- // Request access to the user's microphone
- const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
-
- // Set up the Audio Context and Analyser
- audioContext = new window.AudioContext();
- setAudioContext(audioContext);
-
- analyser = audioContext.createAnalyser();
- analyser.fftSize = 256;
- dataArray = new Uint8Array(analyser.frequencyBinCount);
-
- microphone = audioContext.createMediaStreamSource(stream);
- microphone.connect(analyser);
-
- const updateAmplitude = () => {
- analyser.getByteTimeDomainData(dataArray);
- const amplitudeValue = dataArray.reduce((acc, val) => acc + Math.abs(val - 128), 0) / dataArray.length;
-
- // Calculate scale based on instantaneous amplitude
- const baseScale = 1; // when silent
- const scaleFactor = 0.1; // Controls how much it shrinks with loudness
-
- const amplitude = amplitudeValue > 2 ? Math.max(0.66, baseScale - amplitudeValue * scaleFactor) : baseScale;
-
- setAmplitude(amplitude);
- requestAnimationFrame(updateAmplitude);
- };
-
- updateAmplitude();
- } catch (error) {
- console.error('Error accessing the microphone:', error);
- }
- };
-
- initMicrophone();
-
- return () => {
- if (microphone) microphone.disconnect();
- if (audioContext) audioContext.close();
- };
- }, []);
-
- return amplitude;
-};
-
-export default useMicrophoneAmplitude;
diff --git a/packages/chat/src/components/WelcomeMessage/WelcomeMessage.css.ts b/packages/chat/src/components/WelcomeMessage/WelcomeMessage.css.ts
deleted file mode 100644
index 3d997aaa0a..0000000000
--- a/packages/chat/src/components/WelcomeMessage/WelcomeMessage.css.ts
+++ /dev/null
@@ -1,93 +0,0 @@
-import { keyframes, style } from '@vanilla-extract/css';
-
-import { componentAnimations, timingFunction } from '@/styles/animations';
-import { COLORS } from '@/styles/colors';
-import { THEME } from '@/styles/colors.css';
-import { widgetContainer } from '@/views/ChatWidget/styles.css';
-
-export const fadeIn = keyframes({
- '0%': {
- opacity: 0,
- transform: 'translateY(-10px)',
- },
- '100%': {
- opacity: 1,
- transform: 'translateY(0)',
- },
-});
-
-export const fadeOut = keyframes({
- '0%': {
- opacity: 1,
- transform: 'translateY(0)',
- },
- '100%': {
- opacity: 0,
- transform: 'translateY(-10px)',
- },
-});
-
-export const welcomeMessageContainer = style({
- display: 'flex',
- flexDirection: 'column',
- alignItems: 'center',
- fontFamily: THEME.fontFamily,
- padding: '48px 20px 28px 20px',
- textAlign: 'center',
-});
-
-export const avatarContainer = style({
- marginBottom: '16px',
- opacity: 0,
- selectors: {
- [`.${widgetContainer.classNames.variants.withChat.true} &`]: {
- animation: `${fadeIn} ${componentAnimations.welcomeMessage.duration} ${timingFunction.gentle} forwards`,
- animationDelay: componentAnimations.welcomeMessage.delays.avatar,
- },
- [`.${widgetContainer.classNames.variants.withChat.false} &`]: {
- animation: `${fadeOut} 0.4s ${timingFunction.gentle} forwards`,
- },
- },
-});
-
-export const welcomeMessageTitle = style({
- marginBottom: '3px',
- fontSize: '22px',
- fontWeight: 700,
- color: COLORS.NEUTRAL_DARK[900],
- display: '-webkit-box',
- WebkitLineClamp: 2,
- WebkitBoxOrient: 'vertical',
- overflow: 'hidden',
- opacity: 0,
- selectors: {
- [`.${widgetContainer.classNames.variants.withChat.true} &`]: {
- animation: `${fadeIn} ${componentAnimations.welcomeMessage.duration} ${timingFunction.gentle} forwards`,
- animationDelay: componentAnimations.welcomeMessage.delays.title,
- },
- [`.${widgetContainer.classNames.variants.withChat.false} &`]: {
- animation: `${fadeOut} ${componentAnimations.welcomeMessage.duration} ${timingFunction.gentle} forwards`,
- },
- },
-});
-
-export const welcomeMessageDescription = style({
- margin: 0,
- fontSize: '14px',
- fontWeight: 400,
- color: COLORS.NEUTRAL_DARK[100],
- display: '-webkit-box',
- WebkitLineClamp: 3,
- WebkitBoxOrient: 'vertical',
- overflow: 'hidden',
- opacity: 0,
- selectors: {
- [`.${widgetContainer.classNames.variants.withChat.true} &`]: {
- animation: `${fadeIn} ${componentAnimations.welcomeMessage.duration} ${timingFunction.gentle} forwards`,
- animationDelay: componentAnimations.welcomeMessage.delays.description,
- },
- [`.${widgetContainer.classNames.variants.withChat.false} &`]: {
- animation: `${fadeOut} 0.4s ${timingFunction.gentle} forwards`,
- },
- },
-});
diff --git a/packages/chat/src/components/WelcomeMessage/WelcomeMessage.story.tsx b/packages/chat/src/components/WelcomeMessage/WelcomeMessage.story.tsx
deleted file mode 100644
index 32339f8134..0000000000
--- a/packages/chat/src/components/WelcomeMessage/WelcomeMessage.story.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import EMPTY_IMAGE from '@/__fixtures__/empty-image.png';
-import { widgetContainer } from '@/views/ChatWidget/styles.css';
-
-import { WelcomeMessage } from '.';
-
-type Story = StoryObj;
-
-const meta: Meta = {
- title: 'Core/WelcomeMessage',
- component: WelcomeMessage,
- args: {
- avatar: EMPTY_IMAGE,
- },
- parameters: {
- layout: 'centered',
- },
- decorators: [
- (Story) => (
-
-
-
- ),
- ],
-};
-export default meta;
-
-export const Base: Story = {
- args: {
- avatar: EMPTY_IMAGE,
- title: 'Agent name',
- description: 'Agent description.',
- },
-};
-
-export const LongContent: Story = {
- args: {
- avatar: EMPTY_IMAGE,
- title:
- 'Hello, I am your #1 favourite AI assistant, meant to help you out in all sorts of ways. Hello, I am your #1 favourite AI assistant, meant to help you out in all sorts of ways. Hello, I am your #1 favourite AI assistant, meant to help you out in all sorts of ways. Hello, I am your #1 favourite AI assistant, meant to help you out in all sorts of ways. Hello, I am your #1 favourite AI assistant, meant to help you out in all sorts of ways.',
- description:
- 'I can do tons of stuff, like help you with your account, answer questions, and even tell you a joke or two. Just ask me anything! I can do tons of stuff, like help you with your account, answer questions, and even tell you a joke or two. Just ask me anything! I can do tons of stuff, like help you with your account, answer questions, and even tell you a joke or two. Just ask me anything!I can do tons of stuff, like help you with your account, answer questions, and even tell you a joke or two. Just ask me anything! I can do tons of stuff, like help you with your account, answer questions, and even tell you a joke or two. Just ask me anything! I can do tons of stuff, like help you with your account, answer questions, and even tell you a joke or two. Just ask me anything!',
- },
- render: (args) => (
-
- ),
-};
diff --git a/packages/chat/src/components/WelcomeMessage/index.tsx b/packages/chat/src/components/WelcomeMessage/index.tsx
deleted file mode 100644
index e001fff95d..0000000000
--- a/packages/chat/src/components/WelcomeMessage/index.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-import clsx from 'clsx';
-
-import { ClassName } from '@/constants';
-import { DEFAULT_CHAT_AVATAR } from '@/dtos/AssistantOptions.dto';
-
-import { Avatar } from '../Avatar';
-import {
- avatarContainer,
- welcomeMessageContainer,
- welcomeMessageDescription,
- welcomeMessageTitle,
-} from './WelcomeMessage.css';
-
-export interface IWelcomeMessage {
- /**
- * Should we show the welcome message
- */
- enabled: boolean;
-
- /**
- * The title of the assistant.
- */
- title: string;
-
- /**
- * A short description of the assistant to help frame the conversation.
- */
- description: string;
-
- /**
- * An image URL that identifies the assistant, such as a brand icon.
- */
- avatar?: string;
-}
-
-export const WelcomeMessage: React.FC = ({ enabled, title, description, avatar }) => {
- if (!enabled) return null;
-
- return (
-
-
-
- {title}
-
-
- {description}
-
-
- );
-};
diff --git a/packages/chat/src/components/index.ts b/packages/chat/src/components/index.ts
deleted file mode 100644
index 2f3e66ab2a..0000000000
--- a/packages/chat/src/components/index.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-export { AgentMessage } from './AgentMessage';
-export { Avatar } from './Avatar';
-export { Button } from './Button';
-export { Card } from './Card';
-export { Carousel } from './Carousel';
-export { ColorTheme } from './ColorTheme/ColorTheme.component';
-export { DebugMessage } from './DebugMessage';
-export { FeedbackButton } from './FeedbackButton';
-export { Header } from './Header';
-export { Icon } from './Icon';
-export { Image } from './Image';
-export { Launcher } from './Launcher';
-export { LinkPreview } from './LinkPreview';
-export { MessageInput } from './MessageInput';
-export { NewChat } from './NewChat';
-export { NewFooter } from './NewFooter';
-export { Proactive } from './Proactive';
-export { Prompt } from './Prompt';
-export { SendButton } from './SendButton';
-export { SystemResponse } from './SystemResponse';
-export { Tooltip } from './Tooltip';
-export { TypingIndicator } from './TypingIndicator';
-export { UserResponse } from './UserResponse';
-export { VoiceWidget } from './VoiceWidget';
-export { WelcomeMessage } from './WelcomeMessage';
diff --git a/packages/chat/src/constant/voice.constant.ts b/packages/chat/src/constant/voice.constant.ts
deleted file mode 100644
index d0629eec35..0000000000
--- a/packages/chat/src/constant/voice.constant.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-export const VOICE_STATE = {
- IDLE: 'IDLE',
- INITIALIZING: 'INITIALIZING',
- LISTENING: 'LISTENING',
- TALKING: 'TALKING',
- ENDED: 'ENDED',
-};
-
-export type VoiceState = (typeof VOICE_STATE)[keyof typeof VOICE_STATE];
diff --git a/packages/chat/src/constants.ts b/packages/chat/src/constants.ts
deleted file mode 100644
index 9d74937aed..0000000000
--- a/packages/chat/src/constants.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import Bowser from 'bowser';
-
-export enum ClassName {
- ASSISTANT_INFO = 'vfrc-assistant-info',
- AVATAR = 'vfrc-avatar',
- BUBBLE = 'vfrc-bubble', // Not in use anymore
- BUTTON = 'vfrc-button',
- CARD = 'vfrc-card',
- CAROUSEL = 'vfrc-carousel',
- CHAT = 'vfrc-chat',
- CHAT_INPUT = 'vfrc-chat-input',
- FEEDBACK = 'vfrc-feedback',
- FOOTER = 'vfrc-footer',
- HEADER = 'vfrc-header',
- ICON = 'vfrc-icon',
- IMAGE = 'vfrc-image',
- INPUT = 'vfrc-input',
- LAUNCHER = 'vfrc-launcher',
- LOADER = 'vfrc-loader',
- MESSAGE = 'vfrc-message',
- PROMPT = 'vfrc-prompt',
- SYSTEM_RESPONSE = 'vfrc-system-response',
- TIMESTAMP = 'vfrc-timestamp',
- TOOLTIP = 'vfrc-tooltip',
- TYPING_INDICATOR = 'vfrc-typing-indicator',
- USER_RESPONSE = 'vfrc-user-response',
- WIDGET = 'vfrc-widget',
-
- PROACTIVE_CLOSE = 'vfrc-proactive-close',
- PROACTIVE_MESSAGE = 'vfrc-proactive-message',
- PROACTIVE = 'vfrc-proactive',
-}
-
-export const DEVICE_INFO = Bowser.parse(window.navigator.userAgent);
diff --git a/packages/chat/src/contexts/AutoScrollContext.tsx b/packages/chat/src/contexts/AutoScrollContext.tsx
deleted file mode 100644
index 8d82251945..0000000000
--- a/packages/chat/src/contexts/AutoScrollContext.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import React, { createContext, useCallback, useMemo, useState } from 'react';
-
-export interface AutoScrollContext {
- scrollToBottom: () => void;
-}
-
-export const AutoScrollContext = createContext({
- scrollToBottom: () => undefined,
-});
-
-export const IsAutoScrollingContext = createContext(false);
-
-export const { Consumer: AutoScrollConsumer } = AutoScrollContext;
-
-export interface AutoScrollProviderProps extends React.PropsWithChildren {
- target: React.RefObject;
-}
-
-export const AutoScrollProvider = ({ target, children }: AutoScrollProviderProps) => {
- const [autoScrolling, setAutoScrolling] = useState(false);
-
- const scrollToBottom = useCallback(() => {
- setAutoScrolling(true);
- setTimeout(() => {
- setAutoScrolling(false);
- }, 700);
-
- requestAnimationFrame(() => {
- const el = target.current;
- if (!el) return;
-
- const { scrollTop, scrollHeight, clientHeight } = el;
- const hiddenHeight = scrollHeight - clientHeight;
- if (hiddenHeight === scrollTop) return;
-
- el.scrollTo({ top: hiddenHeight, behavior: 'smooth' });
- });
- }, []);
-
- const context = useMemo(() => ({ scrollToBottom }), [scrollToBottom]);
-
- return (
-
- {children}
-
- );
-};
diff --git a/packages/chat/src/contexts/RuntimeContext/audio-controller.ts b/packages/chat/src/contexts/RuntimeContext/audio-controller.ts
deleted file mode 100644
index 02df7e3d58..0000000000
--- a/packages/chat/src/contexts/RuntimeContext/audio-controller.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-export class AudioController {
- public audio = new Audio();
-
- private reject: (() => void) | null = null;
-
- public pause(): void {
- this.audio.pause();
- }
-
- public continue(): void {
- this.audio.play();
- }
-
- public async play(src: undefined | null | string): Promise {
- this.stop();
-
- if (!src) return Promise.resolve();
-
- return new Promise((resolve, reject) => {
- this.reject = reject;
-
- this.audio.onended = () => resolve();
- this.audio.onerror = () => reject();
-
- this.audio.src = src;
- this.audio.currentTime = 0;
-
- this.audio.play();
- });
- }
-
- public stop(): void {
- this.reject?.();
- this.audio.pause();
-
- this.audio.onended = null;
- this.audio.onerror = null;
- this.audio.currentTime = 0;
- }
-}
diff --git a/packages/chat/src/contexts/RuntimeContext/index.tsx b/packages/chat/src/contexts/RuntimeContext/index.tsx
deleted file mode 100644
index f25e79cedf..0000000000
--- a/packages/chat/src/contexts/RuntimeContext/index.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import React, { createContext, useMemo } from 'react';
-
-import type { RuntimeState, Settings } from './useRuntimeState';
-import { useRuntimeState } from './useRuntimeState';
-
-// split up API and state to prevent unnecessary re-renders
-export const RuntimeStateAPIContext = createContext({} as any);
-export const RuntimeStateContext = createContext({} as any);
-
-interface RuntimeProviderProps extends React.PropsWithChildren, Settings {
- extend?: (runtime: RuntimeState['api']) => RuntimeState['api'];
-}
-
-export const RuntimeProvider = ({ children, extend, ...settings }: RuntimeProviderProps) => {
- const store = useRuntimeState(settings);
-
- // api is a static object, so we can use useMemo to prevent unnecessary re-renders
- const api = useMemo(() => extend?.(store.api) ?? store.api, [settings]);
-
- return (
-
- {children}
-
- );
-};
diff --git a/packages/chat/src/contexts/RuntimeContext/messages.ts b/packages/chat/src/contexts/RuntimeContext/messages.ts
deleted file mode 100644
index 9555123d65..0000000000
--- a/packages/chat/src/contexts/RuntimeContext/messages.ts
+++ /dev/null
@@ -1,106 +0,0 @@
-import { CardTraceDTO, CarouselTraceDTO, ChoiceTraceDTO, TextTraceDTO, VisualTraceDTO } from '@voiceflow/dtos-interact';
-import type { RuntimeAction, TraceDeclaration } from '@voiceflow/sdk-runtime';
-import {
- CardV2TraceComponent,
- ChoiceTraceComponent,
- TextTraceComponent,
- Trace,
- VisualTraceComponent,
-} from '@voiceflow/sdk-runtime';
-
-import type { CardProps } from '@/components/Card/types';
-import type { SystemResponseProps } from '@/components/SystemResponse';
-import { MessageType } from '@/components/SystemResponse/constants';
-
-export interface RuntimeMessage extends Pick {}
-
-const isValidCard = (card: CardProps) => {
- return !!card.title || !!card.description || !!card.image || !!card.actions?.filter(({ name }) => !!name).length;
-};
-
-export const MESSAGE_TRACES: TraceDeclaration[] = [
- TextTraceComponent(({ context }, trace) => {
- if (!TextTraceDTO.safeParse(trace).success) return context;
-
- const { slate, message, ai, delay } = trace.payload;
-
- context.messages.push({
- type: MessageType.TEXT,
- text: slate?.content || message,
- delay,
- ...(ai ? { ai } : {}),
- });
-
- return context;
- }),
- VisualTraceComponent(({ context }, trace) => {
- if (!VisualTraceDTO.safeParse(trace).success) return context;
-
- context.messages.push({ type: MessageType.IMAGE, url: trace.payload.image });
- return context;
- }),
- ChoiceTraceComponent(({ context }, trace) => {
- if (!ChoiceTraceDTO.safeParse(trace).success) return context;
-
- const {
- payload: { buttons },
- } = trace;
- context.actions = (buttons as { name: string; request: RuntimeAction }[]).map(({ name, request }) => ({
- name,
- request,
- }));
- return context;
- }),
- CardV2TraceComponent(({ context }, trace) => {
- if (!CardTraceDTO.safeParse(trace).success) return context;
-
- const {
- payload: { title, imageUrl, description, buttons },
- } = trace;
- const card: CardProps = {
- title,
- description: description.text,
- image: imageUrl,
- actions: buttons.map(({ name, request }) => ({ name, request })),
- };
-
- if (isValidCard(card)) {
- context.messages.push({
- type: 'card',
- ...card,
- });
- }
- return context;
- }),
- {
- canHandle: ({ type }) => type === Trace.TraceType.CAROUSEL,
- handle: ({ context }, trace: Trace.Carousel) => {
- if (!CarouselTraceDTO.safeParse(trace).success) return context;
-
- const cards: CardProps[] = trace.payload.cards
- .map(({ title, description, imageUrl, buttons }) => ({
- title,
- description: description.text,
- image: imageUrl,
- actions: buttons.map(({ name, request }) => ({ name, request })),
- }))
- .filter(isValidCard);
-
- if (cards.length) {
- context.messages.push({
- type: MessageType.CAROUSEL,
- cards,
- });
- }
-
- return context;
- },
- },
- {
- canHandle: ({ type }) => type === Trace.TraceType.END,
- handle: ({ context }) => {
- context.messages.push({ type: MessageType.END });
- return context;
- },
- },
-];
diff --git a/packages/chat/src/contexts/RuntimeContext/runtime.utils.test.ts b/packages/chat/src/contexts/RuntimeContext/runtime.utils.test.ts
deleted file mode 100644
index ebf20f126b..0000000000
--- a/packages/chat/src/contexts/RuntimeContext/runtime.utils.test.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import { describe, expect, it } from 'vitest';
-
-import { TurnType } from '@/types';
-
-import { getLastSystemTurn, resolveAction } from './runtime.utils';
-
-describe('getLastSystemTurn', () => {
- it('should return the last SYSTEM turn', () => {
- const mockTurns1 = [{ type: TurnType.USER }, { type: TurnType.SYSTEM }] as any[];
- expect(getLastSystemTurn(mockTurns1)).toBe(mockTurns1[1]);
-
- const mockTurns2 = [{ type: TurnType.SYSTEM }, { type: TurnType.USER }] as any[];
- expect(getLastSystemTurn(mockTurns2)).toBe(mockTurns2[0]);
- });
-
- it('should return null if no SYSTEM turn is present', () => {
- expect(getLastSystemTurn([])).toBeNull();
- expect(getLastSystemTurn([{ type: TurnType.USER }] as any)).toBeNull();
- });
-});
-
-describe('resolveAction', () => {
- it('should return the matched action if user text request matches system action name', () => {
- const mockTurns = [
- // wrong system turn:
- { type: TurnType.SYSTEM, actions: [{ name: 'action1', request: 'request0' }] },
- // right system turn:
- { type: TurnType.SYSTEM, actions: [{ name: 'action1', request: 'request1' }] },
- { type: TurnType.USER, actions: [] },
- ] as any[];
-
- const result = resolveAction({ type: 'text', payload: 'action1' }, mockTurns);
- expect(result).toEqual('request1');
- });
-
- it('should return the original action if no matching system action is found', () => {
- const mockTurns = [
- { type: TurnType.USER, actions: [] },
- { type: TurnType.SYSTEM, actions: [{ name: 'action1', request: 'request1' }] },
- ] as any[];
-
- const action = { type: 'text', payload: 'non-existent' };
- const result = resolveAction(action, mockTurns);
- expect(result).toEqual(action);
- });
-
- it('should return the original action if action is not a text request', () => {
- const mockTurns = [{ type: TurnType.SYSTEM, actions: [{ name: 'action1', request: 'request1' }] }] as any[];
-
- const action = { type: 'not-text', payload: 'action1' };
- const result = resolveAction(action, mockTurns);
- expect(result).toEqual(action);
- });
-});
diff --git a/packages/chat/src/contexts/RuntimeContext/runtime.utils.ts b/packages/chat/src/contexts/RuntimeContext/runtime.utils.ts
deleted file mode 100644
index b4601da6a1..0000000000
--- a/packages/chat/src/contexts/RuntimeContext/runtime.utils.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { type BaseRequest, isTextRequest } from '@voiceflow/dtos-interact';
-
-import type { SystemTurnProps, TurnProps } from '@/types';
-import { TurnType } from '@/types';
-
-export const getLastSystemTurn = (turns: TurnProps[]): SystemTurnProps | null => {
- for (let i = turns.length - 1; i >= 0; i--) {
- const turn = turns[i];
- if (turn.type === TurnType.SYSTEM) return turn;
- }
-
- return null;
-};
-
-const stringFuzzyEquals = (a: string, b: string) => a.trim().toLowerCase() === b.trim().toLowerCase();
-
-// resolve the action that the user should take, based on pass turns as input
-export const resolveAction = (action: BaseRequest, turns: TurnProps[]): BaseRequest => {
- if (isTextRequest(action)) {
- /// if the system has suggested actions, match action name against the user text request
- const systemTurn = getLastSystemTurn(turns);
- const matchedAction = systemTurn?.actions?.find((a) => stringFuzzyEquals(a.name, action.payload))?.request;
- if (matchedAction) return matchedAction;
- }
-
- return action;
-};
diff --git a/packages/chat/src/contexts/RuntimeContext/silent-audio.ts b/packages/chat/src/contexts/RuntimeContext/silent-audio.ts
deleted file mode 100644
index 665922eb05..0000000000
--- a/packages/chat/src/contexts/RuntimeContext/silent-audio.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export const silentAudio =
- 'data:audio/mpeg;base64,SUQzBAAAAAACPFRYWFgAAAAXAAADVFNTAEdhcmFnZUJhbmQgMTAuMy4zAFRYWFgAAABlAAADaVR1bk5PUk0AIDAwMDAwMDAwIDAwMDAwMDAwIDAwMDAwMDAwIDAwMDAwMDAwIDAwMDAwMDAwIDAwMDAwMDAwIDAwMDAwMDAwIDAwMDAwMDAwIDAwMDAwMDAwIDAwMDAwMDAwAFRYWFgAAAB/AAADaVR1blNNUEIAIDAwMDAwMDAwIDAwMDAwMjEwIDAwMDAwODU4IDAwMDAwMDAwMDAwNDA5OTggMDAwMDAwMDAgMDAwMEI2REMgMDAwMDAwMDAgMDAwMDAwMDAgMDAwMDAwMDAgMDAwMDAwMDAgMDAwMDAwMDAgMDAwMDAwMDAAVFNTRQAAAA8AAANMYXZmNTguMjkuMTAwAAAAAAAAAAAAAAD/+5AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABJbmZvAAAADwAAACgAAELvAAwMEhIYGBgfHyUlJSsrMTExODg+Pj5EREpKSlFRV1dXXV1jY2NqanBwcHZ2fHx8g4OJiYmPj5WVlZycoqKiqKiurq61tbu7u8HBx8fHzs7U1NTa2uDg4Ofn7e3t8/P5+fn//wAAAABMYXZjNTguNTQAAAAAAAAAAAAAAAAkBXwAAAAAAABC78H9CuUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/+5BkAA/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5JkQI/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uSZECP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7kmRAj/AAAGkAAAAIAAANIAAAAQAAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5JkQI/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uSZECP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7kmRAj/AAAGkAAAAIAAANIAAAAQAAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5JkQI/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uSZECP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7kmRAj/AAAGkAAAAIAAANIAAAAQAAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5JkQI/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uSZECP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7kmRAj/AAAGkAAAAIAAANIAAAAQAAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5JkQI/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uSZECP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7kmRAj/AAAGkAAAAIAAANIAAAAQAAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5JkQI/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uSZECP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7kmRAj/AAAGkAAAAIAAANIAAAAQAAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5JkQI/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uSZECP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7kmRAj/AAAGkAAAAIAAANIAAAAQAAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5JkQI/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uSZECP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7kmRAj/AAAGkAAAAIAAANIAAAAQAAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5BkQQ/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5JkQI/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uSZECP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7kmRAj/AAAGkAAAAIAAANIAAAAQAAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5JkQI/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uSZECP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7kmRAj/AAAGkAAAAIAAANIAAAAQAAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5JkQI/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uSZECP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7kmRAj/AAAGkAAAAIAAANIAAAAQAAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5JkQI/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uSZECP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7kmRAj/AAAGkAAAAIAAANIAAAAQAAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5JkQI/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uSZECP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ==';
diff --git a/packages/chat/src/contexts/RuntimeContext/traces/EffectExtensions.trace.ts b/packages/chat/src/contexts/RuntimeContext/traces/EffectExtensions.trace.ts
deleted file mode 100644
index 0ba61c02a8..0000000000
--- a/packages/chat/src/contexts/RuntimeContext/traces/EffectExtensions.trace.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import type { Trace } from '@voiceflow/base-types';
-import type { TraceDeclaration } from '@voiceflow/sdk-runtime';
-
-import type { AnyExtension, EffectExtension } from '@/dtos/Extension.dto';
-import { ExtensionType } from '@/dtos/Extension.dto';
-
-import type { RuntimeMessage } from '../messages';
-
-export const EffectExtensions = (extensions: AnyExtension[]): TraceDeclaration[] => {
- return extensions
- .filter((extension): extension is EffectExtension => extension.type === ExtensionType.EFFECT)
- .map((extension) => ({
- canHandle: (trace) => extension.match({ trace }),
-
- handle: ({ context }, trace) => {
- // NOTE: this promise is intentionally left unhandled
- // we just want to capture and raise any errors thrown
- (async () => {
- try {
- await extension.effect?.({ trace });
- } catch (e) {
- console.error(`Extension '${extension.name}' threw an error: ${e}`);
- }
- })();
-
- return context;
- },
- }));
-};
diff --git a/packages/chat/src/contexts/RuntimeContext/traces/NoReply.trace.ts b/packages/chat/src/contexts/RuntimeContext/traces/NoReply.trace.ts
deleted file mode 100644
index 7040d83463..0000000000
--- a/packages/chat/src/contexts/RuntimeContext/traces/NoReply.trace.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import type { Trace } from '@voiceflow/base-types';
-import type { TraceDeclaration } from '@voiceflow/sdk-runtime';
-import { ActionType } from '@voiceflow/sdk-runtime';
-
-import { DEFAULT_MESSAGE_DELAY } from '@/components/SystemResponse/constants';
-
-import type { RuntimeMessage } from '../messages';
-
-export const NoReply = (callback: (timeout: number) => void): TraceDeclaration => ({
- canHandle: ({ type }) => type === ActionType.NO_REPLY,
- handle: ({ context }, trace: Trace.NoReplyTrace) => {
- if (trace.payload?.timeout) {
- // messages take 1 second to animate in, on top of the delay
- const messageDelays = context.messages.reduce(
- (acc, message) => acc + (message.delay ?? 1000) + DEFAULT_MESSAGE_DELAY,
- 0
- );
- const timeout = trace.payload.timeout * 1000 + messageDelays;
-
- // eslint-disable-next-line callback-return
- callback(timeout);
- }
- return context;
- },
-});
diff --git a/packages/chat/src/contexts/RuntimeContext/traces/ResponseExtensions.trace.ts b/packages/chat/src/contexts/RuntimeContext/traces/ResponseExtensions.trace.ts
deleted file mode 100644
index a2c9cefecb..0000000000
--- a/packages/chat/src/contexts/RuntimeContext/traces/ResponseExtensions.trace.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import type { Trace } from '@voiceflow/base-types';
-import type { TraceDeclaration } from '@voiceflow/sdk-runtime';
-
-import { MessageType } from '@/components/SystemResponse/constants';
-import type { AnyExtension, ResponseExtension } from '@/dtos/Extension.dto';
-import { ExtensionType } from '@/dtos/Extension.dto';
-
-import type { RuntimeMessage } from '../messages';
-
-export const ResponseExtensions = (extensions: AnyExtension[]): TraceDeclaration[] => {
- return extensions
- .filter((extension): extension is ResponseExtension => extension.type === ExtensionType.RESPONSE)
- .map((extension) => ({
- canHandle: (trace) => extension.match({ trace }),
-
- handle: ({ context }, trace) => {
- context.messages.push({ type: MessageType.EXTENSION, payload: { trace, extension } });
-
- return context;
- },
- }));
-};
diff --git a/packages/chat/src/contexts/RuntimeContext/useNoReply.ts b/packages/chat/src/contexts/RuntimeContext/useNoReply.ts
deleted file mode 100644
index f06d492077..0000000000
--- a/packages/chat/src/contexts/RuntimeContext/useNoReply.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import { BaseRequest } from '@voiceflow/base-types';
-import { useCallback, useRef } from 'react';
-
-import { SessionStatus } from '@/types';
-
-import type { RuntimeState } from './useRuntimeState';
-
-export const useNoReply = (api: () => Pick) => {
- const noReplyTimeout = useRef(null);
-
- const clearNoReplyTimeout = useCallback(() => {
- if (!noReplyTimeout.current) return;
-
- clearTimeout(noReplyTimeout.current);
- noReplyTimeout.current = null;
- }, []);
-
- const setNoReplyTimeout = useCallback((timeout: number) => {
- clearNoReplyTimeout();
- noReplyTimeout.current = setTimeout(() => {
- // Trigger no reply action
- if (!api().isStatus(SessionStatus.ACTIVE)) return;
-
- api().interact({ type: BaseRequest.RequestType.NO_REPLY, payload: null });
- }, timeout);
- }, []);
-
- return { setNoReplyTimeout, clearNoReplyTimeout };
-};
diff --git a/packages/chat/src/contexts/RuntimeContext/useRuntimeAPI.ts b/packages/chat/src/contexts/RuntimeContext/useRuntimeAPI.ts
deleted file mode 100644
index 65036596a0..0000000000
--- a/packages/chat/src/contexts/RuntimeContext/useRuntimeAPI.ts
+++ /dev/null
@@ -1,86 +0,0 @@
-import type { RuntimeAction } from '@voiceflow/sdk-runtime';
-import { VoiceflowRuntime } from '@voiceflow/sdk-runtime';
-import { serializeToText } from '@voiceflow/slate-serializer/text';
-import { useMemo } from 'react';
-
-import type { MessageProps } from '@/components/SystemResponse';
-import { MessageType } from '@/components/SystemResponse/constants';
-import { DEVICE_INFO } from '@/constants';
-import type { ChatConfig } from '@/dtos/ChatConfig.dto';
-import type { SessionOptions, UserTurnProps } from '@/types';
-
-import type { RuntimeMessage } from './messages';
-import { MESSAGE_TRACES } from './messages';
-
-export enum FeedbackName {
- POSITIVE = 'Thumbs up',
- NEGATIVE = 'Thumbs down',
-}
-
-export const createContext = (): RuntimeMessage => ({
- messages: [],
-});
-
-export const useRuntimeAPI = ({
- url,
- user,
- userID,
- verify,
- versionID,
- traceHandlers = [],
-}: ChatConfig & Pick & { traceHandlers?: typeof MESSAGE_TRACES }) => {
- const runtime: VoiceflowRuntime = useMemo(
- () =>
- new VoiceflowRuntime({
- verify,
- url,
- traces: [...MESSAGE_TRACES, ...traceHandlers],
- }),
- []
- );
-
- const interact = async (action: RuntimeAction, config?: any) =>
- runtime.interact(createContext(), {
- sessionID: userID,
- action,
- config,
- ...(versionID && { versionID }),
- });
-
- const saveFeedback = async (name: FeedbackName, lastTurnMessages: MessageProps[], userTurn: UserTurnProps | null) => {
- const aiMessages: string[] = [];
-
- lastTurnMessages.forEach((message) => {
- if (!message.ai) return;
- if (message.type !== MessageType.TEXT) return;
- const text = typeof message.text === 'string' ? message.text : serializeToText(message.text);
-
- aiMessages.push(text);
- });
-
- await runtime.feedback({
- sessionID: userID,
- name,
- text: aiMessages,
- lastUserTurn: userTurn,
- ...(versionID && { versionID }),
- });
- };
-
- const saveTranscript = async () => {
- const {
- browser: { name: browser },
- os: { name: os },
- platform: { type: device },
- } = DEVICE_INFO;
-
- await runtime.createTranscript(userID, {
- ...(os && { os }),
- ...(browser && { browser }),
- ...(device && { device }),
- ...(user && { user: user as { name: string } }),
- });
- };
-
- return { interact, saveFeedback, saveTranscript };
-};
diff --git a/packages/chat/src/contexts/RuntimeContext/useRuntimeState.ts b/packages/chat/src/contexts/RuntimeContext/useRuntimeState.ts
deleted file mode 100644
index e57c24fe2a..0000000000
--- a/packages/chat/src/contexts/RuntimeContext/useRuntimeState.ts
+++ /dev/null
@@ -1,248 +0,0 @@
-import type { BaseRequest } from '@voiceflow/dtos-interact';
-import { isTextRequest, RequestType } from '@voiceflow/dtos-interact';
-import type { TraceDeclaration } from '@voiceflow/sdk-runtime';
-import cuid from 'cuid';
-import { useEffect, useRef, useState } from 'react';
-
-import { DEFAULT_MESSAGE_DELAY, MessageType } from '@/components/SystemResponse/constants';
-import { isIOS } from '@/device';
-import type { ChatConfig } from '@/dtos/ChatConfig.dto';
-import { useStateRef } from '@/hooks/useStateRef';
-import { useLocalStorageState } from '@/hooks/useStorage';
-import type { ChatPersistence, ChatWidgetSettings, SendMessage, SessionOptions, TurnProps } from '@/types';
-import { SessionStatus, TurnType } from '@/types';
-import { handleActions } from '@/utils/actions';
-import { broadcast, BroadcastType } from '@/utils/broadcast';
-import { getSession, saveSession } from '@/utils/session';
-
-import { AudioController } from './audio-controller';
-import type { RuntimeMessage } from './messages';
-import { resolveAction } from './runtime.utils';
-import { silentAudio } from './silent-audio';
-import { EffectExtensions } from './traces/EffectExtensions.trace';
-import { NoReply } from './traces/NoReply.trace';
-import { ResponseExtensions } from './traces/ResponseExtensions.trace';
-import { useNoReply } from './useNoReply';
-import { createContext, useRuntimeAPI } from './useRuntimeAPI';
-
-export interface Settings {
- assistant: ChatWidgetSettings;
- config: ChatConfig;
- traceHandlers?: TraceDeclaration[];
-}
-
-const DEFAULT_SESSION_PARAMS = {
- turns: [],
- startTime: Date.now(),
-};
-
-export const useRuntimeState = ({ assistant, config, traceHandlers }: Settings) => {
- const [audio] = useState(() => new AudioController());
- const playAudiosStack = useRef([]);
- const [isOpen, setOpen] = useState(false);
- const [audioOutput, setAudioOutput, audioOutputRef] = useLocalStorageState(
- 'audio-output',
- assistant.chat.voiceOutput ?? false
- );
-
- const [session, setSession, sessionRef] = useStateRef>(() => ({
- ...DEFAULT_SESSION_PARAMS,
- status: config.autostart ? SessionStatus.IDLE : SessionStatus.ENDED,
- // retrieve stored session
- ...getSession(assistant.common.persistence as ChatPersistence, config.verify.projectID, config.userID),
- ...{ userID: config.userID || cuid() },
- }));
-
- const [indicator, setIndicator] = useState(false);
- const { clearNoReplyTimeout, setNoReplyTimeout } = useNoReply(() => ({ interact, isStatus }));
-
- const runtime = useRuntimeAPI({
- ...config,
- ...session,
- traceHandlers: [
- NoReply(setNoReplyTimeout),
- ...EffectExtensions(assistant.extensions),
- ...ResponseExtensions(assistant.extensions),
- ...(traceHandlers ?? []),
- ],
- });
-
- const isAudioOutputEnabled = () => assistant.chat.voiceOutput && audioOutputRef.current;
-
- // status management
- const setStatus = (status: SessionStatus) => {
- setSession((prev) => (prev.status === status ? prev : { ...prev, status }));
- };
- const isStatus = (status: SessionStatus) => {
- return sessionRef.current.status === status;
- };
-
- // turn management
- const setTurns = (action: (turns: TurnProps[]) => TurnProps[]) => {
- setSession((prev) => ({ ...prev, turns: action(prev.turns) }));
- };
-
- const addTurn = (turn: TurnProps) => setTurns((prev) => [...prev, turn]);
-
- const reset = () => setTurns(() => []);
-
- const interact: SendMessage = async (action: BaseRequest, message?: string) => {
- clearNoReplyTimeout();
-
- if (sessionRef.current.status === SessionStatus.ENDED) return;
-
- // create a transcript on the first turn, do this async
- if (sessionRef.current.turns.length === 1) runtime.saveTranscript();
-
- handleActions(action);
-
- const userMessage = message || (isTextRequest(action) ? action.payload : null);
- if (userMessage) {
- addTurn({
- id: cuid(),
- type: TurnType.USER,
- message: userMessage,
- timestamp: Date.now(),
- });
- }
-
- const userAction = resolveAction(action, getTurns());
-
- setIndicator(true);
- const context = await runtime.interact(userAction, { tts: isAudioOutputEnabled() }).catch((error) => {
- // TODO: better define error condition
- console.error(error);
- return createContext();
- });
- setIndicator(false);
-
- addTurn({
- id: cuid(),
- type: TurnType.SYSTEM,
- timestamp: Date.now(),
- ...context,
- });
-
- const shouldPlay = isAudioOutputEnabled() && playAudiosStack.current.length === 0;
-
- if (isAudioOutputEnabled()) {
- context.messages.forEach((message) => {
- if (message.type === MessageType.TEXT && message.audio?.src) {
- playAudiosStack.current.push(message.audio.src);
- }
- });
- }
-
- if (shouldPlay) {
- // eslint-disable-next-line no-promise-executor-return
- await new Promise((resolve) => setTimeout(resolve, DEFAULT_MESSAGE_DELAY));
-
- playAudioCircle();
- }
-
- broadcast({ type: BroadcastType.INTERACT, payload: { session: sessionRef.current, action: userAction } });
- saveSession(assistant.common.persistence as ChatPersistence, config.verify.projectID, sessionRef.current);
- };
-
- const launch = async (): Promise => {
- playAudiosStack.current = [];
-
- // we need to play a silent audio on user interaction to enable async audio playback
- if (isIOS() && isAudioOutputEnabled()) {
- audio.play(silentAudio);
- }
-
- if (sessionRef.current.turns.length) reset();
-
- setStatus(SessionStatus.ACTIVE);
- await interact(config.launch?.event ?? { type: RequestType.LAUNCH });
- };
-
- const reply = async (message: string): Promise => {
- stopAudios();
-
- interact({ type: RequestType.TEXT, payload: message });
- };
-
- const open = async () => {
- broadcast({ type: BroadcastType.OPEN });
- setOpen(true);
-
- if (isStatus(SessionStatus.IDLE)) {
- await launch();
- }
- };
-
- const stopChat = () => {
- stopAudios();
-
- broadcast({ type: BroadcastType.CLOSE });
- saveSession(assistant.common.persistence as ChatPersistence, config.verify.projectID, sessionRef.current);
- };
-
- const close = () => {
- stopChat();
- setOpen(false);
- };
-
- const getTurns = () => sessionRef.current.turns;
-
- const stopAudios = () => {
- playAudiosStack.current = [];
- audio.stop();
- };
-
- const playAudioCircle = async () => {
- if (!isAudioOutputEnabled() || !playAudiosStack.current.length) return;
-
- await audio.play(playAudiosStack.current.shift());
-
- playAudioCircle();
- };
-
- const toggleAudioOutput = () => {
- stopAudios();
- setAudioOutput((prev) => !prev);
- };
-
- useEffect(() => {
- if (!isOpen) return undefined;
-
- return () => {
- stopAudios();
- };
- }, [isOpen]);
-
- return {
- state: {
- session,
- isOpen,
- indicator,
- audioOutput,
- },
- api: {
- launch,
- reply,
- open,
- interact,
- close,
- stopChat,
- addTurn,
- feedback: runtime.saveFeedback,
- setStatus,
- setOpen,
- isStatus,
- reset,
- getTurns,
- setIndicator,
- setAudioOutput,
- toggleAudioOutput,
-
- // these are meant to be static, so bundling them with the API
- assistant,
- config,
- },
- };
-};
-
-export type RuntimeState = ReturnType;
diff --git a/packages/chat/src/contexts/index.ts b/packages/chat/src/contexts/index.ts
deleted file mode 100644
index d4203dc2c1..0000000000
--- a/packages/chat/src/contexts/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './AutoScrollContext';
-export * from './RuntimeContext';
diff --git a/packages/chat/src/device.ts b/packages/chat/src/device.ts
deleted file mode 100644
index 49b1b10235..0000000000
--- a/packages/chat/src/device.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { DEVICE_INFO } from '@/constants';
-
-export const isIOS = () => DEVICE_INFO.os.name === 'iOS';
-
-export const isBrave = () => {
- const browserNavigator = globalThis.navigator as Navigator & { brave?: { isBrave: () => boolean } };
-
- if (!browserNavigator) return false;
-
- if (browserNavigator.brave !== undefined) {
- return browserNavigator.brave.isBrave.name === 'isBrave';
- }
-
- return false;
-};
-
-export const isArc = () => !!getComputedStyle(document.documentElement).getPropertyValue('--arc-palette-title');
-export const isEdge = () => DEVICE_INFO.browser.name === 'Microsoft Edge';
-export const isOpera = () => DEVICE_INFO.browser.name === 'Opera';
-export const isChrome = () => !isBrave() && !isArc() && DEVICE_INFO.browser.name === 'Chrome';
-export const isSafari = () => DEVICE_INFO.browser.name === 'Safari';
-export const isFirefox = () => DEVICE_INFO.browser.name === 'Firefox';
-export const isChromium = () => isEdge() || isChrome() || isBrave() || isArc() || isOpera();
diff --git a/packages/chat/src/dtos/AssistantOptions.dto.ts b/packages/chat/src/dtos/AssistantOptions.dto.ts
deleted file mode 100644
index 9f39e4ecd9..0000000000
--- a/packages/chat/src/dtos/AssistantOptions.dto.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-import { z } from 'zod';
-
-import { DEFAULT_PRIMARY } from '@/styles/colors';
-import { ChatPersistence, ChatPosition } from '@/types';
-
-import { AnyExtension } from './Extension.dto';
-
-export const DEFAULT_AVATAR = 'https://cdn.voiceflow.com/assets/logo.png';
-
-export const DEFAULT_CHAT_AVATAR = 'https://cdn.voiceflow.com/widget-next/vf_chat.png';
-
-export type AssistantOptions = z.infer;
-export type RawAssistantOptions = z.input;
-
-export const AssistantOptions = z
- .object({
- title: z.string().default('Voiceflow Assistant'),
- color: z.string().default(DEFAULT_PRIMARY),
- image: z.string().default(DEFAULT_AVATAR),
- avatar: z.string().default(DEFAULT_AVATAR),
- launcher: z.string().optional(),
- watermark: z.boolean().default(true),
- feedback: z.boolean().default(false),
- stylesheet: z.union([z.string(), z.string().array()]).optional(),
- description: z.string().default(''),
- position: z.nativeEnum(ChatPosition).default(ChatPosition.RIGHT),
- persistence: z.nativeEnum(ChatPersistence).default(ChatPersistence.LOCAL_STORAGE),
- audioInterface: z.boolean().default(false),
- defaultAudioOutput: z.boolean().optional(),
-
- spacing: z
- .object({
- side: z.number().default(30),
- bottom: z.number().default(30),
- })
- .default({}),
-
- extensions: AnyExtension.array().default([]),
- })
- .default({});
diff --git a/packages/chat/src/dtos/ChatConfig.dto.test.ts b/packages/chat/src/dtos/ChatConfig.dto.test.ts
deleted file mode 100644
index a515a753e9..0000000000
--- a/packages/chat/src/dtos/ChatConfig.dto.test.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-import { describe, expect, it } from 'vitest';
-
-import { ChatConfig, RUNTIME_URL } from './ChatConfig.dto';
-import { RenderMode } from './RenderOptions.dto';
-
-describe('ChatConfig', () => {
- describe('parse()', () => {
- it('should accept a minimal configuration', () => {
- const projectID = 'projectID';
-
- const result = ChatConfig.parse({
- verify: { projectID },
- });
-
- expect(result).toEqual({
- autostart: true,
- allowDangerousHTML: true,
- url: RUNTIME_URL,
- verify: { projectID },
- render: { mode: RenderMode.OVERLAY },
- });
- });
-
- it('should accept all configuration options', () => {
- const localOptions = {
- autostart: true,
- allowDangerousHTML: false,
-
- url: 'local',
- userID: 'local',
- versionID: 'local',
-
- verify: { projectID: 'local' },
- user: { name: 'local', image: 'local' },
- render: { mode: RenderMode.OVERLAY },
- launch: { event: { type: 'local' } },
- };
-
- const result = ChatConfig.parse(localOptions);
-
- expect(result).toEqual(localOptions);
- });
-
- it('should accept a numeric userID', () => {
- const projectID = 'projectID';
-
- const result = ChatConfig.parse({
- verify: { projectID },
- userID: 123,
- });
-
- expect(result).toEqual({
- autostart: true,
- allowDangerousHTML: true,
- url: RUNTIME_URL,
- verify: { projectID },
- render: { mode: RenderMode.OVERLAY },
- userID: '123',
- });
- });
-
- it('should accept and decode a string userID', () => {
- const projectID = 'projectID';
-
- const result = ChatConfig.parse({
- verify: { projectID },
- userID: 'foo%20bar',
- });
-
- expect(result).toEqual({
- autostart: true,
- allowDangerousHTML: true,
- url: RUNTIME_URL,
- verify: { projectID },
- render: { mode: RenderMode.OVERLAY },
- userID: 'foo bar',
- });
- });
- });
-});
diff --git a/packages/chat/src/dtos/ChatConfig.dto.ts b/packages/chat/src/dtos/ChatConfig.dto.ts
deleted file mode 100644
index 460b6e383e..0000000000
--- a/packages/chat/src/dtos/ChatConfig.dto.ts
+++ /dev/null
@@ -1,122 +0,0 @@
-import type { BaseRequest } from '@voiceflow/dtos-interact';
-import type { PrototypeVerify, PublicVerify, RuntimeOptions as SDKRuntimeOptions } from '@voiceflow/sdk-runtime';
-import { z } from 'zod';
-
-import { RenderMode, RenderOptions } from './RenderOptions.dto';
-import type { WidgetOverrides } from './WidgetOverrides.dto';
-
-export const RUNTIME_URL = 'https://general-runtime.voiceflow.com';
-
-const tryDecodeURIComponent = (str: string) => {
- try {
- return decodeURIComponent(str);
- } catch {
- return str;
- }
-};
-
-export type VerifyOptions = z.infer;
-export type UserOptions = z.infer;
-export type LaunchOptions = z.infer;
-
-export const VerifyOptions = z.union([
- z.object({ projectID: z.string() }),
- z.object({ projectID: z.string(), versionID: z.string(), prototype: z.literal(true) }),
-]);
-
-export const LaunchOptions = z
- .object({
- event: z
- .object({ type: z.string() })
- .passthrough()
- .transform((x) => x as unknown as BaseRequest),
- })
- .partial();
-
-export const UserOptions = z
- .object({
- name: z.string(),
- image: z.string(),
- })
- .partial();
-
-type Config> = T;
-
-export interface ChatConfig extends Config> {}
-
-export interface LoadConfig extends Omit {
- url?: ChatConfig['url'];
- assistant?: WidgetOverrides;
-}
-
-export const ChatSpeechRecognitionState = z.object({
- listening: z.boolean(),
- transcript: z.string(),
- processing: z.boolean(),
- initializing: z.boolean(),
- microphoneAvailable: z.boolean().describe('If false, the user has not given permission for their microphone.'),
-});
-
-export type ChatSpeechRecognitionState = z.infer;
-
-export const ChatSpeechRecognitionConfig = z.object({
- overrideNative: z
- .boolean()
- .optional()
- .default(false)
- .describe(
- 'If true, uses the custom speech recognition implementation even if the native (browsers) one is available.'
- ),
- initialState: ChatSpeechRecognitionState,
- onStateChange: z
- .function()
- .args(z.function().args(ChatSpeechRecognitionState).returns(z.void()))
- .returns(z.function().returns(z.void())),
- stopListening: z.function().returns(z.void()),
- startListening: z
- .function()
- .returns(z.void())
- .describe(
- `Starts listening for speech input.
- User has to give permission for their microphone to be used before listening can begin.
- If the user has not given permission, needs to update microphoneAvailable: false state.`
- ),
- resetTranscript: z.function().returns(z.void()),
-});
-
-export type ChatSpeechRecognitionConfig = z.infer;
-
-export const ChatConfig = z
- .object({
- autostart: z.boolean().optional(),
- // default to true during migration period, turn off later
- allowDangerousHTML: z.boolean().default(true),
-
- url: z.string().default(RUNTIME_URL),
- userID: z
- .union([z.number(), z.string()])
- .transform((x) => {
- if (typeof x === 'number') return String(x);
- return tryDecodeURIComponent(x);
- })
- .optional(),
- versionID: z.string().optional(),
-
- verify: VerifyOptions,
- user: UserOptions.optional(),
- render: RenderOptions,
- launch: LaunchOptions.optional(),
-
- voice: z
- .object({
- url: z.string(),
- accessToken: z.string(),
- })
- .optional(),
- })
- .transform((config) => ({
- ...config,
-
- // if not configured default to enabling autostart during overlay mode and disabling it otherwise
- autostart: config.autostart ?? config.render.mode === RenderMode.OVERLAY,
- }));
diff --git a/packages/chat/src/dtos/Extension.dto.ts b/packages/chat/src/dtos/Extension.dto.ts
deleted file mode 100644
index 762b774846..0000000000
--- a/packages/chat/src/dtos/Extension.dto.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import type { Trace } from '@voiceflow/base-types';
-import { z } from 'zod';
-
-export enum ExtensionType {
- EFFECT = 'effect',
- RESPONSE = 'response',
-}
-
-export type EffectExtension = z.infer;
-export type ResponseExtension = z.infer;
-export type AnyExtension = z.infer;
-
-const Extension = (type: Type) =>
- z.object({
- name: z.string(),
- type: z.literal(type),
- match: z.function().transform((f) => f as (context: { trace: Trace.AnyTrace }) => boolean),
- });
-
-export const EffectExtension = Extension(ExtensionType.EFFECT).extend({
- effect: z
- .function()
- .transform((f) => f as (context: { trace: Trace.AnyTrace }) => Promise | void)
- .optional(),
-});
-
-export const ResponseExtension = Extension(ExtensionType.RESPONSE).extend({
- render: z
- .function()
- .transform((f) => f as (context: { trace: Trace.AnyTrace; element: HTMLElement }) => (() => void) | void)
- .optional(),
-});
-
-export const AnyExtension = z.discriminatedUnion('type', [EffectExtension, ResponseExtension]);
diff --git a/packages/chat/src/dtos/Palette.dto.ts b/packages/chat/src/dtos/Palette.dto.ts
deleted file mode 100644
index bde405a6cb..0000000000
--- a/packages/chat/src/dtos/Palette.dto.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { z } from 'zod';
-
-import { createPalette } from '@/styles/colors';
-
-export const Palette = z
- .object({
- 50: z.string(),
- 100: z.string(),
- 200: z.string(),
- 300: z.string(),
- 400: z.string(),
- 500: z.string(),
- 600: z.string(),
- 700: z.string(),
- 800: z.string(),
- 900: z.string(),
- })
- .default(createPalette());
-
-export type Palette = z.infer;
diff --git a/packages/chat/src/dtos/RenderOptions.dto.test.ts b/packages/chat/src/dtos/RenderOptions.dto.test.ts
deleted file mode 100644
index 06b129a974..0000000000
--- a/packages/chat/src/dtos/RenderOptions.dto.test.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-import { describe, expect, it, vi } from 'vitest';
-
-import { EMBEDDED_TARGET, RenderMode, RenderOptions } from './RenderOptions.dto';
-
-describe('RenderOptions', () => {
- describe('parse()', () => {
- it('should render in overlay mode by default', () => {
- const result = RenderOptions.parse(undefined);
-
- expect(result).toEqual({ mode: RenderMode.OVERLAY });
- });
-
- it('should render in embedded mode', () => {
- const renderOptions = {
- mode: RenderMode.EMBEDDED,
- target: Object.create(HTMLElement.prototype),
- };
-
- const result = RenderOptions.parse(renderOptions);
-
- expect(result).toEqual(renderOptions);
- });
-
- it('should try to find a target with a known name when in embedded mode', () => {
- const target = Object.create(HTMLElement.prototype);
- const getElementById = vi.spyOn(document, 'getElementById').mockImplementation(() => target);
-
- const result = RenderOptions.parse({ mode: RenderMode.EMBEDDED });
-
- expect(result).toEqual({ mode: RenderMode.EMBEDDED, target });
- expect(getElementById).toBeCalledWith(EMBEDDED_TARGET);
- });
-
- it('should fallback to overlay mode when a target is not provided', () => {
- const result = RenderOptions.parse({ mode: RenderMode.EMBEDDED });
-
- expect(result).toEqual({ mode: RenderMode.OVERLAY });
- });
- });
-});
diff --git a/packages/chat/src/dtos/RenderOptions.dto.ts b/packages/chat/src/dtos/RenderOptions.dto.ts
deleted file mode 100644
index 9c9bc87b1c..0000000000
--- a/packages/chat/src/dtos/RenderOptions.dto.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-import { z } from 'zod';
-
-export const EMBEDDED_TARGET = 'voiceflow-chat-frame';
-
-export enum RenderMode {
- /**
- * Embed the chat window into a specific container in the screen.
- * This won't show the Launcher button because the chat will be
- * opened by default.
- */
- EMBEDDED = 'embedded',
-
- /**
- * Shows the launcher button in the bottom corder of the screen,
- * and the user needs to push it to open/minimize the chat window.
- */
- OVERLAY = 'overlay',
-
- /**
- * Shows the chat as popover dialog in the center of the screen.
- */
- POPOVER = 'popover',
-}
-
-export type RenderOptions = z.infer;
-
-export const RenderOptions = z
- .object({
- mode: z.nativeEnum(RenderMode).default(RenderMode.OVERLAY),
- target: z
- .instanceof(HTMLElement)
- .optional()
- .transform((x) => x ?? document.getElementById(EMBEDDED_TARGET) ?? undefined),
- })
- .optional()
- .transform((render) => {
- if (render?.target && render.mode !== RenderMode.EMBEDDED) {
- console.warn(`render.target has no effect in ${render.mode} mode.`);
- }
-
- if (render?.mode === RenderMode.EMBEDDED) {
- if (render.target) {
- return {
- mode: RenderMode.EMBEDDED as const,
- target: render.target,
- };
- }
-
- console.error('No valid target found for embedded mode. Defaulting to overlay mode.');
- }
-
- return { mode: RenderMode.OVERLAY as const };
- });
diff --git a/packages/chat/src/dtos/WidgetOverrides.dto.test.ts b/packages/chat/src/dtos/WidgetOverrides.dto.test.ts
deleted file mode 100644
index ca6ea7abbb..0000000000
--- a/packages/chat/src/dtos/WidgetOverrides.dto.test.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { describe, expect, it } from 'vitest';
-
-import { WidgetOverrides } from './WidgetOverrides.dto';
-
-describe('WidgetOverrides', () => {
- describe('parse()', () => {
- // WidgetOverrides comes from the user, so it should be totally optional
- it('should create default, empty settings object', () => {
- const result = WidgetOverrides.parse({});
- expect(result).toEqual({});
- });
- });
-});
diff --git a/packages/chat/src/dtos/WidgetOverrides.dto.ts b/packages/chat/src/dtos/WidgetOverrides.dto.ts
deleted file mode 100644
index 935cf70ae5..0000000000
--- a/packages/chat/src/dtos/WidgetOverrides.dto.ts
+++ /dev/null
@@ -1,100 +0,0 @@
-import {
- WidgetSettingsChatRenderMode,
- WidgetSettingsLauncherType,
- WidgetSettingsWidgetType,
-} from '@voiceflow/dtos-interact';
-import { ChatPersistence, ChatPosition } from '@voiceflow/voiceflow-types/build/cjs/version';
-import { z } from 'zod';
-
-import { AnyExtension } from './Extension.dto';
-import { Palette } from './Palette.dto';
-
-export const WidgetOverrides = z.object({
- type: z.nativeEnum(WidgetSettingsWidgetType).optional(),
- renderMode: z.nativeEnum(WidgetSettingsChatRenderMode).optional(),
-
- // Widget header
- header: z
- .object({
- hideImage: z.boolean().optional(),
- imageUrl: z.string().optional(),
- title: z.string().optional(),
- })
- .optional(),
-
- // Welcome message
- banner: z
- .object({
- hide: z.boolean().optional(),
- title: z.string().optional(),
- description: z.string().optional(),
- imageUrl: z.string().optional(),
- })
- .optional(),
-
- // Agent avatar
- avatar: z
- .object({
- hide: z.boolean().optional(),
- imageUrl: z.string().optional(),
- })
- .optional(),
-
- // input
- inputPlaceholder: z.string().optional(),
-
- // voice within chat
- enableVoiceInput: z.boolean().optional(),
- enableVoiceOutput: z.boolean().optional(),
-
- // launcher
- launcher: z
- .object({
- type: z.nativeEnum(WidgetSettingsLauncherType).optional(),
- label: z.string().optional(),
- imageUrl: z.string().optional(),
- })
- .optional(),
-
- // footer
- footer: z
- .object({
- hide: z.boolean().optional(),
- linkText: z.string().optional(),
- linkUrl: z.string().optional(),
- })
- .optional(),
-
- // palette
- color: z.string().optional(),
- palette: Palette.optional(),
-
- // fonts
- fontFamily: z.string().optional(),
-
- // position
- side: z.nativeEnum(ChatPosition).optional(),
- spacing: z
- .object({
- side: z.string().optional(),
- bottom: z.string().optional(),
- })
- .optional(),
-
- // ai disclaimer
- aiDisclaimer: z
- .object({
- hide: z.boolean().optional(),
- text: z.string().optional(),
- })
- .optional(),
-
- // misc
- persistence: z.nativeEnum(ChatPersistence).optional(),
-
- // external additions
- stylesheet: z.string().optional(),
- extensions: AnyExtension.array().optional(),
-});
-
-export type WidgetOverrides = z.infer;
diff --git a/packages/chat/src/fixtures.ts b/packages/chat/src/fixtures.ts
deleted file mode 100644
index b383940cfd..0000000000
--- a/packages/chat/src/fixtures.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export const VF_ICON =
- // eslint-disable-next-line no-secrets/no-secrets
- 'https://s3-alpha-sig.figma.com/img/a055/7f08/d7a7d2188b07379a4b08bd7e495c7831?Expires=1729468800&Key-Pair-Id=APKAQ4GOSFWCVNEHN3O4&Signature=k9k0pTEQfKvUYDDyy5u6XhceRS~CAgifNUHCA7xB8nXcVmtCAljvmt96ooVIL4PxZhzk40ThyaKfd4SaXXmiCCpzA4xVMB995srb2d6ds-oc2x4x76Gd24quVTU2uWeVhv6jgM77ZFW9a-tWPkzP5ie9KK2v4PFjiI8MODI27AaRNoFtNnKC16QrR2KVp8Jjf0GBCWXotOAol2emacH5grLUFLEKOwvroO9~QrRq2Xiwb30qYY3NnI8vm6ZCDpajvi6BOKOWa6oz1URRWt-TV19xqlVkyKpI5F9rtQxp5l5lUx-IdRDjVUNIDcLOBEzqmTn6fjw4VibvtSAoZGu7ug__';
-
-export const MOCK_IMAGE = 'https://picsum.photos/seed/9/300/200';
diff --git a/packages/chat/src/hooks/cache.hook.ts b/packages/chat/src/hooks/cache.hook.ts
deleted file mode 100644
index ea167405b0..0000000000
--- a/packages/chat/src/hooks/cache.hook.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import { useRef } from 'react';
-
-export const useCachedValue = (value: T): React.MutableRefObject => {
- const ref = useRef(value);
-
- ref.current = value;
-
- return ref;
-};
-
-export const useConst = (value: T): T => {
- const ref = useRef();
-
- if (ref.current === undefined) {
- ref.current = value;
- }
-
- return ref.current;
-};
-
-export const useCreateConst = (creator: () => T): T => {
- const ref = useRef();
-
- if (ref.current === undefined) {
- ref.current = creator();
- }
-
- return ref.current;
-};
diff --git a/packages/chat/src/hooks/index.ts b/packages/chat/src/hooks/index.ts
deleted file mode 100644
index 48ac790ec4..0000000000
--- a/packages/chat/src/hooks/index.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export * from './useAutoScroll';
-export * from './useChatAPI';
-export * from './useDidUpdateEffect';
-export * from './usePalette';
-export * from './useStateRef';
-export * from './useStorage';
diff --git a/packages/chat/src/hooks/useAutoScroll.ts b/packages/chat/src/hooks/useAutoScroll.ts
deleted file mode 100644
index 9148abaacd..0000000000
--- a/packages/chat/src/hooks/useAutoScroll.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { useContext, useLayoutEffect } from 'react';
-
-import { AutoScrollContext } from '@/contexts';
-
-export const useAutoScroll = (dependencies: any[] = []): void => {
- const { scrollToBottom } = useContext(AutoScrollContext);
-
- useLayoutEffect(() => {
- scrollToBottom();
- }, dependencies);
-};
diff --git a/packages/chat/src/hooks/useChatAPI.ts b/packages/chat/src/hooks/useChatAPI.ts
deleted file mode 100644
index e844f1d387..0000000000
--- a/packages/chat/src/hooks/useChatAPI.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { useEffect } from 'react';
-import type { PartialDeep } from 'type-fest';
-
-import { createPlaceholderMethods } from '@/utils/chat';
-import { isObject } from '@/utils/isObject';
-
-export const useChatAPI = (
- target: Record | undefined,
- factory: () => PartialDeep,
- onReady?: () => void
-) =>
- useEffect(() => {
- if (!isObject(target)) return undefined;
-
- const placeholders = createPlaceholderMethods((method) => `Method '${method}' has no effect in this mode.`);
- const methods = factory();
-
- Object.assign(target, {
- ...placeholders,
- ...methods,
- proactive: {
- ...placeholders.proactive,
- ...methods.proactive,
- },
- });
-
- onReady?.();
-
- return () => {
- const methods = createPlaceholderMethods(
- (method) =>
- `Method '${method}' has no effect after 'destroy' has been called. Call 'load' to render the chat and restore this method.`
- );
-
- Object.assign(target, methods);
- };
- }, []);
diff --git a/packages/chat/src/hooks/useDidUpdateEffect.ts b/packages/chat/src/hooks/useDidUpdateEffect.ts
deleted file mode 100644
index cb91dde79b..0000000000
--- a/packages/chat/src/hooks/useDidUpdateEffect.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { useEffect, useRef } from 'react';
-
-export const useDidUpdateEffect = (callback: () => void | VoidFunction, dependencies: unknown[] = []): void => {
- const didMount = useRef(false);
-
- useEffect(() => {
- if (didMount.current) {
- return callback();
- }
-
- didMount.current = true;
-
- return undefined;
- }, dependencies);
-};
diff --git a/packages/chat/src/hooks/usePalette.ts b/packages/chat/src/hooks/usePalette.ts
deleted file mode 100644
index 00073df9f7..0000000000
--- a/packages/chat/src/hooks/usePalette.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { useEffect, useState } from 'react';
-
-import type { Palette } from '@/dtos/Palette.dto';
-import type { ChatWidgetSettings } from '@/types';
-
-export const usePalette = (assistant?: ChatWidgetSettings) => {
- const [palette, setPalette] = useState();
- useEffect(() => {
- if (assistant?.common.primaryColor?.palette) {
- setPalette(assistant.common.primaryColor.palette);
- }
- }, [assistant?.common.primaryColor]);
-
- return palette;
-};
diff --git a/packages/chat/src/hooks/useStateRef.ts b/packages/chat/src/hooks/useStateRef.ts
deleted file mode 100644
index bd1243b92b..0000000000
--- a/packages/chat/src/hooks/useStateRef.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import type { Dispatch, SetStateAction } from 'react';
-import { useCallback, useRef, useState } from 'react';
-
-const isFunction = (setStateAction: SetStateAction): setStateAction is (prevState: S) => S =>
- typeof setStateAction === 'function';
-
-interface ReadOnlyRefObject {
- readonly current: T;
-}
-
-interface UseStateRef {
- (initialState: S | (() => S)): [S, Dispatch>, ReadOnlyRefObject];
- (): [S | undefined, Dispatch>, ReadOnlyRefObject];
-}
-
-export const useStateRef: UseStateRef = (initialState?: S | (() => S)) => {
- const [state, setState] = useState(initialState);
- const ref = useRef(state);
-
- const dispatch: typeof setState = useCallback((setStateAction: any) => {
- ref.current = isFunction(setStateAction) ? setStateAction(ref.current) : setStateAction;
-
- setState(ref.current);
- }, []);
-
- return [state, dispatch, ref];
-};
diff --git a/packages/chat/src/hooks/useStorage.ts b/packages/chat/src/hooks/useStorage.ts
deleted file mode 100644
index 35ccf5603a..0000000000
--- a/packages/chat/src/hooks/useStorage.ts
+++ /dev/null
@@ -1,65 +0,0 @@
-import { useCallback, useMemo, useRef, useState } from 'react';
-
-interface Storage {
- getItem: (key: string) => string | null;
- setItem: (key: string, value: string) => void;
- removeItem: (key: string) => void;
-}
-
-const createUseStorageHook =
- (storage: S) =>
- (name: string, defaultValue: T) =>
- useMemo(() => {
- const storageName = `voiceflow-chat-widget:${name}`;
-
- return {
- get: (): T => {
- try {
- const item = storage.getItem(storageName);
-
- return item === null ? defaultValue : JSON.parse(item);
- } catch {
- return defaultValue;
- }
- },
-
- set: (value: T) => storage.setItem(storageName, JSON.stringify(value)),
-
- clear: () => storage.removeItem(storageName),
- };
- }, []);
-
-const createUseStorageStateHook = (storage: S) => {
- const useStorage = createUseStorageHook(storage);
-
- return (name: string, initialState: T) => {
- const storage = useStorage(name, initialState);
- const [value, setValue] = useState(storage.get);
- const ref = useRef(value);
-
- const setStorageValue = useCallback>>((value) => {
- setValue((prevState) => {
- let nextValue: T;
-
- if (typeof value === 'function') {
- nextValue = (value as (prevState: T) => T)(prevState);
- } else {
- nextValue = value;
- }
-
- storage.set(nextValue);
- ref.current = nextValue;
-
- return nextValue;
- });
- }, []);
-
- return [value, setStorageValue, ref] as const;
- };
-};
-
-export const useLocalStorage = createUseStorageHook(globalThis.localStorage);
-export const useSessionStorage = createUseStorageHook(globalThis.localStorage);
-
-export const useLocalStorageState = createUseStorageStateHook(globalThis.localStorage);
-export const useSessionStorageState = createUseStorageStateHook(globalThis.sessionStorage);
diff --git a/packages/chat/src/main.ts b/packages/chat/src/main.ts
deleted file mode 100644
index 11eb274cb9..0000000000
--- a/packages/chat/src/main.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-export * from './components';
-export * from './contexts';
-export type { RuntimeState } from './contexts/RuntimeContext/useRuntimeState';
-export * from './dtos/AssistantOptions.dto';
-export * from './dtos/ChatConfig.dto';
-export * from './dtos/Extension.dto';
-export * from './dtos/RenderOptions.dto';
-export * from './hooks';
-export * from './types/session';
-export * from './types/settings';
-export * from './types/trace';
-export * from './types/turn';
-export * from './utils/functional';
-export * from './views';
-export type { VoiceAPI } from './views/VoiceWidget/VoiceWidget.interface';
diff --git a/packages/chat/src/stories.ts b/packages/chat/src/stories.ts
deleted file mode 100644
index 20aefff05d..0000000000
--- a/packages/chat/src/stories.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-export * as AgentMessage from './components/AgentMessage/AgentMessage.story';
-export * as Avatar from './components/Avatar/Avatar.story';
-export * as Button from './components/Button/Button.story';
-export * as Card from './components/Card/Card.story';
-export * as Carousel from './components/Carousel/Carousel.story';
-export * as CarouselButton from './components/Carousel/CarouselButton.story';
-export * as ColorTheme from './components/ColorTheme/ColorTheme.story';
-export * as FeedbackButton from './components/FeedbackButton/FeedbackButton.story';
-export * as Header from './components/Header/Header.story';
-export * as Launcher from './components/Launcher/Launcher.story';
-export * as LinkPreview from './components/LinkPreview/LinkPreview.story';
-export * as MessageInput from './components/MessageInput/MessageInput.story';
-export * as NewChat from './components/NewChat/NewChat.story';
-export * as Prompt from './components/Prompt/Prompt.story';
-export * as SendButton from './components/SendButton/SendButton.story';
-export * as TypingIndicator from './components/TypingIndicator/TypingIndicator.story';
-export * as VoiceWidget from './components/VoiceWidget/VoiceWidget.story';
-export * as WelcomeMessage from './components/WelcomeMessage/WelcomeMessage.story';
diff --git a/packages/chat/src/storybook/decorators.tsx b/packages/chat/src/storybook/decorators.tsx
deleted file mode 100644
index 4357ad2239..0000000000
--- a/packages/chat/src/storybook/decorators.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import { assignInlineVars } from '@vanilla-extract/dynamic';
-
-import { DEFAULT_WIDGET_SETTINGS } from '@/__fixtures__/mock-assistant';
-import { RuntimeProvider } from '@/contexts';
-import { RenderMode } from '@/dtos/RenderOptions.dto';
-import { createPalette } from '@/styles/colors';
-import { THEME } from '@/styles/colors.css';
-
-export const WithDefaultPalette = (Story: any, { args }: { args: any }) => {
- return (
-
-
-
- );
-};
-
-export const WithRuntimeProvider = (Story: any) => (
-
- {Story()}
-
-);
diff --git a/packages/chat/src/styles.css b/packages/chat/src/styles.css
deleted file mode 100644
index 2c052ecd53..0000000000
--- a/packages/chat/src/styles.css
+++ /dev/null
@@ -1,345 +0,0 @@
-/* use this file to override default styles when forking this repository */
-
-/*
- PAGE CONTENTS
-
- Customize the page that the chat bubble lives on
-*/
-
-/* .voiceflow-chat {} */
-
-/* .vfrc-launcher {} */
-
-/* .vfrc-chat--overlay {} */
-
-/* .vfrc-prompt {} */
-
-/*
- CHAT WIDGET HEADER
-
- Customize the content, controls and styling included in your chat widget header, including the Assistant Information.
- Note that changes to the assistant information here will be shared across other elements that consume this styling.
-*/
-
-/* .vfrc-header {} */
-
-/* .vfrc-assistant-info {} */
-
-/* .vfrc-assistant-info--title {} */
-
-/* .vfrc-assistant-info--description {} */
-
-/* .vfrc-avatar {} */
-
-/* .vfrc-icon {} */
-
-/*
- CHAT MESSAGE BODY
-
- Customize the layout and display of the chat body, and the conversation's metadata
-*/
-
-/* .vfrc-chat {} */
-
-/* .vfrc-chat--dialog {} */
-
-/* .vfrc-chat--spacer {} */
-
-/* .vfrc-chat--session-time {} */
-
-/* .vfrc-chat--status {} */
-
-/* .vfrc-message {} */
-
-/* .vfrc-timestamp {} */
-
-/*
- ASSISTANT RESPONSES
-
- Customize the style and layout of assistant response messages.
-*/
-
-/* .vfrc-system-response--indicator {} */
-
-/* .vfrc-system-response {} */
-
-/* .vfrc-system-response--controls {} */
-
-/* .vfrc-system-response--list {} */
-
-/* .vfrc-system-response--actions {} */
-
-/* .vfrc-button {} */
-
-/* .vfrc-image {} */
-
-/* .vfrc-image--background {} */
-
-/* .vfrc-card--content {} */
-
-/* .vfrc-card--header {} */
-
-/* .vfrc-card--description {} */
-
-/* .vfrc-carousel {} */
-
-/* .vfrc-carousel--button {} */
-
-/* Targeted styling for just the Assistant messages. */
-/* .vfrc-system-response .vfrc-message {} */
-
-/* Targeted styling for just the Assistant buttons. */
-/* .vfrc-system-response .vfrc-button {} */
-
-/*
- USER RESPONSES
-
- Customize the style and layout of users response messages.
-*/
-
-/* .vfrc-user-response {} */
-
-/* Targeted styling for just the User messages */
-/* .vfrc-user-response .vfrc-message {} */
-
-/*
- FOOTER
-
- Customize the layout and appearance of the message input field and the VF Branding
-*/
-
-/* .vf-footer {} */
-
-/* .vfrc-input {} */
-
-/* .vfrc-chat-input--button {} */
-
-/* .vfrc-footer--watermark {} */
-/* use this file to override default styles when forking this repository */
-
-/*
- PAGE CONTENTS
-
- Customize the page that the chat bubble lives on
-*/
-
-/* .voiceflow-chat {} */
-
-/* .vfrc-launcher {} */
-
-/* .vfrc-chat--overlay {} */
-
-/* .vfrc-prompt {} */
-
-/*
- CHAT WIDGET HEADER
-
- Customize the content, controls and styling included in your chat widget header, including the Assistant Information.
- Note that changes to the assistant information here will be shared across other elements that consume this styling.
-*/
-
-/* .vfrc-header {} */
-
-/* .vfrc-assistant-info {} */
-
-/* .vfrc-assistant-info--title {} */
-
-/* .vfrc-assistant-info--description {} */
-
-/* .vfrc-avatar {} */
-
-/* .vfrc-icon {} */
-
-/*
- CHAT MESSAGE BODY
-
- Customize the layout and display of the chat body, and the conversation's metadata
-*/
-
-/* .vfrc-chat {} */
-
-/* .vfrc-chat--dialog {} */
-
-/* .vfrc-chat--spacer {} */
-
-/* .vfrc-chat--session-time {} */
-
-/* .vfrc-chat--status {} */
-
-/* .vfrc-message {} */
-
-/* .vfrc-timestamp {} */
-
-/*
- ASSISTANT RESPONSES
-
- Customize the style and layout of assistant response messages.
-*/
-
-/* .vfrc-system-response--indicator {} */
-
-/* .vfrc-system-response {} */
-
-/* .vfrc-system-response--controls {} */
-
-/* .vfrc-system-response--list {} */
-
-/* .vfrc-system-response--actions {} */
-
-/* .vfrc-button {} */
-
-/* .vfrc-image {} */
-
-/* .vfrc-image--background {} */
-
-/* .vfrc-card--content {} */
-
-/* .vfrc-card--header {} */
-
-/* .vfrc-card--description {} */
-
-/* .vfrc-carousel {} */
-
-/* .vfrc-carousel--button {} */
-
-/* Targeted styling for just the Assistant messages. */
-/* .vfrc-system-response .vfrc-message {} */
-
-/* Targeted styling for just the Assistant buttons. */
-/* .vfrc-system-response .vfrc-button {} */
-
-/*
- USER RESPONSES
-
- Customize the style and layout of users response messages.
-*/
-
-/* .vfrc-user-response {} */
-
-/* Targeted styling for just the User messages */
-/* .vfrc-user-response .vfrc-message {} */
-
-/*
- FOOTER
-
- Customize the layout and appearance of the message input field and the VF Branding
-*/
-
-/* .vf-footer {} */
-
-/* .vfrc-input {} */
-
-/* .vfrc-chat-input--button {} */
-
-/* .vfrc-footer--watermark {} */
-/* Heading styles */
-.markdown h1,
-.markdown h2,
-.markdown h3,
-.markdown h4,
-.markdown h5,
-.markdown h6 {
- margin-bottom: 8px;
- margin-top: 8px;
- font-size: 16px;
- font-weight: 700;
-}
-
-.markdown h2,
-.markdown h3,
-.markdown h4,
-.markdown h5,
-.markdown h6 {
- font-size: 14px;
-}
-
-/* Horizontal rule style */
-.markdown hr {
- margin-top: 8px;
- margin-bottom: 8px;
-}
-
-/* Ordered list styles */
-.markdown ol {
- display: block;
- list-style-type: decimal;
- margin-block-start: 0px;
- margin-block-end: 0px;
- margin-inline-start: 0px;
- margin-inline-end: 0px;
- padding-inline-start: 20px;
- unicode-bidi: isolate;
-}
-
-/* Unordered list styles */
-.markdown ul {
- list-style-type: disc;
- padding-inline-start: 27px;
- margin-block-start: 0px;
- margin-block-end: 0px;
- margin-inline-start: 0px;
- margin-inline-end: 0px;
- unicode-bidi: isolate;
- position: relative;
-}
-
-/* Custom list marker styles */
-.markdown ul li::marker {
- content: '';
-}
-
-.markdown ul li::before {
- content: '';
- height: 4px;
- width: 4px;
- background-color: #1a1e23; /* colors.neutralDark.neutralsDark900 */
- border-radius: 50%;
- position: absolute;
- transform: translate(-14px, 7px);
-}
-
-/* Task list item */
-.markdown .task-list-item {
- display: flex;
- align-items: flex-start;
-}
-
-/* Checkbox styling */
-.markdown input[type='checkbox'] {
- transform: translateY(3px);
- margin-right: 8px;
-}
-
-/* List item styles */
-.markdown li {
- margin: 8px 0;
- position: relative;
-}
-
-.markdown ol {
- margin-left: 8px;
-}
-
-/* Paragraphs within list items */
-.markdown li p {
- line-height: 1.5;
-}
-
-/* Anchor link styles */
-.markdown a {
- transition:
- color 0.3s ease,
- text-decoration-color 0.3s ease;
- color: #397dff;
- text-decoration: underline;
- text-decoration-color: transparent;
-}
-
-.markdown a:hover {
- text-decoration-color: #397dff;
-}
-
-.markdown a:active {
- color: #2f68db; /* colors.accent.accent600 */
- text-decoration-color: transparent;
-}
diff --git a/packages/chat/src/styles/animation-utils.css.ts b/packages/chat/src/styles/animation-utils.css.ts
deleted file mode 100644
index 0d0a7a5372..0000000000
--- a/packages/chat/src/styles/animation-utils.css.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { keyframes, style } from '@vanilla-extract/css';
-
-import { duration } from './animations';
-
-const fadeIn = keyframes({
- '0%': { opacity: 0, transform: 'translateY(20px)' },
- '100%': { opacity: 1, transform: 'translateY(0)' },
-});
-
-export const fadeInAndUp = style({
- opacity: 0,
- animation: `${fadeIn} ${duration.slow} ease-out forwards`,
-});
diff --git a/packages/chat/src/styles/animations.ts b/packages/chat/src/styles/animations.ts
deleted file mode 100644
index 4817788770..0000000000
--- a/packages/chat/src/styles/animations.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-export const duration = {
- slow: '0.5s',
- mid: '0.3s',
- default: '0.15s',
- fast: '0.08s',
- fastest: '0.05s',
-};
-
-export const timingFunction = {
- default: 'ease',
- easeOut: 'ease-out',
- easeIn: 'ease-in',
- linear: 'linear',
- gentle: 'cubic-bezier(0.25, 1, 0.5, 1)',
-};
-
-export const delay = {
- initial: 0.04,
- increment: 0.03,
-};
-
-export const componentAnimations = {
- widgetAppearance: {
- transform: '0.3s',
- opacity: duration.default,
- },
- endChat: {
- transform: '0.25s',
- opacity: duration.fast,
- boxShadow: duration.slow,
- },
- welcomeMessage: {
- duration: '0.6s',
- delays: {
- avatar: '0.25s',
- title: '0.35s',
- description: '0.45s',
- },
- },
-};
diff --git a/packages/chat/src/styles/box-shadows.ts b/packages/chat/src/styles/box-shadows.ts
deleted file mode 100644
index 59ef3adf8f..0000000000
--- a/packages/chat/src/styles/box-shadows.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-const Z1_Light =
- '0px 1px 0px 0px rgba(22, 26, 30, 0.02), 0px 0px 0px 1px rgba(22, 26, 30, 0.04), 0px 1px 5px -4px rgba(22, 26, 30, 0.08), 0px 4px 8px -6px rgba(22, 26, 30, 0.08), 0px 1px 3px 1px rgba(22, 26, 30, 0.01)';
-
-const Z64_Light =
- '0px 0px 0px 1px rgba(22, 26, 30, 0.06), 0px 48px 88px -40px rgba(22, 26, 30, 0.16), 0px 36px 56px -40px rgba(22, 26, 30, 0.12), 0px 24px 40px -40px rgba(22, 26, 30, 0.08), 0px 20px 32px -40px rgba(22, 26, 30, 0.06), 0px 16px 28px -40px rgba(22, 26, 30, 0.06), 0px 12px 20px -40px rgba(22, 26, 30, 0.04), 0px 1px 2px 0px rgba(22, 26, 30, 0.03)';
-
-const Z16_Light =
- '0px 0px 0px 1px rgba(22, 26, 30, 0.06), 0px 1px 1px 0px rgba(22, 26, 30, 0.01), 0px 4px 8px -18px rgba(22, 26, 30, 0.04), 0px 8px 12px -18px rgba(22, 26, 30, 0.04), 0px 10px 16px -18px rgba(22, 26, 30, 0.08), 0px 12px 20px -18px rgba(22, 26, 30, 0.08), 0px 16px 28px -18px rgba(22, 26, 30, 0.12), 0px 20px 44px -18px rgba(22, 26, 30, 0.12)';
-
-const Z32_Light =
- '0px 0px 0px 1px rgba(22, 26, 30, 0.06), 0px 1px 1px 0px rgba(22, 26, 30, 0.04), 0px 4px 8px -32px rgba(22, 26, 30, 0.04), 0px 10px 16px -32px rgba(22, 26, 30, 0.06), 0px 16px 20px -32px rgba(22, 26, 30, 0.08), 0px 24px 32px -32px rgba(22, 26, 30, 0.08), 0px 32px 40px -32px rgba(22, 26, 30, 0.10), 0px 40px 64px -32px rgba(22, 26, 30, 0.12)';
-
-export const SHADOWS = {
- Z1_Light,
- Z16_Light,
- Z32_Light,
- Z64_Light,
-};
diff --git a/packages/chat/src/styles/colors.css.ts b/packages/chat/src/styles/colors.css.ts
deleted file mode 100644
index 203f385b2d..0000000000
--- a/packages/chat/src/styles/colors.css.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { createThemeContract } from '@vanilla-extract/css';
-
-import { createPalette } from './colors';
-import { FAMILY } from './font';
-
-export const THEME = createThemeContract({
- colors: createPalette(),
- fontFamily: FAMILY,
-});
diff --git a/packages/chat/src/styles/colors.ts b/packages/chat/src/styles/colors.ts
deleted file mode 100644
index 751681baf2..0000000000
--- a/packages/chat/src/styles/colors.ts
+++ /dev/null
@@ -1,205 +0,0 @@
-import chroma from 'chroma-js';
-
-export const DEFAULT_PRIMARY = '#387dff';
-
-export const createPalette = (baseColor: string = DEFAULT_PRIMARY) => {
- const [h, s] = chroma(baseColor).hsl();
-
- const shades = [];
-
- for (let i = 10; i >= 0; i--) {
- const newL = 10 * i === 100 ? 95 : 10 * i || 5;
- shades.push(chroma.hsl(h, s, newL / 100).hex());
- }
-
- return {
- 50: shades[0],
- 100: shades[1],
- 200: shades[2],
- 300: shades[3],
- 400: shades[4],
- 500: baseColor,
- 600: shades[6],
- 700: shades[7],
- 800: shades[8],
- 900: shades[9],
- };
-};
-
-const NEUTRAL_DARK = {
- 50: '#30373F',
- 100: '#656D75',
- 300: '#3E4852',
- 400: '#38414A',
- 500: '#30373F',
- 200: '#515A63',
- 600: '#2B3239',
- 700: '#252B31',
- 800: '#1F2429',
- 900: '#1A1E23',
- 9006: '#191D220F',
- 9008: '#191d2214',
- 90012: '#1A1E231F',
- 90016: '#1A1E2329',
- 90020: '#1A1E2333',
-};
-
-const FERN = {
- 50: '#E0F0E3',
- 100: '#CFE9D4',
- 200: '#B2DCB9',
- 300: '#9CD2A5',
- 400: '#70BF7D',
- 500: '#56B365',
- 600: '#4A9B57',
- 700: '#387642',
- 800: '#27542E',
- 900: '#17341C',
- // with opacity
- 900_80: '#17341CCC',
- 900_12: '#17341C1F',
- 900_8: '#17341C14',
-};
-
-const COPPER = {
- 50: '#F8EBE8',
- 100: '#F5E0DC',
- 200: '#F0CDC7',
- 300: '#ECBFB7',
- 400: '#E4A398',
- 500: '#DC8879',
- 600: '#BE7466',
- 700: '#92564B',
- 800: '#683A31',
- 900: '#431F19',
- // with opacity
- 900_80: '#431F19CC',
- 900_12: '#431F191F',
- 900_8: '#431F1914',
-};
-
-const CYCLAMEN = {
- 50: '#FCE5F0',
- 100: '#FBDAEA',
- 200: '#FAC7DF',
- 300: '#F8ACD0',
- 400: '#F587BB',
- 500: '#F263A7',
- 600: '#D6528A',
- 700: '#B63A65',
- 800: '#922240',
- 900: '#630B19',
- // with opacity
- 900_80: '#630B19CC',
- 900_12: '#630B191F',
- 900_8: '#630B1914',
-};
-
-const HAVELOCK = {
- 50: '#E3EFF8',
- 100: '#D3E5F4',
- 200: '#C3DCF0',
- 300: '#A8CCE9',
- 400: '#81B5E0',
- 500: '#5B9FD7',
- 600: '#4E8BBD',
- 700: '#3A6B93',
- 800: '#284D6C',
- 900: '#152F45',
- // with opacity
- 900_80: '#152F45CC',
- 900_12: '#152F451F',
- 900_8: '#152F4514',
-};
-
-const HIBISCUS = {
- 50: '#FEE7EC',
- 100: '#FCD4DE',
- 200: '#F8B9C8',
- 300: '#F39BB0',
- 400: '#E08097',
- 500: '#CB627B',
- 600: '#BD425F',
- 700: '#9F324C',
- 800: '#7B2338',
- 900: '#561524',
- // with opacity
- 900_80: '#561524CC',
- 900_12: '#5615241F',
- 900_8: '#56152414',
-};
-
-const NEUTRAL_LIGHT = {
- 50: '#F1F2F2',
- 100: '#E2E4E5',
- 200: '#D4D7D7',
- 300: '#C5C9CA',
- 400: '#B7BCBD',
- 500: '#A8AFB0',
- 600: '#9AA1A3',
- 700: '#8B9495',
- 800: '#7D8688',
- 900: '#6E797B',
-};
-
-const ACCENT = {
- 50: '#E7F5FD',
- 100: '#C6E4FB',
- 200: '#A2D2FA',
- 300: '#87BFFB',
- 400: '#659FFD',
- 500: '#397DFF',
- 600: '#2F68DB',
- 700: '#264EB4',
- 800: '#1C368E',
- 900: '#0F1E61',
-};
-
-const ALERT = {
- 50: '#FCEBEF',
- 100: '#FAE0E5',
- 200: '#F7CED7',
- 300: '#F1ABB9',
- 400: '#EC889C',
- 500: '#E6657F',
- 600: '#DD4160',
- 700: '#C62445',
- 800: '#A01C37',
- 900: '#741528',
-};
-
-const SUCCESS = {
- 50: '#E7F6E2',
- 100: '#CAE9BE',
- 200: '#A8DB94',
- 300: '#8ACD6F',
- 400: '#68BE46',
- 500: '#50A82E',
- 600: '#449127',
- 700: '#38751F',
- 800: '#285417',
- 900: '#1A390F',
-};
-
-const SHADES = {
- 50: '#F2F7F7',
- 100: '#EEF3F3',
- 200: '#E8ECEC',
- 300: '#E2E6E6',
- 400: '#DBDEDE',
-};
-
-export const COLORS = {
- white: '#fff',
- NEUTRAL_DARK,
- FERN,
- COPPER,
- CYCLAMEN,
- HAVELOCK,
- HIBISCUS,
- NEUTRAL_LIGHT,
- ACCENT,
- ALERT,
- SUCCESS,
- SHADES,
-};
diff --git a/packages/chat/src/styles/font.ts b/packages/chat/src/styles/font.ts
deleted file mode 100644
index df7521b58f..0000000000
--- a/packages/chat/src/styles/font.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import type { ComplexStyleRule } from '@vanilla-extract/css';
-
-export const FAMILY = "'UCityProWeb', 'Open Sans', 'Arial', 'sans-serif'";
-
-export const hideTextOverflow = () => ({
- overflow: 'hidden',
- textOverflow: 'ellipsis',
- whiteSpace: 'nowrap',
-});
-
-export const lineClamp = (lines: number) =>
- ({
- WebkitLineClamp: lines,
- WebkitBoxOrient: 'vertical',
- display: '-webkit-box',
- overflow: 'hidden',
- textOverflow: 'ellipsis',
- }) as ComplexStyleRule;
diff --git a/packages/chat/src/styles/shadow.ts b/packages/chat/src/styles/shadow.ts
deleted file mode 100644
index 4ab2370fed..0000000000
--- a/packages/chat/src/styles/shadow.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-// create shadow dom
-export const VOICEFLOW_ID = 'voiceflow-chat';
-
-const rootEl = document.createElement('div');
-rootEl.id = VOICEFLOW_ID;
-
-document.body.appendChild(rootEl);
-export const shadowRoot = rootEl.attachShadow({ mode: 'open' });
diff --git a/packages/chat/src/styles/sizes.ts b/packages/chat/src/styles/sizes.ts
deleted file mode 100644
index e63ba7ca20..0000000000
--- a/packages/chat/src/styles/sizes.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-export const SIZES = {
- sm: '32px',
- m: '40px',
- xxl: '72px',
-
- radius: {
- xxxs: '4px',
- xxs: '6px',
- xs: '8px',
- sm: '10px',
- lg: '16px',
- round: '50%',
- },
-};
-
-export const BREAKPOINTS = {
- mobile: '768px',
-};
diff --git a/packages/chat/src/styles/transitions.ts b/packages/chat/src/styles/transitions.ts
deleted file mode 100644
index a31b9c2171..0000000000
--- a/packages/chat/src/styles/transitions.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { duration, timingFunction } from './animations';
-
-export interface TransitionOptions {
- duration: string;
- timingFunction: string;
-}
-
-export const createTransition =
- ({ duration: defaultDuration, timingFunction: defaultTimingFunction }: TransitionOptions) =>
- (
- properties: ReadonlyArray,
- { duration = defaultDuration, timingFunction = defaultTimingFunction }: Partial = {}
- ) =>
- properties.map((prop) => `${prop} ${duration} ${timingFunction}`).join(', ');
-
-export const transition = createTransition({
- duration: duration.default,
- timingFunction: timingFunction.default,
-});
diff --git a/packages/chat/src/types/index.ts b/packages/chat/src/types/index.ts
deleted file mode 100644
index 26e6175b15..0000000000
--- a/packages/chat/src/types/index.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import type { $$StyledComponentProps } from '@voiceflow/stitches-react/types/styled-component';
-export * from './session';
-export * from './settings';
-export * from './trace';
-export * from './turn';
-export * from './util';
-export * from './variants';
-export { ChatPersistence, ChatPosition } from '@voiceflow/voiceflow-types/build/cjs/version/chat';
-
-export type Nullish = T | null | undefined;
-
-export type VariantProp<
- Component extends { [key: symbol | string]: any },
- Key extends keyof Component[$$StyledComponentProps],
-> = Component[$$StyledComponentProps][Key];
diff --git a/packages/chat/src/types/session.ts b/packages/chat/src/types/session.ts
deleted file mode 100644
index 4e79f980a8..0000000000
--- a/packages/chat/src/types/session.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import type { BaseRequest } from '@voiceflow/dtos-interact';
-import type { RuntimeAction } from '@voiceflow/sdk-runtime';
-import { ChatPersistence, ChatPosition } from '@voiceflow/voiceflow-types/build/cjs/version/chat';
-
-import type { TurnProps } from './turn';
-
-export { ChatPersistence, ChatPosition };
-export type { RuntimeAction };
-
-export type SendMessage = (action: BaseRequest, message?: string) => Promise;
-
-export enum SessionStatus {
- IDLE = 'IDLE',
- ACTIVE = 'ACTIVE',
- ENDED = 'ENDED',
-}
-
-export interface SessionOptions {
- userID: string;
- turns?: TurnProps[];
- startTime?: number;
- status?: SessionStatus;
-}
diff --git a/packages/chat/src/types/settings.ts b/packages/chat/src/types/settings.ts
deleted file mode 100644
index 53425c9137..0000000000
--- a/packages/chat/src/types/settings.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import type {
- WidgetSettings,
- WidgetSettingsChatSettingsDTO,
- WidgetSettingsCommonSettingsDTO,
- WidgetSettingsDTO,
- WidgetSettingsVoiceSettingsDTO,
-} from '@voiceflow/dtos-interact';
-import type { z } from 'zod';
-
-import type { AnyExtension } from '@/main';
-
-export type RawWidgetSettings = z.input;
-export type RawWidgetSettingsChatSettings = z.input;
-export type RawWidgetSettingsVoiceSettings = z.input;
-export type RawWidgetSettingsCommonSettings = z.input;
-
-export interface WidgetLocalSettings {
- stylesheet: string;
- extensions: AnyExtension[];
-}
-
-export interface ChatWidgetSettings extends WidgetSettings, WidgetLocalSettings {}
diff --git a/packages/chat/src/types/trace.ts b/packages/chat/src/types/trace.ts
deleted file mode 100644
index 733e630b5c..0000000000
--- a/packages/chat/src/types/trace.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import type { Trace } from '@voiceflow/base-types';
-import type { TraceDeclaration } from '@voiceflow/sdk-runtime';
-
-import type { RuntimeMessage } from '../contexts/RuntimeContext/messages';
-
-export type TraceHandler = TraceDeclaration;
diff --git a/packages/chat/src/types/turn.ts b/packages/chat/src/types/turn.ts
deleted file mode 100644
index 8e1ff154c8..0000000000
--- a/packages/chat/src/types/turn.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import type { SystemResponseProps } from '@/components/SystemResponse';
-import type { UserResponseProps } from '@/components/UserResponse';
-
-export enum TurnType {
- USER = 'user',
- SYSTEM = 'system',
-}
-
-export interface UserTurnProps extends UserResponseProps {
- id: string;
- type: TurnType.USER;
-}
-
-export interface SystemTurnProps extends Omit {
- id: string;
- type: TurnType.SYSTEM;
- timestamp: number;
-}
-
-export type TurnProps = UserTurnProps | SystemTurnProps;
diff --git a/packages/chat/src/types/util.ts b/packages/chat/src/types/util.ts
deleted file mode 100644
index fa2a98dcf5..0000000000
--- a/packages/chat/src/types/util.ts
+++ /dev/null
@@ -1 +0,0 @@
-export type StringifiedEnum = T | `${T}`;
diff --git a/packages/chat/src/types/variants.ts b/packages/chat/src/types/variants.ts
deleted file mode 100644
index 2650561685..0000000000
--- a/packages/chat/src/types/variants.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import type { ComplexStyleRule } from '@vanilla-extract/css';
-import type { RecipeVariants, RuntimeFn } from '@vanilla-extract/recipes';
-import type { Simplify } from 'type-fest';
-
-export type VariantStyleRules = Record>;
-
-export type VariantProps