@microsoft/teams-js 2.0.0-beta.4-dev.15 → 2.0.0-beta.4-dev.16

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.
@@ -2179,6 +2179,10 @@ export interface DialogInfo {
2179
2179
  * As of 2.0.0-beta.1, please use {@link DialogInfo} instead.
2180
2180
  */
2181
2181
  export type TaskInfo = DialogInfo;
2182
+ export interface DialogSize {
2183
+ height: DialogDimension | number;
2184
+ width: DialogDimension | number;
2185
+ }
2182
2186
  /**
2183
2187
  * @hidden
2184
2188
  * Hide from docs.
@@ -2799,12 +2803,6 @@ export namespace dialog {
2799
2803
  * @returns a function that can be used to send messages to the dialog.
2800
2804
  */
2801
2805
  function open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): PostMessageChannel;
2802
- /**
2803
- * Update height/width dialog info properties.
2804
- *
2805
- * @param dialogInfo - An object containing width and height properties
2806
- */
2807
- function resize(dialogInfo: DialogInfo): void;
2808
2806
  /**
2809
2807
  * Submit the dialog module.
2810
2808
  *
@@ -2827,6 +2825,15 @@ export namespace dialog {
2827
2825
  */
2828
2826
  function registerOnMessageFromParent(listener: (message: any) => void): void;
2829
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
+ }
2830
2837
  namespace bot {
2831
2838
  function open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): PostMessageChannel;
2832
2839
  function isSupported(): boolean;
@@ -5104,7 +5111,7 @@ export namespace tasks {
5104
5111
  function startTask(taskInfo: TaskInfo, submitHandler?: (err: string, result: string | object) => void): IAppWindow;
5105
5112
  /**
5106
5113
  * @deprecated
5107
- * As of 2.0.0-beta.1, please use {@link dialog.resize dialog.resize(dialogInfo: DialogInfo): void} instead.
5114
+ * As of 2.0.0-beta.4, please use {@link dialog.update.resize dialog.update.resize(dimensions: DialogSize): void} instead.
5108
5115
  *
5109
5116
  * Update height/width task info properties.
5110
5117
  *
@@ -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.15";
1124
+ var version = "2.0.0-beta.4-dev.16";
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.
@@ -1822,6 +1822,7 @@ var runtime = {
1822
1822
  chat: undefined,
1823
1823
  dialog: {
1824
1824
  bot: undefined,
1825
+ update: undefined,
1825
1826
  },
1826
1827
  location: undefined,
1827
1828
  logs: undefined,
@@ -1860,6 +1861,7 @@ var teamsRuntimeConfig = {
1860
1861
  chat: {},
1861
1862
  dialog: {
1862
1863
  bot: {},
1864
+ update: {},
1863
1865
  },
1864
1866
  files: {},
1865
1867
  location: {},
@@ -4255,17 +4257,6 @@ var appInstallDialog;
4255
4257
  /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
4256
4258
  /* eslint-disable @typescript-eslint/ban-types */
4257
4259
  /* eslint-disable @typescript-eslint/no-unused-vars */
4258
- var __rest = (undefined && undefined.__rest) || function (s, e) {
4259
- var t = {};
4260
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4261
- t[p] = s[p];
4262
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
4263
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
4264
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
4265
- t[p[i]] = s[p[i]];
4266
- }
4267
- return t;
4268
- };
4269
4260
 
4270
4261
 
4271
4262
 
@@ -4298,22 +4289,6 @@ var dialog;
4298
4289
  return sendMessageToDialog;
4299
4290
  }
4300
4291
  dialog.open = open;
4301
- /**
4302
- * Update height/width dialog info properties.
4303
- *
4304
- * @param dialogInfo - An object containing width and height properties
4305
- */
4306
- function resize(dialogInfo) {
4307
- ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);
4308
- var width = dialogInfo.width, height = dialogInfo.height, extra = __rest(dialogInfo, ["width", "height"]);
4309
- if (!Object.keys(extra).length) {
4310
- sendMessageToParent('tasks.updateTask', [dialogInfo]);
4311
- }
4312
- else {
4313
- throw new Error('resize requires a dialogInfo argument containing only width and height');
4314
- }
4315
- }
4316
- dialog.resize = resize;
4317
4292
  /**
4318
4293
  * Submit the dialog module.
4319
4294
  *
@@ -4355,6 +4330,23 @@ var dialog;
4355
4330
  return runtime.supports.dialog ? true : false;
4356
4331
  }
4357
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 = {}));
4358
4350
  var bot;
4359
4351
  (function (bot) {
4360
4352
  function open(botUrlDialogInfo, submitHandler, messageFromChildHandler) {
@@ -6351,6 +6343,17 @@ var settings;
6351
6343
 
6352
6344
  ;// CONCATENATED MODULE: ./src/public/tasks.ts
6353
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
+ };
6354
6357
 
6355
6358
 
6356
6359
 
@@ -6396,14 +6399,20 @@ var tasks;
6396
6399
  tasks.startTask = startTask;
6397
6400
  /**
6398
6401
  * @deprecated
6399
- * As of 2.0.0-beta.1, please use {@link dialog.resize dialog.resize(dialogInfo: DialogInfo): void} instead.
6402
+ * As of 2.0.0-beta.4, please use {@link dialog.update.resize dialog.update.resize(dimensions: DialogSize): void} instead.
6400
6403
  *
6401
6404
  * Update height/width task info properties.
6402
6405
  *
6403
6406
  * @param taskInfo - An object containing width and height properties
6404
6407
  */
6405
6408
  function updateTask(taskInfo) {
6406
- dialog.resize(taskInfo);
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);
6407
6416
  }
6408
6417
  tasks.updateTask = updateTask;
6409
6418
  /**