app-tutor-ai-consumer 1.17.0 → 1.18.0

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 CHANGED
@@ -1,3 +1,10 @@
1
+ # [1.18.0](https://github.com/Hotmart-Org/app-tutor-ai-consumer/compare/v1.17.0...v1.18.0) (2025-07-24)
2
+
3
+ ### Features
4
+
5
+ - add info button onclick ([84dda83](https://github.com/Hotmart-Org/app-tutor-ai-consumer/commit/84dda83f12399fc785fecae8927a1404cb1d2dae))
6
+ - add information page ([20996ab](https://github.com/Hotmart-Org/app-tutor-ai-consumer/commit/20996ab224d07e6a44cf27037f7b35b7373aa307))
7
+
1
8
  # [1.17.0](https://github.com/Hotmart-Org/app-tutor-ai-consumer/compare/v1.16.0...v1.17.0) (2025-07-22)
2
9
 
3
10
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "app-tutor-ai-consumer",
3
- "version": "1.17.0",
3
+ "version": "1.18.0",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "dev": "rspack serve --env=development --config config/rspack/rspack.config.js",
@@ -0,0 +1,14 @@
1
+ <svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_18455_21368)">
3
+ <path d="M15.75 14.2358H4.5C4.08579 14.2358 3.75 14.5716 3.75 14.9858C3.75 15.4001 4.08579 15.7358 4.5 15.7358H15.75V17.2358H4.5C3.25736 17.2358 2.25 16.2285 2.25 14.9858V3.73584C2.25 2.90741 2.92157 2.23584 3.75 2.23584H15.75V14.2358ZM3.75 12.7733C3.87117 12.7487 3.99658 12.7358 4.125 12.7358H14.25V3.73584H3.75V12.7733ZM12 7.48584H6V5.98584H12V7.48584Z" fill="url(#paint0_linear_18455_21368)"/>
4
+ </g>
5
+ <defs>
6
+ <linearGradient id="paint0_linear_18455_21368" x1="2.25" y1="9.73584" x2="15.75" y2="9.73584" gradientUnits="userSpaceOnUse">
7
+ <stop stop-color="#44D0FF"/>
8
+ <stop offset="1" stop-color="#B48EFF"/>
9
+ </linearGradient>
10
+ <clipPath id="clip0_18455_21368">
11
+ <rect width="18" height="18" fill="white" transform="translate(0 0.73584)"/>
12
+ </clipPath>
13
+ </defs>
14
+ </svg>
@@ -9,3 +9,6 @@ export type ValidIconNames =
9
9
  | 'info'
10
10
  | 'send'
11
11
  | 'stop'
12
+ | 'warning'
13
+ | 'interrogation'
14
+ | 'book'
@@ -0,0 +1,9 @@
1
+ <svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M8 0.73584C3.5625 0.73584 0 4.32959 0 8.73584C0 13.1733 3.5625 16.7358 8 16.7358C12.4062 16.7358 16 13.1733 16 8.73584C16 4.32959 12.4062 0.73584 8 0.73584ZM8 15.7358C4.125 15.7358 1 12.6108 1 8.73584C1 4.89209 4.125 1.73584 8 1.73584C11.8438 1.73584 15 4.89209 15 8.73584C15 12.6108 11.8438 15.7358 8 15.7358ZM7.5 11.4858C7.0625 11.4858 6.75 11.8296 6.75 12.2358C6.75 12.6733 7.0625 12.9858 7.5 12.9858C7.90625 12.9858 8.25 12.6733 8.25 12.2358C8.25 11.8296 7.90625 11.4858 7.5 11.4858ZM8.90625 4.73584H7.0625C5.90625 4.73584 5 5.67334 5 6.82959V7.11084C5 7.39209 5.21875 7.61084 5.5 7.61084C5.75 7.61084 6 7.39209 6 7.11084V6.82959C6 6.23584 6.46875 5.73584 7.0625 5.73584H8.90625C9.5 5.73584 10 6.23584 10 6.82959C10 7.20459 9.78125 7.57959 9.4375 7.76709L7.5625 8.70459C7.21875 8.89209 7 9.26709 7 9.67334V10.2358C7 10.5171 7.21875 10.7358 7.5 10.7358C7.75 10.7358 8 10.5171 8 10.2358V9.67334C8 9.64209 8 9.61084 8.03125 9.57959L9.90625 8.64209C10.5625 8.26709 11 7.57959 11 6.82959C11 5.67334 10.0625 4.73584 8.90625 4.73584Z" fill="url(#paint0_linear_21475_7939)"/>
3
+ <defs>
4
+ <linearGradient id="paint0_linear_21475_7939" x1="0" y1="8.73584" x2="16" y2="8.73584" gradientUnits="userSpaceOnUse">
5
+ <stop stop-color="#44D0FF"/>
6
+ <stop offset="1" stop-color="#B48EFF"/>
7
+ </linearGradient>
8
+ </defs>
9
+ </svg>
@@ -0,0 +1,9 @@
1
+ <svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M8 11.3193C7.5625 11.3193 7.25 11.6631 7.25 12.0693C7.25 12.5068 7.59375 12.8193 8 12.8193C8.40625 12.8193 8.71875 12.5068 8.71875 12.0693C8.75 11.6631 8.40625 11.3193 8 11.3193ZM8 10.0693C8.25 10.0693 8.46875 9.85059 8.46875 9.56934V5.06934C8.46875 4.81934 8.21875 4.56934 8 4.56934C7.75 4.56934 7.5 4.81934 7.5 5.06934V9.56934C7.5 9.85059 7.71875 10.0693 8 10.0693ZM15.75 12.5068L9.5 1.94434C9.1875 1.41309 8.625 1.10059 8 1.06934C7.34375 1.06934 6.78125 1.41309 6.46875 1.94434L0.21875 12.5068C-0.09375 13.0381 -0.09375 13.6631 0.21875 14.1943C0.53125 14.7568 1.09375 15.0693 1.75 15.0693H14.25C14.875 15.0693 15.4375 14.7568 15.75 14.1943C16.0625 13.6631 16.0625 13.0381 15.75 12.5068ZM14.875 13.6943C14.75 13.9443 14.5 14.0693 14.2188 14.0693H1.75C1.46875 14.0693 1.21875 13.9443 1.09375 13.6943C0.9375 13.4756 0.96875 13.2256 1.09375 13.0068L7.34375 2.44434C7.46875 2.22559 7.71875 2.06934 8 2.06934C8.25 2.10059 8.5 2.22559 8.625 2.44434L14.875 13.0068C15 13.2256 15.0312 13.4756 14.875 13.6943Z" fill="url(#paint0_linear_21475_9749)"/>
3
+ <defs>
4
+ <linearGradient id="paint0_linear_21475_9749" x1="-0.015625" y1="8.06934" x2="15.9844" y2="8.06934" gradientUnits="userSpaceOnUse">
5
+ <stop stop-color="#44D0FF"/>
6
+ <stop offset="1" stop-color="#B48EFF"/>
7
+ </linearGradient>
8
+ </defs>
9
+ </svg>
@@ -1,4 +1,5 @@
1
1
  import { ChatPage } from './chat-page'
2
+ import { WidgetInformationPage } from './information-page'
2
3
  import { WidgetLoadingPage } from './loading-page'
3
4
  import { WidgetOnboardingPage } from './onboarding-page'
4
5
  import { WidgetStarterPage } from './starter-page'
@@ -7,5 +8,6 @@ export const WIDGET_TABS = {
7
8
  onboarding: <WidgetOnboardingPage />,
8
9
  starter: <WidgetStarterPage />,
9
10
  chat: <ChatPage />,
10
- loading: <WidgetLoadingPage />
11
+ loading: <WidgetLoadingPage />,
12
+ information: <WidgetInformationPage />
11
13
  }
@@ -1,5 +1,6 @@
1
1
  import { Button, Icon } from '@/src/lib/components'
2
2
  import { TutorWidgetEvents } from '../../events'
3
+ import { useWidgetTabsAtom } from '../../store'
3
4
  import { AIAvatar } from '../ai-avatar'
4
5
 
5
6
  import type { WidgetHeaderContentProps, WidgetHeaderProps } from './types'
@@ -36,6 +37,8 @@ function WidgetHeader({
36
37
  showContentWithoutMeta,
37
38
  showContent = true
38
39
  }: WidgetHeaderProps) {
40
+ const [, setWidgetTabs] = useWidgetTabsAtom()
41
+
39
42
  return (
40
43
  <div className='grid-areas-[a_b] mt-0.5 grid grid-cols-[1fr_auto] items-center text-neutral-1000'>
41
44
  <div className='grid-area-[a]'>
@@ -51,7 +54,10 @@ function WidgetHeader({
51
54
  <Button show={enabledButtons.includes('archive')} aria-label='Archive Icon'>
52
55
  <Icon name='archive' className='h-4 w-4' aria-hidden />
53
56
  </Button>
54
- <Button show={enabledButtons.includes('info')} aria-label='Info Icon'>
57
+ <Button
58
+ show={enabledButtons.includes('info')}
59
+ aria-label='Info Icon'
60
+ onClick={() => setWidgetTabs('information')}>
55
61
  <Icon name='info' className='h-4 w-4' aria-hidden />
56
62
  </Button>
57
63
  <Button
@@ -0,0 +1,17 @@
1
+ import type { ValidIconNames } from '@/src/lib/components/icons/icon-names'
2
+
3
+ type InfoItem = {
4
+ icon: ValidIconNames
5
+ titleKey: string
6
+ descKey: string
7
+ }
8
+
9
+ export const infoItems: InfoItem[] = [
10
+ {
11
+ icon: 'interrogation',
12
+ titleKey: 'info.what_it_does_question',
13
+ descKey: 'info.what_it_does_answer'
14
+ },
15
+ { icon: 'book', titleKey: 'info.how_it_learns_question', descKey: 'info.how_it_learns_answer' },
16
+ { icon: 'warning', titleKey: 'info.limitations_question', descKey: 'info.limitations_answer' }
17
+ ]
@@ -0,0 +1 @@
1
+ export { default as WidgetInformationPage } from './information-page'
@@ -0,0 +1 @@
1
+ export { default as InformationCard } from './information-card'
@@ -0,0 +1,25 @@
1
+ import { Icon } from '@/src/lib/components'
2
+ import type { ValidIconNames } from '@/src/lib/components/icons/icon-names'
3
+
4
+ export type InformationCardProps = {
5
+ icon: ValidIconNames
6
+ title: string
7
+ description: string
8
+ }
9
+
10
+ function InformationCard({ icon, title, description }: InformationCardProps) {
11
+ return (
12
+ <div className='flex gap-3 border-b border-white/10 pb-5 last:border-none'>
13
+ <div className='flex h-5 w-5 items-start justify-center'>
14
+ <Icon name={icon} width={16} height={16} />
15
+ </div>
16
+
17
+ <div className='flex flex-col gap-1'>
18
+ <p className='text-sm font-bold'>{title}</p>
19
+ <p className='text-xs text-gray-300'>{description}</p>
20
+ </div>
21
+ </div>
22
+ )
23
+ }
24
+
25
+ export default InformationCard
@@ -0,0 +1,50 @@
1
+ import { useTranslation } from 'react-i18next'
2
+
3
+ import { Icon } from '@/src/lib/components'
4
+ import { useWidgetSettingsAtom, useWidgetTabsAtom } from '../../store'
5
+ import { AIAvatar } from '../ai-avatar'
6
+ import { PageLayout } from '../page-layout'
7
+
8
+ import { infoItems } from './constants'
9
+ import { InformationCard } from './information-card'
10
+
11
+ function WidgetInformationPage() {
12
+ const { t } = useTranslation()
13
+ const [, setWidgetTabs] = useWidgetTabsAtom()
14
+ const [settings] = useWidgetSettingsAtom()
15
+
16
+ return (
17
+ <PageLayout className='p-5 text-white'>
18
+ <div className='relative mb-8 flex h-12 items-center justify-center'>
19
+ <button
20
+ className='absolute left-0'
21
+ aria-label='Return Button'
22
+ onClick={() => setWidgetTabs('chat')}>
23
+ <Icon name='arrow-left' width={16} height={16} />
24
+ </button>
25
+ <h1 className='mx-auto font-bold'>{t('info.title')}</h1>
26
+ </div>
27
+
28
+ <div className='mb-8 flex justify-center'>
29
+ <div className='flex flex-col items-center gap-2'>
30
+ <AIAvatar />
31
+
32
+ <h3 className='font-bold'>{settings?.tutorName ?? ''}</h3>
33
+ </div>
34
+ </div>
35
+
36
+ <div className='flex flex-col gap-5'>
37
+ {infoItems.map((item) => (
38
+ <InformationCard
39
+ key={item.titleKey}
40
+ icon={item.icon}
41
+ title={t(item.titleKey)}
42
+ description={t(item.descKey)}
43
+ />
44
+ ))}
45
+ </div>
46
+ </PageLayout>
47
+ )
48
+ }
49
+
50
+ export default WidgetInformationPage