Code Monkey home page Code Monkey logo

microsoft / adaptivecards Goto Github PK

View Code? Open in Web Editor NEW
1.7K 103.0 539.0 360.97 MB

A new way for developers to exchange card content in a common and consistent way.

Home Page: https://adaptivecards.io

License: MIT License

CSS 2.98% HTML 0.18% TypeScript 15.51% JavaScript 5.30% C# 26.41% C++ 23.95% C 0.31% CMake 0.09% Java 12.65% Objective-C 2.21% Objective-C++ 9.15% Ruby 0.05% Batchfile 0.13% PowerShell 0.21% SWIG 0.57% ANTLR 0.03% Makefile 0.01% Swift 0.04% SCSS 0.20% Shell 0.02%
cards bot-framework adaptive-cards adaptivecards adaptive xaml wpf xamarin ios android

adaptivecards's Introduction

Adaptive Cards

logo

Adaptive Cards are a new way for developers to exchange content in a common and consistent way. Get started today by putting Adaptive Cards into Microsoft Teams, Outlook Actionable Messages, Cortana Skills, or Windows Timeline -- or render cards inside your own apps by using our SDKs.

Dive in

Install and Build

Adaptive Cards are designed to render anywhere that your users are. The following native platform renderers are under development right now.

PS: Latest Build Status is against main branch.

Platform Latest Release Source Docs Latest Build Status
JavaScript npm install Source Docs Build Status
.NET Nuget install Source Docs Build status
.NET WPF Nuget install Source Docs Build status
.NET HTML Nuget install Source Docs Build status
Windows UWP Nuget install Source Docs Build Status
Android Maven Central Source Docs Build status
iOS CocoaPods Source Docs Build status
Card Designer npm install Source Docs Build Status

Release schedule

We release the Adaptive Cards products on the third week of each month, assuming there are updates. Please see the table below for the most recent and upcoming release dates.

Product Last Release Date Next Release Date
Website 2/6/2024 3/11/2024
Designer 1/31/2023 7/17/2023
JavaScript Renderer 6/23/2023 7/17/2023
JavaScript Renderer Beta 4/9/2023 7/17/2023
JavaScript Templating 9/16/2022 7/17/2023
XAML Renderer 2/2/2024 3/2/2024
XAML Object Model 2/2/2024 3/2/2024
WinUI 3 Renderer 2/2/2024 3/2/2024
WinUI 3 Object Model 2/2/2024 3/2/2024
C++/WinRT Templating 2/2/2024 3/2/2024
C#/WinRT Templating 2/2/2024 3/2/2024
.NET Renderer 12/1/2022 7/17/2023
.NET Templating 3/7/2023 7/17/2023

Note: These release dates are subject to change based on availability and active development of each product.

Code format

We require the C++ code inside this project to follow the clang-format. If you change them, please make sure your changed files are formatted correctly.

Make sure clang-format version 12.0.0 and above version is used.

IDE integration

ClangFormat describes a set of tools that are built on top of LibFormat. It can support your workflow in a variety of ways including a standalone tool and editor integrations. For details, refer to https://clang.llvm.org/docs/ClangFormat.html

Format with script

Two scripts are provided to help you format files.

  • Windows user only: use FormatSource.ps1. This script use clang-format.exe which is built into Visual Studio by default.

    Execute below command in the root folder of the project

     PowerShell.exe -ExecutionPolicy Bypass scripts\FormatSource.ps1 -ModifiedOnly $False
    

If it's the first time to run the script, make sure clang-format version 12.0.0 or above in the output. Otherwise you may need to upgrade Visual Studio or use your own clang-format binaries.

[clang-format] Version is:
clang-format version 12.0.0
  • Both Windows and MAC users: Use clang-format npmjs package

    Execute below command in source/nodejs

     npm run format
    

Make sure npm install is run before.

Use Git pre-commit hook

git pre-commit hook is an optional process. When you run git commit, it will automatically do the format check and auto fix the format if error detected.

First make sure clang-format binary is installed in your dev enviroment. Then modify scripts/hooks/pre-commit to make sure clangFormat is point to the correct path. And finally setup the git hook.

Two ways to setup the hook:

  1. Copy scripts/hooks/pre-commit to .git/hooks
  2. git config --local core.hooksPath scripts/hooks

End User License Agreement for our binary packages

Consumption of the AdaptiveCards binary packages are subject to the Microsoft EULA (End User License Agreement). Please see the relevant terms as listed below:

NOTE: All of the source code, itself, made available in this repo as well as our NPM packages, continue to be governed by the open source MIT license.

Community SDKs

The following SDKs are lovingly maintained by the Adaptive Cards community. Their contributions are sincerely appreciated! πŸŽ‰

Platform Install Repo Maintainer
ReactNative npm install GitHub BigThinkCode
Pic2Card GitHub BigThinkCode
Vue.js npm install GitHub Tim Cadenbach

Contribute

There are many ways to contribute to Adaptive Cards.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Supported Features

Feature Schema Version Platform Parsing Rendering
Action.OpenUrl v1.0 All βœ… βœ…
Action.ShowCard v1.0 All βœ… βœ…
Action.Submit v1.0 All βœ… βœ…
Column v1.0 All βœ… βœ…
ColumnSet v1.0 All βœ… βœ…
Container v1.0 All βœ… βœ…
Fact v1.0 All βœ… βœ…
FactSet v1.0 All βœ… βœ…
Image v1.0 All βœ… βœ…
ImageSet v1.0 All βœ… βœ…
Input.ChoiceSet v1.0 All βœ… βœ…
Input.Date v1.0 All βœ… βœ…
Input.Number v1.0 All βœ… βœ…
Input.Text v1.0 All βœ… βœ…
Input.Time v1.0 All βœ… βœ…
Input.Toggle v1.0 All βœ… βœ…
SelectAction v1.0 All βœ… βœ…
TextBlock v1.0 All βœ… βœ…
Explicit Image Dimension v1.1 All βœ… βœ…
Background Color v1.1 All βœ… βœ…
Vertical Content Alignment v1.1 All βœ… βœ…
Action Icon v1.1 All βœ… βœ…
Action Style v1.2 All βœ… βœ…
Toggle Visibility v1.2 All βœ… βœ…
ActionSet v1.2 All βœ… βœ…
Fallback v1.2 All βœ… βœ…
Container BackgroundImage v1.2 All βœ… βœ…
Container MinHeight v1.2 All βœ… βœ…
Container Bleed v1.2 All βœ… βœ…
Container Style v1.2 All βœ… βœ…
Image Data Uri v1.2 All βœ… βœ…
Action Icon Data Uri v1.2 All βœ… βœ…
Input.Text Inline Action v1.2 All βœ… βœ…
TextBlock FontType v1.2 All βœ… βœ…
RichTextBlock v1.2 All βœ… βœ…
Input Label v1.3 All βœ… βœ…
Input ErrorMessage v1.3 All βœ… βœ…
AssociatedInputs v1.3 All βœ… βœ…
RichTextBlock UnderLine v1.3 All βœ… βœ…
Action.Refresh v1.4 All βœ… βœ…
AdaptiveCard Authentication v1.4 All βœ… βœ…
Action.Execute v1.4 All βœ… βœ…
Action IsEnabled v1.5 JS βœ… βœ…
Action IsEnabled v1.5 iOS βœ… βœ…
Action IsEnabled v1.5 Android βœ… βœ…
Action IsEnabled v1.5 XAML βœ… βœ…
Action IsEnabled v1.5 .NET βœ… ❎
Action Mode v1.5 JS βœ… βœ…
Action Mode v1.5 iOS βœ… βœ…
Action Mode v1.5 Android βœ… βœ…
Action Mode v1.5 XAML βœ… βœ…
Action Mode v1.5 .NET βœ… ❎
Action/SelectAction ToolTip v1.5 JS βœ… βœ…
Action/SelectAction ToolTip v1.5 iOS βœ… βœ…
Action/SelectAction ToolTip v1.5 Android βœ… βœ…
Action/SelectAction ToolTip v1.5 XAML βœ… βœ…
Action/SelectAction ToolTip v1.5 .NET βœ… ❎
Input.ChoiceSet Filtered Style v1.5 JS βœ… βœ…
Input.ChoiceSet Filtered Style v1.5 iOS βœ… βœ…
Input.ChoiceSet Filtered Style v1.5 Android βœ… βœ…
Input.ChoiceSet Filtered Style v1.5 XAML βœ… βœ…
Input.ChoiceSet Filtered Style v1.5 .NET βœ… ❎
Input.Text Password Style v1.5 JS βœ… βœ…
Input.Text Password Style v1.5 iOS βœ… βœ…
Input.Text Password Style v1.5 Android βœ… βœ…
Input.Text Password Style v1.5 XAML βœ… βœ…
Input.Text Password Style v1.5 .NET βœ… ❎
TextBlock Heading Style v1.5 JS βœ… βœ…
TextBlock Heading Style v1.5 iOS βœ… βœ…
TextBlock Heading Style v1.5 Android βœ… βœ…
TextBlock Heading Style v1.5 XAML βœ… βœ…
TextBlock Heading Style v1.5 .NET βœ… ❎
RTL v1.5 JS βœ… βœ…
RTL v1.5 iOS βœ… βœ…
RTL v1.5 Android βœ… βœ…
RTL v1.5 XAML βœ… βœ…
RTL v1.5 .NET βœ… ❎
Table v1.5 JS βœ… βœ…
Table v1.5 iOS βœ… βœ…
Table v1.5 Android βœ… βœ…
Table v1.5 XAML βœ… βœ…
Table v1.5 .NET βœ… ❎
Carousel v1.6 JS βœ… βœ…
Carousel v1.6 iOS ❎ ❎
Carousel v1.6 Android ❎ ❎
Carousel v1.6 XAML ❎ ❎
Carousel v1.6 .NET ❎ ❎
ImageSet Stacked Presentation Style v1.6 JS βœ… βœ…
ImageSet Stacked Presentation Style v1.6 iOS ❎ ❎
ImageSet Stacked Presentation Style v1.6 Android ❎ ❎
ImageSet Stacked Presentation Style v1.6 XAML ❎ ❎
ImageSet Stacked Presentation Style v1.6 .NET ❎ ❎
Dynamic Type Ahead Search v1.6 JS ❎ ❎
Dynamic Type Ahead Search v1.6 iOS βœ… ❎
Dynamic Type Ahead Search v1.6 Android βœ… ❎
Dynamic Type Ahead Search v1.6 XAML ❎ ❎
Dynamic Type Ahead Search v1.6 .NET ❎ ❎
Label Position v1.6 JS ❎ ❎
Label Position v1.6 iOS ❎ ❎
Label Position v1.6 Android ❎ ❎
Label Position v1.6 XAML ❎ ❎
Label Position v1.6 .NET ❎ ❎
Inline Editable Input Style v1.6 JS ❎ ❎
Inline Editable Input Style v1.6 iOS ❎ ❎
Inline Editable Input Style v1.6 Android ❎ ❎
Inline Editable Input Style v1.6 XAML ❎ ❎
Inline Editable Input Style v1.6 .NET ❎ ❎

adaptivecards's People

Contributors

almedina-ms avatar andrewleader avatar anna-dingler avatar beervoley avatar bekao avatar carlos-zamora avatar chriche-ms avatar danmarshall avatar dclaux avatar dclauxperso avatar dependabot-preview[bot] avatar dependabot[bot] avatar eschavez avatar golddove avatar haridas avatar ibrahimsulai avatar jaymemperlman avatar jeanroca avatar jwoo-msft avatar keerthana786 avatar krschau avatar licanhua avatar matthidinger avatar pankajbhojwani avatar paulcam206 avatar qingpingmeng avatar riarenas avatar shalinijoshi19 avatar tomlm avatar tuanh118 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adaptivecards's Issues

Section "title" property

Example seen in FlightIntinerary.

               {
                                                "title": "Passengers",
                                                "separator": "bottom",
                                                "items": [
                                                                {
                                                                                "@type": "TextBlock",
                                                                                "text": "Sarah Hum"
                                                                },
                                                                {
                                                                                "@type": "TextBlock",
                                                                                "text": "Jeremy Goldberg"
                                                                },
                                                                {
                                                                                "@type": "TextBlock",
                                                                                "text": "Evan Litvak"
                                                                }
                                                ]
                                }

Semantics:

  • Always displayed at the same location within the section (probably at the top)
  • Always rendered using a very specific font (size, weight, color)
  • Possibly useful for accessibility or speech-devices

Toast Notifications using JSON

// TODO: Handle actions with input
// TODO: What about inputs that don't have actions?
// TODO: Can we go semantic with title, description, etc

{
	"@type": "AdaptiveCard",
	"title": "Adaptive Card design session",
	"description1": "Conf Room 112/3377 (10)",
	"description2": "12:30 PM - 1:30 PM",
	"body": [
	    {
	        "@type": "TextBlock",
	        "text": "Snooze for"
	    },
	    {
	        "@type": "MultichoiceInput",
	        "size": "stretch",
	        "choices": [
	            { "display": "5 minutes" },
	            { "display": "15 minutes" },
	            { "display": "30 minutes" }
	        ]
	    },
	    {
	        "@type": "ActionGroup",
	        "items": [
	            {
	                "@type": "HttpPOST",
	                "name": "Snooze"
	            },
	            {
	                "@type": "HttpPOST",
	                "name": "I'll be late"
	            },
	            {
	                "@type": "HttpPOST",
	                "name": "Dismiss"
	            }
	        ]
	    }
	]
}

Live Tile using JSON

// TODO: Do we have MRT issues?
// TODO: What about high contrast?
// TODO: LTR and RTL
// TODO: Should we add TileGeneric?
// TODO: Narrator support

{
    "branding": "none",
    "TileSmall": {
        "branding": {},
        "visual": [
            
        ]
    },
    "TileMedium": {
        "branding": {},
        "visual": [

        ]
    },
     "TileWide": {
        "branding": {},
        "visual": [
            
        ]
    },
    "TileLarge": {
        "branding": {},
        "visual": [
            
        ]
    }
}

Flesh out "House of Cards" concept

Allowing a single payload to house multiple Card variations. E.g., a developer could include an AdaptiveCard targeting Skype, an FbCard targetting FB Messenger, and a SpeechCard meant to being read on a headless device.

This should also cover the the Skype scenario where a Card has a Collapsed and FullScreen view, as seen here on Facebook Messenger:

Card versioning and fallback

Problem

If a bot developer absolutely requires a v2 renderer, and fallback would not be appropriate, they can add this attribute and the renderer would output something like β€œUnfortunately this content couldn’t be displayed”

Schema

  1. version is a required property on all payloads.
  2. minVersion is an optional property that allows a developer to declare that their card must only be renderered on a supported version.

Example

{
    "$schema": "../../schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "99.0",
    "minVersion": "99.0",
    "fallbackText": "This card requires Adaptive Cards version 99.0, which probably doesn't exist",
    "body": [
        {
            "type": "TextBlock",
            "text": "THIS SHOULD NOT APPEAR! It should show the fallback text"
        }        
    ]
}

Renderer spec

  1. A renderer MUST implement a particular version of the schema.
  2. If a renderer encounters a minRequiredVersion property in the AdaptiveCard that is higher than the supported version, it MUST return the fallbackText instead.

TextBlock isSubtle property

Should we make subtle a textColor semantic value versus the isSubtle property. Is it useful to combine them?

{ textColor: "warning", "isSubtle": true }

Schema for List-based choice input

Cortana Scenario: User says "Find a Starbucks", and it presents a customized list of numbered items that the user can choose. They need more than just a "displayName" that we have in the MultiChoiceInput

Renderer allows containers to support custom types

Scenario: Toast Notifications have a progress bar in their payloads

 "body": [
                    {
                        "type": "TextBlock",
                        "text": "Serious Pie",
                        "textWeight": "bolder",
                        "textSize": "medium"
                    },
                    **{
                        "type": "ProgressBar",
                        "Value": "50"
                    }**
                ]

The Renderer should provide some kind of callback to the container to handle generating UI for any unknown types

Adaptive Card Collection to send multiple "views" in a single payload

Allowing a single payload to house multiple Card variations. E.g., a developer could include an AdaptiveCard targeting Skype, an FbCard targetting FB Messenger, and a SpeechCard meant to being read on a headless device.

This should also cover the the Skype scenario where a Card has a Collapsed and FullScreen view, as seen here on Facebook Messenger:

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.