@microsoft/teams-js 2.0.0-beta.4-dev.14 → 2.0.0-beta.4-dev.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MicrosoftTeams.d.ts +66 -10
- package/dist/MicrosoftTeams.js +192 -132
- package/dist/MicrosoftTeams.js.map +1 -1
- package/dist/MicrosoftTeams.min.js +1 -1
- package/dist/MicrosoftTeams.min.js.map +1 -1
- package/package.json +1 -1
package/dist/MicrosoftTeams.d.ts
CHANGED
|
@@ -2109,6 +2109,39 @@ export interface DeepLinkParameters {
|
|
|
2109
2109
|
*/
|
|
2110
2110
|
subEntityWebUrl?: string;
|
|
2111
2111
|
}
|
|
2112
|
+
export interface DialogSize {
|
|
2113
|
+
/**
|
|
2114
|
+
* The requested height of the webview/iframe.
|
|
2115
|
+
*/
|
|
2116
|
+
height: DialogDimension | number;
|
|
2117
|
+
/**
|
|
2118
|
+
* The requested width of the webview/iframe.
|
|
2119
|
+
*/
|
|
2120
|
+
width: DialogDimension | number;
|
|
2121
|
+
}
|
|
2122
|
+
export interface UrlDialogInfo {
|
|
2123
|
+
/**
|
|
2124
|
+
* The url to be rendered in the webview/iframe.
|
|
2125
|
+
*/
|
|
2126
|
+
url: string;
|
|
2127
|
+
size: DialogSize;
|
|
2128
|
+
/**
|
|
2129
|
+
* Title of the task module.
|
|
2130
|
+
*/
|
|
2131
|
+
title?: string;
|
|
2132
|
+
/**
|
|
2133
|
+
* If client doesnt support the URL, the URL that needs to be opened in the browser.
|
|
2134
|
+
*/
|
|
2135
|
+
fallbackUrl?: string;
|
|
2136
|
+
}
|
|
2137
|
+
export interface BotUrlDialogInfo extends UrlDialogInfo {
|
|
2138
|
+
/**
|
|
2139
|
+
* Specifies a bot ID to send the result of the user's interaction with the task module.
|
|
2140
|
+
* The bot will receive a task/complete invoke event with a JSON object
|
|
2141
|
+
* in the event payload.
|
|
2142
|
+
*/
|
|
2143
|
+
completionBotId: string;
|
|
2144
|
+
}
|
|
2112
2145
|
export interface DialogInfo {
|
|
2113
2146
|
/**
|
|
2114
2147
|
* The url to be rendered in the webview/iframe.
|
|
@@ -2146,6 +2179,10 @@ export interface DialogInfo {
|
|
|
2146
2179
|
* As of 2.0.0-beta.1, please use {@link DialogInfo} instead.
|
|
2147
2180
|
*/
|
|
2148
2181
|
export type TaskInfo = DialogInfo;
|
|
2182
|
+
export interface DialogSize {
|
|
2183
|
+
height: DialogDimension | number;
|
|
2184
|
+
width: DialogDimension | number;
|
|
2185
|
+
}
|
|
2149
2186
|
/**
|
|
2150
2187
|
* @hidden
|
|
2151
2188
|
* Hide from docs.
|
|
@@ -2749,20 +2786,23 @@ export namespace appInstallDialog {
|
|
|
2749
2786
|
*
|
|
2750
2787
|
* @beta
|
|
2751
2788
|
*/
|
|
2789
|
+
export interface SdkResponse {
|
|
2790
|
+
err: string;
|
|
2791
|
+
result: string | object;
|
|
2792
|
+
}
|
|
2752
2793
|
export namespace dialog {
|
|
2794
|
+
type PostMessageChannel = (message: any, onComplete?: (status: boolean, reason?: string) => void) => void;
|
|
2795
|
+
type DialogSubmitHandler = (result: SdkResponse) => void;
|
|
2753
2796
|
/**
|
|
2754
2797
|
* Allows an app to open the dialog module.
|
|
2755
2798
|
*
|
|
2756
|
-
* @param
|
|
2757
|
-
* @param submitHandler - Handler
|
|
2758
|
-
|
|
2759
|
-
function open(dialogInfo: DialogInfo, submitHandler?: (err: string, result: string | object) => void): IAppWindow;
|
|
2760
|
-
/**
|
|
2761
|
-
* Update height/width dialog info properties.
|
|
2799
|
+
* @param urlDialogInfo - An object containing the parameters of the dialog module.
|
|
2800
|
+
* @param submitHandler - This Handler is called when the dialog has been submitted or closed.
|
|
2801
|
+
* @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.
|
|
2762
2802
|
*
|
|
2763
|
-
* @
|
|
2803
|
+
* @returns a function that can be used to send messages to the dialog.
|
|
2764
2804
|
*/
|
|
2765
|
-
function
|
|
2805
|
+
function open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): PostMessageChannel;
|
|
2766
2806
|
/**
|
|
2767
2807
|
* Submit the dialog module.
|
|
2768
2808
|
*
|
|
@@ -2785,6 +2825,19 @@ export namespace dialog {
|
|
|
2785
2825
|
*/
|
|
2786
2826
|
function registerOnMessageFromParent(listener: (message: any) => void): void;
|
|
2787
2827
|
function isSupported(): boolean;
|
|
2828
|
+
namespace update {
|
|
2829
|
+
/**
|
|
2830
|
+
* Update dimensions - height/width of a dialog.
|
|
2831
|
+
*
|
|
2832
|
+
* @param dimensions - An object containing width and height properties.
|
|
2833
|
+
*/
|
|
2834
|
+
function resize(dimensions: DialogSize): void;
|
|
2835
|
+
function isSupported(): boolean;
|
|
2836
|
+
}
|
|
2837
|
+
namespace bot {
|
|
2838
|
+
function open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): PostMessageChannel;
|
|
2839
|
+
function isSupported(): boolean;
|
|
2840
|
+
}
|
|
2788
2841
|
}
|
|
2789
2842
|
|
|
2790
2843
|
/**
|
|
@@ -5048,7 +5101,7 @@ export namespace settings {
|
|
|
5048
5101
|
export namespace tasks {
|
|
5049
5102
|
/**
|
|
5050
5103
|
* @deprecated
|
|
5051
|
-
* As of 2.0.0-beta.
|
|
5104
|
+
* As of 2.0.0-beta.4, please use {@link dialog.open(dialogInfo: DialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): PostMessageChannel} instead.
|
|
5052
5105
|
*
|
|
5053
5106
|
* Allows an app to open the task module.
|
|
5054
5107
|
*
|
|
@@ -5058,7 +5111,7 @@ export namespace tasks {
|
|
|
5058
5111
|
function startTask(taskInfo: TaskInfo, submitHandler?: (err: string, result: string | object) => void): IAppWindow;
|
|
5059
5112
|
/**
|
|
5060
5113
|
* @deprecated
|
|
5061
|
-
* As of 2.0.0-beta.
|
|
5114
|
+
* As of 2.0.0-beta.4, please use {@link dialog.update.resize dialog.update.resize(dimensions: DialogSize): void} instead.
|
|
5062
5115
|
*
|
|
5063
5116
|
* Update height/width task info properties.
|
|
5064
5117
|
*
|
|
@@ -5075,5 +5128,8 @@ export namespace tasks {
|
|
|
5075
5128
|
* @param appIds - Helps to validate that the call originates from the same appId as the one that invoked the task module
|
|
5076
5129
|
*/
|
|
5077
5130
|
function submitTask(result?: string | object, appIds?: string | string[]): void;
|
|
5131
|
+
function getUrlDialogInfoFromTaskInfo(taskInfo: TaskInfo): UrlDialogInfo;
|
|
5132
|
+
function getBotUrlDialogInfoFromTaskInfo(taskInfo: TaskInfo): BotUrlDialogInfo;
|
|
5133
|
+
function getDefaultSizeIfNotProvided(taskInfo: TaskInfo): TaskInfo;
|
|
5078
5134
|
}
|
|
5079
5135
|
|
package/dist/MicrosoftTeams.js
CHANGED
|
@@ -1121,7 +1121,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
1121
1121
|
});
|
|
1122
1122
|
|
|
1123
1123
|
;// CONCATENATED MODULE: ./src/internal/constants.ts
|
|
1124
|
-
var version = "2.0.0-beta.4-dev.
|
|
1124
|
+
var version = "2.0.0-beta.4-dev.17";
|
|
1125
1125
|
/**
|
|
1126
1126
|
* @hidden
|
|
1127
1127
|
* The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
|
|
@@ -1820,7 +1820,10 @@ var runtime = {
|
|
|
1820
1820
|
calendar: undefined,
|
|
1821
1821
|
call: undefined,
|
|
1822
1822
|
chat: undefined,
|
|
1823
|
-
dialog:
|
|
1823
|
+
dialog: {
|
|
1824
|
+
bot: undefined,
|
|
1825
|
+
update: undefined,
|
|
1826
|
+
},
|
|
1824
1827
|
location: undefined,
|
|
1825
1828
|
logs: undefined,
|
|
1826
1829
|
mail: undefined,
|
|
@@ -1856,7 +1859,10 @@ var teamsRuntimeConfig = {
|
|
|
1856
1859
|
bot: {},
|
|
1857
1860
|
call: {},
|
|
1858
1861
|
chat: {},
|
|
1859
|
-
dialog: {
|
|
1862
|
+
dialog: {
|
|
1863
|
+
bot: {},
|
|
1864
|
+
update: {},
|
|
1865
|
+
},
|
|
1860
1866
|
files: {},
|
|
1861
1867
|
location: {},
|
|
1862
1868
|
logs: {},
|
|
@@ -4247,6 +4253,124 @@ var appInstallDialog;
|
|
|
4247
4253
|
appInstallDialog.isSupported = isSupported;
|
|
4248
4254
|
})(appInstallDialog || (appInstallDialog = {}));
|
|
4249
4255
|
|
|
4256
|
+
;// CONCATENATED MODULE: ./src/public/dialog.ts
|
|
4257
|
+
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
4258
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
|
4259
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
4260
|
+
|
|
4261
|
+
|
|
4262
|
+
|
|
4263
|
+
|
|
4264
|
+
|
|
4265
|
+
|
|
4266
|
+
var dialog;
|
|
4267
|
+
(function (dialog) {
|
|
4268
|
+
/**
|
|
4269
|
+
* Allows an app to open the dialog module.
|
|
4270
|
+
*
|
|
4271
|
+
* @param urlDialogInfo - An object containing the parameters of the dialog module.
|
|
4272
|
+
* @param submitHandler - This Handler is called when the dialog has been submitted or closed.
|
|
4273
|
+
* @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.
|
|
4274
|
+
*
|
|
4275
|
+
* @returns a function that can be used to send messages to the dialog.
|
|
4276
|
+
*/
|
|
4277
|
+
function open(urlDialogInfo, submitHandler, messageFromChildHandler) {
|
|
4278
|
+
ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
|
4279
|
+
if (messageFromChildHandler) {
|
|
4280
|
+
registerHandler('messageForParent', messageFromChildHandler);
|
|
4281
|
+
}
|
|
4282
|
+
sendMessageToParent('tasks.startTask', [urlDialogInfo], function (err, result) {
|
|
4283
|
+
submitHandler({ err: err, result: result });
|
|
4284
|
+
});
|
|
4285
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4286
|
+
var sendMessageToDialog = function (message, onComplete) {
|
|
4287
|
+
sendMessageToParent('messageForChild', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
|
|
4288
|
+
};
|
|
4289
|
+
return sendMessageToDialog;
|
|
4290
|
+
}
|
|
4291
|
+
dialog.open = open;
|
|
4292
|
+
/**
|
|
4293
|
+
* Submit the dialog module.
|
|
4294
|
+
*
|
|
4295
|
+
* @param result - Contains the result to be sent to the bot or the app. Typically a JSON object or a serialized version of it
|
|
4296
|
+
* @param appIds - Helps to validate that the call originates from the same appId as the one that invoked the task module
|
|
4297
|
+
*/
|
|
4298
|
+
function submit(result, appIds) {
|
|
4299
|
+
ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);
|
|
4300
|
+
// Send tasks.completeTask instead of tasks.submitTask message for backward compatibility with Mobile clients
|
|
4301
|
+
sendMessageToParent('tasks.completeTask', [result, Array.isArray(appIds) ? appIds : [appIds]]);
|
|
4302
|
+
}
|
|
4303
|
+
dialog.submit = submit;
|
|
4304
|
+
/**
|
|
4305
|
+
* Send message to the parent from dialog
|
|
4306
|
+
*
|
|
4307
|
+
* @param message - The message to send
|
|
4308
|
+
* @param onComplete - The callback to know if the message to parent has been success/failed.
|
|
4309
|
+
*/
|
|
4310
|
+
function sendMessageToParentFromDialog(
|
|
4311
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4312
|
+
message, onComplete) {
|
|
4313
|
+
ensureInitialized(FrameContexts.task);
|
|
4314
|
+
sendMessageToParent('messageForParent', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
|
|
4315
|
+
}
|
|
4316
|
+
dialog.sendMessageToParentFromDialog = sendMessageToParentFromDialog;
|
|
4317
|
+
/**
|
|
4318
|
+
* Fucntion to call when an event is received from the Parent
|
|
4319
|
+
*
|
|
4320
|
+
* @param type - The event to listen to. Currently the only supported type is 'message'.
|
|
4321
|
+
* @param listener - listener - The listener that will be called.
|
|
4322
|
+
*/
|
|
4323
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4324
|
+
function registerOnMessageFromParent(listener) {
|
|
4325
|
+
ensureInitialized();
|
|
4326
|
+
registerHandler('messageForChild', listener);
|
|
4327
|
+
}
|
|
4328
|
+
dialog.registerOnMessageFromParent = registerOnMessageFromParent;
|
|
4329
|
+
function isSupported() {
|
|
4330
|
+
return runtime.supports.dialog ? true : false;
|
|
4331
|
+
}
|
|
4332
|
+
dialog.isSupported = isSupported;
|
|
4333
|
+
var update;
|
|
4334
|
+
(function (update) {
|
|
4335
|
+
/**
|
|
4336
|
+
* Update dimensions - height/width of a dialog.
|
|
4337
|
+
*
|
|
4338
|
+
* @param dimensions - An object containing width and height properties.
|
|
4339
|
+
*/
|
|
4340
|
+
function resize(dimensions) {
|
|
4341
|
+
ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);
|
|
4342
|
+
sendMessageToParent('tasks.updateTask', [dimensions]);
|
|
4343
|
+
}
|
|
4344
|
+
update.resize = resize;
|
|
4345
|
+
function isSupported() {
|
|
4346
|
+
return runtime.supports.dialog ? (runtime.supports.dialog.update ? true : false) : false;
|
|
4347
|
+
}
|
|
4348
|
+
update.isSupported = isSupported;
|
|
4349
|
+
})(update = dialog.update || (dialog.update = {}));
|
|
4350
|
+
var bot;
|
|
4351
|
+
(function (bot) {
|
|
4352
|
+
function open(botUrlDialogInfo, submitHandler, messageFromChildHandler) {
|
|
4353
|
+
ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
|
4354
|
+
if (messageFromChildHandler) {
|
|
4355
|
+
registerHandler('messageForParent', messageFromChildHandler);
|
|
4356
|
+
}
|
|
4357
|
+
sendMessageToParent('tasks.startTask', [botUrlDialogInfo], function (err, result) {
|
|
4358
|
+
submitHandler({ err: err, result: result });
|
|
4359
|
+
});
|
|
4360
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4361
|
+
var sendMessageToDialog = function (message, onComplete) {
|
|
4362
|
+
sendMessageToParent('messageForChild', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
|
|
4363
|
+
};
|
|
4364
|
+
return sendMessageToDialog;
|
|
4365
|
+
}
|
|
4366
|
+
bot.open = open;
|
|
4367
|
+
function isSupported() {
|
|
4368
|
+
return runtime.supports.dialog ? (runtime.supports.dialog.bot ? true : false) : false;
|
|
4369
|
+
}
|
|
4370
|
+
bot.isSupported = isSupported;
|
|
4371
|
+
})(bot = dialog.bot || (dialog.bot = {}));
|
|
4372
|
+
})(dialog || (dialog = {}));
|
|
4373
|
+
|
|
4250
4374
|
;// CONCATENATED MODULE: ./src/public/appWindow.ts
|
|
4251
4375
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
4252
4376
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -4319,109 +4443,6 @@ var ParentAppWindow = /** @class */ (function () {
|
|
|
4319
4443
|
}());
|
|
4320
4444
|
|
|
4321
4445
|
|
|
4322
|
-
;// CONCATENATED MODULE: ./src/public/dialog.ts
|
|
4323
|
-
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
4324
|
-
/* eslint-disable @typescript-eslint/ban-types */
|
|
4325
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
4326
|
-
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
4327
|
-
var t = {};
|
|
4328
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4329
|
-
t[p] = s[p];
|
|
4330
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
4331
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
4332
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
4333
|
-
t[p[i]] = s[p[i]];
|
|
4334
|
-
}
|
|
4335
|
-
return t;
|
|
4336
|
-
};
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
/**
|
|
4345
|
-
* Namespace to interact with the dialog module-specific part of the SDK.
|
|
4346
|
-
*
|
|
4347
|
-
* @remarks
|
|
4348
|
-
* This object is usable only on the content frame.
|
|
4349
|
-
*
|
|
4350
|
-
* @beta
|
|
4351
|
-
*/
|
|
4352
|
-
var dialog;
|
|
4353
|
-
(function (dialog) {
|
|
4354
|
-
/**
|
|
4355
|
-
* Allows an app to open the dialog module.
|
|
4356
|
-
*
|
|
4357
|
-
* @param dialogInfo - An object containing the parameters of the dialog module
|
|
4358
|
-
* @param submitHandler - Handler to call when the task module is completed
|
|
4359
|
-
*/
|
|
4360
|
-
function open(dialogInfo, submitHandler) {
|
|
4361
|
-
ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
|
4362
|
-
sendMessageToParent('tasks.startTask', [dialogInfo], submitHandler);
|
|
4363
|
-
return new ChildAppWindow();
|
|
4364
|
-
}
|
|
4365
|
-
dialog.open = open;
|
|
4366
|
-
/**
|
|
4367
|
-
* Update height/width dialog info properties.
|
|
4368
|
-
*
|
|
4369
|
-
* @param dialogInfo - An object containing width and height properties
|
|
4370
|
-
*/
|
|
4371
|
-
function resize(dialogInfo) {
|
|
4372
|
-
ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);
|
|
4373
|
-
var width = dialogInfo.width, height = dialogInfo.height, extra = __rest(dialogInfo, ["width", "height"]);
|
|
4374
|
-
if (!Object.keys(extra).length) {
|
|
4375
|
-
sendMessageToParent('tasks.updateTask', [dialogInfo]);
|
|
4376
|
-
}
|
|
4377
|
-
else {
|
|
4378
|
-
throw new Error('resize requires a dialogInfo argument containing only width and height');
|
|
4379
|
-
}
|
|
4380
|
-
}
|
|
4381
|
-
dialog.resize = resize;
|
|
4382
|
-
/**
|
|
4383
|
-
* Submit the dialog module.
|
|
4384
|
-
*
|
|
4385
|
-
* @param result - Contains the result to be sent to the bot or the app. Typically a JSON object or a serialized version of it
|
|
4386
|
-
* @param appIds - Helps to validate that the call originates from the same appId as the one that invoked the task module
|
|
4387
|
-
*/
|
|
4388
|
-
function submit(result, appIds) {
|
|
4389
|
-
ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);
|
|
4390
|
-
// Send tasks.completeTask instead of tasks.submitTask message for backward compatibility with Mobile clients
|
|
4391
|
-
sendMessageToParent('tasks.completeTask', [result, Array.isArray(appIds) ? appIds : [appIds]]);
|
|
4392
|
-
}
|
|
4393
|
-
dialog.submit = submit;
|
|
4394
|
-
/**
|
|
4395
|
-
* Send message to the parent from dialog
|
|
4396
|
-
*
|
|
4397
|
-
* @param message - The message to send
|
|
4398
|
-
* @param onComplete - The callback to know if the message to parent has been success/failed.
|
|
4399
|
-
*/
|
|
4400
|
-
function sendMessageToParentFromDialog(
|
|
4401
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4402
|
-
message, onComplete) {
|
|
4403
|
-
ensureInitialized(FrameContexts.task);
|
|
4404
|
-
sendMessageToParent('messageForParent', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
|
|
4405
|
-
}
|
|
4406
|
-
dialog.sendMessageToParentFromDialog = sendMessageToParentFromDialog;
|
|
4407
|
-
/**
|
|
4408
|
-
* Fucntion to call when an event is received from the Parent
|
|
4409
|
-
*
|
|
4410
|
-
* @param type - The event to listen to. Currently the only supported type is 'message'.
|
|
4411
|
-
* @param listener - listener - The listener that will be called.
|
|
4412
|
-
*/
|
|
4413
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4414
|
-
function registerOnMessageFromParent(listener) {
|
|
4415
|
-
ensureInitialized();
|
|
4416
|
-
registerHandler('messageForChild', listener);
|
|
4417
|
-
}
|
|
4418
|
-
dialog.registerOnMessageFromParent = registerOnMessageFromParent;
|
|
4419
|
-
function isSupported() {
|
|
4420
|
-
return runtime.supports.dialog ? true : false;
|
|
4421
|
-
}
|
|
4422
|
-
dialog.isSupported = isSupported;
|
|
4423
|
-
})(dialog || (dialog = {}));
|
|
4424
|
-
|
|
4425
4446
|
;// CONCATENATED MODULE: ./src/internal/mediaUtil.ts
|
|
4426
4447
|
|
|
4427
4448
|
|
|
@@ -6322,6 +6343,20 @@ var settings;
|
|
|
6322
6343
|
|
|
6323
6344
|
;// CONCATENATED MODULE: ./src/public/tasks.ts
|
|
6324
6345
|
/* eslint-disable @typescript-eslint/ban-types */
|
|
6346
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
6347
|
+
var t = {};
|
|
6348
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
6349
|
+
t[p] = s[p];
|
|
6350
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6351
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
6352
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
6353
|
+
t[p[i]] = s[p[i]];
|
|
6354
|
+
}
|
|
6355
|
+
return t;
|
|
6356
|
+
};
|
|
6357
|
+
|
|
6358
|
+
|
|
6359
|
+
|
|
6325
6360
|
|
|
6326
6361
|
|
|
6327
6362
|
/**
|
|
@@ -6336,7 +6371,7 @@ var tasks;
|
|
|
6336
6371
|
(function (tasks) {
|
|
6337
6372
|
/**
|
|
6338
6373
|
* @deprecated
|
|
6339
|
-
* As of 2.0.0-beta.
|
|
6374
|
+
* As of 2.0.0-beta.4, please use {@link dialog.open(dialogInfo: DialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): PostMessageChannel} instead.
|
|
6340
6375
|
*
|
|
6341
6376
|
* Allows an app to open the task module.
|
|
6342
6377
|
*
|
|
@@ -6344,19 +6379,40 @@ var tasks;
|
|
|
6344
6379
|
* @param submitHandler - Handler to call when the task module is completed
|
|
6345
6380
|
*/
|
|
6346
6381
|
function startTask(taskInfo, submitHandler) {
|
|
6347
|
-
|
|
6382
|
+
taskInfo = getDefaultSizeIfNotProvided(taskInfo);
|
|
6383
|
+
if (taskInfo.card !== undefined || taskInfo.url === undefined) {
|
|
6384
|
+
ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
|
6385
|
+
sendMessageToParent('tasks.startTask', [taskInfo], submitHandler);
|
|
6386
|
+
}
|
|
6387
|
+
else if (taskInfo.completionBotId !== undefined) {
|
|
6388
|
+
dialog.bot.open(getBotUrlDialogInfoFromTaskInfo(taskInfo), function (sdkResponse) {
|
|
6389
|
+
return submitHandler(sdkResponse.err, sdkResponse.result);
|
|
6390
|
+
});
|
|
6391
|
+
}
|
|
6392
|
+
else {
|
|
6393
|
+
dialog.open(getUrlDialogInfoFromTaskInfo(taskInfo), function (sdkResponse) {
|
|
6394
|
+
return submitHandler(sdkResponse.err, sdkResponse.result);
|
|
6395
|
+
});
|
|
6396
|
+
}
|
|
6397
|
+
return new ChildAppWindow();
|
|
6348
6398
|
}
|
|
6349
6399
|
tasks.startTask = startTask;
|
|
6350
6400
|
/**
|
|
6351
6401
|
* @deprecated
|
|
6352
|
-
* As of 2.0.0-beta.
|
|
6402
|
+
* As of 2.0.0-beta.4, please use {@link dialog.update.resize dialog.update.resize(dimensions: DialogSize): void} instead.
|
|
6353
6403
|
*
|
|
6354
6404
|
* Update height/width task info properties.
|
|
6355
6405
|
*
|
|
6356
6406
|
* @param taskInfo - An object containing width and height properties
|
|
6357
6407
|
*/
|
|
6358
6408
|
function updateTask(taskInfo) {
|
|
6359
|
-
|
|
6409
|
+
taskInfo = getDefaultSizeIfNotProvided(taskInfo);
|
|
6410
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6411
|
+
var width = taskInfo.width, height = taskInfo.height, extra = __rest(taskInfo, ["width", "height"]);
|
|
6412
|
+
if (Object.keys(extra).length) {
|
|
6413
|
+
throw new Error('resize requires a TaskInfo argument containing only width and height');
|
|
6414
|
+
}
|
|
6415
|
+
dialog.update.resize(taskInfo);
|
|
6360
6416
|
}
|
|
6361
6417
|
tasks.updateTask = updateTask;
|
|
6362
6418
|
/**
|
|
@@ -6372,35 +6428,39 @@ var tasks;
|
|
|
6372
6428
|
dialog.submit(result, appIds);
|
|
6373
6429
|
}
|
|
6374
6430
|
tasks.submitTask = submitTask;
|
|
6375
|
-
function
|
|
6376
|
-
var
|
|
6377
|
-
|
|
6378
|
-
:
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6431
|
+
function getUrlDialogInfoFromTaskInfo(taskInfo) {
|
|
6432
|
+
var urldialogInfo = {
|
|
6433
|
+
url: taskInfo.url,
|
|
6434
|
+
size: {
|
|
6435
|
+
height: taskInfo.height,
|
|
6436
|
+
width: taskInfo.width,
|
|
6437
|
+
},
|
|
6438
|
+
title: taskInfo.title,
|
|
6439
|
+
fallbackUrl: taskInfo.fallbackUrl,
|
|
6440
|
+
};
|
|
6441
|
+
return urldialogInfo;
|
|
6442
|
+
}
|
|
6443
|
+
tasks.getUrlDialogInfoFromTaskInfo = getUrlDialogInfoFromTaskInfo;
|
|
6444
|
+
function getBotUrlDialogInfoFromTaskInfo(taskInfo) {
|
|
6445
|
+
var botUrldialogInfo = {
|
|
6383
6446
|
url: taskInfo.url,
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6447
|
+
size: {
|
|
6448
|
+
height: taskInfo.height,
|
|
6449
|
+
width: taskInfo.width,
|
|
6450
|
+
},
|
|
6387
6451
|
title: taskInfo.title,
|
|
6388
6452
|
fallbackUrl: taskInfo.fallbackUrl,
|
|
6389
6453
|
completionBotId: taskInfo.completionBotId,
|
|
6390
6454
|
};
|
|
6391
|
-
return
|
|
6455
|
+
return botUrldialogInfo;
|
|
6392
6456
|
}
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
return TaskModuleDimension.Medium;
|
|
6399
|
-
}
|
|
6400
|
-
else {
|
|
6401
|
-
return TaskModuleDimension.Small;
|
|
6402
|
-
}
|
|
6457
|
+
tasks.getBotUrlDialogInfoFromTaskInfo = getBotUrlDialogInfoFromTaskInfo;
|
|
6458
|
+
function getDefaultSizeIfNotProvided(taskInfo) {
|
|
6459
|
+
taskInfo.height = taskInfo.height ? taskInfo.height : TaskModuleDimension.Small;
|
|
6460
|
+
taskInfo.width = taskInfo.width ? taskInfo.width : TaskModuleDimension.Small;
|
|
6461
|
+
return taskInfo;
|
|
6403
6462
|
}
|
|
6463
|
+
tasks.getDefaultSizeIfNotProvided = getDefaultSizeIfNotProvided;
|
|
6404
6464
|
})(tasks || (tasks = {}));
|
|
6405
6465
|
|
|
6406
6466
|
;// CONCATENATED MODULE: ./src/public/index.ts
|