Repository: awslabs/aws-lex-web-ui Branch: master Commit: 40eb7ca44dce Files: 162 Total size: 10.0 MB Directory structure: gitextract_vkd5losq/ ├── .eslintrc.js ├── .gitattributes ├── .gitignore ├── .npmignore ├── CHANGELOG.md ├── LICENSE ├── Makefile ├── NOTICE ├── README-connect-live-chat.md ├── README-css-style.md ├── README-file-upload.md ├── README-qbusiness.md ├── README-streaming-responses.md ├── README.md ├── build/ │ ├── Makefile │ ├── copy-assets.js │ ├── create-custom-css.js │ ├── create-iframe-snippet-file.sh │ ├── release.sh │ ├── update-lex-web-ui-config.js │ └── upload-bootstrap.sh ├── config/ │ ├── base.env.js │ ├── dist.env.js │ ├── env.mk │ ├── full.env.js │ ├── index.js │ └── utils/ │ └── merge-config.js ├── dist/ │ ├── 3.5.13_dist_vue.global.prod.js │ ├── Makefile │ ├── aws-lex-web-ui.css │ ├── custom-chatbot-style.css │ ├── index.html │ ├── initiate-loader.js │ ├── lex-web-ui-loader.css │ ├── lex-web-ui-loader.js │ ├── lex-web-ui.css │ ├── lex-web-ui.js │ ├── material_icons.css │ ├── parent.html │ └── wav-worker.js ├── example-css/ │ ├── bright-yellow.css │ ├── coral-pink.css │ ├── dark-mode-theme.css │ ├── elegant-purple-theme.css │ ├── forest-green.css │ ├── professional-blue.css │ ├── sky-blue.css │ └── sunset-orange.css ├── lex-web-ui/ │ ├── .browserslistrc │ ├── .editorconfig │ ├── .eslintignore │ ├── .eslintrc.cjs │ ├── .gitignore │ ├── .sassrc.js │ ├── README.md │ ├── READMECONFIGSCREENS.md │ ├── current/ │ │ ├── user-custom-chatbot-style.css │ │ └── user-lex-web-ui-loader-config.json │ ├── index.html │ ├── package.json │ ├── plugins/ │ │ ├── asset-handler-plugin.js │ │ └── banner-plugin.js │ ├── public/ │ │ ├── img/ │ │ │ └── note.md │ │ └── index.html │ ├── scripts/ │ │ └── post-build-css.js │ ├── src/ │ │ ├── App.vue │ │ ├── LexApp.vue │ │ ├── assets/ │ │ │ ├── css-overrides.css │ │ │ └── silent.ogg │ │ ├── components/ │ │ │ ├── InputContainer.vue │ │ │ ├── LexWeb.vue │ │ │ ├── Message.vue │ │ │ ├── MessageList.vue │ │ │ ├── MessageLoading.vue │ │ │ ├── MessageText.vue │ │ │ ├── MinButton.vue │ │ │ ├── RecorderStatus.vue │ │ │ ├── ResponseCard.vue │ │ │ └── ToolbarContainer.vue │ │ ├── config/ │ │ │ ├── .gitattributes │ │ │ ├── config.awstest.json │ │ │ ├── config.current.json │ │ │ ├── config.dev.json │ │ │ ├── config.prod.json │ │ │ ├── config.test.json │ │ │ └── index.js │ │ ├── init.js │ │ ├── lex-web-ui.js │ │ ├── lib/ │ │ │ └── lex/ │ │ │ ├── client.js │ │ │ ├── recorder.js │ │ │ └── wav-worker.js │ │ ├── main.js │ │ ├── router/ │ │ │ └── index.js │ │ └── store/ │ │ ├── actions.js │ │ ├── getters.js │ │ ├── index.js │ │ ├── live-chat-handlers.js │ │ ├── mutations.js │ │ ├── recorder-handlers.js │ │ ├── sigv4-handlers.js │ │ ├── state.js │ │ └── talkdesk-live-chat-handlers.js │ ├── test/ │ │ ├── e2e/ │ │ │ ├── custom-assertions/ │ │ │ │ └── elementCount.js │ │ │ ├── nightwatch.conf.js │ │ │ ├── runner.js │ │ │ └── specs/ │ │ │ └── test.js │ │ ├── integration/ │ │ │ ├── build-modes.test.js │ │ │ ├── functionality.test.js │ │ │ └── jest.config.js │ │ └── unit/ │ │ ├── .eslintrc │ │ ├── index.js │ │ ├── karma.conf.js │ │ └── specs/ │ │ ├── InputContainer.spec.js │ │ ├── LexWeb.spec.js │ │ ├── Message.spec.js │ │ ├── MessageList.spec.js │ │ ├── RecorderStatus.spec.js │ │ ├── lex-web-ui.spec.js │ │ └── store.spec.js │ └── vite.config.js ├── package.json ├── postcss.config.js ├── server.js ├── src/ │ ├── README.md │ ├── config/ │ │ ├── .gitattributes │ │ ├── default-lex-web-ui-loader-config.json │ │ └── lex-web-ui-loader-config.json │ ├── dependencies/ │ │ ├── 3.5.13_dist_vue.global.prod.js │ │ ├── initiate-loader.js │ │ └── material_icons.css │ ├── initiate-chat-lambda/ │ │ └── index.js │ ├── lex-web-ui-loader/ │ │ ├── css/ │ │ │ ├── lex-web-ui-fullpage.css │ │ │ └── lex-web-ui-iframe.css │ │ └── js/ │ │ ├── defaults/ │ │ │ ├── dependencies.js │ │ │ ├── lex-web-ui.js │ │ │ └── loader.js │ │ ├── index.js │ │ └── lib/ │ │ ├── config-loader.js │ │ ├── dependency-loader.js │ │ ├── fullpage-component-loader.js │ │ ├── iframe-component-loader.js │ │ └── loginutil.js │ ├── qbusiness-lambda/ │ │ └── index.py │ ├── streaming-lambda/ │ │ └── index.js │ └── website/ │ ├── custom-chatbot-style.css │ ├── iframeparent.html │ ├── index.css │ ├── index.html │ └── parent.html ├── templates/ │ ├── Makefile │ ├── README.md │ ├── codebuild-deploy.yaml │ ├── cognito.yaml │ ├── cognitouserpoolconfig.yaml │ ├── custom-resources/ │ │ ├── cfnresponse.py │ │ ├── codebuild-start.py │ │ └── s3-cleanup.py │ ├── lexbot.yaml │ ├── master.yaml │ ├── restapi.yaml │ └── streaming-support.yaml └── vite.config.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .eslintrc.js ================================================ module.exports = { root: true, parser: 'babel-eslint', parserOptions: { sourceType: 'module' }, env: { browser: true, }, extends: 'airbnb-base', rules: { // allow debugger during development 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, } } ================================================ FILE: .gitattributes ================================================ dist/*.js -diff dist/*.css -diff dist/*.map -diff dist/*.zip -diff ================================================ FILE: .gitignore ================================================ out/ node_modules/ .DS_Store .idea/ py_modules/ */*/py_modules/ .kiro/ .vscode/ ================================================ FILE: .npmignore ================================================ build config img lex-web-ui Makefile ================================================ FILE: CHANGELOG.md ================================================ # Change Log All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [0.24.1] - 2026-05-12 - Updated Python scripts to 3.13 and removed some unneeded dependencies to simplify deployment - Fixed cross-region deployments where Cognito & Lex region were not being isolated properly - Fixed issue with live chat Lambda caused by new headers used in the sigv4 implementation ## [0.24.0] - 2026-02-20 - POTENTIAL BREAKING CHANGE: Solutions has been migrated to Vite and will no longer use Webpack. If your solution uses custom Webpack builds it, use caution before pulling in this change. - Modified postTextMessage action to set previous question and answer as Lex session attributes - Fixed invalid border-radius value for lex-web-ui-iframe.css which resulted in a visible border when the iFrame was minimized - Create own implementation of sigv4 signing so that Amplify is not a required dependency ## [0.23.1] - 2025-12-17 - Allow users to specify tel:+x.xxx.xxx.xxxx format phone numbers in message responses and in connect wait for agent messages. This allows users to touch on the phone number on mobile devices to initiate a call. - Added custom-chatbot-style.css as a dependency to lex-web-ui-loader to allow for enhanced customization - Hard set the character limit for the text input box element to 1024 - Depedency updates ## [0.23.0] - 2025-10-3 - Remove all reference to Lex v1 as it has been deprecated - Revamp how token refreshes work to resolve some issues that were introduced when migrating to SDKv3 - Add example CSS files to repo for users who want an easier starting point. ## [0.22.5] - 2025-09-10 - Update live chat text transcription applying redaction when required. - Fix issue with live chat not closing on browser or window closing. ## [0.22.4] - 2025-08-09 - Fix issue where full page loader was pulling iniitate-loader as a dependency improperly - Allow empty promptForNameMessage to skip prompting for a name (for Talkdesk integration only). This must be manually updated on the config file. - Upgrade NodeJS Lambda function to v22 as v18 will be deprecated in the near future. ## [0.22.3] - 2025-06-26 - Fix issue where credentials were not available on web socket initiation in some instances of streaming - Accessibility improvements ## [0.22.2] - 2025-05-19 - Fix scenarios where cross origin requests did not have credentials passed before iframe loads ## [0.22.1] - 2025-05-10 - Upgrade to latest versions of Vue/Vuetify ## [0.22.0] - 2025-04-15 - Upgrade to AWS SDK v3 - Fix for Connect transcription redaction - Fix for issue with iframe incompatibility with Firebase login ## [0.21.7] - 2025-01-23 - Add heartbeat for streaming responses to prevent idle timeout of 10 mins ## [0.21.6] - 2024-12-18 - Updatae the Web UI to allow VPC integration with all Lambda functions. This requires your VPC to at a minimum be able to access S3, and additional optional functionality will require additional VPC endpoints to services. - Package updates to address vulnerabilities. ## [0.21.5] - 2024-08-15 - Removed pipeline deployment mode as CodeCommit is no longer accepting new repositories - Cleaned up some issues around lambda layer building ## [0.21.4] - 2024-07-15 - The Lex Web UI can now act as a passthrough for Q Business, allowing users to converse directly with their Q Business application while inheriting all the features of the Web UI such as embedding, CSS customizations and more. - Upgraded version of amazon-connect-chatjs ## [0.21.3] - 2024-06-27 - Dependency & documentation updates - Fixed a bug that was causing builds on Windows machines to fail ## [0.21.2] - 2024-04-24 - Added support for more Connect interactive messages. The UI now supports Panel, QuickReply & Carousel messages. - Removed the DateTime picker component due to its legacy dependency on Vue 2, please use the DatePicker going forward. - Cleaned up some dependencies to reduce the amount of polyfills required - Upgrade all python scripts to 3.10 - Other minor bug fixes and documentation updates. ## [0.21.1] - 2024-03-26 - Updated the streaming feature to be more flexible so users can choose whether or not the fullfilment Lambda should be streaming responses. Additional details can be found in the streaming responses README. - Added a copy icon so responses from the bot can be easily copy/pasted. This option can be configured manually from the configuration file and is defaulted to 'off'. - TalkDesk integration is now supported with the Web UI. Please refer to this [blog post](https://aws.amazon.com/blogs/machine-learning/provide-live-agent-assistance-for-your-chatbot-users-with-amazon-lex-and-talkdesk-cloud-contact-center/) for full details. - Updated broswer targets to only support ES6 browsers. - Dependency upgrades to address vulnerabilities ## [0.21.0] - 2024-03-01 - Upgraded the existing solution and relevant dependencies to Vue 3. Migrating from Vuetify 1.5 -> 3 in the process, skipping over Vuetify 2 entirely, requiring clean-up and reconfiguration of all UI components. Goal was to get parity in UI from the previous release, which includes some new CSS rules to maintain the look at feel of the previous UI. These changes could result in **breaking changes** to custom CSS despite efforts to maintain backwards compatibilty many Vuetify classes changed names during the upgrade. Please use caution when updating to this version of the Lex Web UI UI. ## [0.20.6] - 2024-02-12 - Emergency fix to upgrade Python function to version 3.8 across the board. As this will end of life later in the year we will release another update soon to move everything to 3.12. ## [0.20.5] - 2024-1-19 - Update Lamdba functions using Node to version 18. This required upgrading the Lambda code to use the JS SDK v3 as well. - Dependency upgrades to fix critical vulnerabilities. ## [0.20.4] - 2023-12-27 - Add support for file attachments. See new File Uploads README for full details. - Clean-up & fix issues related to webpack 5 and `npm run` related errors for some build types. ## [0.20.3] - 2023-12-7 - Add streaming support. Refer to Streaming Responses README for full details. - Fixed bug where CSS was not being properly applied to minimized button color. ## [0.20.2] - 2023-11-28 - Adjust handling of Elicit Intent response to account for no interpretations from Lex. Precreate mp3 audio files needed for voice response as default un-authenticated role can't use Polly to create these responses dynamically. - Dependency upgrades to fix critical vulnerabilities. ## [0.20.1] - 2023-10-24 - Removed breaking change of adding CSP configurations into Cloudfront. CSP will remain in place on index.html file but Cloudfront CSPs will need to be manually configured. As a result removed MarkdownSupportDomains parameter. - Minor bug fixes. - Dependency upgrades to fix critical vulnerabilities. ## [0.20.0] - 2023-09-28 - **BREAKING CHANGE**: Removed all inline scripts and added a CSP header to the index.html as well as CSP configurations to CloudFront. If your bot uses Markdown please not you will need to allow list all domains serving image/video using the MarkdownSupportDomains parameter (parent origin is automatically added to the CSP so no action is required in this case). Existing bots updating to this version & using Markdown **will break** if appropriate domains are not supplied. - CSS adjustments can now be made directly in the CloudFormation template for some common use cases. If left blank - Major updates to dependencies and webpack build processes for both the loader & web ui projects. This update removes all dependency vulnerabilities as of release date. - Dependencies used by the loader have been internalized to remove calls to external CDNs - Cognito self-registration is now domain limited. If you want self-registration on you must provide a list of valid domains otherwise self-registration is turned off on the Cognito instance. - Lowered the default timeout for Connect connections to 60 minutes. ## [0.19.9] - 2023-05-22 - Add configurable parameter to control delay between transcript message send on startup to Connect. Workaround Connect problem with respect to out of order delivery of sent messages. - Add the ability to configure a precreated CNAME, ACM Certificate, and WAFV2 ACL via template parameters. If the values are left empty default CloudFront distribution url and certificates is used. If a WAFV2 ACl is not supplied then no WAF Acl is configured for use by CloudFront. ## [0.19.8] - 2023-04-15 - Update CloudFormation template to remove ACL on S3 server access logs bucket and replaced with a bucket policy to align with best practices. This will also prevent the template from failing when the default settings for S3 buckets are changed in the near future. - Fixed issue where multilingual bots were not properly rendering the TimePicker interactive message component ## [0.19.7] - 2023-03-27 - Update to not allow V1 and V2 bots to be selected in CloudFormation parameters - Disable initial utterance sending if chat window is minimized on load - Reduced minimized width of iframe to prevent overflow covering up page elements - Rearrange live chat button locations for better UI experience ## [0.19.6] - 2022-10-17 - Fix issue where some empty string variables would break the Code Deploy build, for example, if InitialText was cleared out of the CloudFormation parameters. - Added more CloudFormation parameters for commonly used UI properties. The new variables include: * HideButtonMessageBubble * MessageMenu * BackButton * MinimizedButtonContent - Change initial speech mechanism to fetch and play mp3 files created during codebuild. Implement support for configured localeIds when creating the mp3 files. Create an mp3 for each configured localeId and use aws translate to generate text for the locale and use aws polly to create the mp3 files. When the user changes locale in the UI and clicks on the mic button, the initial speech for the selected locale will be played. - Add support for Connect interactive messaging into Lex Web UI: [https://docs.aws.amazon.com/connect/latest/adminguide/interactive-messages.html](https://docs.aws.amazon.com/connect/latest/adminguide/interactive-messages.html). Both ListPicker and TimePicker are supported templateTypes and can be sent using the exact same JSON structure as Connect. - Fix handling the new ElicitIntent dialogAction type LexV2 response, which does not have some expected properties on the sessionState object ## [0.19.5] - 2022-07-17 - Updated README to be more clear - Updated Connect chat README - Add the ability to send Lex session attributes prefixed with `connect_` to Connect chat - Fix issue with master pipeline template not working properly for Lex V2 bots - Fix issue where Connect agent and chat user have same name - Bump dependencies - Custom CloudFront response policy that allows iFrame embedding - Changed attaching Amazon Connect chat transcripts to false by default ## [0.19.4] - 2022-03-05 - Add setSessionAttribute function to iframe api, add optional messageType parameter to postText function. - Add the ability to manually configure a help message in lex-web-ui-loader-config.json per locale. This message is displayed in response to clicking the help button rather then sending to the lex bot. In addition, the last message from the bot can be re-displayed after the help message giving the user context on next action again - Prefer Lex V1 response cards over Lex V2 in the case where both are present. In a QnABot result, both a V1 and V2 response card will be present. V1 response cards might contain additional buttons not present in the V2 response card. When both are present, prefer the V1 response card. - Fix for when user sends live chat message while within live chat - Change Connect CloudFormation parameters to have default empty strings - Updated default CSS for input container to be visible on screen in iOS/Safari 15 ## [0.19.3] - 2021-12-17 - Update use of amazon-connect-chatjs to version "^1.1.7" in lex-web-ui/package.json - Support response from LexV2 bots with response card only - no message text - Add Build/Deploy section to bottom of toplevel readme ## [0.19.2] - 2021-11-12 - Update Connect Live Chat README to clarify CORS settings - Fix problem where CodeBuild was not executed when Connect associated template parameters were changed - Fix use of template parameter to disable Connect attach chat transfer ## [0.19.1] - 2021-11-02 - Fix reference to chatbotUiConfig in build/create-iframe-snippet-file.sh to correct capitalization error ## [0.19.0] - 2021-10-22 - Adjust the OPTIONS request on the new API allowing Connect live chat to set Access-Control-Allow-Origin to the ParentOrigin supplied in the template - Deliver full transcript of user interaction to agent when opening live chat to Connect - Parameterize all Connect Live messages in CF template - Update dependent component versions to address several dependabot alerts - Add commented example to set session attributes on startup to snippet, parent.html, and index.html. ## [0.18.2] - 2021-08-28 - Add feature for connect live chat. Allow client to optionally interact with an agent via Connect. ## [0.18.1] - 2021-06-01 - Change package.json revision to 0.18.1 - Provide distribution location in Canada (Central) region - ca-central-1 - Update aws sdk to current revision - Change codebuild-deploy.yaml to use amazon linux image vs nodejs10 image. - Change codebuild-deploy.yaml and pipeline.yaml buildspec and codebuild role to invalidate cloudfront distribution after syncing s3 bucket - Fix Lex V2 client state mapping - specific for audio - Enhance Lex V2 support to - allow configuration of multiple V2 locale ids via template in comma separated list - provide menu based selection of configured V2 locales - Enhance postMessage to better filter messages between iframe and parent - Make CognitoAppUserPoolClientId and CognitoUserPoolId optional in master-pipeline.yaml ## [0.18.0] - 2021-04-21 - Move from webpack V3 to webpack V4 in the lex-web-ui component. - Move to npm version 7.10.0. - Update component package versions. - Resolve dependabot alerts. - Fix to resolve update problem where Cognito Supported Identity Providers is reset to just Cognito. An update will now preserve the existing Supported Identity Providers. - Set AWS sdk to version 2.875.0. - Improve Lex V2 support to handle responseCard defined as a session attribute in sessionAttributes.appContext.responseCard. - Removed support for AWS mobilehub based distribution. ## [0.17.9] - 2021-03-03 - Support Lex Version 2 Bots - Parameter to support initial utterance to send to the bot - Changed behavior of button date message to use "n min ago" - Changed behavior of ShouldLoadIframeMinimized to take precedence over last known state - Added mechanism in loginutils.js to prevent looping - Support mixed case web ParentOrigin URLs and WebAppPath in Cognito user pool - Allow multiple values for WebAppPath to allow UI with login to be enabled on multiple pages on the same site (origin) - Update the Cognito Callback and Signout URLs when updated via CloudFormation template update ## [0.17.8] - 2021-02-02 - Fix for pipeline based deployments - issue 264 - template error - Fix to full page web client (index.html) using forceLogin to require a direct to login page - Fix to move to python 3.8 Lambda Runtime for yaml CloudFormation template embedded functions which remove use of boto3 vendored library - Add ability for Lex Web UI to automatically retry a request if the Lex bot times out after 30 seconds using a configurable number of attempts. By default the timeout retry feature is disabled. When enabled, the default retry count is 1. ## [0.17.7] - 2020-12-31 - Build script fix - Move min button icon to the left of text ## [0.17.6] - 2020-12-20 - Additional fixes to support upgrades. Upgrades from 0.17.1 and above are supported. Older versions will need to perform a fresh install to migrate to this version. - Additions to CSS style documentation ## [0.17.5] - 2020-12-12 - Fix to allow use of CF template upgrade to disable WebAppConfHelp, WebAppConfPositiveFeedback, and WebAppConfNegativeFeedback - Fix to improve resizing of lex-web-ui button at bottom of page when text is used in addition to icon ## [0.17.4] - 2020-12-06 - Improved upgrade support - Chat history can now be preserved and redisplayed when the user comes back to the original parent page. - Lambda function upgrade to Python 3.7. ## [0.17.3] - 2020-11-05 - Added loader config option (forceLogin) to templates which configures UI to require the user to authenticate through Cognito prior to using the bot. - Added loader config option (minButtonContent) which allows text to be added to the button which appears on the parent page when the iframe is minimized. - Added XRay support to Lambda functions. - Added VPC actions to Lambda IAM Roles to support future deployment of Lambdas in VPC. - Encrypted S3 buckets using AES-256 default KMS key - Prebuilt deployments now available for Singapore, Tokyo, London, and Frankfurt regions ## [0.17.2] - 2020-08-21 - Added option to hide message bubble on button click - Resolved current github dependabot security issues - Use default encryption for all S3 buckets using AES-256 encryption - Added instructions in readme for adding additional vue components ## [0.17.1] - 2020-08-01 - Create uniquely named Cognito UserPool on stack creation - Removed display of Back button in title bar and instead provide a replay button using the text from prior message directly in the message bubble. Back button can be re-enabled though configuration json if desired. - Enhanced css attributes of the minimized chatbot button to help allow clicking on items in the parent window as well as selecting text next the button. ## [0.17.0] - 2020-07-12 - Improved accessibility - big thanks to @pdkn for this significant contribution * Improve screen reader experience - Add screen reader specific text to questions & answer (hidden visually) so messages are prepended with ( `bot says: `/ `I say: `) helping to give context to visually impaired - Hide message date from screen readers - Hide loading message from screen readers - Hide avatar image from screen readers - Make the chatbot titlebar title a \

heading – (Pages must contain a level-one heading) - Change \