From 9a80de0b7ed8404a293c4eef34d5ffc13cfdaa3c Mon Sep 17 00:00:00 2001 From: Alex Terentiev Date: Mon, 23 Oct 2023 15:03:53 -0700 Subject: [PATCH 01/13] SP API --- .../sharepoint/sharePointActivityHandler.ts | 131 +++++++++ libraries/botframework-schema/package.json | 3 +- libraries/botframework-schema/src/index.ts | 3 + .../src/sharepoint/aceData.ts | 20 ++ .../src/sharepoint/aceRequest.ts | 17 ++ .../src/sharepoint/actions/cardAction.ts | 276 ++++++++++++++++++ .../src/sharepoint/actions/focusParameters.ts | 20 ++ .../src/sharepoint/actions/index.ts | 5 + .../sharepoint/cardView/baseCardComponent.ts | 30 ++ .../sharepoint/cardView/cardBarComponent.ts | 23 ++ .../src/sharepoint/cardView/cardButtonBase.ts | 19 ++ .../cardView/cardButtonComponent.ts | 23 ++ .../src/sharepoint/cardView/cardImage.ts | 16 + .../cardView/cardSearchBoxComponent.ts | 35 +++ .../cardView/cardSearchFooterComponent.ts | 40 +++ .../sharepoint/cardView/cardTextComponent.ts | 19 ++ .../cardView/cardTextInputComponent.ts | 68 +++++ .../sharepoint/cardView/cardViewParameters.ts | 218 ++++++++++++++ .../src/sharepoint/cardView/index.ts | 10 + .../src/sharepoint/cardViewResponse.ts | 13 + .../getPropertyPaneConfigurationResponse.ts | 11 + .../src/sharepoint/handleActionResponse.ts | 30 ++ .../src/sharepoint/index.ts | 30 ++ .../propertyPaneCheckboxProperties.ts | 10 + .../propertyPaneChoiceGroupIconProperties.ts | 6 + .../propertyPaneChoiceGroupImageSize.ts | 7 + .../propertyPaneChoiceGroupOption.ts | 16 + .../propertyPaneChoiceGroupProperties.ts | 10 + .../sharepoint/propertyPaneDropDownOptions.ts | 18 ++ .../propertyPaneDropDownProperties.ts | 16 + .../sharepoint/propertyPaneFieldProperties.ts | 6 + .../src/sharepoint/propertyPaneGroup.ts | 12 + .../src/sharepoint/propertyPaneGroupField.ts | 23 ++ .../propertyPaneGroupOrConditionalGroup.ts | 6 + .../sharepoint/propertyPaneLabelProperties.ts | 9 + .../propertyPaneLinkPopupWindowProperties.ts | 17 ++ .../sharepoint/propertyPaneLinkProperties.ts | 14 + .../src/sharepoint/propertyPanePage.ts | 11 + .../src/sharepoint/propertyPanePageHeader.ts | 6 + .../propertyPaneSliderProperties.ts | 15 + .../propertyPaneTextFieldProperties.ts | 23 ++ .../propertyPaneToggleProperties.ts | 16 + .../src/sharepoint/quickViewData.ts | 6 + .../src/sharepoint/quickViewResponse.ts | 16 + .../setPropertyPaneConfigurationResponse.ts | 5 + yarn.lock | 5 + 46 files changed, 1332 insertions(+), 1 deletion(-) create mode 100644 libraries/botbuilder/src/sharepoint/sharePointActivityHandler.ts create mode 100644 libraries/botframework-schema/src/sharepoint/aceData.ts create mode 100644 libraries/botframework-schema/src/sharepoint/aceRequest.ts create mode 100644 libraries/botframework-schema/src/sharepoint/actions/cardAction.ts create mode 100644 libraries/botframework-schema/src/sharepoint/actions/focusParameters.ts create mode 100644 libraries/botframework-schema/src/sharepoint/actions/index.ts create mode 100644 libraries/botframework-schema/src/sharepoint/cardView/baseCardComponent.ts create mode 100644 libraries/botframework-schema/src/sharepoint/cardView/cardBarComponent.ts create mode 100644 libraries/botframework-schema/src/sharepoint/cardView/cardButtonBase.ts create mode 100644 libraries/botframework-schema/src/sharepoint/cardView/cardButtonComponent.ts create mode 100644 libraries/botframework-schema/src/sharepoint/cardView/cardImage.ts create mode 100644 libraries/botframework-schema/src/sharepoint/cardView/cardSearchBoxComponent.ts create mode 100644 libraries/botframework-schema/src/sharepoint/cardView/cardSearchFooterComponent.ts create mode 100644 libraries/botframework-schema/src/sharepoint/cardView/cardTextComponent.ts create mode 100644 libraries/botframework-schema/src/sharepoint/cardView/cardTextInputComponent.ts create mode 100644 libraries/botframework-schema/src/sharepoint/cardView/cardViewParameters.ts create mode 100644 libraries/botframework-schema/src/sharepoint/cardView/index.ts create mode 100644 libraries/botframework-schema/src/sharepoint/cardViewResponse.ts create mode 100644 libraries/botframework-schema/src/sharepoint/getPropertyPaneConfigurationResponse.ts create mode 100644 libraries/botframework-schema/src/sharepoint/handleActionResponse.ts create mode 100644 libraries/botframework-schema/src/sharepoint/index.ts create mode 100644 libraries/botframework-schema/src/sharepoint/propertyPaneCheckboxProperties.ts create mode 100644 libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupIconProperties.ts create mode 100644 libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupImageSize.ts create mode 100644 libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupOption.ts create mode 100644 libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupProperties.ts create mode 100644 libraries/botframework-schema/src/sharepoint/propertyPaneDropDownOptions.ts create mode 100644 libraries/botframework-schema/src/sharepoint/propertyPaneDropDownProperties.ts create mode 100644 libraries/botframework-schema/src/sharepoint/propertyPaneFieldProperties.ts create mode 100644 libraries/botframework-schema/src/sharepoint/propertyPaneGroup.ts create mode 100644 libraries/botframework-schema/src/sharepoint/propertyPaneGroupField.ts create mode 100644 libraries/botframework-schema/src/sharepoint/propertyPaneGroupOrConditionalGroup.ts create mode 100644 libraries/botframework-schema/src/sharepoint/propertyPaneLabelProperties.ts create mode 100644 libraries/botframework-schema/src/sharepoint/propertyPaneLinkPopupWindowProperties.ts create mode 100644 libraries/botframework-schema/src/sharepoint/propertyPaneLinkProperties.ts create mode 100644 libraries/botframework-schema/src/sharepoint/propertyPanePage.ts create mode 100644 libraries/botframework-schema/src/sharepoint/propertyPanePageHeader.ts create mode 100644 libraries/botframework-schema/src/sharepoint/propertyPaneSliderProperties.ts create mode 100644 libraries/botframework-schema/src/sharepoint/propertyPaneTextFieldProperties.ts create mode 100644 libraries/botframework-schema/src/sharepoint/propertyPaneToggleProperties.ts create mode 100644 libraries/botframework-schema/src/sharepoint/quickViewData.ts create mode 100644 libraries/botframework-schema/src/sharepoint/quickViewResponse.ts create mode 100644 libraries/botframework-schema/src/sharepoint/setPropertyPaneConfigurationResponse.ts diff --git a/libraries/botbuilder/src/sharepoint/sharePointActivityHandler.ts b/libraries/botbuilder/src/sharepoint/sharePointActivityHandler.ts new file mode 100644 index 0000000000..54618744df --- /dev/null +++ b/libraries/botbuilder/src/sharepoint/sharePointActivityHandler.ts @@ -0,0 +1,131 @@ +/** + * @module botbuilder + */ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + +import { + ActivityHandler, + InvokeResponse, + AceRequest, + TurnContext, + CardViewResponse, + QuickViewResponse, + GetPropertyPaneConfigurationResponse, + SetPropertyPaneConfigurationResponse, + HandleActionResponse +} from 'botbuilder-core'; + +/** + * The SharePointActivityHandler is derived from ActivityHandler. It adds support for + * the SharePoint specific events and interactions + */ +export class SharePointActivityHandler extends ActivityHandler { + /** + * Invoked when an invoke activity is received from the connector. + * Invoke activities can be used to communicate many different things. + * @param context A strongly-typed context object for this turn + * @returns A task that represents the work queued to execute + * + * Invoke activities communicate programmatic commands from a client or channel to a bot. + */ + protected async onInvokeActivity(context: TurnContext): Promise { + try { + if (!context.activity.name && context.activity.channelId === 'sharepoint') { + throw new Error('NotImplemented'); + } else { + switch (context.activity.name) { + case 'cardExtension/getCardView': + return ActivityHandler.createInvokeResponse( + await this.OnSharePointTaskGetCardViewAsync(context, (context.activity.value as AceRequest)) + ); + + case 'cardExtension/getQuickView': + return ActivityHandler.createInvokeResponse( + await this.OnSharePointTaskGetQuickViewAsync(context, (context.activity.value as AceRequest)) + ); + + case 'cardExtension/getPropertyPaneConfiguration': + return ActivityHandler.createInvokeResponse( + await this.OnSharePointTaskGetPropertyPaneConfigurationAsync(context, (context.activity.value as AceRequest)) + ); + + case 'cardExtension/setPropertyPaneConfiguration': + return ActivityHandler.createInvokeResponse( + await this.OnSharePointTaskSetPropertyPaneConfigurationAsync(context, (context.activity.value as AceRequest)) + ); + case 'cardExtension/handleAction': + return ActivityHandler.createInvokeResponse( + await this.OnSharePointTaskHandleActionAsync(context, (context.activity.value as AceRequest)) + ); + default: + return super.onInvokeActivity(context); + } + } + } catch (err) { + if (err.message === 'NotImplemented') { + return { status: 501 }; + } else if (err.message === 'BadRequest') { + return { status: 400 }; + } + throw err; + } + } + + /** + * Override this in a derived class to provide logic for when a card view is fetched + * + * @param context - A strongly-typed context object for this turn + * @param taskModuleRequest - The task module invoke request value payload + * @returns A task module response for the request + */ + protected async OnSharePointTaskGetCardViewAsync(context: TurnContext, aceRequest: AceRequest): Promise{ + throw new Error('NotImplemented'); + } + + /** + * Override this in a derived class to provide logic for when a quick view is fetched + * + * @param context - A strongly-typed context object for this turn + * @param taskModuleRequest - The task module invoke request value payload + * @returns A task module response for the request + */ + protected async OnSharePointTaskGetQuickViewAsync(context: TurnContext, aceRequest: AceRequest): Promise{ + throw new Error('NotImplemented'); + } + + /** + * Override this in a derived class to provide logic for getting configuration pane properties. + * + * @param context - A strongly-typed context object for this turn + * @param taskModuleRequest - The task module invoke request value payload + * @returns A task module response for the request + */ + protected async OnSharePointTaskGetPropertyPaneConfigurationAsync(context: TurnContext, aceRequest: AceRequest): Promise{ + throw new Error('NotImplemented'); + } + + /** + * Override this in a derived class to provide logic for setting configuration pane properties. + * + * @param context - A strongly-typed context object for this turn + * @param taskModuleRequest - The task module invoke request value payload + * @returns A task module response for the request + */ + protected async OnSharePointTaskSetPropertyPaneConfigurationAsync(context: TurnContext, aceRequest: AceRequest): Promise{ + throw new Error('NotImplemented'); + } + + /** + * Override this in a derived class to provide logic for setting configuration pane properties. + * + * @param context - A strongly-typed context object for this turn + * @param taskModuleRequest - The task module invoke request value payload + * @returns A task module response for the request + */ + protected async OnSharePointTaskHandleActionAsync(context: TurnContext, aceRequest: AceRequest): Promise{ + throw new Error('NotImplemented'); + } +} \ No newline at end of file diff --git a/libraries/botframework-schema/package.json b/libraries/botframework-schema/package.json index 45d6bca1f1..fab3d0030c 100644 --- a/libraries/botframework-schema/package.json +++ b/libraries/botframework-schema/package.json @@ -28,7 +28,8 @@ }, "dependencies": { "uuid": "^8.3.2", - "zod": "~1.11.17" + "zod": "~1.11.17", + "adaptivecards": "1.2.3" }, "scripts": { "build": "tsc -b", diff --git a/libraries/botframework-schema/src/index.ts b/libraries/botframework-schema/src/index.ts index 34d5cc53ff..ea98f9aa5e 100644 --- a/libraries/botframework-schema/src/index.ts +++ b/libraries/botframework-schema/src/index.ts @@ -17,6 +17,9 @@ export { TokenExchangeInvokeResponse } from './tokenExchangeInvokeResponse'; // The Teams schemas was manually added to this library. This file has been updated to export those schemas. export * from './teams'; +// The SharePoint schemas was manually added to this library. This file has been updated to export those schemas. +export * from './sharepoint'; + /** * Attachment View name and size */ diff --git a/libraries/botframework-schema/src/sharepoint/aceData.ts b/libraries/botframework-schema/src/sharepoint/aceData.ts new file mode 100644 index 0000000000..ed7c5441a0 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/aceData.ts @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/** + * SharePoint Ace Data object + */ +export interface AceData { + cardSize: AceCardSize; + dataVersion: string; + id: string; + title: string; + iconProperty: string; + description: string; + properties: any; +} + +/** + * SharePoint Ace Card Size + */ +export type AceCardSize = "Medium" | "Large"; \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/aceRequest.ts b/libraries/botframework-schema/src/sharepoint/aceRequest.ts new file mode 100644 index 0000000000..8381c58246 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/aceRequest.ts @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/** + * ACE invoke request payload. + */ +export interface AceRequest { + /** + * @member {any} [data] User ACE request data. Free payload with key-value pairs. + */ + data?: any; // eslint-disable-line @typescript-eslint/no-explicit-any + + /** + * @member {any} [properties] ACE properties data. + */ + properties?: any; // eslint-disable-line @typescript-eslint/no-explicit-any +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/actions/cardAction.ts b/libraries/botframework-schema/src/sharepoint/actions/cardAction.ts new file mode 100644 index 0000000000..7a16b6fa98 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/actions/cardAction.ts @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/** + * Confirmation Dialog option that is passed through `Submit` Action is executed. + */ +export interface ConfirmationDialog { + /** + * Dialog title. + */ + title: string; + + /** + * Dialog message. + */ + message: string; +} + +/** + * Interface for location coordinates + */ +export interface Location { + /** + * Latitude of the location. + */ + latitude: number; + + /** + * Longitude of the location. + */ + longitude: number; + + /** + * Timestamp + */ + timestamp?: number; + + /** + * Accuracy of the location. + */ + accuracy?: number; +} + +/** + * Enum value to specify the type of media. + */ +export enum MediaType { + Image = 1, + Audio = 4, + Document = 8 +} + +/** + * Open the quick view. + */ +export interface QuickViewCardAction { + /** + * Indicates this action opens the quick view. + */ + type: 'QuickView'; + + /** + * Parameters for the quick view opened by this action + */ + parameters: QuickViewParameters; +} + +/** + * Parameters for opening a Quick view. + */ +export interface QuickViewParameters { + /** + * The view of the Quick view to open. + */ + view: string; +} + +/** +* Open an external link. +*/ +export interface ExternalLinkCardAction { + /** + * Indicates this is an external link button. + */ + type: 'ExternalLink'; + + /** + * Parameters for the external link. + */ + parameters: ExternalLinkActionParameters; +} + +/** + * Parameters for opening an external link. + */ +export interface ExternalLinkActionParameters { + /** + * Indicates whether this is a Teams Deep Link. + */ + isTeamsDeepLink?: boolean; + + /** + * The URL of the link. + */ + target: string; +} + +/** + * Invoke an `Action.Submit` event. + */ +export interface SubmitCardAction { + /** + * Indicates this is a Submit button. + */ + type: 'Submit'; + + /** + * Parameters passed to the Submit event handler. + */ + parameters: SubmitCardParameters; + + /** + * Confirmation dialog option passed to the submit handler. + */ + confirmationDialog?: ConfirmationDialog; +} + +/** + * Invoke an `Action.Execute` event. + */ +export interface ExecuteCardAction { + /** + * Indicates this is an Execute button. + */ + type: 'Execute'; + + /** + * Verb associated with this action + */ + verb?: string; + + /** + * Parameters passed to the Execute event handler + */ + parameters: ExecuteCardParameters; +} + +/** + * Parameters for Execute card action. + */ +export interface ExecuteCardParameters { + /** + * Key value pair property that can be defined for execute card action parameters. + */ + [key: string]: unknown; +} + +/** + * Parameters for submit card action. + */ +export interface SubmitCardParameters { + /** + * Key value pair property that can be defined for submit card action parameters. + */ + [key: string]: unknown; +} + +/** + * Invoke an `VivaAction.SelectMedia` event. + */ +export interface SelectMediaCardAction { + /** + * Indicates this is a Viva Select Media button. + */ + type: 'VivaAction.SelectMedia'; + + /** + * Parameters for the Select Media Action + */ + parameters: SelectMediaActionParameters; +} + +/** + * Parameters that can be supplied with the Viva Select Media Action. + */ +export interface SelectMediaActionParameters { + /** + * Specify the specific media type that should be selected + */ + mediaType: MediaType; + + /** + * Allow multiple images to be selected. + */ + allowMultipleCapture?: boolean; + + /** + * Max file size that can be uploaded. + */ + maxSizePerFile?: number; + + /** + * File formats supported for upload. + */ + supportedFileFormats?: string[]; +} + +/** + * Invoke an `VivaAction.ShowLocation` event. + */ +export interface ShowLocationCardAction { + /** + * Indicates this is a Viva show Location button. + */ + type: 'VivaAction.ShowLocation'; + /** + * Parameters that can be supplied with the Viva Show Location Action. + */ + parameters?: ShowLocationActionParameters; +} + +/** + * Parameters that can be supplied with the Viva Show Location Action. + */ +export interface ShowLocationActionParameters { + /** + * If set, show the coordinates that were passed. + * Otherwise, show the current location. + */ + locationCoordinates?: Location; +} + +/** + * Invoke an `VivaAction.GetLocation` event. + */ +export interface GetLocationCardAction { + /** + * Indicates this is a Viva Select Location button. + */ + type: 'VivaAction.GetLocation'; + /** + * Parameters that can be supplied with the Viva Get Location Action. + */ + parameters?: GetLocationActionParameters; +} + +/** + * Parameters that can be supplied with the Viva Get Location Action. + */ +export interface GetLocationActionParameters { + /** + * If true, allow the user to choose a location by opening a map. + * Otherwise, get the current location. + */ + chooseLocationOnMap?: boolean; +} + +/** + * Type of handler for when a button is pressed. + */ +export type CardAction = + | QuickViewCardAction + | ExternalLinkCardAction + | SubmitCardAction + | SelectMediaCardAction + | GetLocationCardAction + | ShowLocationCardAction + | ExecuteCardAction; + +export type OnCardSelectionAction = QuickViewCardAction + | ExternalLinkCardAction + | SelectMediaCardAction + | GetLocationCardAction + | ShowLocationCardAction + | ExecuteCardAction + | undefined; \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/actions/focusParameters.ts b/libraries/botframework-schema/src/sharepoint/actions/focusParameters.ts new file mode 100644 index 0000000000..fd3fd76619 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/actions/focusParameters.ts @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/** + * Interface to give third party developers the capability to determine which element should recieve focus, when, and how often content should be read. + */ +export interface FocusParameters { + /** + * Sets the default focus on the DOM. Developers pass in the id of a unique element that is to attain focus within a quick view. + * If the `focusTarget` is not defined then the root element is selected. + */ + focusTarget?: string; + /** + * Sets the accessibility reading of the contents within the focus target. + * Polite - Content in the target's subtree is read when the user is idle. + * Assertive - Disrupts any announcement in favor of the changed contents within the target's subtree. + * Off - The screen reader will not read contents within the target's subtree. + */ + ariaLive?: 'polite' | 'assertive' | 'off'; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/actions/index.ts b/libraries/botframework-schema/src/sharepoint/actions/index.ts new file mode 100644 index 0000000000..7755f35503 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/actions/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +export * from './cardAction'; +export * from './focusParameters'; \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/cardView/baseCardComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/baseCardComponent.ts new file mode 100644 index 0000000000..1373e50658 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/cardView/baseCardComponent.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/** + * Names of the components allowed in a card view. + */ +export type CardComponentName = + | 'text' + | 'cardButton' + | 'cardBar' + | 'textInput' + | 'searchBox' + | 'searchFooter'; + +/** + * Base card view component. + * + * @public + */ +export interface BaseCardComponent { + /** + * Unique component name. + * For example, "textInput" + */ + componentName: CardComponentName; + /** + * Optional unique identifier of the component's instance. + */ + id?: string; +} diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardBarComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardBarComponent.ts new file mode 100644 index 0000000000..7482313a7c --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardBarComponent.ts @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import type { CardImage } from './cardImage'; +import type { BaseCardComponent } from './baseCardComponent'; + +/** + * Card view title area (card bar) component parameters + */ +export interface CardBarComponent extends BaseCardComponent { + /** + * Unique component name. + */ + componentName: 'cardBar'; + /** + * The icon to display. + */ + icon?: CardImage; + /** + * The title to display. + */ + title?: string; +} diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardButtonBase.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardButtonBase.ts new file mode 100644 index 0000000000..c2a1f68533 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardButtonBase.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import type { CardAction } from '../actions/cardAction'; + +/** + * Base properties for the buttons used in different ACE card view components, such as Text Input and Search Box and Card Button. + */ +export interface CardButtonBase { + /** + * The type of the button. + */ + action: CardAction; + /** + * Unique Id of the button. + * + */ + id?: string; +} diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardButtonComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardButtonComponent.ts new file mode 100644 index 0000000000..ae31bfa7b7 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardButtonComponent.ts @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import type { BaseCardComponent } from './baseCardComponent'; +import type { CardButtonBase } from './cardButtonBase'; + +/** + * Card button component. + */ +export interface CardButtonComponent extends BaseCardComponent, CardButtonBase { + /** + * Unique component name. + */ + componentName: 'cardButton'; + /** + * Text displayed on the button. + */ + title: string; + /** + * Controls the style of the button. + */ + style?: 'default' | 'positive'; +} diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardImage.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardImage.ts new file mode 100644 index 0000000000..916bbf4590 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardImage.ts @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/** + * Properties for the image or icon rendered in a card view. + */ +export interface CardImage { + /** + * The URL to display as image or icon. + */ + url: string; + /** + * The alt text. + */ + altText?: string; + } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardSearchBoxComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardSearchBoxComponent.ts new file mode 100644 index 0000000000..2c9286a3b4 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardSearchBoxComponent.ts @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import type { BaseCardComponent } from './baseCardComponent'; +import type { CardButtonBase } from './cardButtonBase'; + +/** + * Search box button properties. + */ +export interface ICardSearchBoxButton extends CardButtonBase {} + +/** + * Search box component parameters. Represents a search box rendered in the card view. + */ +export interface CardSearchBoxComponent extends BaseCardComponent { + /** + * Unique component name. + */ + componentName: 'searchBox'; + + /** + * Placeholder text to display. + */ + placeholder?: string; + + /** + * Default value to display. + */ + defaultValue?: string; + + /** + * Button displayed on the search box. + */ + button: ICardSearchBoxButton; +} diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardSearchFooterComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardSearchFooterComponent.ts new file mode 100644 index 0000000000..65179aaca5 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardSearchFooterComponent.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import type { CardAction } from '../actions/cardAction'; +import type { BaseCardComponent } from './baseCardComponent'; + +/** + * Search footer component parameters. Represents a container with an image (in the shape of a circle) and text. + */ +export interface CardSearchFooterComponent extends BaseCardComponent { + /** + * Unique component name. + */ + componentName: 'searchFooter'; + + /** + * Title text to display. + */ + title: string; + + /** + * Url to the image to use, should be a square aspect ratio and big enough to fit in the image area. + */ + imageUrl?: string; + + /** + * The initials to display in the image area when there is no image. + */ + imageInitials?: string; + + /** + * Primary text to display. For example, name of the person for people search. + */ + text: string; + + /** + * Action to invoke when the footer is selected. + */ + onSelection?: CardAction; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardTextComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardTextComponent.ts new file mode 100644 index 0000000000..c307c6a113 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardTextComponent.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import type { BaseCardComponent } from './baseCardComponent'; + +/** + * Text component parameters. Represents a text block rendered in the card view. + */ +export interface CardTextComponent extends BaseCardComponent { + /** + * Unique component name. + */ + componentName: 'text'; + + /** + * Text to display. + */ + text: string; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardTextInputComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardTextInputComponent.ts new file mode 100644 index 0000000000..205e336fe2 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardTextInputComponent.ts @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import type { CardImage } from './cardImage'; +import type { BaseCardComponent } from './baseCardComponent'; +import type { CardButtonBase } from './cardButtonBase'; + +/** + * Text input icon button. + */ +export interface ICardTextInputIconButton extends CardButtonBase { + /** + * Properties for the icon displayed on the button. + */ + icon: CardImage; +} + +/** + * Text input title button. + * + * @public + */ +export interface ICardTextInputTitleButton extends CardButtonBase { + /** + * Text displayed on the button. + */ + title: string; +} + +/** + * Text input component parameters. + */ +export interface CardTextInputComponent extends BaseCardComponent { + /** + * Unique component name. + */ + componentName: 'textInput'; + + /** + * Placeholder text to display. + */ + placeholder?: string; + + /** + * Default value to display. + */ + defaultValue?: string; + + /** + * Properties for an optional icon, displayed in the left end of the text input. + */ + iconBefore?: CardImage; + + /** + * Properties for an optional icon, displayed in the right end of the text input. + */ + iconAfter?: CardImage; + + /** + * Optional button to display. + */ + button?: ICardTextInputIconButton | ICardTextInputTitleButton; + + /** + * Aria label for the text field. + */ + ariaLabel?: string; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardViewParameters.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardViewParameters.ts new file mode 100644 index 0000000000..8d51af7e26 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardViewParameters.ts @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import { CardImage } from './cardImage'; +import { CardBarComponent } from './cardBarComponent'; +import { CardButtonComponent } from './cardButtonComponent'; +import { CardSearchBoxComponent } from './cardSearchBoxComponent'; +import { CardSearchFooterComponent } from './cardSearchFooterComponent'; +import { CardTextComponent } from './cardTextComponent'; +import { CardTextInputComponent } from './cardTextInputComponent'; + +/** + * The actions-only footer parameters for the card view. + */ +export type CardViewActionsFooterParameters = + | [CardButtonComponent] + | [CardButtonComponent, CardButtonComponent] + | undefined; + +/** + * The footer parameters for the card view. Can contain either 0 to 2 buttons or a single text input. + */ +export type CardViewFooterParameters = CardViewActionsFooterParameters | [CardTextInputComponent]; + +/** + * Base parameters for the card view. + */ +export interface BaseCardViewParameters { + /** + * Card view title area (card bar) components. + */ + cardBar: [CardBarComponent]; +} + +/** +* The parameters for the card view with text or empty body. +*/ +export interface TextCardViewParameters extends BaseCardViewParameters { + /** + * Card View type + */ + cardViewType: 'text'; + /** + * Header area components. + */ + header: [CardTextComponent]; + /** + * Body area components. + */ + body: [CardTextComponent] | undefined; + /** + * Footer area components. + */ + footer?: CardViewFooterParameters; + + /** + * Image displayed on the card. + */ + image?: CardImage; +} + +export interface TextInputCardViewParameters extends BaseCardViewParameters { + /** + * Card View type + */ + cardViewType: 'textInput'; + /** + * Header area components. + */ + header: [CardTextComponent]; + /** + * Body area components. + */ + body: [CardTextInputComponent]; + /** + * Footer area components. + */ + footer?: CardViewActionsFooterParameters; + /** + * Image displayed on the card. + */ + image?: CardImage; +} + +export interface SearchCardViewParameters extends BaseCardViewParameters { + /** + * Card View type + */ + cardViewType: 'search'; + /** + * Header area components. Contains a single text field. + */ + header: [CardTextComponent]; + /** + * Body area components. Contains a single search box. + */ + body: [CardSearchBoxComponent]; + /** + * Footer area components. Contains a single search footer. + */ + footer?: [CardSearchFooterComponent]; +} + +/** +* The parameters for the card view with text or empty body. + +*/ +export interface SignInCardViewParameters extends BaseCardViewParameters { + /** + * Card View type + */ + cardViewType: 'signIn'; + /** + * Header area components. + */ + header: [CardTextComponent]; + /** + * Body area components. + */ + body: [CardTextComponent] | undefined; + /** + * Footer area components. + */ + footer?: [CardButtonComponent]; +} + +export type CardViewParameters = TextCardViewParameters | TextInputCardViewParameters | SearchCardViewParameters | SignInCardViewParameters; + +/** +* Helper method to create a Basic Card View. +* @param configuration - basic card view configuration. +*/ +export function BasicCardView( + cardBar: CardBarComponent, + header: CardTextComponent, + footer?: CardViewFooterParameters +): TextCardViewParameters { + return { + cardViewType: 'text', + body: undefined, + cardBar: [cardBar], + header: [header], + footer: footer + }; +} + +/** + * Helper method to create a Primary Text Card View. + * @param configuration - primary text card view configuration. + */ +export function PrimaryTextCardView( + cardBar: CardBarComponent, + header: CardTextComponent, + body: CardTextComponent, + footer?: CardViewFooterParameters +): TextCardViewParameters { + return { + cardViewType: 'text', + cardBar: [cardBar], + header: [header], + body: [body], + footer: footer + }; +} + +/** + * Helper method to create an Image Card View. + * @param configuration - image card view configuration. + */ +export function ImageCardView( + cardBar: CardBarComponent, + header: CardTextComponent, + image: CardImage, + footer?: CardViewFooterParameters +): TextCardViewParameters { + return { + cardViewType: 'text', + image: image, + cardBar: [cardBar], + header: [header], + body: undefined, + footer: footer + }; +} + +/** + * Helper method to create an Text Input Card View. + * @param configuration - text input card view configuration. + */ +export function TextInputCardView( + cardBar: CardBarComponent, + header: CardTextComponent, + body: CardTextInputComponent, + footer?: CardViewActionsFooterParameters +): TextInputCardViewParameters { + return { + cardViewType: 'textInput', + cardBar: [cardBar], + header: [header], + body: [body], + footer: footer + }; +} + +export function SignInCardView( + cardBar: CardBarComponent, + header: CardTextComponent, + body: CardTextComponent, + footer: [CardButtonComponent] +): SignInCardViewParameters { + return { + cardViewType: 'signIn', + cardBar: [cardBar], + header: [header], + body: [body], + footer: footer + }; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/cardView/index.ts b/libraries/botframework-schema/src/sharepoint/cardView/index.ts new file mode 100644 index 0000000000..295096a12f --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/cardView/index.ts @@ -0,0 +1,10 @@ +export * from './baseCardComponent'; +export * from './cardBarComponent'; +export * from './cardButtonBase'; +export * from './cardButtonComponent'; +export * from './cardImage'; +export * from './cardSearchBoxComponent'; +export * from './cardSearchFooterComponent'; +export * from './cardTextComponent'; +export * from './cardTextInputComponent'; +export * from './cardViewParameters'; diff --git a/libraries/botframework-schema/src/sharepoint/cardViewResponse.ts b/libraries/botframework-schema/src/sharepoint/cardViewResponse.ts new file mode 100644 index 0000000000..0e38df5e84 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/cardViewResponse.ts @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import { AceData } from './aceData'; +import { OnCardSelectionAction } from './actions/cardAction'; +import { CardViewParameters } from './cardView/cardViewParameters'; + +export interface CardViewResponse { + aceData: AceData; + cardViewParameters: CardViewParameters; + onCardSelection: OnCardSelectionAction; + viewId: string; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/getPropertyPaneConfigurationResponse.ts b/libraries/botframework-schema/src/sharepoint/getPropertyPaneConfigurationResponse.ts new file mode 100644 index 0000000000..8a637f117e --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/getPropertyPaneConfigurationResponse.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import { PropertyPanePage } from './propertyPanePage'; + +export interface GetPropertyPaneConfigurationResponse { + pages: [PropertyPanePage]; + currentPage: number; + loadingIndicatorDelayTime: number; + showLoadingIndicator: boolean; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/handleActionResponse.ts b/libraries/botframework-schema/src/sharepoint/handleActionResponse.ts new file mode 100644 index 0000000000..80aea712f4 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/handleActionResponse.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import { CardViewResponse } from './cardViewResponse'; +import { QuickViewResponse } from './quickViewResponse'; + + +export type ViewResponseType = 'Card' | 'QuickView' | 'NoOp'; + +export interface BaseHandleActionResponse { + type: ViewResponseType; + renderArguments?: CardViewResponse | QuickViewResponse; +} + +export interface CardViewHandleActionResponse extends BaseHandleActionResponse { + type: 'Card'; + renderArguments: CardViewResponse; +} + +export interface QuickViewHandleActionResponse extends BaseHandleActionResponse { + type: 'QuickView'; + renderArguments: QuickViewResponse; +} + +export interface NoOpHandleActionResponse extends BaseHandleActionResponse { + type: 'NoOp'; + renderArguments?: undefined; +} + +export type HandleActionResponse = CardViewHandleActionResponse | QuickViewHandleActionResponse | NoOpHandleActionResponse; \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/index.ts b/libraries/botframework-schema/src/sharepoint/index.ts new file mode 100644 index 0000000000..3e7bb86ea9 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/index.ts @@ -0,0 +1,30 @@ +export { AceData } from './aceData'; +export { AceRequest } from './aceRequest'; +export { FocusParameters } from './actions/focusParameters'; +export { GetPropertyPaneConfigurationResponse } from './getPropertyPaneConfigurationResponse'; +export { QuickViewResponse } from './quickViewResponse'; +export * from './handleActionResponse'; +export { PropertyPaneFieldProperties } from './propertyPaneFieldProperties'; +export { PropertyPaneGroupOrConditionalGroup } from './propertyPaneGroupOrConditionalGroup'; +export { QuickViewData } from './quickViewData'; +export { PropertyPaneCheckboxProperties } from './propertyPaneCheckboxProperties'; +export { PropertyPaneChoiceGroupIconProperties } from './propertyPaneChoiceGroupIconProperties'; +export { PropertyPaneChoiceGroupImageSize } from './propertyPaneChoiceGroupImageSize'; +export { PropertyPaneChoiceGroupOption } from './propertyPaneChoiceGroupOption'; +export { PropertyPaneChoiceGroupProperties } from './propertyPaneChoiceGroupProperties'; +export { PropertyPaneDropDownOption } from './propertyPaneDropDownOptions'; +export { PropertyPaneDropDownProperties } from './propertyPaneDropDownProperties'; +export { PropertyPaneGroupField } from './propertyPaneGroupField'; +export { PropertyPaneGroup } from './propertyPaneGroup'; +export { PropertyPaneLabelProperties } from './propertyPaneLabelProperties'; +export { PropertyPaneLinkPopupWindowProperties } from './propertyPaneLinkPopupWindowProperties'; +export { PropertyPaneLinkProperties } from './propertyPaneLinkProperties'; +export { PropertyPanePage } from './propertyPanePage'; +export { PropertyPanePageHeader } from './propertyPanePageHeader'; +export { PropertyPaneSliderProperties } from './propertyPaneSliderProperties'; +export { PropertyPaneTextFieldProperties } from './propertyPaneTextFieldProperties'; +export { PropertyPaneToggleProperties } from './propertyPaneToggleProperties'; +export { SetPropertyPaneConfigurationResponse } from './setPropertyPaneConfigurationResponse'; +export { CardViewResponse } from './cardViewResponse'; +export * from './actions'; +export * from './cardView'; \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneCheckboxProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneCheckboxProperties.ts new file mode 100644 index 0000000000..7f8b312d35 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneCheckboxProperties.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import { PropertyPaneFieldProperties } from './propertyPaneFieldProperties'; + +export interface PropertyPaneCheckboxProperties extends PropertyPaneFieldProperties { + text: string; + disabled: boolean; + checked: boolean; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupIconProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupIconProperties.ts new file mode 100644 index 0000000000..c37dc0729b --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupIconProperties.ts @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +export interface PropertyPaneChoiceGroupIconProperties { + officeFabricIconFontName: string; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupImageSize.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupImageSize.ts new file mode 100644 index 0000000000..d95069069a --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupImageSize.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +export interface PropertyPaneChoiceGroupImageSize { + width: number; + height: number; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupOption.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupOption.ts new file mode 100644 index 0000000000..99476525bb --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupOption.ts @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import { PropertyPaneChoiceGroupIconProperties } from './propertyPaneChoiceGroupIconProperties'; +import { PropertyPaneChoiceGroupImageSize } from './propertyPaneChoiceGroupImageSize'; + +export interface PropertyPaneChoiceGroupOption { + ariaLabel: string; + disabled: boolean; + checked: boolean; + iconProps: PropertyPaneChoiceGroupIconProperties; + imageSize: PropertyPaneChoiceGroupImageSize; + imageSrc: string; + key: string; + text: string; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupProperties.ts new file mode 100644 index 0000000000..06e111e4fe --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupProperties.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import { PropertyPaneFieldProperties } from './propertyPaneFieldProperties'; +import { PropertyPaneChoiceGroupOption } from './propertyPaneChoiceGroupOption'; + +export interface PropertyPaneChoiceGroupProperties extends PropertyPaneFieldProperties { + label: string; + options: [PropertyPaneChoiceGroupOption]; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownOptions.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownOptions.ts new file mode 100644 index 0000000000..942f01bc18 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownOptions.ts @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +export interface PropertyPaneDropDownOption { + index: number; + key: string; + text: string; + type: DropDownOptionType; +} + +export enum DropDownOptionType { + // Render normal menu item + Normal = 0, + // Render a divider + Divider = 1, + // Render menu item as a header + Header = 2 +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownProperties.ts new file mode 100644 index 0000000000..4a18b8b2cc --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownProperties.ts @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import { PropertyPaneFieldProperties } from './propertyPaneFieldProperties'; +import { PropertyPaneDropDownOption } from './propertyPaneDropDownOptions'; + +export interface PropertyPaneDropDownProperties extends PropertyPaneFieldProperties { + ariaLabel: string; + ariaPositionInSet: number; + ariaSetSize: number; + label: string; + disabled: boolean; + errorMessage: string; + selectedKey: string; + options: [PropertyPaneDropDownOption]; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneFieldProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneFieldProperties.ts new file mode 100644 index 0000000000..87073ceec3 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneFieldProperties.ts @@ -0,0 +1,6 @@ +/** + * Interface for property pane field properties + */ +export interface PropertyPaneFieldProperties { + +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneGroup.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneGroup.ts new file mode 100644 index 0000000000..edfc291b90 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneGroup.ts @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import { PropertyPaneGroupOrConditionalGroup } from './propertyPaneGroupOrConditionalGroup'; +import { PropertyPaneGroupField } from './propertyPaneGroupField'; + +export interface PropertyPaneGroup extends PropertyPaneGroupOrConditionalGroup { + groupFields: [PropertyPaneGroupField]; + groupName: string; + isCollapsed: boolean; + isGroupNameHidden: boolean; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneGroupField.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneGroupField.ts new file mode 100644 index 0000000000..7c611c1f23 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneGroupField.ts @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import { PropertyPaneFieldProperties } from './propertyPaneFieldProperties'; + +export interface PropertyPaneGroupField { + type: FieldType; + targetProperty: string; + properties: PropertyPaneFieldProperties; + shouldFocus?: boolean; +} + +export enum FieldType { + CheckBox = 2, + TextField = 3, + Toggle = 5, + Dropdown = 6, + Label = 7, + Slider = 8, + ChoiceGroup = 10, + HorizontalRule = 12, + Link = 13, +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneGroupOrConditionalGroup.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneGroupOrConditionalGroup.ts new file mode 100644 index 0000000000..df27a06d69 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneGroupOrConditionalGroup.ts @@ -0,0 +1,6 @@ +/** + * Interface for property pane group or conditional group + */ +export interface PropertyPaneGroupOrConditionalGroup { + +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneLabelProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneLabelProperties.ts new file mode 100644 index 0000000000..2658655626 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneLabelProperties.ts @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import { PropertyPaneFieldProperties } from './propertyPaneFieldProperties'; + +export interface PropertyPaneLabelProperties extends PropertyPaneFieldProperties { + text: string; + required: boolean; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneLinkPopupWindowProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneLinkPopupWindowProperties.ts new file mode 100644 index 0000000000..51e6e374c2 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneLinkPopupWindowProperties.ts @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +export interface PropertyPaneLinkPopupWindowProperties { + width: number; + height: number; + title: string; + positionWindowPosition: PopupWindowPosition; +} + +export enum PopupWindowPosition { + Center = 0, + RightTop = 1, + LeftTop = 2, + RightBottom = 3, + LeftBottom = 4 +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneLinkProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneLinkProperties.ts new file mode 100644 index 0000000000..285e5fecff --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneLinkProperties.ts @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import { PropertyPaneFieldProperties } from './propertyPaneFieldProperties'; +import { PropertyPaneLinkPopupWindowProperties } from './propertyPaneLinkPopupWindowProperties'; + +export interface PropertyPaneLinkProperties extends PropertyPaneFieldProperties { + text: string; + target: string; + href: string; + ariaLabel: string; + disabled: boolean; + popupWindowProps: PropertyPaneLinkPopupWindowProperties; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPanePage.ts b/libraries/botframework-schema/src/sharepoint/propertyPanePage.ts new file mode 100644 index 0000000000..37c3afe395 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/propertyPanePage.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import { PropertyPaneGroupOrConditionalGroup } from './propertyPaneGroupOrConditionalGroup'; +import { PropertyPanePageHeader } from './propertyPanePageHeader'; + +export interface PropertyPanePage { + displayGroupsAsAccordion: boolean; + groups: [PropertyPaneGroupOrConditionalGroup]; + header: PropertyPanePageHeader; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPanePageHeader.ts b/libraries/botframework-schema/src/sharepoint/propertyPanePageHeader.ts new file mode 100644 index 0000000000..567c3a3643 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/propertyPanePageHeader.ts @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +export interface PropertyPanePageHeader { + description: string; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneSliderProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneSliderProperties.ts new file mode 100644 index 0000000000..8d8b511937 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneSliderProperties.ts @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import { PropertyPaneFieldProperties } from './propertyPaneFieldProperties'; + +export interface PropertyPaneSliderProperties extends PropertyPaneFieldProperties { + label: string; + value: string; + ariaLabel: string; + disabled: boolean; + max: number; + min: number; + step: number; + showValue: boolean; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneTextFieldProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneTextFieldProperties.ts new file mode 100644 index 0000000000..2621d72738 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneTextFieldProperties.ts @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import { PropertyPaneFieldProperties } from './propertyPaneFieldProperties'; + +export interface PropertyPaneTextFieldProperties extends PropertyPaneFieldProperties { + label: string; + value: string; + ariaLabel: string; + deferredValidationTime: number; + description: string; + disabled: boolean; + errorMessage: string; + logName: string; + maxLength: number; + multiline: boolean; + placeholder: string; + resizable: boolean; + rows: number; + underlined: boolean; + validateOnFocusIn: boolean; + validateOnFocusOut: boolean; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneToggleProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneToggleProperties.ts new file mode 100644 index 0000000000..95864ffc7d --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneToggleProperties.ts @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import { PropertyPaneFieldProperties } from './propertyPaneFieldProperties'; + +export interface PropertyPaneToggleProperties extends PropertyPaneFieldProperties { + ariaLabel: string; + label: string; + disabled: boolean; + checked: boolean; + key: string; + offText: string; + onText: string; + onAriaLabel: string; + offAriaLabel: string; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/quickViewData.ts b/libraries/botframework-schema/src/sharepoint/quickViewData.ts new file mode 100644 index 0000000000..79729892a3 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/quickViewData.ts @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +export interface QuickViewData { + [key: string]: any; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/quickViewResponse.ts b/libraries/botframework-schema/src/sharepoint/quickViewResponse.ts new file mode 100644 index 0000000000..7c57315b38 --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/quickViewResponse.ts @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import { QuickViewData } from './quickViewData'; +import { AdaptiveCard } from 'adaptivecards'; +import { FocusParameters } from './actions/focusParameters'; +import { ExternalLinkActionParameters } from './actions/cardAction'; + +export interface QuickViewResponse { + data: QuickViewData; + template: AdaptiveCard; + viewId: string; + title: string; + externalLink: ExternalLinkActionParameters; + focusParameters: FocusParameters; +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/setPropertyPaneConfigurationResponse.ts b/libraries/botframework-schema/src/sharepoint/setPropertyPaneConfigurationResponse.ts new file mode 100644 index 0000000000..9efb8813eb --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/setPropertyPaneConfigurationResponse.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +import { CardViewHandleActionResponse, NoOpHandleActionResponse } from "./handleActionResponse"; + +export type SetPropertyPaneConfigurationResponse = CardViewHandleActionResponse | NoOpHandleActionResponse; \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 228c1fdc04..7dcda406af 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2757,6 +2757,11 @@ acorn@^8.5.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== +adaptivecards@1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/adaptivecards/-/adaptivecards-1.2.3.tgz#b69319c75bd214a5ec48119240c98449e7df685a" + integrity sha512-amQ5OSW3OpIkrxVKLjxVBPk/T49yuOtnqs1z5ZPfZr0+OpTovzmiHbyoAGDIsu5SNYHwOZFp/3LGOnRaALFa/g== + adm-zip@0.4.16: version "0.4.16" resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" From 97c295b4fc3a010cfa96514233f2ccbec0c3ec47 Mon Sep 17 00:00:00 2001 From: Alex Terentiev Date: Tue, 24 Oct 2023 12:18:08 -0700 Subject: [PATCH 02/13] comments --- .../src/sharepoint/aceData.ts | 27 ++++- .../src/sharepoint/aceRequest.ts | 9 +- .../src/sharepoint/actions/cardAction.ts | 54 ++++------ .../sharepoint/cardView/baseCardComponent.ts | 4 +- .../sharepoint/cardView/cardBarComponent.ts | 2 +- .../src/sharepoint/cardView/cardButtonBase.ts | 3 +- .../cardView/cardButtonComponent.ts | 2 +- .../cardView/cardSearchBoxComponent.ts | 5 +- .../cardView/cardSearchFooterComponent.ts | 7 +- .../sharepoint/cardView/cardTextComponent.ts | 3 +- .../cardView/cardTextInputComponent.ts | 10 +- .../sharepoint/cardView/cardViewParameters.ts | 101 ++++++++++++++++-- .../src/sharepoint/cardViewResponse.ts | 17 ++- .../getPropertyPaneConfigurationResponse.ts | 17 ++- .../src/sharepoint/handleActionResponse.ts | 43 +++++++- .../src/sharepoint/index.ts | 56 +++++----- .../propertyPaneCheckboxProperties.ts | 18 +++- .../propertyPaneChoiceGroupIconProperties.ts | 8 +- .../propertyPaneChoiceGroupImageSize.ts | 9 ++ .../propertyPaneChoiceGroupOption.ts | 39 +++++-- .../propertyPaneChoiceGroupProperties.ts | 13 ++- .../sharepoint/propertyPaneDropDownOption.ts | 42 ++++++++ .../sharepoint/propertyPaneDropDownOptions.ts | 18 ---- .../propertyPaneDropDownProperties.ts | 43 ++++++-- .../sharepoint/propertyPaneFieldProperties.ts | 7 +- .../src/sharepoint/propertyPaneGroup.ts | 23 +++- .../src/sharepoint/propertyPaneGroupField.ts | 45 ++++++++ .../propertyPaneGroupOrConditionalGroup.ts | 2 +- .../sharepoint/propertyPaneLabelProperties.ts | 11 +- .../propertyPaneLinkPopupWindowProperties.ts | 33 ++++++ .../sharepoint/propertyPaneLinkProperties.ts | 29 ++++- .../src/sharepoint/propertyPanePage.ts | 18 +++- .../src/sharepoint/propertyPanePageHeader.ts | 6 ++ .../propertyPaneSliderProperties.ts | 39 +++++-- .../propertyPaneTextFieldProperties.ts | 71 +++++++++--- .../propertyPaneToggleProperties.ts | 48 +++++++-- .../src/sharepoint/quickViewData.ts | 2 +- .../src/sharepoint/quickViewResponse.ts | 21 ++++ 38 files changed, 711 insertions(+), 194 deletions(-) create mode 100644 libraries/botframework-schema/src/sharepoint/propertyPaneDropDownOption.ts delete mode 100644 libraries/botframework-schema/src/sharepoint/propertyPaneDropDownOptions.ts diff --git a/libraries/botframework-schema/src/sharepoint/aceData.ts b/libraries/botframework-schema/src/sharepoint/aceData.ts index ed7c5441a0..6219be7a62 100644 --- a/libraries/botframework-schema/src/sharepoint/aceData.ts +++ b/libraries/botframework-schema/src/sharepoint/aceData.ts @@ -2,19 +2,40 @@ // Licensed under the MIT License. /** - * SharePoint Ace Data object + * SharePoint ACE Data object */ export interface AceData { + /** + * The card size. + */ cardSize: AceCardSize; + /** + * The version of the ACE data schema. + */ dataVersion: string; + /** + * The id of the ACE. + */ id: string; + /** + * The title of the ACE. + */ title: string; + /** + * The icon of the ACE. + */ iconProperty: string; + /** + * The description of the ACE. + */ description: string; + /** + * The properties of the ACE. + */ properties: any; } /** - * SharePoint Ace Card Size + * SharePoint ACE Card Size */ -export type AceCardSize = "Medium" | "Large"; \ No newline at end of file +export type AceCardSize = 'Medium' | 'Large'; \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/aceRequest.ts b/libraries/botframework-schema/src/sharepoint/aceRequest.ts index 8381c58246..b9e890fddc 100644 --- a/libraries/botframework-schema/src/sharepoint/aceRequest.ts +++ b/libraries/botframework-schema/src/sharepoint/aceRequest.ts @@ -6,12 +6,11 @@ */ export interface AceRequest { /** - * @member {any} [data] User ACE request data. Free payload with key-value pairs. + * User ACE request data. Free payload with key-value pairs. */ - data?: any; // eslint-disable-line @typescript-eslint/no-explicit-any - + data?: any; /** - * @member {any} [properties] ACE properties data. + * ACE properties data. */ - properties?: any; // eslint-disable-line @typescript-eslint/no-explicit-any + properties?: any; } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/actions/cardAction.ts b/libraries/botframework-schema/src/sharepoint/actions/cardAction.ts index 7a16b6fa98..0fae641cfc 100644 --- a/libraries/botframework-schema/src/sharepoint/actions/cardAction.ts +++ b/libraries/botframework-schema/src/sharepoint/actions/cardAction.ts @@ -2,14 +2,13 @@ // Licensed under the MIT License. /** - * Confirmation Dialog option that is passed through `Submit` Action is executed. + * SharePoint Confirmation Dialog option that is passed through `Submit` Action is executed. */ export interface ConfirmationDialog { /** * Dialog title. */ title: string; - /** * Dialog message. */ @@ -24,17 +23,14 @@ export interface Location { * Latitude of the location. */ latitude: number; - /** * Longitude of the location. */ longitude: number; - /** * Timestamp */ timestamp?: number; - /** * Accuracy of the location. */ @@ -42,7 +38,7 @@ export interface Location { } /** - * Enum value to specify the type of media. + * Enum value to specify the type of media for VivaAction.SelectMedia action. */ export enum MediaType { Image = 1, @@ -51,14 +47,13 @@ export enum MediaType { } /** - * Open the quick view. + * SharePoint QuickView action. */ export interface QuickViewCardAction { /** * Indicates this action opens the quick view. */ type: 'QuickView'; - /** * Parameters for the quick view opened by this action */ @@ -76,14 +71,13 @@ export interface QuickViewParameters { } /** -* Open an external link. +* SharePoint ExternalLink action. */ export interface ExternalLinkCardAction { /** * Indicates this is an external link button. */ type: 'ExternalLink'; - /** * Parameters for the external link. */ @@ -98,7 +92,6 @@ export interface ExternalLinkActionParameters { * Indicates whether this is a Teams Deep Link. */ isTeamsDeepLink?: boolean; - /** * The URL of the link. */ @@ -106,19 +99,17 @@ export interface ExternalLinkActionParameters { } /** - * Invoke an `Action.Submit` event. + * SharePoint `Action.Submit` event. */ export interface SubmitCardAction { /** * Indicates this is a Submit button. */ type: 'Submit'; - /** * Parameters passed to the Submit event handler. */ parameters: SubmitCardParameters; - /** * Confirmation dialog option passed to the submit handler. */ @@ -126,19 +117,17 @@ export interface SubmitCardAction { } /** - * Invoke an `Action.Execute` event. + * SharePoint `Action.Execute` event. */ export interface ExecuteCardAction { /** * Indicates this is an Execute button. */ type: 'Execute'; - /** * Verb associated with this action */ verb?: string; - /** * Parameters passed to the Execute event handler */ @@ -146,7 +135,7 @@ export interface ExecuteCardAction { } /** - * Parameters for Execute card action. + * Parameters for SharePoint Action.Execute card action. */ export interface ExecuteCardParameters { /** @@ -156,7 +145,7 @@ export interface ExecuteCardParameters { } /** - * Parameters for submit card action. + * Parameters for SharePoint Action.Submit card action. */ export interface SubmitCardParameters { /** @@ -166,14 +155,13 @@ export interface SubmitCardParameters { } /** - * Invoke an `VivaAction.SelectMedia` event. + * SharePoint `VivaAction.SelectMedia` event. */ export interface SelectMediaCardAction { /** * Indicates this is a Viva Select Media button. */ type: 'VivaAction.SelectMedia'; - /** * Parameters for the Select Media Action */ @@ -181,24 +169,21 @@ export interface SelectMediaCardAction { } /** - * Parameters that can be supplied with the Viva Select Media Action. + * Parameters that can be supplied with the SharePoint VivaAction.SelectMendia action. */ export interface SelectMediaActionParameters { /** - * Specify the specific media type that should be selected + * Specifies the specific media type that should be selected */ mediaType: MediaType; - /** - * Allow multiple images to be selected. + * Allow multiple images to be selected. */ allowMultipleCapture?: boolean; - /** * Max file size that can be uploaded. */ maxSizePerFile?: number; - /** * File formats supported for upload. */ @@ -206,7 +191,7 @@ export interface SelectMediaActionParameters { } /** - * Invoke an `VivaAction.ShowLocation` event. + * SharePoint `VivaAction.ShowLocation` event. */ export interface ShowLocationCardAction { /** @@ -214,13 +199,13 @@ export interface ShowLocationCardAction { */ type: 'VivaAction.ShowLocation'; /** - * Parameters that can be supplied with the Viva Show Location Action. + * Parameters that can be supplied with the Viva Show Location action. */ parameters?: ShowLocationActionParameters; } /** - * Parameters that can be supplied with the Viva Show Location Action. + * Parameters that can be supplied with the SharePoint VivaAction.ShowLocation action. */ export interface ShowLocationActionParameters { /** @@ -231,7 +216,7 @@ export interface ShowLocationActionParameters { } /** - * Invoke an `VivaAction.GetLocation` event. + * SharePoint `VivaAction.GetLocation` event. */ export interface GetLocationCardAction { /** @@ -245,7 +230,7 @@ export interface GetLocationCardAction { } /** - * Parameters that can be supplied with the Viva Get Location Action. + * Parameters that can be supplied with the SharePoint VivaAction.GetLocation action. */ export interface GetLocationActionParameters { /** @@ -256,7 +241,7 @@ export interface GetLocationActionParameters { } /** - * Type of handler for when a button is pressed. + * Type of handler for when a card button is pressed. */ export type CardAction = | QuickViewCardAction @@ -267,6 +252,9 @@ export type CardAction = | ShowLocationCardAction | ExecuteCardAction; +/** + * Type of handler for when a card is selected. + */ export type OnCardSelectionAction = QuickViewCardAction | ExternalLinkCardAction | SelectMediaCardAction diff --git a/libraries/botframework-schema/src/sharepoint/cardView/baseCardComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/baseCardComponent.ts index 1373e50658..eec7fc9c22 100644 --- a/libraries/botframework-schema/src/sharepoint/cardView/baseCardComponent.ts +++ b/libraries/botframework-schema/src/sharepoint/cardView/baseCardComponent.ts @@ -13,9 +13,7 @@ export type CardComponentName = | 'searchFooter'; /** - * Base card view component. - * - * @public + * Base Adaptive Card Extension card view component. */ export interface BaseCardComponent { /** diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardBarComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardBarComponent.ts index 7482313a7c..b6d4d6f9b1 100644 --- a/libraries/botframework-schema/src/sharepoint/cardView/cardBarComponent.ts +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardBarComponent.ts @@ -5,7 +5,7 @@ import type { CardImage } from './cardImage'; import type { BaseCardComponent } from './baseCardComponent'; /** - * Card view title area (card bar) component parameters + * Adaptive Card Extension Card view title area (card bar) component */ export interface CardBarComponent extends BaseCardComponent { /** diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardButtonBase.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardButtonBase.ts index c2a1f68533..2d05d15edc 100644 --- a/libraries/botframework-schema/src/sharepoint/cardView/cardButtonBase.ts +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardButtonBase.ts @@ -4,7 +4,7 @@ import type { CardAction } from '../actions/cardAction'; /** - * Base properties for the buttons used in different ACE card view components, such as Text Input and Search Box and Card Button. + * Base properties for the buttons used in different Adaptive Card Extension card view components, such as Text Input, Search Box and Card Button. */ export interface CardButtonBase { /** @@ -13,7 +13,6 @@ export interface CardButtonBase { action: CardAction; /** * Unique Id of the button. - * */ id?: string; } diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardButtonComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardButtonComponent.ts index ae31bfa7b7..d84746b256 100644 --- a/libraries/botframework-schema/src/sharepoint/cardView/cardButtonComponent.ts +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardButtonComponent.ts @@ -5,7 +5,7 @@ import type { BaseCardComponent } from './baseCardComponent'; import type { CardButtonBase } from './cardButtonBase'; /** - * Card button component. + * Adaptive Card Extension Card button component. */ export interface CardButtonComponent extends BaseCardComponent, CardButtonBase { /** diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardSearchBoxComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardSearchBoxComponent.ts index 2c9286a3b4..76f48f4dd2 100644 --- a/libraries/botframework-schema/src/sharepoint/cardView/cardSearchBoxComponent.ts +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardSearchBoxComponent.ts @@ -10,24 +10,21 @@ import type { CardButtonBase } from './cardButtonBase'; export interface ICardSearchBoxButton extends CardButtonBase {} /** - * Search box component parameters. Represents a search box rendered in the card view. + * Adaptive Card Extension Search box component. Represents a search box rendered in the card view. */ export interface CardSearchBoxComponent extends BaseCardComponent { /** * Unique component name. */ componentName: 'searchBox'; - /** * Placeholder text to display. */ placeholder?: string; - /** * Default value to display. */ defaultValue?: string; - /** * Button displayed on the search box. */ diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardSearchFooterComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardSearchFooterComponent.ts index 65179aaca5..395823bb67 100644 --- a/libraries/botframework-schema/src/sharepoint/cardView/cardSearchFooterComponent.ts +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardSearchFooterComponent.ts @@ -5,34 +5,29 @@ import type { CardAction } from '../actions/cardAction'; import type { BaseCardComponent } from './baseCardComponent'; /** - * Search footer component parameters. Represents a container with an image (in the shape of a circle) and text. + * Adaptive Card Extension Search footer component. Represents a container with an image (in the shape of a circle) and text. */ export interface CardSearchFooterComponent extends BaseCardComponent { /** * Unique component name. */ componentName: 'searchFooter'; - /** * Title text to display. */ title: string; - /** * Url to the image to use, should be a square aspect ratio and big enough to fit in the image area. */ imageUrl?: string; - /** * The initials to display in the image area when there is no image. */ imageInitials?: string; - /** * Primary text to display. For example, name of the person for people search. */ text: string; - /** * Action to invoke when the footer is selected. */ diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardTextComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardTextComponent.ts index c307c6a113..117d040a47 100644 --- a/libraries/botframework-schema/src/sharepoint/cardView/cardTextComponent.ts +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardTextComponent.ts @@ -4,14 +4,13 @@ import type { BaseCardComponent } from './baseCardComponent'; /** - * Text component parameters. Represents a text block rendered in the card view. + * Adaptive Card Extension Text component. Represents a text block rendered in the card view. */ export interface CardTextComponent extends BaseCardComponent { /** * Unique component name. */ componentName: 'text'; - /** * Text to display. */ diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardTextInputComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardTextInputComponent.ts index 205e336fe2..9c3997d28b 100644 --- a/libraries/botframework-schema/src/sharepoint/cardView/cardTextInputComponent.ts +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardTextInputComponent.ts @@ -17,8 +17,6 @@ export interface ICardTextInputIconButton extends CardButtonBase { /** * Text input title button. - * - * @public */ export interface ICardTextInputTitleButton extends CardButtonBase { /** @@ -28,39 +26,33 @@ export interface ICardTextInputTitleButton extends CardButtonBase { } /** - * Text input component parameters. + * Adaptive Card Extension Text input component. */ export interface CardTextInputComponent extends BaseCardComponent { /** * Unique component name. */ componentName: 'textInput'; - /** * Placeholder text to display. */ placeholder?: string; - /** * Default value to display. */ defaultValue?: string; - /** * Properties for an optional icon, displayed in the left end of the text input. */ iconBefore?: CardImage; - /** * Properties for an optional icon, displayed in the right end of the text input. */ iconAfter?: CardImage; - /** * Optional button to display. */ button?: ICardTextInputIconButton | ICardTextInputTitleButton; - /** * Aria label for the text field. */ diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardViewParameters.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardViewParameters.ts index 8d51af7e26..eb7e7cfd61 100644 --- a/libraries/botframework-schema/src/sharepoint/cardView/cardViewParameters.ts +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardViewParameters.ts @@ -59,6 +59,9 @@ export interface TextCardViewParameters extends BaseCardViewParameters { image?: CardImage; } +/** + * The parameters for the card view with text input in the body. + */ export interface TextInputCardViewParameters extends BaseCardViewParameters { /** * Card View type @@ -82,6 +85,9 @@ export interface TextInputCardViewParameters extends BaseCardViewParameters { image?: CardImage; } +/** + * The parameters for the search card view. + */ export interface SearchCardViewParameters extends BaseCardViewParameters { /** * Card View type @@ -102,8 +108,7 @@ export interface SearchCardViewParameters extends BaseCardViewParameters { } /** -* The parameters for the card view with text or empty body. - +* The parameters for the sign in card view. */ export interface SignInCardViewParameters extends BaseCardViewParameters { /** @@ -124,12 +129,22 @@ export interface SignInCardViewParameters extends BaseCardViewParameters { footer?: [CardButtonComponent]; } +/** + * Card View Parameters. + */ export type CardViewParameters = TextCardViewParameters | TextInputCardViewParameters | SearchCardViewParameters | SignInCardViewParameters; /** -* Helper method to create a Basic Card View. -* @param configuration - basic card view configuration. -*/ + * Helper method to create a Basic Card View. + * The Basic Text card view displays the following: + * - Card bar + * - One primary text field + * - Zero or one button in the Medium card size, up to two buttons in Large card size; or text input. + * @param cardBar - card bar component + * @param header - text component to display as header + * @param footer - up to two buttons or text input to display as footer + * @returns Basic Card View parameters. + */ export function BasicCardView( cardBar: CardBarComponent, header: CardTextComponent, @@ -146,7 +161,15 @@ export function BasicCardView( /** * Helper method to create a Primary Text Card View. - * @param configuration - primary text card view configuration. + * The Primary Text card view displays the following: + * - Card bar + * - One primary text field + * - One description text field + * - Zero or one button in the Medium card size, up to two buttons in Large card size; or text input. + * @param cardBar - card bar component + * @param header - text component to display as header + * @param body - text component to display as body + * @param footer - up to two buttons or text input to display as footer */ export function PrimaryTextCardView( cardBar: CardBarComponent, @@ -165,7 +188,15 @@ export function PrimaryTextCardView( /** * Helper method to create an Image Card View. - * @param configuration - image card view configuration. + * The Image Card view displays the following: + * - Card bar + * - One primary text field + * - One image + * - Zero buttons in the Medium card size, up to two buttons in Large card size; or text input. + * @param cardBar - card bar component + * @param header - text component to display as header + * @param image - image to display + * @param footer - up to two buttons or text input to display as footer */ export function ImageCardView( cardBar: CardBarComponent, @@ -185,7 +216,16 @@ export function ImageCardView( /** * Helper method to create an Text Input Card View. - * @param configuration - text input card view configuration. + * The Text Input Card view displays the following: + * - Card bar + * - One primary text field + * - Zero or one image + * - Zero text input in Medium card size if image is presented, one text input in Medium card size if no image is presented, one text input in Large card size + * - Zero buttons in the Medium card size if image is presented, one button in Medium card size if no image is presented, up to two buttons in Large card size; or text input. + * @param cardBar - card bar component + * @param header - text component to display as header + * @param body - text input component to display as body + * @param footer - up to two buttons to display as footer */ export function TextInputCardView( cardBar: CardBarComponent, @@ -202,17 +242,58 @@ export function TextInputCardView( }; } +/** + * Helper method to create a Search Card View. + * The Search Card view displays the following: + * - Card bar + * - One primary text field + * - One search box + * - One search footer + * @param cardBar - card bar component + * @param header - text component to display as header + * @param body - search box component to display as body + * @param footer - search footer component to display as footer + */ +export function SearchCardView( + cardBar: CardBarComponent, + header: CardTextComponent, + body: CardSearchBoxComponent, + footer: CardSearchFooterComponent +): SearchCardViewParameters { + return { + cardViewType: 'search', + cardBar: [cardBar], + header: [header], + body: [body], + footer: [footer] + }; +} + +/** + * Helper method to create a Sign In Card View. + * The Sign In Card view displays the following: + * - Card bar + * - One primary text field + * - One description text field + * - Two buttons. + * @remarks The first button (sign in button) is always displayed based on the signInText property of the Adaptive Card Extension. Here you should specify the second button (sign in complete button) to display. + * @param cardBar - card bar component + * @param header - text component to display as header + * @param body - text component to display as body + * @param footer - sign in complete button to display as footer + * @returns + */ export function SignInCardView( cardBar: CardBarComponent, header: CardTextComponent, body: CardTextComponent, - footer: [CardButtonComponent] + footer: CardButtonComponent ): SignInCardViewParameters { return { cardViewType: 'signIn', cardBar: [cardBar], header: [header], body: [body], - footer: footer + footer: [footer] }; } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/cardViewResponse.ts b/libraries/botframework-schema/src/sharepoint/cardViewResponse.ts index 0e38df5e84..8e806135d4 100644 --- a/libraries/botframework-schema/src/sharepoint/cardViewResponse.ts +++ b/libraries/botframework-schema/src/sharepoint/cardViewResponse.ts @@ -5,9 +5,24 @@ import { AceData } from './aceData'; import { OnCardSelectionAction } from './actions/cardAction'; import { CardViewParameters } from './cardView/cardViewParameters'; +/** + * SharePoint ACE Card view response payload. + */ export interface CardViewResponse { + /** + * The ACE data. + */ aceData: AceData; + /** + * The card view parameters. + */ cardViewParameters: CardViewParameters; - onCardSelection: OnCardSelectionAction; + /** + * The on card selection action. + */ + onCardSelection?: OnCardSelectionAction; + /** + * The view id. + */ viewId: string; } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/getPropertyPaneConfigurationResponse.ts b/libraries/botframework-schema/src/sharepoint/getPropertyPaneConfigurationResponse.ts index 8a637f117e..b3598632d7 100644 --- a/libraries/botframework-schema/src/sharepoint/getPropertyPaneConfigurationResponse.ts +++ b/libraries/botframework-schema/src/sharepoint/getPropertyPaneConfigurationResponse.ts @@ -3,9 +3,24 @@ import { PropertyPanePage } from './propertyPanePage'; +/** + * SharePoint ACE get property pane configuration response. + */ export interface GetPropertyPaneConfigurationResponse { - pages: [PropertyPanePage]; + /** + * Property pane pages. + */ + pages: PropertyPanePage[]; + /** + * Current page number. + */ currentPage: number; + /** + * Loading indicator delay time. + */ loadingIndicatorDelayTime: number; + /** + * Value indicating whether to show loading indicator on top of the property pane. + */ showLoadingIndicator: boolean; } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/handleActionResponse.ts b/libraries/botframework-schema/src/sharepoint/handleActionResponse.ts index 80aea712f4..e086b853fe 100644 --- a/libraries/botframework-schema/src/sharepoint/handleActionResponse.ts +++ b/libraries/botframework-schema/src/sharepoint/handleActionResponse.ts @@ -4,27 +4,68 @@ import { CardViewResponse } from './cardViewResponse'; import { QuickViewResponse } from './quickViewResponse'; - +/** + * The type of the view in the handle action response. + */ export type ViewResponseType = 'Card' | 'QuickView' | 'NoOp'; +/** + * The base handle action response. + */ export interface BaseHandleActionResponse { + /** + * The type of the view in the handle action response. + */ type: ViewResponseType; + /** + * The render arguments. + */ renderArguments?: CardViewResponse | QuickViewResponse; } +/** + * The handle action response for card view. + */ export interface CardViewHandleActionResponse extends BaseHandleActionResponse { + /** + * Card view. + */ type: 'Card'; + /** + * Card view render arguments. + */ renderArguments: CardViewResponse; } +/** + * The handle action response for quick view. + */ export interface QuickViewHandleActionResponse extends BaseHandleActionResponse { + /** + * Quick view. + */ type: 'QuickView'; + /** + * Quick view render arguments. + */ renderArguments: QuickViewResponse; } +/** + * The handle action response for no op. + */ export interface NoOpHandleActionResponse extends BaseHandleActionResponse { + /** + * No op. + */ type: 'NoOp'; + /** + * No op doesn't have render arguments. + */ renderArguments?: undefined; } +/** + * The handle action response. + */ export type HandleActionResponse = CardViewHandleActionResponse | QuickViewHandleActionResponse | NoOpHandleActionResponse; \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/index.ts b/libraries/botframework-schema/src/sharepoint/index.ts index 3e7bb86ea9..82722f649f 100644 --- a/libraries/botframework-schema/src/sharepoint/index.ts +++ b/libraries/botframework-schema/src/sharepoint/index.ts @@ -1,30 +1,32 @@ -export { AceData } from './aceData'; -export { AceRequest } from './aceRequest'; -export { FocusParameters } from './actions/focusParameters'; -export { GetPropertyPaneConfigurationResponse } from './getPropertyPaneConfigurationResponse'; -export { QuickViewResponse } from './quickViewResponse'; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +export * from './aceData'; +export * from './aceRequest'; +export * from './getPropertyPaneConfigurationResponse'; export * from './handleActionResponse'; -export { PropertyPaneFieldProperties } from './propertyPaneFieldProperties'; -export { PropertyPaneGroupOrConditionalGroup } from './propertyPaneGroupOrConditionalGroup'; -export { QuickViewData } from './quickViewData'; -export { PropertyPaneCheckboxProperties } from './propertyPaneCheckboxProperties'; -export { PropertyPaneChoiceGroupIconProperties } from './propertyPaneChoiceGroupIconProperties'; -export { PropertyPaneChoiceGroupImageSize } from './propertyPaneChoiceGroupImageSize'; -export { PropertyPaneChoiceGroupOption } from './propertyPaneChoiceGroupOption'; -export { PropertyPaneChoiceGroupProperties } from './propertyPaneChoiceGroupProperties'; -export { PropertyPaneDropDownOption } from './propertyPaneDropDownOptions'; -export { PropertyPaneDropDownProperties } from './propertyPaneDropDownProperties'; -export { PropertyPaneGroupField } from './propertyPaneGroupField'; -export { PropertyPaneGroup } from './propertyPaneGroup'; -export { PropertyPaneLabelProperties } from './propertyPaneLabelProperties'; -export { PropertyPaneLinkPopupWindowProperties } from './propertyPaneLinkPopupWindowProperties'; -export { PropertyPaneLinkProperties } from './propertyPaneLinkProperties'; -export { PropertyPanePage } from './propertyPanePage'; -export { PropertyPanePageHeader } from './propertyPanePageHeader'; -export { PropertyPaneSliderProperties } from './propertyPaneSliderProperties'; -export { PropertyPaneTextFieldProperties } from './propertyPaneTextFieldProperties'; -export { PropertyPaneToggleProperties } from './propertyPaneToggleProperties'; -export { SetPropertyPaneConfigurationResponse } from './setPropertyPaneConfigurationResponse'; -export { CardViewResponse } from './cardViewResponse'; +export * from './propertyPaneFieldProperties'; +export * from './propertyPaneGroupOrConditionalGroup'; +export * from './propertyPaneCheckboxProperties'; +export * from './propertyPaneChoiceGroupIconProperties'; +export * from './propertyPaneChoiceGroupImageSize'; +export * from './propertyPaneChoiceGroupOption'; +export * from './propertyPaneChoiceGroupProperties'; +export * from './propertyPaneDropDownOption'; +export * from './propertyPaneDropDownProperties'; +export * from './propertyPaneGroupField'; +export * from './propertyPaneGroup'; +export * from './propertyPaneLabelProperties'; +export * from './propertyPaneLinkPopupWindowProperties'; +export * from './propertyPaneLinkProperties'; +export * from './propertyPanePage'; +export * from './propertyPanePageHeader'; +export * from './propertyPaneSliderProperties'; +export * from './propertyPaneTextFieldProperties'; +export * from './propertyPaneToggleProperties'; +export * from './setPropertyPaneConfigurationResponse'; +export * from './cardViewResponse'; +export * from './quickViewData'; +export * from './quickViewResponse'; export * from './actions'; export * from './cardView'; \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneCheckboxProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneCheckboxProperties.ts index 7f8b312d35..5dfa95fd12 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneCheckboxProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneCheckboxProperties.ts @@ -3,8 +3,20 @@ import { PropertyPaneFieldProperties } from './propertyPaneFieldProperties'; +/** + * SharePoint property pane checkbox field properties. + */ export interface PropertyPaneCheckboxProperties extends PropertyPaneFieldProperties { - text: string; - disabled: boolean; - checked: boolean; + /** + * The label text to display next to the checkbox. + */ + text?: string; + /** + * Indicates whether the checkbox is disabled or not. + */ + disabled?: boolean; + /** + * Indicates whether the checkbox is checked or not. + */ + checked?: boolean; } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupIconProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupIconProperties.ts index c37dc0729b..d52bfd0a30 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupIconProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupIconProperties.ts @@ -1,6 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +/** + * SharePoint property pane choice group icon properties. + */ export interface PropertyPaneChoiceGroupIconProperties { - officeFabricIconFontName: string; + /** + * The name of the icon to use from Office Fabric icon set. + */ + officeFabricIconFontName?: string; } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupImageSize.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupImageSize.ts index d95069069a..d5536021ad 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupImageSize.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupImageSize.ts @@ -1,7 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +/** + * SharePoint property pane choice group image size. + */ export interface PropertyPaneChoiceGroupImageSize { + /** + * The width of the image. + */ width: number; + /** + * The height of the image. + */ height: number; } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupOption.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupOption.ts index 99476525bb..6484cc48df 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupOption.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupOption.ts @@ -4,13 +4,40 @@ import { PropertyPaneChoiceGroupIconProperties } from './propertyPaneChoiceGroupIconProperties'; import { PropertyPaneChoiceGroupImageSize } from './propertyPaneChoiceGroupImageSize'; +/** + * SharePoint property pane choice group option. + */ export interface PropertyPaneChoiceGroupOption { - ariaLabel: string; - disabled: boolean; - checked: boolean; - iconProps: PropertyPaneChoiceGroupIconProperties; - imageSize: PropertyPaneChoiceGroupImageSize; - imageSrc: string; + /** + * Optional ariaLabel flag. Text for screen-reader to announce regardless of toggle state. + */ + ariaLabel?: string; + /** + * Indicates whether the choice group option is disabled or not. + */ + disabled?: boolean; + /** + * Indicates whether the choice group option is checked or not. + */ + checked?: boolean; + /** + * The icon properties to use for the choice group option. + */ + iconProps?: PropertyPaneChoiceGroupIconProperties; + /** + * The image size to use for the choice group option. + */ + imageSize?: PropertyPaneChoiceGroupImageSize; + /** + * The image source to use for the choice group option. + */ + imageSrc?: string; + /** + * The key to uniquely identify the choice group option. + */ key: string; + /** + * The text to display next for this choice group option. + */ text: string; } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupProperties.ts index 06e111e4fe..70acea96dd 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupProperties.ts @@ -4,7 +4,16 @@ import { PropertyPaneFieldProperties } from './propertyPaneFieldProperties'; import { PropertyPaneChoiceGroupOption } from './propertyPaneChoiceGroupOption'; +/** + * SharePoint property pane choice group field properties. + */ export interface PropertyPaneChoiceGroupProperties extends PropertyPaneFieldProperties { - label: string; - options: [PropertyPaneChoiceGroupOption]; + /** + * The label text to display next to the choice group. + */ + label?: string; + /** + * The options for the choice group. + */ + options: PropertyPaneChoiceGroupOption[]; } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownOption.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownOption.ts new file mode 100644 index 0000000000..0d5a45c57f --- /dev/null +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownOption.ts @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/** + * SharePoint property pane drop down option. + */ +export interface PropertyPaneDropDownOption { + /** + * The index of the option. + */ + index?: number; + /** + * The key to uniquely identify the option. + */ + key: string; + /** + * The text to render for this option. + */ + text: string; + /** + * The type of option to render. + */ + type?: DropDownOptionType; +} + +/** + * SharePoint property pane drop down option type. + */ +export enum DropDownOptionType { + /** + * Render a normal option. + */ + Normal = 0, + /** + * Render a divider. + */ + Divider = 1, + /** + * Render a header. + */ + Header = 2 +} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownOptions.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownOptions.ts deleted file mode 100644 index 942f01bc18..0000000000 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownOptions.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -export interface PropertyPaneDropDownOption { - index: number; - key: string; - text: string; - type: DropDownOptionType; -} - -export enum DropDownOptionType { - // Render normal menu item - Normal = 0, - // Render a divider - Divider = 1, - // Render menu item as a header - Header = 2 -} \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownProperties.ts index 4a18b8b2cc..b72bcd3aeb 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownProperties.ts @@ -2,15 +2,42 @@ // Licensed under the MIT License. import { PropertyPaneFieldProperties } from './propertyPaneFieldProperties'; -import { PropertyPaneDropDownOption } from './propertyPaneDropDownOptions'; +import { PropertyPaneDropDownOption } from './propertyPaneDropDownOption'; +/** + * SharePoint property pane dropdown field properties. + */ export interface PropertyPaneDropDownProperties extends PropertyPaneFieldProperties { - ariaLabel: string; - ariaPositionInSet: number; - ariaSetSize: number; + /** + * Optional ariaLabel flag. Text for screen-reader to announce regardless of toggle state. + */ + ariaLabel?: string; + /** + * The elemement's number or position in the current set of controls. Maps to native aria-positionset attribute. It starts from 1. + */ + ariaPositionInSet?: number; + /** + * The total number of elements in the current set of controls. Maps to native aria-setsize attribute. + */ + ariaSetSize?: number; + /** + * The label text to display next to the dropdown. + */ label: string; - disabled: boolean; - errorMessage: string; - selectedKey: string; - options: [PropertyPaneDropDownOption]; + /** + * Indicates whether the dropdown is disabled or not. + */ + disabled?: boolean; + /** + * The error message to display when the dropdown value is invalid. + */ + errorMessage?: string; + /** + * The key of the selected dropdown option. + */ + selectedKey?: string; + /** + * The options for the dropdown. + */ + options?: PropertyPaneDropDownOption[]; } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneFieldProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneFieldProperties.ts index 87073ceec3..ce10937958 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneFieldProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneFieldProperties.ts @@ -1,6 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + + /** - * Interface for property pane field properties + * SharePoint base property pane field properties */ export interface PropertyPaneFieldProperties { - } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneGroup.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneGroup.ts index edfc291b90..9ff91d75ae 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneGroup.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneGroup.ts @@ -4,9 +4,24 @@ import { PropertyPaneGroupOrConditionalGroup } from './propertyPaneGroupOrConditionalGroup'; import { PropertyPaneGroupField } from './propertyPaneGroupField'; +/** + * SharePoint property pane group. + */ export interface PropertyPaneGroup extends PropertyPaneGroupOrConditionalGroup { - groupFields: [PropertyPaneGroupField]; - groupName: string; - isCollapsed: boolean; - isGroupNameHidden: boolean; + /** + * The fields to be rendered inside this group. + */ + groupFields: PropertyPaneGroupField[]; + /** + * The name of the group. + */ + groupName?: string; + /** + * Whether the group is collapsed or not. + */ + isCollapsed?: boolean; + /** + * Whether the group name is hidden or not. + */ + isGroupNameHidden?: boolean; } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneGroupField.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneGroupField.ts index 7c611c1f23..25ec34058f 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneGroupField.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneGroupField.ts @@ -3,21 +3,66 @@ import { PropertyPaneFieldProperties } from './propertyPaneFieldProperties'; +/** + * SharePoint property pane group field. + */ export interface PropertyPaneGroupField { + /** + * The type of the field. + */ type: FieldType; + /** + * The target property for the field. + */ targetProperty: string; + /** + * The properties for the field. + */ properties: PropertyPaneFieldProperties; + /** + * Indicates whether the field should be focused or not. + */ shouldFocus?: boolean; } +/** + * SharePoint property pane group field type. + */ export enum FieldType { + /** + * Checkbox field. + */ CheckBox = 2, + /** + * Text field. + */ TextField = 3, + /** + * Toggle field. + */ Toggle = 5, + /** + * Dropdown field. + */ Dropdown = 6, + /** + * Label field. + */ Label = 7, + /** + * Slider field. + */ Slider = 8, + /** + * Choice Group field. + */ ChoiceGroup = 10, + /** + * Horizontal Rule field. + */ HorizontalRule = 12, + /** + * Link field. + */ Link = 13, } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneGroupOrConditionalGroup.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneGroupOrConditionalGroup.ts index df27a06d69..bc8288902c 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneGroupOrConditionalGroup.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneGroupOrConditionalGroup.ts @@ -1,5 +1,5 @@ /** - * Interface for property pane group or conditional group + * SharePoint property pane group or conditional group */ export interface PropertyPaneGroupOrConditionalGroup { diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneLabelProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneLabelProperties.ts index 2658655626..f70682522d 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneLabelProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneLabelProperties.ts @@ -3,7 +3,16 @@ import { PropertyPaneFieldProperties } from './propertyPaneFieldProperties'; +/** + * SharePoint property pane label properties. + */ export interface PropertyPaneLabelProperties extends PropertyPaneFieldProperties { + /** + * The text to display in the label. + */ text: string; - required: boolean; + /** + * Whether the label is required or not. + */ + required?: boolean; } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneLinkPopupWindowProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneLinkPopupWindowProperties.ts index 51e6e374c2..b69de33dc1 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneLinkPopupWindowProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneLinkPopupWindowProperties.ts @@ -1,17 +1,50 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +/** + * SharePoint property pane link popup window properties. + */ export interface PropertyPaneLinkPopupWindowProperties { + /** + * The width of the popup window. + */ width: number; + /** + * The height of the popup window. + */ height: number; + /** + * The title of the popup window. + */ title: string; + /** + * The position of the popup window. + */ positionWindowPosition: PopupWindowPosition; } +/** + * SharePoint property pane link popup window position. + */ export enum PopupWindowPosition { + /** + * Center. + */ Center = 0, + /** + * Right top. + */ RightTop = 1, + /** + * Left top. + */ LeftTop = 2, + /** + * Right bottom. + */ RightBottom = 3, + /** + * Left bottom. + */ LeftBottom = 4 } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneLinkProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneLinkProperties.ts index 285e5fecff..7697d63c4c 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneLinkProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneLinkProperties.ts @@ -4,11 +4,32 @@ import { PropertyPaneFieldProperties } from './propertyPaneFieldProperties'; import { PropertyPaneLinkPopupWindowProperties } from './propertyPaneLinkPopupWindowProperties'; +/** + * SharePoint property pane link field properties. + */ export interface PropertyPaneLinkProperties extends PropertyPaneFieldProperties { + /** + * The text to display in the link. + */ text: string; - target: string; + /** + * The target of the link. + */ + target?: string; + /** + * The URL of the link. + */ href: string; - ariaLabel: string; - disabled: boolean; - popupWindowProps: PropertyPaneLinkPopupWindowProperties; + /** + * Optional ariaLabel flag. Text for screen-reader to announce regardless of toggle state. + */ + ariaLabel?: string; + /** + * Whether the link is disabled or not. + */ + disabled?: boolean; + /** + * The properties of the popup window. + */ + popupWindowProps?: PropertyPaneLinkPopupWindowProperties; } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPanePage.ts b/libraries/botframework-schema/src/sharepoint/propertyPanePage.ts index 37c3afe395..1dd3b197d5 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPanePage.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPanePage.ts @@ -4,8 +4,20 @@ import { PropertyPaneGroupOrConditionalGroup } from './propertyPaneGroupOrConditionalGroup'; import { PropertyPanePageHeader } from './propertyPanePageHeader'; +/** + * SharePoint property pane page. + */ export interface PropertyPanePage { - displayGroupsAsAccordion: boolean; - groups: [PropertyPaneGroupOrConditionalGroup]; - header: PropertyPanePageHeader; + /** + * Whether the groups should be displayed as an accordion or not. + */ + displayGroupsAsAccordion?: boolean; + /** + * The groups to be rendered inside this page. + */ + groups: PropertyPaneGroupOrConditionalGroup[]; + /** + * The header to be rendered inside this page. + */ + header?: PropertyPanePageHeader; } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPanePageHeader.ts b/libraries/botframework-schema/src/sharepoint/propertyPanePageHeader.ts index 567c3a3643..5b14958b4c 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPanePageHeader.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPanePageHeader.ts @@ -1,6 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +/** + * SharePoint property pane page header. + */ export interface PropertyPanePageHeader { + /** + * The description of the page. + */ description: string; } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneSliderProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneSliderProperties.ts index 8d8b511937..b83e246449 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneSliderProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneSliderProperties.ts @@ -3,13 +3,40 @@ import { PropertyPaneFieldProperties } from './propertyPaneFieldProperties'; +/** + * SharePoint property pane slider field properties. + */ export interface PropertyPaneSliderProperties extends PropertyPaneFieldProperties { - label: string; - value: string; - ariaLabel: string; - disabled: boolean; + /** + * The label of the slider. + */ + label?: string; + /** + * The value of the slider. + */ + value?: string; + /** + * Optional ariaLabel flag. Text for screen-reader to announce regardless of toggle state. + */ + ariaLabel?: string; + /** + * Whether the slider is disabled or not. + */ + disabled?: boolean; + /** + * The maximum value of the slider. + */ max: number; + /** + * The minimum value of the slider. + */ min: number; - step: number; - showValue: boolean; + /** + * The step value of the slider. + */ + step?: number; + /** + * Whether to show the value on the right of the slider or no. + */ + showValue?: boolean; } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneTextFieldProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneTextFieldProperties.ts index 2621d72738..c965a527b6 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneTextFieldProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneTextFieldProperties.ts @@ -3,21 +3,60 @@ import { PropertyPaneFieldProperties } from './propertyPaneFieldProperties'; +/** + * SharePoint property pane text field properties. + */ export interface PropertyPaneTextFieldProperties extends PropertyPaneFieldProperties { - label: string; - value: string; - ariaLabel: string; - deferredValidationTime: number; - description: string; - disabled: boolean; - errorMessage: string; - logName: string; - maxLength: number; - multiline: boolean; - placeholder: string; - resizable: boolean; - rows: number; - underlined: boolean; - validateOnFocusIn: boolean; - validateOnFocusOut: boolean; + /** + * The label of the text field. + */ + label?: string; + /** + * The value of the text field. + */ + value?: string; + /** + * Optional ariaLabel flag. Text for screen-reader to announce regardless of toggle state. + */ + ariaLabel?: string; + /** + * The description to display under the text field. + */ + description?: string; + /** + * Whether the text field is disabled or not. + */ + disabled?: boolean; + /** + * If set, this will be displayed as an error message underneath the text field.. + */ + errorMessage?: string; + /** + * Name used to log PropertyPaneTextField value changes for engagement tracking. + */ + logName?: string; + /** + * The maximum length of the text field. + */ + maxLength?: number; + /** + * Whether or not the text field is multiline. + */ + multiline?: boolean; + /** + * The placeholder text to display in the text field. + */ + placeholder?: string; + /** + * Whether or not the multiline text field is resizable. + */ + resizable?: boolean; + /** + * Specifies the visible height of a text area(multiline text TextField), in lines. + */ + rows?: number; + /** + * Whether or not the text field is underlined. + */ + underlined?: boolean; } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneToggleProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneToggleProperties.ts index 95864ffc7d..e33437591f 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneToggleProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneToggleProperties.ts @@ -3,14 +3,44 @@ import { PropertyPaneFieldProperties } from './propertyPaneFieldProperties'; +/** + * SharePoint property pane toggle field properties. + */ export interface PropertyPaneToggleProperties extends PropertyPaneFieldProperties { - ariaLabel: string; - label: string; - disabled: boolean; - checked: boolean; - key: string; - offText: string; - onText: string; - onAriaLabel: string; - offAriaLabel: string; + /** + * Optional ariaLabel flag. Text for screen-reader to announce regardless of toggle state. + */ + ariaLabel?: string; + /** + * A label for the toggle. + */ + label?: string; + /** + * Indicates whether the toggle is disabled or not. + */ + disabled?: boolean; + /** + * Indicates whether the toggle is checked or not. + */ + checked?: boolean; + /** + * A key to uniquely identify the toggle. + */ + key?: string; + /** + * Text to display when toggle is OFF. + */ + offText?: string; + /** + * Text to display when toggle is ON. + */ + onText?: string; + /** + * Optional onAriaLabel flag. Text for screen-reader to announce when toggle is ON. + */ + onAriaLabel?: string; + /** + * Optional offAriaLabel flag. Text for screen-reader to announce when toggle is OFF. + */ + offAriaLabel?: string; } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/quickViewData.ts b/libraries/botframework-schema/src/sharepoint/quickViewData.ts index 79729892a3..8b18a162a4 100644 --- a/libraries/botframework-schema/src/sharepoint/quickViewData.ts +++ b/libraries/botframework-schema/src/sharepoint/quickViewData.ts @@ -2,5 +2,5 @@ // Licensed under the MIT License. export interface QuickViewData { - [key: string]: any; + [key: string]: unknown; } \ No newline at end of file diff --git a/libraries/botframework-schema/src/sharepoint/quickViewResponse.ts b/libraries/botframework-schema/src/sharepoint/quickViewResponse.ts index 7c57315b38..18155b2d4a 100644 --- a/libraries/botframework-schema/src/sharepoint/quickViewResponse.ts +++ b/libraries/botframework-schema/src/sharepoint/quickViewResponse.ts @@ -6,11 +6,32 @@ import { AdaptiveCard } from 'adaptivecards'; import { FocusParameters } from './actions/focusParameters'; import { ExternalLinkActionParameters } from './actions/cardAction'; +/** + * SharePoint ACE Quick view response payload. + */ export interface QuickViewResponse { + /** + * The quick view data. + */ data: QuickViewData; + /** + * The adaptive card template for the quick view. + */ template: AdaptiveCard; + /** + * The view id. + */ viewId: string; + /** + * The title of the quick view. + */ title: string; + /** + * An optional external link to be displayed in the navigation bar above the Adaptive Card. + */ externalLink: ExternalLinkActionParameters; + /** + * An optional focus element to set focus when the view is rendered for accessibility purposes. + */ focusParameters: FocusParameters; } \ No newline at end of file From 6753d542ac14e5f1ca4e037bf15cfc8a8e870837 Mon Sep 17 00:00:00 2001 From: Alex Terentiev Date: Tue, 24 Oct 2023 12:25:55 -0700 Subject: [PATCH 03/13] return comments --- .../src/sharepoint/cardView/cardViewParameters.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardViewParameters.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardViewParameters.ts index eb7e7cfd61..cd0997fa85 100644 --- a/libraries/botframework-schema/src/sharepoint/cardView/cardViewParameters.ts +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardViewParameters.ts @@ -143,7 +143,7 @@ export type CardViewParameters = TextCardViewParameters | TextInputCardViewParam * @param cardBar - card bar component * @param header - text component to display as header * @param footer - up to two buttons or text input to display as footer - * @returns Basic Card View parameters. + * @returns basic card view parameters. */ export function BasicCardView( cardBar: CardBarComponent, @@ -170,6 +170,7 @@ export function BasicCardView( * @param header - text component to display as header * @param body - text component to display as body * @param footer - up to two buttons or text input to display as footer + * @returns primary text card view parameters. */ export function PrimaryTextCardView( cardBar: CardBarComponent, @@ -197,6 +198,7 @@ export function PrimaryTextCardView( * @param header - text component to display as header * @param image - image to display * @param footer - up to two buttons or text input to display as footer + * @returns image card view parameters */ export function ImageCardView( cardBar: CardBarComponent, @@ -226,6 +228,7 @@ export function ImageCardView( * @param header - text component to display as header * @param body - text input component to display as body * @param footer - up to two buttons to display as footer + * @returns text input card view parameters */ export function TextInputCardView( cardBar: CardBarComponent, @@ -253,6 +256,7 @@ export function TextInputCardView( * @param header - text component to display as header * @param body - search box component to display as body * @param footer - search footer component to display as footer + * @returns search card view parameters */ export function SearchCardView( cardBar: CardBarComponent, @@ -281,7 +285,7 @@ export function SearchCardView( * @param header - text component to display as header * @param body - text component to display as body * @param footer - sign in complete button to display as footer - * @returns + * @returns sign in card view parameters */ export function SignInCardView( cardBar: CardBarComponent, From a30cbcac24c94b0e685dabc2e2c2d6c460c88cbf Mon Sep 17 00:00:00 2001 From: Alex Terentiev Date: Tue, 24 Oct 2023 12:39:37 -0700 Subject: [PATCH 04/13] update api file --- .../etc/botframework-schema.api.md | 538 ++++++++++++++++++ 1 file changed, 538 insertions(+) diff --git a/libraries/botframework-schema/etc/botframework-schema.api.md b/libraries/botframework-schema/etc/botframework-schema.api.md index 2f9078df2c..279563dfaa 100644 --- a/libraries/botframework-schema/etc/botframework-schema.api.md +++ b/libraries/botframework-schema/etc/botframework-schema.api.md @@ -4,6 +4,28 @@ ```ts +import { AdaptiveCard } from 'adaptivecards'; + +// @public +export type AceCardSize = 'Medium' | 'Large'; + +// @public +export interface AceData { + cardSize: AceCardSize; + dataVersion: string; + description: string; + iconProperty: string; + id: string; + properties: any; + title: string; +} + +// @public +export interface AceRequest { + data?: any; + properties?: any; +} + // @public export type Action = 'accept' | 'decline'; @@ -357,6 +379,23 @@ export interface AudioCard { value: any; } +// @public +export interface BaseCardComponent { + componentName: CardComponentName; + id?: string; +} + +// @public +export interface BaseCardViewParameters { + cardBar: [CardBarComponent]; +} + +// @public +export interface BaseHandleActionResponse { + renderArguments?: CardViewResponse | QuickViewResponse; + type: ViewResponseType; +} + // @public export interface BasicCard { buttons: CardAction[]; @@ -367,6 +406,9 @@ export interface BasicCard { title: string; } +// @public +export function BasicCardView(cardBar: CardBarComponent, header: CardTextComponent, footer?: CardViewFooterParameters): TextCardViewParameters; + // @public export interface BatchFailedEntriesResponse { continuationToken: string; @@ -440,6 +482,31 @@ export interface CardAction { value: any; } +// @public +export interface CardBarComponent extends BaseCardComponent { + componentName: 'cardBar'; + // Warning: (ae-forgotten-export) The symbol "CardImage" needs to be exported by the entry point index.d.ts + icon?: CardImage_2; + title?: string; +} + +// @public +export interface CardButtonBase { + // Warning: (ae-forgotten-export) The symbol "CardAction" needs to be exported by the entry point index.d.ts + action: CardAction_2; + id?: string; +} + +// @public +export interface CardButtonComponent extends BaseCardComponent, CardButtonBase { + componentName: 'cardButton'; + style?: 'default' | 'positive'; + title: string; +} + +// @public +export type CardComponentName = 'text' | 'cardButton' | 'cardBar' | 'textInput' | 'searchBox' | 'searchFooter'; + // @public export interface CardImage { alt?: string; @@ -447,6 +514,64 @@ export interface CardImage { url: string; } +// @public +export interface CardSearchBoxComponent extends BaseCardComponent { + button: ICardSearchBoxButton; + componentName: 'searchBox'; + defaultValue?: string; + placeholder?: string; +} + +// @public +export interface CardSearchFooterComponent extends BaseCardComponent { + componentName: 'searchFooter'; + imageInitials?: string; + imageUrl?: string; + onSelection?: CardAction_2; + text: string; + title: string; +} + +// @public +export interface CardTextComponent extends BaseCardComponent { + componentName: 'text'; + text: string; +} + +// @public +export interface CardTextInputComponent extends BaseCardComponent { + ariaLabel?: string; + button?: ICardTextInputIconButton | ICardTextInputTitleButton; + componentName: 'textInput'; + defaultValue?: string; + iconAfter?: CardImage_2; + iconBefore?: CardImage_2; + placeholder?: string; +} + +// @public +export type CardViewActionsFooterParameters = [CardButtonComponent] | [CardButtonComponent, CardButtonComponent] | undefined; + +// @public +export type CardViewFooterParameters = CardViewActionsFooterParameters | [CardTextInputComponent]; + +// @public +export interface CardViewHandleActionResponse extends BaseHandleActionResponse { + renderArguments: CardViewResponse; + type: 'Card'; +} + +// @public +export type CardViewParameters = TextCardViewParameters | TextInputCardViewParameters | SearchCardViewParameters | SignInCardViewParameters; + +// @public +export interface CardViewResponse { + aceData: AceData; + cardViewParameters: CardViewParameters; + onCardSelection?: OnCardSelectionAction; + viewId: string; +} + // @public export interface ChannelAccount { aadObjectId?: string; @@ -541,6 +666,12 @@ export interface ConfigResponse { export interface ConfigTaskResponse extends ConfigResponse { } +// @public +export interface ConfirmationDialog { + message: string; + title: string; +} + // @public export enum ContactRelationUpdateActionTypes { // (undocumented) @@ -625,6 +756,13 @@ export enum DeliveryModes { Notification = "notification" } +// @public +export enum DropDownOptionType { + Divider = 1, + Header = 2, + Normal = 0 +} + // @public export enum EndOfConversationCodes { // (undocumented) @@ -659,17 +797,54 @@ export interface ErrorResponse { error: ErrorModel; } +// @public +export interface ExecuteCardAction { + parameters: ExecuteCardParameters; + type: 'Execute'; + verb?: string; +} + +// @public +export interface ExecuteCardParameters { + [key: string]: unknown; +} + // @public export interface ExpectedReplies { activities: Activity[]; } +// @public +export interface ExternalLinkActionParameters { + isTeamsDeepLink?: boolean; + target: string; +} + +// @public +export interface ExternalLinkCardAction { + parameters: ExternalLinkActionParameters; + type: 'ExternalLink'; +} + // @public export interface Fact { key: string; value: string; } +// @public +export enum FieldType { + CheckBox = 2, + ChoiceGroup = 10, + Dropdown = 6, + HorizontalRule = 12, + Label = 7, + Link = 13, + Slider = 8, + TextField = 3, + Toggle = 5 +} + // @public export interface FileConsentCard { acceptContext?: any; @@ -712,6 +887,12 @@ export interface FileUploadInfo { uploadUrl?: string; } +// @public +export interface FocusParameters { + ariaLive?: 'polite' | 'assertive' | 'off'; + focusTarget?: string; +} + // @public export interface GeoCoordinates { elevation: number; @@ -721,6 +902,28 @@ export interface GeoCoordinates { type: string; } +// @public +export interface GetLocationActionParameters { + chooseLocationOnMap?: boolean; +} + +// @public +export interface GetLocationCardAction { + parameters?: GetLocationActionParameters; + type: 'VivaAction.GetLocation'; +} + +// @public +export interface GetPropertyPaneConfigurationResponse { + currentPage: number; + loadingIndicatorDelayTime: number; + pages: PropertyPanePage[]; + showLoadingIndicator: boolean; +} + +// @public +export type HandleActionResponse = CardViewHandleActionResponse | QuickViewHandleActionResponse | NoOpHandleActionResponse; + // @public export interface HeroCard { buttons: CardAction[]; @@ -747,6 +950,20 @@ export interface IActivity { type: ActivityTypes | string; } +// @public +export interface ICardSearchBoxButton extends CardButtonBase { +} + +// @public +export interface ICardTextInputIconButton extends CardButtonBase { + icon: CardImage_2; +} + +// @public +export interface ICardTextInputTitleButton extends CardButtonBase { + title: string; +} + // @public export interface ICommandActivity extends IActivity { name: string; @@ -802,6 +1019,9 @@ export interface IInvokeActivity extends IActivity { value?: any; } +// @public +export function ImageCardView(cardBar: CardBarComponent, header: CardTextComponent, image: CardImage_2, footer?: CardViewFooterParameters): TextCardViewParameters; + // @public (undocumented) export interface IMessageActivity extends IActivity { attachmentLayout?: AttachmentLayoutTypes | string; @@ -950,6 +1170,16 @@ export interface ITraceActivity extends IActivity { // @public (undocumented) export type ITypingActivity = IActivity; +// @public +interface Location_2 { + accuracy?: number; + latitude: number; + longitude: number; + timestamp?: number; +} + +export { Location_2 as Location } + // @public export interface MediaCard { aspect: string; @@ -971,6 +1201,16 @@ export interface MediaEventValue { cardValue: any; } +// @public +export enum MediaType { + // (undocumented) + Audio = 4, + // (undocumented) + Document = 8, + // (undocumented) + Image = 1 +} + // @public export interface MediaUrl { profile?: string; @@ -1237,6 +1477,12 @@ export interface MicrosoftPayMethodData { supportedTypes: string[]; } +// @public +export interface NoOpHandleActionResponse extends BaseHandleActionResponse { + renderArguments?: undefined; + type: 'NoOp'; +} + // @public export interface NotificationInfo { alert?: boolean; @@ -1380,6 +1626,9 @@ export interface OnBehalfOf { mri: string; } +// @public +export type OnCardSelectionAction = QuickViewCardAction | ExternalLinkCardAction | SelectMediaCardAction | GetLocationCardAction | ShowLocationCardAction | ExecuteCardAction | undefined; + // @public export type Os = 'default' | 'iOS' | 'android' | 'windows'; @@ -1529,6 +1778,209 @@ export interface Place { type: string; } +// @public +export enum PopupWindowPosition { + Center = 0, + LeftBottom = 4, + LeftTop = 2, + RightBottom = 3, + RightTop = 1 +} + +// @public +export function PrimaryTextCardView(cardBar: CardBarComponent, header: CardTextComponent, body: CardTextComponent, footer?: CardViewFooterParameters): TextCardViewParameters; + +// @public +export interface PropertyPaneCheckboxProperties extends PropertyPaneFieldProperties { + checked?: boolean; + disabled?: boolean; + text?: string; +} + +// @public +export interface PropertyPaneChoiceGroupIconProperties { + officeFabricIconFontName?: string; +} + +// @public +export interface PropertyPaneChoiceGroupImageSize { + height: number; + width: number; +} + +// @public +export interface PropertyPaneChoiceGroupOption { + ariaLabel?: string; + checked?: boolean; + disabled?: boolean; + iconProps?: PropertyPaneChoiceGroupIconProperties; + imageSize?: PropertyPaneChoiceGroupImageSize; + imageSrc?: string; + key: string; + text: string; +} + +// @public +export interface PropertyPaneChoiceGroupProperties extends PropertyPaneFieldProperties { + label?: string; + options: PropertyPaneChoiceGroupOption[]; +} + +// @public +export interface PropertyPaneDropDownOption { + index?: number; + key: string; + text: string; + type?: DropDownOptionType; +} + +// @public +export interface PropertyPaneDropDownProperties extends PropertyPaneFieldProperties { + ariaLabel?: string; + ariaPositionInSet?: number; + ariaSetSize?: number; + disabled?: boolean; + errorMessage?: string; + label: string; + options?: PropertyPaneDropDownOption[]; + selectedKey?: string; +} + +// @public +export interface PropertyPaneFieldProperties { +} + +// @public +export interface PropertyPaneGroup extends PropertyPaneGroupOrConditionalGroup { + groupFields: PropertyPaneGroupField[]; + groupName?: string; + isCollapsed?: boolean; + isGroupNameHidden?: boolean; +} + +// @public +export interface PropertyPaneGroupField { + properties: PropertyPaneFieldProperties; + shouldFocus?: boolean; + targetProperty: string; + type: FieldType; +} + +// @public +export interface PropertyPaneGroupOrConditionalGroup { +} + +// @public +export interface PropertyPaneLabelProperties extends PropertyPaneFieldProperties { + required?: boolean; + text: string; +} + +// @public +export interface PropertyPaneLinkPopupWindowProperties { + height: number; + positionWindowPosition: PopupWindowPosition; + title: string; + width: number; +} + +// @public +export interface PropertyPaneLinkProperties extends PropertyPaneFieldProperties { + ariaLabel?: string; + disabled?: boolean; + href: string; + popupWindowProps?: PropertyPaneLinkPopupWindowProperties; + target?: string; + text: string; +} + +// @public +export interface PropertyPanePage { + displayGroupsAsAccordion?: boolean; + groups: PropertyPaneGroupOrConditionalGroup[]; + header?: PropertyPanePageHeader; +} + +// @public +export interface PropertyPanePageHeader { + description: string; +} + +// @public +export interface PropertyPaneSliderProperties extends PropertyPaneFieldProperties { + ariaLabel?: string; + disabled?: boolean; + label?: string; + max: number; + min: number; + showValue?: boolean; + step?: number; + value?: string; +} + +// @public +export interface PropertyPaneTextFieldProperties extends PropertyPaneFieldProperties { + ariaLabel?: string; + description?: string; + disabled?: boolean; + errorMessage?: string; + label?: string; + logName?: string; + maxLength?: number; + multiline?: boolean; + placeholder?: string; + resizable?: boolean; + rows?: number; + underlined?: boolean; + value?: string; +} + +// @public +export interface PropertyPaneToggleProperties extends PropertyPaneFieldProperties { + ariaLabel?: string; + checked?: boolean; + disabled?: boolean; + key?: string; + label?: string; + offAriaLabel?: string; + offText?: string; + onAriaLabel?: string; + onText?: string; +} + +// @public +export interface QuickViewCardAction { + parameters: QuickViewParameters; + type: 'QuickView'; +} + +// @public (undocumented) +export interface QuickViewData { + // (undocumented) + [key: string]: unknown; +} + +// @public +export interface QuickViewHandleActionResponse extends BaseHandleActionResponse { + renderArguments: QuickViewResponse; + type: 'QuickView'; +} + +// @public +export interface QuickViewParameters { + view: string; +} + +// @public +export interface QuickViewResponse { + data: QuickViewData; + externalLink: ExternalLinkActionParameters; + focusParameters: FocusParameters; + template: AdaptiveCard; + title: string; + viewId: string; +} + // @public export type ReactionType = 'like' | 'heart' | 'laugh' | 'surprised' | 'sad' | 'angry'; @@ -1570,6 +2022,17 @@ export enum RoleTypes { User = "user" } +// @public +export function SearchCardView(cardBar: CardBarComponent, header: CardTextComponent, body: CardSearchBoxComponent, footer: CardSearchFooterComponent): SearchCardViewParameters; + +// @public +export interface SearchCardViewParameters extends BaseCardViewParameters { + body: [CardSearchBoxComponent]; + cardViewType: 'search'; + footer?: [CardSearchFooterComponent]; + header: [CardTextComponent]; +} + // @public export interface SearchInvokeOptions { skip: number; @@ -1588,6 +2051,20 @@ export interface SearchInvokeValue { queryText: string; } +// @public +export interface SelectMediaActionParameters { + allowMultipleCapture?: boolean; + maxSizePerFile?: number; + mediaType: MediaType; + supportedFileFormats?: string[]; +} + +// @public +export interface SelectMediaCardAction { + parameters: SelectMediaActionParameters; + type: 'VivaAction.SelectMedia'; +} + // @public export interface SemanticAction { entities: { @@ -1607,12 +2084,37 @@ export enum SemanticActionStateTypes { Start = "start" } +// @public (undocumented) +export type SetPropertyPaneConfigurationResponse = CardViewHandleActionResponse | NoOpHandleActionResponse; + +// @public +export interface ShowLocationActionParameters { + locationCoordinates?: Location_2; +} + +// @public +export interface ShowLocationCardAction { + parameters?: ShowLocationActionParameters; + type: 'VivaAction.ShowLocation'; +} + // @public export interface SigninCard { buttons: CardAction[]; text?: string; } +// @public +export function SignInCardView(cardBar: CardBarComponent, header: CardTextComponent, body: CardTextComponent, footer: CardButtonComponent): SignInCardViewParameters; + +// @public +export interface SignInCardViewParameters extends BaseCardViewParameters { + body: [CardTextComponent] | undefined; + cardViewType: 'signIn'; + footer?: [CardButtonComponent]; + header: [CardTextComponent]; +} + // @public export interface SigninStateVerificationQuery { state?: string; @@ -1663,6 +2165,18 @@ export enum StatusCodes { // @public export type Style = 'compact' | 'expanded'; +// @public +export interface SubmitCardAction { + confirmationDialog?: ConfirmationDialog; + parameters: SubmitCardParameters; + type: 'Submit'; +} + +// @public +export interface SubmitCardParameters { + [key: string]: unknown; +} + // @public export interface SuggestedActions { actions: CardAction[]; @@ -1872,6 +2386,15 @@ export interface TenantInfo { id?: string; } +// @public +export interface TextCardViewParameters extends BaseCardViewParameters { + body: [CardTextComponent] | undefined; + cardViewType: 'text'; + footer?: CardViewFooterParameters; + header: [CardTextComponent]; + image?: CardImage_2; +} + // @public export enum TextFormatTypes { // (undocumented) @@ -1888,6 +2411,18 @@ export interface TextHighlight { text: string; } +// @public +export function TextInputCardView(cardBar: CardBarComponent, header: CardTextComponent, body: CardTextInputComponent, footer?: CardViewActionsFooterParameters): TextInputCardViewParameters; + +// @public +export interface TextInputCardViewParameters extends BaseCardViewParameters { + body: [CardTextInputComponent]; + cardViewType: 'textInput'; + footer?: CardViewActionsFooterParameters; + header: [CardTextComponent]; + image?: CardImage_2; +} + // @public export interface Thing { name: string; @@ -2020,6 +2555,9 @@ export interface VideoCard { value: any; } +// @public +export type ViewResponseType = 'Card' | 'QuickView' | 'NoOp'; + // (No @packageDocumentation comment for this package) From fd2475632900fc48de74baf3c64f5867c83745b3 Mon Sep 17 00:00:00 2001 From: Alex Terentiev Date: Thu, 26 Oct 2023 14:46:06 -0700 Subject: [PATCH 05/13] fix all lint errors --- .../src/sharepoint/aceData.ts | 2 +- .../src/sharepoint/aceRequest.ts | 2 +- .../src/sharepoint/actions/cardAction.ts | 11 +-- .../src/sharepoint/actions/focusParameters.ts | 18 ++--- .../src/sharepoint/actions/index.ts | 2 +- .../sharepoint/cardView/baseCardComponent.ts | 26 +++---- .../sharepoint/cardView/cardBarComponent.ts | 24 +++--- .../src/sharepoint/cardView/cardButtonBase.ts | 16 ++-- .../cardView/cardButtonComponent.ts | 24 +++--- .../src/sharepoint/cardView/cardImage.ts | 2 +- .../cardView/cardSearchBoxComponent.ts | 37 +++++----- .../cardView/cardSearchFooterComponent.ts | 50 ++++++------- .../sharepoint/cardView/cardTextComponent.ts | 18 ++--- .../cardView/cardTextInputComponent.ts | 74 +++++++++---------- .../sharepoint/cardView/cardViewParameters.ts | 34 ++++++--- .../src/sharepoint/cardViewResponse.ts | 2 +- .../getPropertyPaneConfigurationResponse.ts | 2 +- .../src/sharepoint/handleActionResponse.ts | 5 +- .../src/sharepoint/index.ts | 2 +- .../propertyPaneCheckboxProperties.ts | 2 +- .../propertyPaneChoiceGroupIconProperties.ts | 2 +- .../propertyPaneChoiceGroupImageSize.ts | 2 +- .../propertyPaneChoiceGroupOption.ts | 2 +- .../propertyPaneChoiceGroupProperties.ts | 2 +- .../sharepoint/propertyPaneDropDownOption.ts | 4 +- .../propertyPaneDropDownProperties.ts | 2 +- .../sharepoint/propertyPaneFieldProperties.ts | 5 +- .../src/sharepoint/propertyPaneGroup.ts | 2 +- .../src/sharepoint/propertyPaneGroupField.ts | 2 +- .../propertyPaneGroupOrConditionalGroup.ts | 5 +- .../sharepoint/propertyPaneLabelProperties.ts | 2 +- .../propertyPaneLinkPopupWindowProperties.ts | 4 +- .../sharepoint/propertyPaneLinkProperties.ts | 2 +- .../src/sharepoint/propertyPanePage.ts | 2 +- .../src/sharepoint/propertyPanePageHeader.ts | 2 +- .../propertyPaneSliderProperties.ts | 2 +- .../propertyPaneTextFieldProperties.ts | 2 +- .../propertyPaneToggleProperties.ts | 2 +- .../src/sharepoint/quickViewData.ts | 2 +- .../src/sharepoint/quickViewResponse.ts | 2 +- .../setPropertyPaneConfigurationResponse.ts | 4 +- 41 files changed, 210 insertions(+), 197 deletions(-) diff --git a/libraries/botframework-schema/src/sharepoint/aceData.ts b/libraries/botframework-schema/src/sharepoint/aceData.ts index 6219be7a62..c793e6b92d 100644 --- a/libraries/botframework-schema/src/sharepoint/aceData.ts +++ b/libraries/botframework-schema/src/sharepoint/aceData.ts @@ -38,4 +38,4 @@ export interface AceData { /** * SharePoint ACE Card Size */ -export type AceCardSize = 'Medium' | 'Large'; \ No newline at end of file +export type AceCardSize = 'Medium' | 'Large'; diff --git a/libraries/botframework-schema/src/sharepoint/aceRequest.ts b/libraries/botframework-schema/src/sharepoint/aceRequest.ts index b9e890fddc..009374bbbd 100644 --- a/libraries/botframework-schema/src/sharepoint/aceRequest.ts +++ b/libraries/botframework-schema/src/sharepoint/aceRequest.ts @@ -13,4 +13,4 @@ export interface AceRequest { * ACE properties data. */ properties?: any; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/actions/cardAction.ts b/libraries/botframework-schema/src/sharepoint/actions/cardAction.ts index 0fae641cfc..30c4e838d7 100644 --- a/libraries/botframework-schema/src/sharepoint/actions/cardAction.ts +++ b/libraries/botframework-schema/src/sharepoint/actions/cardAction.ts @@ -43,7 +43,7 @@ export interface Location { export enum MediaType { Image = 1, Audio = 4, - Document = 8 + Document = 8, } /** @@ -71,8 +71,8 @@ export interface QuickViewParameters { } /** -* SharePoint ExternalLink action. -*/ + * SharePoint ExternalLink action. + */ export interface ExternalLinkCardAction { /** * Indicates this is an external link button. @@ -255,10 +255,11 @@ export type CardAction = /** * Type of handler for when a card is selected. */ -export type OnCardSelectionAction = QuickViewCardAction +export type OnCardSelectionAction = + | QuickViewCardAction | ExternalLinkCardAction | SelectMediaCardAction | GetLocationCardAction | ShowLocationCardAction | ExecuteCardAction - | undefined; \ No newline at end of file + | undefined; diff --git a/libraries/botframework-schema/src/sharepoint/actions/focusParameters.ts b/libraries/botframework-schema/src/sharepoint/actions/focusParameters.ts index fd3fd76619..2ad03ac373 100644 --- a/libraries/botframework-schema/src/sharepoint/actions/focusParameters.ts +++ b/libraries/botframework-schema/src/sharepoint/actions/focusParameters.ts @@ -6,15 +6,15 @@ */ export interface FocusParameters { /** - * Sets the default focus on the DOM. Developers pass in the id of a unique element that is to attain focus within a quick view. - * If the `focusTarget` is not defined then the root element is selected. - */ + * Sets the default focus on the DOM. Developers pass in the id of a unique element that is to attain focus within a quick view. + * If the `focusTarget` is not defined then the root element is selected. + */ focusTarget?: string; /** - * Sets the accessibility reading of the contents within the focus target. - * Polite - Content in the target's subtree is read when the user is idle. - * Assertive - Disrupts any announcement in favor of the changed contents within the target's subtree. - * Off - The screen reader will not read contents within the target's subtree. - */ + * Sets the accessibility reading of the contents within the focus target. + * Polite - Content in the target's subtree is read when the user is idle. + * Assertive - Disrupts any announcement in favor of the changed contents within the target's subtree. + * Off - The screen reader will not read contents within the target's subtree. + */ ariaLive?: 'polite' | 'assertive' | 'off'; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/actions/index.ts b/libraries/botframework-schema/src/sharepoint/actions/index.ts index 7755f35503..855ecf3ed9 100644 --- a/libraries/botframework-schema/src/sharepoint/actions/index.ts +++ b/libraries/botframework-schema/src/sharepoint/actions/index.ts @@ -2,4 +2,4 @@ // Licensed under the MIT License. export * from './cardAction'; -export * from './focusParameters'; \ No newline at end of file +export * from './focusParameters'; diff --git a/libraries/botframework-schema/src/sharepoint/cardView/baseCardComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/baseCardComponent.ts index eec7fc9c22..def5e076f0 100644 --- a/libraries/botframework-schema/src/sharepoint/cardView/baseCardComponent.ts +++ b/libraries/botframework-schema/src/sharepoint/cardView/baseCardComponent.ts @@ -4,25 +4,19 @@ /** * Names of the components allowed in a card view. */ -export type CardComponentName = - | 'text' - | 'cardButton' - | 'cardBar' - | 'textInput' - | 'searchBox' - | 'searchFooter'; +export type CardComponentName = 'text' | 'cardButton' | 'cardBar' | 'textInput' | 'searchBox' | 'searchFooter'; /** * Base Adaptive Card Extension card view component. */ export interface BaseCardComponent { - /** - * Unique component name. - * For example, "textInput" - */ - componentName: CardComponentName; - /** - * Optional unique identifier of the component's instance. - */ - id?: string; + /** + * Unique component name. + * For example, "textInput" + */ + componentName: CardComponentName; + /** + * Optional unique identifier of the component's instance. + */ + id?: string; } diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardBarComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardBarComponent.ts index b6d4d6f9b1..16d088c5ec 100644 --- a/libraries/botframework-schema/src/sharepoint/cardView/cardBarComponent.ts +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardBarComponent.ts @@ -8,16 +8,16 @@ import type { BaseCardComponent } from './baseCardComponent'; * Adaptive Card Extension Card view title area (card bar) component */ export interface CardBarComponent extends BaseCardComponent { - /** - * Unique component name. - */ - componentName: 'cardBar'; - /** - * The icon to display. - */ - icon?: CardImage; - /** - * The title to display. - */ - title?: string; + /** + * Unique component name. + */ + componentName: 'cardBar'; + /** + * The icon to display. + */ + icon?: CardImage; + /** + * The title to display. + */ + title?: string; } diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardButtonBase.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardButtonBase.ts index 2d05d15edc..5934cebb87 100644 --- a/libraries/botframework-schema/src/sharepoint/cardView/cardButtonBase.ts +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardButtonBase.ts @@ -7,12 +7,12 @@ import type { CardAction } from '../actions/cardAction'; * Base properties for the buttons used in different Adaptive Card Extension card view components, such as Text Input, Search Box and Card Button. */ export interface CardButtonBase { - /** - * The type of the button. - */ - action: CardAction; - /** - * Unique Id of the button. - */ - id?: string; + /** + * The type of the button. + */ + action: CardAction; + /** + * Unique Id of the button. + */ + id?: string; } diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardButtonComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardButtonComponent.ts index d84746b256..591b4e4543 100644 --- a/libraries/botframework-schema/src/sharepoint/cardView/cardButtonComponent.ts +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardButtonComponent.ts @@ -8,16 +8,16 @@ import type { CardButtonBase } from './cardButtonBase'; * Adaptive Card Extension Card button component. */ export interface CardButtonComponent extends BaseCardComponent, CardButtonBase { - /** - * Unique component name. - */ - componentName: 'cardButton'; - /** - * Text displayed on the button. - */ - title: string; - /** - * Controls the style of the button. - */ - style?: 'default' | 'positive'; + /** + * Unique component name. + */ + componentName: 'cardButton'; + /** + * Text displayed on the button. + */ + title: string; + /** + * Controls the style of the button. + */ + style?: 'default' | 'positive'; } diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardImage.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardImage.ts index 916bbf4590..4d032f6a32 100644 --- a/libraries/botframework-schema/src/sharepoint/cardView/cardImage.ts +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardImage.ts @@ -13,4 +13,4 @@ export interface CardImage { * The alt text. */ altText?: string; - } \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardSearchBoxComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardSearchBoxComponent.ts index 76f48f4dd2..e1894ed17e 100644 --- a/libraries/botframework-schema/src/sharepoint/cardView/cardSearchBoxComponent.ts +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardSearchBoxComponent.ts @@ -7,26 +7,29 @@ import type { CardButtonBase } from './cardButtonBase'; /** * Search box button properties. */ -export interface ICardSearchBoxButton extends CardButtonBase {} +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ICardSearchBoxButton extends CardButtonBase { + // reserved for future. Not additional properties. +} /** * Adaptive Card Extension Search box component. Represents a search box rendered in the card view. */ export interface CardSearchBoxComponent extends BaseCardComponent { - /** - * Unique component name. - */ - componentName: 'searchBox'; - /** - * Placeholder text to display. - */ - placeholder?: string; - /** - * Default value to display. - */ - defaultValue?: string; - /** - * Button displayed on the search box. - */ - button: ICardSearchBoxButton; + /** + * Unique component name. + */ + componentName: 'searchBox'; + /** + * Placeholder text to display. + */ + placeholder?: string; + /** + * Default value to display. + */ + defaultValue?: string; + /** + * Button displayed on the search box. + */ + button: ICardSearchBoxButton; } diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardSearchFooterComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardSearchFooterComponent.ts index 395823bb67..126c431be9 100644 --- a/libraries/botframework-schema/src/sharepoint/cardView/cardSearchFooterComponent.ts +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardSearchFooterComponent.ts @@ -8,28 +8,28 @@ import type { BaseCardComponent } from './baseCardComponent'; * Adaptive Card Extension Search footer component. Represents a container with an image (in the shape of a circle) and text. */ export interface CardSearchFooterComponent extends BaseCardComponent { - /** - * Unique component name. - */ - componentName: 'searchFooter'; - /** - * Title text to display. - */ - title: string; - /** - * Url to the image to use, should be a square aspect ratio and big enough to fit in the image area. - */ - imageUrl?: string; - /** - * The initials to display in the image area when there is no image. - */ - imageInitials?: string; - /** - * Primary text to display. For example, name of the person for people search. - */ - text: string; - /** - * Action to invoke when the footer is selected. - */ - onSelection?: CardAction; -} \ No newline at end of file + /** + * Unique component name. + */ + componentName: 'searchFooter'; + /** + * Title text to display. + */ + title: string; + /** + * Url to the image to use, should be a square aspect ratio and big enough to fit in the image area. + */ + imageUrl?: string; + /** + * The initials to display in the image area when there is no image. + */ + imageInitials?: string; + /** + * Primary text to display. For example, name of the person for people search. + */ + text: string; + /** + * Action to invoke when the footer is selected. + */ + onSelection?: CardAction; +} diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardTextComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardTextComponent.ts index 117d040a47..2038e1aee1 100644 --- a/libraries/botframework-schema/src/sharepoint/cardView/cardTextComponent.ts +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardTextComponent.ts @@ -7,12 +7,12 @@ import type { BaseCardComponent } from './baseCardComponent'; * Adaptive Card Extension Text component. Represents a text block rendered in the card view. */ export interface CardTextComponent extends BaseCardComponent { - /** - * Unique component name. - */ - componentName: 'text'; - /** - * Text to display. - */ - text: string; -} \ No newline at end of file + /** + * Unique component name. + */ + componentName: 'text'; + /** + * Text to display. + */ + text: string; +} diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardTextInputComponent.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardTextInputComponent.ts index 9c3997d28b..7e0a82d2f1 100644 --- a/libraries/botframework-schema/src/sharepoint/cardView/cardTextInputComponent.ts +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardTextInputComponent.ts @@ -9,52 +9,52 @@ import type { CardButtonBase } from './cardButtonBase'; * Text input icon button. */ export interface ICardTextInputIconButton extends CardButtonBase { - /** - * Properties for the icon displayed on the button. - */ - icon: CardImage; + /** + * Properties for the icon displayed on the button. + */ + icon: CardImage; } /** * Text input title button. */ export interface ICardTextInputTitleButton extends CardButtonBase { - /** - * Text displayed on the button. - */ - title: string; + /** + * Text displayed on the button. + */ + title: string; } /** * Adaptive Card Extension Text input component. */ export interface CardTextInputComponent extends BaseCardComponent { - /** - * Unique component name. - */ - componentName: 'textInput'; - /** - * Placeholder text to display. - */ - placeholder?: string; - /** - * Default value to display. - */ - defaultValue?: string; - /** - * Properties for an optional icon, displayed in the left end of the text input. - */ - iconBefore?: CardImage; - /** - * Properties for an optional icon, displayed in the right end of the text input. - */ - iconAfter?: CardImage; - /** - * Optional button to display. - */ - button?: ICardTextInputIconButton | ICardTextInputTitleButton; - /** - * Aria label for the text field. - */ - ariaLabel?: string; -} \ No newline at end of file + /** + * Unique component name. + */ + componentName: 'textInput'; + /** + * Placeholder text to display. + */ + placeholder?: string; + /** + * Default value to display. + */ + defaultValue?: string; + /** + * Properties for an optional icon, displayed in the left end of the text input. + */ + iconBefore?: CardImage; + /** + * Properties for an optional icon, displayed in the right end of the text input. + */ + iconAfter?: CardImage; + /** + * Optional button to display. + */ + button?: ICardTextInputIconButton | ICardTextInputTitleButton; + /** + * Aria label for the text field. + */ + ariaLabel?: string; +} diff --git a/libraries/botframework-schema/src/sharepoint/cardView/cardViewParameters.ts b/libraries/botframework-schema/src/sharepoint/cardView/cardViewParameters.ts index cd0997fa85..8de587613b 100644 --- a/libraries/botframework-schema/src/sharepoint/cardView/cardViewParameters.ts +++ b/libraries/botframework-schema/src/sharepoint/cardView/cardViewParameters.ts @@ -33,8 +33,8 @@ export interface BaseCardViewParameters { } /** -* The parameters for the card view with text or empty body. -*/ + * The parameters for the card view with text or empty body. + */ export interface TextCardViewParameters extends BaseCardViewParameters { /** * Card View type @@ -108,8 +108,8 @@ export interface SearchCardViewParameters extends BaseCardViewParameters { } /** -* The parameters for the sign in card view. -*/ + * The parameters for the sign in card view. + */ export interface SignInCardViewParameters extends BaseCardViewParameters { /** * Card View type @@ -132,7 +132,11 @@ export interface SignInCardViewParameters extends BaseCardViewParameters { /** * Card View Parameters. */ -export type CardViewParameters = TextCardViewParameters | TextInputCardViewParameters | SearchCardViewParameters | SignInCardViewParameters; +export type CardViewParameters = + | TextCardViewParameters + | TextInputCardViewParameters + | SearchCardViewParameters + | SignInCardViewParameters; /** * Helper method to create a Basic Card View. @@ -140,6 +144,7 @@ export type CardViewParameters = TextCardViewParameters | TextInputCardViewParam * - Card bar * - One primary text field * - Zero or one button in the Medium card size, up to two buttons in Large card size; or text input. + * * @param cardBar - card bar component * @param header - text component to display as header * @param footer - up to two buttons or text input to display as footer @@ -155,7 +160,7 @@ export function BasicCardView( body: undefined, cardBar: [cardBar], header: [header], - footer: footer + footer: footer, }; } @@ -166,6 +171,7 @@ export function BasicCardView( * - One primary text field * - One description text field * - Zero or one button in the Medium card size, up to two buttons in Large card size; or text input. + * * @param cardBar - card bar component * @param header - text component to display as header * @param body - text component to display as body @@ -183,7 +189,7 @@ export function PrimaryTextCardView( cardBar: [cardBar], header: [header], body: [body], - footer: footer + footer: footer, }; } @@ -194,6 +200,7 @@ export function PrimaryTextCardView( * - One primary text field * - One image * - Zero buttons in the Medium card size, up to two buttons in Large card size; or text input. + * * @param cardBar - card bar component * @param header - text component to display as header * @param image - image to display @@ -212,7 +219,7 @@ export function ImageCardView( cardBar: [cardBar], header: [header], body: undefined, - footer: footer + footer: footer, }; } @@ -224,6 +231,7 @@ export function ImageCardView( * - Zero or one image * - Zero text input in Medium card size if image is presented, one text input in Medium card size if no image is presented, one text input in Large card size * - Zero buttons in the Medium card size if image is presented, one button in Medium card size if no image is presented, up to two buttons in Large card size; or text input. + * * @param cardBar - card bar component * @param header - text component to display as header * @param body - text input component to display as body @@ -241,7 +249,7 @@ export function TextInputCardView( cardBar: [cardBar], header: [header], body: [body], - footer: footer + footer: footer, }; } @@ -252,6 +260,7 @@ export function TextInputCardView( * - One primary text field * - One search box * - One search footer + * * @param cardBar - card bar component * @param header - text component to display as header * @param body - search box component to display as body @@ -269,7 +278,7 @@ export function SearchCardView( cardBar: [cardBar], header: [header], body: [body], - footer: [footer] + footer: [footer], }; } @@ -280,6 +289,7 @@ export function SearchCardView( * - One primary text field * - One description text field * - Two buttons. + * * @remarks The first button (sign in button) is always displayed based on the signInText property of the Adaptive Card Extension. Here you should specify the second button (sign in complete button) to display. * @param cardBar - card bar component * @param header - text component to display as header @@ -298,6 +308,6 @@ export function SignInCardView( cardBar: [cardBar], header: [header], body: [body], - footer: [footer] + footer: [footer], }; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/cardViewResponse.ts b/libraries/botframework-schema/src/sharepoint/cardViewResponse.ts index 8e806135d4..51c80a70b5 100644 --- a/libraries/botframework-schema/src/sharepoint/cardViewResponse.ts +++ b/libraries/botframework-schema/src/sharepoint/cardViewResponse.ts @@ -25,4 +25,4 @@ export interface CardViewResponse { * The view id. */ viewId: string; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/getPropertyPaneConfigurationResponse.ts b/libraries/botframework-schema/src/sharepoint/getPropertyPaneConfigurationResponse.ts index b3598632d7..cafecb42c4 100644 --- a/libraries/botframework-schema/src/sharepoint/getPropertyPaneConfigurationResponse.ts +++ b/libraries/botframework-schema/src/sharepoint/getPropertyPaneConfigurationResponse.ts @@ -23,4 +23,4 @@ export interface GetPropertyPaneConfigurationResponse { * Value indicating whether to show loading indicator on top of the property pane. */ showLoadingIndicator: boolean; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/handleActionResponse.ts b/libraries/botframework-schema/src/sharepoint/handleActionResponse.ts index e086b853fe..3e4c427575 100644 --- a/libraries/botframework-schema/src/sharepoint/handleActionResponse.ts +++ b/libraries/botframework-schema/src/sharepoint/handleActionResponse.ts @@ -68,4 +68,7 @@ export interface NoOpHandleActionResponse extends BaseHandleActionResponse { /** * The handle action response. */ -export type HandleActionResponse = CardViewHandleActionResponse | QuickViewHandleActionResponse | NoOpHandleActionResponse; \ No newline at end of file +export type HandleActionResponse = + | CardViewHandleActionResponse + | QuickViewHandleActionResponse + | NoOpHandleActionResponse; diff --git a/libraries/botframework-schema/src/sharepoint/index.ts b/libraries/botframework-schema/src/sharepoint/index.ts index 82722f649f..7305500a50 100644 --- a/libraries/botframework-schema/src/sharepoint/index.ts +++ b/libraries/botframework-schema/src/sharepoint/index.ts @@ -29,4 +29,4 @@ export * from './cardViewResponse'; export * from './quickViewData'; export * from './quickViewResponse'; export * from './actions'; -export * from './cardView'; \ No newline at end of file +export * from './cardView'; diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneCheckboxProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneCheckboxProperties.ts index 5dfa95fd12..25a396d9a8 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneCheckboxProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneCheckboxProperties.ts @@ -19,4 +19,4 @@ export interface PropertyPaneCheckboxProperties extends PropertyPaneFieldPropert * Indicates whether the checkbox is checked or not. */ checked?: boolean; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupIconProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupIconProperties.ts index d52bfd0a30..c8ad8e32ec 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupIconProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupIconProperties.ts @@ -9,4 +9,4 @@ export interface PropertyPaneChoiceGroupIconProperties { * The name of the icon to use from Office Fabric icon set. */ officeFabricIconFontName?: string; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupImageSize.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupImageSize.ts index d5536021ad..f61c5f5e90 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupImageSize.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupImageSize.ts @@ -13,4 +13,4 @@ export interface PropertyPaneChoiceGroupImageSize { * The height of the image. */ height: number; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupOption.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupOption.ts index 6484cc48df..44c0d92b55 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupOption.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupOption.ts @@ -40,4 +40,4 @@ export interface PropertyPaneChoiceGroupOption { * The text to display next for this choice group option. */ text: string; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupProperties.ts index 70acea96dd..4d52e2b62a 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneChoiceGroupProperties.ts @@ -16,4 +16,4 @@ export interface PropertyPaneChoiceGroupProperties extends PropertyPaneFieldProp * The options for the choice group. */ options: PropertyPaneChoiceGroupOption[]; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownOption.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownOption.ts index 0d5a45c57f..0b536153e9 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownOption.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownOption.ts @@ -38,5 +38,5 @@ export enum DropDownOptionType { /** * Render a header. */ - Header = 2 -} \ No newline at end of file + Header = 2, +} diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownProperties.ts index b72bcd3aeb..6b48330c0c 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneDropDownProperties.ts @@ -40,4 +40,4 @@ export interface PropertyPaneDropDownProperties extends PropertyPaneFieldPropert * The options for the dropdown. */ options?: PropertyPaneDropDownOption[]; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneFieldProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneFieldProperties.ts index ce10937958..62b8be7c0f 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneFieldProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneFieldProperties.ts @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. - /** * SharePoint base property pane field properties */ +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface PropertyPaneFieldProperties { -} \ No newline at end of file + // keep this empty - used as base type in property group definition +} diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneGroup.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneGroup.ts index 9ff91d75ae..ccdb9835d8 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneGroup.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneGroup.ts @@ -24,4 +24,4 @@ export interface PropertyPaneGroup extends PropertyPaneGroupOrConditionalGroup { * Whether the group name is hidden or not. */ isGroupNameHidden?: boolean; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneGroupField.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneGroupField.ts index 25ec34058f..59825fe5d5 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneGroupField.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneGroupField.ts @@ -65,4 +65,4 @@ export enum FieldType { * Link field. */ Link = 13, -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneGroupOrConditionalGroup.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneGroupOrConditionalGroup.ts index bc8288902c..723c891508 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneGroupOrConditionalGroup.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneGroupOrConditionalGroup.ts @@ -1,6 +1,7 @@ /** * SharePoint property pane group or conditional group */ +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface PropertyPaneGroupOrConditionalGroup { - -} \ No newline at end of file + // keep this empty - used as base type in property page definition +} diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneLabelProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneLabelProperties.ts index f70682522d..28a8ccd8dd 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneLabelProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneLabelProperties.ts @@ -15,4 +15,4 @@ export interface PropertyPaneLabelProperties extends PropertyPaneFieldProperties * Whether the label is required or not. */ required?: boolean; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneLinkPopupWindowProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneLinkPopupWindowProperties.ts index b69de33dc1..a2d222d8d7 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneLinkPopupWindowProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneLinkPopupWindowProperties.ts @@ -46,5 +46,5 @@ export enum PopupWindowPosition { /** * Left bottom. */ - LeftBottom = 4 -} \ No newline at end of file + LeftBottom = 4, +} diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneLinkProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneLinkProperties.ts index 7697d63c4c..bdc1ab0de4 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneLinkProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneLinkProperties.ts @@ -32,4 +32,4 @@ export interface PropertyPaneLinkProperties extends PropertyPaneFieldProperties * The properties of the popup window. */ popupWindowProps?: PropertyPaneLinkPopupWindowProperties; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/propertyPanePage.ts b/libraries/botframework-schema/src/sharepoint/propertyPanePage.ts index 1dd3b197d5..f63062d41f 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPanePage.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPanePage.ts @@ -20,4 +20,4 @@ export interface PropertyPanePage { * The header to be rendered inside this page. */ header?: PropertyPanePageHeader; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/propertyPanePageHeader.ts b/libraries/botframework-schema/src/sharepoint/propertyPanePageHeader.ts index 5b14958b4c..411cbeb134 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPanePageHeader.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPanePageHeader.ts @@ -9,4 +9,4 @@ export interface PropertyPanePageHeader { * The description of the page. */ description: string; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneSliderProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneSliderProperties.ts index b83e246449..ef7b77e2b4 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneSliderProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneSliderProperties.ts @@ -39,4 +39,4 @@ export interface PropertyPaneSliderProperties extends PropertyPaneFieldPropertie * Whether to show the value on the right of the slider or no. */ showValue?: boolean; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneTextFieldProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneTextFieldProperties.ts index c965a527b6..b56df3a1a2 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneTextFieldProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneTextFieldProperties.ts @@ -59,4 +59,4 @@ export interface PropertyPaneTextFieldProperties extends PropertyPaneFieldProper * Whether or not the text field is underlined. */ underlined?: boolean; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/propertyPaneToggleProperties.ts b/libraries/botframework-schema/src/sharepoint/propertyPaneToggleProperties.ts index e33437591f..563afb6b8b 100644 --- a/libraries/botframework-schema/src/sharepoint/propertyPaneToggleProperties.ts +++ b/libraries/botframework-schema/src/sharepoint/propertyPaneToggleProperties.ts @@ -43,4 +43,4 @@ export interface PropertyPaneToggleProperties extends PropertyPaneFieldPropertie * Optional offAriaLabel flag. Text for screen-reader to announce when toggle is OFF. */ offAriaLabel?: string; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/quickViewData.ts b/libraries/botframework-schema/src/sharepoint/quickViewData.ts index 8b18a162a4..5900f892ca 100644 --- a/libraries/botframework-schema/src/sharepoint/quickViewData.ts +++ b/libraries/botframework-schema/src/sharepoint/quickViewData.ts @@ -3,4 +3,4 @@ export interface QuickViewData { [key: string]: unknown; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/quickViewResponse.ts b/libraries/botframework-schema/src/sharepoint/quickViewResponse.ts index 18155b2d4a..933209604b 100644 --- a/libraries/botframework-schema/src/sharepoint/quickViewResponse.ts +++ b/libraries/botframework-schema/src/sharepoint/quickViewResponse.ts @@ -34,4 +34,4 @@ export interface QuickViewResponse { * An optional focus element to set focus when the view is rendered for accessibility purposes. */ focusParameters: FocusParameters; -} \ No newline at end of file +} diff --git a/libraries/botframework-schema/src/sharepoint/setPropertyPaneConfigurationResponse.ts b/libraries/botframework-schema/src/sharepoint/setPropertyPaneConfigurationResponse.ts index 9efb8813eb..9a177c3f3e 100644 --- a/libraries/botframework-schema/src/sharepoint/setPropertyPaneConfigurationResponse.ts +++ b/libraries/botframework-schema/src/sharepoint/setPropertyPaneConfigurationResponse.ts @@ -1,5 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { CardViewHandleActionResponse, NoOpHandleActionResponse } from "./handleActionResponse"; +import { CardViewHandleActionResponse, NoOpHandleActionResponse } from './handleActionResponse'; -export type SetPropertyPaneConfigurationResponse = CardViewHandleActionResponse | NoOpHandleActionResponse; \ No newline at end of file +export type SetPropertyPaneConfigurationResponse = CardViewHandleActionResponse | NoOpHandleActionResponse; From 41d0092dac81ade346cdd0f84dfb5d429d89ed69 Mon Sep 17 00:00:00 2001 From: Alex Terentiev Date: Thu, 26 Oct 2023 15:04:45 -0700 Subject: [PATCH 06/13] more lint errors --- .../sharepoint/sharePointActivityHandler.ts | 83 ++++++++++++------- 1 file changed, 52 insertions(+), 31 deletions(-) diff --git a/libraries/botbuilder/src/sharepoint/sharePointActivityHandler.ts b/libraries/botbuilder/src/sharepoint/sharePointActivityHandler.ts index 54618744df..e0227276be 100644 --- a/libraries/botbuilder/src/sharepoint/sharePointActivityHandler.ts +++ b/libraries/botbuilder/src/sharepoint/sharePointActivityHandler.ts @@ -15,7 +15,7 @@ import { QuickViewResponse, GetPropertyPaneConfigurationResponse, SetPropertyPaneConfigurationResponse, - HandleActionResponse + HandleActionResponse, } from 'botbuilder-core'; /** @@ -26,10 +26,10 @@ export class SharePointActivityHandler extends ActivityHandler { /** * Invoked when an invoke activity is received from the connector. * Invoke activities can be used to communicate many different things. + * * Invoke activities communicate programmatic commands from a client or channel to a bot. + * * @param context A strongly-typed context object for this turn * @returns A task that represents the work queued to execute - * - * Invoke activities communicate programmatic commands from a client or channel to a bot. */ protected async onInvokeActivity(context: TurnContext): Promise { try { @@ -39,26 +39,32 @@ export class SharePointActivityHandler extends ActivityHandler { switch (context.activity.name) { case 'cardExtension/getCardView': return ActivityHandler.createInvokeResponse( - await this.OnSharePointTaskGetCardViewAsync(context, (context.activity.value as AceRequest)) + await this.OnSharePointTaskGetCardViewAsync(context, context.activity.value as AceRequest) ); case 'cardExtension/getQuickView': return ActivityHandler.createInvokeResponse( - await this.OnSharePointTaskGetQuickViewAsync(context, (context.activity.value as AceRequest)) + await this.OnSharePointTaskGetQuickViewAsync(context, context.activity.value as AceRequest) ); case 'cardExtension/getPropertyPaneConfiguration': return ActivityHandler.createInvokeResponse( - await this.OnSharePointTaskGetPropertyPaneConfigurationAsync(context, (context.activity.value as AceRequest)) + await this.OnSharePointTaskGetPropertyPaneConfigurationAsync( + context, + context.activity.value as AceRequest + ) ); case 'cardExtension/setPropertyPaneConfiguration': return ActivityHandler.createInvokeResponse( - await this.OnSharePointTaskSetPropertyPaneConfigurationAsync(context, (context.activity.value as AceRequest)) + await this.OnSharePointTaskSetPropertyPaneConfigurationAsync( + context, + context.activity.value as AceRequest + ) ); case 'cardExtension/handleAction': return ActivityHandler.createInvokeResponse( - await this.OnSharePointTaskHandleActionAsync(context, (context.activity.value as AceRequest)) + await this.OnSharePointTaskHandleActionAsync(context, context.activity.value as AceRequest) ); default: return super.onInvokeActivity(context); @@ -76,56 +82,71 @@ export class SharePointActivityHandler extends ActivityHandler { /** * Override this in a derived class to provide logic for when a card view is fetched - * - * @param context - A strongly-typed context object for this turn - * @param taskModuleRequest - The task module invoke request value payload + * + * @param _context - A strongly-typed context object for this turn + * @param _aceRequest - The Ace invoke request value payload * @returns A task module response for the request */ - protected async OnSharePointTaskGetCardViewAsync(context: TurnContext, aceRequest: AceRequest): Promise{ + protected async OnSharePointTaskGetCardViewAsync( + _context: TurnContext, + _aceRequest: AceRequest + ): Promise { throw new Error('NotImplemented'); } /** * Override this in a derived class to provide logic for when a quick view is fetched - * - * @param context - A strongly-typed context object for this turn - * @param taskModuleRequest - The task module invoke request value payload + * + * @param _context - A strongly-typed context object for this turn + * @param _aceRequest - The Ace invoke request value payload * @returns A task module response for the request */ - protected async OnSharePointTaskGetQuickViewAsync(context: TurnContext, aceRequest: AceRequest): Promise{ + protected async OnSharePointTaskGetQuickViewAsync( + _context: TurnContext, + _aceRequest: AceRequest + ): Promise { throw new Error('NotImplemented'); } /** * Override this in a derived class to provide logic for getting configuration pane properties. - * - * @param context - A strongly-typed context object for this turn - * @param taskModuleRequest - The task module invoke request value payload + * + * @param _context - A strongly-typed context object for this turn + * @param _aceRequest - The Ace invoke request value payload * @returns A task module response for the request */ - protected async OnSharePointTaskGetPropertyPaneConfigurationAsync(context: TurnContext, aceRequest: AceRequest): Promise{ + protected async OnSharePointTaskGetPropertyPaneConfigurationAsync( + _context: TurnContext, + _aceRequest: AceRequest + ): Promise { throw new Error('NotImplemented'); } /** * Override this in a derived class to provide logic for setting configuration pane properties. - * - * @param context - A strongly-typed context object for this turn - * @param taskModuleRequest - The task module invoke request value payload + * + * @param _context - A strongly-typed context object for this turn + * @param _aceRequest - The Ace invoke request value payload * @returns A task module response for the request */ - protected async OnSharePointTaskSetPropertyPaneConfigurationAsync(context: TurnContext, aceRequest: AceRequest): Promise{ + protected async OnSharePointTaskSetPropertyPaneConfigurationAsync( + _context: TurnContext, + _aceRequest: AceRequest + ): Promise { throw new Error('NotImplemented'); - } + } /** * Override this in a derived class to provide logic for setting configuration pane properties. - * - * @param context - A strongly-typed context object for this turn - * @param taskModuleRequest - The task module invoke request value payload + * + * @param _context - A strongly-typed context object for this turn + * @param _aceRequest - The Ace invoke request value payload * @returns A task module response for the request */ - protected async OnSharePointTaskHandleActionAsync(context: TurnContext, aceRequest: AceRequest): Promise{ + protected async OnSharePointTaskHandleActionAsync( + _context: TurnContext, + _aceRequest: AceRequest + ): Promise { throw new Error('NotImplemented'); - } -} \ No newline at end of file + } +} From 7c9085657b71f9c291b13b677ad6f31d9e43a129 Mon Sep 17 00:00:00 2001 From: Alex Terentiev Date: Mon, 30 Oct 2023 09:52:05 -0700 Subject: [PATCH 07/13] address comments --- .../sharepoint/sharePointActivityHandler.ts | 26 ++++++++++++------- .../src/sharepoint/aceData.ts | 6 +++-- .../src/sharepoint/actions/cardAction.ts | 2 +- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/libraries/botbuilder/src/sharepoint/sharePointActivityHandler.ts b/libraries/botbuilder/src/sharepoint/sharePointActivityHandler.ts index e0227276be..fdafeb8617 100644 --- a/libraries/botbuilder/src/sharepoint/sharePointActivityHandler.ts +++ b/libraries/botbuilder/src/sharepoint/sharePointActivityHandler.ts @@ -39,17 +39,23 @@ export class SharePointActivityHandler extends ActivityHandler { switch (context.activity.name) { case 'cardExtension/getCardView': return ActivityHandler.createInvokeResponse( - await this.OnSharePointTaskGetCardViewAsync(context, context.activity.value as AceRequest) + await this.onSharePointTaskGetCardViewAsync( + context, + context.activity.value as AceRequest + ) ); case 'cardExtension/getQuickView': return ActivityHandler.createInvokeResponse( - await this.OnSharePointTaskGetQuickViewAsync(context, context.activity.value as AceRequest) + await this.onSharePointTaskGetQuickViewAsync( + context, + context.activity.value as AceRequest + ) ); case 'cardExtension/getPropertyPaneConfiguration': return ActivityHandler.createInvokeResponse( - await this.OnSharePointTaskGetPropertyPaneConfigurationAsync( + await this.onSharePointTaskGetPropertyPaneConfigurationAsync( context, context.activity.value as AceRequest ) @@ -57,14 +63,14 @@ export class SharePointActivityHandler extends ActivityHandler { case 'cardExtension/setPropertyPaneConfiguration': return ActivityHandler.createInvokeResponse( - await this.OnSharePointTaskSetPropertyPaneConfigurationAsync( + await this.onSharePointTaskSetPropertyPaneConfigurationAsync( context, context.activity.value as AceRequest ) ); case 'cardExtension/handleAction': return ActivityHandler.createInvokeResponse( - await this.OnSharePointTaskHandleActionAsync(context, context.activity.value as AceRequest) + await this.onSharePointTaskHandleActionAsync(context, context.activity.value as AceRequest) ); default: return super.onInvokeActivity(context); @@ -87,7 +93,7 @@ export class SharePointActivityHandler extends ActivityHandler { * @param _aceRequest - The Ace invoke request value payload * @returns A task module response for the request */ - protected async OnSharePointTaskGetCardViewAsync( + protected async onSharePointTaskGetCardViewAsync( _context: TurnContext, _aceRequest: AceRequest ): Promise { @@ -101,7 +107,7 @@ export class SharePointActivityHandler extends ActivityHandler { * @param _aceRequest - The Ace invoke request value payload * @returns A task module response for the request */ - protected async OnSharePointTaskGetQuickViewAsync( + protected async onSharePointTaskGetQuickViewAsync( _context: TurnContext, _aceRequest: AceRequest ): Promise { @@ -115,7 +121,7 @@ export class SharePointActivityHandler extends ActivityHandler { * @param _aceRequest - The Ace invoke request value payload * @returns A task module response for the request */ - protected async OnSharePointTaskGetPropertyPaneConfigurationAsync( + protected async onSharePointTaskGetPropertyPaneConfigurationAsync( _context: TurnContext, _aceRequest: AceRequest ): Promise { @@ -129,7 +135,7 @@ export class SharePointActivityHandler extends ActivityHandler { * @param _aceRequest - The Ace invoke request value payload * @returns A task module response for the request */ - protected async OnSharePointTaskSetPropertyPaneConfigurationAsync( + protected async onSharePointTaskSetPropertyPaneConfigurationAsync( _context: TurnContext, _aceRequest: AceRequest ): Promise { @@ -143,7 +149,7 @@ export class SharePointActivityHandler extends ActivityHandler { * @param _aceRequest - The Ace invoke request value payload * @returns A task module response for the request */ - protected async OnSharePointTaskHandleActionAsync( + protected async onSharePointTaskHandleActionAsync( _context: TurnContext, _aceRequest: AceRequest ): Promise { diff --git a/libraries/botframework-schema/src/sharepoint/aceData.ts b/libraries/botframework-schema/src/sharepoint/aceData.ts index c793e6b92d..6f9479fe3b 100644 --- a/libraries/botframework-schema/src/sharepoint/aceData.ts +++ b/libraries/botframework-schema/src/sharepoint/aceData.ts @@ -10,11 +10,13 @@ export interface AceData { */ cardSize: AceCardSize; /** - * The version of the ACE data schema. + * The value of this property is stored in the serialized data of the Adaptive Card Extension. + * It can be used to manage versioning of the Adaptive Card Extension. + * @remarks - although there is no restriction on the format of this property, it is recommended to use semantic versioning.s */ dataVersion: string; /** - * The id of the ACE. + * The unique id (Guid) of the ACE. */ id: string; /** diff --git a/libraries/botframework-schema/src/sharepoint/actions/cardAction.ts b/libraries/botframework-schema/src/sharepoint/actions/cardAction.ts index 30c4e838d7..9b3bd96606 100644 --- a/libraries/botframework-schema/src/sharepoint/actions/cardAction.ts +++ b/libraries/botframework-schema/src/sharepoint/actions/cardAction.ts @@ -28,7 +28,7 @@ export interface Location { */ longitude: number; /** - * Timestamp + * Timestamp in ISO milliseconds since epoch. */ timestamp?: number; /** From a9a84e1d7a018b70e497bf0321919472c8f5288f Mon Sep 17 00:00:00 2001 From: Alex Terentiev Date: Mon, 30 Oct 2023 09:59:40 -0700 Subject: [PATCH 08/13] formatting --- .../src/sharepoint/sharePointActivityHandler.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/libraries/botbuilder/src/sharepoint/sharePointActivityHandler.ts b/libraries/botbuilder/src/sharepoint/sharePointActivityHandler.ts index fdafeb8617..47e1208d57 100644 --- a/libraries/botbuilder/src/sharepoint/sharePointActivityHandler.ts +++ b/libraries/botbuilder/src/sharepoint/sharePointActivityHandler.ts @@ -39,18 +39,12 @@ export class SharePointActivityHandler extends ActivityHandler { switch (context.activity.name) { case 'cardExtension/getCardView': return ActivityHandler.createInvokeResponse( - await this.onSharePointTaskGetCardViewAsync( - context, - context.activity.value as AceRequest - ) + await this.onSharePointTaskGetCardViewAsync(context, context.activity.value as AceRequest) ); case 'cardExtension/getQuickView': return ActivityHandler.createInvokeResponse( - await this.onSharePointTaskGetQuickViewAsync( - context, - context.activity.value as AceRequest - ) + await this.onSharePointTaskGetQuickViewAsync(context, context.activity.value as AceRequest) ); case 'cardExtension/getPropertyPaneConfiguration': From 4b786d38db3cc0e2bb162ae9e93cca50a16d8fa7 Mon Sep 17 00:00:00 2001 From: Alex Terentiev Date: Mon, 30 Oct 2023 10:02:33 -0700 Subject: [PATCH 09/13] incorrect comment --- libraries/botframework-schema/src/sharepoint/aceData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/botframework-schema/src/sharepoint/aceData.ts b/libraries/botframework-schema/src/sharepoint/aceData.ts index 6f9479fe3b..cd0f96e92f 100644 --- a/libraries/botframework-schema/src/sharepoint/aceData.ts +++ b/libraries/botframework-schema/src/sharepoint/aceData.ts @@ -12,7 +12,7 @@ export interface AceData { /** * The value of this property is stored in the serialized data of the Adaptive Card Extension. * It can be used to manage versioning of the Adaptive Card Extension. - * @remarks - although there is no restriction on the format of this property, it is recommended to use semantic versioning.s + * @remarks - although there is no restriction on the format of this property, it is recommended to use semantic versioning. */ dataVersion: string; /** From d7ca18c73aac7ee3247ffb03c4670ccc535b9e8b Mon Sep 17 00:00:00 2001 From: Alex Terentiev Date: Mon, 30 Oct 2023 10:12:47 -0700 Subject: [PATCH 10/13] more lint fixes --- libraries/botframework-schema/src/sharepoint/aceData.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/botframework-schema/src/sharepoint/aceData.ts b/libraries/botframework-schema/src/sharepoint/aceData.ts index cd0f96e92f..ec56b9c34d 100644 --- a/libraries/botframework-schema/src/sharepoint/aceData.ts +++ b/libraries/botframework-schema/src/sharepoint/aceData.ts @@ -10,8 +10,9 @@ export interface AceData { */ cardSize: AceCardSize; /** - * The value of this property is stored in the serialized data of the Adaptive Card Extension. + * The value of this property is stored in the serialized data of the Adaptive Card Extension. * It can be used to manage versioning of the Adaptive Card Extension. + * * @remarks - although there is no restriction on the format of this property, it is recommended to use semantic versioning. */ dataVersion: string; From 54f7b71553eaf8068776146243b45c428a3b8eb1 Mon Sep 17 00:00:00 2001 From: Alex Terentiev Date: Tue, 31 Oct 2023 14:14:32 -0700 Subject: [PATCH 11/13] updated comments --- .../src/sharepoint/sharePointActivityHandler.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/botbuilder/src/sharepoint/sharePointActivityHandler.ts b/libraries/botbuilder/src/sharepoint/sharePointActivityHandler.ts index 47e1208d57..0a017f68b7 100644 --- a/libraries/botbuilder/src/sharepoint/sharePointActivityHandler.ts +++ b/libraries/botbuilder/src/sharepoint/sharePointActivityHandler.ts @@ -85,7 +85,7 @@ export class SharePointActivityHandler extends ActivityHandler { * * @param _context - A strongly-typed context object for this turn * @param _aceRequest - The Ace invoke request value payload - * @returns A task module response for the request + * @returns A Card View Response for the request */ protected async onSharePointTaskGetCardViewAsync( _context: TurnContext, @@ -99,7 +99,7 @@ export class SharePointActivityHandler extends ActivityHandler { * * @param _context - A strongly-typed context object for this turn * @param _aceRequest - The Ace invoke request value payload - * @returns A task module response for the request + * @returns A Quick View Response for the request */ protected async onSharePointTaskGetQuickViewAsync( _context: TurnContext, @@ -113,7 +113,7 @@ export class SharePointActivityHandler extends ActivityHandler { * * @param _context - A strongly-typed context object for this turn * @param _aceRequest - The Ace invoke request value payload - * @returns A task module response for the request + * @returns A Property Pane Configuration Response for the request */ protected async onSharePointTaskGetPropertyPaneConfigurationAsync( _context: TurnContext, @@ -127,7 +127,7 @@ export class SharePointActivityHandler extends ActivityHandler { * * @param _context - A strongly-typed context object for this turn * @param _aceRequest - The Ace invoke request value payload - * @returns A task module response for the request + * @returns A Card view or no-op action response */ protected async onSharePointTaskSetPropertyPaneConfigurationAsync( _context: TurnContext, @@ -141,7 +141,7 @@ export class SharePointActivityHandler extends ActivityHandler { * * @param _context - A strongly-typed context object for this turn * @param _aceRequest - The Ace invoke request value payload - * @returns A task module response for the request + * @returns A handle action response */ protected async onSharePointTaskHandleActionAsync( _context: TurnContext, From a8ef78de9fc2a86355c5869da6470b87bc50faed Mon Sep 17 00:00:00 2001 From: Alex Terentiev Date: Tue, 31 Oct 2023 15:19:20 -0700 Subject: [PATCH 12/13] export SP activity handler --- libraries/botbuilder/src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/botbuilder/src/index.ts b/libraries/botbuilder/src/index.ts index edfa3d8ffb..072b3edc80 100644 --- a/libraries/botbuilder/src/index.ts +++ b/libraries/botbuilder/src/index.ts @@ -29,3 +29,4 @@ export { HandoffEventNames } from './handoffEventNames'; export { Request, Response, WebRequest, WebResponse } from './interfaces'; export { StatusCodeError } from './statusCodeError'; export { StreamingHttpClient, TokenResolver } from './streaming'; +export { SharePointActivityHandler } from './sharepoint/sharePointActivityHandler'; From de3cbd9646f4008c6f7091dcfe6ede10121bc75e Mon Sep 17 00:00:00 2001 From: Alex Terentiev Date: Tue, 31 Oct 2023 15:41:22 -0700 Subject: [PATCH 13/13] update public API md --- libraries/botbuilder/etc/botbuilder.api.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libraries/botbuilder/etc/botbuilder.api.md b/libraries/botbuilder/etc/botbuilder.api.md index 103f2f78b2..8a20feada0 100644 --- a/libraries/botbuilder/etc/botbuilder.api.md +++ b/libraries/botbuilder/etc/botbuilder.api.md @@ -4,6 +4,7 @@ ```ts +import { AceRequest } from 'botbuilder-core'; import { Activity } from 'botbuilder-core'; import { ActivityHandler } from 'botbuilder-core'; import { ActivityHandlerBase } from 'botbuilder-core'; @@ -22,6 +23,7 @@ import { BotFrameworkClient } from 'botbuilder-core'; import { BotFrameworkSkill } from 'botbuilder-core'; import { BotState } from 'botbuilder-core'; import { CancelOperationResponse } from 'botframework-connector'; +import { CardViewResponse } from 'botbuilder-core'; import { ChannelAccount } from 'botbuilder-core'; import { ChannelInfo } from 'botbuilder-core'; import { ClaimsIdentity } from 'botframework-connector'; @@ -39,6 +41,8 @@ import { ConversationState } from 'botbuilder-core'; import { CoreAppCredentials } from 'botbuilder-core'; import { ExtendedUserTokenProvider } from 'botbuilder-core'; import { FileConsentCardResponse } from 'botbuilder-core'; +import { GetPropertyPaneConfigurationResponse } from 'botbuilder-core'; +import { HandleActionResponse } from 'botbuilder-core'; import { HttpClient } from '@azure/ms-rest-js'; import { HttpOperationResponse } from '@azure/ms-rest-js'; import { ICredentialProvider } from 'botframework-connector'; @@ -63,9 +67,11 @@ import { O365ConnectorCardActionQuery } from 'botbuilder-core'; import { OnBehalfOf } from 'botbuilder-core'; import { PagedMembersResult } from 'botbuilder-core'; import { PagedResult } from 'botbuilder-core'; +import { QuickViewResponse } from 'botbuilder-core'; import { ReadReceiptInfo } from 'botframework-connector'; import { RequestHandler } from 'botframework-streaming'; import { ResourceResponse } from 'botbuilder-core'; +import { SetPropertyPaneConfigurationResponse } from 'botbuilder-core'; import { SigninStateVerificationQuery } from 'botbuilder-core'; import { SignInUrlResponse } from 'botframework-connector'; import { SimpleCredentialProvider } from 'botframework-connector'; @@ -338,6 +344,16 @@ export class SetSpeakMiddleware implements Middleware { onTurn(turnContext: TurnContext, next: () => Promise): Promise; } +// @public +export class SharePointActivityHandler extends ActivityHandler { + protected onInvokeActivity(context: TurnContext): Promise; + protected onSharePointTaskGetCardViewAsync(_context: TurnContext, _aceRequest: AceRequest): Promise; + protected onSharePointTaskGetPropertyPaneConfigurationAsync(_context: TurnContext, _aceRequest: AceRequest): Promise; + protected onSharePointTaskGetQuickViewAsync(_context: TurnContext, _aceRequest: AceRequest): Promise; + protected onSharePointTaskHandleActionAsync(_context: TurnContext, _aceRequest: AceRequest): Promise; + protected onSharePointTaskSetPropertyPaneConfigurationAsync(_context: TurnContext, _aceRequest: AceRequest): Promise; +} + // @public @deprecated (undocumented) export class SkillHandler extends ChannelServiceHandler { constructor(adapter: BotAdapter, bot: ActivityHandlerBase, conversationIdFactory: SkillConversationIdFactoryBase, credentialProvider: ICredentialProvider, authConfig: AuthenticationConfiguration, channelService?: string);