@gooddata/sdk-ui-gen-ai 11.57.0 → 11.58.0-alpha.1
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/NOTICE +2321 -1760
- package/esm/components/GenAIChatDialogConnected.d.ts +1 -2
- package/esm/components/GenAIChatDialogConnected.d.ts.map +1 -1
- package/esm/components/GenAIChatDialogConnected.js +3 -9
- package/esm/components/Input.d.ts.map +1 -1
- package/esm/components/Input.js +8 -18
- package/esm/components/Messages.d.ts.map +1 -1
- package/esm/components/Messages.js +4 -20
- package/esm/components/customized/LandingQuestion.d.ts.map +1 -1
- package/esm/components/customized/LandingQuestion.js +1 -5
- package/esm/components/hooks/useEndpointCheck.d.ts.map +1 -1
- package/esm/components/hooks/useEndpointCheck.js +2 -2
- package/esm/components/messages/MessageScroller.d.ts +2 -2
- package/esm/components/messages/MessageScroller.d.ts.map +1 -1
- package/esm/components/messages/components/SemanticSearchTreeView.d.ts +4 -3
- package/esm/components/messages/components/SemanticSearchTreeView.d.ts.map +1 -1
- package/esm/components/messages/components/SemanticSearchTreeView.js +4 -4
- package/esm/components/messages/contents/drill/DrillSelectDropdownMenu.js +1 -1
- package/esm/components/messages/conversationContents/ConversationMultipartContent.js +1 -1
- package/esm/components/messages/conversationContents/ConversationSearchContent.d.ts.map +1 -1
- package/esm/components/messages/conversationContents/ConversationSearchContent.js +2 -8
- package/esm/components/messages/conversationContents/ConversationVisualisation.d.ts.map +1 -1
- package/esm/components/messages/conversationContents/ConversationVisualisation.js +63 -3
- package/esm/components/messages/conversationContents/ConversationVisualizationContent.js +2 -2
- package/esm/components/messages/conversationContents/SaveVisualizationDialog.js +1 -1
- package/esm/components/messages/useUserFeedback.d.ts +2 -2
- package/esm/components/messages/useUserFeedback.d.ts.map +1 -1
- package/esm/components/messages/useUserFeedback.js +17 -47
- package/esm/components/utils/modelCheckUtility.d.ts +1 -1
- package/esm/components/utils/modelCheckUtility.d.ts.map +1 -1
- package/esm/components/utils/modelCheckUtility.js +2 -2
- package/esm/index.d.ts +1 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -1
- package/esm/internal.d.ts +1 -2
- package/esm/internal.d.ts.map +1 -1
- package/esm/internal.js +1 -2
- package/esm/localization/bundles/en-US.localization-bundle.d.ts +0 -12
- package/esm/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/en-US.localization-bundle.js +0 -12
- package/esm/model.d.ts +0 -209
- package/esm/model.d.ts.map +1 -1
- package/esm/model.js +0 -131
- package/esm/sdk-ui-gen-ai.d.ts +1 -159
- package/esm/store/localStorage.d.ts +0 -4
- package/esm/store/localStorage.d.ts.map +1 -1
- package/esm/store/localStorage.js +0 -41
- package/esm/store/messages/messagesSelectors.d.ts +1 -12
- package/esm/store/messages/messagesSelectors.d.ts.map +1 -1
- package/esm/store/messages/messagesSelectors.js +1 -6
- package/esm/store/messages/messagesSlice.d.ts +7 -34
- package/esm/store/messages/messagesSlice.d.ts.map +1 -1
- package/esm/store/messages/messagesSlice.js +159 -408
- package/esm/store/queues/queue.newMessage.js +2 -4
- package/esm/store/sideEffects/conversationSession.js +1 -1
- package/esm/store/sideEffects/onChatOpenSync.d.ts +0 -1
- package/esm/store/sideEffects/onChatOpenSync.d.ts.map +1 -1
- package/esm/store/sideEffects/onChatOpenSync.js +0 -6
- package/esm/store/sideEffects/onDefinitionReceivedTrigger.d.ts +2 -2
- package/esm/store/sideEffects/onDefinitionReceivedTrigger.d.ts.map +1 -1
- package/esm/store/sideEffects/onDefinitionReceivedTrigger.js +2 -8
- package/esm/store/sideEffects/onEvent.d.ts.map +1 -1
- package/esm/store/sideEffects/onEvent.js +26 -71
- package/esm/store/sideEffects/onThreadClear.d.ts +1 -7
- package/esm/store/sideEffects/onThreadClear.d.ts.map +1 -1
- package/esm/store/sideEffects/onThreadClear.js +4 -26
- package/esm/store/sideEffects/onThreadLoad.d.ts +3 -26
- package/esm/store/sideEffects/onThreadLoad.d.ts.map +1 -1
- package/esm/store/sideEffects/onThreadLoad.js +3 -86
- package/esm/store/sideEffects/onUserFeedback.d.ts +4 -4
- package/esm/store/sideEffects/onUserFeedback.d.ts.map +1 -1
- package/esm/store/sideEffects/onUserFeedback.js +21 -44
- package/esm/store/sideEffects/onUserMessage.d.ts +3 -25
- package/esm/store/sideEffects/onUserMessage.d.ts.map +1 -1
- package/esm/store/sideEffects/onUserMessage.js +7 -161
- package/esm/store/sideEffects/onVisualisationRender.d.ts +2 -8
- package/esm/store/sideEffects/onVisualisationRender.d.ts.map +1 -1
- package/esm/store/sideEffects/onVisualisationRender.js +1 -28
- package/esm/store/sideEffects/onVisualizationSave.d.ts +5 -6
- package/esm/store/sideEffects/onVisualizationSave.d.ts.map +1 -1
- package/esm/store/sideEffects/onVisualizationSave.js +32 -240
- package/esm/store/sideEffects/onVisualizationSuccessSave.d.ts +3 -4
- package/esm/store/sideEffects/onVisualizationSuccessSave.d.ts.map +1 -1
- package/esm/store/sideEffects/onVisualizationSuccessSave.js +16 -49
- package/esm/store/sideEffects/utils.d.ts +0 -2
- package/esm/store/sideEffects/utils.d.ts.map +1 -1
- package/esm/store/sideEffects/utils.js +0 -14
- package/package.json +20 -19
- package/styles/css/main.css +12 -496
- package/styles/css/main.css.map +1 -1
- package/styles/css/messages.css +12 -496
- package/styles/css/messages.css.map +1 -1
- package/styles/scss/messages.scss +14 -375
- package/esm/components/messages/AssistantMessage.d.ts +0 -8
- package/esm/components/messages/AssistantMessage.d.ts.map +0 -1
- package/esm/components/messages/AssistantMessage.js +0 -35
- package/esm/components/messages/MessageContents.d.ts +0 -12
- package/esm/components/messages/MessageContents.d.ts.map +0 -1
- package/esm/components/messages/MessageContents.js +0 -49
- package/esm/components/messages/ReasoningDropdown.d.ts +0 -14
- package/esm/components/messages/ReasoningDropdown.d.ts.map +0 -1
- package/esm/components/messages/ReasoningDropdown.js +0 -42
- package/esm/components/messages/ReasoningMessage.d.ts +0 -9
- package/esm/components/messages/ReasoningMessage.d.ts.map +0 -1
- package/esm/components/messages/ReasoningMessage.js +0 -45
- package/esm/components/messages/UserMessage.d.ts +0 -8
- package/esm/components/messages/UserMessage.d.ts.map +0 -1
- package/esm/components/messages/UserMessage.js +0 -10
- package/esm/components/messages/contents/ChangeAnalysisContentsComponent.d.ts +0 -12
- package/esm/components/messages/contents/ChangeAnalysisContentsComponent.d.ts.map +0 -1
- package/esm/components/messages/contents/ChangeAnalysisContentsComponent.js +0 -36
- package/esm/components/messages/contents/ErrorContents.d.ts +0 -7
- package/esm/components/messages/contents/ErrorContents.d.ts.map +0 -1
- package/esm/components/messages/contents/ErrorContents.js +0 -8
- package/esm/components/messages/contents/ReasoningContents.d.ts +0 -6
- package/esm/components/messages/contents/ReasoningContents.d.ts.map +0 -1
- package/esm/components/messages/contents/ReasoningContents.js +0 -43
- package/esm/components/messages/contents/RoutingContents.d.ts +0 -8
- package/esm/components/messages/contents/RoutingContents.d.ts.map +0 -1
- package/esm/components/messages/contents/RoutingContents.js +0 -8
- package/esm/components/messages/contents/SearchContents.d.ts +0 -7
- package/esm/components/messages/contents/SearchContents.d.ts.map +0 -1
- package/esm/components/messages/contents/SearchContents.js +0 -15
- package/esm/components/messages/contents/SemanticSearchContents.d.ts +0 -8
- package/esm/components/messages/contents/SemanticSearchContents.d.ts.map +0 -1
- package/esm/components/messages/contents/SemanticSearchContents.js +0 -27
- package/esm/components/messages/contents/TextContents.d.ts +0 -7
- package/esm/components/messages/contents/TextContents.d.ts.map +0 -1
- package/esm/components/messages/contents/TextContents.js +0 -8
- package/esm/components/messages/contents/VisualizationContents.d.ts +0 -24
- package/esm/components/messages/contents/VisualizationContents.d.ts.map +0 -1
- package/esm/components/messages/contents/VisualizationContents.js +0 -532
- package/esm/components/messages/contents/VisualizationSaveDialog.d.ts +0 -13
- package/esm/components/messages/contents/VisualizationSaveDialog.d.ts.map +0 -1
- package/esm/components/messages/contents/VisualizationSaveDialog.js +0 -33
- package/esm/components/messages/contents/hooks/useVisualisationSaving.d.ts +0 -6
- package/esm/components/messages/contents/hooks/useVisualisationSaving.d.ts.map +0 -1
- package/esm/components/messages/contents/hooks/useVisualisationSaving.js +0 -17
- package/esm/components/messages/contents/useExecution.d.ts +0 -14
- package/esm/components/messages/contents/useExecution.d.ts.map +0 -1
- package/esm/components/messages/contents/useExecution.js +0 -131
- package/esm/components/messages/contents/useKdaDefinition.d.ts +0 -13
- package/esm/components/messages/contents/useKdaDefinition.d.ts.map +0 -1
- package/esm/components/messages/contents/useKdaDefinition.js +0 -140
- package/esm/components/messages/messageState.d.ts +0 -12
- package/esm/components/messages/messageState.d.ts.map +0 -1
- package/esm/components/messages/messageState.js +0 -21
- package/esm/store/sideEffects/converters/interactionsToMessages.d.ts +0 -19
- package/esm/store/sideEffects/converters/interactionsToMessages.d.ts.map +0 -1
- package/esm/store/sideEffects/converters/interactionsToMessages.js +0 -82
|
@@ -337,379 +337,6 @@ $dataset_color: #952f8e;
|
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
|
|
340
|
-
//MESSAGES
|
|
341
|
-
|
|
342
|
-
.gd-gen-ai-chat__messages__message {
|
|
343
|
-
display: flex;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
.gd-gen-ai-chat__messages__message__contents_wrap {
|
|
347
|
-
display: flex;
|
|
348
|
-
flex-direction: column;
|
|
349
|
-
gap: 5px;
|
|
350
|
-
flex-grow: 1;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
.gd-gen-ai-chat__messages__feedback {
|
|
354
|
-
display: flex;
|
|
355
|
-
flex-direction: row;
|
|
356
|
-
height: 20px;
|
|
357
|
-
|
|
358
|
-
svg {
|
|
359
|
-
opacity: 0;
|
|
360
|
-
transition: opacity 0.2s;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
&:focus-within {
|
|
364
|
-
svg {
|
|
365
|
-
opacity: 1;
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
.gd-gen-ai-chat__messages__message:last-child .gd-gen-ai-chat__messages__feedback,
|
|
371
|
-
.gd-gen-ai-chat__messages__message:hover .gd-gen-ai-chat__messages__feedback,
|
|
372
|
-
.gd-gen-ai-chat__messages__feedback--assigned {
|
|
373
|
-
svg {
|
|
374
|
-
opacity: 1;
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
.gd-gen-ai-chat__messages__message--user {
|
|
379
|
-
.gd-gen-ai-chat__messages__content--text {
|
|
380
|
-
$tail-height: 7px;
|
|
381
|
-
$tail-width: 10px;
|
|
382
|
-
|
|
383
|
-
max-width: 80%;
|
|
384
|
-
background-color: kit-variables.$gd-palette-primary-base;
|
|
385
|
-
border-radius: 3px 3px 0 3px;
|
|
386
|
-
padding: 4.5px 12px;
|
|
387
|
-
position: relative;
|
|
388
|
-
align-self: flex-end;
|
|
389
|
-
margin-bottom: 15px;
|
|
390
|
-
animation: gd-gen-ai-message-in 0.3s ease-out;
|
|
391
|
-
|
|
392
|
-
&::after {
|
|
393
|
-
content: "";
|
|
394
|
-
position: absolute;
|
|
395
|
-
bottom: -$tail-height;
|
|
396
|
-
right: 0;
|
|
397
|
-
border: 0 solid transparent;
|
|
398
|
-
border-top: $tail-height solid kit-variables.$gd-palette-primary-base;
|
|
399
|
-
border-left-width: $tail-width;
|
|
400
|
-
width: 0;
|
|
401
|
-
height: 0;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
@include content-markdown(kit-variables.$gd-color-white, "user");
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
&.gd-gen-ai-chat__messages__message--cancelled .gd-gen-ai-chat__messages__content--text {
|
|
408
|
-
color: kit-variables.$gd-color-white;
|
|
409
|
-
background-color: kit-variables.$gd-palette-primary-base-t80;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
&.gd-gen-ai-chat__messages__message--cancelled .gd-gen-ai-chat__messages__content--text::after {
|
|
413
|
-
border-top-color: kit-variables.$gd-palette-primary-base-t80;
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
.gd-gen-ai-chat__messages__message--assistant {
|
|
418
|
-
display: flex;
|
|
419
|
-
flex-direction: row;
|
|
420
|
-
gap: 10px;
|
|
421
|
-
align-items: flex-start;
|
|
422
|
-
margin-bottom: 19px;
|
|
423
|
-
|
|
424
|
-
&:last-child {
|
|
425
|
-
margin-bottom: 40px;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
.gd-gen-ai-chat__messages__content {
|
|
429
|
-
.gd-typography--h1,
|
|
430
|
-
.gd-typography--h2,
|
|
431
|
-
.gd-typography--h3,
|
|
432
|
-
.gd-typography--h4 {
|
|
433
|
-
margin-top: 15px;
|
|
434
|
-
margin-bottom: 10px;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
.gd-typography--p {
|
|
438
|
-
margin-top: 5px;
|
|
439
|
-
margin-bottom: 5px;
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
.gd-gen-ai-chat__messages__contents {
|
|
445
|
-
flex: 1;
|
|
446
|
-
padding: 4.5px 0;
|
|
447
|
-
display: flex;
|
|
448
|
-
flex-direction: column;
|
|
449
|
-
gap: 15px;
|
|
450
|
-
|
|
451
|
-
// UI kit links have white-space nowrap, which is not desired in the chat
|
|
452
|
-
& .gd-hyperlink,
|
|
453
|
-
& .gd-hyperlink-text {
|
|
454
|
-
white-space: normal;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
// List contents should be styled same as a pargraph
|
|
458
|
-
& li {
|
|
459
|
-
@include typo-mixins.gd-paragraph;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
@include object-types("user");
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
.gd-gen-ai-chat__messages__content--text {
|
|
466
|
-
h1,
|
|
467
|
-
h2,
|
|
468
|
-
h3,
|
|
469
|
-
h4,
|
|
470
|
-
h5,
|
|
471
|
-
h6,
|
|
472
|
-
p,
|
|
473
|
-
ul,
|
|
474
|
-
ol {
|
|
475
|
-
margin: 0 0 8px;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
h1,
|
|
479
|
-
h2,
|
|
480
|
-
h3,
|
|
481
|
-
h4,
|
|
482
|
-
h5,
|
|
483
|
-
h6 {
|
|
484
|
-
margin-top: 12px;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
h1:first-child,
|
|
488
|
-
h2:first-child,
|
|
489
|
-
h3:first-child,
|
|
490
|
-
h4:first-child,
|
|
491
|
-
h5:first-child,
|
|
492
|
-
h6:first-child {
|
|
493
|
-
margin-top: 0;
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
ul,
|
|
497
|
-
ol {
|
|
498
|
-
padding-left: 20px;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
li {
|
|
502
|
-
margin-bottom: 4px;
|
|
503
|
-
|
|
504
|
-
&:last-child {
|
|
505
|
-
margin-bottom: 0;
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
p:last-child,
|
|
510
|
-
ul:last-child,
|
|
511
|
-
ol:last-child {
|
|
512
|
-
margin-bottom: 0;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
table {
|
|
516
|
-
@include typo-mixins.gd-paragraph;
|
|
517
|
-
width: 100%;
|
|
518
|
-
border-collapse: collapse;
|
|
519
|
-
margin: 8px 0;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
th,
|
|
523
|
-
td {
|
|
524
|
-
border: 1px solid kit-variables.$gd-border-color;
|
|
525
|
-
padding: 4px 8px;
|
|
526
|
-
text-align: left;
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
th {
|
|
530
|
-
background: kit-variables.$is-focused-background;
|
|
531
|
-
font-weight: 600;
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
.gd-gen-ai-chat__messages__content--error {
|
|
536
|
-
flex: unset;
|
|
537
|
-
padding: 4px 10px;
|
|
538
|
-
border-radius: 3px;
|
|
539
|
-
background: kit-variables.$gd-palette-error-dimmed;
|
|
540
|
-
color: kit-variables.$gd-palette-error-base;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
.gd-gen-ai-chat__messages__content--changeAnalysis {
|
|
544
|
-
&__button {
|
|
545
|
-
margin-top: 15px;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
&__metric {
|
|
549
|
-
display: inline-flex;
|
|
550
|
-
align-items: baseline;
|
|
551
|
-
flex-direction: row;
|
|
552
|
-
gap: 5px;
|
|
553
|
-
color: kit-variables.$gd-color-object-type-metric;
|
|
554
|
-
|
|
555
|
-
svg {
|
|
556
|
-
position: relative;
|
|
557
|
-
bottom: -4px;
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
.gd-gen-ai-chat__messages__content--semantic-search {
|
|
563
|
-
display: grid;
|
|
564
|
-
|
|
565
|
-
.gd-gen-ai-chat__messages__semantic-search-header {
|
|
566
|
-
display: flex;
|
|
567
|
-
flex-direction: row;
|
|
568
|
-
align-items: center;
|
|
569
|
-
gap: 7px;
|
|
570
|
-
margin: 10px 0 5px 0;
|
|
571
|
-
font-size: 14px;
|
|
572
|
-
font-weight: 400;
|
|
573
|
-
color: var(--gd-palette-complementary-7);
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
.gd-ui-kit-treeview {
|
|
577
|
-
border: 1px solid kit-variables.$gd-border-color;
|
|
578
|
-
border-radius: 8px;
|
|
579
|
-
overflow-x: hidden;
|
|
580
|
-
overflow-y: auto;
|
|
581
|
-
overscroll-behavior: contain;
|
|
582
|
-
margin: 0;
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
.gd-gen-ai-chat__messages__message--cancelled .gd-gen-ai-chat__messages__content {
|
|
587
|
-
&,
|
|
588
|
-
& p,
|
|
589
|
-
& a,
|
|
590
|
-
& a:hover,
|
|
591
|
-
& a:active,
|
|
592
|
-
& a:visited {
|
|
593
|
-
color: kit-variables.$gd-color-disabled;
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
.gd-gen-ai-chat__loading {
|
|
598
|
-
animation: gd-gen-ai-message-loading 3s infinite linear;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
.gd-gen-ai-chat__visualization {
|
|
602
|
-
margin: 10px 0;
|
|
603
|
-
padding: 10px;
|
|
604
|
-
border-radius: 8px;
|
|
605
|
-
position: relative;
|
|
606
|
-
border: 1px solid kit-variables.$is-focused-background;
|
|
607
|
-
background: kit-variables.$gd-chart-background;
|
|
608
|
-
color: variables.$gd-dashboards-content-widget-title-color;
|
|
609
|
-
|
|
610
|
-
&--headline {
|
|
611
|
-
height: auto;
|
|
612
|
-
min-height: 50px;
|
|
613
|
-
|
|
614
|
-
// Headline value is smaller in chart, looks much better with contrast with other text
|
|
615
|
-
.headline-value {
|
|
616
|
-
font-size: 0.8em;
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
.gd-icon-filter::before {
|
|
620
|
-
background: none;
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
&--table {
|
|
625
|
-
background: kit-variables.$gd-table-background;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
&__wrapper {
|
|
629
|
-
height: 250px;
|
|
630
|
-
|
|
631
|
-
&--headline {
|
|
632
|
-
height: auto;
|
|
633
|
-
min-height: 50px;
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
&__drill_overlay {
|
|
638
|
-
position: absolute;
|
|
639
|
-
top: 0;
|
|
640
|
-
left: 0;
|
|
641
|
-
right: 0;
|
|
642
|
-
bottom: 0;
|
|
643
|
-
background: rgba(0, 0, 0, 0.01);
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
&__title {
|
|
647
|
-
text-align: center;
|
|
648
|
-
margin-top: 15px;
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
&__suggestions {
|
|
652
|
-
display: flex;
|
|
653
|
-
flex-wrap: wrap;
|
|
654
|
-
flex-direction: row;
|
|
655
|
-
gap: 10px;
|
|
656
|
-
|
|
657
|
-
.gd-ui-kit-button + .gd-ui-kit-button {
|
|
658
|
-
margin-left: 0;
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
&__save-dialog {
|
|
663
|
-
width: 565px;
|
|
664
|
-
|
|
665
|
-
.gd-dialog-content p {
|
|
666
|
-
margin-bottom: 1em;
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
&__buttons {
|
|
671
|
-
position: absolute;
|
|
672
|
-
top: 0.5em;
|
|
673
|
-
right: 0.5em;
|
|
674
|
-
display: flex;
|
|
675
|
-
flex-direction: row;
|
|
676
|
-
gap: 5px;
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
&__save button:not(:focus):not(:focus-visible) {
|
|
680
|
-
opacity: 0;
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
&__table button:not(:focus):not(:focus-visible) {
|
|
684
|
-
opacity: 0;
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
// Show menu button on hover or when menu is open (active class)
|
|
688
|
-
&:hover,
|
|
689
|
-
&.active {
|
|
690
|
-
.gd-gen-ai-chat__visualization__save button {
|
|
691
|
-
opacity: 1;
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
.gd-gen-ai-chat__visualization__table button {
|
|
695
|
-
opacity: 1;
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
&__menu_overlay {
|
|
700
|
-
padding: 8px 0;
|
|
701
|
-
box-shadow: 0 1px 20px var(--gd-shadow-color-from-theme, rgba(20, 56, 93, 0.2));
|
|
702
|
-
background: kit-variables.$gd-color-white;
|
|
703
|
-
border-radius: 3px;
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
&__what-if-group {
|
|
707
|
-
display: flex;
|
|
708
|
-
flex-direction: column;
|
|
709
|
-
gap: 12px;
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
|
|
713
340
|
.gd-gen-ai-chat__messages__empty {
|
|
714
341
|
display: flex;
|
|
715
342
|
flex-direction: column;
|
|
@@ -815,7 +442,7 @@ $dataset_color: #952f8e;
|
|
|
815
442
|
display: inline;
|
|
816
443
|
}
|
|
817
444
|
|
|
818
|
-
.gd-gen-ai-
|
|
445
|
+
.gd-gen-ai-chat__conversation__visualization__drill-header {
|
|
819
446
|
padding: 4px 10px;
|
|
820
447
|
display: flex;
|
|
821
448
|
text-transform: uppercase;
|
|
@@ -1507,9 +1134,13 @@ $dataset_color: #952f8e;
|
|
|
1507
1134
|
}
|
|
1508
1135
|
|
|
1509
1136
|
&--error {
|
|
1137
|
+
flex: unset;
|
|
1138
|
+
padding: 4px 10px;
|
|
1139
|
+
border-radius: 3px;
|
|
1140
|
+
background: kit-variables.$gd-palette-error-dimmed;
|
|
1141
|
+
color: kit-variables.$gd-palette-error-base;
|
|
1510
1142
|
display: flex;
|
|
1511
1143
|
flex-direction: column;
|
|
1512
|
-
padding: 0;
|
|
1513
1144
|
|
|
1514
1145
|
.gd-gen-ai-chat__error-info {
|
|
1515
1146
|
display: flex;
|
|
@@ -1786,4 +1417,12 @@ $dataset_color: #952f8e;
|
|
|
1786
1417
|
background: kit-variables.$gd-color-white;
|
|
1787
1418
|
border-radius: 3px;
|
|
1788
1419
|
}
|
|
1420
|
+
|
|
1421
|
+
&__save-dialog {
|
|
1422
|
+
width: 565px;
|
|
1423
|
+
|
|
1424
|
+
.gd-dialog-content p {
|
|
1425
|
+
margin-bottom: 1em;
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1789
1428
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type AssistantMessage } from "../../model.js";
|
|
2
|
-
type AssistantMessageProps = {
|
|
3
|
-
message: AssistantMessage;
|
|
4
|
-
isLast?: boolean;
|
|
5
|
-
};
|
|
6
|
-
export declare function AssistantMessageComponent({ message, isLast }: AssistantMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=AssistantMessage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantMessage.d.ts","sourceRoot":"","sources":["../../../src/components/messages/AssistantMessage.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAQvD,KAAK,qBAAqB,GAAG;IACzB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,qBAAqB,2CA+FnF"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// (C) 2024-2026 GoodData Corporation
|
|
3
|
-
import { useCallback } from "react";
|
|
4
|
-
import cx from "classnames";
|
|
5
|
-
import { useIntl } from "react-intl";
|
|
6
|
-
import { useDispatch } from "react-redux";
|
|
7
|
-
import { UiIconButton, UiTooltip } from "@gooddata/sdk-ui-kit";
|
|
8
|
-
import { setUserFeedback } from "../../store/messages/messagesSlice.js";
|
|
9
|
-
import { FeedbackPopup } from "./FeedbackPopup.js";
|
|
10
|
-
import { MessageContents } from "./MessageContents.js";
|
|
11
|
-
import { getAssistantMessageState } from "./messageState.js";
|
|
12
|
-
import { useUserFeedback } from "./useUserFeedback.js";
|
|
13
|
-
export function AssistantMessageComponent({ message, isLast }) {
|
|
14
|
-
const intl = useIntl();
|
|
15
|
-
const dispatch = useDispatch();
|
|
16
|
-
const setUserFeedbackAction = useCallback((payload) => {
|
|
17
|
-
dispatch(setUserFeedback(payload));
|
|
18
|
-
}, [dispatch]);
|
|
19
|
-
const { handlePositiveFeedbackClick, handleNegativeFeedbackClick, handleFeedbackSubmit } = useUserFeedback({ message, setUserFeedback: setUserFeedbackAction });
|
|
20
|
-
const messageState = getAssistantMessageState(message);
|
|
21
|
-
const thumbsUpLabel = intl.formatMessage({ id: "gd.gen-ai.feedback.like" });
|
|
22
|
-
const thumbsDownLabel = intl.formatMessage({ id: "gd.gen-ai.feedback.dislike" });
|
|
23
|
-
return (_jsxs("div", { className: cx("gd-gen-ai-chat__messages__message", "gd-gen-ai-chat__messages__message--assistant", messageState === "cancelled" && "gd-gen-ai-chat__messages__message--cancelled"), "data-state": messageState, "data-testid": "gen-ai-thread-assistant-message", children: [_jsx("span", { className: "gd-gen-ai-chat__visually__hidden", children: intl.formatMessage({ id: "gd.gen-ai.message.label.assistant" }) }), _jsxs("div", { className: "gd-gen-ai-chat__messages__message__contents_wrap", children: [_jsx(MessageContents, { useMarkdown: true, content: message.content, messageState: messageState, isLastMessage: isLast, messageId: message.localId }), message.complete ? (_jsxs("div", { className: cx({
|
|
24
|
-
"gd-gen-ai-chat__messages__feedback": true,
|
|
25
|
-
"gd-gen-ai-chat__messages__feedback--assigned": message.feedback !== "NONE",
|
|
26
|
-
}), children: [_jsx(UiTooltip, { triggerBy: ["focus", "hover"], arrowPlacement: "bottom", anchor: _jsx(UiIconButton, { icon: "thumbsUp", variant: "tertiary", size: "small", isActive: message.feedback === "POSITIVE", onClick: handlePositiveFeedbackClick, accessibilityConfig: {
|
|
27
|
-
ariaLabel: thumbsUpLabel,
|
|
28
|
-
ariaPressed: message.feedback === "POSITIVE" ? "true" : "false",
|
|
29
|
-
} }), content: thumbsUpLabel }), _jsx(FeedbackPopup, { anchor: (opened) => {
|
|
30
|
-
return (_jsx(UiTooltip, { triggerBy: ["focus", "hover"], arrowPlacement: "bottom", anchor: _jsx(UiIconButton, { icon: "thumbsDown", variant: "tertiary", size: "small", isActive: message.feedback === "NEGATIVE" || opened, onClick: handleNegativeFeedbackClick, accessibilityConfig: {
|
|
31
|
-
ariaLabel: thumbsDownLabel,
|
|
32
|
-
ariaPressed: message.feedback === "NEGATIVE" ? "true" : "false",
|
|
33
|
-
} }), content: thumbsDownLabel }));
|
|
34
|
-
}, onSubmit: handleFeedbackSubmit })] })) : null] })] }));
|
|
35
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type Contents } from "../../model.js";
|
|
2
|
-
import { type AssistantMessageState } from "./messageState.js";
|
|
3
|
-
type MessageContentsProps = {
|
|
4
|
-
content: Contents[];
|
|
5
|
-
messageId: string;
|
|
6
|
-
messageState?: AssistantMessageState;
|
|
7
|
-
isLastMessage?: boolean;
|
|
8
|
-
useMarkdown?: boolean;
|
|
9
|
-
};
|
|
10
|
-
export declare function MessageContents({ content, messageId, messageState, isLastMessage, useMarkdown, }: MessageContentsProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=MessageContents.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MessageContents.d.ts","sourceRoot":"","sources":["../../../src/components/messages/MessageContents.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAU/C,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAG/D,KAAK,oBAAoB,GAAG;IACxB,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAC5B,OAAO,EACP,SAAS,EACT,YAAyB,EACzB,aAAqB,EACrB,WAAmB,GACtB,EAAE,oBAAoB,2CA+EtB"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// (C) 2024-2026 GoodData Corporation
|
|
3
|
-
import { FormattedMessage } from "react-intl";
|
|
4
|
-
import { useSelector } from "react-redux";
|
|
5
|
-
import { Typography } from "@gooddata/sdk-ui-kit";
|
|
6
|
-
import { settingsSelector } from "../../store/chatWindow/chatWindowSelectors.js";
|
|
7
|
-
import { ChangeAnalysisContentsComponent } from "./contents/ChangeAnalysisContentsComponent.js";
|
|
8
|
-
import { ErrorContentsComponent } from "./contents/ErrorContents.js";
|
|
9
|
-
import { RoutingContentsComponent } from "./contents/RoutingContents.js";
|
|
10
|
-
import { SearchContentsComponent } from "./contents/SearchContents.js";
|
|
11
|
-
import { SemanticSearchContentsComponent } from "./contents/SemanticSearchContents.js";
|
|
12
|
-
import { TextContentsComponent } from "./contents/TextContents.js";
|
|
13
|
-
import { VisualizationContentsComponent } from "./contents/VisualizationContents.js";
|
|
14
|
-
import { ReasoningMessage } from "./ReasoningMessage.js";
|
|
15
|
-
export function MessageContents({ content, messageId, messageState = "complete", isLastMessage = false, useMarkdown = false, }) {
|
|
16
|
-
const settings = useSelector(settingsSelector);
|
|
17
|
-
const isReasoningEnabled = Boolean(settings?.enableGenAIReasoningVisibility);
|
|
18
|
-
const isComplete = messageState === "complete" || messageState === "cancelled" || messageState === "error";
|
|
19
|
-
const isCancelled = messageState === "cancelled";
|
|
20
|
-
return (_jsxs("div", { className: "gd-gen-ai-chat__messages__contents", children: [_jsx(ReasoningMessage, { content: content, messageState: messageState }), content.map((item, index) => {
|
|
21
|
-
const type = item.type;
|
|
22
|
-
switch (type) {
|
|
23
|
-
case "text":
|
|
24
|
-
return _jsx(TextContentsComponent, { useMarkdown: useMarkdown, content: item }, index);
|
|
25
|
-
case "error":
|
|
26
|
-
return (_jsx(ErrorContentsComponent, { useMarkdown: useMarkdown, content: item }, index));
|
|
27
|
-
case "routing":
|
|
28
|
-
// When reasoning visibility is enabled, routing/use-case reasoning must not be shown.
|
|
29
|
-
// It would overlap with the model-provided reasoning answer and create confusion.
|
|
30
|
-
return isReasoningEnabled ? null : (_jsx(RoutingContentsComponent, { useMarkdown: useMarkdown, content: item }, index));
|
|
31
|
-
case "reasoning":
|
|
32
|
-
// Skip reasoning here - shown in dropdown when FF is enabled
|
|
33
|
-
return null;
|
|
34
|
-
case "search":
|
|
35
|
-
return (_jsx(SearchContentsComponent, { useMarkdown: useMarkdown, content: item }, index));
|
|
36
|
-
case "semanticSearch":
|
|
37
|
-
return (_jsx(SemanticSearchContentsComponent, { content: item, useMarkdown: useMarkdown }, index));
|
|
38
|
-
case "visualization":
|
|
39
|
-
return (_jsx(VisualizationContentsComponent, { useMarkdown: useMarkdown, content: item, showSuggestions: isLastMessage, messageId: messageId }, index));
|
|
40
|
-
case "changeAnalysis":
|
|
41
|
-
return (_jsx(ChangeAnalysisContentsComponent, { useMarkdown: useMarkdown, content: item, messageId: messageId }, index));
|
|
42
|
-
default:
|
|
43
|
-
return assertNever(type);
|
|
44
|
-
}
|
|
45
|
-
}), !isReasoningEnabled && !isComplete ? (_jsx(Typography, { tagName: "p", children: _jsx(FormattedMessage, { id: "gd.gen-ai.state.generating" }) })) : null, isCancelled ? (_jsx(Typography, { tagName: "p", children: _jsx(FormattedMessage, { id: "gd.gen-ai.state.cancelled" }) })) : null] }));
|
|
46
|
-
}
|
|
47
|
-
const assertNever = (value) => {
|
|
48
|
-
throw new Error(`Unknown content type: ${value}`);
|
|
49
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
import { type ReasoningContents } from "../../model.js";
|
|
3
|
-
type ReasoningDropdownProps = {
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
isReasoningFinished: boolean;
|
|
6
|
-
lastReasoningStepTitle: string | undefined;
|
|
7
|
-
};
|
|
8
|
-
export declare function ReasoningDropdown({ children, isReasoningFinished, lastReasoningStepTitle, }: ReasoningDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
/**
|
|
10
|
-
* Gets the title of the last reasoning step across all reasoning items.
|
|
11
|
-
*/
|
|
12
|
-
export declare function getLastReasoningStepTitle(reasoningItems: ReasoningContents[]): string | undefined;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=ReasoningDropdown.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReasoningDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/messages/ReasoningDropdown.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAOjD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,KAAK,sBAAsB,GAAG;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,sBAAsB,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9C,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAC9B,QAAQ,EACR,mBAAmB,EACnB,sBAAsB,GACzB,EAAE,sBAAsB,2CA2CxB;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,cAAc,EAAE,iBAAiB,EAAE,GAAG,MAAM,GAAG,SAAS,CAcjG"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// (C) 2025-2026 GoodData Corporation
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import cx from "classnames";
|
|
5
|
-
import { useIntl } from "react-intl";
|
|
6
|
-
import { UiButton } from "@gooddata/sdk-ui-kit";
|
|
7
|
-
export function ReasoningDropdown({ children, isReasoningFinished, lastReasoningStepTitle, }) {
|
|
8
|
-
const [isExpanded, setIsExpanded] = useState(false);
|
|
9
|
-
const intl = useIntl();
|
|
10
|
-
const thoughtProcessText = intl.formatMessage({ id: "gd.gen-ai.routing.thinking-process" });
|
|
11
|
-
const thinkingText = intl.formatMessage({ id: "gd.gen-ai.state.thinking" });
|
|
12
|
-
const displayText = isReasoningFinished
|
|
13
|
-
? thoughtProcessText
|
|
14
|
-
: lastReasoningStepTitle
|
|
15
|
-
? lastReasoningStepTitle + "..."
|
|
16
|
-
: thinkingText + "...";
|
|
17
|
-
// Announce reasoning intent changes to screen readers.
|
|
18
|
-
// The parent log has aria-relevant="additions" which only announces new elements,
|
|
19
|
-
// but we want to announce text updates (e.g., "Thinking..." → "Creating a visualization...")
|
|
20
|
-
const liveRegionText = isReasoningFinished ? undefined : displayText;
|
|
21
|
-
return (_jsxs("div", { className: cx("gd-gen-ai-chat__thought-process-dropdown", {
|
|
22
|
-
"gd-gen-ai-chat__thought-process-dropdown--loading": !isReasoningFinished,
|
|
23
|
-
}), children: [_jsx("span", { className: "gd-gen-ai-chat__visually__hidden", "aria-live": "polite", "aria-atomic": "true", children: liveRegionText }), _jsx(UiButton, { onClick: () => setIsExpanded(!isExpanded), accessibilityConfig: { ariaExpanded: isExpanded }, iconBefore: isExpanded ? "navigateDown" : "navigateRight", iconBeforeSize: 12, label: displayText, variant: "tertiary" }), isExpanded ? (_jsxs("div", { className: "gd-gen-ai-chat__thought-process-dropdown__content", children: [_jsx("div", { className: "gd-gen-ai-chat__thought-process-dropdown__timeline" }), _jsx("div", { className: "gd-gen-ai-chat__thought-process-dropdown__body", children: children })] })) : null] }));
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Gets the title of the last reasoning step across all reasoning items.
|
|
27
|
-
*/
|
|
28
|
-
export function getLastReasoningStepTitle(reasoningItems) {
|
|
29
|
-
// Iterate from the end to find the last step with a title
|
|
30
|
-
for (let i = reasoningItems.length - 1; i >= 0; i--) {
|
|
31
|
-
const steps = reasoningItems[i].steps;
|
|
32
|
-
if (steps?.length) {
|
|
33
|
-
// Find the last step with a non-empty title
|
|
34
|
-
for (let j = steps.length - 1; j >= 0; j--) {
|
|
35
|
-
if (steps[j].title) {
|
|
36
|
-
return steps[j].title;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return undefined;
|
|
42
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type Contents } from "../../model.js";
|
|
2
|
-
import { type AssistantMessageState } from "./messageState.js";
|
|
3
|
-
interface IReasoningMessageProps {
|
|
4
|
-
content: Contents[];
|
|
5
|
-
messageState: AssistantMessageState;
|
|
6
|
-
}
|
|
7
|
-
export declare function ReasoningMessage({ content, messageState }: IReasoningMessageProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=ReasoningMessage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReasoningMessage.d.ts","sourceRoot":"","sources":["../../../src/components/messages/ReasoningMessage.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAA+C,MAAM,gBAAgB,CAAC;AAI5F,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAG/D,UAAU,sBAAsB;IAC5B,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,YAAY,EAAE,qBAAqB,CAAC;CACvC;AAED,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,sBAAsB,kDA0DjF"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// (C) 2025-2026 GoodData Corporation
|
|
3
|
-
import { useSelector } from "react-redux";
|
|
4
|
-
import { isReasoningContents } from "../../model.js";
|
|
5
|
-
import { settingsSelector } from "../../store/chatWindow/chatWindowSelectors.js";
|
|
6
|
-
import { ReasoningContentsComponent } from "./contents/ReasoningContents.js";
|
|
7
|
-
import { ReasoningDropdown, getLastReasoningStepTitle } from "./ReasoningDropdown.js";
|
|
8
|
-
export function ReasoningMessage({ content, messageState }) {
|
|
9
|
-
const settings = useSelector(settingsSelector);
|
|
10
|
-
const isReasoningEnabled = Boolean(settings?.enableGenAIReasoningVisibility);
|
|
11
|
-
const isComplete = messageState === "complete" || messageState === "cancelled" || messageState === "error";
|
|
12
|
-
// Collect reasoning items for the dropdown
|
|
13
|
-
const reasoningItems = content.filter(isReasoningContents);
|
|
14
|
-
const mergedReasoningSteps = reasoningItems.flatMap((item) => item.steps ?? []);
|
|
15
|
-
const hasReasoningSteps = mergedReasoningSteps.length > 0;
|
|
16
|
-
const mergedReasoningContent = {
|
|
17
|
-
type: "reasoning",
|
|
18
|
-
steps: mergedReasoningSteps,
|
|
19
|
-
};
|
|
20
|
-
// Treat dropdown as "complete" once any real (non-reasoning) answer content exists
|
|
21
|
-
const hasRenderedAnswer = content.some((item) => {
|
|
22
|
-
if (item.type === "reasoning")
|
|
23
|
-
return false;
|
|
24
|
-
if (item.type === "routing")
|
|
25
|
-
return false; // routing is hidden when reasoning FF is enabled
|
|
26
|
-
if (item.type === "text" || item.type === "error") {
|
|
27
|
-
return item.text.trim().length > 0;
|
|
28
|
-
}
|
|
29
|
-
// search / semanticSearch / visualization / changeAnalysis => all render meaningful output
|
|
30
|
-
return true;
|
|
31
|
-
});
|
|
32
|
-
const isReasoningFinished = isComplete || hasRenderedAnswer;
|
|
33
|
-
// Show dropdown when reasoning is enabled and (response is still streaming or contains reasoning items)
|
|
34
|
-
const shouldShowDropdown = isReasoningEnabled && (!isReasoningFinished || reasoningItems.length > 0);
|
|
35
|
-
if (!shouldShowDropdown) {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
// Count reasoning steps
|
|
39
|
-
const totalReasoningSteps = reasoningItems.reduce((sum, item) => sum + (item.steps?.length ?? 0), 0);
|
|
40
|
-
// Get the title of the last reasoning step
|
|
41
|
-
const lastReasoningStepTitle = getLastReasoningStepTitle(reasoningItems);
|
|
42
|
-
// Show placeholder when streaming and no reasoning yet
|
|
43
|
-
const showThinkingPlaceholder = !isReasoningFinished && totalReasoningSteps === 0;
|
|
44
|
-
return (_jsxs(ReasoningDropdown, { isReasoningFinished: isReasoningFinished, lastReasoningStepTitle: lastReasoningStepTitle, children: [showThinkingPlaceholder ? _jsx("div", { className: "gd-gen-ai-chat__reasoning" }) : null, hasReasoningSteps ? _jsx(ReasoningContentsComponent, { content: mergedReasoningContent }) : null] }));
|
|
45
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type UserMessage } from "../../model.js";
|
|
2
|
-
type UserMessageProps = {
|
|
3
|
-
message: UserMessage;
|
|
4
|
-
isLast?: boolean;
|
|
5
|
-
};
|
|
6
|
-
export declare function UserMessageComponent({ message, isLast }: UserMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=UserMessage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserMessage.d.ts","sourceRoot":"","sources":["../../../src/components/messages/UserMessage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,KAAK,gBAAgB,GAAG;IACpB,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,gBAAgB,2CAuBzE"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// (C) 2024-2026 GoodData Corporation
|
|
3
|
-
import cx from "classnames";
|
|
4
|
-
import { useIntl } from "react-intl";
|
|
5
|
-
import { MessageContents } from "./MessageContents.js";
|
|
6
|
-
export function UserMessageComponent({ message, isLast }) {
|
|
7
|
-
const intl = useIntl();
|
|
8
|
-
const classNames = cx("gd-gen-ai-chat__messages__message", "gd-gen-ai-chat__messages__message--user", message.cancelled && "gd-gen-ai-chat__messages__message--cancelled");
|
|
9
|
-
return (_jsxs("div", { className: classNames, children: [_jsx("span", { className: "gd-gen-ai-chat__visually__hidden", children: intl.formatMessage({ id: "gd.gen-ai.message.label.user" }) }), _jsx(MessageContents, { useMarkdown: true, content: message.content, messageState: "complete", isLastMessage: isLast, messageId: message.localId })] }));
|
|
10
|
-
}
|