@microsoft/teams-js 2.1.0-beta.1 → 2.1.0-beta.4

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.
@@ -1118,11 +1118,12 @@ __webpack_require__.d(__webpack_exports__, {
1118
1118
  "teams": () => (/* reexport */ teams),
1119
1119
  "teamsCore": () => (/* reexport */ teamsCore),
1120
1120
  "uploadCustomApp": () => (/* reexport */ uploadCustomApp),
1121
- "video": () => (/* reexport */ video)
1121
+ "video": () => (/* reexport */ video),
1122
+ "webStorage": () => (/* reexport */ webStorage)
1122
1123
  });
1123
1124
 
1124
1125
  ;// CONCATENATED MODULE: ./src/internal/constants.ts
1125
- var version = "2.1.0-beta.1";
1126
+ var version = "2.1.0-beta.4";
1126
1127
  /**
1127
1128
  * @hidden
1128
1129
  * The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
@@ -2358,6 +2359,7 @@ var runtime = {
2358
2359
  calendar: undefined,
2359
2360
  call: undefined,
2360
2361
  chat: undefined,
2362
+ webStorage: undefined,
2361
2363
  conversations: undefined,
2362
2364
  dialog: {
2363
2365
  bot: undefined,
@@ -2460,6 +2462,12 @@ var versionConstants = {
2460
2462
  ],
2461
2463
  },
2462
2464
  ],
2465
+ '2.0.5': [
2466
+ {
2467
+ capability: { webStorage: {} },
2468
+ hostClientTypes: [HostClientType.android, HostClientType.ios],
2469
+ },
2470
+ ],
2463
2471
  };
2464
2472
  /**
2465
2473
  * @internal
@@ -2581,7 +2589,7 @@ var dialog;
2581
2589
  }
2582
2590
  var dialogInfo = getDialogInfoFromUrlDialogInfo(urlDialogInfo);
2583
2591
  sendMessageToParent('tasks.startTask', [dialogInfo], function (err, result) {
2584
- submitHandler({ err: err, result: result });
2592
+ submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err: err, result: result });
2585
2593
  removeHandler('messageForParent');
2586
2594
  });
2587
2595
  }
@@ -2720,7 +2728,7 @@ var dialog;
2720
2728
  }
2721
2729
  var dialogInfo = getDialogInfoFromBotUrlDialogInfo(botUrlDialogInfo);
2722
2730
  sendMessageToParent('tasks.startTask', [dialogInfo], function (err, result) {
2723
- submitHandler({ err: err, result: result });
2731
+ submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err: err, result: result });
2724
2732
  removeHandler('messageForParent');
2725
2733
  });
2726
2734
  }
@@ -4052,6 +4060,10 @@ function removeHandler(name) {
4052
4060
  delete HandlersPrivate.handlers[name];
4053
4061
  }
4054
4062
  /** @internal */
4063
+ function doesHandlerExist(name) {
4064
+ return HandlersPrivate.handlers[name] != null;
4065
+ }
4066
+ /** @internal */
4055
4067
  function handlers_registerOnThemeChangeHandler(handler) {
4056
4068
  HandlersPrivate.themeChangeHandler = handler;
4057
4069
  handler && sendMessageToParent('registerHandler', ['themeChange']);
@@ -5934,7 +5946,7 @@ var meeting;
5934
5946
  meeting.registerSpeakingStateChangeHandler = registerSpeakingStateChangeHandler;
5935
5947
  /**
5936
5948
  * Registers a handler for changes to the selfParticipant's (current user's) raiseHandState. If the selfParticipant raises their hand, isHandRaised
5937
- * will be true. By default and if the selfParticipant hand is lowered, isHandRaised will be false. This API will return {@link RaiseHandStateChangedEvent}
5949
+ * will be true. By default and if the selfParticipant hand is lowered, isHandRaised will be false. This API will return {@link RaiseHandStateChangedEventData}
5938
5950
  * that will have the raiseHandState or an error object. Only one handler can be registered at a time. A subsequent registration
5939
5951
  * replaces an existing registration.
5940
5952
  *
@@ -6269,18 +6281,21 @@ var profile;
6269
6281
 
6270
6282
  /**
6271
6283
  * Namespace to video extensibility of the SDK
6284
+ * @beta
6272
6285
  */
6273
6286
  var video;
6274
6287
  (function (video) {
6275
6288
  /**
6276
6289
  * Video frame format enum, currently only support NV12
6290
+ * @beta
6277
6291
  */
6278
6292
  var VideoFrameFormat;
6279
6293
  (function (VideoFrameFormat) {
6280
6294
  VideoFrameFormat[VideoFrameFormat["NV12"] = 0] = "NV12";
6281
6295
  })(VideoFrameFormat = video.VideoFrameFormat || (video.VideoFrameFormat = {}));
6282
6296
  /**
6283
- * Video effect change type enum
6297
+ * Video effect change type enum
6298
+ * @beta
6284
6299
  */
6285
6300
  var EffectChangeType;
6286
6301
  (function (EffectChangeType) {
@@ -6295,6 +6310,7 @@ var video;
6295
6310
  })(EffectChangeType = video.EffectChangeType || (video.EffectChangeType = {}));
6296
6311
  /**
6297
6312
  * Register to read the video frames in Permissions section
6313
+ * @beta
6298
6314
  * @param frameCallback - The callback to invoke when registerForVideoFrame has completed
6299
6315
  * @param config - VideoFrameConfig to customize generated video frame parameters
6300
6316
  */
@@ -6312,10 +6328,10 @@ var video;
6312
6328
  }
6313
6329
  video.registerForVideoFrame = registerForVideoFrame;
6314
6330
  /**
6315
- * video extension should call this to notify host client that the current selected effect parameter changed.
6331
+ * Video extension should call this to notify host client that the current selected effect parameter changed.
6316
6332
  * If it's pre-meeting, host client will call videoEffectCallback immediately then use the videoEffect.
6317
6333
  * If it's the in-meeting scenario, we will call videoEffectCallback when apply button clicked.
6318
- *
6334
+ * @beta
6319
6335
  * @param effectChangeType - the effect change type.
6320
6336
  * @param effectId - Newly selected effect id.
6321
6337
  */
@@ -6329,6 +6345,7 @@ var video;
6329
6345
  video.notifySelectedVideoEffectChanged = notifySelectedVideoEffectChanged;
6330
6346
  /**
6331
6347
  * Register the video effect callback, host client uses this to notify the video extension the new video effect will by applied
6348
+ * @beta
6332
6349
  * @param callback - The VideoEffectCallback to invoke when registerForVideoEffect has completed
6333
6350
  */
6334
6351
  function registerForVideoEffect(callback) {
@@ -6342,12 +6359,14 @@ var video;
6342
6359
  /**
6343
6360
  * Sending notification to host client finished the video frame processing, now host client can render this video frame
6344
6361
  * or pass the video frame to next one in video pipeline
6362
+ * @beta
6345
6363
  */
6346
6364
  function notifyVideoFrameProcessed() {
6347
6365
  sendMessageToParent('video.videoFrameProcessed');
6348
6366
  }
6349
6367
  /**
6350
6368
  * Sending error notification to host client
6369
+ * @beta
6351
6370
  * @param errorMessage - The error message that will be sent to the host
6352
6371
  */
6353
6372
  function notifyError(errorMessage) {
@@ -6355,6 +6374,7 @@ var video;
6355
6374
  }
6356
6375
  /**
6357
6376
  * Checks if video capability is supported by the host
6377
+ * @beta
6358
6378
  * @returns true if the video capability is enabled in runtime.supports.video and
6359
6379
  * false if it is disabled
6360
6380
  */
@@ -6483,6 +6503,47 @@ var stageView;
6483
6503
  stageView.open = open;
6484
6504
  })(stageView || (stageView = {}));
6485
6505
 
6506
+ ;// CONCATENATED MODULE: ./src/public/webStorage.ts
6507
+
6508
+
6509
+
6510
+
6511
+ /**
6512
+ * Contains functionality to allow web apps to store data in webview cache
6513
+ *
6514
+ * @beta
6515
+ */
6516
+ var webStorage;
6517
+ (function (webStorage) {
6518
+ /**
6519
+ * Checks if web storage gets cleared when a user logs out from host client
6520
+ *
6521
+ * @returns true is web storage gets cleared on logout and false if it does not
6522
+ *
6523
+ * @beta
6524
+ */
6525
+ function isWebStorageClearedOnUserLogOut() {
6526
+ ensureInitialized();
6527
+ // return true as web storage is always cleared on desktop.
6528
+ if (GlobalVars.hostClientType === HostClientType.desktop) {
6529
+ return true;
6530
+ }
6531
+ return isSupported();
6532
+ }
6533
+ webStorage.isWebStorageClearedOnUserLogOut = isWebStorageClearedOnUserLogOut;
6534
+ /**
6535
+ * Checks if webStorage capability is supported by the host
6536
+ * @returns true if the webStorage capability is enabled in runtime.supports.webStorage and
6537
+ * false if it is disabled
6538
+ *
6539
+ * @beta
6540
+ */
6541
+ function isSupported() {
6542
+ return runtime.supports.webStorage ? true : false;
6543
+ }
6544
+ webStorage.isSupported = isSupported;
6545
+ })(webStorage || (webStorage = {}));
6546
+
6486
6547
  ;// CONCATENATED MODULE: ./src/public/call.ts
6487
6548
 
6488
6549
 
@@ -7090,7 +7151,7 @@ var settings;
7090
7151
  settings.setValidityState = setValidityState;
7091
7152
  /**
7092
7153
  * @deprecated
7093
- * As of 2.0.0, please use {@link pages.config.getConfig pages.config.getConfig(): Promise\<Config\>} instead.
7154
+ * As of 2.0.0, please use {@link pages.getConfig pages.getConfig(): Promise\<InstanceConfig\>} instead.
7094
7155
  *
7095
7156
  * Gets the settings for the current instance.
7096
7157
  *
@@ -7186,8 +7247,9 @@ var tasks;
7186
7247
  (function (tasks) {
7187
7248
  /**
7188
7249
  * @deprecated
7189
- * As of 2.0.0, please use {@link dialog.open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): PostMessageChannel} for url based dialogs
7190
- * and {@link dialog.bot.open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): PostMessageChannel} for bot based dialogs.
7250
+ * As of 2.0.0, please use {@link dialog.open dialog.open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void} for url based dialogs
7251
+ * and {@link dialog.bot.open dialog.bot.open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void} for bot based dialogs. In Teams,
7252
+ * this function can be used for adaptive card based dialogs. Support for adaptive card based dialogs is coming to other hosts in the future.
7191
7253
  *
7192
7254
  * Allows an app to open the task module.
7193
7255
  *
@@ -7195,19 +7257,18 @@ var tasks;
7195
7257
  * @param submitHandler - Handler to call when the task module is completed
7196
7258
  */
7197
7259
  function startTask(taskInfo, submitHandler) {
7260
+ var dialogSubmitHandler = submitHandler
7261
+ ? function (sdkResponse) { return submitHandler(sdkResponse.err, sdkResponse.result); }
7262
+ : undefined;
7198
7263
  if (taskInfo.card !== undefined || taskInfo.url === undefined) {
7199
7264
  ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
7200
7265
  sendMessageToParent('tasks.startTask', [taskInfo], submitHandler);
7201
7266
  }
7202
7267
  else if (taskInfo.completionBotId !== undefined) {
7203
- dialog.bot.open(getBotUrlDialogInfoFromTaskInfo(taskInfo), function (sdkResponse) {
7204
- return submitHandler(sdkResponse.err, sdkResponse.result);
7205
- });
7268
+ dialog.bot.open(getBotUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);
7206
7269
  }
7207
7270
  else {
7208
- dialog.open(getUrlDialogInfoFromTaskInfo(taskInfo), function (sdkResponse) {
7209
- return submitHandler(sdkResponse.err, sdkResponse.result);
7210
- });
7271
+ dialog.open(getUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);
7211
7272
  }
7212
7273
  return new ChildAppWindow();
7213
7274
  }
@@ -7232,7 +7293,7 @@ var tasks;
7232
7293
  tasks.updateTask = updateTask;
7233
7294
  /**
7234
7295
  * @deprecated
7235
- * As of 2.0.0, please use {@link dialog.submit dialog.submit(result?: string | object, appIds?: string | string[]): void} instead.
7296
+ * As of 2.0.0, please use {@link dialog.submit} instead.
7236
7297
  *
7237
7298
  * Submit the task module.
7238
7299
  *
@@ -7243,6 +7304,11 @@ var tasks;
7243
7304
  dialog.submit(result, appIds);
7244
7305
  }
7245
7306
  tasks.submitTask = submitTask;
7307
+ /**
7308
+ * Converts {@link TaskInfo} to {@link UrlDialogInfo}
7309
+ * @param taskInfo - TaskInfo object to convert
7310
+ * @returns - Converted UrlDialogInfo object
7311
+ */
7246
7312
  function getUrlDialogInfoFromTaskInfo(taskInfo) {
7247
7313
  var urldialogInfo = {
7248
7314
  url: taskInfo.url,
@@ -7256,6 +7322,11 @@ var tasks;
7256
7322
  return urldialogInfo;
7257
7323
  }
7258
7324
  tasks.getUrlDialogInfoFromTaskInfo = getUrlDialogInfoFromTaskInfo;
7325
+ /**
7326
+ * Converts {@link TaskInfo} to {@link BotUrlDialogInfo}
7327
+ * @param taskInfo - TaskInfo object to convert
7328
+ * @returns - converted BotUrlDialogInfo object
7329
+ */
7259
7330
  function getBotUrlDialogInfoFromTaskInfo(taskInfo) {
7260
7331
  var botUrldialogInfo = {
7261
7332
  url: taskInfo.url,
@@ -7270,6 +7341,12 @@ var tasks;
7270
7341
  return botUrldialogInfo;
7271
7342
  }
7272
7343
  tasks.getBotUrlDialogInfoFromTaskInfo = getBotUrlDialogInfoFromTaskInfo;
7344
+ /**
7345
+ * Sets the height and width of the {@link TaskInfo} object to the original height and width, if initially specified,
7346
+ * otherwise uses the height and width values corresponding to {@link TaskModuleDimension.Small}
7347
+ * @param taskInfo TaskInfo object from which to extract size info, if specified
7348
+ * @returns TaskInfo with height and width specified
7349
+ */
7273
7350
  function getDefaultSizeIfNotProvided(taskInfo) {
7274
7351
  taskInfo.height = taskInfo.height ? taskInfo.height : TaskModuleDimension.Small;
7275
7352
  taskInfo.width = taskInfo.width ? taskInfo.width : TaskModuleDimension.Small;
@@ -7305,6 +7382,7 @@ var tasks;
7305
7382
 
7306
7383
 
7307
7384
 
7385
+
7308
7386
 
7309
7387
 
7310
7388