Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: frontend components refactoring #108

Merged
merged 41 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
3276f34
chore: replaced property decorator for state where boolean
anfibiacreativa Nov 2, 2023
1cb9fd3
chore: update the import
anfibiacreativa Nov 2, 2023
da12c02
chore: update vite config
anfibiacreativa Nov 2, 2023
cfa4d65
chore: create a barrel for all exports
anfibiacreativa Nov 2, 2023
4f665ab
chore: add a teaser type
anfibiacreativa Nov 2, 2023
2cf51d2
chore: add a barrel for core modules
anfibiacreativa Nov 2, 2023
3840812
chore: update global config according to teaser type
anfibiacreativa Nov 2, 2023
13a6a55
chore: move teaserlist styles to own file
anfibiacreativa Nov 2, 2023
fe7ab2c
chore: rename main styles import to chat
anfibiacreativa Nov 2, 2023
67fc447
chore: remove default questions from main component
anfibiacreativa Nov 2, 2023
919f723
chore: create teaserlist component
anfibiacreativa Nov 2, 2023
f04be7c
chore: handle teaser click event on teaserlist
anfibiacreativa Nov 2, 2023
8dcd74b
chore: handle teaserlist click on chat component
anfibiacreativa Nov 2, 2023
818dcbd
chore: remove debugging statements
anfibiacreativa Nov 2, 2023
5d59b94
chore: add tab component
anfibiacreativa Nov 3, 2023
f55511e
chore: add tab component styles
anfibiacreativa Nov 3, 2023
5127edb
chore: decouple tab component (thought process)
anfibiacreativa Nov 3, 2023
8da1949
chore: add tab component to bundle
anfibiacreativa Nov 3, 2023
16d046f
chore: change name of function to generic
anfibiacreativa Nov 3, 2023
2943b16
chore: update styles from main restyling
anfibiacreativa Nov 10, 2023
525891d
chore: update styles for teaserlist
anfibiacreativa Nov 10, 2023
64c8a7a
chore: add event cancellation from main
anfibiacreativa Nov 10, 2023
d2abb81
chore: add latest changes
anfibiacreativa Nov 10, 2023
c716976
fix: merge conflicts on error styles
Nov 10, 2023
e7252a8
chore: fix eslint errors
shibbas Nov 11, 2023
2a1772b
chore: refactor voice input into it's own component
shibbas Nov 14, 2023
770526f
chore: refactor tab component to be generic
shibbas Nov 14, 2023
c968198
chore: refactor markdown preview to it's own component
shibbas Nov 14, 2023
849b302
fix: fix follow up question click
shibbas Nov 14, 2023
265acdf
test: add test for followup questions
shibbas Nov 14, 2023
76837a5
test: iterate through all follow up questions
shibbas Nov 14, 2023
5f212d8
chore: use the imports for lit elements
shibbas Nov 15, 2023
756b018
feat: add support for pdf rendering in document-previewer
shibbas Nov 15, 2023
d2ba762
chore: correct teaserlist filename
shibbas Nov 15, 2023
ecb56bb
chore: make tab content children of tab content
shibbas Nov 15, 2023
71781fd
chore: move citations to their own component
shibbas Nov 15, 2023
7bdc3d9
chore: refactor the chat-thread-list into it's own component
shibbas Nov 16, 2023
0c89545
fix: correct the action button disable
shibbas Nov 16, 2023
480a155
chore: refactor action buttons to it's own component
shibbas Nov 16, 2023
9493991
fix: exported name for chat-action
shibbas Nov 16, 2023
976961d
chore: delete old style file
shibbas Nov 16, 2023
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
6 changes: 6 additions & 0 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion packages/chat-component/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ <h1>Welcome to this Azure OpenAI JavaScript Chat Sample</h1>
}
}
</style>
<script type="module" src="/src/main.ts"></script>
<script type="module" src="/src/index.ts"></script>
</body>
</html>
1 change: 1 addition & 0 deletions packages/chat-component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"author": "",
"license": "MIT",
"dependencies": {
"@types/dom-speech-recognition": "^0.0.4",
"dompurify": "^3.0.6",
"lit": "^2.8.0",
"marked": "^9.1.5"
Expand Down
46 changes: 46 additions & 0 deletions packages/chat-component/src/components/chat-action-button.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { LitElement, html } from 'lit';
import { customElement, property } from 'lit/decorators.js';

import { styles } from '../styles/chat-action-button.js';
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';

export interface ChatActionButton {
label: string;
svgIcon: string;
isDisabled: boolean;
id: string;
}

@customElement('chat-action-button')
export class ChatActionButtonComponent extends LitElement {
static override styles = [styles];

@property({ type: String })
label = '';

@property({ type: String })
svgIcon = '';

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

@property({ type: String })
actionId = '';

@property({ type: String })
tooltip: string | undefined = undefined;

override render() {
return html`
<button
title="${this.label}"
class="button chat__header--button"
data-testid="${this.actionId}"
?disabled="${this.isDisabled}"
>
<span class="chat__header--span">${this.tooltip ?? this.label}</span>
${unsafeSVG(this.svgIcon)}
</button>
`;
}
}
Loading