app-tutor-ai-consumer 1.2.0 → 1.4.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 +23 -0
- package/config/vitest/__mocks__/sparkie.tsx +12 -0
- package/config/vitest/setupTests.ts +6 -1
- package/config/vitest/vitest.config.mts +1 -0
- package/environments/.env.test +2 -2
- package/package.json +12 -2
- package/public/assets/images/default-image.png +0 -0
- package/public/assets/svg/tutor-onboarding.svg +128 -0
- package/src/@types/declarations.d.ts +16 -6
- package/src/config/dayjs/index.ts +2 -0
- package/src/config/dayjs/init.ts +28 -0
- package/src/config/dayjs/utils/format-fulldate.ts +7 -0
- package/src/config/dayjs/utils/format-time.ts +20 -0
- package/src/config/dayjs/utils/index.ts +2 -0
- package/src/config/optimizely/optimizely-provider.tsx +3 -3
- package/src/config/optimizely/optimizely.ts +1 -1
- package/src/config/styles/global.css +20 -1
- package/src/config/styles/utilities/bg-utilities.module.css +11 -0
- package/src/config/styles/utilities/text-utilities.module.css +6 -0
- package/src/config/tanstack/query-provider.tsx +1 -1
- package/src/config/tests/handlers.ts +9 -0
- package/src/index.tsx +4 -0
- package/src/lib/components/button/button.tsx +86 -0
- package/src/lib/components/button/index.ts +1 -0
- package/src/lib/components/index.ts +2 -0
- package/src/lib/components/markdownrenderer/__tests__/markdown.stub.ts +334 -0
- package/src/lib/components/markdownrenderer/components/index.ts +1 -0
- package/src/lib/components/markdownrenderer/components/md-code-block/index.ts +1 -0
- package/src/lib/components/markdownrenderer/components/md-code-block/md-code-block.tsx +71 -0
- package/src/lib/components/markdownrenderer/index.ts +2 -0
- package/src/lib/components/markdownrenderer/markdownrenderer.tsx +115 -0
- package/src/lib/hooks/index.ts +1 -0
- package/src/lib/hooks/use-ref-event-listener/index.ts +2 -0
- package/src/lib/hooks/use-ref-event-listener/use-ref-event-listener.tsx +32 -0
- package/src/lib/utils/constants.ts +1 -1
- package/src/lib/utils/copy-text-to-clipboard.tsx +13 -0
- package/src/lib/utils/extract-text-from-react-nodes.ts +23 -0
- package/src/lib/utils/index.ts +3 -0
- package/src/lib/utils/urls.ts +20 -0
- package/src/main/main.spec.tsx +17 -7
- package/src/main/main.tsx +2 -13
- package/src/modules/messages/__tests__/imessage-with-sender-data.builder.ts +113 -0
- package/src/modules/messages/__tests__/imessage-with-sender-data.mock.ts +15 -0
- package/src/modules/messages/components/chat-input/chat-input.atom.ts +12 -0
- package/src/modules/{create-message → messages}/components/chat-input/chat-input.tsx +6 -2
- package/src/modules/{create-message → messages}/components/chat-input/index.ts +1 -0
- package/src/modules/{create-message → messages}/components/chat-input/types.ts +1 -0
- package/src/modules/messages/components/index.ts +4 -0
- package/src/modules/messages/components/message-img/index.ts +1 -0
- package/src/modules/messages/components/message-img/message-img.tsx +47 -0
- package/src/modules/messages/components/message-item/index.ts +2 -0
- package/src/modules/messages/components/message-item/message-item.spec.tsx +26 -0
- package/src/modules/messages/components/message-item/message-item.tsx +15 -0
- package/src/modules/messages/components/messages-list/index.ts +2 -0
- package/src/modules/messages/components/messages-list/messages-list.tsx +53 -0
- package/src/modules/messages/constants.ts +1 -0
- package/src/modules/messages/hooks/index.ts +1 -0
- package/src/modules/messages/hooks/use-fetch-messages/index.ts +2 -0
- package/src/modules/messages/hooks/use-fetch-messages/use-fetch-messages.spec.tsx +46 -0
- package/src/modules/messages/hooks/use-fetch-messages/use-fetch-messages.tsx +103 -0
- package/src/modules/messages/index.ts +3 -0
- package/src/modules/messages/service.ts +86 -0
- package/src/modules/messages/types.ts +78 -0
- package/src/modules/messages/utils/index.ts +1 -0
- package/src/modules/messages/utils/messages-parser/index.ts +1 -0
- package/src/modules/messages/utils/messages-parser/utils.ts +28 -0
- package/src/modules/profile/__tests__/profile-api-props.builder.ts +74 -0
- package/src/modules/profile/__tests__/profile-props.builder.ts +42 -0
- package/src/modules/profile/constants.ts +3 -0
- package/src/modules/profile/hooks/index.ts +1 -0
- package/src/modules/profile/hooks/use-get-profile/index.ts +1 -0
- package/src/modules/profile/hooks/use-get-profile/use-get-profile.spec.tsx +20 -0
- package/src/modules/profile/hooks/use-get-profile/use-get-profile.tsx +14 -0
- package/src/modules/profile/index.ts +4 -0
- package/src/modules/profile/service.tsx +19 -0
- package/src/modules/profile/types.ts +17 -0
- package/src/modules/sparkie/constants.ts +21 -0
- package/src/modules/sparkie/index.ts +3 -0
- package/src/modules/sparkie/service.ts +94 -0
- package/src/modules/sparkie/types.ts +47 -0
- package/src/modules/sparkie/utils/validate-firebase-config.spec.ts +17 -0
- package/src/modules/sparkie/utils/validate-firebase-config.ts +12 -0
- package/src/modules/widget/__tests__/widget-settings-props.builder.ts +121 -0
- package/src/modules/widget/components/chat-page/chat-page.tsx +20 -0
- package/src/modules/widget/components/chat-page/index.ts +2 -0
- package/src/modules/widget/components/constants.tsx +9 -0
- package/src/modules/widget/components/container/container.tsx +32 -0
- package/src/modules/widget/components/container/index.ts +2 -0
- package/src/modules/widget/components/container/types.ts +3 -0
- package/src/modules/widget/components/greetings-card/greetings-card.tsx +1 -1
- package/src/modules/widget/components/greetings-card/styles.module.css +1 -3
- package/src/modules/widget/components/index.ts +3 -0
- package/src/modules/widget/components/onboarding-page/index.ts +1 -0
- package/src/modules/widget/components/onboarding-page/onboarding-page.tsx +40 -0
- package/src/modules/widget/components/onboarding-page/styles.module.css +7 -0
- package/src/modules/widget/components/starter-page/index.ts +1 -0
- package/src/modules/widget/components/starter-page/starter-page.tsx +41 -0
- package/src/modules/widget/hooks/index.ts +1 -0
- package/src/modules/widget/hooks/use-init-sparkie/index.ts +1 -0
- package/src/modules/widget/hooks/use-init-sparkie/use-init-sparkie.tsx +18 -0
- package/src/modules/widget/store/index.ts +1 -0
- package/src/modules/widget/store/widget-settings.atom.ts +3 -1
- package/src/modules/widget/store/widget-tabs.atom.ts +53 -0
- package/tailwind.config.js +95 -1
- package/config/vitest/index.ts +0 -1
- package/src/config/styles/shared-styles.module.css +0 -16
- package/src/main/styles.module.css +0 -15
- package/src/modules/create-message/components/index.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
# [1.4.0](https://github.com/Hotmart-Org/app-tutor-ai-consumer/compare/v1.3.0...v1.4.0) (2025-06-26)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- pr issues ([74efaec](https://github.com/Hotmart-Org/app-tutor-ai-consumer/commit/74efaecaec56aa84808325cb05bc50bd0b50a6ef))
|
|
6
|
+
- pr issues ([ab7a3a8](https://github.com/Hotmart-Org/app-tutor-ai-consumer/commit/ab7a3a80a5d45b857effb2d281d9523d9789af98))
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- add tutor message markdown support ([4328fc4](https://github.com/Hotmart-Org/app-tutor-ai-consumer/commit/4328fc402c47f501ddd9761f612325515fc8c6e2))
|
|
11
|
+
- add tutor messages and profile service ([213611b](https://github.com/Hotmart-Org/app-tutor-ai-consumer/commit/213611b570a163c27d980a83a8a8a4dd2cf6e077))
|
|
12
|
+
|
|
13
|
+
# [1.3.0](https://github.com/Hotmart-Org/app-tutor-ai-consumer/compare/v1.2.0...v1.3.0) (2025-06-24)
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
- pr issues ([21c2773](https://github.com/Hotmart-Org/app-tutor-ai-consumer/commit/21c2773cdf54babfec739d8684e86b2e3e220765))
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
- add first UI components ([9e2a612](https://github.com/Hotmart-Org/app-tutor-ai-consumer/commit/9e2a6122686004446edf9b2e65cc15bc7a931fc3))
|
|
22
|
+
- enhance initial components ([eca9290](https://github.com/Hotmart-Org/app-tutor-ai-consumer/commit/eca92903035036e27cb7fd405d9d0662971e7016))
|
|
23
|
+
|
|
1
24
|
# [1.2.0](https://github.com/Hotmart-Org/app-tutor-ai-consumer/compare/v1.1.0...v1.2.0) (2025-06-20)
|
|
2
25
|
|
|
3
26
|
### Features
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
vi.mock('@hotmart/sparkie', () => {
|
|
2
|
+
const Sparkie = vi.fn()
|
|
3
|
+
|
|
4
|
+
Sparkie.prototype.destroy = vi.fn()
|
|
5
|
+
Sparkie.prototype.init = vi.fn()
|
|
6
|
+
Sparkie.prototype.off = vi.fn()
|
|
7
|
+
Sparkie.prototype.on = vi.fn()
|
|
8
|
+
Sparkie.prototype.listener = { trackTyping: vi.fn() }
|
|
9
|
+
Sparkie.prototype.setAPIToken = vi.fn()
|
|
10
|
+
|
|
11
|
+
return { default: Sparkie }
|
|
12
|
+
})
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
+
import 'dayjs/locale/pt-br'
|
|
1
2
|
import '@testing-library/jest-dom/vitest'
|
|
2
3
|
|
|
3
4
|
import { cleanup, configure } from '@testing-library/react'
|
|
4
5
|
|
|
5
6
|
import { serviceWorker } from '@/src/config/tests/worker'
|
|
7
|
+
import { initDayjs } from '@/src/config/dayjs'
|
|
8
|
+
import * as I18n from '@/src/config/i18n'
|
|
6
9
|
|
|
7
10
|
configure({ testIdAttribute: 'data-test' })
|
|
8
11
|
|
|
9
12
|
beforeEach(() => {
|
|
10
13
|
cleanup()
|
|
14
|
+
vi.spyOn(I18n, 't').mockImplementation((...args) => args[0])
|
|
11
15
|
})
|
|
12
16
|
|
|
13
17
|
// Start worker before all tests
|
|
14
|
-
beforeAll(() => {
|
|
18
|
+
beforeAll(async () => {
|
|
15
19
|
serviceWorker.listen()
|
|
20
|
+
await initDayjs('pt-br')
|
|
16
21
|
})
|
|
17
22
|
|
|
18
23
|
// Close serviceWorker after all tests
|
package/environments/.env.test
CHANGED
|
@@ -28,8 +28,8 @@ FIREBASE_PROJECT_ID=omnichat-cad8c
|
|
|
28
28
|
FIREBASE_STORAGE_BUCKET=omnichat-cad8c.appspot.com
|
|
29
29
|
|
|
30
30
|
# C3PO
|
|
31
|
-
API_CONVERSATION_URL=
|
|
32
|
-
API_AUTH_URL=
|
|
31
|
+
API_CONVERSATION_URL=https://c3po-api-conversations.buildstaging.com
|
|
32
|
+
API_AUTH_URL=https://c3po-api-auth.buildstaging.com/v1
|
|
33
33
|
|
|
34
34
|
# VLC
|
|
35
35
|
USER_VLC=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "app-tutor-ai-consumer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "rspack serve --env=development --config config/rspack/rspack.config.js",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"@testing-library/user-event": "~14.6.1",
|
|
55
55
|
"@types/axios": "~0.9.36",
|
|
56
56
|
"@types/chance": "~1.1.6",
|
|
57
|
+
"@types/linkify-it": "~5.0.0",
|
|
57
58
|
"@types/node": "~24.0.0",
|
|
58
59
|
"@types/react": "~19.1.7",
|
|
59
60
|
"@types/react-dom": "~19.1.6",
|
|
@@ -101,17 +102,26 @@
|
|
|
101
102
|
},
|
|
102
103
|
"dependencies": {
|
|
103
104
|
"@hot-observability-js/react": "~1.1.0",
|
|
105
|
+
"@hotmart/sparkie": "~5.1.0",
|
|
104
106
|
"@optimizely/react-sdk": "~3.2.4",
|
|
105
107
|
"@tanstack/query-sync-storage-persister": "~5.80.7",
|
|
106
108
|
"@tanstack/react-query": "~5.80.6",
|
|
107
109
|
"@tanstack/react-query-persist-client": "~5.80.7",
|
|
108
110
|
"clsx": "~2.1.1",
|
|
111
|
+
"dayjs": "~1.11.13",
|
|
109
112
|
"i18next": "~25.2.1",
|
|
110
113
|
"i18next-resources-to-backend": "~1.2.1",
|
|
111
114
|
"jotai": "~2.12.5",
|
|
115
|
+
"linkify-it": "~5.0.0",
|
|
116
|
+
"prism-react-renderer": "~2.4.1",
|
|
112
117
|
"react": "~19.1.0",
|
|
113
118
|
"react-dom": "~19.1.0",
|
|
114
|
-
"react-i18next": "~15.5.2"
|
|
119
|
+
"react-i18next": "~15.5.2",
|
|
120
|
+
"react-markdown": "~10.1.0",
|
|
121
|
+
"rehype-raw": "~7.0.0",
|
|
122
|
+
"rehype-sanitize": "~6.0.0",
|
|
123
|
+
"remark-breaks": "~4.0.0",
|
|
124
|
+
"remark-gfm": "~4.0.1"
|
|
115
125
|
},
|
|
116
126
|
"optionalDependencies": {
|
|
117
127
|
"@rollup/rollup-linux-x64-gnu": "4.6.1",
|
|
Binary file
|