11import * as monacoLoader from '@monaco-editor/loader' ;
22import { Versions } from 'adaptivecards' ;
33import { BindingPreviewMode , CardDesigner , FieldDefinition , GlobalSettings , HostContainer , ToolbarChoicePicker } from 'adaptivecards-designer' ;
4- import * as markdownit from " markdown-it" ;
4+ import * as markdownit from ' markdown-it' ;
55import { Spinner , SpinnerSize } from 'office-ui-fabric-react/lib/Spinner' ;
66import * as React from 'react' ;
77import { useEffect , useRef , useState } from 'react' ;
@@ -14,15 +14,15 @@ import { initializeDesignerPeers } from './fluentUI/peers/DesignerPeers';
1414import { IAdaptiveCardDesignerHostProps } from './IAdaptiveCardDesignerProps' ;
1515
1616export const EmptyCard = {
17- " $schema" : " http://adaptivecards.io/schemas/adaptive-card.json" ,
18- " type" : " AdaptiveCard" ,
19- " version" : " 1.5"
17+ ' $schema' : ' http://adaptivecards.io/schemas/adaptive-card.json' ,
18+ ' type' : ' AdaptiveCard' ,
19+ ' version' : ' 1.5'
2020} ;
2121
2222export const AdaptiveCardDesigner = ( props : IAdaptiveCardDesignerHostProps ) => {
2323 const adaptiveCardDesignerInstanceRef = useRef < CardDesigner > ( null ) ;
2424 const renderElementRef = useRef < HTMLDivElement > ( ) ;
25- const currentBreakpointValueRef = useRef < string > ( " 100%" ) ;
25+ const currentBreakpointValueRef = useRef < string > ( ' 100%' ) ;
2626 const [ isMonacoLoaded , setIsMonacoLoaded ] = useState ( false ) ;
2727 const monacoRef = useRef < HTMLDivElement > ( null ) ;
2828
@@ -92,10 +92,10 @@ export const AdaptiveCardDesigner = (props: IAdaptiveCardDesignerHostProps) => {
9292
9393 if ( props . addDefaultAdaptiveCardHostContainer ) {
9494 hosts . push ( ...[
95- new AdaptiveCardHostContainer ( " ACH - Default" , AdaptiveCardHostContainerType . Default ) ,
96- new AdaptiveCardHostContainer ( " ACH - Teams" , AdaptiveCardHostContainerType . TeamsDefault ) ,
97- new AdaptiveCardHostContainer ( " ACH - Teams Dark" , AdaptiveCardHostContainerType . TeamsDark ) ,
98- new AdaptiveCardHostContainer ( " ACH - Teams High Contrast" , AdaptiveCardHostContainerType . TeamsHighContrast )
95+ new AdaptiveCardHostContainer ( ' ACH - Default' , AdaptiveCardHostContainerType . Default ) ,
96+ new AdaptiveCardHostContainer ( ' ACH - Teams' , AdaptiveCardHostContainerType . TeamsDefault ) ,
97+ new AdaptiveCardHostContainer ( ' ACH - Teams Dark' , AdaptiveCardHostContainerType . TeamsDark ) ,
98+ new AdaptiveCardHostContainer ( ' ACH - Teams High Contrast' , AdaptiveCardHostContainerType . TeamsHighContrast )
9999 ] ) ;
100100 }
101101
@@ -105,12 +105,12 @@ export const AdaptiveCardDesigner = (props: IAdaptiveCardDesignerHostProps) => {
105105 ? props . bindingPreviewMode
106106 : BindingPreviewMode . GeneratedData ;
107107
108- addToolbarButton ( cardDesigner , " New Card" , " acd-icon-newCard" ,
108+ addToolbarButton ( cardDesigner , ' New Card' , ' acd-icon-newCard' ,
109109 CardDesigner . ToolbarCommands . NewCard ,
110110 true ,
111111 CardDesigner . ToolbarCommands . NewCard ,
112112 ( sender ) => {
113- let text = " Do you want to create a new Card?" ;
113+ let text = ' Do you want to create a new Card?' ;
114114 if ( confirm ( text ) == true ) {
115115 cardDesigner . setCard ( ( props . newCardPayload ) ? props . newCardPayload : EmptyCard ) ;
116116 cardDesigner . clearUndoStack ( ) ;
@@ -119,7 +119,7 @@ export const AdaptiveCardDesigner = (props: IAdaptiveCardDesignerHostProps) => {
119119 } ) ;
120120
121121 if ( props . onSave ) {
122- addToolbarButton ( cardDesigner , " Save" , " acd-icon-save" ,
122+ addToolbarButton ( cardDesigner , ' Save' , ' acd-icon-save' ,
123123 CardDesigner . ToolbarCommands . NewCard ,
124124 true ,
125125 null ,
@@ -130,15 +130,15 @@ export const AdaptiveCardDesigner = (props: IAdaptiveCardDesignerHostProps) => {
130130 }
131131
132132 if ( props . showFluentBreakpointsPicker ) {
133- addToolbarChoicePicker ( cardDesigner , CardDesigner . ToolbarCommands . HostAppPicker , true , " Breakpoints:" ,
133+ addToolbarChoicePicker ( cardDesigner , CardDesigner . ToolbarCommands . HostAppPicker , true , ' Breakpoints:' ,
134134 [
135- { name : " Fluid (fit content)" , value : " 100%" } ,
136- { name : " Small (>= 320px)" , value : " 320px" } ,
137- { name : " Medium (>= 480px)" , value : " 480px" } ,
138- { name : " Large (>= 640px)" , value : " 640px" } ,
139- { name : " Extra large (>= 1024px)" , value : " 1024px" } ,
140- { name : " Extra extra large (>= 1366px)" , value : " 1366px" } ,
141- { name : " Extra extra extra large (>= 1920px)" , value : " 1920px" }
135+ { name : ' Fluid (fit content)' , value : ' 100%' } ,
136+ { name : ' Small (>= 320px)' , value : ' 320px' } ,
137+ { name : ' Medium (>= 480px)' , value : ' 480px' } ,
138+ { name : ' Large (>= 640px)' , value : ' 640px' } ,
139+ { name : ' Extra large (>= 1024px)' , value : ' 1024px' } ,
140+ { name : ' Extra extra large (>= 1366px)' , value : ' 1366px' } ,
141+ { name : ' Extra extra extra large (>= 1920px)' , value : ' 1920px' }
142142 ] ,
143143 ( sender : ToolbarChoicePicker ) => {
144144 currentBreakpointValueRef . current = sender . value ;
@@ -175,7 +175,7 @@ export const AdaptiveCardDesigner = (props: IAdaptiveCardDesignerHostProps) => {
175175 console . log ( hostConfig ) ;
176176 } ;
177177
178- cardDesigner . designerSurface . context . hostContainer . cardHost . style . width = " 100%" ;
178+ cardDesigner . designerSurface . context . hostContainer . cardHost . style . width = ' 100%' ;
179179 cardDesigner . dataToolbox . collapse ( ) ;
180180
181181 let data = ( props . data ) ? props . data : { $root : { } } ;
@@ -197,15 +197,15 @@ export const AdaptiveCardDesigner = (props: IAdaptiveCardDesignerHostProps) => {
197197 { ! isMonacoLoaded &&
198198 < Spinner
199199 style = { {
200- display : " flex" ,
201- justifyContent : " center" ,
202- alignItems : " center" ,
203- height : " 100%"
200+ display : ' flex' ,
201+ justifyContent : ' center' ,
202+ alignItems : ' center' ,
203+ height : ' 100%'
204204 } }
205205 size = { SpinnerSize . medium }
206- label = " loading..."
207- ariaLive = " assertive"
208- labelPosition = " bottom" />
206+ label = ' loading...'
207+ ariaLive = ' assertive'
208+ labelPosition = ' bottom' />
209209 }
210210 </ > ) ;
211211} ;
0 commit comments