xertica-ui 1.3.6 → 1.3.7
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/components/HomePage.tsx +4 -0
- package/components/TemplatePage.tsx +1 -0
- package/components/ui/xertica-assistant.tsx +18 -10
- package/dist/index.es.js +18 -10
- package/dist/index.umd.js +18 -10
- package/package.json +1 -1
package/components/HomePage.tsx
CHANGED
|
@@ -51,6 +51,10 @@ export function HomePage({ user, onLogout }: HomePageProps) {
|
|
|
51
51
|
responseGenerator={generateDemoResponse}
|
|
52
52
|
richSuggestions={richSuggestions}
|
|
53
53
|
feedbackOptions={feedbackOptions}
|
|
54
|
+
onEvaluation={(messageId, type, reason) => {
|
|
55
|
+
console.log(`Avaliação recebida: ${type} na mensagem ${messageId}. Motivo: ${reason}`);
|
|
56
|
+
// Aqui você implementaria a lógica para salvar no backend
|
|
57
|
+
}}
|
|
54
58
|
/>
|
|
55
59
|
</div>
|
|
56
60
|
);
|
|
@@ -487,9 +487,9 @@ export function XerticaAssistant({
|
|
|
487
487
|
}
|
|
488
488
|
}, [mensagens, abaSelecionada]);
|
|
489
489
|
|
|
490
|
-
// Sincronizar mensagens iniciais
|
|
490
|
+
// Sincronizar mensagens iniciais apenas quando elas mudarem e não forem vazias
|
|
491
491
|
useEffect(() => {
|
|
492
|
-
if (initialMessages.length > 0) {
|
|
492
|
+
if (initialMessages && initialMessages.length > 0) {
|
|
493
493
|
setMensagens(initialMessages);
|
|
494
494
|
}
|
|
495
495
|
}, [initialMessages]);
|
|
@@ -875,17 +875,22 @@ export function XerticaAssistant({
|
|
|
875
875
|
{/* Header - Toggle Button - Apenas visível quando não está em fullPage */}
|
|
876
876
|
{!isFullPage && (
|
|
877
877
|
<div
|
|
878
|
-
className=
|
|
878
|
+
className={cn(
|
|
879
|
+
"border-b border-border flex items-center py-3",
|
|
880
|
+
isExpanded ? "justify-between px-4 py-4" : "justify-center px-0"
|
|
881
|
+
)}
|
|
879
882
|
>
|
|
880
883
|
{isExpanded && (
|
|
881
884
|
<motion.div
|
|
882
|
-
initial={{ opacity: 0, x:
|
|
885
|
+
initial={{ opacity: 0, x: -10 }}
|
|
883
886
|
animate={{ opacity: 1, x: 0 }}
|
|
884
|
-
exit={{ opacity: 0, x:
|
|
885
|
-
className="flex items-center gap-2"
|
|
887
|
+
exit={{ opacity: 0, x: -10 }}
|
|
888
|
+
className="flex items-center gap-2 overflow-hidden"
|
|
886
889
|
>
|
|
887
|
-
<
|
|
888
|
-
|
|
890
|
+
<div className="flex-shrink-0">
|
|
891
|
+
<XerticaOrbe size={32} />
|
|
892
|
+
</div>
|
|
893
|
+
<span className="text-foreground font-medium truncate">Assistente Xertica</span>
|
|
889
894
|
</motion.div>
|
|
890
895
|
)}
|
|
891
896
|
|
|
@@ -895,7 +900,7 @@ export function XerticaAssistant({
|
|
|
895
900
|
variant="ghost"
|
|
896
901
|
size="sm"
|
|
897
902
|
onClick={onNavigateFullPage}
|
|
898
|
-
className="p-
|
|
903
|
+
className="h-8 w-8 p-0 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-full"
|
|
899
904
|
title="Expandir assistente"
|
|
900
905
|
>
|
|
901
906
|
<Maximize2 className="w-4 h-4" />
|
|
@@ -906,7 +911,10 @@ export function XerticaAssistant({
|
|
|
906
911
|
variant="ghost"
|
|
907
912
|
size="sm"
|
|
908
913
|
onClick={handleToggle}
|
|
909
|
-
className=
|
|
914
|
+
className={cn(
|
|
915
|
+
"h-8 w-8 p-0 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-full",
|
|
916
|
+
!isExpanded && "w-10 h-10" // Slightly larger touch target when collapsed if desired, or keep consistent
|
|
917
|
+
)}
|
|
910
918
|
>
|
|
911
919
|
{isExpanded ? (
|
|
912
920
|
<ChevronRight className="w-4 h-4" />
|
package/dist/index.es.js
CHANGED
|
@@ -46010,7 +46010,7 @@ function XerticaAssistant({
|
|
|
46010
46010
|
}
|
|
46011
46011
|
}, [mensagens, abaSelecionada]);
|
|
46012
46012
|
useEffect(() => {
|
|
46013
|
-
if (initialMessages.length > 0) {
|
|
46013
|
+
if (initialMessages && initialMessages.length > 0) {
|
|
46014
46014
|
setMensagens(initialMessages);
|
|
46015
46015
|
}
|
|
46016
46016
|
}, [initialMessages]);
|
|
@@ -46321,18 +46321,21 @@ function XerticaAssistant({
|
|
|
46321
46321
|
!isFullPage && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
46322
46322
|
"div",
|
|
46323
46323
|
{
|
|
46324
|
-
className:
|
|
46324
|
+
className: cn(
|
|
46325
|
+
"border-b border-border flex items-center py-3",
|
|
46326
|
+
isExpanded ? "justify-between px-4 py-4" : "justify-center px-0"
|
|
46327
|
+
),
|
|
46325
46328
|
children: [
|
|
46326
46329
|
isExpanded && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
46327
46330
|
motion.div,
|
|
46328
46331
|
{
|
|
46329
|
-
initial: { opacity: 0, x:
|
|
46332
|
+
initial: { opacity: 0, x: -10 },
|
|
46330
46333
|
animate: { opacity: 1, x: 0 },
|
|
46331
|
-
exit: { opacity: 0, x:
|
|
46332
|
-
className: "flex items-center gap-2",
|
|
46334
|
+
exit: { opacity: 0, x: -10 },
|
|
46335
|
+
className: "flex items-center gap-2 overflow-hidden",
|
|
46333
46336
|
children: [
|
|
46334
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(XerticaOrbe, { size: 32 }),
|
|
46335
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-foreground", children: "Assistente Xertica" })
|
|
46337
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(XerticaOrbe, { size: 32 }) }),
|
|
46338
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-foreground font-medium truncate", children: "Assistente Xertica" })
|
|
46336
46339
|
]
|
|
46337
46340
|
}
|
|
46338
46341
|
),
|
|
@@ -46343,7 +46346,7 @@ function XerticaAssistant({
|
|
|
46343
46346
|
variant: "ghost",
|
|
46344
46347
|
size: "sm",
|
|
46345
46348
|
onClick: onNavigateFullPage,
|
|
46346
|
-
className: "p-
|
|
46349
|
+
className: "h-8 w-8 p-0 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-full",
|
|
46347
46350
|
title: "Expandir assistente",
|
|
46348
46351
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Maximize2, { className: "w-4 h-4" })
|
|
46349
46352
|
}
|
|
@@ -46354,7 +46357,11 @@ function XerticaAssistant({
|
|
|
46354
46357
|
variant: "ghost",
|
|
46355
46358
|
size: "sm",
|
|
46356
46359
|
onClick: handleToggle,
|
|
46357
|
-
className:
|
|
46360
|
+
className: cn(
|
|
46361
|
+
"h-8 w-8 p-0 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-full",
|
|
46362
|
+
!isExpanded && "w-10 h-10"
|
|
46363
|
+
// Slightly larger touch target when collapsed if desired, or keep consistent
|
|
46364
|
+
),
|
|
46358
46365
|
children: isExpanded ? /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "w-4 h-4" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(PanelRight, { className: "w-4 h-4" })
|
|
46359
46366
|
}
|
|
46360
46367
|
)
|
|
@@ -54854,7 +54861,8 @@ function TemplatePage({ user, onLogout }) {
|
|
|
54854
54861
|
XerticaAssistant,
|
|
54855
54862
|
{
|
|
54856
54863
|
isExpanded: assistenteExpanded,
|
|
54857
|
-
onToggle: toggleAssistente
|
|
54864
|
+
onToggle: toggleAssistente,
|
|
54865
|
+
onEvaluation: (id2, type, reason) => console.log("Feedback:", id2, type, reason)
|
|
54858
54866
|
}
|
|
54859
54867
|
)
|
|
54860
54868
|
] });
|
package/dist/index.umd.js
CHANGED
|
@@ -46029,7 +46029,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
|
|
|
46029
46029
|
}
|
|
46030
46030
|
}, [mensagens, abaSelecionada]);
|
|
46031
46031
|
React.useEffect(() => {
|
|
46032
|
-
if (initialMessages.length > 0) {
|
|
46032
|
+
if (initialMessages && initialMessages.length > 0) {
|
|
46033
46033
|
setMensagens(initialMessages);
|
|
46034
46034
|
}
|
|
46035
46035
|
}, [initialMessages]);
|
|
@@ -46340,18 +46340,21 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
|
|
|
46340
46340
|
!isFullPage && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
46341
46341
|
"div",
|
|
46342
46342
|
{
|
|
46343
|
-
className:
|
|
46343
|
+
className: cn(
|
|
46344
|
+
"border-b border-border flex items-center py-3",
|
|
46345
|
+
isExpanded ? "justify-between px-4 py-4" : "justify-center px-0"
|
|
46346
|
+
),
|
|
46344
46347
|
children: [
|
|
46345
46348
|
isExpanded && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
46346
46349
|
motion.div,
|
|
46347
46350
|
{
|
|
46348
|
-
initial: { opacity: 0, x:
|
|
46351
|
+
initial: { opacity: 0, x: -10 },
|
|
46349
46352
|
animate: { opacity: 1, x: 0 },
|
|
46350
|
-
exit: { opacity: 0, x:
|
|
46351
|
-
className: "flex items-center gap-2",
|
|
46353
|
+
exit: { opacity: 0, x: -10 },
|
|
46354
|
+
className: "flex items-center gap-2 overflow-hidden",
|
|
46352
46355
|
children: [
|
|
46353
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(XerticaOrbe, { size: 32 }),
|
|
46354
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-foreground", children: "Assistente Xertica" })
|
|
46356
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(XerticaOrbe, { size: 32 }) }),
|
|
46357
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-foreground font-medium truncate", children: "Assistente Xertica" })
|
|
46355
46358
|
]
|
|
46356
46359
|
}
|
|
46357
46360
|
),
|
|
@@ -46362,7 +46365,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
|
|
|
46362
46365
|
variant: "ghost",
|
|
46363
46366
|
size: "sm",
|
|
46364
46367
|
onClick: onNavigateFullPage,
|
|
46365
|
-
className: "p-
|
|
46368
|
+
className: "h-8 w-8 p-0 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-full",
|
|
46366
46369
|
title: "Expandir assistente",
|
|
46367
46370
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Maximize2, { className: "w-4 h-4" })
|
|
46368
46371
|
}
|
|
@@ -46373,7 +46376,11 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
|
|
|
46373
46376
|
variant: "ghost",
|
|
46374
46377
|
size: "sm",
|
|
46375
46378
|
onClick: handleToggle,
|
|
46376
|
-
className:
|
|
46379
|
+
className: cn(
|
|
46380
|
+
"h-8 w-8 p-0 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-full",
|
|
46381
|
+
!isExpanded && "w-10 h-10"
|
|
46382
|
+
// Slightly larger touch target when collapsed if desired, or keep consistent
|
|
46383
|
+
),
|
|
46377
46384
|
children: isExpanded ? /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "w-4 h-4" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(PanelRight, { className: "w-4 h-4" })
|
|
46378
46385
|
}
|
|
46379
46386
|
)
|
|
@@ -54873,7 +54880,8 @@ Defaulting to \`null\`.`;
|
|
|
54873
54880
|
XerticaAssistant,
|
|
54874
54881
|
{
|
|
54875
54882
|
isExpanded: assistenteExpanded,
|
|
54876
|
-
onToggle: toggleAssistente
|
|
54883
|
+
onToggle: toggleAssistente,
|
|
54884
|
+
onEvaluation: (id2, type, reason) => console.log("Feedback:", id2, type, reason)
|
|
54877
54885
|
}
|
|
54878
54886
|
)
|
|
54879
54887
|
] });
|