Giter Club home page Giter Club logo

microsoft / adaptivecards Goto Github PK

View Code? Open in Web Editor NEW
1.7K 104.0 542.0 361.03 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.95% HTML 0.16% TypeScript 15.38% JavaScript 5.31% C# 26.87% C++ 23.84% C 0.31% CMake 0.09% Java 12.57% Objective-C 2.19% Objective-C++ 9.09% Ruby 0.05% Batchfile 0.12% PowerShell 0.20% 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 Issues

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:

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

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 }

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

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.

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": [
            
        ]
    }
}

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"
	            }
	        ]
	    }
	]
}

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

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.