microsoft / BotFramework-WebChat

A highly-customizable web-based client for Azure Bot Services.
https://www.botframework.com/
MIT License
1.58k stars 1.53k forks source link

Turing: Extending Adaptive Cards using AC extensibility feature #3245

Open compulim opened 4 years ago

compulim commented 4 years ago

Background

Show how to use AC JavaScript extensibility in Web Chat, as a sample.

Goals

Non-goals

Action items

Implement https://docs.microsoft.com/en-us/adaptive-cards/sdk/rendering-cards/javascript/extensibility in Web Chat as a sample.

+ <script crossorigin="anonymous" src="https://unpkg.com/adaptivecards@1.2.6/dist/adaptivecards.min.js"></script>
+ window.AdaptiveCards.AdaptiveCard.elementTypeRegistry.registerType('ProgressBar', () => new window.WebChatSample.ProgressBar());

  window.WebChat.renderWebChat(
    {
+     adaptiveCardsPackage: window.AdaptiveCards,
      directLine: window.WebChat.createDirectLine({ token })
    },
    document.getElementById('webchat')
  );

Prototype

image

Very preliminary POC for this sample in this sample.zip.

corinagum commented 3 years ago

Needs priority for the sample