Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
329 commits
Select commit Hold shift + click to select a range
c92a8f3
Merge branch 'master' of https://github.com/IgniteUI/igniteui-webcomp…
teodosiah Jul 3, 2025
c3f5e30
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
gedinakova Jul 3, 2025
dd3fed1
refactor(chat): move common logic into chat state class
teodosiah Jul 4, 2025
78b4e4d
feat(chat): expose message template
teodosiah Jul 8, 2025
e4c9314
fix(chat): export correct type in index.ts
teodosiah Jul 8, 2025
72ca424
Merge branch 'master' into dmdimitrov/chat-ai-component
teodosiah Jul 8, 2025
5259098
feat(chat): add DOMPurify sanitizer
igdmdimitrov Jul 8, 2025
adf894e
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
igdmdimitrov Jul 8, 2025
0079d34
feat(chat): add support for custom markdown renderer
igdmdimitrov Jul 9, 2025
7df3050
feat(chat): expose draftMessage prop & input area templates
teodosiah Jul 11, 2025
7976d72
Merge branch 'master' of https://github.com/IgniteUI/igniteui-webcomp…
teodosiah Jul 11, 2025
bcb49c3
Merge branch 'master' of https://github.com/IgniteUI/igniteui-webcomp…
teodosiah Jul 16, 2025
a381855
feat(chat): add initial KB nav between messages
teodosiah Jul 16, 2025
6e5f0f1
feat(chat): expand input textarea on long input
igdmdimitrov Jul 17, 2025
05df856
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
igdmdimitrov Jul 17, 2025
d325646
chore(*): update input wrapper prop in tests
igdmdimitrov Jul 17, 2025
39d443d
test(chat): add input focus & KB arrow up/down tests
teodosiah Jul 18, 2025
99320a4
feat(chat): add aria attributes to the chat elements
teodosiah Jul 22, 2025
fe31e84
feat(chat): add slot for empty message list area
teodosiah Jul 22, 2025
b9ecb52
Merge branch 'master' of https://github.com/IgniteUI/igniteui-webcomp…
teodosiah Jul 22, 2025
3c6c454
test(chat): fix tests after exposing empty message list slot
teodosiah Jul 22, 2025
1d6d140
chore(chat): remove default attachment action buttons & fix duplicate…
teodosiah Jul 23, 2025
e57787e
test(chat): fix attachment header actions test
teodosiah Jul 23, 2025
b335c29
Merge branch 'master' of https://github.com/IgniteUI/igniteui-webcomp…
teodosiah Jul 23, 2025
6839f7d
feat(chat): add home/end KB nav & additional tests
teodosiah Jul 23, 2025
212711b
refactor(chat): change action button and attachments places in the in…
teodosiah Jul 23, 2025
4ddd539
Merge branch 'master' into dmdimitrov/chat-ai-component
teodosiah Jul 23, 2025
da400be
Merge branch 'master' into dmdimitrov/chat-ai-component
teodosiah Jul 24, 2025
8a03d6e
feat(chat): initial styling
SisIvanova Jul 24, 2025
4a296aa
chore(*): JSDoc for all types in types.ts
gedinakova Jul 24, 2025
4032567
fix(chat): failing tests
SisIvanova Jul 24, 2025
6735e65
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
gedinakova Jul 24, 2025
e614203
chore(*): JSDoc for chat components
gedinakova Jul 24, 2025
5a50f60
refactor(chat): use key binding controller instead of handling keydow…
teodosiah Jul 24, 2025
701e9ea
fix(chat): fix merge issues
teodosiah Jul 24, 2025
e92820c
feat(chat): expose suggestions header slot
teodosiah Jul 24, 2025
fbfa82e
chore(*): Adding JSDoc to igc-chat-input
gedinakova Jul 24, 2025
598a378
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
gedinakova Jul 24, 2025
f160851
feat(chat): expose getters for the default input area elements
teodosiah Jul 25, 2025
f688b53
refactor(chat): remove containers when they are empty
teodosiah Jul 25, 2025
b3d7800
feat(chat): expose inputPlaceholder option
teodosiah Jul 25, 2025
618943d
Merge branch 'master' into dmdimitrov/chat-ai-component
teodosiah Jul 25, 2025
0d78411
refactor(chat): fix using classes in tests, add undefined checks
teodosiah Jul 28, 2025
4b9355a
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
teodosiah Jul 28, 2025
45ccac3
refactor(chat): apply dragging part
teodosiah Jul 28, 2025
9a65e96
Merge branch 'master' of https://github.com/IgniteUI/igniteui-webcomp…
teodosiah Jul 28, 2025
dec1240
fix(chat): fix file drag&drop
teodosiah Jul 28, 2025
dcda60f
chore(chat): component styling
SisIvanova Jul 28, 2025
aa8d71e
fix(chat): lint errors
SisIvanova Jul 28, 2025
87a52f4
fix(chat): fix calculating active message index
teodosiah Jul 29, 2025
b80c175
chore(chat): add story with templates
teodosiah Jul 29, 2025
0ca9772
refactor(chat): header should be displayed only if it has content
teodosiah Jul 31, 2025
87a2862
refactor(chat): remove the expansion panel usage as default attachmen…
teodosiah Jul 31, 2025
0078251
feat(chat): focus styles and improvements
SisIvanova Jul 31, 2025
b2095e0
Update chat.base.scss
SisIvanova Jul 31, 2025
dfb73eb
feat(chat): return unknown instead of TemplateResult for templates
igdmdimitrov Aug 1, 2025
7a80cef
chore(*): remove leftover props
igdmdimitrov Aug 1, 2025
62a8879
refactor(chat): separate message & attachment template, provide the e…
teodosiah Aug 4, 2025
9aa705f
Adding an option for positioning the suggestions (#1803)
gedinakova Aug 5, 2025
f8daf04
Merge branch 'master' of https://github.com/IgniteUI/igniteui-webcomp…
teodosiah Aug 5, 2025
8d28a31
build(deps): Bumped to fixed theming package
rkaraivanov Aug 5, 2025
a10f321
fix(chat): clear file input after attaching and avoid duplicated atta…
igdmdimitrov Aug 5, 2025
6bfd5ae
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
igdmdimitrov Aug 5, 2025
e984b07
feat(chat): use input type=file instead of igc-file-input
igdmdimitrov Aug 6, 2025
45dc235
feat(chat): add prefix icon in attachments chips
igdmdimitrov Aug 6, 2025
3572374
refactor(chat): styling improvements
SisIvanova Aug 6, 2025
c2b25b3
feat(chat): address some PR comments and improve typing change
igdmdimitrov Aug 8, 2025
b565409
refactor(chat): chip icons and typing dots animation
SisIvanova Aug 11, 2025
f79f356
feat(chat): use slot controller
igdmdimitrov Aug 12, 2025
7ec9588
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
igdmdimitrov Aug 12, 2025
e835efd
refactor(chat): remove message grouping
teodosiah Aug 12, 2025
cc96e63
refactor(chat): rename isComposing to isTyping
teodosiah Aug 12, 2025
b0c0c16
Merge branch 'master' of https://github.com/IgniteUI/igniteui-webcomp…
teodosiah Aug 12, 2025
8bfa538
build(deps): Bumped to latest beta theming package
SisIvanova Aug 12, 2025
4bc7fdf
refactor(chat): remove message active styles
SisIvanova Aug 12, 2025
63e4907
feat(chat): update tests
igdmdimitrov Aug 12, 2025
e4787ed
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
igdmdimitrov Aug 12, 2025
d0abb54
Update chat.base.scss
SisIvanova Aug 12, 2025
7b7a4a1
refactor(chat): use keybinidng controller for textarea enter keydown
teodosiah Aug 13, 2025
2566b0a
fix(chat): textarea keydown should be handled for any key
teodosiah Aug 13, 2025
8f2c25a
feat(chat): fixed failing tests
igdmdimitrov Aug 13, 2025
310c645
fix(chat): move max-width to `sent` part in order to make the respons…
desig9stein Aug 14, 2025
10a91ac
feat(chat): Add customizable chat height via `--igc-chat-height` vari…
desig9stein Aug 14, 2025
c5de30e
chore(*): expose scrollToMessage method
teodosiah Aug 15, 2025
e002594
feat(chat): add message reactions buttons for responses
igdmdimitrov Aug 18, 2025
04206fb
chore(*): fix lint
igdmdimitrov Aug 18, 2025
8349174
refactor(chat): use list component for suggestions
SisIvanova Aug 18, 2025
41f8116
feat(chat): fix upload file button and test fixes
igdmdimitrov Aug 18, 2025
46c7a6f
fix(chat): horizontal & vertical scrollbar issues
SisIvanova Aug 19, 2025
190dbff
Update message.base.scss
SisIvanova Aug 19, 2025
4f91b2e
chore(*): Exporting all relevant parts.
gedinakova Aug 20, 2025
c201da2
chore(*): Restored accidentally removed message-text part
gedinakova Aug 20, 2025
1e704e3
feat(chat): generate suggestions in ai story
igdmdimitrov Aug 20, 2025
4194e8f
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
igdmdimitrov Aug 20, 2025
e02457d
refactor(chat): styling improvements
SisIvanova Aug 20, 2025
860fb63
fix(*): Adding images for file attachments.
gedinakova Aug 20, 2025
5058940
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
gedinakova Aug 20, 2025
cb8cef1
chore(*): Add marked to dev dependencies.
gedinakova Aug 21, 2025
1be97ff
feat(chat): add default suggestions header and reaction tooltips
igdmdimitrov Aug 21, 2025
599d283
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
igdmdimitrov Aug 21, 2025
3d18e25
fix(*); Updated build script to copy chat assets
gedinakova Aug 21, 2025
12c2334
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
gedinakova Aug 21, 2025
87d63d7
fix(*): Fixed png images imports.
gedinakova Aug 21, 2025
8d4da70
fix(*): Adding a slot in message component
gedinakova Aug 21, 2025
b60b857
feat(chat): add sent to attachment-header part for current user
igdmdimitrov Aug 21, 2025
ac0185d
feat(chat): add template for suggestion prefix
igdmdimitrov Aug 21, 2025
a649390
feat(chat): improve reactions tooltip
igdmdimitrov Aug 21, 2025
22d88da
refactor(chat): udate attachments styling
SisIvanova Aug 22, 2025
295b729
Adding renderers + default templates (#1821)
gedinakova Aug 22, 2025
65ea59d
chore(*): Fixed chat state methods
gedinakova Aug 22, 2025
8ed9190
fix(*): Fixed templates in test setup
gedinakova Aug 22, 2025
ee2e5a9
feat(chat): fixed reaction icons and suggestions generation in AI story
igdmdimitrov Aug 22, 2025
efab918
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
gedinakova Aug 22, 2025
ea314ef
fix(*): Fix Tooltip targets
gedinakova Aug 22, 2025
b0f89fe
chore(*): update stories
igdmdimitrov Aug 22, 2025
ba740ed
fix(*): Fixing failing tests.
gedinakova Aug 24, 2025
d49e099
fix(*): Polishing on stories.
gedinakova Aug 24, 2025
79acef9
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
gedinakova Aug 24, 2025
27af099
fix(*): Fixed input actions template and tests.
gedinakova Aug 24, 2025
6951915
fix(*): Fixed message content in template test
gedinakova Aug 25, 2025
22522ec
fix(*): Adding a default sanitizer and an option for custom one.
gedinakova Aug 25, 2025
1de788e
chore(*): Added Dompurify to dev & peer deps.
gedinakova Aug 25, 2025
f701b47
refactor(chat): remove unnecessary part
SisIvanova Aug 25, 2025
0725bc7
feat(chat): moved div with parts outside of default attachment conten…
igdmdimitrov Aug 25, 2025
580e916
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
igdmdimitrov Aug 25, 2025
ac4c6ce
Merge branch 'master' into dmdimitrov/chat-ai-component
igdmdimitrov Aug 26, 2025
b9e3d68
chore(*): address PR comments
igdmdimitrov Aug 26, 2025
7802431
chore(*): address PR comments
igdmdimitrov Aug 26, 2025
f684e3d
feat(chat): add template for message author
igdmdimitrov Aug 26, 2025
f82afbd
chore(*): removed only from test
igdmdimitrov Aug 26, 2025
87facf2
fix(chat-message): Adopt page stylesheets in chat message ShadowRoot
rkaraivanov Aug 27, 2025
f1da11d
fix(*): Moved rendering logic back to components
gedinakova Aug 27, 2025
25af43c
feat(chat): renamed message header template and other
igdmdimitrov Aug 27, 2025
b78a951
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
igdmdimitrov Aug 27, 2025
68e4521
chore(*): renamed template
igdmdimitrov Aug 27, 2025
e2ab0cb
feat(chat): create igniteui-webcomponents/extras with markdown renderer
igdmdimitrov Aug 28, 2025
7fb8f58
refactor: Cleaned up chat state and smaller components
rkaraivanov Aug 29, 2025
9f1e235
fix(*): Added template renderers for all templatable areas
gedinakova Aug 29, 2025
442d664
feat(chat): remove igc-chat-message-list and move messages in igc-chat
igdmdimitrov Aug 29, 2025
73cb4e8
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
igdmdimitrov Aug 29, 2025
b995826
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
gedinakova Aug 29, 2025
feda411
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
gedinakova Aug 29, 2025
e91517d
fix(*): Updated stories to use renderers
gedinakova Aug 29, 2025
60efb94
Merge branch 'master' into dmdimitrov/chat-ai-component
gedinakova Sep 1, 2025
44ea247
fix(chat): message list styles
SisIvanova Sep 1, 2025
d72dc5b
fix(*); Simplify ChatTemplateRenderers.
gedinakova Sep 1, 2025
4165ba7
fix(*): Fixing renderers updates & tests.
gedinakova Sep 1, 2025
7eb8913
fix(*):Delegate the click to action buttons container
gedinakova Sep 1, 2025
5f6aa41
text(*): Exclude an irrelevant keyboard test.
gedinakova Sep 1, 2025
1bf8948
Merge branch 'master' into dmdimitrov/chat-ai-component
rkaraivanov Sep 2, 2025
9d3cb0f
fix(chat): render header if headerText is provided
igdmdimitrov Sep 2, 2025
4077b24
chore(*): fix chat headerText test
igdmdimitrov Sep 2, 2025
94cc25d
refactor(chat-message): Simplified renderers
rkaraivanov Sep 2, 2025
6c6fdd9
refactor(chat-input): Drag handlers bindings
rkaraivanov Sep 2, 2025
a264bcf
fix(*): Update input & attachments renderers.
gedinakova Sep 2, 2025
64b0b4e
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
gedinakova Sep 2, 2025
c14f1cb
fix(*): Adding file extensions for the planned svgs
gedinakova Sep 2, 2025
7ab0225
refactor(chat): Cache message renderer and cleaned some templates
rkaraivanov Sep 2, 2025
dfc2b65
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
rkaraivanov Sep 2, 2025
6d7731a
chore(*): update templates story with markdown message renderer
igdmdimitrov Sep 2, 2025
0421b58
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
igdmdimitrov Sep 2, 2025
7766630
refactor(test): Changed query expectation to not null.
gedinakova Sep 2, 2025
e642e3d
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
gedinakova Sep 2, 2025
02571ee
fix(chat): Autoscroll behavior
rkaraivanov Sep 2, 2025
103a8a8
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
rkaraivanov Sep 2, 2025
64af197
fix(tests): Show typing indicator when there are no messages; Updated…
gedinakova Sep 2, 2025
35dfc16
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
gedinakova Sep 2, 2025
7a636be
refactor(chat): Scroll to `end` boundry and code cleanup
rkaraivanov Sep 2, 2025
b12a229
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
rkaraivanov Sep 2, 2025
2c078d5
feat(chat): renamed message actions icons and tooltips
igdmdimitrov Sep 3, 2025
8e73294
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
igdmdimitrov Sep 3, 2025
2a2ebbb
test(*): Updated slots tests
gedinakova Sep 3, 2025
83de405
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
gedinakova Sep 3, 2025
959ab63
chore(*): enabled markdown for AI story
igdmdimitrov Sep 3, 2025
4db6d87
refactor(chat): use icons from internal registry
simeonoff Sep 3, 2025
c6f3157
refactor(*): Changed renderAttachment signature
gedinakova Sep 3, 2025
facb259
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
gedinakova Sep 3, 2025
c139b7c
refactor(*): Removed highlighter prop from MarkdownRendererOptions
gedinakova Sep 3, 2025
91c3ffe
feat(chat): refactor layout to use CSS Grid for improved structure an…
desig9stein Sep 4, 2025
ae4d4e6
refactor(chat): replace png assets with svg icons
simeonoff Sep 4, 2025
3c82640
feat(chat): tests adjustments
igdmdimitrov Sep 4, 2025
f11668c
feat(chat): styling improvements
SisIvanova Sep 5, 2025
5ecce9c
refactor(chat): update thumb active icons
simeonoff Sep 5, 2025
8794409
feat(chat): support for toggled like/dislike message actions
igdmdimitrov Sep 5, 2025
599f9e2
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
igdmdimitrov Sep 5, 2025
f01ce78
chore(*): update dislike active icon name
igdmdimitrov Sep 5, 2025
9382e23
Merge remote-tracking branch 'origin/master' into dmdimitrov/chat-ai-…
rkaraivanov Sep 9, 2025
95ab978
refactor(chat): Simplify markdown renderer
rkaraivanov Sep 9, 2025
6814780
refactor(chat): Streamline rendering
rkaraivanov Sep 9, 2025
73294bb
refactor: Starting to clear up internal chat state model
rkaraivanov Sep 9, 2025
7a65bdc
chore(*): adding all file type icons
gedinakova Sep 9, 2025
6ce1588
refactor(chat): textarea height
SisIvanova Sep 9, 2025
3d99d05
fix(chat): code snippets font
SisIvanova Sep 9, 2025
570a3e4
refactor(chat): textarea size
SisIvanova Sep 10, 2025
f5ac4de
chore(*): Adding file preview icons. (#1843)
gedinakova Sep 10, 2025
5caf2aa
feat(chat): add suggestion prefix renderer
igdmdimitrov Sep 10, 2025
f370c0a
Merge branch 'master' into dmdimitrov/chat-ai-component
gedinakova Sep 10, 2025
000922f
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
igdmdimitrov Sep 10, 2025
c387091
fix(chat): header fixes
SisIvanova Sep 11, 2025
bdac4b8
chore(*): adjust chat tests
igdmdimitrov Sep 11, 2025
ba82fb6
refactor(chat): Reorganized template renderers and types
rkaraivanov Sep 11, 2025
7c0882a
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
rkaraivanov Sep 11, 2025
10d31be
fix(*): Render actions for message with attachments only.
gedinakova Sep 11, 2025
b9f17da
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
gedinakova Sep 11, 2025
14870b8
refactor: Removed default renderers from template context
rkaraivanov Sep 12, 2025
867cfc1
chore: Adjusted chat stories
rkaraivanov Sep 12, 2025
8cc770f
chore(*): Copy message content to clipboard (#1846)
gedinakova Sep 12, 2025
58fc80f
feat(chat): export sent css part
igdmdimitrov Sep 12, 2025
ed68030
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
igdmdimitrov Sep 12, 2025
42412b8
refactor(*): Moved show tooltip & toast functions to ChatState.
gedinakova Sep 12, 2025
c48300e
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
gedinakova Sep 12, 2025
f06f9c1
chore(*): renamed renderer contexts
igdmdimitrov Sep 12, 2025
7545f95
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
igdmdimitrov Sep 12, 2025
674a5e0
chore(*): Added input area start and end renderers
gedinakova Sep 12, 2025
67ff710
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
gedinakova Sep 12, 2025
9af4c9d
refactor(*): Renamed message and message attachment interfaces
gedinakova Sep 12, 2025
88cd56d
Merge remote-tracking branch 'origin/master' into dmdimitrov/chat-ai-…
rkaraivanov Sep 12, 2025
1b0a763
chore: Fix chat stylelint errors
rkaraivanov Sep 12, 2025
72c3ae6
feat(chat): add message-actions part
igdmdimitrov Sep 12, 2025
8b2d30e
chore(*): tests adjustment
igdmdimitrov Sep 12, 2025
ad0e2eb
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
igdmdimitrov Sep 12, 2025
da4733d
refactor: Cleaned up chat state model
rkaraivanov Sep 12, 2025
2838753
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
rkaraivanov Sep 12, 2025
5a6c266
fix(*): Scroll typing indicator/suggestions into view. (#1848)
gedinakova Sep 12, 2025
d87f63a
refactor: Cleaned-up auto-scroll handler
rkaraivanov Sep 12, 2025
88848af
test: Fixed DOM structure for the typing indicator container
rkaraivanov Sep 12, 2025
15d6214
refactor: Moved state functionality to appropriate inner components
rkaraivanov Sep 16, 2025
7d34591
feat: Split attachments event into explciit types
rkaraivanov Sep 16, 2025
ad879b1
fix(*): Removed unnecessary timeouts
gedinakova Sep 16, 2025
5bcea88
refactor: API docs and moved adoptRootStyles as optional
rkaraivanov Sep 16, 2025
40a07cb
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
rkaraivanov Sep 16, 2025
5415b9c
docs: Enhance adoptRootStyles API docs
rkaraivanov Sep 16, 2025
96569e3
docs: Updated adoptRootStyle API docs
rkaraivanov Sep 16, 2025
c703225
fix(*): Fixed failing interaction & events tests
gedinakova Sep 16, 2025
ad57339
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
gedinakova Sep 16, 2025
5be4ebc
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
gedinakova Sep 16, 2025
9bbf2ed
refactor(*): Further fixes & updates of events tests.
gedinakova Sep 16, 2025
625ab14
refactor(*): Adding wrapping containers for some renderers
gedinakova Sep 17, 2025
d5dd419
deps(theming): bump to theming version with dark chat schemas
simeonoff Sep 17, 2025
258e457
fix(chat): hide empty parts
SisIvanova Sep 17, 2025
4b6f657
fix: Strip significant whitespace from empty template containers
rkaraivanov Sep 17, 2025
aa6746f
test(*): Small tweak for custom content
gedinakova Sep 17, 2025
c98cb22
refactor(*): Updated all parts & export
gedinakova Sep 17, 2025
210d391
test: Fixed typing state test
rkaraivanov Sep 18, 2025
0a8b8b6
fix: Flaky test and auto-scroll behavior
rkaraivanov Sep 18, 2025
8b1b965
Merge branch 'master' into dmdimitrov/chat-ai-component
gedinakova Sep 18, 2025
8654bb4
deps(theming): bump theming package to latest release
simeonoff Sep 18, 2025
af26fdc
refactor(chat): styling improvements
SisIvanova Sep 18, 2025
1f06be1
feat: Pinned dependencies and updated release package.json
rkaraivanov Sep 18, 2025
a276dbf
Merge branch 'dmdimitrov/chat-ai-component' of https://github.com/Ign…
rkaraivanov Sep 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@
"typescript": "^5.8.3",
"vite": "^6.3.4"
},
"peerDependencies": {
"marked": "^12.0.0"
},
"browserslist": [
"defaults"
],
Expand Down
187 changes: 187 additions & 0 deletions src/components/chat/chat-input.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
import { LitElement, html } from 'lit';
import { property, query, state } from 'lit/decorators.js';
import IgcIconButtonComponent from '../button/icon-button.js';
import IgcChipComponent from '../chip/chip.js';
import { registerComponent } from '../common/definitions/register.js';
import IgcFileInputComponent from '../file-input/file-input.js';
import IgcIconComponent from '../icon/icon.js';
import { registerIconFromText } from '../icon/icon.registry.js';
import IgcTextareaComponent from '../textarea/textarea.js';
import { styles } from './themes/input.base.css.js';
import {
type IgcMessageAttachment,
attachmentIcon,
sendButtonIcon,
} from './types.js';

/**
*
* @element igc-chat
*
*/
export default class IgcChatInputComponent extends LitElement {
/** @private */
public static readonly tagName = 'igc-chat-input';

public static override styles = styles;

/* blazorSuppress */
public static register() {
registerComponent(
IgcChatInputComponent,
IgcTextareaComponent,
IgcIconButtonComponent,
IgcChipComponent,
IgcFileInputComponent,
IgcIconComponent
);
}

@property({ type: Boolean, attribute: 'disable-attachments' })
public disableAttachments = false;

@property({ type: Boolean })
public isAiResponding = false;

@query('textarea')
private textInputElement!: HTMLTextAreaElement;

@state()
private inputValue = '';

@state()
private attachments: IgcMessageAttachment[] = [];

constructor() {
super();
registerIconFromText('attachment', attachmentIcon, 'material');
registerIconFromText('send-message', sendButtonIcon, 'material');
}

private handleInput(e: Event) {
const target = e.target as HTMLTextAreaElement;
this.inputValue = target.value;
this.adjustTextareaHeight();
}

private handleKeyDown(e: KeyboardEvent) {
if (e.key === 'Enter' && !e.shiftKey) {
e.preventDefault();
this.sendMessage();
}
}

private adjustTextareaHeight() {
const textarea = this.textInputElement;
if (!textarea) return;

textarea.style.height = 'auto';
const newHeight = Math.min(textarea.scrollHeight, 120);
textarea.style.height = `${newHeight}px`;
}

private sendMessage() {
if (!this.inputValue.trim() && this.attachments.length === 0) return;

const messageEvent = new CustomEvent('message-send', {
detail: { text: this.inputValue, attachments: this.attachments },
});

this.dispatchEvent(messageEvent);
this.inputValue = '';
this.attachments = [];

if (this.textInputElement) {
this.textInputElement.style.height = 'auto';
}

setTimeout(() => {
this.textInputElement?.focus();
}, 0);
}

private handleFileUpload(e: Event) {
const input = (e.target as any).input as HTMLInputElement;
if (!input.files || input.files.length === 0) return;

const files = Array.from(input.files);
const newAttachments: IgcMessageAttachment[] = [];
files.forEach((file) => {
const isImage = file.type.startsWith('image/');
newAttachments.push({
id: `attach_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
type: isImage ? 'image' : 'file',
url: URL.createObjectURL(file),
name: file.name,
size: file.size,
thumbnail: isImage ? URL.createObjectURL(file) : undefined,
});
});
this.attachments = [...this.attachments, ...newAttachments];
}

private removeAttachment(index: number) {
this.attachments = this.attachments.filter((_, i) => i !== index);
}

protected override render() {
return html`
<div class="input-container">
${this.disableAttachments
? ''
: html`
<igc-file-input multiple @igcChange=${this.handleFileUpload}>
<igc-icon
slot="file-selector-text"
name="attachment"
collection="material"
></igc-icon>
</igc-file-input>
`}

<div class="input-wrapper">
<igc-textarea
class="text-input"
placeholder="Type a message..."
rows="1"
.value=${this.inputValue}
@input=${this.handleInput}
@keydown=${this.handleKeyDown}
></igc-textarea>
</div>

<div class="buttons-container">
<igc-icon-button
name="send-message"
collection="material"
variant="contained"
class="small"
?disabled=${!this.inputValue.trim() &&
this.attachments.length === 0}
@click=${this.sendMessage}
></igc-icon-button>
</div>
</div>
<div>
${this.attachments?.map(
(attachment, index) => html`
<div class="attachment-wrapper">
<igc-chip
removable
@igcRemove=${() => this.removeAttachment(index)}
>
<span class="attachment-name">${attachment.name}</span>
</igc-chip>
</div>
`
)}
</div>
`;
}
}

declare global {
interface HTMLElementTagNameMap {
'igc-chat-input': IgcChatInputComponent;
}
}
138 changes: 138 additions & 0 deletions src/components/chat/chat-message-list.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
import { LitElement, html } from 'lit';
import { property } from 'lit/decorators.js';
import { repeat } from 'lit/directives/repeat.js';
import { registerComponent } from '../common/definitions/register.js';
import IgcChatMessageComponent from './chat-message.js';
import { styles } from './themes/message-list.base.css.js';
import type { IgcMessage } from './types.js';

/**
*
* @element igc-chat-message-list
*
*/
export default class IgcChatMessageListComponent extends LitElement {
/** @private */
public static readonly tagName = 'igc-chat-message-list';

public static override styles = styles;

/* blazorSuppress */
public static register() {
registerComponent(IgcChatMessageListComponent, IgcChatMessageComponent);
}

@property({ reflect: true, attribute: false })
public messages: IgcMessage[] = [];

@property({ reflect: true, attribute: false })
public isAiResponding = false;

@property({ type: Boolean, attribute: 'disable-auto-scroll' })
public disableAutoScroll = false;

private formatDate(date: Date): string {
const today = new Date();
const yesterday = new Date(today);
yesterday.setDate(yesterday.getDate() - 1);

if (date.toDateString() === today.toDateString()) {
return 'Today';
}

if (date.toDateString() === yesterday.toDateString()) {
return 'Yesterday';
}

return date.toLocaleDateString('en-US', {
weekday: 'long',
month: 'short',
day: 'numeric',
});
}

private groupMessagesByDate(
messages: IgcMessage[]
): { date: string; messages: IgcMessage[] }[] {
const grouped: { [key: string]: IgcMessage[] } = {};

messages.forEach((message) => {
const dateStr = this.formatDate(message.timestamp);
if (!grouped[dateStr]) {
grouped[dateStr] = [];
}
grouped[dateStr].push(message);
});

return Object.keys(grouped).map((date) => ({
date,
messages: grouped[date],
}));
}

private scrollToBottom() {
requestAnimationFrame(() => {
const container = this.shadowRoot?.host as HTMLElement;
if (container) {
container.scrollTop = container.scrollHeight;
}
});
}

protected override updated() {
if (!this.disableAutoScroll) {
this.scrollToBottom();
}
}

protected override firstUpdated() {
if (!this.disableAutoScroll) {
this.scrollToBottom();
}
}

protected override render() {
const groupedMessages = this.groupMessagesByDate(this.messages);

return html`
<div class='message-container'></div>
<div class="message-list">
${repeat(
groupedMessages,
(group) => group.date,
(group) => html`
<div class="day-separator">${group.date}</div>
${repeat(
group.messages,
(message) => message.id,
(message) => html`
<igc-chat-message
.message=${message}
.isResponse=${message.isResponse}
></igc-chat-message>
`
)}
`
)}
${
this.isAiResponding
? html`
<div class="typing-indicator">
<div class="typing-dot"></div>
<div class="typing-dot"></div>
<div class="typing-dot"></div>
</div>
`
: ''
}
</div>
</div>
`;
}
}

declare global {
interface HTMLElementTagNameMap {
'igc-chat-message-list': IgcChatMessageListComponent;
}
}
Loading