xertica-ui 2.1.2 → 2.1.3
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 +31 -0
- package/README.md +1 -1
- package/assets/xertica-logo.svg +37 -37
- package/assets/xertica-x-logo.svg +20 -20
- package/bin/cli.ts +1 -1
- package/bin/generate-tokens.ts +13 -7
- package/components/assistant/index.ts +6 -6
- package/components/assistant/xertica-assistant/index.ts +2 -0
- package/components/assistant/xertica-assistant/use-assistant.ts +564 -0
- package/components/assistant/xertica-assistant/xertica-assistant.stories.tsx +200 -0
- package/components/assistant/xertica-assistant/xertica-assistant.tsx +183 -474
- package/components/blocks/card-patterns/ActivityCard.tsx +72 -72
- package/components/blocks/card-patterns/FeatureCard.tsx +100 -100
- package/components/blocks/card-patterns/NotificationCard.tsx +127 -127
- package/components/blocks/card-patterns/ProfileCard.tsx +84 -84
- package/components/blocks/card-patterns/ProjectCard.tsx +89 -89
- package/components/blocks/card-patterns/QuickActionCard.tsx +62 -62
- package/components/blocks/card-patterns/card-patterns.stories.tsx +445 -445
- package/components/blocks/card-patterns/index.ts +17 -17
- package/components/blocks/index.ts +1 -1
- package/components/brand/index.ts +6 -6
- package/components/brand/xertica-provider/XerticaProvider.tsx +48 -48
- package/components/brand/xertica-provider/xertica-provider.mdx +61 -61
- package/components/brand/xertica-provider/xertica-provider.test.tsx +52 -52
- package/components/examples/MapExamples.tsx +282 -282
- package/components/examples/SimpleFilterableMap.tsx +191 -191
- package/components/examples/index.ts +51 -51
- package/components/figma/ImageWithFallback.tsx +27 -27
- package/components/hooks/index.ts +7 -7
- package/components/index.ts +5 -5
- package/components/layout/header/header.test.tsx +8 -8
- package/components/layout/header/header.tsx +4 -4
- package/components/layout/index.ts +2 -2
- package/components/layout/sidebar/index.ts +2 -0
- package/components/layout/sidebar/sidebar.mdx +1 -1
- package/components/layout/sidebar/sidebar.stories.tsx +160 -8
- package/components/layout/sidebar/sidebar.test.tsx +11 -11
- package/components/layout/sidebar/sidebar.tsx +610 -471
- package/components/layout/sidebar/use-sidebar.ts +113 -0
- package/components/media/FloatingMediaWrapper.tsx +11 -11
- package/components/media/audio-player/AudioPlayer.tsx +22 -22
- package/components/media/index.ts +3 -3
- package/components/pages/home-content/HomeContent.tsx +7 -7
- package/components/pages/home-content/home-content.mdx +62 -62
- package/components/pages/home-page/HomePage.stories.tsx +39 -39
- package/components/pages/home-page/HomePage.tsx +1 -1
- package/components/pages/home-page/home-page.mdx +53 -53
- package/components/pages/index.ts +8 -8
- package/components/pages/template-content/TemplateContent.tsx +5 -5
- package/components/pages/template-content/template-content.mdx +61 -61
- package/components/pages/template-page/TemplatePage.stories.tsx +39 -39
- package/components/pages/template-page/TemplatePage.tsx +5 -5
- package/components/pages/template-page/template-page.mdx +53 -53
- package/components/public-api-smoke.test.tsx +52 -52
- package/components/shared/assistant-utils.ts +43 -43
- package/components/shared/layout-constants.ts +1 -1
- package/components/ui/accordion/accordion.mdx +8 -8
- package/components/ui/accordion/accordion.stories.tsx +53 -53
- 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/badge/badge.tsx +9 -9
- 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/calendar/calendar.tsx +258 -258
- package/components/ui/card/card.mdx +8 -8
- package/components/ui/card/card.stories.tsx +245 -245
- package/components/ui/carousel/carousel.mdx +8 -8
- package/components/ui/chart/chart.mdx +8 -8
- package/components/ui/chart/chart.stories.tsx +1303 -344
- package/components/ui/chart/chart.test.tsx +154 -154
- package/components/ui/chart/chart.tsx +2367 -1494
- package/components/ui/checkbox/checkbox.mdx +8 -8
- package/components/ui/checkbox/checkbox.stories.tsx +20 -20
- 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/file-upload/file-upload.stories.tsx +100 -0
- package/components/ui/file-upload/file-upload.tsx +14 -74
- package/components/ui/file-upload/index.ts +1 -0
- package/components/ui/file-upload/use-file-upload.ts +181 -0
- package/components/ui/google-maps-loader/google-maps-loader.tsx +2 -2
- 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/input-otp/input-otp.stories.tsx +6 -6
- package/components/ui/label/label.mdx +8 -8
- package/components/ui/map/map.mdx +8 -8
- package/components/ui/map/map.stories.tsx +51 -51
- package/components/ui/map/map.tsx +2 -2
- 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/index.ts +2 -0
- package/components/ui/pagination/pagination.mdx +8 -8
- package/components/ui/pagination/pagination.stories.tsx +94 -0
- package/components/ui/pagination/use-pagination.ts +194 -0
- package/components/ui/popover/popover.mdx +8 -8
- package/components/ui/progress/progress.mdx +8 -8
- package/components/ui/progress/progress.tsx +68 -68
- 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/rich-text-editor/index.ts +2 -0
- package/components/ui/rich-text-editor/rich-text-editor.stories.tsx +129 -1
- package/components/ui/rich-text-editor/rich-text-editor.tsx +86 -305
- package/components/ui/rich-text-editor/use-rich-text-editor.ts +439 -0
- package/components/ui/route-map/route-map.mdx +8 -8
- package/components/ui/route-map/route-map.stories.tsx +54 -54
- package/components/ui/route-map/route-map.tsx +2 -2
- 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/select/select.stories.tsx +9 -9
- package/components/ui/separator/separator.mdx +8 -8
- package/components/ui/sheet/sheet.mdx +8 -8
- package/components/ui/sheet/sheet.stories.tsx +95 -95
- package/components/ui/simple-map/simple-map.mdx +8 -8
- package/components/ui/simple-map/simple-map.stories.tsx +48 -48
- 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/stats-card.mdx +8 -8
- package/components/ui/stepper/index.ts +3 -1
- package/components/ui/stepper/stepper.mdx +8 -8
- package/components/ui/stepper/stepper.stories.tsx +116 -0
- package/components/ui/stepper/stepper.tsx +4 -4
- package/components/ui/stepper/use-stepper.ts +137 -0
- package/components/ui/switch/switch.mdx +8 -8
- package/components/ui/switch/switch.stories.tsx +20 -20
- package/components/ui/table/table.mdx +8 -8
- package/components/ui/tabs/tabs.mdx +8 -8
- package/components/ui/tabs/tabs.stories.tsx +26 -26
- 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/index.ts +4 -1
- package/components/ui/tree-view/tree-view.mdx +8 -8
- package/components/ui/tree-view/tree-view.stories.tsx +110 -4
- package/components/ui/tree-view/tree-view.tsx +17 -125
- package/components/ui/tree-view/use-tree-view.ts +229 -0
- package/components.json +1512 -1512
- package/contexts/ApiKeyContext.tsx +72 -72
- package/contexts/BrandColorsContext.tsx +26 -26
- package/contexts/LanguageContext.tsx +13 -13
- package/contexts/LayoutContext.test.tsx +11 -11
- package/contexts/LayoutContext.tsx +29 -29
- package/contexts/ThemeContext.tsx +26 -26
- package/contexts/theme-data.ts +4 -4
- package/dist/{AssistantChart-CVzmmhx4.js → AssistantChart-C_hwFRRr.js} +4 -4
- package/dist/{AssistantChart-BAx9VQvb.cjs → AssistantChart-CldVCVDe.cjs} +311 -94
- package/dist/{AssistantChart-CVko2A1W.js → AssistantChart-Cu3m7RBo.js} +314 -97
- package/dist/{AssistantChart-9w31gdAb.cjs → AssistantChart-DoZCyS5r.cjs} +4 -4
- package/dist/AudioPlayer-B1lt5cPl.cjs +989 -0
- package/dist/AudioPlayer-BZ7bibzU.cjs +982 -0
- package/dist/AudioPlayer-C12BjQBV.cjs +997 -0
- package/dist/AudioPlayer-DMcG_c7L.js +990 -0
- package/dist/AudioPlayer-DcFKRJE_.js +998 -0
- package/dist/AudioPlayer-e8LfNoqO.js +983 -0
- package/dist/{xertica-assistant-Qp3ydksa.cjs → CodeBlock-7TTgmdGG.cjs} +263 -51
- package/dist/{xertica-assistant-gnCJdcZY.js → CodeBlock-BeSt1h5P.js} +219 -7
- package/dist/CodeBlock-BgfYL_rD.cjs +2094 -0
- package/dist/CodeBlock-BlcqlA9M.cjs +2094 -0
- package/dist/CodeBlock-Bnmeu5ez.cjs +2094 -0
- package/dist/CodeBlock-BtfPlbAI.js +2078 -0
- package/dist/CodeBlock-CIySIuYr.js +2078 -0
- package/dist/CodeBlock-CuPtUM-7.cjs +2094 -0
- package/dist/CodeBlock-D6ffWXgc.js +2078 -0
- package/dist/CodeBlock-D8dcwbit.cjs +2094 -0
- package/dist/CodeBlock-DMZrFnlw.cjs +2094 -0
- package/dist/CodeBlock-DlBehYN8.js +2078 -0
- package/dist/CodeBlock-DnYNI8rQ.js +2078 -0
- package/dist/CodeBlock-DvKWbSnE.cjs +2094 -0
- package/dist/CodeBlock-DwMCfkFY.js +2078 -0
- package/dist/CodeBlock-Dy6CNYyj.js +2078 -0
- package/dist/CodeBlock-U1pPOQI7.cjs +2094 -0
- package/dist/CodeBlock-f_GpNhEB.js +2078 -0
- package/dist/CodeBlock-oB6u8nI1.js +2078 -0
- package/dist/CodeBlock-tZC31B73.cjs +2094 -0
- package/dist/ImageWithFallback-CGtidP6B.cjs +4542 -0
- package/dist/ImageWithFallback-lsg3pdFg.js +4508 -0
- package/dist/LanguageSelector-B5YfbHra.js +231 -0
- package/dist/LanguageSelector-D6uacAIM.cjs +230 -0
- package/dist/LayoutContext-BAql6ZRY.js +97 -0
- package/dist/LayoutContext-BvK-ggDa.cjs +96 -0
- package/dist/ThemeContext-BoH4NLfN.js +734 -0
- package/dist/{ThemeContext-BbBNoFTG.js → ThemeContext-C2EwAPDt.js} +2 -2
- package/dist/ThemeContext-r69W20Xg.cjs +733 -0
- package/dist/{ThemeContext-Cmr8Ex8H.cjs → ThemeContext-vTjumZeM.cjs} +2 -2
- package/dist/{VerifyEmailPage-BE-L9mB7.js → VerifyEmailPage-C0c2e5n0.js} +7 -7
- package/dist/{VerifyEmailPage-DMBh4NM9.cjs → VerifyEmailPage-CYXtbKi3.cjs} +1 -1
- package/dist/{VerifyEmailPage-CR7kb5df.cjs → VerifyEmailPage-Cwi3kbol.cjs} +7 -7
- package/dist/{VerifyEmailPage-CdYPSJoO.js → VerifyEmailPage-DvMLZgFt.js} +1 -1
- package/dist/XerticaOrbe-KL1RBHzw.cjs +1354 -0
- package/dist/XerticaOrbe-zwS1p2a8.js +1355 -0
- package/dist/XerticaProvider-6btlAlzc.js +17 -0
- package/dist/XerticaProvider-BNoNOxQ5.cjs +16 -0
- package/dist/XerticaProvider-BlY2limY.cjs +38 -0
- package/dist/{XerticaProvider-BITjgC5p.js → XerticaProvider-CEoWMTxu.js} +2 -2
- package/dist/{XerticaProvider-By8q3Roe.cjs → XerticaProvider-CllrbMEJ.cjs} +2 -2
- package/dist/XerticaProvider-DDuiIcKo.js +39 -0
- package/dist/XerticaProvider-cI9hSs27.cjs +38 -0
- package/dist/XerticaProvider-hSwhNQex.js +39 -0
- package/dist/{alert-dialog-yckpaOpy.cjs → alert-dialog-DSKByiKZ.cjs} +3 -3
- package/dist/{alert-dialog-iDe5VE5o.js → alert-dialog-s-vmNkJ_.js} +3 -3
- package/dist/assistant.cjs.js +2 -1
- package/dist/assistant.es.js +3 -2
- package/dist/brand.cjs.js +1 -1
- package/dist/brand.es.js +1 -1
- package/dist/breadcrumb-CqJ7bHY5.js +161 -0
- package/dist/breadcrumb-m9Hb2_XN.cjs +177 -0
- package/dist/cli.js +14 -8
- package/dist/components/assistant/xertica-assistant/index.d.ts +2 -0
- package/dist/components/assistant/xertica-assistant/use-assistant.d.ts +126 -0
- package/dist/components/assistant/xertica-assistant/xertica-assistant.d.ts +7 -2
- package/dist/components/blocks/audio-player/AudioPlayer.d.ts +35 -0
- package/dist/components/blocks/audio-player/index.d.ts +1 -0
- package/dist/components/blocks/document-editor/DocumentEditor.d.ts +26 -0
- package/dist/components/blocks/document-editor/index.d.ts +1 -0
- package/dist/components/blocks/podcast-player/PodcastPlayer.d.ts +41 -0
- package/dist/components/blocks/podcast-player/index.d.ts +1 -0
- package/dist/components/layout/sidebar/index.d.ts +2 -0
- package/dist/components/layout/sidebar/sidebar.d.ts +80 -0
- package/dist/components/layout/sidebar/use-sidebar.d.ts +22 -0
- package/dist/components/shared/layout-constants.d.ts +1 -1
- package/dist/components/ui/button/button.d.ts +1 -1
- package/dist/components/ui/chart/chart.d.ts +162 -5
- package/dist/components/ui/file-upload/file-upload.d.ts +2 -0
- package/dist/components/ui/file-upload/index.d.ts +1 -0
- package/dist/components/ui/file-upload/use-file-upload.d.ts +49 -0
- package/dist/components/ui/pagination/index.d.ts +2 -0
- package/dist/components/ui/pagination/use-pagination.d.ts +78 -0
- package/dist/components/ui/rich-text-editor/index.d.ts +2 -0
- package/dist/components/ui/rich-text-editor/use-rich-text-editor.d.ts +107 -0
- package/dist/components/ui/stepper/index.d.ts +3 -1
- package/dist/components/ui/stepper/stepper.d.ts +2 -2
- package/dist/components/ui/stepper/use-stepper.d.ts +60 -0
- package/dist/components/ui/tree-view/index.d.ts +4 -1
- package/dist/components/ui/tree-view/tree-view.d.ts +4 -6
- package/dist/components/ui/tree-view/use-tree-view.d.ts +60 -0
- package/dist/dropdown-menu-BDB5CmQs.cjs +247 -0
- package/dist/dropdown-menu-DQidbKBD.js +231 -0
- package/dist/google-maps-loader-BFWp6VPd.js +287 -0
- package/dist/{google-maps-loader-t2IlYBzw.js → google-maps-loader-CTYySAun.js} +4 -0
- package/dist/{google-maps-loader-BqsYL48U.cjs → google-maps-loader-Y-QkD-Li.cjs} +5 -0
- package/dist/google-maps-loader-eS3uQ5TA.cjs +287 -0
- package/dist/header-Cgy6vYPk.cjs +731 -0
- package/dist/header-DRlT4jgI.js +715 -0
- package/dist/header-Dux00SI4.cjs +731 -0
- package/dist/header-EkGKXPsD.js +715 -0
- package/dist/header-WfEywpyc.cjs +731 -0
- package/dist/header-tifNQn2U.js +715 -0
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +1 -1
- package/dist/index-BhapVLVj.js +8 -0
- package/dist/{index-D3RLKRAs.cjs → index-COtD8bRW.cjs} +1 -1
- package/dist/index-D6fxYEY8.cjs +7 -0
- package/dist/index-DW5tYe26.js +8 -0
- package/dist/index.cjs.js +19 -8
- package/dist/index.es.js +39 -28
- package/dist/index.umd.js +1043 -470
- package/dist/input-2R4loU86.js +127 -0
- package/dist/input-DWANSKGb.cjs +145 -0
- package/dist/layout.cjs.js +89 -1
- package/dist/layout.es.js +90 -2
- package/dist/pages.cjs.js +1 -1
- package/dist/pages.es.js +1 -1
- package/dist/rich-text-editor-0mraWT5y.cjs +2376 -0
- package/dist/rich-text-editor-B6jMRLzk.cjs +1939 -0
- package/dist/rich-text-editor-B8_oYcIR.js +1730 -0
- package/dist/rich-text-editor-B9UbSXNb.js +1203 -0
- package/dist/rich-text-editor-BYuRBNBU.js +2373 -0
- package/dist/rich-text-editor-Bb9pySTs.cjs +2374 -0
- package/dist/rich-text-editor-BcL6L3cm.cjs +2374 -0
- package/dist/rich-text-editor-BoVZYtTs.cjs +2391 -0
- package/dist/rich-text-editor-CPV1lEPH.cjs +1748 -0
- package/dist/rich-text-editor-CoKqbCtu.cjs +1799 -0
- package/dist/rich-text-editor-Cw56T_mB.js +2356 -0
- package/dist/rich-text-editor-Cyt8qs2b.js +1921 -0
- package/dist/rich-text-editor-D6H84OcX.cjs +1220 -0
- package/dist/rich-text-editor-D76gD-QI.js +2328 -0
- package/dist/rich-text-editor-DKkokOnA.js +1781 -0
- package/dist/rich-text-editor-DNsdpN64.cjs +2359 -0
- package/dist/rich-text-editor-DfG8bCyY.js +2358 -0
- package/dist/rich-text-editor-DgF8s7xW.js +2949 -0
- package/dist/rich-text-editor-Dxjw31Z4.js +2341 -0
- package/dist/rich-text-editor-DzP0Epmb.js +2356 -0
- package/dist/rich-text-editor-mWoaSCE4.cjs +2966 -0
- package/dist/rich-text-editor-skplNlBM.cjs +2345 -0
- package/dist/select-Bkbr0f-Z.cjs +162 -0
- package/dist/select-CvIVdX2n.js +145 -0
- package/dist/sidebar-CK_0ZQHj.cjs +803 -0
- package/dist/sidebar-CUuOvYhK.js +787 -0
- package/dist/slider-Bc5Hd0y1.js +56 -0
- package/dist/slider-N7hFFj6X.cjs +73 -0
- package/dist/tooltip-Ded96neP.cjs +137 -0
- package/dist/tooltip-HDOoD2-0.js +120 -0
- package/dist/ui.cjs.js +14 -4
- package/dist/ui.es.js +26 -16
- package/dist/use-mobile-B0hNy_Y6.cjs +4303 -0
- package/dist/use-mobile-BXuYROXM.js +4202 -0
- package/dist/use-mobile-Bbd51ASU.cjs +4392 -0
- package/dist/use-mobile-Bk6CX-TC.js +4359 -0
- package/dist/use-mobile-BvYdisLP.js +4202 -0
- package/dist/use-mobile-BzuxjzNX.cjs +4392 -0
- package/dist/use-mobile-CG2-SdXV.cjs +4235 -0
- package/dist/use-mobile-CKb5pqTs.js +4269 -0
- package/dist/use-mobile-CYuAuGDl.js +4202 -0
- package/dist/use-mobile-CaENcqm-.js +4508 -0
- package/dist/use-mobile-CbrYgJGJ.js +4203 -0
- package/dist/use-mobile-DMOvImGQ.cjs +4542 -0
- package/dist/use-mobile-DRB3BQgD.cjs +4235 -0
- package/dist/use-mobile-DZvv7QMR.js +4359 -0
- package/dist/use-mobile-DdI_TXam.cjs +4235 -0
- package/dist/use-mobile-DlceKf8a.js +4359 -0
- package/dist/use-mobile-DsOnow1o.cjs +4236 -0
- package/dist/use-mobile-Kcj6jSnK.cjs +4392 -0
- package/dist/use-mobile-bnKcua_i.js +4202 -0
- package/dist/use-mobile-ncXBeE2z.cjs +4235 -0
- package/dist/{xertica-assistant-B1IaHXnB.cjs → xertica-assistant-dyP7KHM5.cjs} +533 -392
- package/dist/{xertica-assistant-DPsESB6t.js → xertica-assistant-yX1CFBBo.js} +535 -394
- package/dist/xertica-ui.css +2 -2
- package/docs/ai-usage.md +28 -10
- package/docs/architecture.md +76 -0
- package/docs/components/assistant.md +159 -0
- package/docs/components/calendar.md +154 -154
- package/docs/components/card-patterns.md +337 -337
- package/docs/components/card.md +235 -235
- package/docs/components/chart.md +354 -39
- package/docs/components/file-upload.md +119 -2
- package/docs/components/map.md +84 -84
- package/docs/components/pagination.md +187 -0
- package/docs/components/rich-text-editor.md +164 -0
- package/docs/components/sidebar.md +153 -4
- package/docs/components/stepper.md +157 -12
- package/docs/components/tree-view.md +164 -6
- package/docs/components/xertica-provider.md +24 -24
- package/docs/decision-tree.md +287 -287
- package/docs/getting-started.md +1 -1
- package/docs/guidelines.md +14 -8
- package/docs/layout.md +2 -2
- package/docs/llms.md +4 -4
- package/guidelines/Guidelines.md +252 -250
- package/hooks/useTheme.ts +3 -3
- package/imports/Podcast.tsx +388 -388
- package/imports/XerticaAi.tsx +45 -45
- package/imports/XerticaX.tsx +19 -19
- package/imports/svg-aueiaqngck.ts +11 -11
- package/imports/svg-v9krss1ozd.ts +16 -16
- package/imports/svg-vhrdofe3qe.ts +5 -5
- package/llms-compact.txt +327 -327
- package/llms.txt +160 -160
- package/package.json +203 -203
- package/styles/xertica/app-overrides/chat.css +61 -61
- package/styles/xertica/app-overrides/scrollbar.css +33 -33
- package/styles/xertica/integrations/google-maps.css +76 -76
- package/styles/xertica/integrations/sonner.css +73 -73
- package/styles/xertica/tokens.css +41 -12
- package/templates/CLAUDE.md +182 -172
- package/templates/guidelines/Guidelines.md +325 -313
- package/templates/package.json +3 -3
- package/templates/src/features/auth/index.ts +4 -4
- package/templates/src/features/auth/ui/AuthPageShell.tsx +34 -34
- package/templates/src/features/auth/ui/ForgotPasswordContent.tsx +70 -70
- package/templates/src/features/auth/ui/LoginContent.tsx +90 -90
- package/templates/src/features/auth/ui/ResetPasswordContent.tsx +151 -151
- package/templates/src/features/auth/ui/SocialLoginButtons.tsx +59 -59
- package/templates/src/features/auth/ui/VerifyEmailContent.tsx +82 -82
- package/templates/src/features/home/index.ts +1 -1
- package/templates/src/features/home/ui/HomeContent.tsx +100 -100
- package/templates/src/features/template/index.ts +5 -5
- package/templates/src/features/template/ui/CrudTemplate.tsx +3 -3
- package/templates/src/features/template/ui/DashboardTemplate.tsx +3 -3
- package/templates/src/features/template/ui/FormTemplate.tsx +120 -120
- package/templates/src/features/template/ui/LoginTemplate.tsx +3 -3
- package/templates/src/pages/AssistantPage.tsx +328 -328
- package/templates/src/pages/ForgotPasswordPage.tsx +6 -6
- package/templates/src/pages/HomePage.tsx +57 -57
- package/templates/src/pages/LoginPage.tsx +10 -10
- package/templates/src/pages/ResetPasswordPage.tsx +6 -6
- package/templates/src/pages/TemplatePage.tsx +30 -30
- package/templates/src/pages/VerifyEmailPage.tsx +6 -6
- package/templates/src/shared/config/navigation.ts +20 -20
- package/templates/src/shared/lib/auth.ts +20 -20
- package/templates/src/shared/types/auth.ts +3 -3
- package/templates/src/styles/xertica/tokens.css +39 -10
- package/templates/tsconfig.json +5 -5
- package/utils/gemini.ts +140 -140
- package/dist/VerifyEmailPage-Bae2cBXT.cjs +0 -2827
- package/dist/VerifyEmailPage-CbgjOF0v.js +0 -2828
- package/dist/index-CkTUgOwX.js +0 -8
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MockResponse } from '../../shared/assistant-utils';
|
|
3
|
+
import { useAssistant } from './use-assistant';
|
|
2
4
|
import { motion, AnimatePresence } from 'framer-motion';
|
|
3
5
|
import {
|
|
4
6
|
MessageSquare,
|
|
@@ -241,8 +243,6 @@ export type AssistantTab = 'chat' | 'historico' | 'favoritos';
|
|
|
241
243
|
// Component Props
|
|
242
244
|
// ============================================================================
|
|
243
245
|
|
|
244
|
-
import { gerarResposta, type MockResponse } from '../../shared/assistant-utils';
|
|
245
|
-
|
|
246
246
|
export interface XerticaAssistantProps {
|
|
247
247
|
/**
|
|
248
248
|
* Layout mode for the assistant panel
|
|
@@ -310,6 +310,12 @@ export interface XerticaAssistantProps {
|
|
|
310
310
|
*/
|
|
311
311
|
suggestions?: Suggestion[];
|
|
312
312
|
|
|
313
|
+
/**
|
|
314
|
+
* Subtitle shown below the user's name in the empty state.
|
|
315
|
+
* @default 'Como posso ajudar?'
|
|
316
|
+
*/
|
|
317
|
+
welcomeMessage?: string;
|
|
318
|
+
|
|
313
319
|
/**
|
|
314
320
|
* Callback fired when the user sends a message
|
|
315
321
|
*/
|
|
@@ -480,6 +486,7 @@ export function XerticaAssistant({
|
|
|
480
486
|
customResponses = [],
|
|
481
487
|
responseGenerator,
|
|
482
488
|
richSuggestions = [],
|
|
489
|
+
welcomeMessage = 'Como posso ajudar?',
|
|
483
490
|
onRichAction,
|
|
484
491
|
onEvaluation,
|
|
485
492
|
feedbackOptions,
|
|
@@ -493,368 +500,70 @@ export function XerticaAssistant({
|
|
|
493
500
|
enableSearch = true,
|
|
494
501
|
}: XerticaAssistantProps) {
|
|
495
502
|
// ============================================================================
|
|
496
|
-
// State
|
|
497
|
-
// ============================================================================
|
|
498
|
-
|
|
499
|
-
const isFullPage = mode === 'fullPage';
|
|
500
|
-
const [internalIsExpanded, setInternalIsExpanded] = useState(controlledIsExpanded ?? true);
|
|
501
|
-
const isExpanded = controlledIsExpanded ?? internalIsExpanded;
|
|
502
|
-
|
|
503
|
-
const [isMobile, setIsMobile] = useState(false);
|
|
504
|
-
useEffect(() => {
|
|
505
|
-
const handleResize = () => setIsMobile(window.innerWidth < 768);
|
|
506
|
-
handleResize();
|
|
507
|
-
window.addEventListener('resize', handleResize);
|
|
508
|
-
return () => window.removeEventListener('resize', handleResize);
|
|
509
|
-
}, []);
|
|
510
|
-
|
|
511
|
-
const [abaSelecionada, setAbaSelecionada] = useState<AssistantTab>(defaultTab);
|
|
512
|
-
const [mensagens, setMensagens] = useState<Message[]>(initialMessages);
|
|
513
|
-
const [mensagem, setMensagem] = useState('');
|
|
514
|
-
const [conversas, setConversas] = useState<Conversation[]>(savedConversations);
|
|
515
|
-
const [conversaAtual, setConversaAtual] = useState<string | null>(null);
|
|
516
|
-
const [copiedId, setCopiedId] = useState<string | null>(null);
|
|
517
|
-
const [generatingPodcastId, setGeneratingPodcastId] = useState<string | null>(null);
|
|
518
|
-
const [executingCommand, setExecutingCommand] = useState<string | null>(null);
|
|
519
|
-
const [savedSearches, setSavedSearches] = useState<string[]>([]);
|
|
520
|
-
const [editingDocument, setEditingDocument] = useState<{
|
|
521
|
-
content: string;
|
|
522
|
-
title: string;
|
|
523
|
-
} | null>(null);
|
|
524
|
-
const [showMoreSuggestions, setShowMoreSuggestions] = useState(false);
|
|
525
|
-
const [evaluationState, setEvaluationState] = useState<{
|
|
526
|
-
isOpen: boolean;
|
|
527
|
-
messageId: string | null;
|
|
528
|
-
type: 'dislike' | null;
|
|
529
|
-
category?: string | null;
|
|
530
|
-
reason: string;
|
|
531
|
-
}>({
|
|
532
|
-
isOpen: false,
|
|
533
|
-
messageId: null,
|
|
534
|
-
type: null,
|
|
535
|
-
category: null,
|
|
536
|
-
reason: ''
|
|
537
|
-
});
|
|
538
|
-
|
|
539
|
-
// ============================================================================
|
|
540
|
-
// Refs
|
|
541
|
-
// ============================================================================
|
|
542
|
-
|
|
543
|
-
const messagesEndRef = useRef<HTMLDivElement>(null);
|
|
544
|
-
const fileInputRef = useRef<HTMLInputElement>(null);
|
|
545
|
-
const audioInputRef = useRef<HTMLInputElement>(null);
|
|
546
|
-
|
|
547
|
-
// ============================================================================
|
|
548
|
-
// Sugestões padrão
|
|
549
|
-
// ============================================================================
|
|
550
|
-
|
|
551
|
-
const defaultSuggestions: Suggestion[] = [
|
|
552
|
-
{ id: '1', text: 'Me ajude a criar um documento profissional' },
|
|
553
|
-
{ id: '2', text: 'Buscar nos meus arquivos por "relatório"' },
|
|
554
|
-
{ id: '3', text: 'Resuma as conversas importantes desta semana' },
|
|
555
|
-
{ id: '4', text: 'Crie um podcast sobre o último projeto' },
|
|
556
|
-
];
|
|
557
|
-
|
|
558
|
-
const sugestoes = propSuggestions ?? defaultSuggestions;
|
|
559
|
-
|
|
560
|
-
// API Key Validation removed
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
// ============================================================================
|
|
564
|
-
// Effects
|
|
565
|
-
// ============================================================================
|
|
566
|
-
|
|
567
|
-
// Auto-scroll ao adicionar mensagens
|
|
568
|
-
useEffect(() => {
|
|
569
|
-
if (messagesEndRef.current && abaSelecionada === 'chat') {
|
|
570
|
-
messagesEndRef.current.scrollIntoView({ behavior: 'smooth' });
|
|
571
|
-
}
|
|
572
|
-
}, [mensagens, abaSelecionada]);
|
|
573
|
-
|
|
574
|
-
// Sincronizar mensagens iniciais apenas quando elas mudarem e não forem vazias
|
|
575
|
-
useEffect(() => {
|
|
576
|
-
if (initialMessages && initialMessages.length > 0) {
|
|
577
|
-
setMensagens(initialMessages);
|
|
578
|
-
}
|
|
579
|
-
}, [initialMessages]);
|
|
580
|
-
|
|
581
|
-
// ============================================================================
|
|
582
|
-
// Handlers
|
|
583
|
-
// ============================================================================
|
|
584
|
-
|
|
585
|
-
const handleToggle = () => {
|
|
586
|
-
if (onToggle) {
|
|
587
|
-
onToggle();
|
|
588
|
-
} else {
|
|
589
|
-
setInternalIsExpanded(!internalIsExpanded);
|
|
590
|
-
}
|
|
591
|
-
};
|
|
592
|
-
|
|
593
|
-
const handleExpandWithTab = (tab: AssistantTab) => {
|
|
594
|
-
setAbaSelecionada(tab);
|
|
595
|
-
if (onToggle) {
|
|
596
|
-
onToggle();
|
|
597
|
-
} else {
|
|
598
|
-
setInternalIsExpanded(true);
|
|
599
|
-
}
|
|
600
|
-
};
|
|
601
|
-
|
|
602
|
-
const handleEnviarMensagem = async (arg?: string | ActionType) => {
|
|
603
|
-
let msgToSend = mensagem;
|
|
604
|
-
|
|
605
|
-
// Check if argument is a message text (from simple string) or ActionType
|
|
606
|
-
if (typeof arg === 'string' && !['document', 'podcast', 'search'].includes(arg)) {
|
|
607
|
-
msgToSend = arg;
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
if (!msgToSend.trim() || isProcessing) return;
|
|
611
|
-
|
|
612
|
-
const novaMensagem: Message = {
|
|
613
|
-
id: `msg-${Date.now()}`,
|
|
614
|
-
type: 'user',
|
|
615
|
-
content: msgToSend,
|
|
616
|
-
timestamp: new Date(),
|
|
617
|
-
isFavorite: false,
|
|
618
|
-
};
|
|
619
|
-
|
|
620
|
-
setMensagens(prev => [...prev, novaMensagem]);
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
if (onSendMessage) {
|
|
624
|
-
onSendMessage(msgToSend);
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
if (demoMode || responseGenerator) {
|
|
628
|
-
const mensagemAtual = msgToSend;
|
|
629
|
-
setTimeout(async () => {
|
|
630
|
-
let resposta: string | Partial<Message>;
|
|
631
|
-
|
|
632
|
-
if (responseGenerator) {
|
|
633
|
-
resposta = await responseGenerator(mensagemAtual);
|
|
634
|
-
} else {
|
|
635
|
-
resposta = gerarResposta(mensagemAtual, customResponses);
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
let novaMensagemIA: Message = {
|
|
639
|
-
id: `msg-${Date.now()}-ia`,
|
|
640
|
-
type: 'assistant',
|
|
641
|
-
content: '',
|
|
642
|
-
timestamp: new Date(),
|
|
643
|
-
isFavorite: false
|
|
644
|
-
};
|
|
645
|
-
|
|
646
|
-
if (typeof resposta === 'string') {
|
|
647
|
-
novaMensagemIA.content = resposta;
|
|
648
|
-
} else {
|
|
649
|
-
novaMensagemIA = { ...novaMensagemIA, ...resposta };
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
setMensagens(prev => [...prev, novaMensagemIA]);
|
|
653
|
-
}, 1000 + Math.random() * 1000);
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
setMensagem('');
|
|
657
|
-
};
|
|
658
|
-
|
|
659
|
-
const handleToggleFavorite = (messageId: string) => {
|
|
660
|
-
setMensagens(prev =>
|
|
661
|
-
prev.map(msg =>
|
|
662
|
-
msg.id === messageId ? { ...msg, isFavorite: !msg.isFavorite } : msg
|
|
663
|
-
)
|
|
664
|
-
);
|
|
665
|
-
};
|
|
666
|
-
|
|
667
|
-
const handleCopyMessage = async (content: string, messageId: string) => {
|
|
668
|
-
try {
|
|
669
|
-
// Try modern Clipboard API first
|
|
670
|
-
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
671
|
-
try {
|
|
672
|
-
await navigator.clipboard.writeText(content);
|
|
673
|
-
setCopiedId(messageId);
|
|
674
|
-
setTimeout(() => setCopiedId(null), 2000);
|
|
675
|
-
} catch (clipboardError: any) {
|
|
676
|
-
// If clipboard API fails due to permissions, fall back to execCommand
|
|
677
|
-
if (clipboardError.name === 'NotAllowedError' || clipboardError.message.includes('permissions policy')) {
|
|
678
|
-
throw new Error('Clipboard permission denied, falling back');
|
|
679
|
-
}
|
|
680
|
-
throw clipboardError;
|
|
681
|
-
}
|
|
682
|
-
} else {
|
|
683
|
-
throw new Error('Clipboard API not available');
|
|
684
|
-
}
|
|
685
|
-
} catch (err) {
|
|
686
|
-
// Fallback for browsers that don't support Clipboard API or when permissions are denied
|
|
687
|
-
try {
|
|
688
|
-
const textArea = document.createElement('textarea');
|
|
689
|
-
textArea.value = content;
|
|
690
|
-
textArea.style.position = 'fixed';
|
|
691
|
-
textArea.style.left = '-999999px';
|
|
692
|
-
textArea.style.top = '-999999px';
|
|
693
|
-
document.body.appendChild(textArea);
|
|
694
|
-
textArea.focus();
|
|
695
|
-
textArea.select();
|
|
696
|
-
|
|
697
|
-
const successful = document.execCommand('copy');
|
|
698
|
-
document.body.removeChild(textArea);
|
|
699
|
-
|
|
700
|
-
if (successful) {
|
|
701
|
-
setCopiedId(messageId);
|
|
702
|
-
setTimeout(() => setCopiedId(null), 2000);
|
|
703
|
-
} else {
|
|
704
|
-
console.error('Falha ao copiar: execCommand returned false');
|
|
705
|
-
}
|
|
706
|
-
} catch (fallbackErr) {
|
|
707
|
-
console.error('Falha ao copiar:', fallbackErr);
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
};
|
|
711
|
-
|
|
712
|
-
const handleGeneratePodcast = async (messageId: string, content: string) => {
|
|
713
|
-
setGeneratingPodcastId(messageId);
|
|
714
|
-
|
|
715
|
-
// Simulação de geração de podcast
|
|
716
|
-
setTimeout(() => {
|
|
717
|
-
setMensagens(prev =>
|
|
718
|
-
prev.map(msg =>
|
|
719
|
-
msg.id === messageId
|
|
720
|
-
? {
|
|
721
|
-
...msg,
|
|
722
|
-
attachmentType: 'podcast',
|
|
723
|
-
attachmentName: 'Podcast - ' + content.substring(0, 30) + '...',
|
|
724
|
-
audioUrl: 'data:audio/mpeg;base64,//uQx...' // Mock
|
|
725
|
-
}
|
|
726
|
-
: msg
|
|
727
|
-
)
|
|
728
|
-
);
|
|
729
|
-
setGeneratingPodcastId(null);
|
|
730
|
-
}, 2000);
|
|
731
|
-
};
|
|
732
|
-
|
|
733
|
-
const handleDownloadDocument = (content: string, fileName: string) => {
|
|
734
|
-
const blob = new Blob([content], { type: 'text/markdown' });
|
|
735
|
-
const url = URL.createObjectURL(blob);
|
|
736
|
-
const a = document.createElement('a');
|
|
737
|
-
a.href = url;
|
|
738
|
-
a.download = fileName.endsWith('.md') ? fileName : fileName + '.md';
|
|
739
|
-
document.body.appendChild(a);
|
|
740
|
-
a.click();
|
|
741
|
-
document.body.removeChild(a);
|
|
742
|
-
URL.revokeObjectURL(url);
|
|
743
|
-
};
|
|
744
|
-
|
|
745
|
-
const handleDownloadPodcast = (audioUrl: string, fileName: string) => {
|
|
746
|
-
const a = document.createElement('a');
|
|
747
|
-
a.href = audioUrl;
|
|
748
|
-
a.download = fileName.endsWith('.mp3') ? fileName : fileName + '.mp3';
|
|
749
|
-
document.body.appendChild(a);
|
|
750
|
-
a.click();
|
|
751
|
-
document.body.removeChild(a);
|
|
752
|
-
};
|
|
753
|
-
|
|
754
|
-
const handleEditDocument = (content: string, title: string) => {
|
|
755
|
-
setEditingDocument({ content, title });
|
|
756
|
-
};
|
|
757
|
-
|
|
758
|
-
const handleNovaConversa = () => {
|
|
759
|
-
setMensagens([]);
|
|
760
|
-
setConversaAtual(null);
|
|
761
|
-
setAbaSelecionada('chat');
|
|
762
|
-
};
|
|
763
|
-
|
|
764
|
-
const handleSelecionarConversa = (conversaId: string) => {
|
|
765
|
-
const conversa = conversas.find(c => c.id === conversaId);
|
|
766
|
-
if (conversa) {
|
|
767
|
-
setMensagens(conversa.messages);
|
|
768
|
-
setConversaAtual(conversaId);
|
|
769
|
-
setAbaSelecionada('chat');
|
|
770
|
-
}
|
|
771
|
-
};
|
|
772
|
-
|
|
773
|
-
const handleToggleFavoritaConversa = (conversaId: string) => {
|
|
774
|
-
setConversas(prev =>
|
|
775
|
-
prev.map(conv =>
|
|
776
|
-
conv.id === conversaId ? { ...conv, isFavorite: !conv.isFavorite } : conv
|
|
777
|
-
)
|
|
778
|
-
);
|
|
779
|
-
};
|
|
780
|
-
|
|
781
|
-
const handleOpenSearchResult = (result: SearchResult) => {
|
|
782
|
-
console.log('Abrir resultado:', result);
|
|
783
|
-
// Implementar lógica de navegação ou abertura de resultado
|
|
784
|
-
};
|
|
785
|
-
|
|
786
|
-
const handleExecuteSearchCommand = async (
|
|
787
|
-
commandId: string,
|
|
788
|
-
searchTerm: string,
|
|
789
|
-
results: SearchResult[],
|
|
790
|
-
messageId: string
|
|
791
|
-
) => {
|
|
792
|
-
setExecutingCommand(commandId);
|
|
793
|
-
|
|
794
|
-
// Simular execução de comando
|
|
795
|
-
setTimeout(() => {
|
|
796
|
-
if (commandId === '5') {
|
|
797
|
-
setSavedSearches(prev => [...prev, messageId]);
|
|
798
|
-
}
|
|
799
|
-
setExecutingCommand(null);
|
|
800
|
-
}, 1500);
|
|
801
|
-
};
|
|
802
|
-
|
|
803
|
-
const handleRichSuggestionClick = (suggestion: Suggestion) => {
|
|
804
|
-
if (onRichAction) {
|
|
805
|
-
onRichAction(suggestion.id, suggestion.text);
|
|
806
|
-
} else {
|
|
807
|
-
// Fallback: send as message
|
|
808
|
-
handleEnviarMensagem(suggestion.text);
|
|
809
|
-
}
|
|
810
|
-
setShowMoreSuggestions(false);
|
|
811
|
-
};
|
|
812
|
-
|
|
813
|
-
const handleEvaluationClick = (messageId: string, type: 'like' | 'dislike') => {
|
|
814
|
-
if (type === 'like') {
|
|
815
|
-
if (onEvaluation) onEvaluation(messageId, 'like');
|
|
816
|
-
// Update local state
|
|
817
|
-
setMensagens(prev => prev.map(m => m.id === messageId ? { ...m, evaluation: 'like' } : m));
|
|
818
|
-
toast.success("Obrigado por avaliar positivamente!");
|
|
819
|
-
}
|
|
820
|
-
};
|
|
821
|
-
|
|
822
|
-
const openFeedbackDialog = (messageId: string, category: string | null) => {
|
|
823
|
-
setEvaluationState({
|
|
824
|
-
isOpen: true,
|
|
825
|
-
messageId,
|
|
826
|
-
type: 'dislike',
|
|
827
|
-
category,
|
|
828
|
-
reason: ''
|
|
829
|
-
});
|
|
830
|
-
};
|
|
831
|
-
|
|
832
|
-
const handleSubmitDislike = () => {
|
|
833
|
-
if (evaluationState.messageId) {
|
|
834
|
-
const finalReason = evaluationState.category
|
|
835
|
-
? (evaluationState.reason ? `${evaluationState.category}: ${evaluationState.reason}` : evaluationState.category)
|
|
836
|
-
: evaluationState.reason;
|
|
837
|
-
|
|
838
|
-
if (onEvaluation) {
|
|
839
|
-
onEvaluation(evaluationState.messageId, 'dislike', finalReason);
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
// Update local state
|
|
843
|
-
setMensagens(prev => prev.map(m => m.id === evaluationState.messageId ? { ...m, evaluation: 'dislike', evaluationReason: finalReason } : m));
|
|
844
|
-
toast.success("Obrigado pelo seu feedback. Vamos melhorar.");
|
|
845
|
-
}
|
|
846
|
-
setEvaluationState({ isOpen: false, messageId: null, type: null, category: null, reason: '' });
|
|
847
|
-
};
|
|
848
|
-
|
|
849
|
-
// ============================================================================
|
|
850
|
-
// Computations
|
|
503
|
+
// State & Logic — delegated to useAssistant hook
|
|
851
504
|
// ============================================================================
|
|
852
505
|
|
|
853
|
-
const
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
506
|
+
const {
|
|
507
|
+
isFullPage,
|
|
508
|
+
isExpanded,
|
|
509
|
+
isMobile,
|
|
510
|
+
abaSelecionada,
|
|
511
|
+
setAbaSelecionada,
|
|
512
|
+
mensagens,
|
|
513
|
+
setMensagens,
|
|
514
|
+
mensagem,
|
|
515
|
+
setMensagem,
|
|
516
|
+
conversas,
|
|
517
|
+
conversaAtual,
|
|
518
|
+
conversasFiltradas,
|
|
519
|
+
copiedId,
|
|
520
|
+
generatingPodcastId,
|
|
521
|
+
executingCommand,
|
|
522
|
+
savedSearches,
|
|
523
|
+
editingDocument,
|
|
524
|
+
setEditingDocument,
|
|
525
|
+
showMoreSuggestions,
|
|
526
|
+
setShowMoreSuggestions,
|
|
527
|
+
evaluationState,
|
|
528
|
+
setEvaluationState,
|
|
529
|
+
sugestoes,
|
|
530
|
+
messagesEndRef,
|
|
531
|
+
fileInputRef,
|
|
532
|
+
audioInputRef,
|
|
533
|
+
handleToggle,
|
|
534
|
+
handleExpandWithTab,
|
|
535
|
+
handleEnviarMensagem,
|
|
536
|
+
handleToggleFavorite,
|
|
537
|
+
handleCopyMessage,
|
|
538
|
+
handleGeneratePodcast,
|
|
539
|
+
handleDownloadDocument,
|
|
540
|
+
handleDownloadPodcast,
|
|
541
|
+
handleEditDocument,
|
|
542
|
+
handleNovaConversa,
|
|
543
|
+
handleSelecionarConversa,
|
|
544
|
+
handleToggleFavoritaConversa,
|
|
545
|
+
handleOpenSearchResult,
|
|
546
|
+
handleExecuteSearchCommand,
|
|
547
|
+
handleRichSuggestionClick,
|
|
548
|
+
handleEvaluationClick,
|
|
549
|
+
openFeedbackDialog,
|
|
550
|
+
handleSubmitDislike,
|
|
551
|
+
} = useAssistant({
|
|
552
|
+
mode,
|
|
553
|
+
isExpanded: controlledIsExpanded,
|
|
554
|
+
onToggle,
|
|
555
|
+
defaultTab,
|
|
556
|
+
demoMode,
|
|
557
|
+
customResponses,
|
|
558
|
+
initialMessages,
|
|
559
|
+
savedConversations,
|
|
560
|
+
suggestions: propSuggestions,
|
|
561
|
+
onSendMessage,
|
|
562
|
+
isProcessing,
|
|
563
|
+
responseGenerator,
|
|
564
|
+
richSuggestions,
|
|
565
|
+
onRichAction,
|
|
566
|
+
onEvaluation,
|
|
858
567
|
});
|
|
859
568
|
|
|
860
569
|
// ============================================================================
|
|
@@ -927,53 +636,53 @@ export function XerticaAssistant({
|
|
|
927
636
|
width: isFullPage ? '100%' : containerWidth,
|
|
928
637
|
} : undefined}
|
|
929
638
|
>
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
639
|
+
{/* Document Editor Overlay */}
|
|
640
|
+
{editingDocument && !isFullPage && (
|
|
641
|
+
<div
|
|
642
|
+
className={cn(
|
|
643
|
+
"flex flex-col border-border bg-background overflow-hidden transition-all duration-300",
|
|
644
|
+
isMobile ? "fixed inset-0 z-[110] w-full h-[100dvh]" : "absolute top-0 bottom-0 right-full w-[800px] border-l border-r border-border shadow-[-25px_0_50px_-15px_rgba(0,0,0,0.15)] z-[90]"
|
|
645
|
+
)}
|
|
646
|
+
style={{ maxWidth: isMobile ? 'none' : `calc(100vw - ${containerWidth})` }}
|
|
647
|
+
>
|
|
648
|
+
<div className="h-full flex flex-col">
|
|
649
|
+
{/* Header Toolbar */}
|
|
650
|
+
<div className="px-4 h-[64px] border-b border-border bg-card flex items-center justify-between">
|
|
651
|
+
<div className="flex items-center gap-3">
|
|
652
|
+
<div className="p-2 bg-primary/10 rounded-md">
|
|
653
|
+
<FileText className="w-4 h-4 text-primary" />
|
|
654
|
+
</div>
|
|
655
|
+
<h3 className="font-semibold text-card-foreground text-sm">{editingDocument.title}</h3>
|
|
945
656
|
</div>
|
|
946
|
-
<
|
|
657
|
+
<Button
|
|
658
|
+
variant="ghost"
|
|
659
|
+
size="icon"
|
|
660
|
+
className="h-8 w-8 rounded-full"
|
|
661
|
+
onClick={() => setEditingDocument(null)}
|
|
662
|
+
aria-label="Fechar editor de documento"
|
|
663
|
+
>
|
|
664
|
+
<X className="w-4 h-4" />
|
|
665
|
+
</Button>
|
|
666
|
+
</div>
|
|
667
|
+
|
|
668
|
+
{/* Rich Text Editor */}
|
|
669
|
+
<div className="flex-1 bg-muted/20 p-0 sm:p-6 overflow-hidden">
|
|
670
|
+
<RichTextEditor
|
|
671
|
+
value={editingDocument.content || ''}
|
|
672
|
+
onChange={(newVal) => setEditingDocument(editingDocument ? { ...editingDocument, content: newVal } : null)}
|
|
673
|
+
placeholder="Comece a digitar o conteúdo do seu documento aqui..."
|
|
674
|
+
className="max-w-4xl mx-auto h-full"
|
|
675
|
+
actionButton={
|
|
676
|
+
<Button size="sm" className="gap-2 h-8">
|
|
677
|
+
<Check className="w-3.5 h-3.5" />
|
|
678
|
+
Salvar
|
|
679
|
+
</Button>
|
|
680
|
+
}
|
|
681
|
+
/>
|
|
947
682
|
</div>
|
|
948
|
-
<Button
|
|
949
|
-
variant="ghost"
|
|
950
|
-
size="icon"
|
|
951
|
-
className="h-8 w-8 rounded-full"
|
|
952
|
-
onClick={() => setEditingDocument(null)}
|
|
953
|
-
aria-label="Fechar editor de documento"
|
|
954
|
-
>
|
|
955
|
-
<X className="w-4 h-4" />
|
|
956
|
-
</Button>
|
|
957
|
-
</div>
|
|
958
|
-
|
|
959
|
-
{/* Rich Text Editor */}
|
|
960
|
-
<div className="flex-1 bg-muted/20 p-0 sm:p-6 overflow-hidden">
|
|
961
|
-
<RichTextEditor
|
|
962
|
-
value={editingDocument.content || ''}
|
|
963
|
-
onChange={(newVal) => setEditingDocument(prev => prev ? { ...prev, content: newVal } : null)}
|
|
964
|
-
placeholder="Comece a digitar o conteúdo do seu documento aqui..."
|
|
965
|
-
className="max-w-4xl mx-auto h-full"
|
|
966
|
-
actionButton={
|
|
967
|
-
<Button size="sm" className="gap-2 h-8">
|
|
968
|
-
<Check className="w-3.5 h-3.5" />
|
|
969
|
-
Salvar
|
|
970
|
-
</Button>
|
|
971
|
-
}
|
|
972
|
-
/>
|
|
973
683
|
</div>
|
|
974
684
|
</div>
|
|
975
|
-
|
|
976
|
-
)}
|
|
685
|
+
)}
|
|
977
686
|
{/* Header - Toggle Button - Apenas visível quando não está em fullPage */}
|
|
978
687
|
{!isFullPage && (
|
|
979
688
|
<div
|
|
@@ -1187,63 +896,63 @@ export function XerticaAssistant({
|
|
|
1187
896
|
Olá, {userName}
|
|
1188
897
|
</h3>
|
|
1189
898
|
<p className="text-muted-foreground">
|
|
1190
|
-
|
|
899
|
+
{welcomeMessage}
|
|
1191
900
|
</p>
|
|
1192
901
|
</div>
|
|
1193
902
|
|
|
1194
903
|
{/* Suggestions */}
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
904
|
+
{(sugestoes.length > 0 || richSuggestions.length > 0) && (
|
|
905
|
+
<div className="px-4 pb-4 space-y-2">
|
|
906
|
+
{sugestoes.map((sugestao) => (
|
|
907
|
+
<button
|
|
908
|
+
key={sugestao.id}
|
|
909
|
+
onClick={() => handleEnviarMensagem(sugestao.text)}
|
|
910
|
+
className="w-full p-3 text-left rounded-[var(--radius-card)] bg-muted text-foreground transition-colors duration-200 hover:bg-muted/80"
|
|
911
|
+
>
|
|
912
|
+
{sugestao.text}
|
|
913
|
+
</button>
|
|
914
|
+
))}
|
|
1205
915
|
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
<div className="space-y-2 pt-2 border-t border-border mt-2 animate-in slide-in-from-top-2">
|
|
1218
|
-
{richSuggestions.length > 0 ? (
|
|
1219
|
-
richSuggestions.map((sugestao) => (
|
|
1220
|
-
<button
|
|
1221
|
-
key={sugestao.id}
|
|
1222
|
-
onClick={() => handleRichSuggestionClick(sugestao)}
|
|
1223
|
-
className="w-full p-3 text-left rounded-[var(--radius-card)] bg-muted/50 border border-border text-foreground transition-all duration-200 hover:bg-primary/5 hover:border-primary/50 group"
|
|
1224
|
-
>
|
|
1225
|
-
<div className="flex items-center gap-2">
|
|
1226
|
-
{sugestao.id.includes('chart') && <BarChart3 className="w-4 h-4 text-primary" />}
|
|
1227
|
-
{sugestao.id.includes('table') && <TableIcon className="w-4 h-4 text-primary" />}
|
|
1228
|
-
<span className="font-medium">{sugestao.text}</span>
|
|
1229
|
-
</div>
|
|
1230
|
-
</button>
|
|
1231
|
-
))
|
|
916
|
+
{richSuggestions.length > 0 && (
|
|
917
|
+
!showMoreSuggestions ? (
|
|
918
|
+
<Button
|
|
919
|
+
variant="ghost"
|
|
920
|
+
size="sm"
|
|
921
|
+
onClick={() => setShowMoreSuggestions(true)}
|
|
922
|
+
className="w-full justify-start text-muted-foreground"
|
|
923
|
+
>
|
|
924
|
+
<MoreHorizontal className="w-4 h-4 mr-2" />
|
|
925
|
+
Mais sugestões
|
|
926
|
+
</Button>
|
|
1232
927
|
) : (
|
|
1233
|
-
<
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
928
|
+
<div className="space-y-2 pt-2 border-t border-border mt-2 animate-in slide-in-from-top-2">
|
|
929
|
+
{richSuggestions.map((sugestao) => (
|
|
930
|
+
<button
|
|
931
|
+
key={sugestao.id}
|
|
932
|
+
onClick={() => handleRichSuggestionClick(sugestao)}
|
|
933
|
+
className="w-full p-3 text-left rounded-[var(--radius-card)] bg-muted/50 border border-border text-foreground transition-all duration-200 hover:bg-primary/5 hover:border-primary/50 group"
|
|
934
|
+
>
|
|
935
|
+
<div className="flex items-center gap-2">
|
|
936
|
+
{sugestao.id.includes('chart') && <BarChart3 className="w-4 h-4 text-primary" />}
|
|
937
|
+
{sugestao.id.includes('table') && <TableIcon className="w-4 h-4 text-primary" />}
|
|
938
|
+
<span className="font-medium">{sugestao.text}</span>
|
|
939
|
+
</div>
|
|
940
|
+
</button>
|
|
941
|
+
))}
|
|
942
|
+
<Button
|
|
943
|
+
variant="ghost"
|
|
944
|
+
size="sm"
|
|
945
|
+
onClick={() => setShowMoreSuggestions(false)}
|
|
946
|
+
className="w-full justify-center text-muted-foreground mt-2"
|
|
947
|
+
>
|
|
948
|
+
<ChevronLeft className="w-4 h-4 mr-2" />
|
|
949
|
+
Voltar
|
|
950
|
+
</Button>
|
|
951
|
+
</div>
|
|
952
|
+
)
|
|
953
|
+
)}
|
|
954
|
+
</div>
|
|
955
|
+
)}
|
|
1247
956
|
</div>
|
|
1248
957
|
) : (
|
|
1249
958
|
<ScrollArea className="flex-1 min-h-0 overflow-x-hidden [&_[data-radix-scroll-area-viewport]>div]:!block">
|
|
@@ -1264,14 +973,14 @@ export function XerticaAssistant({
|
|
|
1264
973
|
|
|
1265
974
|
<div className={cn(
|
|
1266
975
|
"flex flex-col min-w-0 transition-all duration-300",
|
|
1267
|
-
msg.type === 'user'
|
|
1268
|
-
? "max-w-[85%] md:max-w-[70%] items-end w-fit"
|
|
976
|
+
msg.type === 'user'
|
|
977
|
+
? "max-w-[85%] md:max-w-[70%] items-end w-fit"
|
|
1269
978
|
: cn(
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
979
|
+
"items-start",
|
|
980
|
+
(msg.tableData || msg.chartData || msg.searchResults || msg.attachmentType === 'document')
|
|
981
|
+
? "w-full max-w-full"
|
|
982
|
+
: "w-fit max-w-[95%] md:max-w-[90%]"
|
|
983
|
+
)
|
|
1275
984
|
)}>
|
|
1276
985
|
<div
|
|
1277
986
|
className={cn(
|
|
@@ -1590,15 +1299,15 @@ export function XerticaAssistant({
|
|
|
1590
1299
|
|
|
1591
1300
|
|
|
1592
1301
|
{enablePodcastGeneration && msg.type === 'assistant' && msg.attachmentType !== 'podcast' && (
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1302
|
+
<Button
|
|
1303
|
+
variant="ghost"
|
|
1304
|
+
size="sm"
|
|
1305
|
+
onClick={() => handleGeneratePodcast(msg.id, msg.content)}
|
|
1306
|
+
disabled={generatingPodcastId === msg.id}
|
|
1307
|
+
className="h-6 w-6 p-0 disabled:opacity-50 text-muted-foreground"
|
|
1308
|
+
title="Gerar Podcast"
|
|
1309
|
+
aria-label="Gerar Podcast"
|
|
1310
|
+
>
|
|
1602
1311
|
{generatingPodcastId === msg.id ? (
|
|
1603
1312
|
<Loader2 className="w-3 h-3 animate-spin" />
|
|
1604
1313
|
) : (
|
|
@@ -1810,7 +1519,7 @@ export function XerticaAssistant({
|
|
|
1810
1519
|
onSubmit={handleEnviarMensagem}
|
|
1811
1520
|
onFileUpload={enableFileAttachment ? () => fileInputRef.current?.click() : undefined}
|
|
1812
1521
|
onAudioUpload={enableAudioInput ? () => audioInputRef.current?.click() : undefined}
|
|
1813
|
-
placeholder="Envie uma mensagem
|
|
1522
|
+
placeholder="Envie uma mensagem"
|
|
1814
1523
|
disabled={isProcessing}
|
|
1815
1524
|
isFullPage={isFullPage}
|
|
1816
1525
|
enableAudioInput={enableAudioInput}
|