diff --git a/source/nodejs/README.md b/source/nodejs/README.md index 7a6f0cba1b..1cd3671520 100644 --- a/source/nodejs/README.md +++ b/source/nodejs/README.md @@ -4,6 +4,8 @@ This directory contains all the JS packages for adaptive cards: * `adaptivecards` - The renderer library * `adaptivecards-controls` - A controls library useful for the designer +* `adaptivecards-fabric` - A set of Fabric UI extensions for the Adaptive Cards JS renderer +* `adaptivecards-templating` - A JSON-to-JSON templating and data binding library for use with Adaptive Cards * `adaptivecards-designer` - The drag-drop designer component * `adaptivecards-designer-app` - The designer app that consumes the designer component * `adaptivecards-site` - The generated website that is currently hosted at adaptivecards.io @@ -21,18 +23,19 @@ We use lerna to manage package linking and building. `npx lerna run build` -## Start the Designer or Visualizer +## Start the Designer -1. `cd adaptivecards-designer` (or `adaptivecards-visualizer`) +1. `cd adaptivecards-designer` 2. `npm start` +3. OR to test preview features: `npm run start:preview` # Start the documentation site (http://adaptivecards.io) 1. `cd adaptivecards-site` -2. `npm install hexo-cli -g` -3. `hexo generate` -4. `hexo server` -5. `Open up the browser to point to localhost:[portnumber] printed after the command above returns under "Hexo is running at".` +2. `npx lerna run release` +3. `npm install hexo-cli -g` +5. `npm start` +6. Open up the browser to point to: `localhost:[portnumber]` printed after the command above returns under "Hexo is running at". ## Adding a new package diff --git a/source/nodejs/adaptivecards-controls/package-lock.json b/source/nodejs/adaptivecards-controls/package-lock.json index c0ee3af64c..498765c826 100644 --- a/source/nodejs/adaptivecards-controls/package-lock.json +++ b/source/nodejs/adaptivecards-controls/package-lock.json @@ -353,7 +353,7 @@ }, "util": { "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "resolved": "http://registry.npmjs.org/util/-/util-0.10.3.tgz", "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", "dev": true, "requires": { @@ -562,7 +562,7 @@ }, "browserify-aes": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { @@ -599,7 +599,7 @@ }, "browserify-rsa": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "dev": true, "requires": { @@ -633,7 +633,7 @@ }, "buffer": { "version": "4.9.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", "dev": true, "requires": { @@ -999,7 +999,7 @@ }, "create-hash": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { @@ -1012,7 +1012,7 @@ }, "create-hmac": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { @@ -1193,7 +1193,7 @@ }, "diffie-hellman": { "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "requires": { @@ -1358,7 +1358,7 @@ }, "events": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "resolved": "http://registry.npmjs.org/events/-/events-1.1.1.tgz", "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", "dev": true }, @@ -1784,12 +1784,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1802,17 +1804,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -1927,7 +1932,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -1939,6 +1945,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -1953,6 +1960,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -2063,7 +2071,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -2075,6 +2084,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -2195,6 +2205,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -2258,7 +2269,7 @@ }, "get-stream": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", "dev": true }, @@ -2637,7 +2648,7 @@ }, "is-accessor-descriptor": { "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "resolved": "http://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "dev": true, "requires": { @@ -2672,7 +2683,7 @@ }, "is-data-descriptor": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "resolved": "http://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "dev": true, "requires": { @@ -3098,6 +3109,7 @@ "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -3107,7 +3119,8 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", - "dev": true + "dev": true, + "optional": true } } }, @@ -3162,7 +3175,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { @@ -3535,7 +3548,7 @@ }, "parse-asn1": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", + "resolved": "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", "dev": true, "requires": { @@ -3560,7 +3573,7 @@ }, "path-browserify": { "version": "0.0.0", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "resolved": "http://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", "dev": true }, @@ -3578,7 +3591,7 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, @@ -3949,7 +3962,7 @@ }, "safe-regex": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { @@ -4090,7 +4103,7 @@ }, "sha.js": { "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { @@ -4444,7 +4457,7 @@ }, "stream-browserify": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "resolved": "http://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", "dev": true, "requires": { @@ -4707,7 +4720,7 @@ }, "tty-browserify": { "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "resolved": "http://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", "dev": true }, @@ -4728,9 +4741,9 @@ "dev": true }, "typescript": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.2.tgz", - "integrity": "sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.2.tgz", + "integrity": "sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA==", "dev": true }, "union-value": { @@ -4928,7 +4941,7 @@ }, "vm-browserify": { "version": "0.0.4", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "resolved": "http://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", "dev": true, "requires": { diff --git a/source/nodejs/adaptivecards-controls/src/adaptivecards-controls.css b/source/nodejs/adaptivecards-controls/src/adaptivecards-controls.css index f12eb2ff90..933fc185bc 100644 --- a/source/nodejs/adaptivecards-controls/src/adaptivecards-controls.css +++ b/source/nodejs/adaptivecards-controls/src/adaptivecards-controls.css @@ -1,363 +1,450 @@ .ms-ctrl-overlay { - position: absolute; - left: 0; - top: 0; } + position: absolute; + left: 0; + top: 0; + z-index: 10000; +} @keyframes fadeIn { - 0% { - opacity: 0; } } + 0% { + opacity: 0; + } +} @keyframes slideTopToBottom { - 0% { - transform: translate(0, -20px); } } + 0% { + transform: translate(0, -20px); + } +} @keyframes slideBottomToTop { - 0% { - transform: translate(0, 20px); } } + 0% { + transform: translate(0, 20px); + } +} @keyframes slideLeftToRight { - 0% { - transform: translate(-20px, 0); } } + 0% { + transform: translate(-20px, 0); + } +} @keyframes slideRightToLeft { - 0% { - transform: translate(20px, 0); } } + 0% { + transform: translate(20px, 0); + } +} .ms-ctrl-slide { - animation-duration: 0.5s; - animation-timing-function: cubic-bezier(0.1, 0.9, 0.2, 1); } + animation-duration: 0.5s; + animation-timing-function: cubic-bezier(0.1, 0.9, 0.2, 1); +} .ms-ctrl-slide.ms-ctrl-slideTopToBottom { - animation-name: fadeIn,slideTopToBottom; } + animation-name: fadeIn, slideTopToBottom; +} .ms-ctrl-slide.ms-ctrl-slideBottomToTop { - animation-name: fadeIn,slideBottomToTop; } + animation-name: fadeIn, slideBottomToTop; +} .ms-ctrl-slide.ms-ctrl-slideLeftToRight { - animation-name: fadeIn,slideLeftToRight; } + animation-name: fadeIn, slideLeftToRight; +} .ms-ctrl-slide.ms-ctrl-slideRightToLeft { - animation-name: fadeIn,slideRightToLeft; } + animation-name: fadeIn, slideRightToLeft; +} @font-face { - font-family: 'FabricMDL2Icons'; - src: url("https://static2.sharepointonline.com/files/fabric/assets/icons/fabricmdl2icons.woff2?2.21") format("woff2"), url("https://static2.sharepointonline.com/files/fabric/assets/icons/fabricmdl2icons.woff?2.21") format("woff"), url("https://static2.sharepointonline.com/files/fabric/assets/icons/fabricmdl2icons.ttf?2.21") format("truetype"); - font-weight: normal; - font-style: normal; } + font-family: 'FabricMDL2Icons'; + src: url("https://static2.sharepointonline.com/files/fabric/assets/icons/fabricmdl2icons.woff2?2.21") format("woff2"), url("https://static2.sharepointonline.com/files/fabric/assets/icons/fabricmdl2icons.woff?2.21") format("woff"), url("https://static2.sharepointonline.com/files/fabric/assets/icons/fabricmdl2icons.ttf?2.21") format("truetype"); + font-weight: normal; + font-style: normal; +} .ms-icon { - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; - display: inline-block; - font-family: 'FabricMDL2Icons'; - font-style: normal; - font-weight: normal; } + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + display: inline-block; + font-family: 'FabricMDL2Icons'; + font-style: normal; + font-weight: normal; +} + +.ms-icon-close::before { + content: '\E8BB'; +} .ms-icon-chevronDown::before { - content: '\E70D'; } + content: '\E70D'; +} .ms-icon-chevronLeft::before { - content: "\E76B"; } + content: "\E76B"; +} .ms-icon-chevronRight::before { - content: "\E76C"; } + content: "\E76C"; +} .ms-icon-calendar::before { - content: "\E787"; } + content: "\E787"; +} .ms-icon-radioOff::before { - content: "\ECCA"; } + content: "\ECCA"; +} .ms-icon-radioOn::before { - content: "\ECCB"; } + content: "\ECCB"; +} .ms-icon-checkboxOff::before { - content: "\E739"; } + content: "\E739"; +} .ms-icon-checkboxOn::before { - content: "\E73A"; } + content: "\E73A"; +} .ms-icon-checkboxOn-reversed::before { - content: "\E73D"; } + content: "\E73D"; +} .ms-icon-checkMark::before { - content: "\E73E"; } + content: "\E73E"; +} .ms-ctrl { - box-sizing: border-box; - font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; - font-size: 14px; - font-weight: normal; } + box-sizing: border-box; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + font-size: 14px; + font-weight: normal; +} .ms-ctrl-dropdown { - border: 1px solid #EEEEEE; - background-color: white; - height: 32px; - display: flex; - padding-left: 12px; - padding-right: 12px; - cursor: pointer; } + border: 1px solid #EEEEEE; + background-color: white; + height: 32px; + display: flex; + padding-left: 12px; + padding-right: 12px; + cursor: pointer; +} .ms-ctrl-dropdown:hover { - border: 1px solid #0078D7; } + border: 1px solid #0078D7; +} .ms-ctrl-dropdown:focus { - border: 1px solid #0078D7; - outline: 0; } + border: 1px solid #0078D7; + outline: 0; +} .ms-dropdown-label { - line-height: 30px; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - height: 100%; - width: 100%; - color: #333333; - flex: 1 1 100%; - padding-right: 12px; } + line-height: 30px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + height: 100%; + width: 100%; + color: #333333; + flex: 1 1 100%; + padding-right: 12px; +} .ms-dropdown-label.placeholder { - color: gray; } + color: gray; +} .ms-ctrl-dropdown-button { - line-height: 32px; - flex: 0 0 auto; } + line-height: 32px; + flex: 0 0 auto; +} .ms-ctrl-dropdown-button:hover { - color: #0078D7; } + color: #0078D7; +} .ms-ctrl-dropdown-item { - width: 100%; - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; - display: block; - padding: 0px 12px 0px 12px; - line-height: 30px; - cursor: pointer; } + width: 100%; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + display: block; + padding: 0px 12px 0px 12px; + line-height: 30px; + cursor: pointer; +} .ms-ctrl-dropdown-item:hover { - background-color: #EEEEEE; } + background-color: #EEEEEE; +} .ms-ctrl-dropdown-item:focus { - outline: 0; - background-color: #CCCCCC; } + outline: 0; + background-color: #CCCCCC; +} .ms-ctrl-popup-container { - border: 1px solid #EEEEEE; - background-color: white; - position: absolute; - box-shadow: 0 0 15px -5px rgba(0, 0, 0, 0.4); - overflow-y: auto; } + border: 1px solid #EEEEEE; + background-color: white; + position: absolute; + box-shadow: 0 0 15px -5px rgba(0, 0, 0, 0.4); + overflow-y: auto; +} .ms-ctrl-popup-container:focus { - outline: 0; } + outline: 0; +} .ms-ctrl-calendar { - display: inline-block; } + display: inline-block; +} .ms-ctrl-calendarHeader { - font-size: 18px; - color: gray; - padding-left: 4px; - line-height: 34px; } + font-size: 18px; + color: gray; + padding-left: 4px; + line-height: 34px; +} .ms-ctrl-calendarNavButton { - text-align: center; - line-height: 34px; - width: 30px; - cursor: pointer; } + text-align: center; + line-height: 34px; + width: 30px; + cursor: pointer; +} .ms-ctrl-calendarNavButton:hover { - background-color: #EEEEEE; } + background-color: #EEEEEE; +} .ms-ctrl-calendarDayHeader { - font-size: 12px; - text-align: center; - padding: 6px 8px 6px 8px; - color: #333333; } + font-size: 12px; + text-align: center; + padding: 6px 8px 6px 8px; + color: #333333; +} .ms-ctrl-calendarDay { - font-size: 12px; - text-align: center; - padding: 6px 8px 6px 8px; - color: #333333; - cursor: pointer; } + font-size: 12px; + text-align: center; + padding: 6px 8px 6px 8px; + color: #333333; + cursor: pointer; +} .ms-ctrl-calendarDay:hover { - background-color: #EEEEEE; } + background-color: #EEEEEE; +} .ms-ctrl-calendarDay.subdued { - color: gray; } + color: gray; +} .ms-ctrl-calendarDay.selected { - color: white; - background-color: #0078D7; } + color: white; + background-color: #0078D7; +} .ms-calendarPopup { - padding: 6px; - overflow: hidden; } + padding: 6px; + overflow: hidden; +} .ms-ctrl-datePicker { - border: 1px solid #EEEEEE; - height: 32px; - display: flex; - padding-left: 12px; - padding-right: 12px; - cursor: pointer; } + border: 1px solid #EEEEEE; + height: 32px; + display: flex; + padding-left: 12px; + padding-right: 12px; + cursor: pointer; +} .ms-ctrl-datePicker:hover { - border: 1px solid #0078D7; } + border: 1px solid #0078D7; +} .ms-ctrl-datePicker:focus { - border: 1px solid #0078D7; - outline: 0; } + border: 1px solid #0078D7; + outline: 0; +} .ms-ctrl-checkbox { - outline: 0; - cursor: pointer; } + outline: 0; + cursor: pointer; +} .ms-ctrl-checkbox input[type=checkbox] { - visibility: hidden; } + visibility: hidden; +} .ms-ctrl-checkbox label { - display: inline-block; - box-sizing: border-box; - position: relative; } + display: inline-block; + box-sizing: border-box; + position: relative; +} .ms-ctrl-checkbox label span { - margin-left: 24px; - line-height: 18px; - color: #333333; - display: inline-block; } + margin-left: 24px; + line-height: 18px; + color: #333333; + display: inline-block; +} .ms-ctrl-checkbox label span:hover { - color: black; } + color: black; +} .ms-ctrl-checkbox label::before { - box-sizing: border-box; - display: inline-block; - position: absolute; - border: 1px solid #A6A6A6; - content: ""; - width: 18px; - height: 18px; - transition-property: background,border,border-color; - transition-duration: .2s; - transition-timing-function: cubic-bezier(0.4, 0, 0.23, 1); } + box-sizing: border-box; + display: inline-block; + position: absolute; + border: 1px solid #A6A6A6; + content: ""; + width: 18px; + height: 18px; + transition-property: background, border, border-color; + transition-duration: .2s; + transition-timing-function: cubic-bezier(0.4, 0, 0.23, 1); +} .ms-ctrl-checkbox label:hover::before { - border: 1px solid #767676; } - -.ms-ctrl-checkbox input[type=checkbox]:checked + label::before { - content: ""; - border: 1px solid #0078D7; - background-color: #0078D7; } - -.ms-ctrl-checkbox input[type=checkbox]:checked + label::after { - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; - font-family: 'FabricMDL2Icons'; - font-style: normal; - font-weight: bold; - content: "\E73E"; - color: white; - position: absolute; - width: 18px; - line-height: 18px; - left: 0; - top: 0; - text-align: center; - transition-property: background,border,border-color; - transition-duration: .2s; - transition-timing-function: cubic-bezier(0.4, 0, 0.23, 1); } + border: 1px solid #767676; +} + +.ms-ctrl-checkbox input[type=checkbox]:checked+label::before { + content: ""; + border: 1px solid #0078D7; + background-color: #0078D7; +} + +.ms-ctrl-checkbox input[type=checkbox]:checked+label::after { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + font-family: 'FabricMDL2Icons'; + font-style: normal; + font-weight: bold; + content: "\E73E"; + color: white; + position: absolute; + width: 18px; + line-height: 18px; + left: 0; + top: 0; + text-align: center; + transition-property: background, border, border-color; + transition-duration: .2s; + transition-timing-function: cubic-bezier(0.4, 0, 0.23, 1); +} .ms-ctrl-radiobutton { - outline: 0; - cursor: pointer; } + outline: 0; + cursor: pointer; +} .ms-ctrl-radiobutton input[type=radio] { - visibility: hidden; } + visibility: hidden; +} .ms-ctrl-radiobutton label { - display: inline-block; - box-sizing: border-box; - position: relative; } + display: inline-block; + box-sizing: border-box; + position: relative; +} .ms-ctrl-radiobutton label span { - margin-left: 22px; - line-height: 16px; - color: #333333; - display: inline-block; - vertical-align: top; } + margin-left: 22px; + line-height: 16px; + color: #333333; + display: inline-block; + vertical-align: top; +} .ms-ctrl-radiobutton label span:hover { - color: black; } + color: black; +} .ms-ctrl-radiobutton label::before { - content: ""; - box-sizing: border-box; - display: inline-block; - position: absolute; - border: 1px solid #A6A6A6; - width: 16px; - height: 16px; - border-radius: 50%; } + content: ""; + box-sizing: border-box; + display: inline-block; + position: absolute; + border: 1px solid #A6A6A6; + width: 16px; + height: 16px; + border-radius: 50%; +} .ms-ctrl-radiobutton label:hover::before { - border: 1px solid #767676; } - -.ms-ctrl-radiobutton input[type=radio]:checked + label::before { - border: 1px solid #0078D7; } - -.ms-ctrl-radiobutton input[type=radio] + label::after { - content: ""; - box-sizing: border-box; - display: inline-block; - position: absolute; - top: 8px; - left: 8px; - width: 0; - height: 0; } - -.ms-ctrl-radiobutton input[type=radio]:checked + label::after { - top: 4px; - left: 4px; - width: 8px; - height: 8px; - background-color: #0078D7; - border-radius: 50%; - transition-property: top,left,right,width,height; - transition-duration: 150ms; - transition-timing-function: cubic-bezier(0.4, 0, 0.23, 1); } + border: 1px solid #767676; +} + +.ms-ctrl-radiobutton input[type=radio]:checked+label::before { + border: 1px solid #0078D7; +} + +.ms-ctrl-radiobutton input[type=radio]+label::after { + content: ""; + box-sizing: border-box; + display: inline-block; + position: absolute; + top: 8px; + left: 8px; + width: 0; + height: 0; +} + +.ms-ctrl-radiobutton input[type=radio]:checked+label::after { + top: 4px; + left: 4px; + width: 8px; + height: 8px; + background-color: #0078D7; + border-radius: 50%; + transition-property: top, left, right, width, height; + transition-duration: 150ms; + transition-timing-function: cubic-bezier(0.4, 0, 0.23, 1); +} .ms-ctrl-textbox { - border: 1px solid #EEEEEE; - color: #333333; - outline: 0; - resize: none; - padding: 4px 8px; } + border: 1px solid #EEEEEE; + color: #333333; + outline: 0; + resize: none; + padding: 4px 8px; +} .ms-ctrl-textbox-multiline { - overflow: auto; } + overflow: auto; +} .ms-ctrl-textbox:-moz-placeholder { - color: gray; } + color: gray; +} .ms-ctrl-textbox::-moz-placeholder { - color: gray; } + color: gray; +} .ms-ctrl-textbox:-ms-input-placeholder { - color: gray; } + color: gray; +} .ms-ctrl-textbox::-ms-input-placeholder { - color: gray; } + color: gray; +} .ms-ctrl-textbox::-webkit-input-placeholder { - color: gray; } + color: gray; +} .ms-ctrl-textbox:hover { - border: 1px solid #0078D7; } + border: 1px solid #0078D7; +} .ms-ctrl-textbox:focus, .ms-ctrl-textbox:active { - border: 1px solid #0078D7; } + border: 1px solid #0078D7; +} \ No newline at end of file diff --git a/source/nodejs/adaptivecards-controls/src/popupmenu.ts b/source/nodejs/adaptivecards-controls/src/popupmenu.ts index eb5a5cb839..71ffab2c95 100644 --- a/source/nodejs/adaptivecards-controls/src/popupmenu.ts +++ b/source/nodejs/adaptivecards-controls/src/popupmenu.ts @@ -100,7 +100,6 @@ export class PopupMenu extends PopupControl { this._overlayElement = document.createElement("div"); this._overlayElement.className = "ms-ctrl-overlay"; this._overlayElement.tabIndex = 0; - this._overlayElement.style.zIndex = "1000"; this._overlayElement.style.width = document.documentElement.scrollWidth + "px"; this._overlayElement.style.height = document.documentElement.scrollHeight + "px"; this._overlayElement.onfocus = (e) => { this.closePopup(); }; diff --git a/source/nodejs/adaptivecards-designer-app/package-lock.json b/source/nodejs/adaptivecards-designer-app/package-lock.json index 914212a566..cc5f3c07e7 100644 --- a/source/nodejs/adaptivecards-designer-app/package-lock.json +++ b/source/nodejs/adaptivecards-designer-app/package-lock.json @@ -1,6 +1,6 @@ { "name": "adaptivecards-designer-app", - "version": "0.2.0", + "version": "0.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -254,25 +254,10 @@ } }, "adaptivecards": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/adaptivecards/-/adaptivecards-1.2.0.tgz", - "integrity": "sha512-rfB3dr2/yNMgJHiGCFH247RtLXkKcNwhGbI1GrXSITfyqfo12esTWDLkRLe62b0oGZxPKJZo5187BY9xORZYsg==" - }, - "adaptivecards-controls": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/adaptivecards-controls/-/adaptivecards-controls-0.2.0.tgz", - "integrity": "sha512-LfmE76Chi6hfNnxp7olyEF25t2Jmbm7b9pqVa+RXrTR48Klj4KHGrMrXsVQKhEznAVordYiwLliBMDlbsiJ7Fw==" - }, - "adaptivecards-designer": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/adaptivecards-designer/-/adaptivecards-designer-0.6.0.tgz", - "integrity": "sha512-PC/bnwnjT9YxUZAvUlGI0x4t9ytgED+mpJZRhK4TpjkzCZu7MvxDRgRu9tkZK0qsNRafMFQAK9vvbLt2RP9lNA==", - "requires": { - "adaptivecards": "^1.2.0", - "adaptivecards-controls": "^0.2.0", - "clipboard": "^2.0.1", - "monaco-editor": "^0.15.6" - } + "version": "1.3.0-alpha1", + "resolved": "https://registry.npmjs.org/adaptivecards/-/adaptivecards-1.3.0-alpha1.tgz", + "integrity": "sha512-V6dOox+Kzpu0NUb14FErW5JGBDLtxL3JimdA9D2scIP5O2g9t5eO/auD2RTFaag2pzBLGKBKbe06koeh1ml9RA==", + "dev": true }, "ajv": { "version": "6.6.2", @@ -345,6 +330,7 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, "requires": { "sprintf-js": "~1.0.2" } @@ -439,7 +425,7 @@ }, "async": { "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true }, @@ -866,16 +852,6 @@ } } }, - "clipboard": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.4.tgz", - "integrity": "sha512-Vw26VSLRpJfBofiVaFb/I8PVfdI1OxKcYShe6fm0sP/DtmiWQNCjhM/okTvdCo0G+lMMm1rMYbk4IK4x1X+kgQ==", - "requires": { - "good-listener": "^1.2.2", - "select": "^1.1.2", - "tiny-emitter": "^2.0.0" - } - }, "cliui": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", @@ -1001,7 +977,7 @@ }, "content-disposition": { "version": "0.5.2", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "resolved": "http://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=", "dev": true }, @@ -1222,11 +1198,6 @@ "rimraf": "^2.2.8" } }, - "delegate": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz", - "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==" - }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -1365,7 +1336,8 @@ "entities": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", - "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=" + "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", + "dev": true }, "errno": { "version": "0.1.7", @@ -1540,7 +1512,7 @@ "dependencies": { "array-flatten": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "resolved": "http://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", "dev": true } @@ -1684,7 +1656,7 @@ }, "finalhandler": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", "dev": true, "requires": { @@ -1832,7 +1804,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -1853,12 +1826,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1871,17 +1846,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -1996,7 +1974,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -2008,6 +1987,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2022,6 +2002,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -2132,7 +2113,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -2144,6 +2126,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -2264,6 +2247,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -2283,6 +2267,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -2311,7 +2296,8 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.2", @@ -2399,14 +2385,6 @@ } } }, - "good-listener": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz", - "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=", - "requires": { - "delegate": "^3.1.2" - } - }, "graceful-fs": { "version": "4.1.15", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", @@ -2897,6 +2875,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.0.3.tgz", "integrity": "sha1-2UpGSPmxwXnWT6lykSaL22zpQ08=", + "dev": true, "requires": { "uc.micro": "^1.0.1" } @@ -2993,6 +2972,7 @@ "version": "8.4.1", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.1.tgz", "integrity": "sha512-CzzqSSNkFRUf9vlWvhK1awpJreMRqdCrBvZ8DIoDWTOkESMIF741UPAhuAmbyWmdiFPA6WARNhnu2M6Nrhwa+A==", + "dev": true, "requires": { "argparse": "^1.0.7", "entities": "~1.1.1", @@ -3015,7 +2995,8 @@ "mdurl": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=" + "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", + "dev": true }, "media-typer": { "version": "0.3.0", @@ -3146,6 +3127,7 @@ "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -3155,7 +3137,8 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", - "dev": true + "dev": true, + "optional": true } } }, @@ -3220,7 +3203,8 @@ "monaco-editor": { "version": "0.15.6", "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.15.6.tgz", - "integrity": "sha512-JoU9V9k6KqT9R9Tiw1RTU8ohZ+Xnf9DMg6Ktqqw5hILumwmq7xqa/KLXw513uTUsWbhtnHoSJYYR++u3pkyxJg==" + "integrity": "sha512-JoU9V9k6KqT9R9Tiw1RTU8ohZ+Xnf9DMg6Ktqqw5hILumwmq7xqa/KLXw513uTUsWbhtnHoSJYYR++u3pkyxJg==", + "dev": true }, "monaco-editor-webpack-plugin": { "version": "1.7.0", @@ -4004,11 +3988,6 @@ "ajv-keywords": "^3.1.0" } }, - "select": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz", - "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=" - }, "select-hose": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", @@ -4444,7 +4423,8 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true }, "ssri": { "version": "6.0.1", @@ -4660,11 +4640,6 @@ "setimmediate": "^1.0.4" } }, - "tiny-emitter": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", - "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==" - }, "to-arraybuffer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", @@ -4742,15 +4717,16 @@ "dev": true }, "typescript": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.2.tgz", - "integrity": "sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.2.tgz", + "integrity": "sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA==", "dev": true }, "uc.micro": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.5.tgz", - "integrity": "sha512-JoLI4g5zv5qNyT09f4YAvEZIIV1oOjqnewYg5D38dkQljIzpPT296dbIGvKro3digYI1bkb7W6EP1y4uDlmzLg==" + "integrity": "sha512-JoLI4g5zv5qNyT09f4YAvEZIIV1oOjqnewYg5D38dkQljIzpPT296dbIGvKro3digYI1bkb7W6EP1y4uDlmzLg==", + "dev": true }, "union-value": { "version": "1.0.0", diff --git a/source/nodejs/adaptivecards-designer-app/package.json b/source/nodejs/adaptivecards-designer-app/package.json index af969bc9d0..30c96ddd6f 100644 --- a/source/nodejs/adaptivecards-designer-app/package.json +++ b/source/nodejs/adaptivecards-designer-app/package.json @@ -1,6 +1,6 @@ { "name": "adaptivecards-designer-app", - "version": "0.2.0", + "version": "0.2.1", "description": "Adaptive Card designer app", "author": "AdaptiveCards", "license": "MIT", @@ -11,17 +11,20 @@ "start": "webpack-dev-server --open", "release": "npm run build" }, - "dependencies": { - "adaptivecards-designer": "^0.6.0", - "markdown-it": "^8.4.0", - "monaco-editor": "^0.15.6" - }, "devDependencies": { + "adaptivecards": "^1.3.0-alpha1", + "adaptivecards-controls": "^0.3.0", + "adaptivecards-designer": "^0.7.0", + "markdown-it": "^8.4.0", + "monaco-editor": "^0.15.6", "monaco-editor-webpack-plugin": "^1.7.0", "rimraf": "^2.6.2", "typescript": "^3.2.2", "webpack": "^4.27.1", "webpack-cli": "^3.1.2", "webpack-dev-server": "^3.1.14" + }, + "dependencies": { + "adaptivecards-templating": "^0.1.0-alpha.0" } } diff --git a/source/nodejs/adaptivecards-designer-app/sample-catalogue.json b/source/nodejs/adaptivecards-designer-app/sample-catalogue.json new file mode 100644 index 0000000000..6730be078b --- /dev/null +++ b/source/nodejs/adaptivecards-designer-app/sample-catalogue.json @@ -0,0 +1,21 @@ +[ + { + "displayName": "Social update", + "cardPayloadUrl": "samples/Default.json" + }, + { + "displayName": "Flight update", + "cardPayloadUrl": "samples/FlightUpdate.json", + "dataSampleUrl": "samples/FlightUpdate.data.json" + }, + { + "displayName": "Restaurant", + "cardPayloadUrl": "samples/Restaurant.json", + "dataSampleUrl": "samples/Restaurant.data.json" + }, + { + "displayName": "Stock update", + "cardPayloadUrl": "samples/StockUpdate.json", + "dataSampleUrl": "samples/StockUpdate.data.json" + } +] diff --git a/source/nodejs/adaptivecards-designer-app/samples/Default.json b/source/nodejs/adaptivecards-designer-app/samples/Default.json new file mode 100644 index 0000000000..a865e2b5e7 --- /dev/null +++ b/source/nodejs/adaptivecards-designer-app/samples/Default.json @@ -0,0 +1,109 @@ +{ + "type": "AdaptiveCard", + "body": [ + { + "type": "TextBlock", + "size": "medium", + "weight": "bolder", + "text": "Publish Adaptive Card schema" + }, + { + "type": "ColumnSet", + "columns": [ + { + "type": "Column", + "items": [ + { + "type": "Image", + "style": "Person", + "url": "https://pbs.twimg.com/profile_images/3647943215/d7f12830b3c17a5a9e4afcc370e3a37e_400x400.jpeg", + "size": "Small" + } + ], + "width": "auto" + }, + { + "type": "Column", + "items": [ + { + "type": "TextBlock", + "weight": "Bolder", + "text": "Matt Hidinger", + "wrap": true + }, + { + "type": "TextBlock", + "spacing": "None", + "text": "Created {{DATE(2017-02-14T06:08:39Z,SHORT)}}", + "isSubtle": true, + "wrap": true + } + ], + "width": "stretch" + } + ] + }, + { + "type": "TextBlock", + "text": "Now that we have defined the main rules and features of the format, we need to produce a schema and publish it to GitHub. The schema will be the starting point of our reference documentation.", + "wrap": true + }, + { + "type": "FactSet", + "facts": [ + { + "title": "Board:", + "value": "Adaptive Card" + }, + { + "title": "List:", + "value": "Backlog" + }, + { + "title": "Assigned to:", + "value": "Matt Hidinger" + }, + { + "title": "Due date:", + "value": "Not set" + } + ] + } + ], + "actions": [ + { + "type": "Action.ShowCard", + "title": "Set due date", + "card": { + "type": "AdaptiveCard", + "body": [ + { + "type": "Input.Date", + "id": "dueDate" + }, + { + "type": "Input.Text", + "id": "comment", + "placeholder": "Add a comment", + "isMultiline": true + } + ], + "actions": [ + { + "type": "Action.OpenUrl", + "title": "OK", + "url": "http://adaptivecards.io" + } + ], + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json" + } + }, + { + "type": "Action.OpenUrl", + "title": "View", + "url": "http://adaptivecards.io" + } + ], + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "version": "1.0" +} \ No newline at end of file diff --git a/source/nodejs/adaptivecards-designer-app/samples/FlightUpdate.data.json b/source/nodejs/adaptivecards-designer-app/samples/FlightUpdate.data.json new file mode 100644 index 0000000000..bcfb259e6d --- /dev/null +++ b/source/nodejs/adaptivecards-designer-app/samples/FlightUpdate.data.json @@ -0,0 +1,40 @@ +{ + "@context": "http://schema.org", + "@type": "FlightReservation", + "reservationId": "RXJ34P", + "reservationStatus": "http://schema.org/ReservationConfirmed", + "passengerPriorityStatus": "Fast Track", + "passengerSequenceNumber": "ABC123", + "securityScreening": "TSA PreCheck", + "underName": { + "@type": "Person", + "name": "Eva Green" + }, + "reservationFor": { + "@type": "Flight", + "flightNumber": "UA110", + "provider": { + "@type": "Airline", + "name": "Continental", + "iataCode": "CO", + "boardingPolicy": "http://schema.org/ZoneBoardingPolicy" + }, + "seller": { + "@type": "Airline", + "name": "United", + "iataCode": "UA" + }, + "departureAirport": { + "@type": "Airport", + "name": "San Francisco Airport", + "iataCode": "SFO" + }, + "departureTime": "2017-03-04T20:15:00-08:00", + "arrivalAirport": { + "@type": "Airport", + "name": "John F. Kennedy International Airport", + "iataCode": "JFK" + }, + "arrivalTime": "2017-03-05T06:30:00-05:00" + } + } \ No newline at end of file diff --git a/source/nodejs/adaptivecards-designer-app/samples/FlightUpdate.json b/source/nodejs/adaptivecards-designer-app/samples/FlightUpdate.json new file mode 100644 index 0000000000..6cb0ecbfb5 --- /dev/null +++ b/source/nodejs/adaptivecards-designer-app/samples/FlightUpdate.json @@ -0,0 +1,235 @@ +{ + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "type": "AdaptiveCard", + "version": "1.0", + "speak": "Flight KL0605 to San Fransisco has been delayed.It will not leave until 10:10 AM.", + "body": [ + { + "type": "ColumnSet", + "columns": [ + { + "type": "Column", + "width": "auto", + "items": [ + { + "type": "Image", + "size": "small", + "url": "http://adaptivecards.io/content/airplane.png" + } + ] + }, + { + "type": "Column", + "width": "stretch", + "items": [ + { + "type": "TextBlock", + "text": "Flight Status", + "horizontalAlignment": "right", + "isSubtle": true + }, + { + "type": "TextBlock", + "text": "DELAYED", + "horizontalAlignment": "right", + "spacing": "none", + "size": "large", + "color": "attention" + } + ] + } + ] + }, + { + "type": "ColumnSet", + "separator": true, + "spacing": "medium", + "columns": [ + { + "type": "Column", + "width": "stretch", + "items": [ + { + "type": "TextBlock", + "text": "Passengers", + "isSubtle": true, + "weight": "bolder" + }, + { + "type": "TextBlock", + "text": "Sarah Hum", + "spacing": "small" + }, + { + "type": "TextBlock", + "text": "Jeremy Goldberg", + "spacing": "small" + }, + { + "type": "TextBlock", + "text": "Evan Litvak", + "spacing": "small" + } + ] + }, + { + "type": "Column", + "width": "auto", + "items": [ + { + "type": "TextBlock", + "text": "Seat", + "horizontalAlignment": "right", + "isSubtle": true, + "weight": "bolder" + }, + { + "type": "TextBlock", + "text": "14A", + "horizontalAlignment": "right", + "spacing": "small" + }, + { + "type": "TextBlock", + "text": "14B", + "horizontalAlignment": "right", + "spacing": "small" + }, + { + "type": "TextBlock", + "text": "14C", + "horizontalAlignment": "right", + "spacing": "small" + } + ] + } + ] + }, + { + "type": "ColumnSet", + "spacing": "medium", + "separator": true, + "columns": [ + { + "type": "Column", + "width": 1, + "items": [ + { + "type": "TextBlock", + "text": "Flight", + "isSubtle": true, + "weight": "bolder" + }, + { + "type": "TextBlock", + "text": "KL0605", + "spacing": "small" + } + ] + }, + { + "type": "Column", + "width": 1, + "items": [ + { + "type": "TextBlock", + "text": "Departs", + "isSubtle": true, + "horizontalAlignment": "center", + "weight": "bolder" + }, + { + "type": "TextBlock", + "text": "10:10 AM", + "color": "attention", + "weight": "bolder", + "horizontalAlignment": "center", + "spacing": "small" + } + ] + }, + { + "type": "Column", + "width": 1, + "items": [ + { + "type": "TextBlock", + "text": "Arrives", + "isSubtle": true, + "horizontalAlignment": "right", + "weight": "bolder" + }, + { + "type": "TextBlock", + "text": "12:00 AM", + "color": "attention", + "horizontalAlignment": "right", + "weight": "bolder", + "spacing": "small" + } + ] + } + ] + }, + { + "type": "ColumnSet", + "spacing": "medium", + "separator": true, + "columns": [ + { + "type": "Column", + "width": 1, + "items": [ + { + "type": "TextBlock", + "text": "Amsterdam", + "isSubtle": true + }, + { + "type": "TextBlock", + "text": "AMS", + "size": "extraLarge", + "color": "accent", + "spacing": "none" + } + ] + }, + { + "type": "Column", + "width": "auto", + "items": [ + { + "type": "TextBlock", + "text": " " + }, + { + "type": "Image", + "url": "http://adaptivecards.io/content/airplane.png", + "size": "small" + } + ] + }, + { + "type": "Column", + "width": 1, + "items": [ + { + "type": "TextBlock", + "text": "San Francisco", + "isSubtle": true, + "horizontalAlignment": "right" + }, + { + "type": "TextBlock", + "text": "SFO", + "horizontalAlignment": "right", + "size": "extraLarge", + "color": "accent", + "spacing": "none" + } + ] + } + ] + } + ] + } \ No newline at end of file diff --git a/source/nodejs/adaptivecards-designer-app/samples/Restaurant.data.json b/source/nodejs/adaptivecards-designer-app/samples/Restaurant.data.json new file mode 100644 index 0000000000..078140dcc0 --- /dev/null +++ b/source/nodejs/adaptivecards-designer-app/samples/Restaurant.data.json @@ -0,0 +1,29 @@ +{ + "@context": "http://schema.org/", + "@type": "LocalBusiness", + "name": "Malt \u0026 Vine", + "url": "https://www.yelp.com/biz/malt-and-vine-redmond", + "address": { + "addressLocality": "Redmond", + "addressRegion": "WA", + "streetAddress": "16851 Redmond Way", + "postalCode": "98052", + "addressCountry": "US" + }, + "image": "https://s3-media1.fl.yelpcdn.com/bphoto/HD_NsxwaCTwKRxvOZs2Shw/ls.jpg", + "telephone": "+14258816461", + "aggregateRating": { + "reviewCount": 176, + "@type": "AggregateRating", + "ratingValue": 4.5 + }, + "review": [{ + "reviewRating": { + "ratingValue": 4 + }, + "datePublished": "2014-11-28", + "description": "Great concept and a wide selection of beers both on tap and bottled! Smaller wine selection than I wanted, but the variety of beers certainly made up for that. Although I didn't order anything, my boyfriend got a beer and he loved it. Their prices are fair too. \n\nThe concept is really awesome. It's a bar/store that you can bring outside food into. The place was pretty packed tonight. I wish we had stayed for more than one drink. I would have loved to sample everything!", + "author": "Blaire S." + }], + "priceRange": "$$" +} diff --git a/source/nodejs/adaptivecards-designer-app/samples/Restaurant.json b/source/nodejs/adaptivecards-designer-app/samples/Restaurant.json new file mode 100644 index 0000000000..5873465510 --- /dev/null +++ b/source/nodejs/adaptivecards-designer-app/samples/Restaurant.json @@ -0,0 +1,61 @@ +{ + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "type": "AdaptiveCard", + "version": "1.0", + "body": [ + { + "speak": "Tom's Pie is a Pizza restaurant which is rated 9.3 by customers.", + "type": "ColumnSet", + "columns": [ + { + "type": "Column", + "width": 2, + "items": [ + { + "type": "TextBlock", + "text": "{address.addressLocality}, {address.addressRegion}" + }, + { + "type": "TextBlock", + "text": "{name}", + "weight": "Bolder", + "size": "ExtraLarge", + "spacing": "None" + }, + { + "type": "TextBlock", + "text": "{aggregateRating.ratingValue} ★★★☆ ({aggregateRating.reviewCount}) · {priceRange}", + "isSubtle": true, + "spacing": "None" + }, + { + "type": "TextBlock", + "text": "**{review[0].author}** said \"{review[0].description}\"", + "size": "Small", + "wrap": true, + "maxLines": 3 + } + ] + }, + { + "type": "Column", + "width": 1, + "items": [ + { + "type": "Image", + "url": "{image}", + "size": "auto" + } + ] + } + ] + } + ], + "actions": [ + { + "type": "Action.OpenUrl", + "title": "More Info", + "url": "{url}" + } + ] +} \ No newline at end of file diff --git a/source/nodejs/adaptivecards-designer-app/samples/StockUpdate.data.json b/source/nodejs/adaptivecards-designer-app/samples/StockUpdate.data.json new file mode 100644 index 0000000000..91d26b2341 --- /dev/null +++ b/source/nodejs/adaptivecards-designer-app/samples/StockUpdate.data.json @@ -0,0 +1,26 @@ +{ + "symbol": "MSFT", + "exchange": "NASDAQ", + "company": "Microsoft Corp", + "date": "2019-02-12T18:34:00Z", + "price": "106.70", + "arrow": "up", + "change": "1.45", + "difference": "1.37", + "changeFormatted": "▲ USD 1.45 (1.37%) ", + "changeColor": "attention", + "stages": [ + { + "title": "Open", + "value": "106.14" + }, + { + "title": "High", + "value": "107.14" + }, + { + "title": "Low", + "value": "105.48" + } + ] +} \ No newline at end of file diff --git a/source/nodejs/adaptivecards-designer-app/samples/StockUpdate.json b/source/nodejs/adaptivecards-designer-app/samples/StockUpdate.json new file mode 100644 index 0000000000..458c7b9c30 --- /dev/null +++ b/source/nodejs/adaptivecards-designer-app/samples/StockUpdate.json @@ -0,0 +1,62 @@ +{ + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "type": "AdaptiveCard", + "version": "1.0", + "speak": "{company} stock is trading at {price} a share, which is {arrow} {difference}", + "body": [ + { + "type": "Container", + "items": [ + { + "type": "TextBlock", + "text": "{company} ({exchange}: {symbol})", + "size": "medium", + "isSubtle": true + }, + { + "type": "TextBlock", + "text": "{{DATE({date}, LONG)}} {{TIME({date})}}", + "isSubtle": true + } + ] + }, + { + "type": "Container", + "spacing": "None", + "items": [ + { + "type": "ColumnSet", + "columns": [ + { + "type": "Column", + "width": "stretch", + "items": [ + { + "type": "TextBlock", + "text": "{price}", + "size": "ExtraLarge" + }, + { + "type": "TextBlock", + "text": "{changeFormatted}", + "color": "{changeColor}", + "spacing": "None" + } + ] + }, + { + "type": "Column", + "width": "auto", + "items": [ + { + "type": "FactSet", + "facts": "{stages}" + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/source/nodejs/adaptivecards-designer-app/samples/Symphony.bond.json b/source/nodejs/adaptivecards-designer-app/samples/Symphony.bond.json new file mode 100644 index 0000000000..53190caab3 --- /dev/null +++ b/source/nodejs/adaptivecards-designer-app/samples/Symphony.bond.json @@ -0,0 +1,56 @@ +{ + "type": "org.symphonyoss.fin.rfq.request.bond", + "version": "0.1", + "id": [ + { + "type": "com.factset.portware.ticket.id", + "value": "123456789" + } + ], + "side": "BUY", + "info": { + "description": "IBM 1.25 02/08/2018", + "assetType": "Corporate Bond/Note", + "accruedInterest": 0, + "coupon": 1.25, + "maturityDate": "2018-08-02", + "currency": "USD", + "issuer": [ + { + "type": "com.factset.symbology.id", + "value": "ibm-us" + } + ], + "ratings": [ + { + "type": "org.symphonyoss.fin.rating.agent.sandp", + "value": "AA-" + }, + { + "type": "org.symphonyoss.fin.rating.agent.moody", + "value": "Aa3" + }, + { + "type": "org.symphonyoss.fin.rating.agent.fitch", + "value": "A+" + } + ] + }, + "tradeDate": "2017-11-12", + "settlementDate": "2017-11-14", + "faceValue": 1000000, + "instrument":[ + { + "type": "org.symphonyoss.fin.security.id.isin", + "value": "US459200HK05" + }, + { + "type": "org.symphonyoss.fin.security.id.cusip", + "value": "459200HK0" + }, + { + "type": "org.symphonyoss.fin.security.id.sedol", + "value": "B90NK89" + } + ] +} \ No newline at end of file diff --git a/source/nodejs/adaptivecards-designer-app/src/app.ts b/source/nodejs/adaptivecards-designer-app/src/app.ts index 26d370c489..020327736b 100644 --- a/source/nodejs/adaptivecards-designer-app/src/app.ts +++ b/source/nodejs/adaptivecards-designer-app/src/app.ts @@ -6,10 +6,13 @@ import * as ACDesigner from "adaptivecards-designer"; import "adaptivecards-designer/dist/adaptivecards-designer.css"; import "./app.css"; -// UNCOMMENT below if you plan to use an empty hostContainers array -//import "adaptivecards-designer/dist/adaptivecards-defaulthost.css"; +// Uncomment below if you plan to use an empty hostContainers array +// import "adaptivecards-designer/dist/adaptivecards-defaulthost.css"; + +window.onload = function() { + // Uncomment to enabled preview features such as data binding + // ACDesigner.GlobalSettings.previewFeaturesEnabled = true; -window.onload = function () { ACDesigner.CardDesigner.onProcessMarkdown = (text: string, result: { didProcess: boolean, outputHtml: string }) => { result.outputHtml = new markdownit().render(text); result.didProcess = true; @@ -29,7 +32,76 @@ window.onload = function () { hostContainers.push(new ACDesigner.BotFrameworkContainer("Bot Framework Other Channels (Image render)", "containers/bf-image-container.css")); hostContainers.push(new ACDesigner.ToastContainer("Windows Notifications (Preview)", "containers/toast-container.css")); - let designer = new ACDesigner.CardDesigner(hostContainers); - designer.attachTo(document.getElementById("designerRootHost")); + let designer = new ACDesigner.CardDesigner(hostContainers); + designer.sampleCatalogueUrl = window.location.origin + "/sample-catalogue.json"; + designer.attachTo(document.getElementById("designerRootHost")); + + /* Uncomment to test a custom palette item example + let exampleSnippet = new ACDesigner.SnippetPaletteItem("Custom", "Example"); + exampleSnippet.snippet = { + type: "ColumnSet", + columns: [ + { + width: "auto", + items: [ + { + type: "Image", + size: "Small", + style: "Person", + url: "https://pbs.twimg.com/profile_images/3647943215/d7f12830b3c17a5a9e4afcc370e3a37e_400x400.jpeg" + } + ] + }, + { + width: "stretch", + items: [ + { + type: "TextBlock", + text: "John Doe", + weight: "Bolder", + wrap: true + }, + { + type: "TextBlock", + spacing: "None", + text: "Additional information", + wrap: true + } + ] + } + ] + }; + + designer.customPaletteItems = [ exampleSnippet ]; + */ + designer.monacoModuleLoaded(monaco); -}; + + let sampleData = { + firstName: "John", + lastName: "Doe", + age: 45, + isMarried: true, + address: { + street: "1234 555th Ave NE", + city: "Redmond", + state: "WA", + countryOrRegion: "USA" + }, + children: [ + { + firstName: "Jennifer", + lastName: "Doe", + age: 9 + }, + { + firstName: "James", + lastName: "Doe", + age: 13 + } + ] + }; + + designer.dataStructure = ACDesigner.FieldDefinition.create(sampleData); + designer.sampleData = sampleData; +} diff --git a/source/nodejs/adaptivecards-designer/index.html b/source/nodejs/adaptivecards-designer/index.html index 68ac3d78ec..8729f550de 100644 --- a/source/nodejs/adaptivecards-designer/index.html +++ b/source/nodejs/adaptivecards-designer/index.html @@ -18,7 +18,9 @@ + + + + + + + +
+