app-tutor-ai-consumer 1.27.4 → 1.27.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/package.json +1 -2
- package/src/development-bootstrap.tsx +2 -1
- package/src/modules/messages/components/message-item/message-item.tsx +9 -9
- package/src/modules/widget/components/avatar-animation/avatar-animation.tsx +2 -4
- package/src/modules/widget/components/starter-page/starter-page.spec.tsx +6 -0
- package/src/modules/widget/components/starter-page/starter-page.tsx +12 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## [1.27.6](https://github.com/Hotmart-Org/app-tutor-ai-consumer/compare/v1.27.5...v1.27.6) (2025-08-19)
|
|
2
|
+
|
|
3
|
+
## [1.27.5](https://github.com/Hotmart-Org/app-tutor-ai-consumer/compare/v1.27.4...v1.27.5) (2025-08-18)
|
|
4
|
+
|
|
1
5
|
## [1.27.4](https://github.com/Hotmart-Org/app-tutor-ai-consumer/compare/v1.27.3...v1.27.4) (2025-08-14)
|
|
2
6
|
|
|
3
7
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "app-tutor-ai-consumer",
|
|
3
|
-
"version": "1.27.
|
|
3
|
+
"version": "1.27.6",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "rspack serve --env=development --config config/rspack/rspack.config.js",
|
|
@@ -110,7 +110,6 @@
|
|
|
110
110
|
"@hotmart-org-ca/hot-observability-js": "~1.1.0",
|
|
111
111
|
"@hotmart/event-agent-js": "~1.1.2",
|
|
112
112
|
"@hotmart/sparkie": "~5.1.0",
|
|
113
|
-
"@lottiefiles/dotlottie-react": "~0.14.4",
|
|
114
113
|
"@optimizely/react-sdk": "~3.2.4",
|
|
115
114
|
"@tanstack/query-sync-storage-persister": "~5.80.7",
|
|
116
115
|
"@tanstack/react-query": "~5.80.6",
|
|
@@ -9,6 +9,8 @@ function MessageItem({ message }: { message: ParsedMessage }) {
|
|
|
9
9
|
const messageFromAi = message.metadata.author === 'ai'
|
|
10
10
|
const isMediaVoice = message.type === 'media/voice'
|
|
11
11
|
|
|
12
|
+
if (messageFromAi && isMediaVoice) return null
|
|
13
|
+
|
|
12
14
|
return (
|
|
13
15
|
<div
|
|
14
16
|
className={clsx(
|
|
@@ -25,15 +27,13 @@ function MessageItem({ message }: { message: ParsedMessage }) {
|
|
|
25
27
|
})}>
|
|
26
28
|
<MessageContentTypeRenderer message={message} />
|
|
27
29
|
</div>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/>
|
|
36
|
-
)}
|
|
30
|
+
<MessageActions
|
|
31
|
+
className={clsx('flex items-center justify-between gap-2', {
|
|
32
|
+
'w-full': messageFromAi
|
|
33
|
+
})}
|
|
34
|
+
message={message}
|
|
35
|
+
showActions={messageFromAi}
|
|
36
|
+
/>
|
|
37
37
|
</div>
|
|
38
38
|
)
|
|
39
39
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const AVATAR_ANIMATION_URL = `${process.env.STATIC_URL}/tutor/tutor_sparkle.lottie`
|
|
1
|
+
const AVATAR_ANIMATION_URL = `${process.env.STATIC_URL}/tutor/web/tutor_sparkle.gif`
|
|
4
2
|
|
|
5
3
|
const AvatarAnimation = () => {
|
|
6
4
|
return (
|
|
7
5
|
<div className='flex h-11 w-11 items-center justify-center rounded-lg bg-neutral-300'>
|
|
8
|
-
<
|
|
6
|
+
<img src={AVATAR_ANIMATION_URL} alt='' aria-hidden className='max-w-[70%]' loading='lazy' />
|
|
9
7
|
</div>
|
|
10
8
|
)
|
|
11
9
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { useDecision } from '@optimizely/react-sdk'
|
|
2
|
+
|
|
1
3
|
import { render, screen } from '@/src/config/tests'
|
|
2
4
|
import { useSendTextMessage } from '@/src/modules/messages/hooks'
|
|
3
5
|
|
|
@@ -12,13 +14,17 @@ vi.mock('@/src/modules/sparkie/hooks/use-init-sparkie', () => ({
|
|
|
12
14
|
useInitSparkie: vi.fn(() => true)
|
|
13
15
|
}))
|
|
14
16
|
|
|
17
|
+
vi.mock('@optimizely/react-sdk')
|
|
18
|
+
|
|
15
19
|
describe('WidgetStarterPage', () => {
|
|
16
20
|
const useSendTextMessageMock = { mutate: vi.fn() }
|
|
21
|
+
const useDecisionMock = [{ enabled: true, variables: { show_quick_actions: true } }]
|
|
17
22
|
|
|
18
23
|
const renderComponent = () => render(<WidgetStarterPage />)
|
|
19
24
|
|
|
20
25
|
beforeEach(() => {
|
|
21
26
|
vi.mocked(useSendTextMessage).mockReturnValue(useSendTextMessageMock as never)
|
|
27
|
+
vi.mocked(useDecision).mockReturnValue(useDecisionMock as never)
|
|
22
28
|
})
|
|
23
29
|
|
|
24
30
|
it('should render without errors', () => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useEffect, useMemo, useRef } from 'react'
|
|
2
|
+
import { useDecision } from '@optimizely/react-sdk'
|
|
2
3
|
import { useQueryClient } from '@tanstack/react-query'
|
|
3
4
|
import { useTranslation } from 'react-i18next'
|
|
4
5
|
|
|
@@ -29,6 +30,7 @@ function WidgetStarterPage() {
|
|
|
29
30
|
const isSparkieReady = useInitSparkie()
|
|
30
31
|
const isMobile = useMediaQuery({ maxSize: 'md' })
|
|
31
32
|
const widgetLoading = useWidgetLoadingAtomValue()
|
|
33
|
+
const [newTutorWidgetFF] = useDecision('lex_new_tutor_widget')
|
|
32
34
|
|
|
33
35
|
useRefEventListener<HTMLTextAreaElement>({
|
|
34
36
|
config: {
|
|
@@ -84,7 +86,8 @@ function WidgetStarterPage() {
|
|
|
84
86
|
name='new-chat-msg-input'
|
|
85
87
|
ref={chatInputRef}
|
|
86
88
|
onSend={handleSend}
|
|
87
|
-
buttonDisabled={widgetLoading || !chatInputValue.trim()
|
|
89
|
+
buttonDisabled={widgetLoading || !chatInputValue.trim()}
|
|
90
|
+
loading={!isSparkieReady}
|
|
88
91
|
/>
|
|
89
92
|
}>
|
|
90
93
|
<div className='grid-areas-[a_b] grid h-full grid-cols-1 grid-rows-[1fr_auto]'>
|
|
@@ -103,12 +106,14 @@ function WidgetStarterPage() {
|
|
|
103
106
|
/>
|
|
104
107
|
</div>
|
|
105
108
|
</div>
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
{newTutorWidgetFF?.enabled && newTutorWidgetFF?.variables?.['show_quick_actions'] ? (
|
|
110
|
+
<QuickActionButtons
|
|
111
|
+
className='grid-area-[b] my-4 flex flex-shrink-0 snap-x snap-mandatory gap-2 overflow-x-auto whitespace-nowrap [scrollbar-width:none] [&::-webkit-scrollbar]:hidden'
|
|
112
|
+
isDarkTheme={isDarkTheme}
|
|
113
|
+
send={sendText}
|
|
114
|
+
loading={!isSparkieReady}
|
|
115
|
+
/>
|
|
116
|
+
) : null}
|
|
112
117
|
</div>
|
|
113
118
|
</PageLayout>
|
|
114
119
|
)
|