xertica-ui 2.5.0 → 2.5.2
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 +35 -0
- package/README.md +56 -17
- package/assets/xertica-logo.svg +37 -37
- package/assets/xertica-x-logo.svg +20 -20
- package/bin/cli.ts +14 -2
- package/bin/generate-tokens.ts +262 -262
- package/bin/language-config.ts +359 -358
- package/components/assistant/code-block/CodeBlock.tsx +268 -268
- package/components/assistant/formatted-document/FormattedDocument.tsx +147 -147
- package/components/assistant/modern-chat-input/ModernChatInput.tsx +564 -564
- package/components/assistant/xertica-assistant/parts/AssistantCollapsedView.tsx +99 -99
- package/components/assistant/xertica-assistant/parts/AssistantConversationList.tsx +104 -104
- package/components/assistant/xertica-assistant/parts/AssistantDocumentEditor.tsx +81 -81
- package/components/assistant/xertica-assistant/parts/AssistantFeedbackDialog.tsx +88 -88
- package/components/assistant/xertica-assistant/parts/AssistantHeader.tsx +75 -75
- package/components/assistant/xertica-assistant/parts/AssistantMessageBubble.tsx +564 -564
- package/components/assistant/xertica-assistant/parts/AssistantTabBar.tsx +67 -67
- package/components/assistant/xertica-assistant/parts/AssistantWelcomeScreen.tsx +103 -103
- package/components/assistant/xertica-assistant/use-assistant.ts +615 -615
- package/components/assistant/xertica-assistant/xertica-assistant.tsx +611 -611
- package/components/blocks/card-patterns/ActivityCard.tsx +100 -100
- package/components/blocks/card-patterns/ActivityCardSkeleton.tsx +56 -56
- package/components/blocks/card-patterns/FeatureCardSkeleton.tsx +58 -58
- package/components/blocks/card-patterns/NotificationCard.tsx +140 -140
- package/components/blocks/card-patterns/NotificationCardSkeleton.tsx +81 -81
- package/components/blocks/card-patterns/ProfileCard.tsx +112 -112
- package/components/blocks/card-patterns/ProfileCardSkeleton.tsx +69 -69
- package/components/blocks/card-patterns/ProjectCard.tsx +123 -123
- package/components/blocks/card-patterns/ProjectCardSkeleton.tsx +67 -67
- package/components/blocks/card-patterns/QuickActionCardSkeleton.tsx +44 -44
- package/components/blocks/card-patterns/card-patterns.stories.tsx +594 -594
- package/components/blocks/card-patterns/index.ts +29 -29
- package/components/brand/language-selector/LanguageSelector.tsx +102 -102
- package/components/brand/language-selector/language-selector.stories.tsx +111 -111
- package/components/brand/language-selector/language-selector.test.tsx +101 -101
- package/components/brand/theme-toggle/ThemeToggle.tsx +74 -74
- package/components/brand/xertica-provider/xertica-provider.mdx +61 -61
- package/components/index.ts +86 -86
- package/components/layout/sidebar/sidebar.mdx +1 -1
- package/components/layout/sidebar/sidebar.stories.tsx +1033 -787
- package/components/layout/sidebar/sidebar.tsx +338 -1
- package/components/media/FloatingMediaWrapper.tsx +371 -371
- package/components/media/audio-player/AudioPlayer.tsx +768 -768
- package/components/media/video-player/VideoPlayer.tsx +310 -310
- package/components/pages/home-content/HomeContent.tsx +120 -120
- package/components/pages/home-content/home-content.mdx +62 -62
- package/components/pages/home-page/HomePage.tsx +78 -78
- package/components/pages/home-page/home-page.mdx +53 -53
- package/components/pages/template-content/TemplateContent.tsx +1354 -1354
- package/components/pages/template-content/template-content.mdx +61 -61
- package/components/pages/template-page/TemplatePage.stories.tsx +32 -32
- package/components/pages/template-page/template-page.mdx +53 -53
- package/components/shared/error-boundary.stories.tsx +114 -114
- package/components/shared/error-boundary.tsx +150 -150
- package/components/shared/error-fallbacks.tsx +222 -222
- package/components/ui/accordion/accordion.mdx +8 -8
- package/components/ui/alert/alert.mdx +8 -8
- package/components/ui/alert-dialog/alert-dialog.mdx +8 -8
- package/components/ui/aspect-ratio/aspect-ratio.mdx +8 -8
- package/components/ui/assistant-chart/assistant-chart.mdx +8 -8
- package/components/ui/avatar/avatar.mdx +8 -8
- package/components/ui/badge/badge.mdx +8 -8
- package/components/ui/breadcrumb/breadcrumb.mdx +8 -8
- package/components/ui/button/button.mdx +8 -8
- package/components/ui/calendar/calendar.mdx +8 -8
- package/components/ui/card/card.mdx +8 -8
- package/components/ui/carousel/carousel.mdx +8 -8
- package/components/ui/chart/chart.mdx +8 -8
- package/components/ui/chart/chart.test.tsx +178 -178
- package/components/ui/chart/chart.tsx +2245 -2239
- package/components/ui/checkbox/checkbox.mdx +8 -8
- package/components/ui/collapsible/collapsible.mdx +8 -8
- package/components/ui/command/command.mdx +8 -8
- package/components/ui/context-menu/context-menu.mdx +8 -8
- package/components/ui/dialog/dialog.mdx +8 -8
- package/components/ui/drawer/drawer.mdx +8 -8
- package/components/ui/dropdown-menu/dropdown-menu.mdx +8 -8
- package/components/ui/empty/empty.mdx +8 -8
- package/components/ui/file-upload/file-upload.mdx +8 -8
- package/components/ui/hover-card/hover-card.mdx +8 -8
- package/components/ui/input/input.mdx +8 -8
- package/components/ui/input-otp/input-otp.mdx +8 -8
- package/components/ui/label/label.mdx +8 -8
- package/components/ui/map/map.mdx +8 -8
- package/components/ui/menubar/menubar.mdx +8 -8
- package/components/ui/navigation-menu/navigation-menu.mdx +8 -8
- package/components/ui/notification-badge/notification-badge.mdx +8 -8
- package/components/ui/pagination/pagination.mdx +8 -8
- package/components/ui/popover/popover.mdx +8 -8
- package/components/ui/progress/progress.mdx +8 -8
- package/components/ui/radio-group/radio-group.mdx +8 -8
- package/components/ui/rating/rating.mdx +8 -8
- package/components/ui/resizable/resizable.mdx +8 -8
- package/components/ui/route-map/route-map.mdx +8 -8
- package/components/ui/scroll-area/scroll-area.mdx +8 -8
- package/components/ui/search/search.mdx +8 -8
- package/components/ui/select/select.mdx +8 -8
- package/components/ui/separator/separator.mdx +8 -8
- package/components/ui/sheet/sheet.mdx +8 -8
- package/components/ui/simple-map/simple-map.mdx +8 -8
- package/components/ui/skeleton/skeleton.mdx +8 -8
- package/components/ui/slider/slider.mdx +8 -8
- package/components/ui/sonner/sonner.mdx +8 -8
- package/components/ui/stats-card/index.ts +2 -2
- package/components/ui/stats-card/stats-card-skeleton.tsx +60 -60
- package/components/ui/stats-card/stats-card.mdx +8 -8
- package/components/ui/stats-card/stats-card.tsx +109 -109
- package/components/ui/stepper/stepper.mdx +8 -8
- package/components/ui/switch/switch.mdx +8 -8
- package/components/ui/table/table.mdx +8 -8
- package/components/ui/tabs/tabs.mdx +8 -8
- package/components/ui/textarea/textarea.mdx +8 -8
- package/components/ui/timeline/timeline.mdx +8 -8
- package/components/ui/toggle/toggle.mdx +8 -8
- package/components/ui/toggle-group/toggle-group.mdx +8 -8
- package/components/ui/tooltip/tooltip.mdx +8 -8
- package/components/ui/tree-view/tree-view.mdx +8 -8
- package/components.json +511 -511
- package/contexts/AuthContext.tsx +121 -121
- package/contexts/BrandColorsContext.tsx +282 -282
- package/contexts/LanguageContext.test.tsx +121 -121
- package/contexts/LanguageContext.tsx +250 -250
- package/contexts/theme-data.ts +391 -391
- package/dist/{AssistantChart-DoZCyS5r.cjs → AssistantChart-9w31gdAb.cjs} +4 -4
- package/dist/{AssistantChart-CldVCVDe.cjs → AssistantChart-BAudAfne.cjs} +5 -5
- package/dist/{AssistantChart-Bdd44uBn.cjs → AssistantChart-BAx9VQvb.cjs} +127 -388
- package/dist/{AssistantChart-Cu3m7RBo.js → AssistantChart-BP8upjMk.js} +5 -5
- package/dist/{AssistantChart-CFhDdGyU.js → AssistantChart-CVko2A1W.js} +130 -391
- package/dist/{AssistantChart-C_hwFRRr.js → AssistantChart-CVzmmhx4.js} +4 -4
- package/dist/{AudioPlayer-IAU5q5T1.cjs → AudioPlayer-1ypwE2Wh.cjs} +1 -1
- package/dist/{AudioPlayer-CGRUtUdN.js → AudioPlayer-DuKXrCfy.js} +1 -1
- package/dist/{LanguageContext-CS14yCpi.js → LanguageContext-BwhwC3G2.js} +2 -2
- package/dist/{LanguageContext-B_KFTCzT.cjs → LanguageContext-DvUt5jBg.cjs} +2 -2
- package/dist/{ThemeContext-C2EwAPDt.js → ThemeContext-BbBNoFTG.js} +2 -2
- package/dist/{ThemeContext-Bmod0Cg2.cjs → ThemeContext-BblcjQup.cjs} +13 -8
- package/dist/{ThemeContext-BWq9ACPo.js → ThemeContext-Bo-W2WZH.js} +13 -8
- package/dist/{ThemeContext-j5aGtPky.cjs → ThemeContext-CP3a0jxy.cjs} +193 -262
- package/dist/{ThemeContext-vTjumZeM.cjs → ThemeContext-Cmr8Ex8H.cjs} +2 -2
- package/dist/ThemeContext-CpqYShLq.cjs +324 -0
- package/dist/{ThemeContext-CQSo4Iwc.js → ThemeContext-D3LzacmG.js} +8 -1
- package/dist/ThemeContext-Du2nE1PL.js +325 -0
- package/dist/ThemeContext-GeEBTJ3q.cjs +1621 -0
- package/dist/ThemeContext-JyLK9B1o.js +1622 -0
- package/dist/{ThemeContext-CGk3KK0k.cjs → ThemeContext-U4dEYc6C.cjs} +8 -1
- package/dist/{ThemeContext-BXjrgUjW.js → ThemeContext-ept8jhXI.js} +200 -261
- package/dist/{VerifyEmailPage-CGIwmWrm.js → VerifyEmailPage-B31mCrMc.js} +1 -1
- package/dist/{VerifyEmailPage-C0c2e5n0.js → VerifyEmailPage-BE-L9mB7.js} +7 -7
- package/dist/{VerifyEmailPage-DSBMRHtl.js → VerifyEmailPage-BIBOKV7Z.js} +41 -36
- package/dist/{VerifyEmailPage-DgIid028.js → VerifyEmailPage-BJjAMUTW.js} +4 -4
- package/dist/{VerifyEmailPage--1Vurewl.cjs → VerifyEmailPage-BRSP-Pwt.cjs} +3 -3
- package/dist/{VerifyEmailPage-Cwi3kbol.cjs → VerifyEmailPage-Bae2cBXT.cjs} +7 -7
- package/dist/{VerifyEmailPage-De6bQjrz.cjs → VerifyEmailPage-BiRm7Nh4.cjs} +41 -36
- package/dist/{VerifyEmailPage-ByerOcm4.cjs → VerifyEmailPage-Bv8Ah_TK.cjs} +23 -20
- package/dist/VerifyEmailPage-Bvfv8HVQ.js +3214 -0
- package/dist/{VerifyEmailPage-BComraR7.cjs → VerifyEmailPage-CR7kb5df.cjs} +22 -12
- package/dist/{VerifyEmailPage-CpqqpLpo.cjs → VerifyEmailPage-C_Zk6Gen.cjs} +1 -1
- package/dist/{VerifyEmailPage-MTD7AG1Z.js → VerifyEmailPage-C_ihbcth.js} +4 -4
- package/dist/{VerifyEmailPage-1WwWczAn.js → VerifyEmailPage-CbgjOF0v.js} +22 -12
- package/dist/{VerifyEmailPage-DvMLZgFt.js → VerifyEmailPage-CdYPSJoO.js} +1 -1
- package/dist/{VerifyEmailPage-By3Jf__L.cjs → VerifyEmailPage-CkBYfsNy.cjs} +4 -4
- package/dist/{VerifyEmailPage-CJLz3jrn.js → VerifyEmailPage-Cyl55sJb.js} +23 -20
- package/dist/VerifyEmailPage-D-FRj5TU.cjs +3213 -0
- package/dist/{VerifyEmailPage-B4peJjAT.cjs → VerifyEmailPage-DF2ilhum.cjs} +334 -356
- package/dist/{VerifyEmailPage-CYXtbKi3.cjs → VerifyEmailPage-DMBh4NM9.cjs} +1 -1
- package/dist/{VerifyEmailPage-CgMxRb4z.js → VerifyEmailPage-DTtFfC-J.js} +3 -3
- package/dist/{VerifyEmailPage-CFLMls1p.cjs → VerifyEmailPage-Dt7zgA4w.cjs} +4 -4
- package/dist/{VerifyEmailPage-C5TNQTBa.js → VerifyEmailPage-EhudUdqF.js} +343 -355
- package/dist/{VerifyEmailPage-DGhuIqkb.js → VerifyEmailPage-X14vhdyl.js} +4 -4
- package/dist/VerifyEmailPage-hdB8JQGv.cjs +3213 -0
- package/dist/{VerifyEmailPage-Bp1XXl3H.cjs → VerifyEmailPage-u_Dn7t1U.cjs} +4 -4
- package/dist/VerifyEmailPage-vYHbYK3q.js +3214 -0
- package/dist/{XerticaProvider-CBGc4EMA.cjs → XerticaProvider-AChwphCO.cjs} +4 -4
- package/dist/{XerticaProvider-BIrqfZ-i.cjs → XerticaProvider-AbWlr7Af.cjs} +8 -11
- package/dist/{XerticaProvider-D-yNhF94.cjs → XerticaProvider-B8CaV7xu.cjs} +1 -1
- package/dist/{XerticaProvider-CEoWMTxu.js → XerticaProvider-BITjgC5p.js} +2 -2
- package/dist/{XerticaProvider-CllrbMEJ.cjs → XerticaProvider-By8q3Roe.cjs} +2 -2
- package/dist/{XerticaProvider-C1DKnvLh.js → XerticaProvider-CUYJZc32.js} +4 -4
- package/dist/{XerticaProvider-ET0ihewn.cjs → XerticaProvider-CW9hpCdF.cjs} +2 -2
- package/dist/{XerticaProvider-Dt5HEzbQ.js → XerticaProvider-CWgby5mY.js} +10 -10
- package/dist/XerticaProvider-CWs6EwNa.js +49 -0
- package/dist/XerticaProvider-CjQAQPcn.cjs +48 -0
- package/dist/XerticaProvider-D5lLumH-.js +49 -0
- package/dist/{XerticaProvider-DYq4JWtg.js → XerticaProvider-DQtvJU7m.js} +1 -1
- package/dist/XerticaProvider-qQUDop71.cjs +48 -0
- package/dist/{XerticaProvider-B7EVH-NF.js → XerticaProvider-siSt9uG2.js} +2 -2
- package/dist/{XerticaXLogo-Zw2B276b.cjs → XerticaXLogo-8TTzBjHw.cjs} +1 -1
- package/dist/{XerticaXLogo-B7xQ5dhi.js → XerticaXLogo-BWaag64t.js} +1 -1
- package/dist/{XerticaXLogo-DZbo4vOE.js → XerticaXLogo-CFuIlYFH.js} +12 -12
- package/dist/{XerticaXLogo-bvZSgwGF.cjs → XerticaXLogo-CU-U-GP4.cjs} +7 -13
- package/dist/XerticaXLogo-ChryA6xj.js +252 -0
- package/dist/{XerticaXLogo-CQUUjXoH.cjs → XerticaXLogo-CziKMQil.cjs} +8 -8
- package/dist/XerticaXLogo-DHz5SugF.js +252 -0
- package/dist/XerticaXLogo-DTee_y8X.cjs +251 -0
- package/dist/{XerticaXLogo-Cmsp-Eey.js → XerticaXLogo-DfUvz-lD.js} +9 -9
- package/dist/XerticaXLogo-kslQ8Tk_.cjs +251 -0
- package/dist/{alert-dialog-s-vmNkJ_.js → alert-dialog-iDe5VE5o.js} +3 -3
- package/dist/{alert-dialog-DSKByiKZ.cjs → alert-dialog-yckpaOpy.cjs} +3 -3
- package/dist/cli.js +16 -6
- package/dist/components/ui/chart/chart.d.ts +7 -5
- package/dist/{google-maps-loader-Y-QkD-Li.cjs → google-maps-loader-BqsYL48U.cjs} +0 -5
- package/dist/{google-maps-loader-CTYySAun.js → google-maps-loader-t2IlYBzw.js} +0 -4
- package/dist/index-CkTUgOwX.js +8 -0
- package/dist/{index-COtD8bRW.cjs → index-D3RLKRAs.cjs} +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +2 -2
- package/dist/index.umd.js +454 -1027
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +1 -1
- package/dist/pages.cjs.js +1 -1
- package/dist/pages.es.js +1 -1
- package/dist/{sidebar-DAaY8bRU.cjs → sidebar-B3EYhli0.cjs} +33 -24
- package/dist/{sidebar-nzPoVHBQ.cjs → sidebar-B9NR0lCe.cjs} +46 -41
- package/dist/{sidebar-CeTMuzOx.cjs → sidebar-BvF5I2Ue.cjs} +47 -128
- package/dist/{sidebar-q7P2Godd.cjs → sidebar-C5B_LHek.cjs} +1 -1
- package/dist/{sidebar-CrQDDdcz.js → sidebar-CA6_ek3f.js} +33 -24
- package/dist/sidebar-CLmIjgNd.cjs +1136 -0
- package/dist/{sidebar-BxGXsDAd.cjs → sidebar-CVUGHOS_.cjs} +8 -16
- package/dist/{sidebar-BViy8Eeu.js → sidebar-CmvwjnVb.js} +9 -17
- package/dist/{sidebar-B6SlKZYN.js → sidebar-CplprZpM.js} +49 -40
- package/dist/sidebar-Duermn32.js +1133 -0
- package/dist/{sidebar-BbVIQvlP.js → sidebar-Dz7bd3zP.js} +1 -1
- package/dist/{sidebar-0ocFLSks.js → sidebar-KIS0C2JH.js} +50 -127
- package/dist/sidebar-OTO_up7Z.js +801 -0
- package/dist/sidebar-zowjejT2.cjs +800 -0
- package/dist/{use-audio-player-nv8ZSGa1.js → use-audio-player-Bkh23vQ3.js} +3 -7
- package/dist/{use-audio-player-NKsWyjWu.cjs → use-audio-player-Dn1NR9xN.cjs} +3 -7
- package/dist/{xertica-assistant-dyP7KHM5.cjs → xertica-assistant-B1IaHXnB.cjs} +388 -529
- package/dist/{xertica-assistant-ciJaWqm1.js → xertica-assistant-BMqdyRVi.js} +10 -28
- package/dist/{xertica-assistant-V_IdW4WF.cjs → xertica-assistant-Bj3vBCq_.cjs} +9 -27
- package/dist/{xertica-assistant-yX1CFBBo.js → xertica-assistant-DPsESB6t.js} +390 -531
- package/dist/{CodeBlock-7TTgmdGG.cjs → xertica-assistant-Qp3ydksa.cjs} +51 -263
- package/dist/{CodeBlock-BeSt1h5P.js → xertica-assistant-gnCJdcZY.js} +7 -219
- package/dist/xertica-ui.css +2 -2
- package/docs/architecture-improvements.md +456 -456
- package/docs/architecture.md +312 -312
- package/docs/components/assistant.md +428 -428
- package/docs/components/branding.md +252 -252
- package/docs/components/card-patterns.md +447 -447
- package/docs/components/error-boundary.md +201 -201
- package/docs/components/hooks.md +432 -432
- package/docs/components/language-selector.md +176 -176
- package/docs/components/pages.md +323 -323
- package/docs/components/sidebar.md +331 -331
- package/docs/components/stats-card.md +138 -138
- package/docs/doc-audit.md +244 -244
- package/docs/getting-started.md +616 -616
- package/docs/guidelines.md +330 -330
- package/docs/i18n.md +480 -480
- package/docs/installation.md +268 -268
- package/docs/llms.md +295 -295
- package/docs/state-management.md +289 -289
- package/guidelines/Guidelines.md +409 -409
- package/llms-compact.txt +1 -1
- package/llms-full.txt +10688 -10688
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/styles/xertica/base.css +90 -90
- package/styles/xertica/tokens.css +240 -240
- package/templates/.prettierignore +4 -4
- package/templates/.prettierrc +10 -10
- package/templates/CLAUDE.md +180 -180
- package/templates/package.json +2 -2
- package/templates/src/app/App.tsx +46 -46
- package/templates/src/app/components/AuthGuard.tsx +131 -131
- package/templates/src/features/assistant/data/mock.ts +75 -75
- package/templates/src/features/assistant/hooks/useAssistantConfig.ts +20 -20
- package/templates/src/features/assistant/index.ts +5 -5
- package/templates/src/features/auth/ui/ForgotPasswordContent.tsx +70 -70
- package/templates/src/features/auth/ui/LoginContent.tsx +92 -92
- package/templates/src/features/auth/ui/ResetPasswordContent.tsx +183 -183
- package/templates/src/features/auth/ui/SocialLoginButtons.tsx +78 -78
- package/templates/src/features/auth/ui/VerifyEmailContent.tsx +80 -80
- package/templates/src/features/home/data/mock.ts +41 -41
- package/templates/src/features/home/hooks/useFeatureCards.ts +20 -20
- package/templates/src/features/home/index.ts +11 -11
- package/templates/src/features/home/ui/HomeContent.tsx +117 -117
- package/templates/src/features/template/ui/CrudTemplate.tsx +112 -112
- package/templates/src/features/template/ui/DashboardTemplate.tsx +110 -110
- package/templates/src/features/template/ui/FormTemplate.tsx +117 -117
- package/templates/src/features/template/ui/LoginTemplate.tsx +59 -59
- package/templates/src/features/template/ui/TemplateContent.tsx +1322 -1322
- package/templates/src/i18n.ts +124 -124
- package/templates/src/locales/en/common.json +21 -21
- package/templates/src/locales/en/components/activityCard.json +10 -10
- package/templates/src/locales/en/components/assistant.json +119 -119
- package/templates/src/locales/en/components/media.json +29 -29
- package/templates/src/locales/en/components/notificationCard.json +5 -5
- package/templates/src/locales/en/components/profileCard.json +8 -8
- package/templates/src/locales/en/components/projectCard.json +10 -10
- package/templates/src/locales/en/components/sidebar.json +14 -14
- package/templates/src/locales/en/components/stats.json +8 -8
- package/templates/src/locales/en/components/team.json +14 -14
- package/templates/src/locales/en/errors.json +9 -9
- package/templates/src/locales/en/languageSelector.json +7 -7
- package/templates/src/locales/en/nav.json +6 -6
- package/templates/src/locales/en/pages/crudTemplate.json +25 -25
- package/templates/src/locales/en/pages/dashboardTemplate.json +20 -20
- package/templates/src/locales/en/pages/forgotPassword.json +10 -10
- package/templates/src/locales/en/pages/formTemplate.json +16 -16
- package/templates/src/locales/en/pages/home.json +7 -7
- package/templates/src/locales/en/pages/login.json +15 -15
- package/templates/src/locales/en/pages/loginTemplate.json +9 -9
- package/templates/src/locales/en/pages/resetPassword.json +18 -18
- package/templates/src/locales/en/pages/templates.json +317 -317
- package/templates/src/locales/en/pages/verifyEmail.json +12 -12
- package/templates/src/locales/en/themeToggle.json +6 -6
- package/templates/src/locales/es/common.json +21 -21
- package/templates/src/locales/es/components/activityCard.json +10 -10
- package/templates/src/locales/es/components/assistant.json +119 -119
- package/templates/src/locales/es/components/media.json +29 -29
- package/templates/src/locales/es/components/notificationCard.json +5 -5
- package/templates/src/locales/es/components/profileCard.json +8 -8
- package/templates/src/locales/es/components/projectCard.json +10 -10
- package/templates/src/locales/es/components/sidebar.json +14 -14
- package/templates/src/locales/es/components/stats.json +8 -8
- package/templates/src/locales/es/components/team.json +14 -14
- package/templates/src/locales/es/errors.json +9 -9
- package/templates/src/locales/es/languageSelector.json +7 -7
- package/templates/src/locales/es/nav.json +6 -6
- package/templates/src/locales/es/pages/crudTemplate.json +25 -25
- package/templates/src/locales/es/pages/dashboardTemplate.json +20 -20
- package/templates/src/locales/es/pages/forgotPassword.json +10 -10
- package/templates/src/locales/es/pages/formTemplate.json +16 -16
- package/templates/src/locales/es/pages/home.json +7 -7
- package/templates/src/locales/es/pages/login.json +15 -15
- package/templates/src/locales/es/pages/loginTemplate.json +9 -9
- package/templates/src/locales/es/pages/resetPassword.json +18 -18
- package/templates/src/locales/es/pages/templates.json +317 -317
- package/templates/src/locales/es/pages/verifyEmail.json +12 -12
- package/templates/src/locales/es/themeToggle.json +6 -6
- package/templates/src/locales/pt-BR/common.json +21 -21
- package/templates/src/locales/pt-BR/components/activityCard.json +10 -10
- package/templates/src/locales/pt-BR/components/assistant.json +119 -119
- package/templates/src/locales/pt-BR/components/media.json +29 -29
- package/templates/src/locales/pt-BR/components/notificationCard.json +5 -5
- package/templates/src/locales/pt-BR/components/profileCard.json +8 -8
- package/templates/src/locales/pt-BR/components/projectCard.json +10 -10
- package/templates/src/locales/pt-BR/components/sidebar.json +14 -14
- package/templates/src/locales/pt-BR/components/stats.json +8 -8
- package/templates/src/locales/pt-BR/components/team.json +14 -14
- package/templates/src/locales/pt-BR/errors.json +9 -9
- package/templates/src/locales/pt-BR/languageSelector.json +7 -7
- package/templates/src/locales/pt-BR/nav.json +6 -6
- package/templates/src/locales/pt-BR/pages/crudTemplate.json +25 -25
- package/templates/src/locales/pt-BR/pages/dashboardTemplate.json +20 -20
- package/templates/src/locales/pt-BR/pages/forgotPassword.json +10 -10
- package/templates/src/locales/pt-BR/pages/formTemplate.json +16 -16
- package/templates/src/locales/pt-BR/pages/home.json +7 -7
- package/templates/src/locales/pt-BR/pages/login.json +15 -15
- package/templates/src/locales/pt-BR/pages/loginTemplate.json +9 -9
- package/templates/src/locales/pt-BR/pages/resetPassword.json +18 -18
- package/templates/src/locales/pt-BR/pages/templates.json +317 -317
- package/templates/src/locales/pt-BR/pages/verifyEmail.json +12 -12
- package/templates/src/locales/pt-BR/themeToggle.json +6 -6
- package/templates/src/pages/AssistantPage.tsx +470 -470
- package/templates/src/pages/HomePage.tsx +53 -53
- package/templates/src/shared/error-boundary.tsx +150 -150
- package/templates/src/shared/error-fallbacks.tsx +222 -222
- package/templates/src/styles/xertica/tokens.css +240 -240
- package/templates/vite.config.js +20 -20
- package/templates/vite.config.ts +55 -55
- package/dist/AssistantChart-BKVtGUKF.js +0 -3383
- package/dist/AssistantChart-CxGjH7Qk.js +0 -3477
- package/dist/AssistantChart-DIpshm3i.js +0 -4784
- package/dist/AssistantChart-D_PTeu8P.cjs +0 -3503
- package/dist/AssistantChart-WeycT5Pd.cjs +0 -3551
- package/dist/AssistantChart-zjsy2GaZ.cjs +0 -4810
- package/dist/AudioPlayer-B1lt5cPl.cjs +0 -989
- package/dist/AudioPlayer-BZ7bibzU.cjs +0 -982
- package/dist/AudioPlayer-BpRPS4-1.cjs +0 -1277
- package/dist/AudioPlayer-C12BjQBV.cjs +0 -997
- package/dist/AudioPlayer-CFeV8t-5.cjs +0 -936
- package/dist/AudioPlayer-Coly3q5R.js +0 -1278
- package/dist/AudioPlayer-CySJIyvL.js +0 -937
- package/dist/AudioPlayer-DMcG_c7L.js +0 -990
- package/dist/AudioPlayer-DcFKRJE_.js +0 -998
- package/dist/AudioPlayer-e8LfNoqO.js +0 -983
- package/dist/BrandColorsContext-565dDHd5.js +0 -660
- package/dist/BrandColorsContext-BcJbtkqn.cjs +0 -659
- package/dist/CodeBlock-BgfYL_rD.cjs +0 -2094
- package/dist/CodeBlock-BlcqlA9M.cjs +0 -2094
- package/dist/CodeBlock-Bnmeu5ez.cjs +0 -2094
- package/dist/CodeBlock-BtfPlbAI.js +0 -2078
- package/dist/CodeBlock-CIySIuYr.js +0 -2078
- package/dist/CodeBlock-CuPtUM-7.cjs +0 -2094
- package/dist/CodeBlock-D6ffWXgc.js +0 -2078
- package/dist/CodeBlock-D8dcwbit.cjs +0 -2094
- package/dist/CodeBlock-DMZrFnlw.cjs +0 -2094
- package/dist/CodeBlock-DlBehYN8.js +0 -2078
- package/dist/CodeBlock-DnYNI8rQ.js +0 -2078
- package/dist/CodeBlock-DvKWbSnE.cjs +0 -2094
- package/dist/CodeBlock-DwMCfkFY.js +0 -2078
- package/dist/CodeBlock-Dy6CNYyj.js +0 -2078
- package/dist/CodeBlock-U1pPOQI7.cjs +0 -2094
- package/dist/CodeBlock-f_GpNhEB.js +0 -2078
- package/dist/CodeBlock-oB6u8nI1.js +0 -2078
- package/dist/CodeBlock-tZC31B73.cjs +0 -2094
- package/dist/FeatureCard-CxC-7C-C.cjs +0 -300
- package/dist/FeatureCard-DbHWCb4E.js +0 -301
- package/dist/ImageWithFallback-CGtidP6B.cjs +0 -4542
- package/dist/ImageWithFallback-lsg3pdFg.js +0 -4508
- package/dist/LanguageSelector-B5YfbHra.js +0 -231
- package/dist/LanguageSelector-D6uacAIM.cjs +0 -230
- package/dist/LayoutContext-B45-e9DI.cjs +0 -93
- package/dist/LayoutContext-BAql6ZRY.js +0 -97
- package/dist/LayoutContext-Bav3UMEA.js +0 -94
- package/dist/LayoutContext-BvK-ggDa.cjs +0 -96
- package/dist/ThemeContext-BoH4NLfN.js +0 -734
- package/dist/ThemeContext-r69W20Xg.cjs +0 -733
- package/dist/VerifyEmailPage-COiyNl1y.js +0 -2825
- package/dist/VerifyEmailPage-CqKsR2v8.js +0 -2827
- package/dist/VerifyEmailPage-DjQKRlUS.cjs +0 -2824
- package/dist/VerifyEmailPage-s-1X3LDJ.cjs +0 -2826
- package/dist/XerticaOrbe-KL1RBHzw.cjs +0 -1354
- package/dist/XerticaOrbe-zwS1p2a8.js +0 -1355
- package/dist/XerticaProvider-6btlAlzc.js +0 -17
- package/dist/XerticaProvider-BNoNOxQ5.cjs +0 -16
- package/dist/XerticaProvider-BlY2limY.cjs +0 -38
- package/dist/XerticaProvider-DDuiIcKo.js +0 -39
- package/dist/XerticaProvider-cI9hSs27.cjs +0 -38
- package/dist/XerticaProvider-hSwhNQex.js +0 -39
- package/dist/alert-dialog-BOje--vD.js +0 -847
- package/dist/alert-dialog-BtEuQqrg.cjs +0 -870
- package/dist/breadcrumb-CqJ7bHY5.js +0 -161
- package/dist/breadcrumb-m9Hb2_XN.cjs +0 -177
- package/dist/components/assistant/xertica-assistant/hooks/index.d.ts +0 -6
- package/dist/components/assistant/xertica-assistant/hooks/use-assistant-conversations.d.ts +0 -21
- package/dist/components/assistant/xertica-assistant/hooks/use-assistant-messages.d.ts +0 -49
- package/dist/components/assistant/xertica-assistant/hooks/use-assistant-suggestions.d.ts +0 -16
- package/dist/components/blocks/audio-player/AudioPlayer.d.ts +0 -35
- package/dist/components/blocks/audio-player/index.d.ts +0 -1
- package/dist/components/blocks/document-editor/DocumentEditor.d.ts +0 -26
- package/dist/components/blocks/document-editor/index.d.ts +0 -1
- package/dist/components/blocks/podcast-player/PodcastPlayer.d.ts +0 -41
- package/dist/components/blocks/podcast-player/index.d.ts +0 -1
- package/dist/components/ui/chart/parts/chart-dashboard.d.ts +0 -113
- package/dist/components/ui/chart/parts/chart-metric.d.ts +0 -118
- package/dist/components/ui/chart/parts/chart-primitives.d.ts +0 -101
- package/dist/components/ui/chart/parts/chart-shared.d.ts +0 -20
- package/dist/components/ui/chart/parts/chart-utils.d.ts +0 -12
- package/dist/components/ui/chart/parts/index.d.ts +0 -5
- package/dist/dropdown-menu-BDB5CmQs.cjs +0 -247
- package/dist/dropdown-menu-DQidbKBD.js +0 -231
- package/dist/google-maps-loader-BFWp6VPd.js +0 -287
- package/dist/google-maps-loader-BKcdgFbu.cjs +0 -312
- package/dist/google-maps-loader-CumCNXeG.js +0 -312
- package/dist/google-maps-loader-eS3uQ5TA.cjs +0 -287
- package/dist/header-Cgy6vYPk.cjs +0 -731
- package/dist/header-DRlT4jgI.js +0 -715
- package/dist/header-Dux00SI4.cjs +0 -731
- package/dist/header-EkGKXPsD.js +0 -715
- package/dist/header-WfEywpyc.cjs +0 -731
- package/dist/header-tifNQn2U.js +0 -715
- package/dist/index-BhapVLVj.js +0 -8
- package/dist/index-D6fxYEY8.cjs +0 -7
- package/dist/index-DAIp0_HK.js +0 -8
- package/dist/index-DW5tYe26.js +0 -8
- package/dist/index-GA__GvnG.cjs +0 -7
- package/dist/input-2R4loU86.js +0 -127
- package/dist/input-DWANSKGb.cjs +0 -145
- package/dist/progress-DPtzoVV8.js +0 -175
- package/dist/progress-EeaoqqUs.cjs +0 -191
- package/dist/rich-text-editor-0mraWT5y.cjs +0 -2376
- package/dist/rich-text-editor-B-IkcPD0.js +0 -2874
- package/dist/rich-text-editor-B6jMRLzk.cjs +0 -1939
- package/dist/rich-text-editor-B8_oYcIR.js +0 -1730
- package/dist/rich-text-editor-B9UbSXNb.js +0 -1203
- package/dist/rich-text-editor-BYuRBNBU.js +0 -2373
- package/dist/rich-text-editor-Bb9pySTs.cjs +0 -2374
- package/dist/rich-text-editor-BcL6L3cm.cjs +0 -2374
- package/dist/rich-text-editor-BoVZYtTs.cjs +0 -2391
- package/dist/rich-text-editor-Bp3zQqMC.js +0 -2954
- package/dist/rich-text-editor-CMgSN_w2.js +0 -1189
- package/dist/rich-text-editor-CPV1lEPH.cjs +0 -1748
- package/dist/rich-text-editor-CeucBdIv.cjs +0 -2971
- package/dist/rich-text-editor-CoKqbCtu.cjs +0 -1799
- package/dist/rich-text-editor-Cw56T_mB.js +0 -2356
- package/dist/rich-text-editor-Cyt8qs2b.js +0 -1921
- package/dist/rich-text-editor-D6H84OcX.cjs +0 -1220
- package/dist/rich-text-editor-D76gD-QI.js +0 -2328
- package/dist/rich-text-editor-DKkokOnA.js +0 -1781
- package/dist/rich-text-editor-DNsdpN64.cjs +0 -2359
- package/dist/rich-text-editor-DfG8bCyY.js +0 -2358
- package/dist/rich-text-editor-Dxjw31Z4.js +0 -2341
- package/dist/rich-text-editor-DzP0Epmb.js +0 -2356
- package/dist/rich-text-editor-bRkNoeZY.cjs +0 -2891
- package/dist/rich-text-editor-lyYE2ZG5.cjs +0 -1207
- package/dist/rich-text-editor-skplNlBM.cjs +0 -2345
- package/dist/select-Bkbr0f-Z.cjs +0 -162
- package/dist/select-CvIVdX2n.js +0 -145
- package/dist/sidebar-CK_0ZQHj.cjs +0 -803
- package/dist/sidebar-CUuOvYhK.js +0 -787
- package/dist/sidebar-DQj1z3jG.cjs +0 -758
- package/dist/sidebar-Djn5syhi.cjs +0 -786
- package/dist/sidebar-LluMXfam.js +0 -759
- package/dist/sidebar-_rT7rBMk.js +0 -787
- package/dist/slider-Bc5Hd0y1.js +0 -56
- package/dist/slider-N7hFFj6X.cjs +0 -73
- package/dist/tooltip-Ded96neP.cjs +0 -137
- package/dist/tooltip-HDOoD2-0.js +0 -120
- package/dist/use-audio-player-B31J-aqh.cjs +0 -187
- package/dist/use-audio-player-BkmEmj8Q.js +0 -185
- package/dist/use-audio-player-CLFTWFW1.cjs +0 -184
- package/dist/use-audio-player-CLLn00I6.js +0 -188
- package/dist/use-file-upload-BcjEo2S5.js +0 -404
- package/dist/use-file-upload-CRJR68Tj.cjs +0 -403
- package/dist/use-mobile-B0hNy_Y6.cjs +0 -4303
- package/dist/use-mobile-BXuYROXM.js +0 -4202
- package/dist/use-mobile-Bbd51ASU.cjs +0 -4392
- package/dist/use-mobile-Bk6CX-TC.js +0 -4359
- package/dist/use-mobile-BvYdisLP.js +0 -4202
- package/dist/use-mobile-BzuxjzNX.cjs +0 -4392
- package/dist/use-mobile-CG2-SdXV.cjs +0 -4235
- package/dist/use-mobile-CKb5pqTs.js +0 -4269
- package/dist/use-mobile-CYuAuGDl.js +0 -4202
- package/dist/use-mobile-CaENcqm-.js +0 -4508
- package/dist/use-mobile-CbrYgJGJ.js +0 -4203
- package/dist/use-mobile-Cd4xPrKq.cjs +0 -46
- package/dist/use-mobile-DMOvImGQ.cjs +0 -4542
- package/dist/use-mobile-DRB3BQgD.cjs +0 -4235
- package/dist/use-mobile-DZvv7QMR.js +0 -4359
- package/dist/use-mobile-DdI_TXam.cjs +0 -4235
- package/dist/use-mobile-DlceKf8a.js +0 -4359
- package/dist/use-mobile-DsOnow1o.cjs +0 -4236
- package/dist/use-mobile-Kcj6jSnK.cjs +0 -4392
- package/dist/use-mobile-bnKcua_i.js +0 -4202
- package/dist/use-mobile-j4w2Jrf1.js +0 -30
- package/dist/use-mobile-ncXBeE2z.cjs +0 -4235
- package/dist/use-rich-text-editor-DjiddBGv.js +0 -282
- package/dist/use-rich-text-editor-lpeswbCs.cjs +0 -281
- package/dist/xertica-assistant-BdiZag0h.js +0 -2187
- package/dist/xertica-assistant-CrgTb6Hs.cjs +0 -2155
- package/dist/xertica-assistant-DCsnQyi5.js +0 -2156
- package/dist/xertica-assistant-DUBpmEgo.cjs +0 -2186
- package/dist/{rich-text-editor-DgF8s7xW.js → rich-text-editor-BmsjY03B.js} +26 -26
- package/dist/{rich-text-editor-mWoaSCE4.cjs → rich-text-editor-GS2kpTAK.cjs} +26 -26
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
3
|
const React = require("react");
|
|
4
|
-
const sonner = require("sonner");
|
|
5
|
-
const lucideReact = require("lucide-react");
|
|
6
4
|
const framerMotion = require("framer-motion");
|
|
5
|
+
const lucideReact = require("lucide-react");
|
|
7
6
|
const RechartsPrimitive = require("recharts");
|
|
8
|
-
const richTextEditor = require("./rich-text-editor-
|
|
7
|
+
const richTextEditor = require("./rich-text-editor-DbV-S7Fi.cjs");
|
|
9
8
|
const dropdownMenu = require("./dropdown-menu-Ze1YZFyc.cjs");
|
|
10
9
|
const button = require("./button-0CXwCRTm.cjs");
|
|
11
10
|
const input = require("./input-CPl84zAx.cjs");
|
|
11
|
+
const sonner = require("sonner");
|
|
12
12
|
const XerticaOrbe = require("./XerticaOrbe-FWGjBj0U.cjs");
|
|
13
13
|
const tooltip = require("./tooltip-CNtsL5cB.cjs");
|
|
14
14
|
const TooltipPrimitive = require("@radix-ui/react-tooltip");
|
|
@@ -29,457 +29,6 @@ function _interopNamespaceDefault(e) {
|
|
|
29
29
|
return Object.freeze(n);
|
|
30
30
|
}
|
|
31
31
|
const TooltipPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TooltipPrimitive);
|
|
32
|
-
[
|
|
33
|
-
{ id: "rich-1", text: "Ver exemplo de Gráfico", icon: React.createElement(lucideReact.BarChart3, { className: "w-4 h-4 mr-2" }) },
|
|
34
|
-
{ id: "rich-2", text: "Ver exemplo de Imagem", icon: React.createElement(lucideReact.ImageIcon, { className: "w-4 h-4 mr-2" }) },
|
|
35
|
-
{ id: "rich-3", text: "Ver exemplo de Tabela", icon: React.createElement(lucideReact.Table, { className: "w-4 h-4 mr-2" }) },
|
|
36
|
-
{ id: "rich-4", text: "Ver exemplo de Documento", icon: React.createElement(lucideReact.FileText, { className: "w-4 h-4 mr-2" }) }
|
|
37
|
-
];
|
|
38
|
-
const gerarResposta = (mensagemUsuario, customResponses) => {
|
|
39
|
-
const mensagemLower = mensagemUsuario.toLowerCase();
|
|
40
|
-
if (customResponses && customResponses.length > 0) {
|
|
41
|
-
for (const mock of customResponses) {
|
|
42
|
-
const trigger = mock.trigger;
|
|
43
|
-
let match = false;
|
|
44
|
-
if (trigger instanceof RegExp) {
|
|
45
|
-
match = trigger.test(mensagemUsuario);
|
|
46
|
-
} else {
|
|
47
|
-
match = mensagemLower.includes(trigger.toLowerCase());
|
|
48
|
-
}
|
|
49
|
-
if (match) {
|
|
50
|
-
return mock.response;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
const mensagemOriginal = mensagemUsuario;
|
|
55
|
-
if (mensagemLower.includes("o que") && (mensagemLower.includes("fazer") || mensagemLower.includes("pedir"))) {
|
|
56
|
-
return "Posso ajudar você com diversas tarefas! Posso:\n\n• Analisar dados e métricas dos seus projetos\n• Responder perguntas sobre performance e resultados\n• Sugerir otimizações e melhorias\n• Gerar relatórios e documentação\n• Ajudar no planejamento de sprints\n• E muito mais!\n\nQual tarefa você gostaria de realizar primeiro?";
|
|
57
|
-
}
|
|
58
|
-
if (mensagemLower.includes("o que você faz") || mensagemLower.includes("quem é você")) {
|
|
59
|
-
return "Olá! Sou o Assistente Xertica, uma IA desenvolvida para ajudar você a gerenciar projetos, analisar dados e otimizar processos. Estou aqui 24/7 para responder suas perguntas e auxiliar nas suas tarefas diárias.\n\nPosso processar documentos, analisar áudios e imagens, além de fornecer insights baseados nos dados da plataforma.";
|
|
60
|
-
}
|
|
61
|
-
if (mensagemLower.includes("projeto") && (mensagemLower.includes("preocupar") || mensagemLower.includes("atenção"))) {
|
|
62
|
-
return "Com base na análise dos seus projetos ativos, recomendo focar nos seguintes:\n\n1. **Projeto Alpha** - 15% acima do prazo, requer atenção imediata\n2. **Sistema Beta** - Performance crítica, necessita otimização\n3. **Mobile Gamma** - Aguardando aprovações há 5 dias\n\nGostaria de mais detalhes sobre algum deles?";
|
|
63
|
-
}
|
|
64
|
-
if (mensagemLower.includes("próximo projeto") || mensagemLower.includes("próxima tarefa")) {
|
|
65
|
-
return "Seu próximo projeto prioritário é o **Sistema de Analytics V2**.\n\n📅 Início previsto: Próxima segunda-feira\n👥 Time: 5 desenvolvedores\n⏱️ Duração estimada: 3 sprints\n\nJá preparei um roadmap inicial. Gostaria de revisar?";
|
|
66
|
-
}
|
|
67
|
-
if (mensagemLower.includes("desempenho") || mensagemLower.includes("performance") || mensagemLower.includes("melhor")) {
|
|
68
|
-
return "Analisando os dados de performance dos últimos 30 dias:\n\n🏆 **Melhor Performance:**\n• Projeto Dashboard 2.0: +35% eficiência\n• Sistema CRM: -40% tempo de resposta\n• App Mobile: 4.8★ rating (+0.5)\n\n📊 Todos estão acima das metas estabelecidas. Parabéns!\n\nQuer ver métricas detalhadas?";
|
|
69
|
-
}
|
|
70
|
-
if (mensagemLower.includes("olá") || mensagemLower.includes("oi") || mensagemLower.includes("bom dia") || mensagemLower.includes("boa tarde") || mensagemLower.includes("boa noite")) {
|
|
71
|
-
return "Olá! 👋 Como posso ajudar você hoje? Estou pronto para auxiliar com análises, relatórios ou responder suas dúvidas sobre os projetos.";
|
|
72
|
-
}
|
|
73
|
-
if (mensagemLower.includes("obrigado") || mensagemLower.includes("obrigada")) {
|
|
74
|
-
return "Por nada! Estou aqui sempre que precisar. 😊 Se tiver mais alguma dúvida ou precisar de ajuda, é só chamar!";
|
|
75
|
-
}
|
|
76
|
-
if (mensagemLower.includes("criar documento")) {
|
|
77
|
-
const tema = mensagemOriginal.replace(/📄 \[Criar documento\]/gi, "").trim() || "Novo Documento";
|
|
78
|
-
return {
|
|
79
|
-
content: `📝 Documento criado com sucesso!
|
|
80
|
-
|
|
81
|
-
Gerei um documento completo sobre "${tema}". O documento está pronto para revisão e pode ser editado conforme necessário.`,
|
|
82
|
-
attachmentType: "document",
|
|
83
|
-
attachmentName: `Documento - ${tema}.md`,
|
|
84
|
-
documentTitle: tema,
|
|
85
|
-
documentContent: `# ${tema}
|
|
86
|
-
|
|
87
|
-
## Introdução
|
|
88
|
-
Este é um documento gerado automaticamente sobre ${tema}.
|
|
89
|
-
|
|
90
|
-
## Detalhes
|
|
91
|
-
- Item 1
|
|
92
|
-
- Item 2
|
|
93
|
-
|
|
94
|
-
## Conclusão
|
|
95
|
-
Documento finalizado.`
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
if (mensagemLower.includes("gráfico") || mensagemLower.includes("chart")) {
|
|
99
|
-
return {
|
|
100
|
-
content: "Aqui está a análise de performance solicitada:",
|
|
101
|
-
chartData: [
|
|
102
|
-
{ month: "Jan", desktop: 186, mobile: 80 },
|
|
103
|
-
{ month: "Fev", desktop: 305, mobile: 200 },
|
|
104
|
-
{ month: "Mar", desktop: 237, mobile: 120 },
|
|
105
|
-
{ month: "Abr", desktop: 73, mobile: 190 },
|
|
106
|
-
{ month: "Mai", desktop: 209, mobile: 130 },
|
|
107
|
-
{ month: "Jun", desktop: 214, mobile: 140 }
|
|
108
|
-
],
|
|
109
|
-
chartConfig: {
|
|
110
|
-
desktop: { label: "Desktop", color: "hsl(var(--primary))" },
|
|
111
|
-
mobile: { label: "Mobile", color: "hsl(var(--destructive))" }
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
if (mensagemLower.includes("tabela") || mensagemLower.includes("table")) {
|
|
116
|
-
return {
|
|
117
|
-
content: "Aqui estão os dados estruturados conforme solicitado:",
|
|
118
|
-
tableData: {
|
|
119
|
-
caption: "Lista de Projetos Ativos",
|
|
120
|
-
headers: ["Projeto", "Status", "Prazo"],
|
|
121
|
-
rows: [
|
|
122
|
-
["Alpha", "Em andamento", "15/05"],
|
|
123
|
-
["Beta", "Concluido", "02/04"],
|
|
124
|
-
["Gamma", "Atrasado", "10/01"]
|
|
125
|
-
]
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
if (mensagemLower.includes("exemplo de documento")) {
|
|
130
|
-
return {
|
|
131
|
-
content: "Com certeza! Aqui está um exemplo de documento profissional que acabei de gerar:",
|
|
132
|
-
attachmentType: "document",
|
|
133
|
-
attachmentName: "Proposta_Comercial_Xertica.md",
|
|
134
|
-
documentTitle: "Proposta Comercial Xertica",
|
|
135
|
-
documentContent: "# Proposta Comercial\n\n## 1. Visão Geral\nNossa solução oferece o melhor desempenho para sua empresa.\n\n## 2. Investimento\nO valor total é de R$ 50.000,00."
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
if (mensagemLower.includes("arquivo") || mensagemLower.includes("documento")) {
|
|
139
|
-
return "Entendi que você deseja trabalhar com arquivos. Posso analisar diversos tipos de documentos:\n\n📄 Documentos de texto (PDF, DOCX)\n📊 Planilhas (XLSX, CSV)\n📈 Relatórios e apresentações\n\nBasta enviá-los usando o botão de anexo (📎) e terei prazer em analisá-los para você!";
|
|
140
|
-
}
|
|
141
|
-
const respostasGenericas = [
|
|
142
|
-
"Entendo sua questão. Com base nos dados disponíveis na plataforma Xertica, posso fornecer análises detalhadas sobre esse tema. Poderia me dar mais contexto para que eu possa ajudá-lo melhor?",
|
|
143
|
-
"Interessante! Deixe-me processar isso... Com base no seu histórico e nos dados do sistema, recomendo que possamos explorar essa questão em mais detalhes. O que especificamente você gostaria de saber?",
|
|
144
|
-
"Ótima pergunta! Para te dar a melhor resposta possível, preciso entender melhor o contexto. Você pode me fornecer mais informações sobre o que está buscando?",
|
|
145
|
-
"Estou analisando sua solicitação. Baseado nos dados do sistema Xertica, posso te ajudar com isso. Você gostaria de uma análise rápida ou um relatório completo?"
|
|
146
|
-
];
|
|
147
|
-
return respostasGenericas[Math.floor(Math.random() * respostasGenericas.length)];
|
|
148
|
-
};
|
|
149
|
-
const DEFAULT_SUGGESTIONS = [
|
|
150
|
-
{ id: "1", text: "Me ajude a criar um documento profissional" },
|
|
151
|
-
{ id: "2", text: 'Buscar nos meus arquivos por "relatório"' },
|
|
152
|
-
{ id: "3", text: "Resuma as conversas importantes desta semana" },
|
|
153
|
-
{ id: "4", text: "Crie um podcast sobre o último projeto" }
|
|
154
|
-
];
|
|
155
|
-
function useAssistant({
|
|
156
|
-
mode = "expanded",
|
|
157
|
-
isExpanded: controlledIsExpanded,
|
|
158
|
-
onToggle,
|
|
159
|
-
defaultTab = "chat",
|
|
160
|
-
demoMode = true,
|
|
161
|
-
customResponses = [],
|
|
162
|
-
initialMessages = [],
|
|
163
|
-
savedConversations = [],
|
|
164
|
-
suggestions: propSuggestions,
|
|
165
|
-
onSendMessage,
|
|
166
|
-
isProcessing = false,
|
|
167
|
-
responseGenerator,
|
|
168
|
-
richSuggestions = [],
|
|
169
|
-
onRichAction,
|
|
170
|
-
onEvaluation
|
|
171
|
-
} = {}) {
|
|
172
|
-
const isFullPage = mode === "fullPage";
|
|
173
|
-
const [internalIsExpanded, setInternalIsExpanded] = React.useState(controlledIsExpanded ?? true);
|
|
174
|
-
const isExpanded = controlledIsExpanded ?? internalIsExpanded;
|
|
175
|
-
const [isMobile, setIsMobile] = React.useState(false);
|
|
176
|
-
React.useEffect(() => {
|
|
177
|
-
const handleResize = () => setIsMobile(window.innerWidth < 768);
|
|
178
|
-
handleResize();
|
|
179
|
-
window.addEventListener("resize", handleResize);
|
|
180
|
-
return () => window.removeEventListener("resize", handleResize);
|
|
181
|
-
}, []);
|
|
182
|
-
const [abaSelecionada, setAbaSelecionada] = React.useState(defaultTab);
|
|
183
|
-
const [mensagens, setMensagens] = React.useState(initialMessages);
|
|
184
|
-
const [mensagem, setMensagem] = React.useState("");
|
|
185
|
-
const [conversas, setConversas] = React.useState(savedConversations);
|
|
186
|
-
const [conversaAtual, setConversaAtual] = React.useState(null);
|
|
187
|
-
const [copiedId, setCopiedId] = React.useState(null);
|
|
188
|
-
const [generatingPodcastId, setGeneratingPodcastId] = React.useState(null);
|
|
189
|
-
const [executingCommand, setExecutingCommand] = React.useState(null);
|
|
190
|
-
const [savedSearches, setSavedSearches] = React.useState([]);
|
|
191
|
-
const [editingDocument, setEditingDocument] = React.useState(null);
|
|
192
|
-
const [showMoreSuggestions, setShowMoreSuggestions] = React.useState(false);
|
|
193
|
-
const [evaluationState, setEvaluationState] = React.useState({
|
|
194
|
-
isOpen: false,
|
|
195
|
-
messageId: null,
|
|
196
|
-
type: null,
|
|
197
|
-
category: null,
|
|
198
|
-
reason: ""
|
|
199
|
-
});
|
|
200
|
-
const messagesEndRef = React.useRef(null);
|
|
201
|
-
const fileInputRef = React.useRef(null);
|
|
202
|
-
const audioInputRef = React.useRef(null);
|
|
203
|
-
const sugestoes = propSuggestions ?? DEFAULT_SUGGESTIONS;
|
|
204
|
-
React.useEffect(() => {
|
|
205
|
-
if (messagesEndRef.current && abaSelecionada === "chat") {
|
|
206
|
-
messagesEndRef.current.scrollIntoView({ behavior: "smooth" });
|
|
207
|
-
}
|
|
208
|
-
}, [mensagens, abaSelecionada]);
|
|
209
|
-
React.useEffect(() => {
|
|
210
|
-
if (initialMessages && initialMessages.length > 0) {
|
|
211
|
-
setMensagens(initialMessages);
|
|
212
|
-
}
|
|
213
|
-
}, [initialMessages]);
|
|
214
|
-
const conversasFiltradas = conversas.filter((conversa) => {
|
|
215
|
-
if (abaSelecionada === "favoritos") return conversa.isFavorite;
|
|
216
|
-
return true;
|
|
217
|
-
});
|
|
218
|
-
const handleToggle = React.useCallback(() => {
|
|
219
|
-
if (onToggle) {
|
|
220
|
-
onToggle();
|
|
221
|
-
} else {
|
|
222
|
-
setInternalIsExpanded((prev) => !prev);
|
|
223
|
-
}
|
|
224
|
-
}, [onToggle]);
|
|
225
|
-
const handleExpandWithTab = React.useCallback((tab) => {
|
|
226
|
-
setAbaSelecionada(tab);
|
|
227
|
-
if (onToggle) {
|
|
228
|
-
onToggle();
|
|
229
|
-
} else {
|
|
230
|
-
setInternalIsExpanded(true);
|
|
231
|
-
}
|
|
232
|
-
}, [onToggle]);
|
|
233
|
-
const handleEnviarMensagem = React.useCallback(async (arg) => {
|
|
234
|
-
let msgToSend = mensagem;
|
|
235
|
-
if (typeof arg === "string" && !["document", "podcast", "search"].includes(arg)) {
|
|
236
|
-
msgToSend = arg;
|
|
237
|
-
}
|
|
238
|
-
if (!msgToSend.trim() || isProcessing) return;
|
|
239
|
-
const novaMensagem = {
|
|
240
|
-
id: `msg-${Date.now()}`,
|
|
241
|
-
type: "user",
|
|
242
|
-
content: msgToSend,
|
|
243
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
244
|
-
isFavorite: false
|
|
245
|
-
};
|
|
246
|
-
setMensagens((prev) => [...prev, novaMensagem]);
|
|
247
|
-
if (onSendMessage) {
|
|
248
|
-
onSendMessage(msgToSend);
|
|
249
|
-
}
|
|
250
|
-
if (demoMode || responseGenerator) {
|
|
251
|
-
const mensagemAtual = msgToSend;
|
|
252
|
-
setTimeout(async () => {
|
|
253
|
-
let resposta;
|
|
254
|
-
if (responseGenerator) {
|
|
255
|
-
resposta = await responseGenerator(mensagemAtual);
|
|
256
|
-
} else {
|
|
257
|
-
resposta = gerarResposta(mensagemAtual, customResponses);
|
|
258
|
-
}
|
|
259
|
-
let novaMensagemIA = {
|
|
260
|
-
id: `msg-${Date.now()}-ia`,
|
|
261
|
-
type: "assistant",
|
|
262
|
-
content: "",
|
|
263
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
264
|
-
isFavorite: false
|
|
265
|
-
};
|
|
266
|
-
if (typeof resposta === "string") {
|
|
267
|
-
novaMensagemIA.content = resposta;
|
|
268
|
-
} else {
|
|
269
|
-
novaMensagemIA = { ...novaMensagemIA, ...resposta };
|
|
270
|
-
}
|
|
271
|
-
setMensagens((prev) => [...prev, novaMensagemIA]);
|
|
272
|
-
}, 1e3 + Math.random() * 1e3);
|
|
273
|
-
}
|
|
274
|
-
setMensagem("");
|
|
275
|
-
}, [mensagem, isProcessing, onSendMessage, demoMode, responseGenerator, customResponses]);
|
|
276
|
-
const handleToggleFavorite = React.useCallback((messageId) => {
|
|
277
|
-
setMensagens(
|
|
278
|
-
(prev) => prev.map(
|
|
279
|
-
(msg) => msg.id === messageId ? { ...msg, isFavorite: !msg.isFavorite } : msg
|
|
280
|
-
)
|
|
281
|
-
);
|
|
282
|
-
}, []);
|
|
283
|
-
const handleCopyMessage = React.useCallback(async (content, messageId) => {
|
|
284
|
-
try {
|
|
285
|
-
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
286
|
-
try {
|
|
287
|
-
await navigator.clipboard.writeText(content);
|
|
288
|
-
setCopiedId(messageId);
|
|
289
|
-
setTimeout(() => setCopiedId(null), 2e3);
|
|
290
|
-
} catch (clipboardError) {
|
|
291
|
-
if (clipboardError.name === "NotAllowedError" || clipboardError.message.includes("permissions policy")) {
|
|
292
|
-
throw new Error("Clipboard permission denied, falling back");
|
|
293
|
-
}
|
|
294
|
-
throw clipboardError;
|
|
295
|
-
}
|
|
296
|
-
} else {
|
|
297
|
-
throw new Error("Clipboard API not available");
|
|
298
|
-
}
|
|
299
|
-
} catch {
|
|
300
|
-
try {
|
|
301
|
-
const textArea = document.createElement("textarea");
|
|
302
|
-
textArea.value = content;
|
|
303
|
-
textArea.style.position = "fixed";
|
|
304
|
-
textArea.style.left = "-999999px";
|
|
305
|
-
textArea.style.top = "-999999px";
|
|
306
|
-
document.body.appendChild(textArea);
|
|
307
|
-
textArea.focus();
|
|
308
|
-
textArea.select();
|
|
309
|
-
const successful = document.execCommand("copy");
|
|
310
|
-
document.body.removeChild(textArea);
|
|
311
|
-
if (successful) {
|
|
312
|
-
setCopiedId(messageId);
|
|
313
|
-
setTimeout(() => setCopiedId(null), 2e3);
|
|
314
|
-
}
|
|
315
|
-
} catch (fallbackErr) {
|
|
316
|
-
console.error("Falha ao copiar:", fallbackErr);
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
}, []);
|
|
320
|
-
const handleGeneratePodcast = React.useCallback(async (messageId, content) => {
|
|
321
|
-
setGeneratingPodcastId(messageId);
|
|
322
|
-
setTimeout(() => {
|
|
323
|
-
setMensagens(
|
|
324
|
-
(prev) => prev.map(
|
|
325
|
-
(msg) => msg.id === messageId ? {
|
|
326
|
-
...msg,
|
|
327
|
-
attachmentType: "podcast",
|
|
328
|
-
attachmentName: "Podcast - " + content.substring(0, 30) + "...",
|
|
329
|
-
audioUrl: "data:audio/mpeg;base64,//uQx..."
|
|
330
|
-
} : msg
|
|
331
|
-
)
|
|
332
|
-
);
|
|
333
|
-
setGeneratingPodcastId(null);
|
|
334
|
-
}, 2e3);
|
|
335
|
-
}, []);
|
|
336
|
-
const handleDownloadDocument = React.useCallback((content, fileName) => {
|
|
337
|
-
const blob = new Blob([content], { type: "text/markdown" });
|
|
338
|
-
const url = URL.createObjectURL(blob);
|
|
339
|
-
const a = document.createElement("a");
|
|
340
|
-
a.href = url;
|
|
341
|
-
a.download = fileName.endsWith(".md") ? fileName : fileName + ".md";
|
|
342
|
-
document.body.appendChild(a);
|
|
343
|
-
a.click();
|
|
344
|
-
document.body.removeChild(a);
|
|
345
|
-
URL.revokeObjectURL(url);
|
|
346
|
-
}, []);
|
|
347
|
-
const handleDownloadPodcast = React.useCallback((audioUrl, fileName) => {
|
|
348
|
-
const a = document.createElement("a");
|
|
349
|
-
a.href = audioUrl;
|
|
350
|
-
a.download = fileName.endsWith(".mp3") ? fileName : fileName + ".mp3";
|
|
351
|
-
document.body.appendChild(a);
|
|
352
|
-
a.click();
|
|
353
|
-
document.body.removeChild(a);
|
|
354
|
-
}, []);
|
|
355
|
-
const handleEditDocument = React.useCallback((content, title) => {
|
|
356
|
-
setEditingDocument({ content, title });
|
|
357
|
-
}, []);
|
|
358
|
-
const handleNovaConversa = React.useCallback(() => {
|
|
359
|
-
setMensagens([]);
|
|
360
|
-
setConversaAtual(null);
|
|
361
|
-
setAbaSelecionada("chat");
|
|
362
|
-
}, []);
|
|
363
|
-
const handleSelecionarConversa = React.useCallback((conversaId) => {
|
|
364
|
-
const conversa = conversas.find((c) => c.id === conversaId);
|
|
365
|
-
if (conversa) {
|
|
366
|
-
setMensagens(conversa.messages);
|
|
367
|
-
setConversaAtual(conversaId);
|
|
368
|
-
setAbaSelecionada("chat");
|
|
369
|
-
}
|
|
370
|
-
}, [conversas]);
|
|
371
|
-
const handleToggleFavoritaConversa = React.useCallback((conversaId) => {
|
|
372
|
-
setConversas(
|
|
373
|
-
(prev) => prev.map(
|
|
374
|
-
(conv) => conv.id === conversaId ? { ...conv, isFavorite: !conv.isFavorite } : conv
|
|
375
|
-
)
|
|
376
|
-
);
|
|
377
|
-
}, []);
|
|
378
|
-
const handleOpenSearchResult = React.useCallback((result) => {
|
|
379
|
-
console.log("Abrir resultado:", result);
|
|
380
|
-
}, []);
|
|
381
|
-
const handleExecuteSearchCommand = React.useCallback(async (commandId, searchTerm, results, messageId) => {
|
|
382
|
-
setExecutingCommand(commandId);
|
|
383
|
-
setTimeout(() => {
|
|
384
|
-
if (commandId === "5") {
|
|
385
|
-
setSavedSearches((prev) => [...prev, messageId]);
|
|
386
|
-
}
|
|
387
|
-
setExecutingCommand(null);
|
|
388
|
-
}, 1500);
|
|
389
|
-
}, []);
|
|
390
|
-
const handleRichSuggestionClick = React.useCallback((suggestion) => {
|
|
391
|
-
if (onRichAction) {
|
|
392
|
-
onRichAction(suggestion.id, suggestion.text);
|
|
393
|
-
} else {
|
|
394
|
-
handleEnviarMensagem(suggestion.text);
|
|
395
|
-
}
|
|
396
|
-
setShowMoreSuggestions(false);
|
|
397
|
-
}, [onRichAction, handleEnviarMensagem]);
|
|
398
|
-
const handleEvaluationClick = React.useCallback((messageId, type) => {
|
|
399
|
-
if (type === "like") {
|
|
400
|
-
if (onEvaluation) onEvaluation(messageId, "like");
|
|
401
|
-
setMensagens((prev) => prev.map((m) => m.id === messageId ? { ...m, evaluation: "like" } : m));
|
|
402
|
-
sonner.toast.success("Obrigado por avaliar positivamente!");
|
|
403
|
-
}
|
|
404
|
-
}, [onEvaluation]);
|
|
405
|
-
const openFeedbackDialog = React.useCallback((messageId, category) => {
|
|
406
|
-
setEvaluationState({
|
|
407
|
-
isOpen: true,
|
|
408
|
-
messageId,
|
|
409
|
-
type: "dislike",
|
|
410
|
-
category,
|
|
411
|
-
reason: ""
|
|
412
|
-
});
|
|
413
|
-
}, []);
|
|
414
|
-
const handleSubmitDislike = React.useCallback(() => {
|
|
415
|
-
if (evaluationState.messageId) {
|
|
416
|
-
const finalReason = evaluationState.category ? evaluationState.reason ? `${evaluationState.category}: ${evaluationState.reason}` : evaluationState.category : evaluationState.reason;
|
|
417
|
-
if (onEvaluation) {
|
|
418
|
-
onEvaluation(evaluationState.messageId, "dislike", finalReason);
|
|
419
|
-
}
|
|
420
|
-
setMensagens(
|
|
421
|
-
(prev) => prev.map(
|
|
422
|
-
(m) => m.id === evaluationState.messageId ? { ...m, evaluation: "dislike", evaluationReason: finalReason } : m
|
|
423
|
-
)
|
|
424
|
-
);
|
|
425
|
-
sonner.toast.success("Obrigado pelo seu feedback. Vamos melhorar.");
|
|
426
|
-
}
|
|
427
|
-
setEvaluationState({ isOpen: false, messageId: null, type: null, category: null, reason: "" });
|
|
428
|
-
}, [evaluationState, onEvaluation]);
|
|
429
|
-
return {
|
|
430
|
-
// Layout
|
|
431
|
-
isFullPage,
|
|
432
|
-
isExpanded,
|
|
433
|
-
isMobile,
|
|
434
|
-
abaSelecionada,
|
|
435
|
-
setAbaSelecionada,
|
|
436
|
-
// Messages
|
|
437
|
-
mensagens,
|
|
438
|
-
setMensagens,
|
|
439
|
-
mensagem,
|
|
440
|
-
setMensagem,
|
|
441
|
-
// Conversations
|
|
442
|
-
conversas,
|
|
443
|
-
conversaAtual,
|
|
444
|
-
conversasFiltradas,
|
|
445
|
-
// UI
|
|
446
|
-
copiedId,
|
|
447
|
-
generatingPodcastId,
|
|
448
|
-
executingCommand,
|
|
449
|
-
savedSearches,
|
|
450
|
-
editingDocument,
|
|
451
|
-
setEditingDocument,
|
|
452
|
-
showMoreSuggestions,
|
|
453
|
-
setShowMoreSuggestions,
|
|
454
|
-
evaluationState,
|
|
455
|
-
setEvaluationState,
|
|
456
|
-
// Suggestions
|
|
457
|
-
sugestoes,
|
|
458
|
-
// Refs
|
|
459
|
-
messagesEndRef,
|
|
460
|
-
fileInputRef,
|
|
461
|
-
audioInputRef,
|
|
462
|
-
// Handlers
|
|
463
|
-
handleToggle,
|
|
464
|
-
handleExpandWithTab,
|
|
465
|
-
handleEnviarMensagem,
|
|
466
|
-
handleToggleFavorite,
|
|
467
|
-
handleCopyMessage,
|
|
468
|
-
handleGeneratePodcast,
|
|
469
|
-
handleDownloadDocument,
|
|
470
|
-
handleDownloadPodcast,
|
|
471
|
-
handleEditDocument,
|
|
472
|
-
handleNovaConversa,
|
|
473
|
-
handleSelecionarConversa,
|
|
474
|
-
handleToggleFavoritaConversa,
|
|
475
|
-
handleOpenSearchResult,
|
|
476
|
-
handleExecuteSearchCommand,
|
|
477
|
-
handleRichSuggestionClick,
|
|
478
|
-
handleEvaluationClick,
|
|
479
|
-
openFeedbackDialog,
|
|
480
|
-
handleSubmitDislike
|
|
481
|
-
};
|
|
482
|
-
}
|
|
483
32
|
function MarkdownMessage({ content, className = "" }) {
|
|
484
33
|
const convertMarkdownToHtml = (markdown) => {
|
|
485
34
|
let html = markdown;
|
|
@@ -1016,9 +565,126 @@ function ModernChatInput({
|
|
|
1016
565
|
transition: { delay: 0.1 },
|
|
1017
566
|
children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "O assistente Xertica pode cometer erros. Considere verificar informações importantes." })
|
|
1018
567
|
}
|
|
1019
|
-
)
|
|
1020
|
-
] });
|
|
1021
|
-
}
|
|
568
|
+
)
|
|
569
|
+
] });
|
|
570
|
+
}
|
|
571
|
+
[
|
|
572
|
+
{ id: "rich-1", text: "Ver exemplo de Gráfico", icon: React.createElement(lucideReact.BarChart3, { className: "w-4 h-4 mr-2" }) },
|
|
573
|
+
{ id: "rich-2", text: "Ver exemplo de Imagem", icon: React.createElement(lucideReact.ImageIcon, { className: "w-4 h-4 mr-2" }) },
|
|
574
|
+
{ id: "rich-3", text: "Ver exemplo de Tabela", icon: React.createElement(lucideReact.Table, { className: "w-4 h-4 mr-2" }) },
|
|
575
|
+
{ id: "rich-4", text: "Ver exemplo de Documento", icon: React.createElement(lucideReact.FileText, { className: "w-4 h-4 mr-2" }) }
|
|
576
|
+
];
|
|
577
|
+
const gerarResposta = (mensagemUsuario, customResponses) => {
|
|
578
|
+
const mensagemLower = mensagemUsuario.toLowerCase();
|
|
579
|
+
if (customResponses && customResponses.length > 0) {
|
|
580
|
+
for (const mock of customResponses) {
|
|
581
|
+
const trigger = mock.trigger;
|
|
582
|
+
let match = false;
|
|
583
|
+
if (trigger instanceof RegExp) {
|
|
584
|
+
match = trigger.test(mensagemUsuario);
|
|
585
|
+
} else {
|
|
586
|
+
match = mensagemLower.includes(trigger.toLowerCase());
|
|
587
|
+
}
|
|
588
|
+
if (match) {
|
|
589
|
+
return mock.response;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
const mensagemOriginal = mensagemUsuario;
|
|
594
|
+
if (mensagemLower.includes("o que") && (mensagemLower.includes("fazer") || mensagemLower.includes("pedir"))) {
|
|
595
|
+
return "Posso ajudar você com diversas tarefas! Posso:\n\n• Analisar dados e métricas dos seus projetos\n• Responder perguntas sobre performance e resultados\n• Sugerir otimizações e melhorias\n• Gerar relatórios e documentação\n• Ajudar no planejamento de sprints\n• E muito mais!\n\nQual tarefa você gostaria de realizar primeiro?";
|
|
596
|
+
}
|
|
597
|
+
if (mensagemLower.includes("o que você faz") || mensagemLower.includes("quem é você")) {
|
|
598
|
+
return "Olá! Sou o Assistente Xertica, uma IA desenvolvida para ajudar você a gerenciar projetos, analisar dados e otimizar processos. Estou aqui 24/7 para responder suas perguntas e auxiliar nas suas tarefas diárias.\n\nPosso processar documentos, analisar áudios e imagens, além de fornecer insights baseados nos dados da plataforma.";
|
|
599
|
+
}
|
|
600
|
+
if (mensagemLower.includes("projeto") && (mensagemLower.includes("preocupar") || mensagemLower.includes("atenção"))) {
|
|
601
|
+
return "Com base na análise dos seus projetos ativos, recomendo focar nos seguintes:\n\n1. **Projeto Alpha** - 15% acima do prazo, requer atenção imediata\n2. **Sistema Beta** - Performance crítica, necessita otimização\n3. **Mobile Gamma** - Aguardando aprovações há 5 dias\n\nGostaria de mais detalhes sobre algum deles?";
|
|
602
|
+
}
|
|
603
|
+
if (mensagemLower.includes("próximo projeto") || mensagemLower.includes("próxima tarefa")) {
|
|
604
|
+
return "Seu próximo projeto prioritário é o **Sistema de Analytics V2**.\n\n📅 Início previsto: Próxima segunda-feira\n👥 Time: 5 desenvolvedores\n⏱️ Duração estimada: 3 sprints\n\nJá preparei um roadmap inicial. Gostaria de revisar?";
|
|
605
|
+
}
|
|
606
|
+
if (mensagemLower.includes("desempenho") || mensagemLower.includes("performance") || mensagemLower.includes("melhor")) {
|
|
607
|
+
return "Analisando os dados de performance dos últimos 30 dias:\n\n🏆 **Melhor Performance:**\n• Projeto Dashboard 2.0: +35% eficiência\n• Sistema CRM: -40% tempo de resposta\n• App Mobile: 4.8★ rating (+0.5)\n\n📊 Todos estão acima das metas estabelecidas. Parabéns!\n\nQuer ver métricas detalhadas?";
|
|
608
|
+
}
|
|
609
|
+
if (mensagemLower.includes("olá") || mensagemLower.includes("oi") || mensagemLower.includes("bom dia") || mensagemLower.includes("boa tarde") || mensagemLower.includes("boa noite")) {
|
|
610
|
+
return "Olá! 👋 Como posso ajudar você hoje? Estou pronto para auxiliar com análises, relatórios ou responder suas dúvidas sobre os projetos.";
|
|
611
|
+
}
|
|
612
|
+
if (mensagemLower.includes("obrigado") || mensagemLower.includes("obrigada")) {
|
|
613
|
+
return "Por nada! Estou aqui sempre que precisar. 😊 Se tiver mais alguma dúvida ou precisar de ajuda, é só chamar!";
|
|
614
|
+
}
|
|
615
|
+
if (mensagemLower.includes("criar documento")) {
|
|
616
|
+
const tema = mensagemOriginal.replace(/📄 \[Criar documento\]/gi, "").trim() || "Novo Documento";
|
|
617
|
+
return {
|
|
618
|
+
content: `📝 Documento criado com sucesso!
|
|
619
|
+
|
|
620
|
+
Gerei um documento completo sobre "${tema}". O documento está pronto para revisão e pode ser editado conforme necessário.`,
|
|
621
|
+
attachmentType: "document",
|
|
622
|
+
attachmentName: `Documento - ${tema}.md`,
|
|
623
|
+
documentTitle: tema,
|
|
624
|
+
documentContent: `# ${tema}
|
|
625
|
+
|
|
626
|
+
## Introdução
|
|
627
|
+
Este é um documento gerado automaticamente sobre ${tema}.
|
|
628
|
+
|
|
629
|
+
## Detalhes
|
|
630
|
+
- Item 1
|
|
631
|
+
- Item 2
|
|
632
|
+
|
|
633
|
+
## Conclusão
|
|
634
|
+
Documento finalizado.`
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
if (mensagemLower.includes("gráfico") || mensagemLower.includes("chart")) {
|
|
638
|
+
return {
|
|
639
|
+
content: "Aqui está a análise de performance solicitada:",
|
|
640
|
+
chartData: [
|
|
641
|
+
{ month: "Jan", desktop: 186, mobile: 80 },
|
|
642
|
+
{ month: "Fev", desktop: 305, mobile: 200 },
|
|
643
|
+
{ month: "Mar", desktop: 237, mobile: 120 },
|
|
644
|
+
{ month: "Abr", desktop: 73, mobile: 190 },
|
|
645
|
+
{ month: "Mai", desktop: 209, mobile: 130 },
|
|
646
|
+
{ month: "Jun", desktop: 214, mobile: 140 }
|
|
647
|
+
],
|
|
648
|
+
chartConfig: {
|
|
649
|
+
desktop: { label: "Desktop", color: "hsl(var(--primary))" },
|
|
650
|
+
mobile: { label: "Mobile", color: "hsl(var(--destructive))" }
|
|
651
|
+
}
|
|
652
|
+
};
|
|
653
|
+
}
|
|
654
|
+
if (mensagemLower.includes("tabela") || mensagemLower.includes("table")) {
|
|
655
|
+
return {
|
|
656
|
+
content: "Aqui estão os dados estruturados conforme solicitado:",
|
|
657
|
+
tableData: {
|
|
658
|
+
caption: "Lista de Projetos Ativos",
|
|
659
|
+
headers: ["Projeto", "Status", "Prazo"],
|
|
660
|
+
rows: [
|
|
661
|
+
["Alpha", "Em andamento", "15/05"],
|
|
662
|
+
["Beta", "Concluido", "02/04"],
|
|
663
|
+
["Gamma", "Atrasado", "10/01"]
|
|
664
|
+
]
|
|
665
|
+
}
|
|
666
|
+
};
|
|
667
|
+
}
|
|
668
|
+
if (mensagemLower.includes("exemplo de documento")) {
|
|
669
|
+
return {
|
|
670
|
+
content: "Com certeza! Aqui está um exemplo de documento profissional que acabei de gerar:",
|
|
671
|
+
attachmentType: "document",
|
|
672
|
+
attachmentName: "Proposta_Comercial_Xertica.md",
|
|
673
|
+
documentTitle: "Proposta Comercial Xertica",
|
|
674
|
+
documentContent: "# Proposta Comercial\n\n## 1. Visão Geral\nNossa solução oferece o melhor desempenho para sua empresa.\n\n## 2. Investimento\nO valor total é de R$ 50.000,00."
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
if (mensagemLower.includes("arquivo") || mensagemLower.includes("documento")) {
|
|
678
|
+
return "Entendi que você deseja trabalhar com arquivos. Posso analisar diversos tipos de documentos:\n\n📄 Documentos de texto (PDF, DOCX)\n📊 Planilhas (XLSX, CSV)\n📈 Relatórios e apresentações\n\nBasta enviá-los usando o botão de anexo (📎) e terei prazer em analisá-los para você!";
|
|
679
|
+
}
|
|
680
|
+
const respostasGenericas = [
|
|
681
|
+
"Entendo sua questão. Com base nos dados disponíveis na plataforma Xertica, posso fornecer análises detalhadas sobre esse tema. Poderia me dar mais contexto para que eu possa ajudá-lo melhor?",
|
|
682
|
+
"Interessante! Deixe-me processar isso... Com base no seu histórico e nos dados do sistema, recomendo que possamos explorar essa questão em mais detalhes. O que especificamente você gostaria de saber?",
|
|
683
|
+
"Ótima pergunta! Para te dar a melhor resposta possível, preciso entender melhor o contexto. Você pode me fornecer mais informações sobre o que está buscando?",
|
|
684
|
+
"Estou analisando sua solicitação. Baseado nos dados do sistema Xertica, posso te ajudar com isso. Você gostaria de uma análise rápida ou um relatório completo?"
|
|
685
|
+
];
|
|
686
|
+
return respostasGenericas[Math.floor(Math.random() * respostasGenericas.length)];
|
|
687
|
+
};
|
|
1022
688
|
function AssistantTooltipContent({
|
|
1023
689
|
className,
|
|
1024
690
|
sideOffset = 0,
|
|
@@ -1071,7 +737,6 @@ function XerticaAssistant({
|
|
|
1071
737
|
customResponses = [],
|
|
1072
738
|
responseGenerator,
|
|
1073
739
|
richSuggestions = [],
|
|
1074
|
-
welcomeMessage = "Como posso ajudar?",
|
|
1075
740
|
onRichAction,
|
|
1076
741
|
onEvaluation,
|
|
1077
742
|
feedbackOptions,
|
|
@@ -1084,67 +749,262 @@ function XerticaAssistant({
|
|
|
1084
749
|
enablePodcastGeneration = true,
|
|
1085
750
|
enableSearch = true
|
|
1086
751
|
}) {
|
|
1087
|
-
const
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
752
|
+
const isFullPage = mode === "fullPage";
|
|
753
|
+
const [internalIsExpanded, setInternalIsExpanded] = React.useState(controlledIsExpanded ?? true);
|
|
754
|
+
const isExpanded = controlledIsExpanded ?? internalIsExpanded;
|
|
755
|
+
const [isMobile, setIsMobile] = React.useState(false);
|
|
756
|
+
React.useEffect(() => {
|
|
757
|
+
const handleResize = () => setIsMobile(window.innerWidth < 768);
|
|
758
|
+
handleResize();
|
|
759
|
+
window.addEventListener("resize", handleResize);
|
|
760
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
761
|
+
}, []);
|
|
762
|
+
const [abaSelecionada, setAbaSelecionada] = React.useState(defaultTab);
|
|
763
|
+
const [mensagens, setMensagens] = React.useState(initialMessages);
|
|
764
|
+
const [mensagem, setMensagem] = React.useState("");
|
|
765
|
+
const [conversas, setConversas] = React.useState(savedConversations);
|
|
766
|
+
const [conversaAtual, setConversaAtual] = React.useState(null);
|
|
767
|
+
const [copiedId, setCopiedId] = React.useState(null);
|
|
768
|
+
const [generatingPodcastId, setGeneratingPodcastId] = React.useState(null);
|
|
769
|
+
const [executingCommand, setExecutingCommand] = React.useState(null);
|
|
770
|
+
const [savedSearches, setSavedSearches] = React.useState([]);
|
|
771
|
+
const [editingDocument, setEditingDocument] = React.useState(null);
|
|
772
|
+
const [showMoreSuggestions, setShowMoreSuggestions] = React.useState(false);
|
|
773
|
+
const [evaluationState, setEvaluationState] = React.useState({
|
|
774
|
+
isOpen: false,
|
|
775
|
+
messageId: null,
|
|
776
|
+
type: null,
|
|
777
|
+
category: null,
|
|
778
|
+
reason: ""
|
|
779
|
+
});
|
|
780
|
+
const messagesEndRef = React.useRef(null);
|
|
781
|
+
const fileInputRef = React.useRef(null);
|
|
782
|
+
const audioInputRef = React.useRef(null);
|
|
783
|
+
const defaultSuggestions = [
|
|
784
|
+
{ id: "1", text: "Me ajude a criar um documento profissional" },
|
|
785
|
+
{ id: "2", text: 'Buscar nos meus arquivos por "relatório"' },
|
|
786
|
+
{ id: "3", text: "Resuma as conversas importantes desta semana" },
|
|
787
|
+
{ id: "4", text: "Crie um podcast sobre o último projeto" }
|
|
788
|
+
];
|
|
789
|
+
const sugestoes = propSuggestions ?? defaultSuggestions;
|
|
790
|
+
React.useEffect(() => {
|
|
791
|
+
if (messagesEndRef.current && abaSelecionada === "chat") {
|
|
792
|
+
messagesEndRef.current.scrollIntoView({ behavior: "smooth" });
|
|
793
|
+
}
|
|
794
|
+
}, [mensagens, abaSelecionada]);
|
|
795
|
+
React.useEffect(() => {
|
|
796
|
+
if (initialMessages && initialMessages.length > 0) {
|
|
797
|
+
setMensagens(initialMessages);
|
|
798
|
+
}
|
|
799
|
+
}, [initialMessages]);
|
|
800
|
+
const handleToggle = () => {
|
|
801
|
+
if (onToggle) {
|
|
802
|
+
onToggle();
|
|
803
|
+
} else {
|
|
804
|
+
setInternalIsExpanded(!internalIsExpanded);
|
|
805
|
+
}
|
|
806
|
+
};
|
|
807
|
+
const handleExpandWithTab = (tab) => {
|
|
808
|
+
setAbaSelecionada(tab);
|
|
809
|
+
if (onToggle) {
|
|
810
|
+
onToggle();
|
|
811
|
+
} else {
|
|
812
|
+
setInternalIsExpanded(true);
|
|
813
|
+
}
|
|
814
|
+
};
|
|
815
|
+
const handleEnviarMensagem = async (arg) => {
|
|
816
|
+
let msgToSend = mensagem;
|
|
817
|
+
if (typeof arg === "string" && !["document", "podcast", "search"].includes(arg)) {
|
|
818
|
+
msgToSend = arg;
|
|
819
|
+
}
|
|
820
|
+
if (!msgToSend.trim() || isProcessing) return;
|
|
821
|
+
const novaMensagem = {
|
|
822
|
+
id: `msg-${Date.now()}`,
|
|
823
|
+
type: "user",
|
|
824
|
+
content: msgToSend,
|
|
825
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
826
|
+
isFavorite: false
|
|
827
|
+
};
|
|
828
|
+
setMensagens((prev) => [...prev, novaMensagem]);
|
|
829
|
+
if (onSendMessage) {
|
|
830
|
+
onSendMessage(msgToSend);
|
|
831
|
+
}
|
|
832
|
+
if (demoMode || responseGenerator) {
|
|
833
|
+
const mensagemAtual = msgToSend;
|
|
834
|
+
setTimeout(async () => {
|
|
835
|
+
let resposta;
|
|
836
|
+
if (responseGenerator) {
|
|
837
|
+
resposta = await responseGenerator(mensagemAtual);
|
|
838
|
+
} else {
|
|
839
|
+
resposta = gerarResposta(mensagemAtual, customResponses);
|
|
840
|
+
}
|
|
841
|
+
let novaMensagemIA = {
|
|
842
|
+
id: `msg-${Date.now()}-ia`,
|
|
843
|
+
type: "assistant",
|
|
844
|
+
content: "",
|
|
845
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
846
|
+
isFavorite: false
|
|
847
|
+
};
|
|
848
|
+
if (typeof resposta === "string") {
|
|
849
|
+
novaMensagemIA.content = resposta;
|
|
850
|
+
} else {
|
|
851
|
+
novaMensagemIA = { ...novaMensagemIA, ...resposta };
|
|
852
|
+
}
|
|
853
|
+
setMensagens((prev) => [...prev, novaMensagemIA]);
|
|
854
|
+
}, 1e3 + Math.random() * 1e3);
|
|
855
|
+
}
|
|
856
|
+
setMensagem("");
|
|
857
|
+
};
|
|
858
|
+
const handleCopyMessage = async (content, messageId) => {
|
|
859
|
+
try {
|
|
860
|
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
861
|
+
try {
|
|
862
|
+
await navigator.clipboard.writeText(content);
|
|
863
|
+
setCopiedId(messageId);
|
|
864
|
+
setTimeout(() => setCopiedId(null), 2e3);
|
|
865
|
+
} catch (clipboardError) {
|
|
866
|
+
if (clipboardError.name === "NotAllowedError" || clipboardError.message.includes("permissions policy")) {
|
|
867
|
+
throw new Error("Clipboard permission denied, falling back");
|
|
868
|
+
}
|
|
869
|
+
throw clipboardError;
|
|
870
|
+
}
|
|
871
|
+
} else {
|
|
872
|
+
throw new Error("Clipboard API not available");
|
|
873
|
+
}
|
|
874
|
+
} catch (err) {
|
|
875
|
+
try {
|
|
876
|
+
const textArea = document.createElement("textarea");
|
|
877
|
+
textArea.value = content;
|
|
878
|
+
textArea.style.position = "fixed";
|
|
879
|
+
textArea.style.left = "-999999px";
|
|
880
|
+
textArea.style.top = "-999999px";
|
|
881
|
+
document.body.appendChild(textArea);
|
|
882
|
+
textArea.focus();
|
|
883
|
+
textArea.select();
|
|
884
|
+
const successful = document.execCommand("copy");
|
|
885
|
+
document.body.removeChild(textArea);
|
|
886
|
+
if (successful) {
|
|
887
|
+
setCopiedId(messageId);
|
|
888
|
+
setTimeout(() => setCopiedId(null), 2e3);
|
|
889
|
+
} else {
|
|
890
|
+
console.error("Falha ao copiar: execCommand returned false");
|
|
891
|
+
}
|
|
892
|
+
} catch (fallbackErr) {
|
|
893
|
+
console.error("Falha ao copiar:", fallbackErr);
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
};
|
|
897
|
+
const handleGeneratePodcast = async (messageId, content) => {
|
|
898
|
+
setGeneratingPodcastId(messageId);
|
|
899
|
+
setTimeout(() => {
|
|
900
|
+
setMensagens(
|
|
901
|
+
(prev) => prev.map(
|
|
902
|
+
(msg) => msg.id === messageId ? {
|
|
903
|
+
...msg,
|
|
904
|
+
attachmentType: "podcast",
|
|
905
|
+
attachmentName: "Podcast - " + content.substring(0, 30) + "...",
|
|
906
|
+
audioUrl: "data:audio/mpeg;base64,//uQx..."
|
|
907
|
+
// Mock
|
|
908
|
+
} : msg
|
|
909
|
+
)
|
|
910
|
+
);
|
|
911
|
+
setGeneratingPodcastId(null);
|
|
912
|
+
}, 2e3);
|
|
913
|
+
};
|
|
914
|
+
const handleDownloadDocument = (content, fileName) => {
|
|
915
|
+
const blob = new Blob([content], { type: "text/markdown" });
|
|
916
|
+
const url = URL.createObjectURL(blob);
|
|
917
|
+
const a = document.createElement("a");
|
|
918
|
+
a.href = url;
|
|
919
|
+
a.download = fileName.endsWith(".md") ? fileName : fileName + ".md";
|
|
920
|
+
document.body.appendChild(a);
|
|
921
|
+
a.click();
|
|
922
|
+
document.body.removeChild(a);
|
|
923
|
+
URL.revokeObjectURL(url);
|
|
924
|
+
};
|
|
925
|
+
const handleDownloadPodcast = (audioUrl, fileName) => {
|
|
926
|
+
const a = document.createElement("a");
|
|
927
|
+
a.href = audioUrl;
|
|
928
|
+
a.download = fileName.endsWith(".mp3") ? fileName : fileName + ".mp3";
|
|
929
|
+
document.body.appendChild(a);
|
|
930
|
+
a.click();
|
|
931
|
+
document.body.removeChild(a);
|
|
932
|
+
};
|
|
933
|
+
const handleEditDocument = (content, title) => {
|
|
934
|
+
setEditingDocument({ content, title });
|
|
935
|
+
};
|
|
936
|
+
const handleNovaConversa = () => {
|
|
937
|
+
setMensagens([]);
|
|
938
|
+
setConversaAtual(null);
|
|
939
|
+
setAbaSelecionada("chat");
|
|
940
|
+
};
|
|
941
|
+
const handleSelecionarConversa = (conversaId) => {
|
|
942
|
+
const conversa = conversas.find((c) => c.id === conversaId);
|
|
943
|
+
if (conversa) {
|
|
944
|
+
setMensagens(conversa.messages);
|
|
945
|
+
setConversaAtual(conversaId);
|
|
946
|
+
setAbaSelecionada("chat");
|
|
947
|
+
}
|
|
948
|
+
};
|
|
949
|
+
const handleToggleFavoritaConversa = (conversaId) => {
|
|
950
|
+
setConversas(
|
|
951
|
+
(prev) => prev.map(
|
|
952
|
+
(conv) => conv.id === conversaId ? { ...conv, isFavorite: !conv.isFavorite } : conv
|
|
953
|
+
)
|
|
954
|
+
);
|
|
955
|
+
};
|
|
956
|
+
const handleOpenSearchResult = (result) => {
|
|
957
|
+
console.log("Abrir resultado:", result);
|
|
958
|
+
};
|
|
959
|
+
const handleExecuteSearchCommand = async (commandId, searchTerm, results, messageId) => {
|
|
960
|
+
setExecutingCommand(commandId);
|
|
961
|
+
setTimeout(() => {
|
|
962
|
+
if (commandId === "5") {
|
|
963
|
+
setSavedSearches((prev) => [...prev, messageId]);
|
|
964
|
+
}
|
|
965
|
+
setExecutingCommand(null);
|
|
966
|
+
}, 1500);
|
|
967
|
+
};
|
|
968
|
+
const handleRichSuggestionClick = (suggestion) => {
|
|
969
|
+
if (onRichAction) {
|
|
970
|
+
onRichAction(suggestion.id, suggestion.text);
|
|
971
|
+
} else {
|
|
972
|
+
handleEnviarMensagem(suggestion.text);
|
|
973
|
+
}
|
|
974
|
+
setShowMoreSuggestions(false);
|
|
975
|
+
};
|
|
976
|
+
const handleEvaluationClick = (messageId, type) => {
|
|
977
|
+
{
|
|
978
|
+
if (onEvaluation) onEvaluation(messageId, "like");
|
|
979
|
+
setMensagens((prev) => prev.map((m) => m.id === messageId ? { ...m, evaluation: "like" } : m));
|
|
980
|
+
sonner.toast.success("Obrigado por avaliar positivamente!");
|
|
981
|
+
}
|
|
982
|
+
};
|
|
983
|
+
const openFeedbackDialog = (messageId, category) => {
|
|
984
|
+
setEvaluationState({
|
|
985
|
+
isOpen: true,
|
|
986
|
+
messageId,
|
|
987
|
+
type: "dislike",
|
|
988
|
+
category,
|
|
989
|
+
reason: ""
|
|
990
|
+
});
|
|
991
|
+
};
|
|
992
|
+
const handleSubmitDislike = () => {
|
|
993
|
+
if (evaluationState.messageId) {
|
|
994
|
+
const finalReason = evaluationState.category ? evaluationState.reason ? `${evaluationState.category}: ${evaluationState.reason}` : evaluationState.category : evaluationState.reason;
|
|
995
|
+
if (onEvaluation) {
|
|
996
|
+
onEvaluation(evaluationState.messageId, "dislike", finalReason);
|
|
997
|
+
}
|
|
998
|
+
setMensagens((prev) => prev.map((m) => m.id === evaluationState.messageId ? { ...m, evaluation: "dislike", evaluationReason: finalReason } : m));
|
|
999
|
+
sonner.toast.success("Obrigado pelo seu feedback. Vamos melhorar.");
|
|
1000
|
+
}
|
|
1001
|
+
setEvaluationState({ isOpen: false, messageId: null, type: null, category: null, reason: "" });
|
|
1002
|
+
};
|
|
1003
|
+
const conversasFiltradas = conversas.filter((conversa) => {
|
|
1004
|
+
if (abaSelecionada === "favoritos") {
|
|
1005
|
+
return conversa.isFavorite;
|
|
1006
|
+
}
|
|
1007
|
+
return true;
|
|
1148
1008
|
});
|
|
1149
1009
|
const containerWidth = width ?? (isFullPage ? "100%" : isExpanded ? editingDocument ? "420px" : "420px" : "80px");
|
|
1150
1010
|
const containerHeight = height ?? "h-full";
|
|
@@ -1242,7 +1102,7 @@ function XerticaAssistant({
|
|
|
1242
1102
|
richTextEditor.RichTextEditor,
|
|
1243
1103
|
{
|
|
1244
1104
|
value: editingDocument.content || "",
|
|
1245
|
-
onChange: (newVal) => setEditingDocument(
|
|
1105
|
+
onChange: (newVal) => setEditingDocument((prev) => prev ? { ...prev, content: newVal } : null),
|
|
1246
1106
|
placeholder: "Comece a digitar o conteúdo do seu documento aqui...",
|
|
1247
1107
|
className: "max-w-4xl mx-auto h-full",
|
|
1248
1108
|
actionButton: /* @__PURE__ */ jsxRuntime.jsxs(button.Button, { size: "sm", className: "gap-2 h-8", children: [
|
|
@@ -1455,9 +1315,9 @@ function XerticaAssistant({
|
|
|
1455
1315
|
"Olá, ",
|
|
1456
1316
|
userName
|
|
1457
1317
|
] }),
|
|
1458
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground", children:
|
|
1318
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground", children: "Como posso ajudar?" })
|
|
1459
1319
|
] }),
|
|
1460
|
-
|
|
1320
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-4 pb-4 space-y-2", children: [
|
|
1461
1321
|
sugestoes.map((sugestao) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1462
1322
|
"button",
|
|
1463
1323
|
{
|
|
@@ -1467,7 +1327,7 @@ function XerticaAssistant({
|
|
|
1467
1327
|
},
|
|
1468
1328
|
sugestao.id
|
|
1469
1329
|
)),
|
|
1470
|
-
|
|
1330
|
+
!showMoreSuggestions ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1471
1331
|
button.Button,
|
|
1472
1332
|
{
|
|
1473
1333
|
variant: "ghost",
|
|
@@ -1480,7 +1340,7 @@ function XerticaAssistant({
|
|
|
1480
1340
|
]
|
|
1481
1341
|
}
|
|
1482
1342
|
) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2 pt-2 border-t border-border mt-2 animate-in slide-in-from-top-2", children: [
|
|
1483
|
-
richSuggestions.map((sugestao) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1343
|
+
richSuggestions.length > 0 ? richSuggestions.map((sugestao) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1484
1344
|
"button",
|
|
1485
1345
|
{
|
|
1486
1346
|
onClick: () => handleRichSuggestionClick(sugestao),
|
|
@@ -1492,7 +1352,7 @@ function XerticaAssistant({
|
|
|
1492
1352
|
] })
|
|
1493
1353
|
},
|
|
1494
1354
|
sugestao.id
|
|
1495
|
-
)),
|
|
1355
|
+
)) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground text-center py-2", children: "Nenhuma sugestão extra." }),
|
|
1496
1356
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1497
1357
|
button.Button,
|
|
1498
1358
|
{
|
|
@@ -1506,7 +1366,7 @@ function XerticaAssistant({
|
|
|
1506
1366
|
]
|
|
1507
1367
|
}
|
|
1508
1368
|
)
|
|
1509
|
-
] })
|
|
1369
|
+
] })
|
|
1510
1370
|
] })
|
|
1511
1371
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(input.ScrollArea, { className: "flex-1 min-h-0 overflow-x-hidden [&_[data-radix-scroll-area-viewport]>div]:!block", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 px-4 py-4 max-w-6xl mx-auto !block !w-full", children: [
|
|
1512
1372
|
mensagens.map((msg) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1823,7 +1683,7 @@ function XerticaAssistant({
|
|
|
1823
1683
|
"h-6 w-6 rounded-full hover:bg-green-100 dark:hover:bg-green-900/20 hover:text-green-600",
|
|
1824
1684
|
msg.evaluation === "like" && "text-green-600 bg-green-100 dark:bg-green-900/20"
|
|
1825
1685
|
),
|
|
1826
|
-
onClick: () => handleEvaluationClick(msg.id
|
|
1686
|
+
onClick: () => handleEvaluationClick(msg.id),
|
|
1827
1687
|
title: "Gostei",
|
|
1828
1688
|
"aria-label": "Gostei",
|
|
1829
1689
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ThumbsUp, { className: "h-3.5 w-3.5" })
|
|
@@ -1988,7 +1848,7 @@ function XerticaAssistant({
|
|
|
1988
1848
|
var _a;
|
|
1989
1849
|
return (_a = audioInputRef.current) == null ? void 0 : _a.click();
|
|
1990
1850
|
} : void 0,
|
|
1991
|
-
placeholder: "Envie uma mensagem",
|
|
1851
|
+
placeholder: "Envie uma mensagem para Xertica",
|
|
1992
1852
|
disabled: isProcessing,
|
|
1993
1853
|
isFullPage,
|
|
1994
1854
|
enableAudioInput,
|
|
@@ -2032,4 +1892,3 @@ exports.MarkdownMessage = MarkdownMessage;
|
|
|
2032
1892
|
exports.ModernChatInput = ModernChatInput;
|
|
2033
1893
|
exports.XerticaAssistant = XerticaAssistant;
|
|
2034
1894
|
exports.gerarResposta = gerarResposta;
|
|
2035
|
-
exports.useAssistant = useAssistant;
|