From 5e206432061bdb871ecc35224d30071acc6bf3bb Mon Sep 17 00:00:00 2001 From: Heather Buchel Date: Tue, 15 Oct 2024 13:09:14 -0400 Subject: [PATCH 01/12] pin cookie (#5904) --- package.json | 1 + yarn.lock | 44 +++++++------------------------------------- 2 files changed, 8 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index b6458816d15..4d1ad50c164 100644 --- a/package.json +++ b/package.json @@ -84,6 +84,7 @@ "@types/react-dom": "^18.2.7", "body-parser": "1.20.3", "browserslist": "^4.16.15", + "cookie": "^0.7.0", "docs/next-plugin-preval/webpack": "^5.76.0", "follow-redirects": "^1.15.6", "json5": "^2.2.1", diff --git a/yarn.lock b/yarn.lock index b0db81a1864..276ffa32622 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13861,15 +13861,10 @@ cookie-signature@1.0.6: resolved "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== -cookie@0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051" - integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw== - -cookie@~0.4.1: - version "0.4.2" - resolved "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" - integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== +cookie@0.6.0, cookie@^0.7.0, cookie@~0.4.1: + version "0.7.2" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.7.2.tgz#556369c472a2ba910f2979891b526b3436237ed7" + integrity sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w== copy-anything@^2.0.1: version "2.0.6" @@ -25861,16 +25856,7 @@ string-natural-compare@^3.0.1: resolved "https://registry.npmjs.org/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -25995,14 +25981,7 @@ stringify-entities@^4.0.0: character-entities-html4 "^2.0.0" character-entities-legacy "^3.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -28016,7 +27995,7 @@ workerpool@6.2.1: resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -28034,15 +28013,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From 1421ddef49215f232a580d464d13920b9213b698 Mon Sep 17 00:00:00 2001 From: Danny Banks Date: Tue, 15 Oct 2024 11:15:34 -0700 Subject: [PATCH 02/12] chore(ai): add graphql errors to useAIGeneration (#5900) --- .changeset/fresh-parents-invent.md | 5 ++ .../ai/use-ai-generation/index.page.tsx | 54 ++++++++------- .../hooks/__tests__/createAIHooks.test.tsx | 14 +++- .../react-ai/src/hooks/useAIGeneration.tsx | 67 +++++++++++++------ 4 files changed, 93 insertions(+), 47 deletions(-) create mode 100644 .changeset/fresh-parents-invent.md diff --git a/.changeset/fresh-parents-invent.md b/.changeset/fresh-parents-invent.md new file mode 100644 index 00000000000..76b58b69349 --- /dev/null +++ b/.changeset/fresh-parents-invent.md @@ -0,0 +1,5 @@ +--- +"@aws-amplify/ui-react-ai": patch +--- + +chore(ai): add graphql errors to useAIGeneration diff --git a/examples/next/pages/ui/components/ai/use-ai-generation/index.page.tsx b/examples/next/pages/ui/components/ai/use-ai-generation/index.page.tsx index 7421d29d0f0..7d5a051a429 100644 --- a/examples/next/pages/ui/components/ai/use-ai-generation/index.page.tsx +++ b/examples/next/pages/ui/components/ai/use-ai-generation/index.page.tsx @@ -6,7 +6,13 @@ import '@aws-amplify/ui-react-ai/ai-conversation-styles.css'; import outputs from './amplify_outputs.js'; import type { Schema } from '@environments/ai/gen2/amplify/data/resource'; -import { Authenticator } from '@aws-amplify/ui-react'; +import { + Button, + Flex, + Loader, + TextField, + withAuthenticator, +} from '@aws-amplify/ui-react'; import React from 'react'; const client = generateClient(); @@ -14,28 +20,30 @@ const { useAIGeneration } = createAIHooks(client); Amplify.configure(outputs); -export default function Example() { - const [{ data }, handler] = useAIGeneration('generateRecipe'); +function Example() { + const [{ data, isLoading, hasError, messages }, handler] = + useAIGeneration('generateRecipe'); + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault(); + const formData = new FormData(e.currentTarget); + const description = formData.get('description') as string; + handler({ description }); + }; return ( - - {({ user }) => { - return ( - <> -

Hello {user.username}

-
{JSON.stringify(data)}
- - - ); - }} -
+ + + + + + {isLoading ? : null} + {hasError ? ( +
+ {messages?.map(({ message }, i) =>
{message}
)} +
+ ) : null} + {data ?
{JSON.stringify(data)}
: null} +
); } + +export default withAuthenticator(Example); diff --git a/packages/react-ai/src/hooks/__tests__/createAIHooks.test.tsx b/packages/react-ai/src/hooks/__tests__/createAIHooks.test.tsx index a2aa63fd3b0..9ff19fae396 100644 --- a/packages/react-ai/src/hooks/__tests__/createAIHooks.test.tsx +++ b/packages/react-ai/src/hooks/__tests__/createAIHooks.test.tsx @@ -179,7 +179,14 @@ describe('createAIHooks', () => { }; const generateReturn = { data: expectedResult, - errors: ['this is just one error'], + errors: [ + { + errorType: '', + locations: [], + path: ['generateRecipe'], + message: 'this is just one error', + }, + ], }; generateRecipeMock.mockResolvedValueOnce(generateReturn); const { useAIGeneration } = createAIHooks(client); @@ -202,7 +209,10 @@ describe('createAIHooks', () => { const [awaitedState] = hookResult.current; expect(awaitedState.data).toStrictEqual(expectedResult); - expect(awaitedState.graphqlErrors).toHaveLength(1); + expect(awaitedState.isLoading).toBeFalsy(); + expect(awaitedState.hasError).toBeTruthy(); + expect(awaitedState.messages).toHaveLength(1); + expect(awaitedState.messages?.[0].message).toContain('error'); }); }); }); diff --git a/packages/react-ai/src/hooks/useAIGeneration.tsx b/packages/react-ai/src/hooks/useAIGeneration.tsx index c9aa4c139ef..e5c5981ce88 100644 --- a/packages/react-ai/src/hooks/useAIGeneration.tsx +++ b/packages/react-ai/src/hooks/useAIGeneration.tsx @@ -1,4 +1,5 @@ -import { DataState, useDataState } from '@aws-amplify/ui-react-core'; +import * as React from 'react'; +import { DataState } from '@aws-amplify/ui-react-core'; import { V6Client } from '@aws-amplify/api-graphql'; import { getSchema } from '../types'; @@ -9,7 +10,7 @@ export interface UseAIGenerationHookWrapper< useAIGeneration: ( routeName: U ) => [ - Awaited>, + Awaited>, (input: Schema[U]['args']) => void, ]; } @@ -20,7 +21,7 @@ export type UseAIGenerationHook< > = ( routeName: Key ) => [ - Awaited>, + Awaited>, (input: Schema[Key]['args']) => void, ]; @@ -42,10 +43,19 @@ type SingularReturnValue = { errors?: GraphQLFormattedError[]; }; -type GenerateState = DataState & { - graphqlErrors?: GraphQLFormattedError[]; +type GenerationState = Omit, 'message'> & { + messages?: GraphQLFormattedError[]; }; +// default state +const INITIAL_STATE = { + hasError: false, + isLoading: false, + messages: undefined, +}; +const LOADING_STATE = { hasError: false, isLoading: true, messages: undefined }; +const ERROR_STATE = { hasError: true, isLoading: false }; + export function createUseAIGeneration< Client extends Record<'generations' | 'conversations', Record>, Schema extends getSchema, @@ -55,29 +65,42 @@ export function createUseAIGeneration< >( routeName: Key ): [ - state: GenerateState, + state: GenerationState, handleAction: (input: Schema[Key]['args']) => void, ] => { - const handleGenerate = ( - client.generations as AIGenerationClient['generations'] - )[routeName]; + const [dataState, setDataState] = React.useState< + GenerationState + >(() => ({ + ...INITIAL_STATE, + data: undefined, + })); - const updateAIGenerationStateAction = async ( - _prev: Schema[Key]['returnType'], - input: Schema[Key]['args'] - ): Promise => { - return await handleGenerate(input); - }; + const handleGeneration = React.useCallback( + async (input: Schema[Key]['args']) => { + setDataState(({ data }) => ({ ...LOADING_STATE, data })); - const [result, handler] = useDataState( - updateAIGenerationStateAction, - undefined - ); + const result = await ( + client.generations as AIGenerationClient['generations'] + )[routeName](input); - const { data, errors } = - (result?.data as SingularReturnValue) ?? {}; + const { data, errors } = result as SingularReturnValue< + Schema[Key]['returnType'] + >; + + if (errors) { + setDataState({ + ...ERROR_STATE, + data, + messages: errors, + }); + } else { + setDataState({ ...INITIAL_STATE, data }); + } + }, + [routeName] + ); - return [{ ...result, data, graphqlErrors: errors }, handler]; + return [dataState, handleGeneration]; }; return useAIGeneration; From ac7cb271aff895e643fb5dc927030df9245b7c5b Mon Sep 17 00:00:00 2001 From: Danny Banks Date: Tue, 15 Oct 2024 12:16:06 -0700 Subject: [PATCH 03/12] chore(ai): add theming for AIConversation (#5827) --- .changeset/pretty-items-lick.md | 30 ++++ .../__snapshots__/cssvars-table.test.ts.snap | 140 ++++++++++++++++++ .../amplify_outputs.js | 2 + .../ai-conversation-theming-v2/index.page.tsx | 124 ++++++++++++++++ .../amplify_outputs.js | 2 + .../ai/ai-conversation-theming/index.page.tsx | 81 ++++++++++ .../__snapshots__/defaultTheme.test.ts.snap | 35 +++++ .../__snapshots__/overrides.test.ts.snap | 35 +++++ .../ui/src/theme/components/aiConverstion.ts | 31 ++++ packages/ui/src/theme/components/index.ts | 3 + .../AIConversation/aiConversation.scss | 134 ++++++++++++----- .../theme/tokens/components/aiConversation.ts | 120 +++++++++++++++ .../ui/src/theme/tokens/components/index.ts | 3 + 13 files changed, 702 insertions(+), 38 deletions(-) create mode 100644 .changeset/pretty-items-lick.md create mode 100644 examples/next/pages/ui/components/ai/ai-conversation-theming-v2/amplify_outputs.js create mode 100644 examples/next/pages/ui/components/ai/ai-conversation-theming-v2/index.page.tsx create mode 100644 examples/next/pages/ui/components/ai/ai-conversation-theming/amplify_outputs.js create mode 100644 examples/next/pages/ui/components/ai/ai-conversation-theming/index.page.tsx create mode 100644 packages/ui/src/theme/components/aiConverstion.ts create mode 100644 packages/ui/src/theme/tokens/components/aiConversation.ts diff --git a/.changeset/pretty-items-lick.md b/.changeset/pretty-items-lick.md new file mode 100644 index 00000000000..bfadb87ffd2 --- /dev/null +++ b/.changeset/pretty-items-lick.md @@ -0,0 +1,30 @@ +--- +"@aws-amplify/ui": patch +--- + +chore(ai): add theming for AIConversation + +```ts +const theme = createTheme({ + tokens: { + components: { + aiConversation: {} + } + } +}) +``` + +```ts +const aiConversationTheme = defineComponentTheme({ + name: 'ai-conversation', + theme(tokens) { + return { + _element: { + message: { + color: tokens.colors.font.tertiary + } + } + } + } +}); +``` diff --git a/docs/__tests__/__snapshots__/cssvars-table.test.ts.snap b/docs/__tests__/__snapshots__/cssvars-table.test.ts.snap index f96d36e9ddc..69baeff0c0f 100644 --- a/docs/__tests__/__snapshots__/cssvars-table.test.ts.snap +++ b/docs/__tests__/__snapshots__/cssvars-table.test.ts.snap @@ -606,6 +606,146 @@ exports[`CSS Variables Table 1`] = ` "variable": "--amplify-components-accordion-item-trigger-padding-inline", "value": "var(--amplify-space-small)" }, + { + "variable": "--amplify-components-ai-conversation-attachment-border-color", + "value": "var(--amplify-colors-border-secondary)" + }, + { + "variable": "--amplify-components-ai-conversation-attachment-border-radius", + "value": "var(--amplify-radii-small)" + }, + { + "variable": "--amplify-components-ai-conversation-attachment-border-width", + "value": "var(--amplify-border-widths-small)" + }, + { + "variable": "--amplify-components-ai-conversation-attachment-font-size", + "value": "var(--amplify-font-sizes-small)" + }, + { + "variable": "--amplify-components-ai-conversation-attachment-gap", + "value": "var(--amplify-space-xs)" + }, + { + "variable": "--amplify-components-ai-conversation-attachment-image-height", + "value": "var(--amplify-font-sizes-medium)" + }, + { + "variable": "--amplify-components-ai-conversation-attachment-image-width", + "value": "var(--amplify-font-sizes-medium)" + }, + { + "variable": "--amplify-components-ai-conversation-attachment-list-gap", + "value": "var(--amplify-space-xxs)" + }, + { + "variable": "--amplify-components-ai-conversation-attachment-list-padding-block-start", + "value": "var(--amplify-space-xs)" + }, + { + "variable": "--amplify-components-ai-conversation-attachment-name-color", + "value": "var(--amplify-colors-font-primary)" + }, + { + "variable": "--amplify-components-ai-conversation-attachment-name-font-size", + "value": "var(--amplify-font-sizes-small)" + }, + { + "variable": "--amplify-components-ai-conversation-attachment-name-font-weight", + "value": "var(--amplify-font-weights-normal)" + }, + { + "variable": "--amplify-components-ai-conversation-attachment-padding-block", + "value": "var(--amplify-space-xxxs)" + }, + { + "variable": "--amplify-components-ai-conversation-attachment-padding-inline", + "value": "var(--amplify-space-xs)" + }, + { + "variable": "--amplify-components-ai-conversation-attachment-remove-padding", + "value": "var(--amplify-space-xxs)" + }, + { + "variable": "--amplify-components-ai-conversation-attachment-size-color", + "value": "var(--amplify-colors-font-tertiary)" + }, + { + "variable": "--amplify-components-ai-conversation-attachment-size-font-size", + "value": "var(--amplify-font-sizes-small)" + }, + { + "variable": "--amplify-components-ai-conversation-attachment-size-font-weight", + "value": "var(--amplify-font-weights-normal)" + }, + { + "variable": "--amplify-components-ai-conversation-form-gap", + "value": "var(--amplify-space-small)" + }, + { + "variable": "--amplify-components-ai-conversation-form-padding", + "value": "var(--amplify-space-small)" + }, + { + "variable": "--amplify-components-ai-conversation-message-assistant-background-color", + "value": "var(--amplify-colors-primary-10)" + }, + { + "variable": "--amplify-components-ai-conversation-message-background-color", + "value": "var(--amplify-colors-background-secondary)" + }, + { + "variable": "--amplify-components-ai-conversation-message-body-gap", + "value": "var(--amplify-space-xs)" + }, + { + "variable": "--amplify-components-ai-conversation-message-border-radius", + "value": "var(--amplify-radii-large)" + }, + { + "variable": "--amplify-components-ai-conversation-message-gap", + "value": "var(--amplify-space-small)" + }, + { + "variable": "--amplify-components-ai-conversation-message-padding-block", + "value": "var(--amplify-space-small)" + }, + { + "variable": "--amplify-components-ai-conversation-message-padding-inline", + "value": "var(--amplify-space-small)" + }, + { + "variable": "--amplify-components-ai-conversation-message-sender-gap", + "value": "var(--amplify-space-small)" + }, + { + "variable": "--amplify-components-ai-conversation-message-sender-timestamp-color", + "value": "var(--amplify-colors-font-tertiary)" + }, + { + "variable": "--amplify-components-ai-conversation-message-sender-timestamp-font-size", + "value": "inherit" + }, + { + "variable": "--amplify-components-ai-conversation-message-sender-timestamp-font-weight", + "value": "inherit" + }, + { + "variable": "--amplify-components-ai-conversation-message-sender-username-color", + "value": "var(--amplify-colors-font-primary)" + }, + { + "variable": "--amplify-components-ai-conversation-message-sender-username-font-size", + "value": "inherit" + }, + { + "variable": "--amplify-components-ai-conversation-message-sender-username-font-weight", + "value": "var(--amplify-font-weights-bold)" + }, + { + "variable": "--amplify-components-ai-conversation-message-user-background-color", + "value": "var(--amplify-colors-background-secondary)" + }, { "variable": "--amplify-components-alert-align-items", "value": "center" diff --git a/examples/next/pages/ui/components/ai/ai-conversation-theming-v2/amplify_outputs.js b/examples/next/pages/ui/components/ai/ai-conversation-theming-v2/amplify_outputs.js new file mode 100644 index 00000000000..2f1016412fd --- /dev/null +++ b/examples/next/pages/ui/components/ai/ai-conversation-theming-v2/amplify_outputs.js @@ -0,0 +1,2 @@ +import amplifyOutputs from '@environments/ai/gen2/amplify_outputs'; +export default amplifyOutputs; diff --git a/examples/next/pages/ui/components/ai/ai-conversation-theming-v2/index.page.tsx b/examples/next/pages/ui/components/ai/ai-conversation-theming-v2/index.page.tsx new file mode 100644 index 00000000000..5ca1cb2e059 --- /dev/null +++ b/examples/next/pages/ui/components/ai/ai-conversation-theming-v2/index.page.tsx @@ -0,0 +1,124 @@ +import * as React from 'react'; + +import { Amplify } from 'aws-amplify'; +import { generateClient } from 'aws-amplify/api'; +import { + View, + createTheme, + defaultDarkModeOverride, + withAuthenticator, + ColorMode, + Button, +} from '@aws-amplify/ui-react'; +import { createAIHooks, AIConversation } from '@aws-amplify/ui-react-ai'; +import { ThemeStyle, defineComponentTheme } from '@aws-amplify/ui-react/server'; +import '@aws-amplify/ui-react/styles.css'; + +import outputs from './amplify_outputs'; +import type { Schema } from '@environments/ai/gen2/amplify/data/resource'; + +const client = generateClient({ authMode: 'userPool' }); +const { useAIConversation } = createAIHooks(client); + +Amplify.configure(outputs); + +const conversationTheme = defineComponentTheme({ + name: 'ai-conversation', + theme(tokens) { + return { + _element: { + message: { + borderRadius: tokens.radii.large, + padding: tokens.space.small, + borderWidth: tokens.borderWidths.small, + borderStyle: 'solid', + borderColor: tokens.colors.border.primary, + boxShadow: `${tokens.shadows.medium}`, + }, + message__list: { + gap: tokens.space.large, + }, + form: { + borderRadius: tokens.radii.large, + padding: tokens.space.small, + borderWidth: tokens.borderWidths.small, + borderStyle: 'solid', + borderColor: tokens.colors.border.primary, + boxShadow: `${tokens.shadows.medium}`, + }, + }, + }; + }, + overrides: [ + { + colorMode: 'dark', + theme(tokens) { + return { + _element: { + form: { + backgroundColor: tokens.colors.background.secondary, + }, + }, + }; + }, + }, + ], +}); + +const theme = createTheme({ + name: 'ai-conversation-theme', + components: [conversationTheme], + overrides: [defaultDarkModeOverride], +}); + +function Chat() { + const [ + { + data: { messages }, + isLoading, + }, + sendMessage, + ] = useAIConversation('pirateChat'); + return ( + <> + + + + ); +} + +function AIConversationThemePage() { + const [colorMode, setColorMode] = React.useState('light'); + + return ( + <> + + + + + + + ); +} + +export default withAuthenticator(AIConversationThemePage); diff --git a/examples/next/pages/ui/components/ai/ai-conversation-theming/amplify_outputs.js b/examples/next/pages/ui/components/ai/ai-conversation-theming/amplify_outputs.js new file mode 100644 index 00000000000..2f1016412fd --- /dev/null +++ b/examples/next/pages/ui/components/ai/ai-conversation-theming/amplify_outputs.js @@ -0,0 +1,2 @@ +import amplifyOutputs from '@environments/ai/gen2/amplify_outputs'; +export default amplifyOutputs; diff --git a/examples/next/pages/ui/components/ai/ai-conversation-theming/index.page.tsx b/examples/next/pages/ui/components/ai/ai-conversation-theming/index.page.tsx new file mode 100644 index 00000000000..2b26d0a4c82 --- /dev/null +++ b/examples/next/pages/ui/components/ai/ai-conversation-theming/index.page.tsx @@ -0,0 +1,81 @@ +import * as React from 'react'; +import { Amplify } from 'aws-amplify'; +import { createAIHooks, AIConversation } from '@aws-amplify/ui-react-ai'; +import { ThemeStyle } from '@aws-amplify/ui-react/server'; +import { generateClient } from 'aws-amplify/api'; +import '@aws-amplify/ui-react/styles.css'; +import outputs from './amplify_outputs'; +import type { Schema } from '@environments/ai/gen2/amplify/data/resource'; +import { + View, + createTheme, + defaultDarkModeOverride, + withAuthenticator, +} from '@aws-amplify/ui-react'; +import { ColorMode } from '@aws-amplify/ui-react'; +import { Button } from '@aws-amplify/ui-react'; + +const client = generateClient({ authMode: 'userPool' }); +const { useAIConversation } = createAIHooks(client); + +Amplify.configure(outputs); + +const theme = createTheme({ + name: 'ai-conversation-theme', + tokens: { + components: { + aiConversation: { + message: { + backgroundColor: { value: '#f5f5f5' }, + gap: '{space.small}', + }, + }, + }, + }, + overrides: [defaultDarkModeOverride], +}); + +function AIConversationThemePage() { + const [colorMode, setColorMode] = React.useState('light'); + const [ + { + data: { messages }, + isLoading, + }, + sendMessage, + ] = useAIConversation('pirateChat'); + + return ( + <> + + + + + + + + ); +} + +export default withAuthenticator(AIConversationThemePage); diff --git a/packages/ui/src/theme/__tests__/__snapshots__/defaultTheme.test.ts.snap b/packages/ui/src/theme/__tests__/__snapshots__/defaultTheme.test.ts.snap index 27b7132a0cd..4bcbd85efee 100644 --- a/packages/ui/src/theme/__tests__/__snapshots__/defaultTheme.test.ts.snap +++ b/packages/ui/src/theme/__tests__/__snapshots__/defaultTheme.test.ts.snap @@ -25,6 +25,41 @@ exports[`@aws-amplify/ui defaultTheme should match snapshot 1`] = ` --amplify-components-accordion-item-icon-color: var(--amplify-colors-font-tertiary); --amplify-components-accordion-item-icon-transition-duration: var(--amplify-time-medium); --amplify-components-accordion-item-icon-transition-timing-function: cubic-bezier(0.87, 0, 0.13, 1); +--amplify-components-ai-conversation-message-background-color: var(--amplify-colors-background-secondary); +--amplify-components-ai-conversation-message-border-radius: var(--amplify-radii-large); +--amplify-components-ai-conversation-message-gap: var(--amplify-space-small); +--amplify-components-ai-conversation-message-padding-block: var(--amplify-space-small); +--amplify-components-ai-conversation-message-padding-inline: var(--amplify-space-small); +--amplify-components-ai-conversation-message-user-background-color: var(--amplify-colors-background-secondary); +--amplify-components-ai-conversation-message-assistant-background-color: var(--amplify-colors-primary-10); +--amplify-components-ai-conversation-message-sender-gap: var(--amplify-space-small); +--amplify-components-ai-conversation-message-sender-username-color: var(--amplify-colors-font-primary); +--amplify-components-ai-conversation-message-sender-username-font-size: inherit; +--amplify-components-ai-conversation-message-sender-username-font-weight: var(--amplify-font-weights-bold); +--amplify-components-ai-conversation-message-sender-timestamp-color: var(--amplify-colors-font-tertiary); +--amplify-components-ai-conversation-message-sender-timestamp-font-size: inherit; +--amplify-components-ai-conversation-message-sender-timestamp-font-weight: inherit; +--amplify-components-ai-conversation-message-body-gap: var(--amplify-space-xs); +--amplify-components-ai-conversation-form-gap: var(--amplify-space-small); +--amplify-components-ai-conversation-form-padding: var(--amplify-space-small); +--amplify-components-ai-conversation-attachment-border-color: var(--amplify-colors-border-secondary); +--amplify-components-ai-conversation-attachment-border-width: var(--amplify-border-widths-small); +--amplify-components-ai-conversation-attachment-border-radius: var(--amplify-radii-small); +--amplify-components-ai-conversation-attachment-font-size: var(--amplify-font-sizes-small); +--amplify-components-ai-conversation-attachment-padding-block: var(--amplify-space-xxxs); +--amplify-components-ai-conversation-attachment-padding-inline: var(--amplify-space-xs); +--amplify-components-ai-conversation-attachment-gap: var(--amplify-space-xs); +--amplify-components-ai-conversation-attachment-list-padding-block-start: var(--amplify-space-xs); +--amplify-components-ai-conversation-attachment-list-gap: var(--amplify-space-xxs); +--amplify-components-ai-conversation-attachment-name-color: var(--amplify-colors-font-primary); +--amplify-components-ai-conversation-attachment-name-font-size: var(--amplify-font-sizes-small); +--amplify-components-ai-conversation-attachment-name-font-weight: var(--amplify-font-weights-normal); +--amplify-components-ai-conversation-attachment-size-color: var(--amplify-colors-font-tertiary); +--amplify-components-ai-conversation-attachment-size-font-size: var(--amplify-font-sizes-small); +--amplify-components-ai-conversation-attachment-size-font-weight: var(--amplify-font-weights-normal); +--amplify-components-ai-conversation-attachment-remove-padding: var(--amplify-space-xxs); +--amplify-components-ai-conversation-attachment-image-width: var(--amplify-font-sizes-medium); +--amplify-components-ai-conversation-attachment-image-height: var(--amplify-font-sizes-medium); --amplify-components-alert-align-items: center; --amplify-components-alert-justify-content: space-between; --amplify-components-alert-color: var(--amplify-colors-font-primary); diff --git a/packages/ui/src/theme/__tests__/__snapshots__/overrides.test.ts.snap b/packages/ui/src/theme/__tests__/__snapshots__/overrides.test.ts.snap index a4b700e4656..55d0c70ec60 100644 --- a/packages/ui/src/theme/__tests__/__snapshots__/overrides.test.ts.snap +++ b/packages/ui/src/theme/__tests__/__snapshots__/overrides.test.ts.snap @@ -25,6 +25,41 @@ exports[`@aws-amplify/ui overrides should match snapshot 1`] = ` --amplify-components-accordion-item-icon-color: var(--amplify-colors-font-tertiary); --amplify-components-accordion-item-icon-transition-duration: var(--amplify-time-medium); --amplify-components-accordion-item-icon-transition-timing-function: cubic-bezier(0.87, 0, 0.13, 1); +--amplify-components-ai-conversation-message-background-color: var(--amplify-colors-background-secondary); +--amplify-components-ai-conversation-message-border-radius: var(--amplify-radii-large); +--amplify-components-ai-conversation-message-gap: var(--amplify-space-small); +--amplify-components-ai-conversation-message-padding-block: var(--amplify-space-small); +--amplify-components-ai-conversation-message-padding-inline: var(--amplify-space-small); +--amplify-components-ai-conversation-message-user-background-color: var(--amplify-colors-background-secondary); +--amplify-components-ai-conversation-message-assistant-background-color: var(--amplify-colors-primary-10); +--amplify-components-ai-conversation-message-sender-gap: var(--amplify-space-small); +--amplify-components-ai-conversation-message-sender-username-color: var(--amplify-colors-font-primary); +--amplify-components-ai-conversation-message-sender-username-font-size: inherit; +--amplify-components-ai-conversation-message-sender-username-font-weight: var(--amplify-font-weights-bold); +--amplify-components-ai-conversation-message-sender-timestamp-color: var(--amplify-colors-font-tertiary); +--amplify-components-ai-conversation-message-sender-timestamp-font-size: inherit; +--amplify-components-ai-conversation-message-sender-timestamp-font-weight: inherit; +--amplify-components-ai-conversation-message-body-gap: var(--amplify-space-xs); +--amplify-components-ai-conversation-form-gap: var(--amplify-space-small); +--amplify-components-ai-conversation-form-padding: var(--amplify-space-small); +--amplify-components-ai-conversation-attachment-border-color: var(--amplify-colors-border-secondary); +--amplify-components-ai-conversation-attachment-border-width: var(--amplify-border-widths-small); +--amplify-components-ai-conversation-attachment-border-radius: var(--amplify-radii-small); +--amplify-components-ai-conversation-attachment-font-size: var(--amplify-font-sizes-small); +--amplify-components-ai-conversation-attachment-padding-block: var(--amplify-space-xxxs); +--amplify-components-ai-conversation-attachment-padding-inline: var(--amplify-space-xs); +--amplify-components-ai-conversation-attachment-gap: var(--amplify-space-xs); +--amplify-components-ai-conversation-attachment-list-padding-block-start: var(--amplify-space-xs); +--amplify-components-ai-conversation-attachment-list-gap: var(--amplify-space-xxs); +--amplify-components-ai-conversation-attachment-name-color: var(--amplify-colors-font-primary); +--amplify-components-ai-conversation-attachment-name-font-size: var(--amplify-font-sizes-small); +--amplify-components-ai-conversation-attachment-name-font-weight: var(--amplify-font-weights-normal); +--amplify-components-ai-conversation-attachment-size-color: var(--amplify-colors-font-tertiary); +--amplify-components-ai-conversation-attachment-size-font-size: var(--amplify-font-sizes-small); +--amplify-components-ai-conversation-attachment-size-font-weight: var(--amplify-font-weights-normal); +--amplify-components-ai-conversation-attachment-remove-padding: var(--amplify-space-xxs); +--amplify-components-ai-conversation-attachment-image-width: var(--amplify-font-sizes-medium); +--amplify-components-ai-conversation-attachment-image-height: var(--amplify-font-sizes-medium); --amplify-components-alert-align-items: center; --amplify-components-alert-justify-content: space-between; --amplify-components-alert-color: var(--amplify-colors-font-primary); diff --git a/packages/ui/src/theme/components/aiConverstion.ts b/packages/ui/src/theme/components/aiConverstion.ts new file mode 100644 index 00000000000..1bd747c910c --- /dev/null +++ b/packages/ui/src/theme/components/aiConverstion.ts @@ -0,0 +1,31 @@ +import { Modifiers, ComponentStyles, Elements } from './utils'; + +export type AIConversationTheme = + ComponentStyles & + Elements< + { + message?: ComponentStyles & + Modifiers<'user' | 'assistant' | 'bubble', Required>; + message__list?: ComponentStyles; + message__avatar?: ComponentStyles; + message__sender?: ComponentStyles; + message__sender__username?: ComponentStyles; + message__sender__timestamp?: ComponentStyles; + message__body?: ComponentStyles; + message__actions?: ComponentStyles; + + form?: ComponentStyles; + form__dropzone?: ComponentStyles; + form__attatch?: ComponentStyles; + form__send?: ComponentStyles; + form_field?: ComponentStyles; + + attachment?: ComponentStyles; + attachment__list?: ComponentStyles; + attachment__image?: ComponentStyles; + attachment__size?: ComponentStyles; + attachment__name?: ComponentStyles; + attachment__remove?: ComponentStyles; + }, + Required + >; diff --git a/packages/ui/src/theme/components/index.ts b/packages/ui/src/theme/components/index.ts index eb8c5c69d2d..01d21a02d6a 100644 --- a/packages/ui/src/theme/components/index.ts +++ b/packages/ui/src/theme/components/index.ts @@ -1,4 +1,5 @@ import { WebTokens } from '../tokens'; +import { AIConversationTheme } from './aiConverstion'; import { AccordionTheme } from './accordion'; import { AlertTheme } from './alert'; import { AutoCompleteTheme } from './autocomplete'; @@ -51,6 +52,7 @@ export type { ComponentTheme, BaseComponentTheme, BaseTheme }; export type ComponentsTheme = | BaseComponentTheme | BaseComponentTheme + | BaseComponentTheme | BaseComponentTheme | BaseComponentTheme | BaseComponentTheme @@ -100,6 +102,7 @@ export type ComponentsTheme = // if the name extends from a known name, like 'alert' this should return the specific shape export type AllComponentThemes = { accordion: AccordionTheme; + 'ai-conversation': AIConversationTheme; alert: AlertTheme; autocomplete: AutoCompleteTheme; avatar: AvatarTheme; diff --git a/packages/ui/src/theme/css/component/AIConversation/aiConversation.scss b/packages/ui/src/theme/css/component/AIConversation/aiConversation.scss index ee24a98256d..b2db174cc9c 100644 --- a/packages/ui/src/theme/css/component/AIConversation/aiConversation.scss +++ b/packages/ui/src/theme/css/component/AIConversation/aiConversation.scss @@ -2,17 +2,27 @@ display: flex; flex-direction: column; height: 100%; + flex: 1; &__suggestion { } &__message { - --content-bg: transparent; + // internal CSS vars to handle combination of variation and sender (user, ai) + --internal-content-bg: ; + --internal-flex-direction: ; + --internal-content-padding: ; + --internal-body-align-items: ; display: flex; - flex-direction: var(--flex-direction); - gap: var(--amplify-space-small); - padding: var(--amplify-space-small); + flex-direction: var(--internal-flex-direction); + gap: var(--amplify-components-ai-conversation-message-gap); + padding-inline: var( + --amplify-components-ai-conversation-message-padding-inline + ); + padding-block: var( + --amplify-components-ai-conversation-message-padding-block + ); &__list { display: flex; @@ -25,32 +35,47 @@ &__sender { display: flex; - flex-direction: var(--flex-direction); + flex-direction: var(--internal-flex-direction); align-items: center; - height: var(--amplify-components-avatar-height); - gap: var(--amplify-space-small); + min-height: var(--amplify-components-avatar-height); + gap: var(--amplify-components-ai-conversation-message-sender-gap); &__username { - font-weight: bold; + color: var( + --amplify-components-ai-conversation-message-sender-username-color + ); + font-size: var( + --amplify-components-ai-conversation-message-sender-username-font-size + ); + font-weight: var( + --amplify-components-ai-conversation-message-sender-username-font-weight + ); } &__timestamp { - color: var(--amplify-colors-font-tertiary); - font-size: var(--amplify-font-sizes-small); + color: var( + --amplify-components-ai-conversation-message-sender-timestamp-color + ); + font-size: var( + --amplify-components-ai-conversation-message-sender-timestamp-font-size + ); + font-weight: var( + --amplify-components-ai-conversation-message-sender-timestamp-font-weight + ); } } &__body { display: flex; flex-direction: column; - align-items: var(--body-align-items); - gap: var(--amplify-space-xs); + align-items: var(--internal-body-align-items); + gap: var(--amplify-components-ai-conversation-message-body-gap); } &__content { - background-color: var(--content-bg); + background-color: var(--internal-content-bg); border-radius: var(--amplify-radii-medium); - padding: var(--content-padding); + padding: var(--internal-content-padding); } &__actions { @@ -59,23 +84,28 @@ } &--bubble { - --content-bg: var(--bg-color); - --content-padding: var(--amplify-space-xxs) var(--amplify-space-xs); - --flex-direction: row-reverse; - --body-align-items: flex-end; + --internal-content-bg: var(--internal-bg-color); + --internal-content-padding: var(--amplify-space-xxs) + var(--amplify-space-xs); + --internal-flex-direction: row-reverse; + --internal-body-align-items: flex-end; } &--filled { } &--user { - --bg-color: var(--amplify-colors-background-secondary); + --internal-bg-color: var( + --amplify-components-ai-conversation-message-user-background-color + ); } &--assistant { - --bg-color: var(--amplify-colors-primary-10); - --flex-direction: row; - --body-align-items: flex-start; + --internal-bg-color: var( + --amplify-components-ai-conversation-message-assistant-background-color + ); + --internal-flex-direction: row; + --internal-body-align-items: flex-start; } } @@ -83,12 +113,13 @@ display: flex; flex-direction: row; align-items: flex-start; - gap: var(--amplify-space-small); + gap: var(--amplify-components-ai-conversation-form-gap); + padding: var(--amplify-components-ai-conversation-form-padding); &__dropzone { text-align: initial; border: none; - padding: var(--amplify-space-xs); + padding: 0; } &__attach { @@ -102,39 +133,66 @@ &__attachment { display: flex; flex-direction: row; - padding-block: var(--amplify-space-xxxs); - padding-inline: var(--amplify-space-xs); - border-width: var(--amplify-border-widths-small); - border-style: solid; - border-color: var(--amplify-colors-border-secondary); - border-radius: var(--amplify-radii-small); align-items: center; - gap: var(--amplify-space-xs); - font-size: var(--amplify-font-sizes-small); + padding-block: var( + --amplify-components-ai-conversation-attachment-padding-block + ); + padding-inline: var( + --amplify-components-ai-conversation-attachment-padding-inline + ); + border-width: var( + --amplify-components-ai-conversation-attachment-border-width + ); + border-style: solid; + border-color: var( + --amplify-components-ai-conversation-attachment-border-color + ); + border-radius: var( + --amplify-components-ai-conversation-attachment-border-radius + ); + gap: var(--amplify-components-ai-conversation-attachment-gap); + font-size: var(--amplify-components-ai-conversation-attachment-font-size); &__list { display: flex; flex-direction: row; flex-wrap: wrap; - gap: var(--amplify-space-small); - padding-block-start: var(--amplify-space-small); + gap: var(--amplify-components-ai-conversation-attachment-list-gap); + padding-block-start: var( + --amplify-components-ai-conversation-attachment-padding-block-start + ); } &__image { - width: 1rem; - height: 1rem; + width: var(--amplify-components-ai-conversation-attachment-image-width); + height: var(--amplify-components-ai-conversation-attachment-image-height); object-fit: cover; } &__name { + color: var(--amplify-components-ai-conversation-attachment-name-color); + font-size: var( + --amplify-components-ai-conversation-attachment-name-font-size + ); + font-weight: var( + --amplify-components-ai-conversation-attachment-name-font-weight + ); } &__size { - color: var(--amplify-colors-font-tertiary); + color: var(--amplify-components-ai-conversation-attachment-size-color); + font-size: var( + --amplify-components-ai-conversation-attachment-size-font-size + ); + font-weight: var( + --amplify-components-ai-conversation-attachment-size-font-weight + ); } &__remove { - padding: var(--amplify-space-xxs); + padding: var( + --amplify-components-ai-conversation-attachment-remove-padding + ); } } diff --git a/packages/ui/src/theme/tokens/components/aiConversation.ts b/packages/ui/src/theme/tokens/components/aiConversation.ts new file mode 100644 index 00000000000..52c0ae4513b --- /dev/null +++ b/packages/ui/src/theme/tokens/components/aiConversation.ts @@ -0,0 +1,120 @@ +import { DesignTokenProperties, OutputVariantKey } from '../types/designToken'; + +export interface AIConversationTokens { + message?: DesignTokenProperties< + | 'backgroundColor' + | 'borderRadius' + | 'paddingBlock' + | 'paddingInline' + | 'gap', + OutputType + > & { + sender?: DesignTokenProperties<'gap', OutputType> & { + username?: DesignTokenProperties< + 'color' | 'fontSize' | 'fontWeight', + OutputType + >; + timestamp?: DesignTokenProperties< + 'color' | 'fontSize' | 'fontWeight', + OutputType + >; + }; + body?: DesignTokenProperties<'gap', OutputType>; + user?: DesignTokenProperties<'backgroundColor', OutputType>; + assistant?: DesignTokenProperties<'backgroundColor', OutputType>; + }; + form?: DesignTokenProperties<'gap' | 'padding', OutputType>; + attachment?: DesignTokenProperties< + | 'borderColor' + | 'borderWidth' + | 'borderRadius' + | 'fontSize' + | 'paddingBlock' + | 'paddingInline' + | 'gap', + OutputType + > & { + list?: DesignTokenProperties<'paddingBlockStart' | 'gap', OutputType>; + image?: DesignTokenProperties<'width' | 'height', OutputType>; + size?: DesignTokenProperties< + 'color' | 'fontSize' | 'fontWeight', + OutputType + >; + name?: DesignTokenProperties< + 'color' | 'fontSize' | 'fontWeight', + OutputType + >; + remove?: DesignTokenProperties<'padding', OutputType>; + }; +} + +export const aiConversation: Required> = { + message: { + backgroundColor: { value: '{colors.background.secondary.value}' }, + borderRadius: { value: '{radii.large.value}' }, + gap: { value: '{space.small.value}' }, + paddingBlock: { value: '{space.small.value}' }, + paddingInline: { value: '{space.small.value}' }, + user: { + backgroundColor: { value: '{colors.background.secondary.value}' }, + }, + assistant: { + backgroundColor: { value: '{colors.primary.10.value}' }, + }, + sender: { + gap: { value: '{space.small.value}' }, + username: { + color: { value: '{colors.font.primary.value}' }, + fontSize: { value: 'inherit' }, + fontWeight: { value: '{fontWeights.bold.value}' }, + }, + timestamp: { + color: { value: '{colors.font.tertiary.value}' }, + fontSize: { value: 'inherit' }, + fontWeight: { value: 'inherit' }, + }, + }, + body: { gap: { value: '{space.xs.value}' } }, + }, + + form: { + gap: { value: '{space.small.value}' }, + padding: { value: '{space.small.value}' }, + }, + + attachment: { + borderColor: { value: '{colors.border.secondary.value}' }, + borderWidth: { value: '{borderWidths.small.value}' }, + borderRadius: { value: '{radii.small.value}' }, + fontSize: { value: '{fontSizes.small.value}' }, + paddingBlock: { value: '{space.xxxs.value}' }, + paddingInline: { value: '{space.xs.value}' }, + gap: { value: '{space.xs.value}' }, + + list: { + paddingBlockStart: { value: '{space.xs.value}' }, + gap: { value: '{space.xxs.value}' }, + }, + + name: { + color: { value: '{colors.font.primary.value}' }, + fontSize: { value: '{fontSizes.small.value}' }, + fontWeight: { value: '{fontWeights.normal.value}' }, + }, + + size: { + color: { value: '{colors.font.tertiary.value}' }, + fontSize: { value: '{fontSizes.small.value}' }, + fontWeight: { value: '{fontWeights.normal.value}' }, + }, + + remove: { + padding: { value: '{space.xxs.value}' }, + }, + + image: { + width: { value: '{fontSizes.medium.value}' }, + height: { value: '{fontSizes.medium.value}' }, + }, + }, +}; diff --git a/packages/ui/src/theme/tokens/components/index.ts b/packages/ui/src/theme/tokens/components/index.ts index 650cda3042d..4c10dd92866 100644 --- a/packages/ui/src/theme/tokens/components/index.ts +++ b/packages/ui/src/theme/tokens/components/index.ts @@ -1,4 +1,5 @@ import { AlertTokens, alert } from './alert'; +import { AIConversationTokens, aiConversation } from './aiConversation'; import { AutocompleteTokens, autocomplete } from './autocomplete'; import { AuthenticatorTokens, authenticator } from './authenticator'; import { AvatarTokens, avatar } from './avatar'; @@ -61,6 +62,7 @@ import { OutputVariantKey } from '../types/designToken'; type BaseComponentTokens = { accordion?: AccordionTokens; + aiConversation?: AIConversationTokens; alert?: AlertTokens; authenticator?: AuthenticatorTokens; autocomplete?: AutocompleteTokens; @@ -131,6 +133,7 @@ export type WebComponentTokens = Required<{ export const components: DefaultComponentTokens = { accordion, + aiConversation, alert, authenticator, autocomplete, From d52a6f349f8789df3bbe57d6375eee3beb894fbf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:54:46 -0400 Subject: [PATCH 04/12] Version Packages (#5884) Co-authored-by: github-actions[bot] --- .changeset/dirty-cups-chew.md | 5 --- .changeset/fresh-parents-invent.md | 5 --- .changeset/metal-pumas-repeat.md | 5 --- .changeset/pretty-items-lick.md | 30 ------------------ docs/package.json | 2 +- examples/angular/package.json | 2 +- examples/next/package.json | 12 +++---- examples/vue/package.json | 2 +- .../angular/projects/ui-angular/CHANGELOG.md | 7 +++++ .../angular/projects/ui-angular/package.json | 4 +-- .../projects/ui-angular/src/version.ts | 2 +- packages/e2e/package.json | 2 +- packages/react-ai/CHANGELOG.md | 15 +++++++++ packages/react-ai/package.json | 8 ++--- packages/react-auth/CHANGELOG.md | 10 ++++++ packages/react-auth/package.json | 10 +++--- packages/react-auth/src/version.ts | 2 +- packages/react-core-auth/CHANGELOG.md | 8 +++++ packages/react-core-auth/package.json | 6 ++-- .../react-core-notifications/CHANGELOG.md | 8 +++++ .../react-core-notifications/package.json | 6 ++-- packages/react-core/CHANGELOG.md | 7 +++++ packages/react-core/package.json | 4 +-- packages/react-geo/CHANGELOG.md | 7 +++++ packages/react-geo/package.json | 4 +-- packages/react-geo/src/version.ts | 2 +- packages/react-liveness/CHANGELOG.md | 8 +++++ packages/react-liveness/package.json | 6 ++-- packages/react-liveness/src/version.ts | 2 +- packages/react-native-auth/CHANGELOG.md | 9 ++++++ packages/react-native-auth/package.json | 8 ++--- packages/react-native-auth/src/version.ts | 2 +- packages/react-native/CHANGELOG.md | 9 ++++++ packages/react-native/package.json | 8 ++--- packages/react-native/src/version.ts | 2 +- packages/react-notifications/CHANGELOG.md | 10 ++++++ packages/react-notifications/package.json | 10 +++--- packages/react-notifications/src/version.ts | 2 +- packages/react-storage/CHANGELOG.md | 9 ++++++ packages/react-storage/package.json | 8 ++--- packages/react-storage/src/version.ts | 2 +- packages/react/CHANGELOG.md | 8 +++++ packages/react/package.json | 6 ++-- packages/react/src/version.ts | 2 +- packages/ui/CHANGELOG.md | 31 +++++++++++++++++++ packages/ui/package.json | 2 +- packages/vue/CHANGELOG.md | 7 +++++ packages/vue/package.json | 4 +-- packages/vue/src/version.ts | 2 +- 49 files changed, 220 insertions(+), 112 deletions(-) delete mode 100644 .changeset/dirty-cups-chew.md delete mode 100644 .changeset/fresh-parents-invent.md delete mode 100644 .changeset/metal-pumas-repeat.md delete mode 100644 .changeset/pretty-items-lick.md diff --git a/.changeset/dirty-cups-chew.md b/.changeset/dirty-cups-chew.md deleted file mode 100644 index d3216a309f8..00000000000 --- a/.changeset/dirty-cups-chew.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@aws-amplify/ui-react-ai": patch ---- - -fix(ai): update useAIGeneration to manage its own date state diff --git a/.changeset/fresh-parents-invent.md b/.changeset/fresh-parents-invent.md deleted file mode 100644 index 76b58b69349..00000000000 --- a/.changeset/fresh-parents-invent.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@aws-amplify/ui-react-ai": patch ---- - -chore(ai): add graphql errors to useAIGeneration diff --git a/.changeset/metal-pumas-repeat.md b/.changeset/metal-pumas-repeat.md deleted file mode 100644 index 56c8c25a037..00000000000 --- a/.changeset/metal-pumas-repeat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@aws-amplify/ui-react-ai": patch ---- - -fix(ai): no more unnecessary re-renders in AIConversation diff --git a/.changeset/pretty-items-lick.md b/.changeset/pretty-items-lick.md deleted file mode 100644 index bfadb87ffd2..00000000000 --- a/.changeset/pretty-items-lick.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -"@aws-amplify/ui": patch ---- - -chore(ai): add theming for AIConversation - -```ts -const theme = createTheme({ - tokens: { - components: { - aiConversation: {} - } - } -}) -``` - -```ts -const aiConversationTheme = defineComponentTheme({ - name: 'ai-conversation', - theme(tokens) { - return { - _element: { - message: { - color: tokens.colors.font.tertiary - } - } - } - } -}); -``` diff --git a/docs/package.json b/docs/package.json index ee3ba4c235f..aaa4d0762e5 100644 --- a/docs/package.json +++ b/docs/package.json @@ -23,7 +23,7 @@ "test:links": "node --require esbuild-register ./scripts/link-checker-puppeteer.ts" }, "dependencies": { - "@aws-amplify/ui-react": "6.5.3", + "@aws-amplify/ui-react": "6.5.4", "@docsearch/react": "3", "@mdx-js/loader": "^2.1.0", "@mdx-js/mdx": "^2.1.0", diff --git a/examples/angular/package.json b/examples/angular/package.json index 7ee4374f668..ab68eaa55d2 100644 --- a/examples/angular/package.json +++ b/examples/angular/package.json @@ -20,7 +20,7 @@ "@angular/platform-browser": "^14.3.0", "@angular/platform-browser-dynamic": "^14.3.0", "@angular/router": "^14.3.0", - "@aws-amplify/ui-angular": "^5.0.28", + "@aws-amplify/ui-angular": "^5.0.29", "rxjs": "~6.6.0", "tslib": "^2.0.0", "zone.js": "~0.11.4" diff --git a/examples/next/package.json b/examples/next/package.json index 3fc7d7f811b..e99850caa96 100644 --- a/examples/next/package.json +++ b/examples/next/package.json @@ -10,12 +10,12 @@ "lint": "next lint" }, "dependencies": { - "@aws-amplify/ui-react": "^6.5.3", - "@aws-amplify/ui-react-ai": "0.3.1", - "@aws-amplify/ui-react-geo": "^2.0.28", - "@aws-amplify/ui-react-liveness": "^3.1.13", - "@aws-amplify/ui-react-notifications": "^2.0.32", - "@aws-amplify/ui-react-storage": "^3.3.7", + "@aws-amplify/ui-react": "^6.5.4", + "@aws-amplify/ui-react-ai": "0.3.2", + "@aws-amplify/ui-react-geo": "^2.0.29", + "@aws-amplify/ui-react-liveness": "^3.1.14", + "@aws-amplify/ui-react-notifications": "^2.0.33", + "@aws-amplify/ui-react-storage": "^3.3.8", "@aws-sdk/credential-providers": "^3.370.0", "next": "^14.2.10", "next-global-css": "^1.1.1", diff --git a/examples/vue/package.json b/examples/vue/package.json index 0b11b000729..2811268b38b 100644 --- a/examples/vue/package.json +++ b/examples/vue/package.json @@ -11,7 +11,7 @@ "start": "vite preview --port 3000" }, "dependencies": { - "@aws-amplify/ui-vue": "^4.2.20", + "@aws-amplify/ui-vue": "^4.2.21", "vue": "^3.0.5", "vue-router": "4" }, diff --git a/packages/angular/projects/ui-angular/CHANGELOG.md b/packages/angular/projects/ui-angular/CHANGELOG.md index a79bed01afd..3d146ce9ed9 100644 --- a/packages/angular/projects/ui-angular/CHANGELOG.md +++ b/packages/angular/projects/ui-angular/CHANGELOG.md @@ -1,5 +1,12 @@ # @aws-amplify/ui-angular +## 5.0.29 + +### Patch Changes + +- Updated dependencies [[`ac7cb271a`](https://github.com/aws-amplify/amplify-ui/commit/ac7cb271aff895e643fb5dc927030df9245b7c5b)]: + - @aws-amplify/ui@6.6.4 + ## 5.0.28 ### Patch Changes diff --git a/packages/angular/projects/ui-angular/package.json b/packages/angular/projects/ui-angular/package.json index a5f49d2970f..5ed5eaec8d1 100644 --- a/packages/angular/projects/ui-angular/package.json +++ b/packages/angular/projects/ui-angular/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-angular", - "version": "5.0.28", + "version": "5.0.29", "scripts": { "build": "yarn --cwd ../../ build", "dev": "yarn --cwd ../../ dev", @@ -20,7 +20,7 @@ "rxjs": "^6.5.3 || ^7.4.0" }, "dependencies": { - "@aws-amplify/ui": "6.6.3", + "@aws-amplify/ui": "6.6.4", "nanoid": "3.1.31", "qrcode": "1.5.0", "tslib": "^2.5.2", diff --git a/packages/angular/projects/ui-angular/src/version.ts b/packages/angular/projects/ui-angular/src/version.ts index 8647993f042..7e7f682925c 100644 --- a/packages/angular/projects/ui-angular/src/version.ts +++ b/packages/angular/projects/ui-angular/src/version.ts @@ -1 +1 @@ -export const VERSION = '5.0.28'; +export const VERSION = '5.0.29'; diff --git a/packages/e2e/package.json b/packages/e2e/package.json index 7fc433b191b..ba8353e27d0 100644 --- a/packages/e2e/package.json +++ b/packages/e2e/package.json @@ -29,7 +29,7 @@ ] }, "devDependencies": { - "@aws-amplify/ui": "^6.6.3", + "@aws-amplify/ui": "^6.6.4", "@badeball/cypress-cucumber-preprocessor": "^18.0.6", "@bahmutov/cypress-esbuild-preprocessor": "~2.2.0", "@cucumber/cucumber": "^10.0.1", diff --git a/packages/react-ai/CHANGELOG.md b/packages/react-ai/CHANGELOG.md index 8e221c89a18..eaaa2628dfa 100644 --- a/packages/react-ai/CHANGELOG.md +++ b/packages/react-ai/CHANGELOG.md @@ -1,5 +1,20 @@ # @aws-amplify/ui-react-ai +## 0.3.2 + +### Patch Changes + +- [#5816](https://github.com/aws-amplify/amplify-ui/pull/5816) [`5af986fff`](https://github.com/aws-amplify/amplify-ui/commit/5af986fff369b76de8cb624393960d0335bfc2fc) Thanks [@thaddmt](https://github.com/thaddmt)! - fix(ai): update useAIGeneration to manage its own date state + +- [#5900](https://github.com/aws-amplify/amplify-ui/pull/5900) [`1421ddef4`](https://github.com/aws-amplify/amplify-ui/commit/1421ddef49215f232a580d464d13920b9213b698) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - chore(ai): add graphql errors to useAIGeneration + +- [#5883](https://github.com/aws-amplify/amplify-ui/pull/5883) [`77ac8b92c`](https://github.com/aws-amplify/amplify-ui/commit/77ac8b92cb601bfc034173ef39e1e0091b674566) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - fix(ai): no more unnecessary re-renders in AIConversation + +- Updated dependencies [[`ac7cb271a`](https://github.com/aws-amplify/amplify-ui/commit/ac7cb271aff895e643fb5dc927030df9245b7c5b)]: + - @aws-amplify/ui@6.6.4 + - @aws-amplify/ui-react@6.5.4 + - @aws-amplify/ui-react-core@3.0.28 + ## 0.3.1 ### Patch Changes diff --git a/packages/react-ai/package.json b/packages/react-ai/package.json index 3c4b8bab03d..60e96280d83 100644 --- a/packages/react-ai/package.json +++ b/packages/react-ai/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-ai", - "version": "0.3.1", + "version": "0.3.2", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -48,9 +48,9 @@ "react-dom": "^16.14.0 || ^17.0 || ^18.0" }, "dependencies": { - "@aws-amplify/ui": "^6.6.3", - "@aws-amplify/ui-react": "^6.5.3", - "@aws-amplify/ui-react-core": "^3.0.27" + "@aws-amplify/ui": "^6.6.4", + "@aws-amplify/ui-react": "^6.5.4", + "@aws-amplify/ui-react-core": "^3.0.28" }, "devDependencies": { "@types/jest-when": "^3.5.0", diff --git a/packages/react-auth/CHANGELOG.md b/packages/react-auth/CHANGELOG.md index 0077a330040..b28dd65ab82 100644 --- a/packages/react-auth/CHANGELOG.md +++ b/packages/react-auth/CHANGELOG.md @@ -1,5 +1,15 @@ # @aws-amplify/ui-react-auth +## 0.0.35 + +### Patch Changes + +- Updated dependencies [[`ac7cb271a`](https://github.com/aws-amplify/amplify-ui/commit/ac7cb271aff895e643fb5dc927030df9245b7c5b)]: + - @aws-amplify/ui@6.6.4 + - @aws-amplify/ui-react@6.5.4 + - @aws-amplify/ui-react-core@3.0.28 + - @aws-amplify/ui-react-core-auth@0.0.30 + ## 0.0.34 ### Patch Changes diff --git a/packages/react-auth/package.json b/packages/react-auth/package.json index a2c60ddbc90..b21dd3fe055 100644 --- a/packages/react-auth/package.json +++ b/packages/react-auth/package.json @@ -1,7 +1,7 @@ { "name": "@aws-amplify/ui-react-auth", "private": true, - "version": "0.0.34", + "version": "0.0.35", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -40,10 +40,10 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "6.6.3", - "@aws-amplify/ui-react": "6.5.3", - "@aws-amplify/ui-react-core": "3.0.27", - "@aws-amplify/ui-react-core-auth": "0.0.29", + "@aws-amplify/ui": "6.6.4", + "@aws-amplify/ui-react": "6.5.4", + "@aws-amplify/ui-react-core": "3.0.28", + "@aws-amplify/ui-react-core-auth": "0.0.30", "@xstate/react": "3.2.2", "lodash": "4.17.21", "tslib": "^2.5.2" diff --git a/packages/react-auth/src/version.ts b/packages/react-auth/src/version.ts index 74430b563e8..2af0b90cd6c 100644 --- a/packages/react-auth/src/version.ts +++ b/packages/react-auth/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.0.34'; +export const VERSION = '0.0.35'; diff --git a/packages/react-core-auth/CHANGELOG.md b/packages/react-core-auth/CHANGELOG.md index b039ddce8ab..0d4fd323b59 100644 --- a/packages/react-core-auth/CHANGELOG.md +++ b/packages/react-core-auth/CHANGELOG.md @@ -1,5 +1,13 @@ # @aws-amplify/ui-react-core-auth +## 0.0.30 + +### Patch Changes + +- Updated dependencies [[`ac7cb271a`](https://github.com/aws-amplify/amplify-ui/commit/ac7cb271aff895e643fb5dc927030df9245b7c5b)]: + - @aws-amplify/ui@6.6.4 + - @aws-amplify/ui-react-core@3.0.28 + ## 0.0.29 ### Patch Changes diff --git a/packages/react-core-auth/package.json b/packages/react-core-auth/package.json index f6af9333b36..f952bfbf1db 100644 --- a/packages/react-core-auth/package.json +++ b/packages/react-core-auth/package.json @@ -1,7 +1,7 @@ { "name": "@aws-amplify/ui-react-core-auth", "private": true, - "version": "0.0.29", + "version": "0.0.30", "main": "dist/index.js", "module": "dist/esm/index.mjs", "react-native": "src/index.ts", @@ -33,8 +33,8 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "6.6.3", - "@aws-amplify/ui-react-core": "3.0.27", + "@aws-amplify/ui": "6.6.4", + "@aws-amplify/ui-react-core": "3.0.28", "@xstate/react": "3.2.2", "lodash": "4.17.21", "qrcode": "1.5.0", diff --git a/packages/react-core-notifications/CHANGELOG.md b/packages/react-core-notifications/CHANGELOG.md index 2637bdf4461..1ccce03a13f 100644 --- a/packages/react-core-notifications/CHANGELOG.md +++ b/packages/react-core-notifications/CHANGELOG.md @@ -1,5 +1,13 @@ # @aws-amplify/ui-react-core-notifications +## 2.0.28 + +### Patch Changes + +- Updated dependencies [[`ac7cb271a`](https://github.com/aws-amplify/amplify-ui/commit/ac7cb271aff895e643fb5dc927030df9245b7c5b)]: + - @aws-amplify/ui@6.6.4 + - @aws-amplify/ui-react-core@3.0.28 + ## 2.0.27 ### Patch Changes diff --git a/packages/react-core-notifications/package.json b/packages/react-core-notifications/package.json index c53e8d2007c..91526ecb4cc 100644 --- a/packages/react-core-notifications/package.json +++ b/packages/react-core-notifications/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-core-notifications", - "version": "2.0.27", + "version": "2.0.28", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -35,8 +35,8 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "6.6.3", - "@aws-amplify/ui-react-core": "3.0.27" + "@aws-amplify/ui": "6.6.4", + "@aws-amplify/ui-react-core": "3.0.28" }, "peerDependencies": { "aws-amplify": "^6.6.0", diff --git a/packages/react-core/CHANGELOG.md b/packages/react-core/CHANGELOG.md index d2b60a8c198..5f1106c591a 100644 --- a/packages/react-core/CHANGELOG.md +++ b/packages/react-core/CHANGELOG.md @@ -1,5 +1,12 @@ # @aws-amplify/ui-react-core +## 3.0.28 + +### Patch Changes + +- Updated dependencies [[`ac7cb271a`](https://github.com/aws-amplify/amplify-ui/commit/ac7cb271aff895e643fb5dc927030df9245b7c5b)]: + - @aws-amplify/ui@6.6.4 + ## 3.0.27 ### Patch Changes diff --git a/packages/react-core/package.json b/packages/react-core/package.json index 01d5a162591..6418a01ff8b 100644 --- a/packages/react-core/package.json +++ b/packages/react-core/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-core", - "version": "3.0.27", + "version": "3.0.28", "main": "dist/index.js", "module": "dist/esm/index.mjs", "react-native": "src/index.ts", @@ -40,7 +40,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "6.6.3", + "@aws-amplify/ui": "6.6.4", "@xstate/react": "^3.2.2", "lodash": "4.17.21", "react-hook-form": "^7.43.5", diff --git a/packages/react-geo/CHANGELOG.md b/packages/react-geo/CHANGELOG.md index d85d962daec..9e337efbfcf 100644 --- a/packages/react-geo/CHANGELOG.md +++ b/packages/react-geo/CHANGELOG.md @@ -1,5 +1,12 @@ # @aws-amplify/ui-react-geo +## 2.0.29 + +### Patch Changes + +- Updated dependencies []: + - @aws-amplify/ui-react-core@3.0.28 + ## 2.0.28 ### Patch Changes diff --git a/packages/react-geo/package.json b/packages/react-geo/package.json index 8d1b1370402..007e7c72a08 100644 --- a/packages/react-geo/package.json +++ b/packages/react-geo/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-geo", - "version": "2.0.28", + "version": "2.0.29", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -39,7 +39,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui-react-core": "3.0.27", + "@aws-amplify/ui-react-core": "3.0.28", "mapbox-gl": "1.13.1", "maplibre-gl": "2.1.9", "maplibre-gl-js-amplify": "^4.0.1", diff --git a/packages/react-geo/src/version.ts b/packages/react-geo/src/version.ts index ba5104dae22..44cac1e9580 100644 --- a/packages/react-geo/src/version.ts +++ b/packages/react-geo/src/version.ts @@ -1 +1 @@ -export const VERSION = '2.0.28'; +export const VERSION = '2.0.29'; diff --git a/packages/react-liveness/CHANGELOG.md b/packages/react-liveness/CHANGELOG.md index 3a47392e616..ece40f4ea8c 100644 --- a/packages/react-liveness/CHANGELOG.md +++ b/packages/react-liveness/CHANGELOG.md @@ -1,5 +1,13 @@ # @aws-amplify/ui-react-liveness +## 3.1.14 + +### Patch Changes + +- Updated dependencies [[`ac7cb271a`](https://github.com/aws-amplify/amplify-ui/commit/ac7cb271aff895e643fb5dc927030df9245b7c5b)]: + - @aws-amplify/ui@6.6.4 + - @aws-amplify/ui-react@6.5.4 + ## 3.1.13 ### Patch Changes diff --git a/packages/react-liveness/package.json b/packages/react-liveness/package.json index b0f352844b8..bf92963ce06 100644 --- a/packages/react-liveness/package.json +++ b/packages/react-liveness/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-liveness", - "version": "3.1.13", + "version": "3.1.14", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -48,8 +48,8 @@ "react-dom": "^16.14.0 || ^17.0 || ^18.0" }, "dependencies": { - "@aws-amplify/ui": "6.6.3", - "@aws-amplify/ui-react": "6.5.3", + "@aws-amplify/ui": "6.6.4", + "@aws-amplify/ui-react": "6.5.4", "@aws-sdk/client-rekognitionstreaming": "3.621.0", "@aws-sdk/util-format-url": "3.609.0", "@smithy/eventstream-serde-browser": "^2.0.4", diff --git a/packages/react-liveness/src/version.ts b/packages/react-liveness/src/version.ts index 58b4d6d4622..edd491f67b3 100644 --- a/packages/react-liveness/src/version.ts +++ b/packages/react-liveness/src/version.ts @@ -1 +1 @@ -export const VERSION = '3.1.13'; +export const VERSION = '3.1.14'; diff --git a/packages/react-native-auth/CHANGELOG.md b/packages/react-native-auth/CHANGELOG.md index 769ea8cca97..c24f1f8e8df 100644 --- a/packages/react-native-auth/CHANGELOG.md +++ b/packages/react-native-auth/CHANGELOG.md @@ -1,5 +1,14 @@ # @aws-amplify/ui-react-native-auth +## 0.0.33 + +### Patch Changes + +- Updated dependencies [[`ac7cb271a`](https://github.com/aws-amplify/amplify-ui/commit/ac7cb271aff895e643fb5dc927030df9245b7c5b)]: + - @aws-amplify/ui@6.6.4 + - @aws-amplify/ui-react-core-auth@0.0.30 + - @aws-amplify/ui-react-native@2.2.15 + ## 0.0.32 ### Patch Changes diff --git a/packages/react-native-auth/package.json b/packages/react-native-auth/package.json index c6ae8e8ffb0..ebc4a170858 100644 --- a/packages/react-native-auth/package.json +++ b/packages/react-native-auth/package.json @@ -1,7 +1,7 @@ { "name": "@aws-amplify/ui-react-native-auth", "private": true, - "version": "0.0.32", + "version": "0.0.33", "main": "lib/index.js", "module": "dist/index.js", "react-native": "src/index.ts", @@ -28,9 +28,9 @@ "metro-react-native-babel-preset": "^0.77.0" }, "dependencies": { - "@aws-amplify/ui": "6.6.3", - "@aws-amplify/ui-react-core-auth": "0.0.29", - "@aws-amplify/ui-react-native": "2.2.14", + "@aws-amplify/ui": "6.6.4", + "@aws-amplify/ui-react-core-auth": "0.0.30", + "@aws-amplify/ui-react-native": "2.2.15", "qrcode": "1.5.0" }, "peerDependencies": { diff --git a/packages/react-native-auth/src/version.ts b/packages/react-native-auth/src/version.ts index 05f09d4cf96..1b7f4860781 100644 --- a/packages/react-native-auth/src/version.ts +++ b/packages/react-native-auth/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.0.32'; +export const VERSION = '0.0.33'; diff --git a/packages/react-native/CHANGELOG.md b/packages/react-native/CHANGELOG.md index 8070b36c1ce..d1020a6716f 100644 --- a/packages/react-native/CHANGELOG.md +++ b/packages/react-native/CHANGELOG.md @@ -1,5 +1,14 @@ # @aws-amplify/ui-react-native +## 2.2.15 + +### Patch Changes + +- Updated dependencies [[`ac7cb271a`](https://github.com/aws-amplify/amplify-ui/commit/ac7cb271aff895e643fb5dc927030df9245b7c5b)]: + - @aws-amplify/ui@6.6.4 + - @aws-amplify/ui-react-core@3.0.28 + - @aws-amplify/ui-react-core-notifications@2.0.28 + ## 2.2.14 ### Patch Changes diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 77375ca8974..ddd928879d0 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-native", - "version": "2.2.14", + "version": "2.2.15", "main": "lib/index.js", "module": "dist/index.js", "react-native": "src/index.ts", @@ -30,9 +30,9 @@ "react-native-safe-area-context": "^4.7.3" }, "dependencies": { - "@aws-amplify/ui": "6.6.3", - "@aws-amplify/ui-react-core": "3.0.27", - "@aws-amplify/ui-react-core-notifications": "2.0.27" + "@aws-amplify/ui": "6.6.4", + "@aws-amplify/ui-react-core": "3.0.28", + "@aws-amplify/ui-react-core-notifications": "2.0.28" }, "peerDependencies": { "aws-amplify": "^6.6.0", diff --git a/packages/react-native/src/version.ts b/packages/react-native/src/version.ts index cdf44e9ee86..9ce86091d7b 100644 --- a/packages/react-native/src/version.ts +++ b/packages/react-native/src/version.ts @@ -1 +1 @@ -export const VERSION = '2.2.14'; +export const VERSION = '2.2.15'; diff --git a/packages/react-notifications/CHANGELOG.md b/packages/react-notifications/CHANGELOG.md index a49ab108664..b7498a3a582 100644 --- a/packages/react-notifications/CHANGELOG.md +++ b/packages/react-notifications/CHANGELOG.md @@ -1,5 +1,15 @@ # @aws-amplify/ui-react-notifications +## 2.0.33 + +### Patch Changes + +- Updated dependencies [[`ac7cb271a`](https://github.com/aws-amplify/amplify-ui/commit/ac7cb271aff895e643fb5dc927030df9245b7c5b)]: + - @aws-amplify/ui@6.6.4 + - @aws-amplify/ui-react@6.5.4 + - @aws-amplify/ui-react-core@3.0.28 + - @aws-amplify/ui-react-core-notifications@2.0.28 + ## 2.0.32 ### Patch Changes diff --git a/packages/react-notifications/package.json b/packages/react-notifications/package.json index 5fcade4f4ce..40525f880a9 100644 --- a/packages/react-notifications/package.json +++ b/packages/react-notifications/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-notifications", - "version": "2.0.32", + "version": "2.0.33", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -39,10 +39,10 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "6.6.3", - "@aws-amplify/ui-react": "6.5.3", - "@aws-amplify/ui-react-core": "3.0.27", - "@aws-amplify/ui-react-core-notifications": "2.0.27", + "@aws-amplify/ui": "6.6.4", + "@aws-amplify/ui-react": "6.5.4", + "@aws-amplify/ui-react-core": "3.0.28", + "@aws-amplify/ui-react-core-notifications": "2.0.28", "tinycolor2": "1.4.2" }, "peerDependencies": { diff --git a/packages/react-notifications/src/version.ts b/packages/react-notifications/src/version.ts index 93a5cc9f1b3..48c07983203 100644 --- a/packages/react-notifications/src/version.ts +++ b/packages/react-notifications/src/version.ts @@ -1 +1 @@ -export const VERSION = '2.0.32'; +export const VERSION = '2.0.33'; diff --git a/packages/react-storage/CHANGELOG.md b/packages/react-storage/CHANGELOG.md index e11dec3760d..3d09dbac9a9 100644 --- a/packages/react-storage/CHANGELOG.md +++ b/packages/react-storage/CHANGELOG.md @@ -1,5 +1,14 @@ # @aws-amplify/ui-react-storage +## 3.3.8 + +### Patch Changes + +- Updated dependencies [[`ac7cb271a`](https://github.com/aws-amplify/amplify-ui/commit/ac7cb271aff895e643fb5dc927030df9245b7c5b)]: + - @aws-amplify/ui@6.6.4 + - @aws-amplify/ui-react@6.5.4 + - @aws-amplify/ui-react-core@3.0.28 + ## 3.3.7 ### Patch Changes diff --git a/packages/react-storage/package.json b/packages/react-storage/package.json index fc52e344e67..dea9c56045c 100644 --- a/packages/react-storage/package.json +++ b/packages/react-storage/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-storage", - "version": "3.3.7", + "version": "3.3.8", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -39,9 +39,9 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "6.6.3", - "@aws-amplify/ui-react": "6.5.3", - "@aws-amplify/ui-react-core": "3.0.27", + "@aws-amplify/ui": "6.6.4", + "@aws-amplify/ui-react": "6.5.4", + "@aws-amplify/ui-react-core": "3.0.28", "lodash": "4.17.21", "tslib": "^2.5.2" }, diff --git a/packages/react-storage/src/version.ts b/packages/react-storage/src/version.ts index 90f191c0995..2d1e187016d 100644 --- a/packages/react-storage/src/version.ts +++ b/packages/react-storage/src/version.ts @@ -1 +1 @@ -export const VERSION = '3.3.7'; +export const VERSION = '3.3.8'; diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index e554eb86e6c..2ed4f3cf7be 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,13 @@ # @aws-amplify/ui-react +## 6.5.4 + +### Patch Changes + +- Updated dependencies [[`ac7cb271a`](https://github.com/aws-amplify/amplify-ui/commit/ac7cb271aff895e643fb5dc927030df9245b7c5b)]: + - @aws-amplify/ui@6.6.4 + - @aws-amplify/ui-react-core@3.0.28 + ## 6.5.3 ### Patch Changes diff --git a/packages/react/package.json b/packages/react/package.json index 47337223ebf..b96d616b6fd 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react", - "version": "6.5.3", + "version": "6.5.4", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -55,8 +55,8 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "6.6.3", - "@aws-amplify/ui-react-core": "3.0.27", + "@aws-amplify/ui": "6.6.4", + "@aws-amplify/ui-react-core": "3.0.28", "@radix-ui/react-direction": "1.0.0", "@radix-ui/react-dropdown-menu": "1.0.0", "@radix-ui/react-slider": "1.0.0", diff --git a/packages/react/src/version.ts b/packages/react/src/version.ts index bf92613c23b..9c61130162b 100644 --- a/packages/react/src/version.ts +++ b/packages/react/src/version.ts @@ -1 +1 @@ -export const VERSION = '6.5.3'; +export const VERSION = '6.5.4'; diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index 05591496e81..fd8c5df2ed8 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -1,5 +1,36 @@ # @aws-amplify/ui +## 6.6.4 + +### Patch Changes + +- [#5827](https://github.com/aws-amplify/amplify-ui/pull/5827) [`ac7cb271a`](https://github.com/aws-amplify/amplify-ui/commit/ac7cb271aff895e643fb5dc927030df9245b7c5b) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - chore(ai): add theming for AIConversation + + ```ts + const theme = createTheme({ + tokens: { + components: { + aiConversation: {}, + }, + }, + }); + ``` + + ```ts + const aiConversationTheme = defineComponentTheme({ + name: 'ai-conversation', + theme(tokens) { + return { + _element: { + message: { + color: tokens.colors.font.tertiary, + }, + }, + }; + }, + }); + ``` + ## 6.6.3 ### Patch Changes diff --git a/packages/ui/package.json b/packages/ui/package.json index 407b8708c2d..4b334820ca5 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui", - "version": "6.6.3", + "version": "6.6.4", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { diff --git a/packages/vue/CHANGELOG.md b/packages/vue/CHANGELOG.md index bdae5fd9d9a..364bb770958 100644 --- a/packages/vue/CHANGELOG.md +++ b/packages/vue/CHANGELOG.md @@ -1,5 +1,12 @@ # @aws-amplify/ui-vue +## 4.2.21 + +### Patch Changes + +- Updated dependencies [[`ac7cb271a`](https://github.com/aws-amplify/amplify-ui/commit/ac7cb271aff895e643fb5dc927030df9245b7c5b)]: + - @aws-amplify/ui@6.6.4 + ## 4.2.20 ### Patch Changes diff --git a/packages/vue/package.json b/packages/vue/package.json index 4a3644e3b7d..2a1ed3f57e6 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-vue", - "version": "4.2.20", + "version": "4.2.21", "type": "module", "main": "dist/index.cjs", "module": "dist/index.js", @@ -38,7 +38,7 @@ "typecheck": "vue-tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "6.6.3", + "@aws-amplify/ui": "6.6.4", "@vueuse/core": "7.5.5", "@xstate/vue": "0.8.1", "nanoid": "3.1.31", diff --git a/packages/vue/src/version.ts b/packages/vue/src/version.ts index d2eb5212e9f..8e3573157a7 100644 --- a/packages/vue/src/version.ts +++ b/packages/vue/src/version.ts @@ -1 +1 @@ -export const VERSION = '4.2.20'; +export const VERSION = '4.2.21'; From 6fea94b890d9d497a3f13e189ea0b52e8dcdadb8 Mon Sep 17 00:00:00 2001 From: Heather Buchel Date: Thu, 17 Oct 2024 16:37:28 -0400 Subject: [PATCH 05/12] fix(Authenticator): clicking on current tab switches tabs (#5912) * fix clicking on current tab switching tabs * use newRoute for route changing * Create brown-pumpkins-knock.md --- .changeset/brown-pumpkins-knock.md | 5 +++++ docs/next-env.d.ts | 2 +- .../components/Authenticator/shared/SignInSignUpTabs.tsx | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .changeset/brown-pumpkins-knock.md diff --git a/.changeset/brown-pumpkins-knock.md b/.changeset/brown-pumpkins-knock.md new file mode 100644 index 00000000000..3cfc9e06339 --- /dev/null +++ b/.changeset/brown-pumpkins-knock.md @@ -0,0 +1,5 @@ +--- +"@aws-amplify/ui-react": patch +--- + +fix(React/Authenticator): clicking on currently active tab no longer switches to the wrong tab diff --git a/docs/next-env.d.ts b/docs/next-env.d.ts index 4f11a03dc6c..a4a7b3f5cfa 100644 --- a/docs/next-env.d.ts +++ b/docs/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information. diff --git a/packages/react/src/components/Authenticator/shared/SignInSignUpTabs.tsx b/packages/react/src/components/Authenticator/shared/SignInSignUpTabs.tsx index 5fd7bfe1a2f..fb0f01bd559 100644 --- a/packages/react/src/components/Authenticator/shared/SignInSignUpTabs.tsx +++ b/packages/react/src/components/Authenticator/shared/SignInSignUpTabs.tsx @@ -32,7 +32,11 @@ export const SignInSignUpTabs = ({ (route === 'signIn' ? toSignUp() : toSignIn())} + onValueChange={(newRoute) => { + if (newRoute !== route) { + newRoute === 'signIn' ? toSignIn() : toSignUp(); + } + }} > {getSignInTabText()} From 3655af2be54733d364e71d3c7f86f32d7bbcf811 Mon Sep 17 00:00:00 2001 From: Danny Banks Date: Thu, 17 Oct 2024 14:45:23 -0700 Subject: [PATCH 06/12] chore(ai): adding UA string for AIConversation (#5917) Co-authored-by: Jordan Van Ness --- .changeset/rich-bags-smile.md | 20 +++ package.json | 2 +- .../angular/projects/ui-angular/package.json | 2 +- packages/react-ai/package.json | 2 +- .../AIConversation/AIConversation.tsx | 7 + packages/react-ai/src/types.ts | 29 ++-- packages/react-ai/src/version.ts | 1 + packages/react-auth/package.json | 2 +- packages/react-core-auth/package.json | 2 +- .../react-core-notifications/package.json | 2 +- packages/react-core/package.json | 2 +- packages/react-geo/package.json | 2 +- packages/react-liveness/package.json | 2 +- packages/react-native-auth/package.json | 2 +- packages/react-native/package.json | 2 +- packages/react-notifications/package.json | 4 +- packages/react-storage/package.json | 2 +- packages/react/package.json | 2 +- packages/ui/package.json | 2 +- .../ui/src/utils/setUserAgent/constants.ts | 15 ++ .../ui/src/utils/setUserAgent/setUserAgent.ts | 10 ++ packages/vue/package.json | 2 +- scripts/generateVersion.js | 1 + yarn.lock | 152 +++++++++++------- 24 files changed, 184 insertions(+), 85 deletions(-) create mode 100644 .changeset/rich-bags-smile.md create mode 100644 packages/react-ai/src/version.ts diff --git a/.changeset/rich-bags-smile.md b/.changeset/rich-bags-smile.md new file mode 100644 index 00000000000..04cd2a360d2 --- /dev/null +++ b/.changeset/rich-bags-smile.md @@ -0,0 +1,20 @@ +--- +"@aws-amplify/ui-angular": patch +"@aws-amplify/ui-react-ai": patch +"@aws-amplify/ui-react-auth": patch +"@aws-amplify/ui-react-core-auth": patch +"@aws-amplify/ui-react-core-notifications": patch +"@aws-amplify/ui-react-core": patch +"@aws-amplify/ui-react-geo": patch +"@aws-amplify/ui-react-liveness": patch +"@aws-amplify/ui-react-native-auth": patch +"@aws-amplify/ui-react-native": patch +"@aws-amplify/ui-react-notifications": patch +"@aws-amplify/ui-react-storage": patch +"@aws-amplify/ui-react": patch +"@aws-amplify/ui": patch +"@aws-amplify/ui-vue": patch +"@aws-amplify/ui-angular": patch +--- + +chore(ai): adding UA string for AIConversation diff --git a/package.json b/package.json index 4d1ad50c164..267817ccbd4 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,7 @@ "@types/jest": "^29.5.5", "@types/react-test-renderer": "^18.0.2", "@vitejs/plugin-vue": "^2.3.4", - "aws-amplify": "^6.6.0", + "aws-amplify": "^6.6.5", "esbuild-register": "^3.5.0", "eslint": "^8.44.0", "fs-extra": "^11.1.1", diff --git a/packages/angular/projects/ui-angular/package.json b/packages/angular/projects/ui-angular/package.json index 5ed5eaec8d1..c0ab2fccb47 100644 --- a/packages/angular/projects/ui-angular/package.json +++ b/packages/angular/projects/ui-angular/package.json @@ -16,7 +16,7 @@ "peerDependencies": { "@angular/core": ">= 14.0.0", "@angular/common": ">= 14.0.0", - "aws-amplify": "^6.6.0", + "aws-amplify": "^6.6.5", "rxjs": "^6.5.3 || ^7.4.0" }, "dependencies": { diff --git a/packages/react-ai/package.json b/packages/react-ai/package.json index 60e96280d83..1ee47e296b6 100644 --- a/packages/react-ai/package.json +++ b/packages/react-ai/package.json @@ -43,7 +43,7 @@ }, "peerDependencies": { "@aws-amplify/api-graphql": "^4.3.0", - "aws-amplify": "^6.6.0", + "aws-amplify": "^6.6.5", "react": "^16.14.0 || ^17.0 || ^18.0", "react-dom": "^16.14.0 || ^17.0 || ^18.0" }, diff --git a/packages/react-ai/src/components/AIConversation/AIConversation.tsx b/packages/react-ai/src/components/AIConversation/AIConversation.tsx index 248814a8e9f..382d1b380b3 100644 --- a/packages/react-ai/src/components/AIConversation/AIConversation.tsx +++ b/packages/react-ai/src/components/AIConversation/AIConversation.tsx @@ -14,6 +14,8 @@ import { PromptList } from './views/default/PromptList'; import { AutoHidablePromptControl } from './views/Controls'; import { ComponentClassName } from '@aws-amplify/ui'; import { AIConversationProvider } from './AIConversationProvider'; +import { useSetUserAgent } from '@aws-amplify/ui-react-core'; +import { VERSION } from '../../version'; interface AIConversationBaseProps extends AIConversationProps, @@ -32,6 +34,11 @@ function AIConversationBase({ displayText, allowAttachments, }: AIConversationBaseProps): JSX.Element { + useSetUserAgent({ + componentName: 'AIConversation', + packageName: 'react-ai', + version: VERSION, + }); const icons = useIcons('aiConversation'); const defaultAvatars: Avatars = { ai: { diff --git a/packages/react-ai/src/types.ts b/packages/react-ai/src/types.ts index d2c96f73fd2..ec7c108ece4 100644 --- a/packages/react-ai/src/types.ts +++ b/packages/react-ai/src/types.ts @@ -4,6 +4,7 @@ export type ConversationRoute = V6Client['conversations'][string]; export type Conversation = NonNullable< Awaited>['data'] >; + export type ConversationMessage = NonNullable< Awaited>['data'] >; @@ -14,20 +15,28 @@ export type TextContent = NonNullable; export type ImageContent = NonNullable; -export type InputContent = Parameters< - Conversation['sendMessage'] ->[0]['content'][number]; +// Note: the conversation sendMessage function is an overload +// that accepts a string OR an object +export type InputContent = Exclude< + Parameters[0], + string +>['content'][number]; -export type SendMessageContent = Parameters< - Conversation['sendMessage'] ->[0]['content']; +export type SendMessageContent = Exclude< + Parameters[0], + string +>['content']; -export type SendMessageContext = Parameters< - Conversation['sendMessage'] ->[0]['aiContext']; +export type SendMessageContext = Exclude< + Parameters[0], + string +>['aiContext']; export type ToolConfiguration = NonNullable< - Parameters[0]['toolConfiguration'] + Exclude< + Parameters[0], + string + >['toolConfiguration'] >; export interface SendMesageParameters { diff --git a/packages/react-ai/src/version.ts b/packages/react-ai/src/version.ts new file mode 100644 index 00000000000..7195b1090e2 --- /dev/null +++ b/packages/react-ai/src/version.ts @@ -0,0 +1 @@ +export const VERSION = '0.3.2'; diff --git a/packages/react-auth/package.json b/packages/react-auth/package.json index b21dd3fe055..ea607c6f624 100644 --- a/packages/react-auth/package.json +++ b/packages/react-auth/package.json @@ -49,7 +49,7 @@ "tslib": "^2.5.2" }, "peerDependencies": { - "aws-amplify": "^6.6.0", + "aws-amplify": "^6.6.5", "react": "^16.14.0 || ^17.0 || ^18.0", "react-dom": "^16.14.0 || ^17.0 || ^18.0" }, diff --git a/packages/react-core-auth/package.json b/packages/react-core-auth/package.json index f952bfbf1db..822916397f7 100644 --- a/packages/react-core-auth/package.json +++ b/packages/react-core-auth/package.json @@ -42,7 +42,7 @@ }, "peerDependencies": { "@aws-amplify/core": "*", - "aws-amplify": "^6.6.0", + "aws-amplify": "^6.6.5", "react": "^16.14.0 || ^17.0 || ^18.0" }, "sideEffects": false diff --git a/packages/react-core-notifications/package.json b/packages/react-core-notifications/package.json index 91526ecb4cc..466b49305fb 100644 --- a/packages/react-core-notifications/package.json +++ b/packages/react-core-notifications/package.json @@ -39,7 +39,7 @@ "@aws-amplify/ui-react-core": "3.0.28" }, "peerDependencies": { - "aws-amplify": "^6.6.0", + "aws-amplify": "^6.6.5", "react": "^16.14.0 || ^17.0 || ^18.0" }, "sideEffects": false diff --git a/packages/react-core/package.json b/packages/react-core/package.json index 6418a01ff8b..57c6edf4a2b 100644 --- a/packages/react-core/package.json +++ b/packages/react-core/package.json @@ -47,7 +47,7 @@ "xstate": "^4.33.6" }, "peerDependencies": { - "aws-amplify": "^6.6.0", + "aws-amplify": "^6.6.5", "react": "^16.14.0 || ^17.0 || ^18.0" }, "sideEffects": false diff --git a/packages/react-geo/package.json b/packages/react-geo/package.json index 007e7c72a08..e5ac85c6f31 100644 --- a/packages/react-geo/package.json +++ b/packages/react-geo/package.json @@ -48,7 +48,7 @@ }, "peerDependencies": { "@aws-amplify/geo": "^3.0.47", - "aws-amplify": "^6.6.0", + "aws-amplify": "^6.6.5", "react": "^16.14.0 || ^17.0 || ^18.0", "react-dom": "^16.14.0 || ^17.0 || ^18.0" }, diff --git a/packages/react-liveness/package.json b/packages/react-liveness/package.json index bf92963ce06..ba7b79bed44 100644 --- a/packages/react-liveness/package.json +++ b/packages/react-liveness/package.json @@ -43,7 +43,7 @@ }, "peerDependencies": { "@aws-amplify/core": "*", - "aws-amplify": "^6.6.0", + "aws-amplify": "^6.6.5", "react": "^16.14.0 || ^17.0 || ^18.0", "react-dom": "^16.14.0 || ^17.0 || ^18.0" }, diff --git a/packages/react-native-auth/package.json b/packages/react-native-auth/package.json index ebc4a170858..99d8828de7b 100644 --- a/packages/react-native-auth/package.json +++ b/packages/react-native-auth/package.json @@ -34,7 +34,7 @@ "qrcode": "1.5.0" }, "peerDependencies": { - "aws-amplify": "^6.6.0", + "aws-amplify": "^6.6.5", "react": "^18", "react-native": "^0.70 || ^0.71 || ^0.72" }, diff --git a/packages/react-native/package.json b/packages/react-native/package.json index ddd928879d0..553d86fe0ea 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -35,7 +35,7 @@ "@aws-amplify/ui-react-core-notifications": "2.0.28" }, "peerDependencies": { - "aws-amplify": "^6.6.0", + "aws-amplify": "^6.6.5", "react": "*", "react-native": "^0.70 || ^0.71 || ^0.72 || ^0.73 || ^0.74 || ^0.75", "react-native-safe-area-context": "^4.2.5" diff --git a/packages/react-notifications/package.json b/packages/react-notifications/package.json index 40525f880a9..4ad7e465448 100644 --- a/packages/react-notifications/package.json +++ b/packages/react-notifications/package.json @@ -46,7 +46,7 @@ "tinycolor2": "1.4.2" }, "peerDependencies": { - "aws-amplify": "^6.6.0", + "aws-amplify": "^6.6.5", "react": "^16.14.0 || ^17.0 || ^18.0", "react-dom": "^16.14.0 || ^17.0 || ^18.0" }, @@ -61,7 +61,7 @@ "name": "InAppMessaging", "path": "dist/esm/index.mjs", "import": "{ InAppMessagingProvider, InAppMessageDisplay }", - "limit": "22 kB" + "limit": "23 kB" } ] } diff --git a/packages/react-storage/package.json b/packages/react-storage/package.json index dea9c56045c..3b9b9de913b 100644 --- a/packages/react-storage/package.json +++ b/packages/react-storage/package.json @@ -46,7 +46,7 @@ "tslib": "^2.5.2" }, "peerDependencies": { - "aws-amplify": "^6.6.0", + "aws-amplify": "^6.6.5", "react": "^16.14.0 || ^17.0 || ^18.0", "react-dom": "^16.14.0 || ^17.0 || ^18.0" }, diff --git a/packages/react/package.json b/packages/react/package.json index b96d616b6fd..1b2361ed5c1 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -67,7 +67,7 @@ }, "peerDependencies": { "@aws-amplify/core": "*", - "aws-amplify": "^6.6.0", + "aws-amplify": "^6.6.5", "react": "^16.14.0 || ^17.0 || ^18.0", "react-dom": "^16.14.0 || ^17.0 || ^18.0" }, diff --git a/packages/ui/package.json b/packages/ui/package.json index 4b334820ca5..d259e4d93e0 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -50,7 +50,7 @@ }, "peerDependencies": { "@aws-amplify/core": "*", - "aws-amplify": "^6.6.0", + "aws-amplify": "^6.6.5", "xstate": "^4.33.6" }, "peerDependenciesMeta": { diff --git a/packages/ui/src/utils/setUserAgent/constants.ts b/packages/ui/src/utils/setUserAgent/constants.ts index 6ca75550a3d..f95c5c20a32 100644 --- a/packages/ui/src/utils/setUserAgent/constants.ts +++ b/packages/ui/src/utils/setUserAgent/constants.ts @@ -8,8 +8,23 @@ import { InAppMessagingAction, StorageAction, Category, + AiAction, + AiUserAgentInput, } from '@aws-amplify/core/internals/utils'; +export const AI_INPUT_BASE: Omit = { + category: Category.AI, + apis: [ + AiAction.CreateConversation, + AiAction.DeleteConversation, + AiAction.ListConversations, + AiAction.UpdateConversation, + AiAction.OnMessage, + AiAction.SendMessage, + AiAction.Generation, + ], +}; + export const ACCOUNT_SETTINGS_INPUT_BASE: Omit< AuthUserAgentInput, 'additionalDetails' diff --git a/packages/ui/src/utils/setUserAgent/setUserAgent.ts b/packages/ui/src/utils/setUserAgent/setUserAgent.ts index 45e4065c134..bf002dd21db 100644 --- a/packages/ui/src/utils/setUserAgent/setUserAgent.ts +++ b/packages/ui/src/utils/setUserAgent/setUserAgent.ts @@ -2,6 +2,7 @@ import { setCustomUserAgent } from '@aws-amplify/core/internals/utils'; import { ACCOUNT_SETTINGS_INPUT_BASE, + AI_INPUT_BASE, AUTHENTICATOR_INPUT_BASE, FILE_UPLOADER_BASE_INPUT, IN_APP_MESSAGING_INPUT_BASE, @@ -15,6 +16,7 @@ import { noop } from '../utils'; export type PackageName = | 'angular' | 'react' + | 'react-ai' | 'react-auth' | 'react-geo' | 'react-liveness' @@ -25,6 +27,7 @@ export type PackageName = | 'vue'; export type ComponentName = + | 'AIConversation' | 'Authenticator' | 'ChangePassword' | 'DeleteUser' @@ -63,6 +66,13 @@ export const setUserAgent = ({ const packageData: [string, string] = [`ui-${packageName}`, version]; switch (componentName) { + case 'AIConversation': { + setCustomUserAgent({ + ...AI_INPUT_BASE, + additionalDetails: [[componentName], packageData], + }); + break; + } case 'Authenticator': { setCustomUserAgent({ ...AUTHENTICATOR_INPUT_BASE, diff --git a/packages/vue/package.json b/packages/vue/package.json index 2a1ed3f57e6..5bb6c027df0 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -66,7 +66,7 @@ }, "peerDependencies": { "@aws-amplify/core": "*", - "aws-amplify": "^6.6.0", + "aws-amplify": "^6.6.5", "vue": "^3.0" } } diff --git a/scripts/generateVersion.js b/scripts/generateVersion.js index 222585d0207..2e9d901a1a1 100644 --- a/scripts/generateVersion.js +++ b/scripts/generateVersion.js @@ -8,6 +8,7 @@ const fs = require('fs-extra'); const packages = [ 'packages/angular/projects/ui-angular', 'packages/react', + 'packages/react-ai', 'packages/react-auth', 'packages/react-geo', 'packages/react-native', diff --git a/yarn.lock b/yarn.lock index 276ffa32622..9839269129f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -482,10 +482,10 @@ "@aws-sdk/client-bedrock-runtime" "^3.622.0" "@smithy/types" "^3.3.0" -"@aws-amplify/analytics@7.0.49": - version "7.0.49" - resolved "https://registry.yarnpkg.com/@aws-amplify/analytics/-/analytics-7.0.49.tgz#03f21ebef88cc8542a56b3493d8ff4fb6709c5e2" - integrity sha512-+HLuvrbTAVhsMtMpwZuiGVULM7NqSoy6+gByi3NodZjMFvIQX6SvbZlGdDGjT5vYb8r3GSLRbgvGnf2VvfTTFA== +"@aws-amplify/analytics@7.0.52": + version "7.0.52" + resolved "https://registry.yarnpkg.com/@aws-amplify/analytics/-/analytics-7.0.52.tgz#a3c942a4762fc998baecbce5abfa48b1288904dc" + integrity sha512-Ja6nKlKkIHlkZk/Rl5auLcLRwf8yFHlL65UVXzpBrafmVSl72ygNAT4dsxRMOWse/aiEw1Y/Jqb/XpkgAweBCw== dependencies: "@aws-sdk/client-firehose" "3.621.0" "@aws-sdk/client-kinesis" "3.621.0" @@ -493,34 +493,34 @@ "@smithy/util-utf8" "2.0.0" tslib "^2.5.0" -"@aws-amplify/api-graphql@4.3.2": - version "4.3.2" - resolved "https://registry.yarnpkg.com/@aws-amplify/api-graphql/-/api-graphql-4.3.2.tgz#596cd879d0be4d84f62ccdc28ee25e8cb3f6df92" - integrity sha512-izdaQOUMD/CuTY7eHI2ngjt2i80bMynNT63HueJszkeyc+N/eEl5qAQNRHx+VaVGiyGgiz82WxcEU6gfLKnvMA== +"@aws-amplify/api-graphql@4.4.1": + version "4.4.1" + resolved "https://registry.yarnpkg.com/@aws-amplify/api-graphql/-/api-graphql-4.4.1.tgz#681018e3082676fd65313f72d3534664195ebc7c" + integrity sha512-Waec2UbCQ4OssG2/lrAiZgQuS9WUlsth0AnuPjbsUKQpw7k7Rq0OOhGJepAXnn8v1YGVmr9ilyzKevN799qFCw== dependencies: - "@aws-amplify/api-rest" "4.0.49" - "@aws-amplify/core" "6.4.2" - "@aws-amplify/data-schema" "^1.5.0" + "@aws-amplify/api-rest" "4.0.52" + "@aws-amplify/core" "6.4.5" + "@aws-amplify/data-schema" "^1.7.0" "@aws-sdk/types" "3.387.0" graphql "15.8.0" rxjs "^7.8.1" tslib "^2.5.0" uuid "^9.0.0" -"@aws-amplify/api-rest@4.0.49": - version "4.0.49" - resolved "https://registry.yarnpkg.com/@aws-amplify/api-rest/-/api-rest-4.0.49.tgz#80f9c4cc2e31b87da0f14a1cfdf1d6914f33d660" - integrity sha512-o2C/62yAvn/KvKDkvHUtMEroT6aG0YAEgjSWjkerURipHx0o5JvQVcTuKAvop7ZxnzV/RO+8qdSg/iI14kzZnw== +"@aws-amplify/api-rest@4.0.52": + version "4.0.52" + resolved "https://registry.yarnpkg.com/@aws-amplify/api-rest/-/api-rest-4.0.52.tgz#711bc9addf8cf6656b99a3e64bd3ef66ec3e50d9" + integrity sha512-A1kI7/6UqLUyOoPbPrUUjg84dPORAJzyC+xnk+o9ZKbVZVcfyHDU/XsbZgEi9NGZBMMPNgCek/m6O/FI5hd1VQ== dependencies: tslib "^2.5.0" -"@aws-amplify/api@6.0.51": - version "6.0.51" - resolved "https://registry.yarnpkg.com/@aws-amplify/api/-/api-6.0.51.tgz#c493511e65320e9da2fef45570622a3162fdfff2" - integrity sha512-p5jWW6saazLuJ+8TkXLB8O7ZGXMCuP9HArIt9o0jP+nDRBIqsRb5IQQb14DDQ8PkBfleKjKHeI69c246uTsKSA== +"@aws-amplify/api@6.0.54": + version "6.0.54" + resolved "https://registry.yarnpkg.com/@aws-amplify/api/-/api-6.0.54.tgz#0e2b4b581171fa5318a028487e05fcd9eddedaf0" + integrity sha512-aZ2rqapEtZHuHKgGhZ9F+E9VTah61PqxGEJWuJFQYhBA3Ui5dA5m98Rt49666xvQ7dJo1KkUqw9vrpPyE/mW/Q== dependencies: - "@aws-amplify/api-graphql" "4.3.2" - "@aws-amplify/api-rest" "4.0.49" + "@aws-amplify/api-graphql" "4.4.1" + "@aws-amplify/api-rest" "4.0.52" tslib "^2.5.0" "@aws-amplify/appsync-modelgen-plugin@2.13.0": @@ -549,10 +549,10 @@ "@aws-amplify/plugin-types" "^1.2.1" "@aws-sdk/util-arn-parser" "^3.568.0" -"@aws-amplify/auth@6.4.2": - version "6.4.2" - resolved "https://registry.yarnpkg.com/@aws-amplify/auth/-/auth-6.4.2.tgz#319a2f264587886e0ff0b6be63c7d8dc3f189519" - integrity sha512-Mfx5AW5RgM0qE9DuJNlFAl4yzFAN1nSxCuLvGrWpKUrcYDomy5I2zzETCxRcJvrb94qzg3aPHlooR8Lgl6t6qg== +"@aws-amplify/auth@6.5.2": + version "6.5.2" + resolved "https://registry.yarnpkg.com/@aws-amplify/auth/-/auth-6.5.2.tgz#4aa286bc18fdf99ffeb6b91b9f540e6445a5ebd9" + integrity sha512-YxLcfhWWt9AtkePPo4aRH3OeRrlIWoo5+FV8gyOkeaHBiF3fkWcWZ3YAxMz7jG+iycgQMzj0bkFFTaNAy0Ohgw== dependencies: tslib "^2.5.0" @@ -665,10 +665,10 @@ "@aws-amplify/platform-core" "^1.0.7" zod "^3.22.2" -"@aws-amplify/core@6.4.2": - version "6.4.2" - resolved "https://registry.yarnpkg.com/@aws-amplify/core/-/core-6.4.2.tgz#db258b8118ec3eff25bdfb757492008f7dbf8af2" - integrity sha512-kumvcxy8dk+L78MBjzfCrd+iVefliTvrbYskNFFbxbKCxUB7QavgALrVi31VXQxBW5YvImjAsS1qS7SY1YkYHQ== +"@aws-amplify/core@6.4.5": + version "6.4.5" + resolved "https://registry.yarnpkg.com/@aws-amplify/core/-/core-6.4.5.tgz#a40e7c5d4857d9864fc44d94a0590844fdb2ad3d" + integrity sha512-YE1CUOEoDs6gwZbTXYcrg5BSC1yfKAPM5yh4/Yy7BdIyev3WZl0RwukWk6Z/rdM1/ePKyDAbVeiGO7GOaWhJNw== dependencies: "@aws-crypto/sha256-js" "5.2.0" "@aws-sdk/types" "3.398.0" @@ -735,7 +735,7 @@ graphql "15.8.0" rxjs "^7.8.1" -"@aws-amplify/data-schema@^1.0.0", "@aws-amplify/data-schema@^1.5.0": +"@aws-amplify/data-schema@^1.0.0": version "1.6.2" resolved "https://registry.yarnpkg.com/@aws-amplify/data-schema/-/data-schema-1.6.2.tgz#6d6537b163c723b7e138aaded2d32b2f94ed9bc3" integrity sha512-GCntMHsm2VPBAdfpsRSv35K1csSVJ/sCBbOHcPwb3it3hea5Z88B13fK+B4ktpvUJSjy4n/m9/m6tK9h9Yky8Q== @@ -746,12 +746,23 @@ "@types/json-schema" "^7.0.15" rxjs "^7.8.1" -"@aws-amplify/datastore@5.0.51": - version "5.0.51" - resolved "https://registry.yarnpkg.com/@aws-amplify/datastore/-/datastore-5.0.51.tgz#2fb1acd9b0915c601f04421e7498eca8d852daad" - integrity sha512-R4XAsmrT7psWnvgc6lr8hxbJwFd6iHgsiqazOH67h9tusgmIFAp+HEgKPV/sUrkT2aIEy8Ge7so5y1Tku70zBA== +"@aws-amplify/data-schema@^1.7.0": + version "1.10.0" + resolved "https://registry.yarnpkg.com/@aws-amplify/data-schema/-/data-schema-1.10.0.tgz#016fe8e9e1f40d268d26867c1bd925d71e902a12" + integrity sha512-tp1dtpNmc5X8B9M3yg1TmkXvnMH10UicPrnfpNCVfsuCQZk7r/hNkzLaLlAyD8/f5/sXatpYl91zo7owbIuPPw== dependencies: - "@aws-amplify/api" "6.0.51" + "@aws-amplify/data-schema-types" "*" + "@smithy/util-base64" "^3.0.0" + "@types/aws-lambda" "^8.10.134" + "@types/json-schema" "^7.0.15" + rxjs "^7.8.1" + +"@aws-amplify/datastore@5.0.54": + version "5.0.54" + resolved "https://registry.yarnpkg.com/@aws-amplify/datastore/-/datastore-5.0.54.tgz#1a1569737ec9000052c0010d2c0367cb97cb17e1" + integrity sha512-WYoUMWbpQci1Ah6Ft+EyWmTzKKxB+MrtgBa8CmYsNYm7PSGcOQ/SyGDdaxxBj0YnXv8KKA46/O/ofT9SrxX9Wg== + dependencies: + "@aws-amplify/api" "6.0.54" buffer "4.9.2" idb "5.0.6" immer "9.0.6" @@ -1111,10 +1122,10 @@ "@aws-sdk/types" "^3.609.0" graphql "^15.8.0" -"@aws-amplify/notifications@2.0.49": - version "2.0.49" - resolved "https://registry.yarnpkg.com/@aws-amplify/notifications/-/notifications-2.0.49.tgz#e226dd9cb9ba54651c72d332b5446dfdfc629ddf" - integrity sha512-26+vgiCnugF3wGyVPzOFsc0BFC/nGf+70LpzsYrxLes4OaLq1cBVJgh7q6p9nT+qjsrmlVGwl0kU49OIyPx7xg== +"@aws-amplify/notifications@2.0.52": + version "2.0.52" + resolved "https://registry.yarnpkg.com/@aws-amplify/notifications/-/notifications-2.0.52.tgz#332c401d65cfafadfa95c9c5f831182bff834394" + integrity sha512-jvReh1i4e80pY+XUtahIeGZ5I1plpQgq3lgYYky4Z9lViMQKJrrNdl6Yy0AKbkv+7/3h/m/wtKF2d/PSqJtrDw== dependencies: lodash "^4.17.21" tslib "^2.5.0" @@ -1193,10 +1204,10 @@ resolved "https://registry.npmjs.org/@aws-amplify/rtn-web-browser/-/rtn-web-browser-1.0.30.tgz#664053391226c956dce25402b77263059b914e1c" integrity sha512-1n3za9kmCOMjOXh3qMGZboQm6PlefiDZED1b78cOpeyha7AzynOfJm8y8jGd71gZPODSP94FD+6aa7VNq/S/4w== -"@aws-amplify/storage@6.6.7": - version "6.6.7" - resolved "https://registry.yarnpkg.com/@aws-amplify/storage/-/storage-6.6.7.tgz#5beb4943e72f8a6a44312231c83938a432f7f6b6" - integrity sha512-iTpVvTzAGoAzXpI72SJBez3qwqXH8I1IxRKJOURXkv4z2rBeFfCHYv8z+o2DHv7YQ+ATuuQF1TvmQ1Xsat1PLw== +"@aws-amplify/storage@6.6.10": + version "6.6.10" + resolved "https://registry.yarnpkg.com/@aws-amplify/storage/-/storage-6.6.10.tgz#ef0236b03456efbd0d4e96db3cdb9c562390e1e9" + integrity sha512-wQ4Xj74Xh+TOlT9Lt7xv8zlgE5Jgtswgzap10rcNxLd45mo0KzC3dMBvIN1EW5+25HUQaQMzSByyI1T1GijE2g== dependencies: "@aws-sdk/types" "3.398.0" "@smithy/md5-js" "2.0.7" @@ -12360,18 +12371,18 @@ available-typed-arrays@^1.0.5: resolved "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== -aws-amplify@^6.6.0: - version "6.6.2" - resolved "https://registry.yarnpkg.com/aws-amplify/-/aws-amplify-6.6.2.tgz#1584a89b3834e5678815b8f28904e06de83df832" - integrity sha512-VPboVLLQyyWQvpMfqrEQsF2SkVTqIKMQrEzakl01kIzyoaKKaPVefc7Gd9RmtuDuDcU/SalIR2pIRfE4ZkTMRQ== - dependencies: - "@aws-amplify/analytics" "7.0.49" - "@aws-amplify/api" "6.0.51" - "@aws-amplify/auth" "6.4.2" - "@aws-amplify/core" "6.4.2" - "@aws-amplify/datastore" "5.0.51" - "@aws-amplify/notifications" "2.0.49" - "@aws-amplify/storage" "6.6.7" +aws-amplify@^6.6.5: + version "6.6.5" + resolved "https://registry.yarnpkg.com/aws-amplify/-/aws-amplify-6.6.5.tgz#d033d165d9e29fabcb2be79f81f9e5029d6bb755" + integrity sha512-m8NzejjZi5ASY9ynkeEZ1maM+F2Ho1vb4IyM5ZLDPIHz4kk1zOZPIuWAPUbOPu4Q3kDr0jvoBSpq/rfTqa630w== + dependencies: + "@aws-amplify/analytics" "7.0.52" + "@aws-amplify/api" "6.0.54" + "@aws-amplify/auth" "6.5.2" + "@aws-amplify/core" "6.4.5" + "@aws-amplify/datastore" "5.0.54" + "@aws-amplify/notifications" "2.0.52" + "@aws-amplify/storage" "6.6.10" tslib "^2.5.0" aws-sign2@~0.7.0: @@ -25856,7 +25867,16 @@ string-natural-compare@^3.0.1: resolved "https://registry.npmjs.org/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -25981,7 +26001,14 @@ stringify-entities@^4.0.0: character-entities-html4 "^2.0.0" character-entities-legacy "^3.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -27995,7 +28022,7 @@ workerpool@6.2.1: resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -28013,6 +28040,15 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From 6d97bc31af251de2daee573e81a036429faa405b Mon Sep 17 00:00:00 2001 From: Danny Banks Date: Fri, 18 Oct 2024 08:12:42 -0700 Subject: [PATCH 07/12] Update rich-bags-smile.md (#5921) --- .changeset/rich-bags-smile.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.changeset/rich-bags-smile.md b/.changeset/rich-bags-smile.md index 04cd2a360d2..8a8ddcd10a7 100644 --- a/.changeset/rich-bags-smile.md +++ b/.changeset/rich-bags-smile.md @@ -14,7 +14,6 @@ "@aws-amplify/ui-react": patch "@aws-amplify/ui": patch "@aws-amplify/ui-vue": patch -"@aws-amplify/ui-angular": patch --- chore(ai): adding UA string for AIConversation From 7f42be209a8f700873a8df0e6ce7f57d389e6ad6 Mon Sep 17 00:00:00 2001 From: Danny Banks Date: Fri, 18 Oct 2024 14:33:28 -0700 Subject: [PATCH 08/12] chore(ai): add size limits (#5918) --- packages/react-ai/package.json | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/react-ai/package.json b/packages/react-ai/package.json index 1ee47e296b6..1e203d13f7c 100644 --- a/packages/react-ai/package.json +++ b/packages/react-ai/package.json @@ -55,5 +55,19 @@ "devDependencies": { "@types/jest-when": "^3.5.0", "jest-when": "^3.5.1" - } + }, + "size-limit": [ + { + "name": "AIConversation", + "path": "dist/esm/index.mjs", + "import": "{ AIConversation }", + "limit": "25 kB" + }, + { + "name": "createAIConversation", + "path": "dist/esm/index.mjs", + "import": "{ createAIConversation }", + "limit": "7 kB" + } + ] } From 3a697ea5cdb81dd43988abbd2a336440713a8e31 Mon Sep 17 00:00:00 2001 From: Danny Banks Date: Fri, 18 Oct 2024 14:59:42 -0700 Subject: [PATCH 09/12] feat(ai): add message renderer (#5873) --- .changeset/heavy-dots-applaud.md | 16 ++++ .../amplify_outputs.js | 2 + .../ai-conversation-renderer/index.page.tsx | 89 +++++++++++++++++++ .../AIConversation/AIConversation.tsx | 2 + .../context/MessageRenderContext.tsx | 13 +++ .../AIConversation/context/index.ts | 6 ++ .../AIConversation/createAIConversation.tsx | 2 + .../src/components/AIConversation/types.ts | 13 ++- .../src/components/AIConversation/utils.ts | 4 +- .../views/Controls/MessagesControl.tsx | 22 ++--- .../__tests__/MessagesControl.spec.tsx | 68 +++++++------- packages/react-ai/src/types.ts | 6 +- 12 files changed, 190 insertions(+), 53 deletions(-) create mode 100644 .changeset/heavy-dots-applaud.md create mode 100644 examples/next/pages/ui/components/ai/ai-conversation-renderer/amplify_outputs.js create mode 100644 examples/next/pages/ui/components/ai/ai-conversation-renderer/index.page.tsx create mode 100644 packages/react-ai/src/components/AIConversation/context/MessageRenderContext.tsx diff --git a/.changeset/heavy-dots-applaud.md b/.changeset/heavy-dots-applaud.md new file mode 100644 index 00000000000..26b303ed917 --- /dev/null +++ b/.changeset/heavy-dots-applaud.md @@ -0,0 +1,16 @@ +--- +"@aws-amplify/ui-react-ai": minor +--- + +feat(ai): add message renderer + +```tsx + {text}, + }} +/> +``` diff --git a/examples/next/pages/ui/components/ai/ai-conversation-renderer/amplify_outputs.js b/examples/next/pages/ui/components/ai/ai-conversation-renderer/amplify_outputs.js new file mode 100644 index 00000000000..2f1016412fd --- /dev/null +++ b/examples/next/pages/ui/components/ai/ai-conversation-renderer/amplify_outputs.js @@ -0,0 +1,2 @@ +import amplifyOutputs from '@environments/ai/gen2/amplify_outputs'; +export default amplifyOutputs; diff --git a/examples/next/pages/ui/components/ai/ai-conversation-renderer/index.page.tsx b/examples/next/pages/ui/components/ai/ai-conversation-renderer/index.page.tsx new file mode 100644 index 00000000000..42409609fdd --- /dev/null +++ b/examples/next/pages/ui/components/ai/ai-conversation-renderer/index.page.tsx @@ -0,0 +1,89 @@ +import { Amplify } from 'aws-amplify'; +import { createAIHooks, AIConversation } from '@aws-amplify/ui-react-ai'; +import { generateClient } from 'aws-amplify/api'; +import '@aws-amplify/ui-react/styles.css'; +import '@aws-amplify/ui-react-ai/ai-conversation-styles.css'; + +import outputs from './amplify_outputs'; +import type { Schema } from '@environments/ai/gen2/amplify/data/resource'; +import { Authenticator, Card, Text } from '@aws-amplify/ui-react'; +import Image from 'next/image'; + +const client = generateClient({ authMode: 'userPool' }); +const { useAIConversation } = createAIHooks(client); + +Amplify.configure(outputs); + +function arrayBufferToBase64(buffer: ArrayBuffer) { + let binary = ''; + const bytes = new Uint8Array(buffer); + const len = bytes.byteLength; + for (let i = 0; i < len; i++) { + binary += String.fromCharCode(bytes[i]); + } + return window.btoa(binary); +} + +function convertBufferToBase64(buffer: ArrayBuffer, format: string): string { + let base64string = ''; + // Use node-based buffer if available + // fall back on browser if not + if (typeof Buffer !== 'undefined') { + base64string = Buffer.from(new Uint8Array(buffer)).toString('base64'); + } else { + base64string = arrayBufferToBase64(buffer); + } + return `data:image/${format};base64,${base64string}`; +} + +function Chat() { + const [ + { + data: { messages }, + isLoading, + }, + sendMessage, + ] = useAIConversation('pirateChat'); + + return ( + + {text}, + image: ({ image }) => ( + + ), + }} + suggestedPrompts={[ + { + inputText: 'hello', + header: 'hello', + }, + { + inputText: 'how are you?', + header: 'how are you?', + }, + ]} + variant="bubble" + /> + + ); +} + +export default function Example() { + return ( + + + + ); +} diff --git a/packages/react-ai/src/components/AIConversation/AIConversation.tsx b/packages/react-ai/src/components/AIConversation/AIConversation.tsx index 382d1b380b3..a17bc811c86 100644 --- a/packages/react-ai/src/components/AIConversation/AIConversation.tsx +++ b/packages/react-ai/src/components/AIConversation/AIConversation.tsx @@ -33,6 +33,7 @@ function AIConversationBase({ isLoading, displayText, allowAttachments, + messageRenderer, }: AIConversationBaseProps): JSX.Element { useSetUserAgent({ componentName: 'AIConversation', @@ -78,6 +79,7 @@ function AIConversationBase({ }, displayText, allowAttachments, + messageRenderer, }; return ( diff --git a/packages/react-ai/src/components/AIConversation/context/MessageRenderContext.tsx b/packages/react-ai/src/components/AIConversation/context/MessageRenderContext.tsx new file mode 100644 index 00000000000..7336e74f95c --- /dev/null +++ b/packages/react-ai/src/components/AIConversation/context/MessageRenderContext.tsx @@ -0,0 +1,13 @@ +import { createContextUtilities } from '@aws-amplify/ui-react-core'; +import { MessageRenderer } from '../types'; + +export const { + MessageRendererContext, + MessageRendererProvider, + useMessageRenderer, +} = createContextUtilities({ + contextName: 'MessageRenderer', + defaultValue: undefined, + errorMessage: + '`useMessageRenderer` must be used with an AIConversation component', +}); diff --git a/packages/react-ai/src/components/AIConversation/context/index.ts b/packages/react-ai/src/components/AIConversation/context/index.ts index 5c56c750018..ca32e10d824 100644 --- a/packages/react-ai/src/components/AIConversation/context/index.ts +++ b/packages/react-ai/src/components/AIConversation/context/index.ts @@ -34,5 +34,11 @@ export { RESPONSE_COMPONENT_PREFIX, } from './ResponseComponentsContext'; export { SendMessageContextProvider } from './SendMessageContext'; +export { + MessageRendererProvider, + MessageRendererContext, + useMessageRenderer, +} from './MessageRenderContext'; +export { AttachmentProvider, AttachmentContext } from './AttachmentContext'; export * from './elements'; diff --git a/packages/react-ai/src/components/AIConversation/createAIConversation.tsx b/packages/react-ai/src/components/AIConversation/createAIConversation.tsx index 83bad22362f..e672db0ef50 100644 --- a/packages/react-ai/src/components/AIConversation/createAIConversation.tsx +++ b/packages/react-ai/src/components/AIConversation/createAIConversation.tsx @@ -31,6 +31,7 @@ export function createAIConversation(input: AIConversationInput = {}): { controls, displayText, allowAttachments, + messageRenderer, } = input; function AIConversation(props: AIConversationProps): JSX.Element { @@ -48,6 +49,7 @@ export function createAIConversation(input: AIConversationInput = {}): { avatars, handleSendMessage, isLoading, + messageRenderer, }; return ( diff --git a/packages/react-ai/src/components/AIConversation/types.ts b/packages/react-ai/src/components/AIConversation/types.ts index ba987b8dce1..1a6ccac8487 100644 --- a/packages/react-ai/src/components/AIConversation/types.ts +++ b/packages/react-ai/src/components/AIConversation/types.ts @@ -11,7 +11,12 @@ import { } from './views'; import { DisplayTextTemplate } from '@aws-amplify/ui'; import { AIConversationDisplayText } from './displayText'; -import { ConversationMessage, SendMessage } from '../../types'; +import { + ConversationMessage, + ImageContentBlock, + SendMessage, + TextContentBlock, +} from '../../types'; import { ControlsContextProps } from './context/ControlsContext'; export interface Controls { @@ -32,6 +37,7 @@ export interface AIConversationInput { variant?: MessageVariant; controls?: ControlsContextProps; allowAttachments?: boolean; + messageRenderer?: MessageRenderer; } export interface AIConversationProps { @@ -54,6 +60,11 @@ export interface AIConversation { export type MessageVariant = 'bubble' | 'default'; +export interface MessageRenderer { + text?: (input: { text: TextContentBlock }) => React.JSX.Element; + image?: (input: { image: ImageContentBlock }) => React.JSX.Element; +} + export interface Avatar { username?: string; avatar?: React.ReactNode; diff --git a/packages/react-ai/src/components/AIConversation/utils.ts b/packages/react-ai/src/components/AIConversation/utils.ts index d93401baa66..023cec0be22 100644 --- a/packages/react-ai/src/components/AIConversation/utils.ts +++ b/packages/react-ai/src/components/AIConversation/utils.ts @@ -1,4 +1,4 @@ -import { ImageContent } from '../../types'; +import { ImageContentBlock } from '../../types'; export function formatDate(date: Date): string { const dateString = date.toLocaleDateString('en-US', { @@ -27,7 +27,7 @@ function arrayBufferToBase64(buffer: ArrayBuffer) { export function convertBufferToBase64( buffer: ArrayBuffer, - format: ImageContent['format'] + format: ImageContentBlock['format'] ): string { let base64string = ''; // Use node-based buffer if available diff --git a/packages/react-ai/src/components/AIConversation/views/Controls/MessagesControl.tsx b/packages/react-ai/src/components/AIConversation/views/Controls/MessagesControl.tsx index deface4b773..5de1fd3f1dc 100644 --- a/packages/react-ai/src/components/AIConversation/views/Controls/MessagesControl.tsx +++ b/packages/react-ai/src/components/AIConversation/views/Controls/MessagesControl.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { withBaseElementProps } from '@aws-amplify/ui-react-core/elements'; import { + MessageRendererContext, MessagesContext, MessageVariantContext, RoleContext, @@ -63,17 +64,22 @@ const ContentContainer: typeof View = React.forwardRef( export const MessageControl: MessageControl = ({ message }) => { const responseComponents = React.useContext(ResponseComponentsContext); + const messageRenderer = React.useContext(MessageRendererContext); return ( {message.content.map((content, index) => { if (content.text) { - return ( + return messageRenderer?.text ? ( + messageRenderer.text({ text: content.text }) + ) : ( {content.text} ); } else if (content.image) { - return ( + return messageRenderer?.image ? ( + messageRenderer?.image({ image: content.image }) + ) : ( { content.image?.source.bytes, content.image?.format )} - > + /> ); } else if (content.toolUse) { // For now tool use is limited to custom response components @@ -164,7 +170,7 @@ const Layout: typeof View = React.forwardRef(function Layout(props, ref) { ); }); -export const MessagesControl: MessagesControl = ({ renderMessage }) => { +export const MessagesControl: MessagesControl = () => { const messages = React.useContext(MessagesContext); const controls = React.useContext(ControlsContext); const { getMessageTimestampText } = useConversationDisplayText(); @@ -226,9 +232,7 @@ export const MessagesControl: MessagesControl = ({ renderMessage }) => { return ( {messagesWithRenderableContent?.map((message, index) => { - return renderMessage ? ( - renderMessage(message) - ) : ( + return ( React.ReactNode; - }): JSX.Element; + (): JSX.Element; ActionsBar: ActionsBarControl; Avatar: AvatarControl; Container: AIConversationElements['View']; diff --git a/packages/react-ai/src/components/AIConversation/views/Controls/__tests__/MessagesControl.spec.tsx b/packages/react-ai/src/components/AIConversation/views/Controls/__tests__/MessagesControl.spec.tsx index be5ed0206fd..a054835a569 100644 --- a/packages/react-ai/src/components/AIConversation/views/Controls/__tests__/MessagesControl.spec.tsx +++ b/packages/react-ai/src/components/AIConversation/views/Controls/__tests__/MessagesControl.spec.tsx @@ -13,6 +13,7 @@ import { MessagesControl, MessageControl } from '../MessagesControl'; import { convertBufferToBase64 } from '../../../utils'; import { ConversationMessage } from '../../../../../types'; import { ResponseComponentsProvider } from '../../../context/ResponseComponentsContext'; +import { MessageRendererProvider } from '../../../context'; const AITextMessage: ConversationMessage = { conversationId: 'foobar', @@ -212,44 +213,6 @@ describe('MessagesControl', () => { expect(actionElements).toHaveLength(2); }); - it('renders a MessagesControl element with a custom renderMessage function', () => { - const customMessage = jest.fn((message: ConversationMessage) => ( -
- {message.content.map((content, index) => { - if (content.text) { - return

{content.text}

; - } else if (content.image) { - return ( - - ); - } - })} -
- )); - - render( - - - - ); - - expect(customMessage).toHaveBeenCalledTimes(3); - - const defaultMessageElements = screen.queryAllByTestId('message'); - expect(defaultMessageElements).toHaveLength(0); - - const customMessageElements = screen.queryAllByTestId('custom-message'); - expect(customMessageElements).toHaveLength(3); - }); - it('renders avatars and actions appropriately if the same user sends multiple messages', () => { const { rerender } = render( @@ -387,4 +350,33 @@ describe('MessageControl', () => { const { container } = render(); expect(container.firstChild).toBeEmptyDOMElement(); }); + + it('uses text message renderer if passed', () => { + render( +
{text}
} + > + +
+ ); + const message = screen.getByTestId('custom-message'); + expect(message).toBeInTheDocument(); + }); + + it('uses image message renderer if passed', () => { + render( + ( + + )} + > + + + ); + const message = screen.getByTestId('custom-message'); + expect(message).toBeInTheDocument(); + }); }); diff --git a/packages/react-ai/src/types.ts b/packages/react-ai/src/types.ts index ec7c108ece4..8a887c5020e 100644 --- a/packages/react-ai/src/types.ts +++ b/packages/react-ai/src/types.ts @@ -11,9 +11,11 @@ export type ConversationMessage = NonNullable< export type ConversationMessageContent = ConversationMessage['content'][number]; -export type TextContent = NonNullable; +export type TextContentBlock = NonNullable; -export type ImageContent = NonNullable; +export type ImageContentBlock = NonNullable< + ConversationMessageContent['image'] +>; // Note: the conversation sendMessage function is an overload // that accepts a string OR an object From d65cea0d0475aacb4ea0ac9c83278a62356f6421 Mon Sep 17 00:00:00 2001 From: Danny Banks Date: Tue, 22 Oct 2024 10:11:14 -0700 Subject: [PATCH 10/12] AIConversation composable (#5924) --- .changeset/good-planets-invite.md | 41 +++++++++++ .../amplify_outputs.js | 2 + .../ai-conversation-composable/index.page.tsx | 56 +++++++++++++++ .../ai-conversation-renderer/index.page.tsx | 4 +- .../ai/ai-conversation/index.page.tsx | 4 +- .../ai/create-ai-conversation/index.page.tsx | 27 +++---- .../AIConversation/AIConversation.tsx | 64 ++++++++++------- .../AIConversation/AIConversationProvider.tsx | 68 +++++++++--------- .../context/WelcomeMessageContext.tsx | 20 ++++++ .../AIConversation/context/index.ts | 5 +- .../AIConversation/createAIConversation.tsx | 37 ++++------ .../src/components/AIConversation/types.ts | 28 ++++---- .../views/Controls/DefaultMessageControl.tsx | 18 +++++ .../{FieldControl.tsx => FormControl.tsx} | 16 ++--- .../views/Controls/HeaderControl.tsx | 57 --------------- .../views/Controls/MessagesControl.tsx | 47 ++++++++----- .../views/Controls/PromptControl.tsx | 70 +------------------ ...dControl.spec.tsx => FormControl.spec.tsx} | 14 ++-- .../Controls/__tests__/HeaderControl.spec.tsx | 11 --- .../AIConversation/views/Controls/index.ts | 9 +-- .../AIConversation/views/ConversationView.tsx | 23 ------ .../views/__tests__/ConversationView.spec.tsx | 9 --- .../views/default/PromptList.tsx | 2 +- .../components/AIConversation/views/index.ts | 8 +-- 24 files changed, 311 insertions(+), 329 deletions(-) create mode 100644 .changeset/good-planets-invite.md create mode 100644 examples/next/pages/ui/components/ai/ai-conversation-composable/amplify_outputs.js create mode 100644 examples/next/pages/ui/components/ai/ai-conversation-composable/index.page.tsx create mode 100644 packages/react-ai/src/components/AIConversation/context/WelcomeMessageContext.tsx create mode 100644 packages/react-ai/src/components/AIConversation/views/Controls/DefaultMessageControl.tsx rename packages/react-ai/src/components/AIConversation/views/Controls/{FieldControl.tsx => FormControl.tsx} (95%) delete mode 100644 packages/react-ai/src/components/AIConversation/views/Controls/HeaderControl.tsx rename packages/react-ai/src/components/AIConversation/views/Controls/__tests__/{FieldControl.spec.tsx => FormControl.spec.tsx} (94%) delete mode 100644 packages/react-ai/src/components/AIConversation/views/Controls/__tests__/HeaderControl.spec.tsx delete mode 100644 packages/react-ai/src/components/AIConversation/views/ConversationView.tsx delete mode 100644 packages/react-ai/src/components/AIConversation/views/__tests__/ConversationView.spec.tsx diff --git a/.changeset/good-planets-invite.md b/.changeset/good-planets-invite.md new file mode 100644 index 00000000000..fe948afde0c --- /dev/null +++ b/.changeset/good-planets-invite.md @@ -0,0 +1,41 @@ +--- +"@aws-amplify/ui-react-ai": minor +--- + + +The AIConversation component is now composable if you are using the default component or the headless component using `createAIConversation()`. There are 4 parts: + +* Provider: provides all the necessary data/handlers for the composable components +* Messages: the message history for the conversation +* DefaultMessage: contains an optional welcome message and prompt suggestions, only shown if no messages present +* Form: the form for sending messages, includes the text input, submit button, and attachments + +```jsx +function Chat() { + const [ + { + data: { messages }, + isLoading, + }, + sendMessage, + ] = useAIConversation('pirateChat'); + + return ( + + + + + + + + + + + + ); +} +``` diff --git a/examples/next/pages/ui/components/ai/ai-conversation-composable/amplify_outputs.js b/examples/next/pages/ui/components/ai/ai-conversation-composable/amplify_outputs.js new file mode 100644 index 00000000000..2f1016412fd --- /dev/null +++ b/examples/next/pages/ui/components/ai/ai-conversation-composable/amplify_outputs.js @@ -0,0 +1,2 @@ +import amplifyOutputs from '@environments/ai/gen2/amplify_outputs'; +export default amplifyOutputs; diff --git a/examples/next/pages/ui/components/ai/ai-conversation-composable/index.page.tsx b/examples/next/pages/ui/components/ai/ai-conversation-composable/index.page.tsx new file mode 100644 index 00000000000..9a4ad3e9d82 --- /dev/null +++ b/examples/next/pages/ui/components/ai/ai-conversation-composable/index.page.tsx @@ -0,0 +1,56 @@ +import * as React from 'react'; +import { Amplify } from 'aws-amplify'; +import { createAIHooks, AIConversation } from '@aws-amplify/ui-react-ai'; +import { generateClient } from 'aws-amplify/api'; +import '@aws-amplify/ui-react/styles.css'; +import '@aws-amplify/ui-react-ai/ai-conversation-styles.css'; + +import outputs from './amplify_outputs'; +import type { Schema } from '@environments/ai/gen2/amplify/data/resource'; +import { Authenticator, Card, Flex } from '@aws-amplify/ui-react'; + +const client = generateClient({ authMode: 'userPool' }); +const { useAIConversation } = createAIHooks(client); + +Amplify.configure(outputs); + +function Chat() { + const [ + { + data: { messages }, + isLoading, + }, + sendMessage, + ] = useAIConversation('pirateChat'); + + return ( + + + + + + + + + + + + ); +} + +export default function Example() { + return ( + + + + ); +} diff --git a/examples/next/pages/ui/components/ai/ai-conversation-renderer/index.page.tsx b/examples/next/pages/ui/components/ai/ai-conversation-renderer/index.page.tsx index 42409609fdd..04d75b965a1 100644 --- a/examples/next/pages/ui/components/ai/ai-conversation-renderer/index.page.tsx +++ b/examples/next/pages/ui/components/ai/ai-conversation-renderer/index.page.tsx @@ -67,11 +67,11 @@ function Chat() { suggestedPrompts={[ { inputText: 'hello', - header: 'hello', + component: 'hello', }, { inputText: 'how are you?', - header: 'how are you?', + component: 'how are you?', }, ]} variant="bubble" diff --git a/examples/next/pages/ui/components/ai/ai-conversation/index.page.tsx b/examples/next/pages/ui/components/ai/ai-conversation/index.page.tsx index b71fbecebf9..f60b0d6e93e 100644 --- a/examples/next/pages/ui/components/ai/ai-conversation/index.page.tsx +++ b/examples/next/pages/ui/components/ai/ai-conversation/index.page.tsx @@ -40,11 +40,11 @@ function Chat() { suggestedPrompts={[ { inputText: 'hello', - header: 'hello', + component: 'hello', }, { inputText: 'how are you?', - header: 'how are you?', + component: 'how are you?', }, ]} variant="bubble" diff --git a/examples/next/pages/ui/components/ai/create-ai-conversation/index.page.tsx b/examples/next/pages/ui/components/ai/create-ai-conversation/index.page.tsx index 86f73677127..ee1f22b954e 100644 --- a/examples/next/pages/ui/components/ai/create-ai-conversation/index.page.tsx +++ b/examples/next/pages/ui/components/ai/create-ai-conversation/index.page.tsx @@ -46,25 +46,14 @@ export default function Example() { return ( - {({ user, signOut }) => { - return ( - <> -

Hello {user.username}

- - - - ); - }} + + + +
); } - -// export default function Example() { -// return
hello world
; -// } diff --git a/packages/react-ai/src/components/AIConversation/AIConversation.tsx b/packages/react-ai/src/components/AIConversation/AIConversation.tsx index a17bc811c86..10a79abb3da 100644 --- a/packages/react-ai/src/components/AIConversation/AIConversation.tsx +++ b/packages/react-ai/src/components/AIConversation/AIConversation.tsx @@ -1,27 +1,31 @@ import * as React from 'react'; -import { Flex, ScrollView, Text, TextProps } from '@aws-amplify/ui-react'; +import { Flex, ScrollView, Text } from '@aws-amplify/ui-react'; import { IconAssistant, IconUser, useIcons, } from '@aws-amplify/ui-react/internal'; -import { AIConversationInput, AIConversationProps, Avatars } from './types'; +import { + AIConversation as AIConversationType, + AIConversationInput, + AIConversationProps, + Avatars, +} from './types'; import { MessagesControl } from './views/Controls/MessagesControl'; -import { FieldControl } from './views'; +import { FormControl } from './views/Controls/FormControl'; import { MessageList } from './views/default/MessageList'; import { Form } from './views/default/Form'; import { PromptList } from './views/default/PromptList'; -import { AutoHidablePromptControl } from './views/Controls'; import { ComponentClassName } from '@aws-amplify/ui'; -import { AIConversationProvider } from './AIConversationProvider'; +import { + AIConversationProvider, + AIConversationProviderProps, +} from './AIConversationProvider'; import { useSetUserAgent } from '@aws-amplify/ui-react-core'; import { VERSION } from '../../version'; +import { DefaultMessageControl } from './views/Controls/DefaultMessageControl'; -interface AIConversationBaseProps - extends AIConversationProps, - AIConversationInput {} - -function AIConversationBase({ +function Provider({ actions, avatars, controls, @@ -34,12 +38,14 @@ function AIConversationBase({ displayText, allowAttachments, messageRenderer, -}: AIConversationBaseProps): JSX.Element { + children, +}: AIConversationProviderProps): JSX.Element { useSetUserAgent({ componentName: 'AIConversation', packageName: 'react-ai', version: VERSION, }); + const icons = useIcons('aiConversation'); const defaultAvatars: Avatars = { ai: { @@ -61,11 +67,7 @@ function AIConversationBase({ }, isLoading, elements: { - Text: React.forwardRef( - function _Text(props, ref) { - return ; - } - ), + Text, }, actions, suggestedPrompts, @@ -84,22 +86,36 @@ function AIConversationBase({ return ( + {children} + + ); +} + +interface AIConversationBaseProps + extends AIConversationProps, + AIConversationInput {} + +function AIConversationBase(props: AIConversationBaseProps): JSX.Element { + return ( + - + - + -
+ ); } /** * @experimental */ -export const AIConversation = Object.assign(AIConversationBase, { - MessageList, - PromptList, - Form, -}); +export const AIConversation: AIConversationType = + Object.assign(AIConversationBase, { + Provider, + DefaultMessage: DefaultMessageControl, + Messages: MessagesControl, + Form: FormControl, + }); diff --git a/packages/react-ai/src/components/AIConversation/AIConversationProvider.tsx b/packages/react-ai/src/components/AIConversation/AIConversationProvider.tsx index 84b02cb0768..ee85e1fd720 100644 --- a/packages/react-ai/src/components/AIConversation/AIConversationProvider.tsx +++ b/packages/react-ai/src/components/AIConversation/AIConversationProvider.tsx @@ -16,29 +16,31 @@ import { LoadingContextProvider, ResponseComponentsProvider, SendMessageContextProvider, + WelcomeMessageProvider, } from './context'; import { AttachmentProvider } from './context/AttachmentContext'; -interface AIConversationProviderProps +export interface AIConversationProviderProps extends AIConversationInput, AIConversationProps { children?: React.ReactNode; } export const AIConversationProvider = ({ - elements, actions, - suggestedPrompts, - responseComponents, - variant, + allowAttachments, + avatars, + children, controls, displayText, - allowAttachments, - messages, + elements, handleSendMessage, - avatars, isLoading, - children, + messages, + responseComponents, + suggestedPrompts, + variant, + welcomeMessage, }: AIConversationProviderProps): React.JSX.Element => { const _displayText = { ...defaultAIConversationDisplayTextEn, @@ -48,29 +50,31 @@ export const AIConversationProvider = ({ - - - - - - - - - - - {children} - - - - - - - - - - + + + + + + + + + + + + {children} + + + + + + + + + + + diff --git a/packages/react-ai/src/components/AIConversation/context/WelcomeMessageContext.tsx b/packages/react-ai/src/components/AIConversation/context/WelcomeMessageContext.tsx new file mode 100644 index 00000000000..fe116d97bcf --- /dev/null +++ b/packages/react-ai/src/components/AIConversation/context/WelcomeMessageContext.tsx @@ -0,0 +1,20 @@ +import * as React from 'react'; + +type WelcomeMessageContextProps = React.ReactNode | undefined; + +export const WelcomeMessageContext = + React.createContext(undefined); + +export const WelcomeMessageProvider = ({ + children, + welcomeMessage, +}: { + children?: React.ReactNode; + welcomeMessage?: React.ReactNode; +}): JSX.Element => { + return ( + + {children} + + ); +}; diff --git a/packages/react-ai/src/components/AIConversation/context/index.ts b/packages/react-ai/src/components/AIConversation/context/index.ts index ca32e10d824..ba42f91c8bc 100644 --- a/packages/react-ai/src/components/AIConversation/context/index.ts +++ b/packages/react-ai/src/components/AIConversation/context/index.ts @@ -40,5 +40,8 @@ export { useMessageRenderer, } from './MessageRenderContext'; export { AttachmentProvider, AttachmentContext } from './AttachmentContext'; - +export { + WelcomeMessageContext, + WelcomeMessageProvider, +} from './WelcomeMessageContext'; export * from './elements'; diff --git a/packages/react-ai/src/components/AIConversation/createAIConversation.tsx b/packages/react-ai/src/components/AIConversation/createAIConversation.tsx index e672db0ef50..440f7672f0b 100644 --- a/packages/react-ai/src/components/AIConversation/createAIConversation.tsx +++ b/packages/react-ai/src/components/AIConversation/createAIConversation.tsx @@ -1,20 +1,13 @@ import React from 'react'; import { - Controls, AIConversationInput, AIConversation, AIConversationProps, } from './types'; -import { - ActionsBarControl, - AvatarControl, - Conversation, - FieldControl, - HeaderControl, - MessagesControl, - PromptControl, -} from './views'; +import { FormControl, MessagesControl } from './views'; +import { ViewElement as View } from './context/elements/definitions'; import { AIConversationProvider } from './AIConversationProvider'; +import { DefaultMessageControl } from './views/Controls/DefaultMessageControl'; /** * @experimental @@ -53,23 +46,23 @@ export function createAIConversation(input: AIConversationInput = {}): { }; return ( - + + + + + + + + + ); } - const Controls: Controls = { - ActionsBar: ActionsBarControl, - Avatars: AvatarControl, - Field: FieldControl, - Header: HeaderControl, - Messages: MessagesControl, - SuggestedPrompts: PromptControl, - }; - AIConversation.Provider = AIConversationProvider; - AIConversation.Conversation = Conversation; - AIConversation.Controls = Controls; + AIConversation.DefaultMessage = DefaultMessageControl; + AIConversation.Messages = MessagesControl; + AIConversation.Form = FormControl; return { AIConversation }; } diff --git a/packages/react-ai/src/components/AIConversation/types.ts b/packages/react-ai/src/components/AIConversation/types.ts index 1a6ccac8487..fba9f995226 100644 --- a/packages/react-ai/src/components/AIConversation/types.ts +++ b/packages/react-ai/src/components/AIConversation/types.ts @@ -4,8 +4,7 @@ import { AIConversationElements } from './context/elements'; import { ActionsBarControl, AvatarControl, - FieldControl, - HeaderControl, + FormControl, MessagesControl, PromptControl, } from './views'; @@ -18,12 +17,12 @@ import { TextContentBlock, } from '../../types'; import { ControlsContextProps } from './context/ControlsContext'; +import { AIConversationProviderProps } from './AIConversationProvider'; export interface Controls { Avatars: AvatarControl; ActionsBar: ActionsBarControl; - Field: FieldControl; - Header: HeaderControl; + Form: FormControl; Messages: MessagesControl; SuggestedPrompts: PromptControl; } @@ -31,6 +30,7 @@ export interface Controls { export interface AIConversationInput { elements?: Partial; displayText?: DisplayTextTemplate; + welcomeMessage?: React.ReactNode; suggestedPrompts?: SuggestedPrompt[]; actions?: CustomAction[]; responseComponents?: ResponseComponents; @@ -47,15 +47,14 @@ export interface AIConversationProps { isLoading?: boolean; } -export interface AIConversation { - (props: AIConversationProps): JSX.Element; - Conversation: () => React.JSX.Element; - Controls: Controls; - Provider: ( - props: { - children?: React.ReactNode; - } & Pick - ) => React.JSX.Element; +export interface AIConversation< + PropsType extends AIConversationProps = AIConversationProps, +> { + (props: PropsType): JSX.Element; + DefaultMessage: () => JSX.Element | undefined; + Messages: () => JSX.Element; + Form: () => JSX.Element; + Provider: (props: AIConversationProviderProps) => React.JSX.Element; } export type MessageVariant = 'bubble' | 'default'; @@ -82,8 +81,7 @@ export interface CustomAction { } export interface SuggestedPrompt { - icon?: React.ReactNode; - header: string; + component?: React.ReactNode; inputText: string; } diff --git a/packages/react-ai/src/components/AIConversation/views/Controls/DefaultMessageControl.tsx b/packages/react-ai/src/components/AIConversation/views/Controls/DefaultMessageControl.tsx new file mode 100644 index 00000000000..be2e769fbf9 --- /dev/null +++ b/packages/react-ai/src/components/AIConversation/views/Controls/DefaultMessageControl.tsx @@ -0,0 +1,18 @@ +import * as React from 'react'; +import { MessagesContext } from '../../context'; +import { PromptControl } from './PromptControl'; +import { WelcomeMessageContext } from '../../context/WelcomeMessageContext'; + +export const DefaultMessageControl = (): JSX.Element | undefined => { + const messages = React.useContext(MessagesContext); + const welcomeMessage = React.useContext(WelcomeMessageContext); + + if (!messages || messages.length === 0) { + return ( + <> + {welcomeMessage} + + + ); + } +}; diff --git a/packages/react-ai/src/components/AIConversation/views/Controls/FieldControl.tsx b/packages/react-ai/src/components/AIConversation/views/Controls/FormControl.tsx similarity index 95% rename from packages/react-ai/src/components/AIConversation/views/Controls/FieldControl.tsx rename to packages/react-ai/src/components/AIConversation/views/Controls/FormControl.tsx index cc9e012362c..975a6710273 100644 --- a/packages/react-ai/src/components/AIConversation/views/Controls/FieldControl.tsx +++ b/packages/react-ai/src/components/AIConversation/views/Controls/FormControl.tsx @@ -146,7 +146,7 @@ const InputContainer = withBaseElementProps(View, { className: `${FIELD_BLOCK}__input-container`, }); -export const FieldControl: FieldControl = () => { +export const FormControl: FormControl = () => { const { input, setInput } = React.useContext(ConversationInputContext); const handleSendMessage = React.useContext(SendMessageContext); const allowAttachments = React.useContext(AttachmentContext); @@ -241,14 +241,14 @@ export const FieldControl: FieldControl = () => { ); }; -FieldControl.AttachFile = AttachFileControl; -FieldControl.InputContainer = InputContainer; -FieldControl.Label = Label; -FieldControl.TextInput = TextInput; -FieldControl.SendButton = SendButton; -FieldControl.SendIcon = SendIcon; +FormControl.AttachFile = AttachFileControl; +FormControl.InputContainer = InputContainer; +FormControl.Label = Label; +FormControl.TextInput = TextInput; +FormControl.SendButton = SendButton; +FormControl.SendIcon = SendIcon; -export interface FieldControl { +export interface FormControl { (): React.JSX.Element; AttachFile: AttachFileControl; InputContainer: AIConversationElements['View']; diff --git a/packages/react-ai/src/components/AIConversation/views/Controls/HeaderControl.tsx b/packages/react-ai/src/components/AIConversation/views/Controls/HeaderControl.tsx deleted file mode 100644 index 4dc9018cde1..00000000000 --- a/packages/react-ai/src/components/AIConversation/views/Controls/HeaderControl.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import React from 'react'; -import { withBaseElementProps } from '@aws-amplify/ui-react-core/elements'; - -import { AIConversationElements } from '../../context/elements'; - -const { View, Button, Icon, Text } = AIConversationElements; - -const HEADER_BLOCK = 'ai-header'; - -const HeaderTextBase = withBaseElementProps(Text, { - className: `${HEADER_BLOCK}__text`, -}); - -const HeaderText: typeof HeaderTextBase = React.forwardRef( - function HeaderText(props, ref) { - return ; - } -); - -const CloseIcon = withBaseElementProps(Icon, { - className: `${HEADER_BLOCK}__icon`, - variant: 'close', -}); - -const CloseButtonBase = withBaseElementProps(Button, { - className: `${HEADER_BLOCK}__button`, -}); - -const CloseButton: typeof CloseButtonBase = React.forwardRef( - function CloseButton(props, ref) { - return ; - } -); - -const Container = withBaseElementProps(View, { - className: `${HEADER_BLOCK}__container`, -}); - -export const HeaderControl: HeaderControl = () => ( - - Raven Chat - - - - -); - -HeaderControl.Container = Container; -HeaderControl.Text = HeaderText; -HeaderControl.Button = CloseButton; - -export interface HeaderControl { - (): React.JSX.Element; - Container: AIConversationElements['View']; - Button: AIConversationElements['Button']; - Text: AIConversationElements['Text']; -} diff --git a/packages/react-ai/src/components/AIConversation/views/Controls/MessagesControl.tsx b/packages/react-ai/src/components/AIConversation/views/Controls/MessagesControl.tsx index 5de1fd3f1dc..59d7d3c4b2d 100644 --- a/packages/react-ai/src/components/AIConversation/views/Controls/MessagesControl.tsx +++ b/packages/react-ai/src/components/AIConversation/views/Controls/MessagesControl.tsx @@ -62,15 +62,40 @@ const ContentContainer: typeof View = React.forwardRef( } ); -export const MessageControl: MessageControl = ({ message }) => { +const ToolContent = ({ + toolUse, +}: { + toolUse: NonNullable; +}) => { const responseComponents = React.useContext(ResponseComponentsContext); + + // For now tool use is limited to custom response components + const { name, input } = toolUse; + + if ( + !responseComponents || + !name || + !name.startsWith(RESPONSE_COMPONENT_PREFIX) + ) { + return; + } else { + const response = responseComponents[name]; + const CustomComponent = response.component; + return ; + } +}; + +export const MessageControl: MessageControl = ({ message }) => { const messageRenderer = React.useContext(MessageRendererContext); + return ( {message.content.map((content, index) => { if (content.text) { return messageRenderer?.text ? ( - messageRenderer.text({ text: content.text }) + + {messageRenderer.text({ text: content.text })} + ) : ( {content.text} @@ -78,7 +103,9 @@ export const MessageControl: MessageControl = ({ message }) => { ); } else if (content.image) { return messageRenderer?.image ? ( - messageRenderer?.image({ image: content.image }) + + {messageRenderer?.image({ image: content.image })} + ) : ( { /> ); } else if (content.toolUse) { - // For now tool use is limited to custom response components - const { name, input } = content.toolUse; - if ( - !responseComponents || - !name || - !name.startsWith(RESPONSE_COMPONENT_PREFIX) - ) { - return; - } else { - const response = responseComponents[name]; - const CustomComponent = response.component; - return ; - } + return ; } })} diff --git a/packages/react-ai/src/components/AIConversation/views/Controls/PromptControl.tsx b/packages/react-ai/src/components/AIConversation/views/Controls/PromptControl.tsx index bf12b7b8aeb..125d0a35f9b 100644 --- a/packages/react-ai/src/components/AIConversation/views/Controls/PromptControl.tsx +++ b/packages/react-ai/src/components/AIConversation/views/Controls/PromptControl.tsx @@ -4,13 +4,11 @@ import { withBaseElementProps } from '@aws-amplify/ui-react-core/elements'; import { AIConversationElements, ConversationInputContext, - MessagesContext, SuggestedPromptsContext, } from '../../context'; -import { classNames } from '@aws-amplify/ui'; import { ControlsContext } from '../../context/ControlsContext'; -const { View, Button, Text, Heading, Icon } = AIConversationElements; +const { View, Button } = AIConversationElements; const PROMPT_BLOCK = 'ai-prompts'; const PROMPT_CONTROL = `${PROMPT_BLOCK}__prompt`; @@ -21,48 +19,6 @@ const PromptCard = withBaseElementProps(Button, { type: 'button', }); -const AIIconProps = () => ({ - children: ( - <> - - - - - - - - - - ), - className: `${PROMPT_CONTROL}__icon`, - width: '40', - height: '40', - viewBox: '0 0 40 40', - fill: 'none', - xmlns: 'http://www.w3.org/2000/svg', -}); - -const AIIcon = withBaseElementProps(Icon, AIIconProps); - -const HeaderText = withBaseElementProps(Heading, { - className: `${PROMPT_CONTROL}__header`, -}); - const PromptGroupBase = withBaseElementProps(View, { className: `${PROMPT_CONTROL}__buttongroup`, }); @@ -91,15 +47,7 @@ const PromptGroup: typeof PromptGroupBase = React.forwardRef( })) } > - - {prompt.header} - - {prompt.inputText} + {prompt.component} ); })} @@ -128,32 +76,18 @@ export const PromptControl: PromptControl = () => { return ( - - How can I help you today? ); }; -export const AutoHidablePromptControl = (): JSX.Element | undefined => { - const messages = React.useContext(MessagesContext); - - if (!messages || messages.length === 0) { - return ; - } -}; - PromptControl.Container = Container; -PromptControl.Header = HeaderText; -PromptControl.Icon = AIIcon; PromptControl.PromptGroup = PromptGroup; PromptControl.PromptCard = PromptCard; export interface PromptControl { (): React.JSX.Element; Container: AIConversationElements['View']; - Header: AIConversationElements['Heading']; - Icon: AIConversationElements['Icon']; PromptGroup: AIConversationElements['View']; PromptCard: AIConversationElements['Button']; } diff --git a/packages/react-ai/src/components/AIConversation/views/Controls/__tests__/FieldControl.spec.tsx b/packages/react-ai/src/components/AIConversation/views/Controls/__tests__/FormControl.spec.tsx similarity index 94% rename from packages/react-ai/src/components/AIConversation/views/Controls/__tests__/FieldControl.spec.tsx rename to packages/react-ai/src/components/AIConversation/views/Controls/__tests__/FormControl.spec.tsx index c153227af3a..285ca8bbac7 100644 --- a/packages/react-ai/src/components/AIConversation/views/Controls/__tests__/FieldControl.spec.tsx +++ b/packages/react-ai/src/components/AIConversation/views/Controls/__tests__/FormControl.spec.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { render, screen, act } from '@testing-library/react'; import { MessagesProvider } from '../../../context/MessagesContext'; -import { FieldControl } from '../FieldControl'; +import { FormControl } from '../FormControl'; import { ConversationInputContextProvider } from '../../../context/ConversationInputContext'; import userEvent from '@testing-library/user-event'; import { SendMessageContextProvider } from '../../../context/SendMessageContext'; @@ -11,7 +11,7 @@ describe('FieldControl', () => { it('renders a FieldControl component with the correct elements', () => { const result = render( - + ); expect(result.container).toBeDefined(); @@ -30,7 +30,7 @@ describe('FieldControl', () => { it('renders FieldControl with the correct accessibility roles', () => { render( - + ); @@ -52,7 +52,7 @@ describe('FieldControl', () => { it('renders correct placeholder text in the input field', () => { const { rerender } = render( - + ); const textInput = screen.getByTestId('text-input'); @@ -70,7 +70,7 @@ describe('FieldControl', () => { }, ]} > - + ); @@ -80,7 +80,7 @@ describe('FieldControl', () => { it('disables the send button when the input field is empty', async () => { render( - + ); expect(screen.getByTestId('send-button')).toBeDisabled(); @@ -97,7 +97,7 @@ describe('FieldControl', () => { render( - + ); diff --git a/packages/react-ai/src/components/AIConversation/views/Controls/__tests__/HeaderControl.spec.tsx b/packages/react-ai/src/components/AIConversation/views/Controls/__tests__/HeaderControl.spec.tsx deleted file mode 100644 index 0b9c9198d13..00000000000 --- a/packages/react-ai/src/components/AIConversation/views/Controls/__tests__/HeaderControl.spec.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; -import { render } from '@testing-library/react'; -import { HeaderControl } from '../HeaderControl'; - -describe('HeaderControl', () => { - it('renders a HeaderControl element', () => { - const result = render(); - expect(result.container).toBeDefined(); - expect(result.findAllByText('anything')).toBeDefined(); - }); -}); diff --git a/packages/react-ai/src/components/AIConversation/views/Controls/index.ts b/packages/react-ai/src/components/AIConversation/views/Controls/index.ts index f2b999fcd15..067e27a4ccd 100644 --- a/packages/react-ai/src/components/AIConversation/views/Controls/index.ts +++ b/packages/react-ai/src/components/AIConversation/views/Controls/index.ts @@ -1,16 +1,13 @@ import { ActionsBarControl } from './ActionsBarControl'; import { AvatarControl } from './AvatarControl'; -import { HeaderControl } from './HeaderControl'; -import { FieldControl } from './FieldControl'; +import { FormControl } from './FormControl'; import { MessagesControl } from './MessagesControl'; -import { AutoHidablePromptControl, PromptControl } from './PromptControl'; +import { PromptControl } from './PromptControl'; export { ActionsBarControl, AvatarControl, - HeaderControl, - FieldControl, + FormControl, MessagesControl, PromptControl, - AutoHidablePromptControl, }; diff --git a/packages/react-ai/src/components/AIConversation/views/ConversationView.tsx b/packages/react-ai/src/components/AIConversation/views/ConversationView.tsx deleted file mode 100644 index 28750646211..00000000000 --- a/packages/react-ai/src/components/AIConversation/views/ConversationView.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import React from 'react'; -import { ViewElement as View } from '../context/elements/definitions'; -import { - AutoHidablePromptControl, - HeaderControl, - FieldControl, - MessagesControl, -} from './Controls'; - -export default function Conversation(): JSX.Element { - return ( - - - - - - - - - - - ); -} diff --git a/packages/react-ai/src/components/AIConversation/views/__tests__/ConversationView.spec.tsx b/packages/react-ai/src/components/AIConversation/views/__tests__/ConversationView.spec.tsx deleted file mode 100644 index f0e78a5125c..00000000000 --- a/packages/react-ai/src/components/AIConversation/views/__tests__/ConversationView.spec.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; -import { render } from '@testing-library/react'; -import ConversationView from '../ConversationView'; - -describe('ConversationView', () => { - it('renders a ConversationView element', () => { - expect(render().container).toBeDefined(); - }); -}); diff --git a/packages/react-ai/src/components/AIConversation/views/default/PromptList.tsx b/packages/react-ai/src/components/AIConversation/views/default/PromptList.tsx index 29eef606856..fab975e4034 100644 --- a/packages/react-ai/src/components/AIConversation/views/default/PromptList.tsx +++ b/packages/react-ai/src/components/AIConversation/views/default/PromptList.tsx @@ -22,7 +22,7 @@ export const PromptList: ControlsContextProps['PromptList'] = ({ })); }} > - {prompt.header} + {prompt.component} ); })} diff --git a/packages/react-ai/src/components/AIConversation/views/index.ts b/packages/react-ai/src/components/AIConversation/views/index.ts index adbbd2ea688..ebe2edb3cc0 100644 --- a/packages/react-ai/src/components/AIConversation/views/index.ts +++ b/packages/react-ai/src/components/AIConversation/views/index.ts @@ -1,9 +1,7 @@ -import Conversation from './ConversationView'; import { ActionsBarControl, AvatarControl, - FieldControl, - HeaderControl, + FormControl, MessagesControl, PromptControl, } from './Controls'; @@ -11,9 +9,7 @@ import { export { ActionsBarControl, AvatarControl, - Conversation, - FieldControl, - HeaderControl, + FormControl, MessagesControl, PromptControl, }; From cc12b43fc0178aa34bf5e4796f136ab64bcba2bf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 13:29:39 -0700 Subject: [PATCH 11/12] Version Packages (#5919) Co-authored-by: github-actions[bot] --- .changeset/brown-pumpkins-knock.md | 5 -- .changeset/good-planets-invite.md | 41 ------------ .changeset/heavy-dots-applaud.md | 16 ----- .changeset/rich-bags-smile.md | 19 ------ docs/package.json | 2 +- examples/angular/package.json | 2 +- examples/next/package.json | 12 ++-- examples/vue/package.json | 2 +- .../angular/projects/ui-angular/CHANGELOG.md | 9 +++ .../angular/projects/ui-angular/package.json | 4 +- .../projects/ui-angular/src/version.ts | 2 +- packages/e2e/package.json | 2 +- packages/react-ai/CHANGELOG.md | 63 +++++++++++++++++++ packages/react-ai/package.json | 8 +-- packages/react-ai/src/version.ts | 2 +- packages/react-auth/CHANGELOG.md | 12 ++++ packages/react-auth/package.json | 10 +-- packages/react-auth/src/version.ts | 2 +- packages/react-core-auth/CHANGELOG.md | 10 +++ packages/react-core-auth/package.json | 6 +- .../react-core-notifications/CHANGELOG.md | 10 +++ .../react-core-notifications/package.json | 6 +- packages/react-core/CHANGELOG.md | 9 +++ packages/react-core/package.json | 4 +- packages/react-geo/CHANGELOG.md | 9 +++ packages/react-geo/package.json | 4 +- packages/react-geo/src/version.ts | 2 +- packages/react-liveness/CHANGELOG.md | 10 +++ packages/react-liveness/package.json | 6 +- packages/react-liveness/src/version.ts | 2 +- packages/react-native-auth/CHANGELOG.md | 11 ++++ packages/react-native-auth/package.json | 8 +-- packages/react-native-auth/src/version.ts | 2 +- packages/react-native/CHANGELOG.md | 11 ++++ packages/react-native/package.json | 8 +-- packages/react-native/src/version.ts | 2 +- packages/react-notifications/CHANGELOG.md | 12 ++++ packages/react-notifications/package.json | 10 +-- packages/react-notifications/src/version.ts | 2 +- packages/react-storage/CHANGELOG.md | 11 ++++ packages/react-storage/package.json | 8 +-- packages/react-storage/src/version.ts | 2 +- packages/react/CHANGELOG.md | 12 ++++ packages/react/package.json | 6 +- packages/react/src/version.ts | 2 +- packages/ui/CHANGELOG.md | 6 ++ packages/ui/package.json | 2 +- packages/vue/CHANGELOG.md | 9 +++ packages/vue/package.json | 4 +- packages/vue/src/version.ts | 2 +- 50 files changed, 272 insertions(+), 149 deletions(-) delete mode 100644 .changeset/brown-pumpkins-knock.md delete mode 100644 .changeset/good-planets-invite.md delete mode 100644 .changeset/heavy-dots-applaud.md delete mode 100644 .changeset/rich-bags-smile.md diff --git a/.changeset/brown-pumpkins-knock.md b/.changeset/brown-pumpkins-knock.md deleted file mode 100644 index 3cfc9e06339..00000000000 --- a/.changeset/brown-pumpkins-knock.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@aws-amplify/ui-react": patch ---- - -fix(React/Authenticator): clicking on currently active tab no longer switches to the wrong tab diff --git a/.changeset/good-planets-invite.md b/.changeset/good-planets-invite.md deleted file mode 100644 index fe948afde0c..00000000000 --- a/.changeset/good-planets-invite.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -"@aws-amplify/ui-react-ai": minor ---- - - -The AIConversation component is now composable if you are using the default component or the headless component using `createAIConversation()`. There are 4 parts: - -* Provider: provides all the necessary data/handlers for the composable components -* Messages: the message history for the conversation -* DefaultMessage: contains an optional welcome message and prompt suggestions, only shown if no messages present -* Form: the form for sending messages, includes the text input, submit button, and attachments - -```jsx -function Chat() { - const [ - { - data: { messages }, - isLoading, - }, - sendMessage, - ] = useAIConversation('pirateChat'); - - return ( - - - - - - - - - - - - ); -} -``` diff --git a/.changeset/heavy-dots-applaud.md b/.changeset/heavy-dots-applaud.md deleted file mode 100644 index 26b303ed917..00000000000 --- a/.changeset/heavy-dots-applaud.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -"@aws-amplify/ui-react-ai": minor ---- - -feat(ai): add message renderer - -```tsx - {text}, - }} -/> -``` diff --git a/.changeset/rich-bags-smile.md b/.changeset/rich-bags-smile.md deleted file mode 100644 index 8a8ddcd10a7..00000000000 --- a/.changeset/rich-bags-smile.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -"@aws-amplify/ui-angular": patch -"@aws-amplify/ui-react-ai": patch -"@aws-amplify/ui-react-auth": patch -"@aws-amplify/ui-react-core-auth": patch -"@aws-amplify/ui-react-core-notifications": patch -"@aws-amplify/ui-react-core": patch -"@aws-amplify/ui-react-geo": patch -"@aws-amplify/ui-react-liveness": patch -"@aws-amplify/ui-react-native-auth": patch -"@aws-amplify/ui-react-native": patch -"@aws-amplify/ui-react-notifications": patch -"@aws-amplify/ui-react-storage": patch -"@aws-amplify/ui-react": patch -"@aws-amplify/ui": patch -"@aws-amplify/ui-vue": patch ---- - -chore(ai): adding UA string for AIConversation diff --git a/docs/package.json b/docs/package.json index aaa4d0762e5..615497cec02 100644 --- a/docs/package.json +++ b/docs/package.json @@ -23,7 +23,7 @@ "test:links": "node --require esbuild-register ./scripts/link-checker-puppeteer.ts" }, "dependencies": { - "@aws-amplify/ui-react": "6.5.4", + "@aws-amplify/ui-react": "6.5.5", "@docsearch/react": "3", "@mdx-js/loader": "^2.1.0", "@mdx-js/mdx": "^2.1.0", diff --git a/examples/angular/package.json b/examples/angular/package.json index ab68eaa55d2..ea030993780 100644 --- a/examples/angular/package.json +++ b/examples/angular/package.json @@ -20,7 +20,7 @@ "@angular/platform-browser": "^14.3.0", "@angular/platform-browser-dynamic": "^14.3.0", "@angular/router": "^14.3.0", - "@aws-amplify/ui-angular": "^5.0.29", + "@aws-amplify/ui-angular": "^5.0.30", "rxjs": "~6.6.0", "tslib": "^2.0.0", "zone.js": "~0.11.4" diff --git a/examples/next/package.json b/examples/next/package.json index e99850caa96..97b7f481e58 100644 --- a/examples/next/package.json +++ b/examples/next/package.json @@ -10,12 +10,12 @@ "lint": "next lint" }, "dependencies": { - "@aws-amplify/ui-react": "^6.5.4", - "@aws-amplify/ui-react-ai": "0.3.2", - "@aws-amplify/ui-react-geo": "^2.0.29", - "@aws-amplify/ui-react-liveness": "^3.1.14", - "@aws-amplify/ui-react-notifications": "^2.0.33", - "@aws-amplify/ui-react-storage": "^3.3.8", + "@aws-amplify/ui-react": "^6.5.5", + "@aws-amplify/ui-react-ai": "0.4.0", + "@aws-amplify/ui-react-geo": "^2.0.30", + "@aws-amplify/ui-react-liveness": "^3.1.15", + "@aws-amplify/ui-react-notifications": "^2.0.34", + "@aws-amplify/ui-react-storage": "^3.3.9", "@aws-sdk/credential-providers": "^3.370.0", "next": "^14.2.10", "next-global-css": "^1.1.1", diff --git a/examples/vue/package.json b/examples/vue/package.json index 2811268b38b..a8451357c1d 100644 --- a/examples/vue/package.json +++ b/examples/vue/package.json @@ -11,7 +11,7 @@ "start": "vite preview --port 3000" }, "dependencies": { - "@aws-amplify/ui-vue": "^4.2.21", + "@aws-amplify/ui-vue": "^4.2.22", "vue": "^3.0.5", "vue-router": "4" }, diff --git a/packages/angular/projects/ui-angular/CHANGELOG.md b/packages/angular/projects/ui-angular/CHANGELOG.md index 3d146ce9ed9..c49fe339015 100644 --- a/packages/angular/projects/ui-angular/CHANGELOG.md +++ b/packages/angular/projects/ui-angular/CHANGELOG.md @@ -1,5 +1,14 @@ # @aws-amplify/ui-angular +## 5.0.30 + +### Patch Changes + +- [#5917](https://github.com/aws-amplify/amplify-ui/pull/5917) [`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - chore(ai): adding UA string for AIConversation + +- Updated dependencies [[`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811)]: + - @aws-amplify/ui@6.6.5 + ## 5.0.29 ### Patch Changes diff --git a/packages/angular/projects/ui-angular/package.json b/packages/angular/projects/ui-angular/package.json index c0ab2fccb47..67c50e521fb 100644 --- a/packages/angular/projects/ui-angular/package.json +++ b/packages/angular/projects/ui-angular/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-angular", - "version": "5.0.29", + "version": "5.0.30", "scripts": { "build": "yarn --cwd ../../ build", "dev": "yarn --cwd ../../ dev", @@ -20,7 +20,7 @@ "rxjs": "^6.5.3 || ^7.4.0" }, "dependencies": { - "@aws-amplify/ui": "6.6.4", + "@aws-amplify/ui": "6.6.5", "nanoid": "3.1.31", "qrcode": "1.5.0", "tslib": "^2.5.2", diff --git a/packages/angular/projects/ui-angular/src/version.ts b/packages/angular/projects/ui-angular/src/version.ts index 7e7f682925c..defe995d6d7 100644 --- a/packages/angular/projects/ui-angular/src/version.ts +++ b/packages/angular/projects/ui-angular/src/version.ts @@ -1 +1 @@ -export const VERSION = '5.0.29'; +export const VERSION = '5.0.30'; diff --git a/packages/e2e/package.json b/packages/e2e/package.json index ba8353e27d0..e6e4df23415 100644 --- a/packages/e2e/package.json +++ b/packages/e2e/package.json @@ -29,7 +29,7 @@ ] }, "devDependencies": { - "@aws-amplify/ui": "^6.6.4", + "@aws-amplify/ui": "^6.6.5", "@badeball/cypress-cucumber-preprocessor": "^18.0.6", "@bahmutov/cypress-esbuild-preprocessor": "~2.2.0", "@cucumber/cucumber": "^10.0.1", diff --git a/packages/react-ai/CHANGELOG.md b/packages/react-ai/CHANGELOG.md index eaaa2628dfa..09383283402 100644 --- a/packages/react-ai/CHANGELOG.md +++ b/packages/react-ai/CHANGELOG.md @@ -1,5 +1,68 @@ # @aws-amplify/ui-react-ai +## 0.4.0 + +### Minor Changes + +- [#5924](https://github.com/aws-amplify/amplify-ui/pull/5924) [`d65cea0d0`](https://github.com/aws-amplify/amplify-ui/commit/d65cea0d0475aacb4ea0ac9c83278a62356f6421) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - The AIConversation component is now composable if you are using the default component or the headless component using `createAIConversation()`. There are 4 parts: + + - Provider: provides all the necessary data/handlers for the composable components + - Messages: the message history for the conversation + - DefaultMessage: contains an optional welcome message and prompt suggestions, only shown if no messages present + - Form: the form for sending messages, includes the text input, submit button, and attachments + + ```jsx + function Chat() { + const [ + { + data: { messages }, + isLoading, + }, + sendMessage, + ] = useAIConversation('pirateChat'); + + return ( + + + + + + + + + + + + ); + } + ``` + +- [#5873](https://github.com/aws-amplify/amplify-ui/pull/5873) [`3a697ea5c`](https://github.com/aws-amplify/amplify-ui/commit/3a697ea5cdb81dd43988abbd2a336440713a8e31) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - feat(ai): add message renderer + + ```tsx + {text}, + }} + /> + ``` + +### Patch Changes + +- [#5917](https://github.com/aws-amplify/amplify-ui/pull/5917) [`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - chore(ai): adding UA string for AIConversation + +- Updated dependencies [[`6fea94b89`](https://github.com/aws-amplify/amplify-ui/commit/6fea94b890d9d497a3f13e189ea0b52e8dcdadb8), [`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811)]: + - @aws-amplify/ui-react@6.5.5 + - @aws-amplify/ui-react-core@3.0.29 + - @aws-amplify/ui@6.6.5 + ## 0.3.2 ### Patch Changes diff --git a/packages/react-ai/package.json b/packages/react-ai/package.json index 1e203d13f7c..05244d7f7da 100644 --- a/packages/react-ai/package.json +++ b/packages/react-ai/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-ai", - "version": "0.3.2", + "version": "0.4.0", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -48,9 +48,9 @@ "react-dom": "^16.14.0 || ^17.0 || ^18.0" }, "dependencies": { - "@aws-amplify/ui": "^6.6.4", - "@aws-amplify/ui-react": "^6.5.4", - "@aws-amplify/ui-react-core": "^3.0.28" + "@aws-amplify/ui": "^6.6.5", + "@aws-amplify/ui-react": "^6.5.5", + "@aws-amplify/ui-react-core": "^3.0.29" }, "devDependencies": { "@types/jest-when": "^3.5.0", diff --git a/packages/react-ai/src/version.ts b/packages/react-ai/src/version.ts index 7195b1090e2..465e390cf8d 100644 --- a/packages/react-ai/src/version.ts +++ b/packages/react-ai/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.3.2'; +export const VERSION = '0.4.0'; diff --git a/packages/react-auth/CHANGELOG.md b/packages/react-auth/CHANGELOG.md index b28dd65ab82..d33a05403d6 100644 --- a/packages/react-auth/CHANGELOG.md +++ b/packages/react-auth/CHANGELOG.md @@ -1,5 +1,17 @@ # @aws-amplify/ui-react-auth +## 0.0.36 + +### Patch Changes + +- [#5917](https://github.com/aws-amplify/amplify-ui/pull/5917) [`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - chore(ai): adding UA string for AIConversation + +- Updated dependencies [[`6fea94b89`](https://github.com/aws-amplify/amplify-ui/commit/6fea94b890d9d497a3f13e189ea0b52e8dcdadb8), [`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811)]: + - @aws-amplify/ui-react@6.5.5 + - @aws-amplify/ui-react-core-auth@0.0.31 + - @aws-amplify/ui-react-core@3.0.29 + - @aws-amplify/ui@6.6.5 + ## 0.0.35 ### Patch Changes diff --git a/packages/react-auth/package.json b/packages/react-auth/package.json index ea607c6f624..30f596d44eb 100644 --- a/packages/react-auth/package.json +++ b/packages/react-auth/package.json @@ -1,7 +1,7 @@ { "name": "@aws-amplify/ui-react-auth", "private": true, - "version": "0.0.35", + "version": "0.0.36", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -40,10 +40,10 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "6.6.4", - "@aws-amplify/ui-react": "6.5.4", - "@aws-amplify/ui-react-core": "3.0.28", - "@aws-amplify/ui-react-core-auth": "0.0.30", + "@aws-amplify/ui": "6.6.5", + "@aws-amplify/ui-react": "6.5.5", + "@aws-amplify/ui-react-core": "3.0.29", + "@aws-amplify/ui-react-core-auth": "0.0.31", "@xstate/react": "3.2.2", "lodash": "4.17.21", "tslib": "^2.5.2" diff --git a/packages/react-auth/src/version.ts b/packages/react-auth/src/version.ts index 2af0b90cd6c..a39fbfc6e73 100644 --- a/packages/react-auth/src/version.ts +++ b/packages/react-auth/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.0.35'; +export const VERSION = '0.0.36'; diff --git a/packages/react-core-auth/CHANGELOG.md b/packages/react-core-auth/CHANGELOG.md index 0d4fd323b59..23682f044b2 100644 --- a/packages/react-core-auth/CHANGELOG.md +++ b/packages/react-core-auth/CHANGELOG.md @@ -1,5 +1,15 @@ # @aws-amplify/ui-react-core-auth +## 0.0.31 + +### Patch Changes + +- [#5917](https://github.com/aws-amplify/amplify-ui/pull/5917) [`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - chore(ai): adding UA string for AIConversation + +- Updated dependencies [[`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811)]: + - @aws-amplify/ui-react-core@3.0.29 + - @aws-amplify/ui@6.6.5 + ## 0.0.30 ### Patch Changes diff --git a/packages/react-core-auth/package.json b/packages/react-core-auth/package.json index 822916397f7..01f282b3c34 100644 --- a/packages/react-core-auth/package.json +++ b/packages/react-core-auth/package.json @@ -1,7 +1,7 @@ { "name": "@aws-amplify/ui-react-core-auth", "private": true, - "version": "0.0.30", + "version": "0.0.31", "main": "dist/index.js", "module": "dist/esm/index.mjs", "react-native": "src/index.ts", @@ -33,8 +33,8 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "6.6.4", - "@aws-amplify/ui-react-core": "3.0.28", + "@aws-amplify/ui": "6.6.5", + "@aws-amplify/ui-react-core": "3.0.29", "@xstate/react": "3.2.2", "lodash": "4.17.21", "qrcode": "1.5.0", diff --git a/packages/react-core-notifications/CHANGELOG.md b/packages/react-core-notifications/CHANGELOG.md index 1ccce03a13f..03c0fcac84e 100644 --- a/packages/react-core-notifications/CHANGELOG.md +++ b/packages/react-core-notifications/CHANGELOG.md @@ -1,5 +1,15 @@ # @aws-amplify/ui-react-core-notifications +## 2.0.29 + +### Patch Changes + +- [#5917](https://github.com/aws-amplify/amplify-ui/pull/5917) [`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - chore(ai): adding UA string for AIConversation + +- Updated dependencies [[`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811)]: + - @aws-amplify/ui-react-core@3.0.29 + - @aws-amplify/ui@6.6.5 + ## 2.0.28 ### Patch Changes diff --git a/packages/react-core-notifications/package.json b/packages/react-core-notifications/package.json index 466b49305fb..7370977797f 100644 --- a/packages/react-core-notifications/package.json +++ b/packages/react-core-notifications/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-core-notifications", - "version": "2.0.28", + "version": "2.0.29", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -35,8 +35,8 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "6.6.4", - "@aws-amplify/ui-react-core": "3.0.28" + "@aws-amplify/ui": "6.6.5", + "@aws-amplify/ui-react-core": "3.0.29" }, "peerDependencies": { "aws-amplify": "^6.6.5", diff --git a/packages/react-core/CHANGELOG.md b/packages/react-core/CHANGELOG.md index 5f1106c591a..9284573a677 100644 --- a/packages/react-core/CHANGELOG.md +++ b/packages/react-core/CHANGELOG.md @@ -1,5 +1,14 @@ # @aws-amplify/ui-react-core +## 3.0.29 + +### Patch Changes + +- [#5917](https://github.com/aws-amplify/amplify-ui/pull/5917) [`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - chore(ai): adding UA string for AIConversation + +- Updated dependencies [[`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811)]: + - @aws-amplify/ui@6.6.5 + ## 3.0.28 ### Patch Changes diff --git a/packages/react-core/package.json b/packages/react-core/package.json index 57c6edf4a2b..9dddc69bc53 100644 --- a/packages/react-core/package.json +++ b/packages/react-core/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-core", - "version": "3.0.28", + "version": "3.0.29", "main": "dist/index.js", "module": "dist/esm/index.mjs", "react-native": "src/index.ts", @@ -40,7 +40,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "6.6.4", + "@aws-amplify/ui": "6.6.5", "@xstate/react": "^3.2.2", "lodash": "4.17.21", "react-hook-form": "^7.43.5", diff --git a/packages/react-geo/CHANGELOG.md b/packages/react-geo/CHANGELOG.md index 9e337efbfcf..36b931f0088 100644 --- a/packages/react-geo/CHANGELOG.md +++ b/packages/react-geo/CHANGELOG.md @@ -1,5 +1,14 @@ # @aws-amplify/ui-react-geo +## 2.0.30 + +### Patch Changes + +- [#5917](https://github.com/aws-amplify/amplify-ui/pull/5917) [`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - chore(ai): adding UA string for AIConversation + +- Updated dependencies [[`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811)]: + - @aws-amplify/ui-react-core@3.0.29 + ## 2.0.29 ### Patch Changes diff --git a/packages/react-geo/package.json b/packages/react-geo/package.json index e5ac85c6f31..cf28a9d0d0b 100644 --- a/packages/react-geo/package.json +++ b/packages/react-geo/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-geo", - "version": "2.0.29", + "version": "2.0.30", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -39,7 +39,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui-react-core": "3.0.28", + "@aws-amplify/ui-react-core": "3.0.29", "mapbox-gl": "1.13.1", "maplibre-gl": "2.1.9", "maplibre-gl-js-amplify": "^4.0.1", diff --git a/packages/react-geo/src/version.ts b/packages/react-geo/src/version.ts index 44cac1e9580..f92de8475b1 100644 --- a/packages/react-geo/src/version.ts +++ b/packages/react-geo/src/version.ts @@ -1 +1 @@ -export const VERSION = '2.0.29'; +export const VERSION = '2.0.30'; diff --git a/packages/react-liveness/CHANGELOG.md b/packages/react-liveness/CHANGELOG.md index ece40f4ea8c..f63f8b98513 100644 --- a/packages/react-liveness/CHANGELOG.md +++ b/packages/react-liveness/CHANGELOG.md @@ -1,5 +1,15 @@ # @aws-amplify/ui-react-liveness +## 3.1.15 + +### Patch Changes + +- [#5917](https://github.com/aws-amplify/amplify-ui/pull/5917) [`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - chore(ai): adding UA string for AIConversation + +- Updated dependencies [[`6fea94b89`](https://github.com/aws-amplify/amplify-ui/commit/6fea94b890d9d497a3f13e189ea0b52e8dcdadb8), [`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811)]: + - @aws-amplify/ui-react@6.5.5 + - @aws-amplify/ui@6.6.5 + ## 3.1.14 ### Patch Changes diff --git a/packages/react-liveness/package.json b/packages/react-liveness/package.json index ba7b79bed44..676422f030b 100644 --- a/packages/react-liveness/package.json +++ b/packages/react-liveness/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-liveness", - "version": "3.1.14", + "version": "3.1.15", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -48,8 +48,8 @@ "react-dom": "^16.14.0 || ^17.0 || ^18.0" }, "dependencies": { - "@aws-amplify/ui": "6.6.4", - "@aws-amplify/ui-react": "6.5.4", + "@aws-amplify/ui": "6.6.5", + "@aws-amplify/ui-react": "6.5.5", "@aws-sdk/client-rekognitionstreaming": "3.621.0", "@aws-sdk/util-format-url": "3.609.0", "@smithy/eventstream-serde-browser": "^2.0.4", diff --git a/packages/react-liveness/src/version.ts b/packages/react-liveness/src/version.ts index edd491f67b3..844181693dc 100644 --- a/packages/react-liveness/src/version.ts +++ b/packages/react-liveness/src/version.ts @@ -1 +1 @@ -export const VERSION = '3.1.14'; +export const VERSION = '3.1.15'; diff --git a/packages/react-native-auth/CHANGELOG.md b/packages/react-native-auth/CHANGELOG.md index c24f1f8e8df..6a5f0146889 100644 --- a/packages/react-native-auth/CHANGELOG.md +++ b/packages/react-native-auth/CHANGELOG.md @@ -1,5 +1,16 @@ # @aws-amplify/ui-react-native-auth +## 0.0.34 + +### Patch Changes + +- [#5917](https://github.com/aws-amplify/amplify-ui/pull/5917) [`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - chore(ai): adding UA string for AIConversation + +- Updated dependencies [[`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811)]: + - @aws-amplify/ui-react-core-auth@0.0.31 + - @aws-amplify/ui-react-native@2.2.16 + - @aws-amplify/ui@6.6.5 + ## 0.0.33 ### Patch Changes diff --git a/packages/react-native-auth/package.json b/packages/react-native-auth/package.json index 99d8828de7b..bd1cfe5221a 100644 --- a/packages/react-native-auth/package.json +++ b/packages/react-native-auth/package.json @@ -1,7 +1,7 @@ { "name": "@aws-amplify/ui-react-native-auth", "private": true, - "version": "0.0.33", + "version": "0.0.34", "main": "lib/index.js", "module": "dist/index.js", "react-native": "src/index.ts", @@ -28,9 +28,9 @@ "metro-react-native-babel-preset": "^0.77.0" }, "dependencies": { - "@aws-amplify/ui": "6.6.4", - "@aws-amplify/ui-react-core-auth": "0.0.30", - "@aws-amplify/ui-react-native": "2.2.15", + "@aws-amplify/ui": "6.6.5", + "@aws-amplify/ui-react-core-auth": "0.0.31", + "@aws-amplify/ui-react-native": "2.2.16", "qrcode": "1.5.0" }, "peerDependencies": { diff --git a/packages/react-native-auth/src/version.ts b/packages/react-native-auth/src/version.ts index 1b7f4860781..74430b563e8 100644 --- a/packages/react-native-auth/src/version.ts +++ b/packages/react-native-auth/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.0.33'; +export const VERSION = '0.0.34'; diff --git a/packages/react-native/CHANGELOG.md b/packages/react-native/CHANGELOG.md index d1020a6716f..fdb204a1482 100644 --- a/packages/react-native/CHANGELOG.md +++ b/packages/react-native/CHANGELOG.md @@ -1,5 +1,16 @@ # @aws-amplify/ui-react-native +## 2.2.16 + +### Patch Changes + +- [#5917](https://github.com/aws-amplify/amplify-ui/pull/5917) [`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - chore(ai): adding UA string for AIConversation + +- Updated dependencies [[`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811)]: + - @aws-amplify/ui-react-core-notifications@2.0.29 + - @aws-amplify/ui-react-core@3.0.29 + - @aws-amplify/ui@6.6.5 + ## 2.2.15 ### Patch Changes diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 553d86fe0ea..8114094acf8 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-native", - "version": "2.2.15", + "version": "2.2.16", "main": "lib/index.js", "module": "dist/index.js", "react-native": "src/index.ts", @@ -30,9 +30,9 @@ "react-native-safe-area-context": "^4.7.3" }, "dependencies": { - "@aws-amplify/ui": "6.6.4", - "@aws-amplify/ui-react-core": "3.0.28", - "@aws-amplify/ui-react-core-notifications": "2.0.28" + "@aws-amplify/ui": "6.6.5", + "@aws-amplify/ui-react-core": "3.0.29", + "@aws-amplify/ui-react-core-notifications": "2.0.29" }, "peerDependencies": { "aws-amplify": "^6.6.5", diff --git a/packages/react-native/src/version.ts b/packages/react-native/src/version.ts index 9ce86091d7b..eab1605ef31 100644 --- a/packages/react-native/src/version.ts +++ b/packages/react-native/src/version.ts @@ -1 +1 @@ -export const VERSION = '2.2.15'; +export const VERSION = '2.2.16'; diff --git a/packages/react-notifications/CHANGELOG.md b/packages/react-notifications/CHANGELOG.md index b7498a3a582..9f2af5e5a2b 100644 --- a/packages/react-notifications/CHANGELOG.md +++ b/packages/react-notifications/CHANGELOG.md @@ -1,5 +1,17 @@ # @aws-amplify/ui-react-notifications +## 2.0.34 + +### Patch Changes + +- [#5917](https://github.com/aws-amplify/amplify-ui/pull/5917) [`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - chore(ai): adding UA string for AIConversation + +- Updated dependencies [[`6fea94b89`](https://github.com/aws-amplify/amplify-ui/commit/6fea94b890d9d497a3f13e189ea0b52e8dcdadb8), [`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811)]: + - @aws-amplify/ui-react@6.5.5 + - @aws-amplify/ui-react-core-notifications@2.0.29 + - @aws-amplify/ui-react-core@3.0.29 + - @aws-amplify/ui@6.6.5 + ## 2.0.33 ### Patch Changes diff --git a/packages/react-notifications/package.json b/packages/react-notifications/package.json index 4ad7e465448..94a1aaea665 100644 --- a/packages/react-notifications/package.json +++ b/packages/react-notifications/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-notifications", - "version": "2.0.33", + "version": "2.0.34", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -39,10 +39,10 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "6.6.4", - "@aws-amplify/ui-react": "6.5.4", - "@aws-amplify/ui-react-core": "3.0.28", - "@aws-amplify/ui-react-core-notifications": "2.0.28", + "@aws-amplify/ui": "6.6.5", + "@aws-amplify/ui-react": "6.5.5", + "@aws-amplify/ui-react-core": "3.0.29", + "@aws-amplify/ui-react-core-notifications": "2.0.29", "tinycolor2": "1.4.2" }, "peerDependencies": { diff --git a/packages/react-notifications/src/version.ts b/packages/react-notifications/src/version.ts index 48c07983203..e527a2c3319 100644 --- a/packages/react-notifications/src/version.ts +++ b/packages/react-notifications/src/version.ts @@ -1 +1 @@ -export const VERSION = '2.0.33'; +export const VERSION = '2.0.34'; diff --git a/packages/react-storage/CHANGELOG.md b/packages/react-storage/CHANGELOG.md index 3d09dbac9a9..9ee71700d4b 100644 --- a/packages/react-storage/CHANGELOG.md +++ b/packages/react-storage/CHANGELOG.md @@ -1,5 +1,16 @@ # @aws-amplify/ui-react-storage +## 3.3.9 + +### Patch Changes + +- [#5917](https://github.com/aws-amplify/amplify-ui/pull/5917) [`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - chore(ai): adding UA string for AIConversation + +- Updated dependencies [[`6fea94b89`](https://github.com/aws-amplify/amplify-ui/commit/6fea94b890d9d497a3f13e189ea0b52e8dcdadb8), [`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811)]: + - @aws-amplify/ui-react@6.5.5 + - @aws-amplify/ui-react-core@3.0.29 + - @aws-amplify/ui@6.6.5 + ## 3.3.8 ### Patch Changes diff --git a/packages/react-storage/package.json b/packages/react-storage/package.json index 3b9b9de913b..b253f61ea92 100644 --- a/packages/react-storage/package.json +++ b/packages/react-storage/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-storage", - "version": "3.3.8", + "version": "3.3.9", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -39,9 +39,9 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "6.6.4", - "@aws-amplify/ui-react": "6.5.4", - "@aws-amplify/ui-react-core": "3.0.28", + "@aws-amplify/ui": "6.6.5", + "@aws-amplify/ui-react": "6.5.5", + "@aws-amplify/ui-react-core": "3.0.29", "lodash": "4.17.21", "tslib": "^2.5.2" }, diff --git a/packages/react-storage/src/version.ts b/packages/react-storage/src/version.ts index 2d1e187016d..564971b4332 100644 --- a/packages/react-storage/src/version.ts +++ b/packages/react-storage/src/version.ts @@ -1 +1 @@ -export const VERSION = '3.3.8'; +export const VERSION = '3.3.9'; diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 2ed4f3cf7be..773b92cda21 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,17 @@ # @aws-amplify/ui-react +## 6.5.5 + +### Patch Changes + +- [#5912](https://github.com/aws-amplify/amplify-ui/pull/5912) [`6fea94b89`](https://github.com/aws-amplify/amplify-ui/commit/6fea94b890d9d497a3f13e189ea0b52e8dcdadb8) Thanks [@hbuchel](https://github.com/hbuchel)! - fix(React/Authenticator): clicking on currently active tab no longer switches to the wrong tab + +- [#5917](https://github.com/aws-amplify/amplify-ui/pull/5917) [`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - chore(ai): adding UA string for AIConversation + +- Updated dependencies [[`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811)]: + - @aws-amplify/ui-react-core@3.0.29 + - @aws-amplify/ui@6.6.5 + ## 6.5.4 ### Patch Changes diff --git a/packages/react/package.json b/packages/react/package.json index 1b2361ed5c1..6ee354d0557 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react", - "version": "6.5.4", + "version": "6.5.5", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -55,8 +55,8 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "6.6.4", - "@aws-amplify/ui-react-core": "3.0.28", + "@aws-amplify/ui": "6.6.5", + "@aws-amplify/ui-react-core": "3.0.29", "@radix-ui/react-direction": "1.0.0", "@radix-ui/react-dropdown-menu": "1.0.0", "@radix-ui/react-slider": "1.0.0", diff --git a/packages/react/src/version.ts b/packages/react/src/version.ts index 9c61130162b..10cc83bf501 100644 --- a/packages/react/src/version.ts +++ b/packages/react/src/version.ts @@ -1 +1 @@ -export const VERSION = '6.5.4'; +export const VERSION = '6.5.5'; diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index fd8c5df2ed8..8d75274711d 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -1,5 +1,11 @@ # @aws-amplify/ui +## 6.6.5 + +### Patch Changes + +- [#5917](https://github.com/aws-amplify/amplify-ui/pull/5917) [`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - chore(ai): adding UA string for AIConversation + ## 6.6.4 ### Patch Changes diff --git a/packages/ui/package.json b/packages/ui/package.json index d259e4d93e0..70c86d5bb61 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui", - "version": "6.6.4", + "version": "6.6.5", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { diff --git a/packages/vue/CHANGELOG.md b/packages/vue/CHANGELOG.md index 364bb770958..eda33eabd6c 100644 --- a/packages/vue/CHANGELOG.md +++ b/packages/vue/CHANGELOG.md @@ -1,5 +1,14 @@ # @aws-amplify/ui-vue +## 4.2.22 + +### Patch Changes + +- [#5917](https://github.com/aws-amplify/amplify-ui/pull/5917) [`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - chore(ai): adding UA string for AIConversation + +- Updated dependencies [[`3655af2be`](https://github.com/aws-amplify/amplify-ui/commit/3655af2be54733d364e71d3c7f86f32d7bbcf811)]: + - @aws-amplify/ui@6.6.5 + ## 4.2.21 ### Patch Changes diff --git a/packages/vue/package.json b/packages/vue/package.json index 5bb6c027df0..4304217b710 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-vue", - "version": "4.2.21", + "version": "4.2.22", "type": "module", "main": "dist/index.cjs", "module": "dist/index.js", @@ -38,7 +38,7 @@ "typecheck": "vue-tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "6.6.4", + "@aws-amplify/ui": "6.6.5", "@vueuse/core": "7.5.5", "@xstate/vue": "0.8.1", "nanoid": "3.1.31", diff --git a/packages/vue/src/version.ts b/packages/vue/src/version.ts index 8e3573157a7..7f36832be53 100644 --- a/packages/vue/src/version.ts +++ b/packages/vue/src/version.ts @@ -1 +1 @@ -export const VERSION = '4.2.21'; +export const VERSION = '4.2.22'; From aae53b336539788c6a7ff6c6804de8b9738761d4 Mon Sep 17 00:00:00 2001 From: Scott Rees <6165315+reesscot@users.noreply.github.com> Date: Wed, 23 Oct 2024 13:51:46 -0700 Subject: [PATCH 12/12] chore(deps): bump http-proxy-middleware from 2.0.6 to 2.0.7 (#5948) Bumps [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) from 2.0.6 to 2.0.7. - [Release notes](https://github.com/chimurai/http-proxy-middleware/releases) - [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/v2.0.7/CHANGELOG.md) - [Commits](https://github.com/chimurai/http-proxy-middleware/compare/v2.0.6...v2.0.7) --- updated-dependencies: - dependency-name: http-proxy-middleware dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9839269129f..dd3579a6b43 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17849,9 +17849,9 @@ http-proxy-agent@^7.0.0, http-proxy-agent@^7.0.1: debug "^4.3.4" http-proxy-middleware@^2.0.3: - version "2.0.6" - resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz#e1a4dd6979572c7ab5a4e4b55095d1f32a74963f" - integrity sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw== + version "2.0.7" + resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz#915f236d92ae98ef48278a95dedf17e991936ec6" + integrity sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA== dependencies: "@types/http-proxy" "^1.17.8" http-proxy "^1.18.1"