Git Product home page Git Product logo

einstein-bots-ui-recipe's Introduction

Einstein Bots UI Recipe

Provides rich user interface by LWC lightningsnapin-base-chat-message base component in Salesforce Einstein Bot and Embedded Service for Web.

How to use

Deploy chatMessage lightning web component to the org and select it as custom component in embedded service setting.

If a message in Einstein Bot starts with

  • RICH_TEXT:<RICH_TEXT_CONTENT_INCLUDING_SUPPORTED_HTML_TAGS>, shows the message in rich text format.
  • YOUTUBE:<YOUTUBE_VIDEO_ID>, shows the youtube video in chat window.
  • IMAGE:<IMAGE_URL>, shows the image.
  • URL:<TARGET_URL> shows the OGP info.
  • PLAIN_TEXT:<MESSAGE> or no prefix, shows the message in plain text format.

Example

Notice

  • Custom attributes cannot be passed to lightning web component. So in this repository, using prefix rule to decide the type of content.
  • OpenGraph.io is used to fetch OGP data. Make sure to create your api key and to add the CSP setting. And text truncation is not supported in Internet Explorer.
  • Standard CSS selector is not applied to custom message component. Be careful for the layout skew.
  • URL in bot message is automatically converted to string contains <a> tag. For example, if a bot message is https://www.google.com, in custom component, messageContent.value will be <a href="https//www.google.com">https://www.google.com</a>. So extractOriginalString method returns the original url without <a> tag.

einstein-bots-ui-recipe's People

Contributors

shunkosa avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.