Skip to content

Commit

Permalink
Bump mynah-ui version to 4.0.1. (#4128)
Browse files Browse the repository at this point in the history
* Bump mynah-ui version to 4.0.1.

* Add package lock
  • Loading branch information
mk-fan authored Feb 12, 2024
1 parent 8a8ba88 commit 6d5832b
Show file tree
Hide file tree
Showing 13 changed files with 3,744 additions and 28 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ ui-tests/bin
/jetbrains-core/ui/package-lock.json
node_modules
package-lock.json
!mynah-ui/package-lock.json

2 changes: 1 addition & 1 deletion mynah-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
alias(libs.plugins.node.gradle)
}

// mynah build assumes 'build/' belongs to itself, which conficts with gradle
// mynah build assumes 'build/' belongs to itself, which conflicts with gradle
buildDir = file("gradle_build")

val buildMynahUI = tasks.register<NpmTask>("buildMynahUI") {
Expand Down
3,727 changes: 3,727 additions & 0 deletions mynah-ui/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mynah-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"lintfix": "eslint -c .eslintrc.js --fix --ext .ts ."
},
"dependencies": {
"@aws/mynah-ui-chat": "npm:@aws/mynah-ui@3.2.9",
"@aws/mynah-ui-chat": "npm:@aws/mynah-ui@4.0.1",
"@types/node": "^14.18.5",
"fs-extra": "^10.0.1",
"ts-node": "^10.7.0",
Expand Down
4 changes: 2 additions & 2 deletions mynah-ui/src/mynah-ui/ui/apps/amazonqCommonsConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { ChatItemFollowUp } from '@aws/mynah-ui-chat'
import { ChatItemAction } from '@aws/mynah-ui-chat'
import { AuthFollowUpType } from '../followUps/generator'
import { ExtensionMessage } from '../commands'

Expand Down Expand Up @@ -32,7 +32,7 @@ export class Connector {
this.onWelcomeFollowUpClicked = props.onWelcomeFollowUpClicked
}

followUpClicked = (tabID: string, followUp: ChatItemFollowUp): void => {
followUpClicked = (tabID: string, followUp: ChatItemAction): void => {
if (followUp.type !== undefined && followUp.type === 'continue-to-chat') {
this.onWelcomeFollowUpClicked(tabID, followUp.type)
}
Expand Down
4 changes: 2 additions & 2 deletions mynah-ui/src/mynah-ui/ui/apps/cwChatConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { ChatItem, ChatItemFollowUp, ChatItemType, FeedbackPayload } from '@aws/mynah-ui-chat'
import { ChatItem, ChatItemAction, ChatItemType, FeedbackPayload } from '@aws/mynah-ui-chat'
import { ExtensionMessage } from '../commands'
import { CodeReference } from './amazonqCommonsConnector'
import { TabOpenType, TabsStorage } from '../storages/tabsStorage'
Expand Down Expand Up @@ -68,7 +68,7 @@ export class Connector {
})
}

followUpClicked = (tabID: string, messageId: string, followUp: ChatItemFollowUp): void => {
followUpClicked = (tabID: string, messageId: string, followUp: ChatItemAction): void => {
this.sendMessageToExtension({
command: 'follow-up-was-clicked',
followUp,
Expand Down
4 changes: 2 additions & 2 deletions mynah-ui/src/mynah-ui/ui/apps/featureDevChatConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { ChatItem, ChatItemFollowUp, ChatItemType, FeedbackPayload } from '@aws/mynah-ui-chat'
import { ChatItem, ChatItemAction, ChatItemType, FeedbackPayload } from '@aws/mynah-ui-chat'
import { ExtensionMessage } from '../commands'
import { TabType, TabsStorage } from '../storages/tabsStorage'
import { CodeReference } from './amazonqCommonsConnector'
Expand Down Expand Up @@ -93,7 +93,7 @@ export class Connector {
})
}

followUpClicked = (tabID: string, followUp: ChatItemFollowUp): void => {
followUpClicked = (tabID: string, followUp: ChatItemAction): void => {
this.sendMessageToExtension({
command: 'follow-up-was-clicked',
followUp,
Expand Down
4 changes: 2 additions & 2 deletions mynah-ui/src/mynah-ui/ui/connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { ChatItem, ChatItemFollowUp, FeedbackPayload, Engagement } from '@aws/mynah-ui-chat'
import { ChatItem, ChatItemAction, FeedbackPayload, Engagement } from '@aws/mynah-ui-chat'
import { Connector as CWChatConnector } from './apps/cwChatConnector'
import { Connector as FeatureDevChatConnector } from './apps/featureDevChatConnector'
import { Connector as AmazonQCommonsConnector } from './apps/amazonqCommonsConnector'
Expand Down Expand Up @@ -280,7 +280,7 @@ export class Connector {
}
}

onFollowUpClicked = (tabID: string, messageId: string, followUp: ChatItemFollowUp): void => {
onFollowUpClicked = (tabID: string, messageId: string, followUp: ChatItemAction): void => {
switch (this.tabsStorage.getTab(tabID)?.type) {
// TODO: We cannot rely on the tabType here,
// It can come up at a later point depending on the future UX designs,
Expand Down
4 changes: 2 additions & 2 deletions mynah-ui/src/mynah-ui/ui/followUps/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { ChatItemFollowUp, ChatItemType, MynahUI } from '@aws/mynah-ui-chat'
import { ChatItemAction, ChatItemType, MynahUI } from '@aws/mynah-ui-chat'
import { Connector } from '../connector'
import { TabsStorage } from '../storages/tabsStorage'
import { WelcomeFollowupType } from '../apps/amazonqCommonsConnector'
Expand All @@ -26,7 +26,7 @@ export class FollowUpInteractionHandler {
this.tabsStorage = props.tabsStorage
}

public onFollowUpClicked(tabID: string, messageId: string, followUp: ChatItemFollowUp) {
public onFollowUpClicked(tabID: string, messageId: string, followUp: ChatItemAction) {
if (
followUp.type !== undefined &&
['full-auth', 're-auth', 'missing_scopes', 'use-supported-auth'].includes(followUp.type)
Expand Down
4 changes: 2 additions & 2 deletions mynah-ui/src/mynah-ui/ui/followUps/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { ChatItemFollowUp } from '@aws/mynah-ui-chat'
import { ChatItemAction } from '@aws/mynah-ui-chat'

export interface FollowUpsBlock {
text?: string
options?: ChatItemFollowUp[]
options?: ChatItemAction[]
}
7 changes: 0 additions & 7 deletions mynah-ui/src/mynah-ui/ui/messages/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ export class TextMessageHandler {
this.mynahUI.addChatItem(tabID, {
type: ChatItemType.PROMPT,
body: chatPrompt.escapedPrompt,
...(chatPrompt.attachment !== undefined
? {
relatedContent: {
content: [chatPrompt.attachment],
},
}
: {}),
})

this.mynahUI.updateStore(tabID, {
Expand Down
7 changes: 0 additions & 7 deletions mynah-ui/src/mynah-ui/ui/quickActions/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,6 @@ export class QuickActionHandler {
this.mynahUI.addChatItem(affectedTabId, {
type: ChatItemType.PROMPT,
body: realPromptText,
...(chatPrompt.attachment !== undefined
? {
relatedContent: {
content: [chatPrompt.attachment],
},
}
: {}),
})

this.mynahUI.addChatItem(affectedTabId, {
Expand Down
1 change: 1 addition & 0 deletions mynah-ui/src/mynah-ui/ui/texts/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ export const uiComponentsTexts = {
noMoreTabsTooltip: 'You can only open ten conversation tabs at a time.',
codeSuggestionWithReferenceTitle: 'Some suggestions contain code with references.',
spinnerText: 'Generating your answer...',
pleaseSelect: 'Please select',
}

0 comments on commit 6d5832b

Please sign in to comment.