@tylertech/forge-ai 0.15.0 → 0.15.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/custom-elements.json +148 -126
- package/dist/ai-chatbot-launcher/ai-chatbot-launcher.mjs +40 -2
- package/dist/ai-chatbot-launcher/ai-chatbot-launcher.scss.mjs +1 -1
- package/dist/ai-threads-search/ai-threads-search.d.ts +13 -1
- package/dist/ai-threads-search/ai-threads-search.mjs +76 -13
- package/dist/ai-threads-search/ai-threads-search.scss.mjs +1 -1
- package/dist/core/popover/popover.mjs +3 -0
- package/package.json +1 -1
package/custom-elements.json
CHANGED
|
@@ -737,156 +737,156 @@
|
|
|
737
737
|
},
|
|
738
738
|
{
|
|
739
739
|
"kind": "javascript-module",
|
|
740
|
-
"path": "src/lib/ai-
|
|
740
|
+
"path": "src/lib/ai-button/ai-button.ts",
|
|
741
741
|
"declarations": [
|
|
742
742
|
{
|
|
743
743
|
"kind": "variable",
|
|
744
|
-
"name": "
|
|
744
|
+
"name": "AiButtonComponentTagName",
|
|
745
745
|
"type": {
|
|
746
746
|
"text": "keyof HTMLElementTagNameMap"
|
|
747
747
|
},
|
|
748
|
-
"default": "'forge-ai-
|
|
748
|
+
"default": "'forge-ai-button'"
|
|
749
749
|
},
|
|
750
750
|
{
|
|
751
751
|
"kind": "class",
|
|
752
752
|
"description": "",
|
|
753
|
-
"name": "
|
|
753
|
+
"name": "AiButtonComponent",
|
|
754
|
+
"slots": [
|
|
755
|
+
{
|
|
756
|
+
"description": "Default slot for button content",
|
|
757
|
+
"name": ""
|
|
758
|
+
}
|
|
759
|
+
],
|
|
754
760
|
"members": [
|
|
755
761
|
{
|
|
756
762
|
"kind": "field",
|
|
757
|
-
"name": "
|
|
763
|
+
"name": "disabled",
|
|
758
764
|
"type": {
|
|
759
765
|
"text": "boolean"
|
|
760
766
|
},
|
|
761
767
|
"privacy": "public",
|
|
762
768
|
"default": "false",
|
|
763
|
-
"description": "Whether the
|
|
764
|
-
"attribute": "
|
|
769
|
+
"description": "Whether the button is disabled",
|
|
770
|
+
"attribute": "disabled",
|
|
765
771
|
"reflects": true
|
|
766
772
|
}
|
|
767
773
|
],
|
|
768
774
|
"attributes": [
|
|
769
775
|
{
|
|
770
|
-
"name": "
|
|
776
|
+
"name": "disabled",
|
|
771
777
|
"type": {
|
|
772
778
|
"text": "boolean"
|
|
773
779
|
},
|
|
774
780
|
"default": "false",
|
|
775
|
-
"description": "Whether the
|
|
776
|
-
"fieldName": "
|
|
781
|
+
"description": "Whether the button is disabled",
|
|
782
|
+
"fieldName": "disabled"
|
|
777
783
|
}
|
|
778
784
|
],
|
|
779
785
|
"superclass": {
|
|
780
786
|
"name": "LitElement",
|
|
781
787
|
"package": "lit"
|
|
782
788
|
},
|
|
783
|
-
"tagName": "forge-ai-
|
|
789
|
+
"tagName": "forge-ai-button",
|
|
784
790
|
"customElement": true
|
|
785
791
|
}
|
|
786
792
|
],
|
|
787
793
|
"exports": [
|
|
788
794
|
{
|
|
789
795
|
"kind": "js",
|
|
790
|
-
"name": "
|
|
796
|
+
"name": "AiButtonComponentTagName",
|
|
791
797
|
"declaration": {
|
|
792
|
-
"name": "
|
|
793
|
-
"module": "src/lib/ai-
|
|
798
|
+
"name": "AiButtonComponentTagName",
|
|
799
|
+
"module": "src/lib/ai-button/ai-button.ts"
|
|
794
800
|
}
|
|
795
801
|
},
|
|
796
802
|
{
|
|
797
803
|
"kind": "js",
|
|
798
|
-
"name": "
|
|
804
|
+
"name": "AiButtonComponent",
|
|
799
805
|
"declaration": {
|
|
800
|
-
"name": "
|
|
801
|
-
"module": "src/lib/ai-
|
|
806
|
+
"name": "AiButtonComponent",
|
|
807
|
+
"module": "src/lib/ai-button/ai-button.ts"
|
|
802
808
|
}
|
|
803
809
|
},
|
|
804
810
|
{
|
|
805
811
|
"kind": "custom-element-definition",
|
|
806
812
|
"declaration": {
|
|
807
|
-
"name": "
|
|
808
|
-
"module": "src/lib/ai-
|
|
813
|
+
"name": "AiButtonComponent",
|
|
814
|
+
"module": "src/lib/ai-button/ai-button.ts"
|
|
809
815
|
}
|
|
810
816
|
}
|
|
811
817
|
]
|
|
812
818
|
},
|
|
813
819
|
{
|
|
814
820
|
"kind": "javascript-module",
|
|
815
|
-
"path": "src/lib/ai-
|
|
821
|
+
"path": "src/lib/ai-chain-of-thought/ai-chain-of-thought.ts",
|
|
816
822
|
"declarations": [
|
|
817
823
|
{
|
|
818
824
|
"kind": "variable",
|
|
819
|
-
"name": "
|
|
825
|
+
"name": "AiChainOfThoughtComponentTagName",
|
|
820
826
|
"type": {
|
|
821
827
|
"text": "keyof HTMLElementTagNameMap"
|
|
822
828
|
},
|
|
823
|
-
"default": "'forge-ai-
|
|
829
|
+
"default": "'forge-ai-chain-of-thought'"
|
|
824
830
|
},
|
|
825
831
|
{
|
|
826
832
|
"kind": "class",
|
|
827
833
|
"description": "",
|
|
828
|
-
"name": "
|
|
829
|
-
"slots": [
|
|
830
|
-
{
|
|
831
|
-
"description": "Default slot for button content",
|
|
832
|
-
"name": ""
|
|
833
|
-
}
|
|
834
|
-
],
|
|
834
|
+
"name": "AiChainOfThoughtComponent",
|
|
835
835
|
"members": [
|
|
836
836
|
{
|
|
837
837
|
"kind": "field",
|
|
838
|
-
"name": "
|
|
838
|
+
"name": "expanded",
|
|
839
839
|
"type": {
|
|
840
840
|
"text": "boolean"
|
|
841
841
|
},
|
|
842
842
|
"privacy": "public",
|
|
843
843
|
"default": "false",
|
|
844
|
-
"description": "Whether the
|
|
845
|
-
"attribute": "
|
|
844
|
+
"description": "Whether the chain of thought is expanded",
|
|
845
|
+
"attribute": "expanded",
|
|
846
846
|
"reflects": true
|
|
847
847
|
}
|
|
848
848
|
],
|
|
849
849
|
"attributes": [
|
|
850
850
|
{
|
|
851
|
-
"name": "
|
|
851
|
+
"name": "expanded",
|
|
852
852
|
"type": {
|
|
853
853
|
"text": "boolean"
|
|
854
854
|
},
|
|
855
855
|
"default": "false",
|
|
856
|
-
"description": "Whether the
|
|
857
|
-
"fieldName": "
|
|
856
|
+
"description": "Whether the chain of thought is expanded",
|
|
857
|
+
"fieldName": "expanded"
|
|
858
858
|
}
|
|
859
859
|
],
|
|
860
860
|
"superclass": {
|
|
861
861
|
"name": "LitElement",
|
|
862
862
|
"package": "lit"
|
|
863
863
|
},
|
|
864
|
-
"tagName": "forge-ai-
|
|
864
|
+
"tagName": "forge-ai-chain-of-thought",
|
|
865
865
|
"customElement": true
|
|
866
866
|
}
|
|
867
867
|
],
|
|
868
868
|
"exports": [
|
|
869
869
|
{
|
|
870
870
|
"kind": "js",
|
|
871
|
-
"name": "
|
|
871
|
+
"name": "AiChainOfThoughtComponentTagName",
|
|
872
872
|
"declaration": {
|
|
873
|
-
"name": "
|
|
874
|
-
"module": "src/lib/ai-
|
|
873
|
+
"name": "AiChainOfThoughtComponentTagName",
|
|
874
|
+
"module": "src/lib/ai-chain-of-thought/ai-chain-of-thought.ts"
|
|
875
875
|
}
|
|
876
876
|
},
|
|
877
877
|
{
|
|
878
878
|
"kind": "js",
|
|
879
|
-
"name": "
|
|
879
|
+
"name": "AiChainOfThoughtComponent",
|
|
880
880
|
"declaration": {
|
|
881
|
-
"name": "
|
|
882
|
-
"module": "src/lib/ai-
|
|
881
|
+
"name": "AiChainOfThoughtComponent",
|
|
882
|
+
"module": "src/lib/ai-chain-of-thought/ai-chain-of-thought.ts"
|
|
883
883
|
}
|
|
884
884
|
},
|
|
885
885
|
{
|
|
886
886
|
"kind": "custom-element-definition",
|
|
887
887
|
"declaration": {
|
|
888
|
-
"name": "
|
|
889
|
-
"module": "src/lib/ai-
|
|
888
|
+
"name": "AiChainOfThoughtComponent",
|
|
889
|
+
"module": "src/lib/ai-chain-of-thought/ai-chain-of-thought.ts"
|
|
890
890
|
}
|
|
891
891
|
}
|
|
892
892
|
]
|
|
@@ -9421,79 +9421,6 @@
|
|
|
9421
9421
|
}
|
|
9422
9422
|
]
|
|
9423
9423
|
},
|
|
9424
|
-
{
|
|
9425
|
-
"kind": "javascript-module",
|
|
9426
|
-
"path": "src/lib/ai-empty-state/ai-empty-state.ts",
|
|
9427
|
-
"declarations": [
|
|
9428
|
-
{
|
|
9429
|
-
"kind": "variable",
|
|
9430
|
-
"name": "AiEmptyStateComponentTagName",
|
|
9431
|
-
"type": {
|
|
9432
|
-
"text": "keyof HTMLElementTagNameMap"
|
|
9433
|
-
},
|
|
9434
|
-
"default": "'forge-ai-empty-state'"
|
|
9435
|
-
},
|
|
9436
|
-
{
|
|
9437
|
-
"kind": "class",
|
|
9438
|
-
"description": "",
|
|
9439
|
-
"name": "AiEmptyStateComponent",
|
|
9440
|
-
"slots": [
|
|
9441
|
-
{
|
|
9442
|
-
"description": "The welcome message content (overrides the default message).",
|
|
9443
|
-
"name": ""
|
|
9444
|
-
},
|
|
9445
|
-
{
|
|
9446
|
-
"description": "The icon/graphic to display.",
|
|
9447
|
-
"name": "icon"
|
|
9448
|
-
},
|
|
9449
|
-
{
|
|
9450
|
-
"description": "The custom heading/title to display.",
|
|
9451
|
-
"name": "heading"
|
|
9452
|
-
},
|
|
9453
|
-
{
|
|
9454
|
-
"description": "The custom body message content.",
|
|
9455
|
-
"name": "body"
|
|
9456
|
-
},
|
|
9457
|
-
{
|
|
9458
|
-
"description": "The actions or suggestions to display below the message.",
|
|
9459
|
-
"name": "actions"
|
|
9460
|
-
}
|
|
9461
|
-
],
|
|
9462
|
-
"members": [],
|
|
9463
|
-
"superclass": {
|
|
9464
|
-
"name": "LitElement",
|
|
9465
|
-
"package": "lit"
|
|
9466
|
-
},
|
|
9467
|
-
"tagName": "forge-ai-empty-state",
|
|
9468
|
-
"customElement": true
|
|
9469
|
-
}
|
|
9470
|
-
],
|
|
9471
|
-
"exports": [
|
|
9472
|
-
{
|
|
9473
|
-
"kind": "js",
|
|
9474
|
-
"name": "AiEmptyStateComponentTagName",
|
|
9475
|
-
"declaration": {
|
|
9476
|
-
"name": "AiEmptyStateComponentTagName",
|
|
9477
|
-
"module": "src/lib/ai-empty-state/ai-empty-state.ts"
|
|
9478
|
-
}
|
|
9479
|
-
},
|
|
9480
|
-
{
|
|
9481
|
-
"kind": "js",
|
|
9482
|
-
"name": "AiEmptyStateComponent",
|
|
9483
|
-
"declaration": {
|
|
9484
|
-
"name": "AiEmptyStateComponent",
|
|
9485
|
-
"module": "src/lib/ai-empty-state/ai-empty-state.ts"
|
|
9486
|
-
}
|
|
9487
|
-
},
|
|
9488
|
-
{
|
|
9489
|
-
"kind": "custom-element-definition",
|
|
9490
|
-
"declaration": {
|
|
9491
|
-
"name": "AiEmptyStateComponent",
|
|
9492
|
-
"module": "src/lib/ai-empty-state/ai-empty-state.ts"
|
|
9493
|
-
}
|
|
9494
|
-
}
|
|
9495
|
-
]
|
|
9496
|
-
},
|
|
9497
9424
|
{
|
|
9498
9425
|
"kind": "javascript-module",
|
|
9499
9426
|
"path": "src/lib/ai-embedded-chat/ai-embedded-chat.ts",
|
|
@@ -9730,6 +9657,79 @@
|
|
|
9730
9657
|
}
|
|
9731
9658
|
]
|
|
9732
9659
|
},
|
|
9660
|
+
{
|
|
9661
|
+
"kind": "javascript-module",
|
|
9662
|
+
"path": "src/lib/ai-empty-state/ai-empty-state.ts",
|
|
9663
|
+
"declarations": [
|
|
9664
|
+
{
|
|
9665
|
+
"kind": "variable",
|
|
9666
|
+
"name": "AiEmptyStateComponentTagName",
|
|
9667
|
+
"type": {
|
|
9668
|
+
"text": "keyof HTMLElementTagNameMap"
|
|
9669
|
+
},
|
|
9670
|
+
"default": "'forge-ai-empty-state'"
|
|
9671
|
+
},
|
|
9672
|
+
{
|
|
9673
|
+
"kind": "class",
|
|
9674
|
+
"description": "",
|
|
9675
|
+
"name": "AiEmptyStateComponent",
|
|
9676
|
+
"slots": [
|
|
9677
|
+
{
|
|
9678
|
+
"description": "The welcome message content (overrides the default message).",
|
|
9679
|
+
"name": ""
|
|
9680
|
+
},
|
|
9681
|
+
{
|
|
9682
|
+
"description": "The icon/graphic to display.",
|
|
9683
|
+
"name": "icon"
|
|
9684
|
+
},
|
|
9685
|
+
{
|
|
9686
|
+
"description": "The custom heading/title to display.",
|
|
9687
|
+
"name": "heading"
|
|
9688
|
+
},
|
|
9689
|
+
{
|
|
9690
|
+
"description": "The custom body message content.",
|
|
9691
|
+
"name": "body"
|
|
9692
|
+
},
|
|
9693
|
+
{
|
|
9694
|
+
"description": "The actions or suggestions to display below the message.",
|
|
9695
|
+
"name": "actions"
|
|
9696
|
+
}
|
|
9697
|
+
],
|
|
9698
|
+
"members": [],
|
|
9699
|
+
"superclass": {
|
|
9700
|
+
"name": "LitElement",
|
|
9701
|
+
"package": "lit"
|
|
9702
|
+
},
|
|
9703
|
+
"tagName": "forge-ai-empty-state",
|
|
9704
|
+
"customElement": true
|
|
9705
|
+
}
|
|
9706
|
+
],
|
|
9707
|
+
"exports": [
|
|
9708
|
+
{
|
|
9709
|
+
"kind": "js",
|
|
9710
|
+
"name": "AiEmptyStateComponentTagName",
|
|
9711
|
+
"declaration": {
|
|
9712
|
+
"name": "AiEmptyStateComponentTagName",
|
|
9713
|
+
"module": "src/lib/ai-empty-state/ai-empty-state.ts"
|
|
9714
|
+
}
|
|
9715
|
+
},
|
|
9716
|
+
{
|
|
9717
|
+
"kind": "js",
|
|
9718
|
+
"name": "AiEmptyStateComponent",
|
|
9719
|
+
"declaration": {
|
|
9720
|
+
"name": "AiEmptyStateComponent",
|
|
9721
|
+
"module": "src/lib/ai-empty-state/ai-empty-state.ts"
|
|
9722
|
+
}
|
|
9723
|
+
},
|
|
9724
|
+
{
|
|
9725
|
+
"kind": "custom-element-definition",
|
|
9726
|
+
"declaration": {
|
|
9727
|
+
"name": "AiEmptyStateComponent",
|
|
9728
|
+
"module": "src/lib/ai-empty-state/ai-empty-state.ts"
|
|
9729
|
+
}
|
|
9730
|
+
}
|
|
9731
|
+
]
|
|
9732
|
+
},
|
|
9733
9733
|
{
|
|
9734
9734
|
"kind": "javascript-module",
|
|
9735
9735
|
"path": "src/lib/ai-error-message/ai-error-message.ts",
|
|
@@ -13040,6 +13040,28 @@
|
|
|
13040
13040
|
}
|
|
13041
13041
|
],
|
|
13042
13042
|
"description": "Completes a delete that a host intercepted via `forge-ai-threads-search-delete-confirm`\n(calling preventDefault() to show its own confirmation instead of this component's\nbuilt-in one). Call once the host's own confirmation has been accepted."
|
|
13043
|
+
},
|
|
13044
|
+
{
|
|
13045
|
+
"kind": "method",
|
|
13046
|
+
"name": "resetSearch",
|
|
13047
|
+
"privacy": "public",
|
|
13048
|
+
"return": {
|
|
13049
|
+
"type": {
|
|
13050
|
+
"text": "void"
|
|
13051
|
+
}
|
|
13052
|
+
},
|
|
13053
|
+
"description": "Discards the current query and its results so the list shows every loaded chat again.\nDispatches no search event and moves no focus, so a host may call it on a surface that is\ncurrently hidden (e.g. a popover that stays mounted between opens)."
|
|
13054
|
+
},
|
|
13055
|
+
{
|
|
13056
|
+
"kind": "method",
|
|
13057
|
+
"name": "focus",
|
|
13058
|
+
"privacy": "public",
|
|
13059
|
+
"return": {
|
|
13060
|
+
"type": {
|
|
13061
|
+
"text": "void"
|
|
13062
|
+
}
|
|
13063
|
+
},
|
|
13064
|
+
"description": "Moves focus into the component: the search input when shown, otherwise the first chat in\nthe list, otherwise the first header button."
|
|
13043
13065
|
}
|
|
13044
13066
|
],
|
|
13045
13067
|
"events": [
|
|
@@ -13054,7 +13076,7 @@
|
|
|
13054
13076
|
"type": {
|
|
13055
13077
|
"text": "CustomEvent<ForgeAiThreadsSearchLoadMoreEventData>"
|
|
13056
13078
|
},
|
|
13057
|
-
"description": "Fired when user scrolls near bottom for pagination.",
|
|
13079
|
+
"description": "Fired when the user scrolls near the bottom or clicks \"Load more\" for pagination.",
|
|
13058
13080
|
"name": "forge-ai-threads-search-load-more"
|
|
13059
13081
|
},
|
|
13060
13082
|
{
|
|
@@ -15617,14 +15639,14 @@
|
|
|
15617
15639
|
"path": "src/lib/ai-attachment/ai-attachment.ts",
|
|
15618
15640
|
"lineNumber": 41
|
|
15619
15641
|
},
|
|
15620
|
-
"AiChainOfThoughtComponent": {
|
|
15621
|
-
"path": "src/lib/ai-chain-of-thought/ai-chain-of-thought.ts",
|
|
15622
|
-
"lineNumber": 17
|
|
15623
|
-
},
|
|
15624
15642
|
"AiButtonComponent": {
|
|
15625
15643
|
"path": "src/lib/ai-button/ai-button.ts",
|
|
15626
15644
|
"lineNumber": 22
|
|
15627
15645
|
},
|
|
15646
|
+
"AiChainOfThoughtComponent": {
|
|
15647
|
+
"path": "src/lib/ai-chain-of-thought/ai-chain-of-thought.ts",
|
|
15648
|
+
"lineNumber": 17
|
|
15649
|
+
},
|
|
15628
15650
|
"ForgeAiChatHeaderAgentChangeEventData": {
|
|
15629
15651
|
"path": "src/lib/ai-chat-header/ai-chat-header.ts",
|
|
15630
15652
|
"lineNumber": 39
|
|
@@ -16177,14 +16199,14 @@
|
|
|
16177
16199
|
"path": "src/lib/ai-edit-thread/ai-edit-thread.ts",
|
|
16178
16200
|
"lineNumber": 38
|
|
16179
16201
|
},
|
|
16180
|
-
"AiEmptyStateComponent": {
|
|
16181
|
-
"path": "src/lib/ai-empty-state/ai-empty-state.ts",
|
|
16182
|
-
"lineNumber": 23
|
|
16183
|
-
},
|
|
16184
16202
|
"AiEmbeddedChatComponent": {
|
|
16185
16203
|
"path": "src/lib/ai-embedded-chat/ai-embedded-chat.ts",
|
|
16186
16204
|
"lineNumber": 47
|
|
16187
16205
|
},
|
|
16206
|
+
"AiEmptyStateComponent": {
|
|
16207
|
+
"path": "src/lib/ai-empty-state/ai-empty-state.ts",
|
|
16208
|
+
"lineNumber": 23
|
|
16209
|
+
},
|
|
16188
16210
|
"ErrorMessageDensity": {
|
|
16189
16211
|
"path": "src/lib/ai-error-message/ai-error-message.ts",
|
|
16190
16212
|
"lineNumber": 13
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { unsafeCSS, nothing, html } from "lit";
|
|
1
|
+
import { unsafeCSS, nothing, html, LitElement } from "lit";
|
|
2
2
|
import { property, state, customElement } from "lit/decorators.js";
|
|
3
3
|
import { classMap } from "lit/directives/class-map.js";
|
|
4
4
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
@@ -40,7 +40,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
40
40
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
41
41
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
42
42
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
43
|
-
var _headerRef, _gradientContainerRef, _internals, _pendingThreadDeleteSource, _deleteThreadController, _AiChatbotLauncherComponent_instances, setViewState_fn, transitionToConversation_fn, commitConversationTransition_fn, transitionToWelcome_fn, transitionToHistory_fn, handleHistoryBack_fn, handleHeaderClear_fn, handleHeaderInfo_fn, handleThreadRename_fn, handleEditSave_fn, handleEditCancel_fn, handleThreadNameClick_fn, handleThreadDelete_fn, handleHistoryButtonClick_fn, handleHistoryPopoverToggle_fn, handleViewAllClick_fn, handleThreadsSearchQuery_fn, handleThreadsSearchLoadMore_fn, handleThreadsSearchSelect_fn, handleThreadsSearchRetry_fn, handleThreadsSearchNewChat_fn, handleThreadsSearchRename_fn, handleThreadsSearchDelete_fn, handleThreadsSearchDeleteConfirm_fn, headingElement_get, promptTemplate_get, welcomeHeaderTemplate_get, welcomeSuggestionsTemplate_get, threadName_get, threadActionsMenu_get, conversationContentTemplate_get, historyContentTemplate_get, mainContentTemplate_get, showThreadsLoading_get, historyButtonTemplate_get, historyPopoverTemplate_get, promptSectionTemplate_get;
|
|
43
|
+
var _headerRef, _gradientContainerRef, _historyButtonRef, _historyPopoverSearchRef, _historyViewSearchRef, _internals, _pendingThreadDeleteSource, _deleteThreadController, _AiChatbotLauncherComponent_instances, setViewState_fn, focusAfterUpdate_fn, transitionToConversation_fn, commitConversationTransition_fn, transitionToWelcome_fn, transitionToHistory_fn, handleHistoryBack_fn, handleHeaderClear_fn, handleHeaderInfo_fn, handleThreadRename_fn, handleEditSave_fn, handleEditCancel_fn, handleThreadNameClick_fn, handleThreadDelete_fn, handleHistoryButtonClick_fn, handleHistoryPopoverToggle_fn, handleViewAllClick_fn, handleThreadsSearchQuery_fn, handleThreadsSearchLoadMore_fn, handleThreadsSearchSelect_fn, handleThreadsSearchRetry_fn, handleThreadsSearchNewChat_fn, handleThreadsSearchRename_fn, handleThreadsSearchDelete_fn, handleThreadsSearchDeleteConfirm_fn, headingElement_get, promptTemplate_get, welcomeHeaderTemplate_get, welcomeSuggestionsTemplate_get, threadName_get, threadActionsMenu_get, conversationContentTemplate_get, historyContentTemplate_get, mainContentTemplate_get, showThreadsLoading_get, historyButtonTemplate_get, historyPopoverTemplate_get, promptSectionTemplate_get;
|
|
44
44
|
const HISTORY_POPOVER_INSET = 48;
|
|
45
45
|
const AiChatbotLauncherComponentTagName = "forge-ai-chatbot-launcher";
|
|
46
46
|
let AiChatbotLauncherComponent = class extends AiChatbotBase {
|
|
@@ -63,6 +63,9 @@ let AiChatbotLauncherComponent = class extends AiChatbotBase {
|
|
|
63
63
|
this._promptRef = createRef();
|
|
64
64
|
__privateAdd(this, _headerRef, createRef());
|
|
65
65
|
__privateAdd(this, _gradientContainerRef, createRef());
|
|
66
|
+
__privateAdd(this, _historyButtonRef, createRef());
|
|
67
|
+
__privateAdd(this, _historyPopoverSearchRef, createRef());
|
|
68
|
+
__privateAdd(this, _historyViewSearchRef, createRef());
|
|
66
69
|
__privateAdd(this, _internals);
|
|
67
70
|
__privateAdd(this, _pendingThreadDeleteSource, null);
|
|
68
71
|
__privateAdd(this, _deleteThreadController, new DeleteThreadController(this, {
|
|
@@ -185,6 +188,9 @@ let AiChatbotLauncherComponent = class extends AiChatbotBase {
|
|
|
185
188
|
};
|
|
186
189
|
_headerRef = /* @__PURE__ */ new WeakMap();
|
|
187
190
|
_gradientContainerRef = /* @__PURE__ */ new WeakMap();
|
|
191
|
+
_historyButtonRef = /* @__PURE__ */ new WeakMap();
|
|
192
|
+
_historyPopoverSearchRef = /* @__PURE__ */ new WeakMap();
|
|
193
|
+
_historyViewSearchRef = /* @__PURE__ */ new WeakMap();
|
|
188
194
|
_internals = /* @__PURE__ */ new WeakMap();
|
|
189
195
|
_pendingThreadDeleteSource = /* @__PURE__ */ new WeakMap();
|
|
190
196
|
_deleteThreadController = /* @__PURE__ */ new WeakMap();
|
|
@@ -199,10 +205,25 @@ setViewState_fn = function(next) {
|
|
|
199
205
|
this._viewState = next;
|
|
200
206
|
if (next === "history") {
|
|
201
207
|
this._dispatchHostEvent({ type: "forge-ai-chatbot-launcher-history-open" });
|
|
208
|
+
void __privateMethod(this, _AiChatbotLauncherComponent_instances, focusAfterUpdate_fn).call(this, () => __privateGet(this, _historyViewSearchRef).value);
|
|
202
209
|
} else if (previous === "history") {
|
|
203
210
|
this._dispatchHostEvent({ type: "forge-ai-chatbot-launcher-history-close" });
|
|
211
|
+
void __privateMethod(this, _AiChatbotLauncherComponent_instances, focusAfterUpdate_fn).call(this, () => this);
|
|
204
212
|
}
|
|
205
213
|
};
|
|
214
|
+
focusAfterUpdate_fn = async function(resolve) {
|
|
215
|
+
const viewState = this._viewState;
|
|
216
|
+
const popoverOpen = this._historyPopoverOpen;
|
|
217
|
+
await this.updateComplete;
|
|
218
|
+
const target = resolve();
|
|
219
|
+
if (target instanceof LitElement) {
|
|
220
|
+
await target.updateComplete;
|
|
221
|
+
}
|
|
222
|
+
if (!this.isConnected || this._viewState !== viewState || this._historyPopoverOpen !== popoverOpen) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
target?.focus();
|
|
226
|
+
};
|
|
206
227
|
transitionToConversation_fn = function() {
|
|
207
228
|
if (this._viewState === "conversation") {
|
|
208
229
|
return;
|
|
@@ -280,10 +301,24 @@ handleThreadDelete_fn = function() {
|
|
|
280
301
|
__privateGet(this, _deleteThreadController).show(thread);
|
|
281
302
|
};
|
|
282
303
|
handleHistoryButtonClick_fn = function() {
|
|
304
|
+
if (!this._historyPopoverOpen) {
|
|
305
|
+
__privateGet(this, _historyPopoverSearchRef).value?.resetSearch();
|
|
306
|
+
}
|
|
283
307
|
this._historyPopoverOpen = !this._historyPopoverOpen;
|
|
284
308
|
};
|
|
285
309
|
handleHistoryPopoverToggle_fn = function(evt) {
|
|
310
|
+
if (evt.target !== evt.currentTarget) {
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
286
313
|
this._historyPopoverOpen = evt.detail.open;
|
|
314
|
+
if (evt.detail.open) {
|
|
315
|
+
void __privateMethod(this, _AiChatbotLauncherComponent_instances, focusAfterUpdate_fn).call(this, () => __privateGet(this, _historyPopoverSearchRef).value);
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
const focusLost = this.ownerDocument.activeElement === this.ownerDocument.body;
|
|
319
|
+
if (focusLost && this._viewState !== "history") {
|
|
320
|
+
__privateGet(this, _historyButtonRef).value?.focus();
|
|
321
|
+
}
|
|
287
322
|
};
|
|
288
323
|
handleViewAllClick_fn = function() {
|
|
289
324
|
this._historyPopoverOpen = false;
|
|
@@ -539,6 +574,7 @@ historyContentTemplate_get = function() {
|
|
|
539
574
|
return html`
|
|
540
575
|
<div class="history">
|
|
541
576
|
<forge-ai-threads-search
|
|
577
|
+
${ref(__privateGet(this, _historyViewSearchRef))}
|
|
542
578
|
header-title="Chat history"
|
|
543
579
|
?show-back-button=${true}
|
|
544
580
|
.threads=${this.threads}
|
|
@@ -579,6 +615,7 @@ historyButtonTemplate_get = function() {
|
|
|
579
615
|
}
|
|
580
616
|
return html`
|
|
581
617
|
<button
|
|
618
|
+
${ref(__privateGet(this, _historyButtonRef))}
|
|
582
619
|
id="history-button"
|
|
583
620
|
slot="actions-start"
|
|
584
621
|
type="button"
|
|
@@ -625,6 +662,7 @@ historyPopoverTemplate_get = function() {
|
|
|
625
662
|
@forge-ai-popover-toggle=${__privateMethod(this, _AiChatbotLauncherComponent_instances, handleHistoryPopoverToggle_fn)}>
|
|
626
663
|
<div class="history-popover" style=${popoverWidth ? `width: ${popoverWidth}px` : ""}>
|
|
627
664
|
<forge-ai-threads-search
|
|
665
|
+
${ref(__privateGet(this, _historyPopoverSearchRef))}
|
|
628
666
|
header-title="Chat history"
|
|
629
667
|
.showNewChatButton=${false}
|
|
630
668
|
.showSearch=${chatCount > 5}
|