@microsoft/teams-js 2.4.0-beta.1 → 2.4.0-beta.3

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.
@@ -178,6 +178,247 @@ function plural(ms, msAbs, n, name) {
178
178
  }
179
179
 
180
180
 
181
+ /***/ }),
182
+
183
+ /***/ 22:
184
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
185
+
186
+ var v1 = __webpack_require__(481);
187
+ var v4 = __webpack_require__(426);
188
+
189
+ var uuid = v4;
190
+ uuid.v1 = v1;
191
+ uuid.v4 = v4;
192
+
193
+ module.exports = uuid;
194
+
195
+
196
+ /***/ }),
197
+
198
+ /***/ 725:
199
+ /***/ ((module) => {
200
+
201
+ /**
202
+ * Convert array of 16 byte values to UUID string format of the form:
203
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
204
+ */
205
+ var byteToHex = [];
206
+ for (var i = 0; i < 256; ++i) {
207
+ byteToHex[i] = (i + 0x100).toString(16).substr(1);
208
+ }
209
+
210
+ function bytesToUuid(buf, offset) {
211
+ var i = offset || 0;
212
+ var bth = byteToHex;
213
+ // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
214
+ return ([
215
+ bth[buf[i++]], bth[buf[i++]],
216
+ bth[buf[i++]], bth[buf[i++]], '-',
217
+ bth[buf[i++]], bth[buf[i++]], '-',
218
+ bth[buf[i++]], bth[buf[i++]], '-',
219
+ bth[buf[i++]], bth[buf[i++]], '-',
220
+ bth[buf[i++]], bth[buf[i++]],
221
+ bth[buf[i++]], bth[buf[i++]],
222
+ bth[buf[i++]], bth[buf[i++]]
223
+ ]).join('');
224
+ }
225
+
226
+ module.exports = bytesToUuid;
227
+
228
+
229
+ /***/ }),
230
+
231
+ /***/ 157:
232
+ /***/ ((module) => {
233
+
234
+ // Unique ID creation requires a high quality random # generator. In the
235
+ // browser this is a little complicated due to unknown quality of Math.random()
236
+ // and inconsistent support for the `crypto` API. We do the best we can via
237
+ // feature-detection
238
+
239
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto
240
+ // implementation. Also, find the complete implementation of crypto on IE11.
241
+ var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
242
+ (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
243
+
244
+ if (getRandomValues) {
245
+ // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
246
+ var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
247
+
248
+ module.exports = function whatwgRNG() {
249
+ getRandomValues(rnds8);
250
+ return rnds8;
251
+ };
252
+ } else {
253
+ // Math.random()-based (RNG)
254
+ //
255
+ // If all else fails, use Math.random(). It's fast, but is of unspecified
256
+ // quality.
257
+ var rnds = new Array(16);
258
+
259
+ module.exports = function mathRNG() {
260
+ for (var i = 0, r; i < 16; i++) {
261
+ if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
262
+ rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
263
+ }
264
+
265
+ return rnds;
266
+ };
267
+ }
268
+
269
+
270
+ /***/ }),
271
+
272
+ /***/ 481:
273
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
274
+
275
+ var rng = __webpack_require__(157);
276
+ var bytesToUuid = __webpack_require__(725);
277
+
278
+ // **`v1()` - Generate time-based UUID**
279
+ //
280
+ // Inspired by https://github.com/LiosK/UUID.js
281
+ // and http://docs.python.org/library/uuid.html
282
+
283
+ var _nodeId;
284
+ var _clockseq;
285
+
286
+ // Previous uuid creation time
287
+ var _lastMSecs = 0;
288
+ var _lastNSecs = 0;
289
+
290
+ // See https://github.com/uuidjs/uuid for API details
291
+ function v1(options, buf, offset) {
292
+ var i = buf && offset || 0;
293
+ var b = buf || [];
294
+
295
+ options = options || {};
296
+ var node = options.node || _nodeId;
297
+ var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
298
+
299
+ // node and clockseq need to be initialized to random values if they're not
300
+ // specified. We do this lazily to minimize issues related to insufficient
301
+ // system entropy. See #189
302
+ if (node == null || clockseq == null) {
303
+ var seedBytes = rng();
304
+ if (node == null) {
305
+ // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
306
+ node = _nodeId = [
307
+ seedBytes[0] | 0x01,
308
+ seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
309
+ ];
310
+ }
311
+ if (clockseq == null) {
312
+ // Per 4.2.2, randomize (14 bit) clockseq
313
+ clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
314
+ }
315
+ }
316
+
317
+ // UUID timestamps are 100 nano-second units since the Gregorian epoch,
318
+ // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
319
+ // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
320
+ // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
321
+ var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
322
+
323
+ // Per 4.2.1.2, use count of uuid's generated during the current clock
324
+ // cycle to simulate higher resolution clock
325
+ var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
326
+
327
+ // Time since last uuid creation (in msecs)
328
+ var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
329
+
330
+ // Per 4.2.1.2, Bump clockseq on clock regression
331
+ if (dt < 0 && options.clockseq === undefined) {
332
+ clockseq = clockseq + 1 & 0x3fff;
333
+ }
334
+
335
+ // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
336
+ // time interval
337
+ if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
338
+ nsecs = 0;
339
+ }
340
+
341
+ // Per 4.2.1.2 Throw error if too many uuids are requested
342
+ if (nsecs >= 10000) {
343
+ throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
344
+ }
345
+
346
+ _lastMSecs = msecs;
347
+ _lastNSecs = nsecs;
348
+ _clockseq = clockseq;
349
+
350
+ // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
351
+ msecs += 12219292800000;
352
+
353
+ // `time_low`
354
+ var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
355
+ b[i++] = tl >>> 24 & 0xff;
356
+ b[i++] = tl >>> 16 & 0xff;
357
+ b[i++] = tl >>> 8 & 0xff;
358
+ b[i++] = tl & 0xff;
359
+
360
+ // `time_mid`
361
+ var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
362
+ b[i++] = tmh >>> 8 & 0xff;
363
+ b[i++] = tmh & 0xff;
364
+
365
+ // `time_high_and_version`
366
+ b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
367
+ b[i++] = tmh >>> 16 & 0xff;
368
+
369
+ // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
370
+ b[i++] = clockseq >>> 8 | 0x80;
371
+
372
+ // `clock_seq_low`
373
+ b[i++] = clockseq & 0xff;
374
+
375
+ // `node`
376
+ for (var n = 0; n < 6; ++n) {
377
+ b[i + n] = node[n];
378
+ }
379
+
380
+ return buf ? buf : bytesToUuid(b);
381
+ }
382
+
383
+ module.exports = v1;
384
+
385
+
386
+ /***/ }),
387
+
388
+ /***/ 426:
389
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
390
+
391
+ var rng = __webpack_require__(157);
392
+ var bytesToUuid = __webpack_require__(725);
393
+
394
+ function v4(options, buf, offset) {
395
+ var i = buf && offset || 0;
396
+
397
+ if (typeof(options) == 'string') {
398
+ buf = options === 'binary' ? new Array(16) : null;
399
+ options = null;
400
+ }
401
+ options = options || {};
402
+
403
+ var rnds = options.random || (options.rng || rng)();
404
+
405
+ // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
406
+ rnds[6] = (rnds[6] & 0x0f) | 0x40;
407
+ rnds[8] = (rnds[8] & 0x3f) | 0x80;
408
+
409
+ // Copy bytes to buffer, if provided
410
+ if (buf) {
411
+ for (var ii = 0; ii < 16; ++ii) {
412
+ buf[i + ii] = rnds[ii];
413
+ }
414
+ }
415
+
416
+ return buf || bytesToUuid(rnds);
417
+ }
418
+
419
+ module.exports = v4;
420
+
421
+
181
422
  /***/ }),
182
423
 
183
424
  /***/ 227:
@@ -735,25 +976,6 @@ function setup(env) {
735
976
  module.exports = setup;
736
977
 
737
978
 
738
- /***/ }),
739
-
740
- /***/ 703:
741
- /***/ ((module) => {
742
-
743
- function webpackEmptyAsyncContext(req) {
744
- // Here Promise.resolve().then() is used instead of new Promise() to prevent
745
- // uncaught exception popping up in devtools
746
- return Promise.resolve().then(() => {
747
- var e = new Error("Cannot find module '" + req + "'");
748
- e.code = 'MODULE_NOT_FOUND';
749
- throw e;
750
- });
751
- }
752
- webpackEmptyAsyncContext.keys = () => ([]);
753
- webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
754
- webpackEmptyAsyncContext.id = 703;
755
- module.exports = webpackEmptyAsyncContext;
756
-
757
979
  /***/ })
758
980
 
759
981
  /******/ });
@@ -858,7 +1080,6 @@ __webpack_require__.d(__webpack_exports__, {
858
1080
  "getTabInstances": () => (/* reexport */ getTabInstances),
859
1081
  "initialize": () => (/* reexport */ initialize),
860
1082
  "initializeWithFrameContext": () => (/* reexport */ initializeWithFrameContext),
861
- "liveShare": () => (/* reexport */ liveShare),
862
1083
  "location": () => (/* reexport */ location_location),
863
1084
  "logs": () => (/* reexport */ logs),
864
1085
  "mail": () => (/* reexport */ mail),
@@ -909,7 +1130,7 @@ __webpack_require__.d(__webpack_exports__, {
909
1130
  });
910
1131
 
911
1132
  ;// CONCATENATED MODULE: ./src/public/version.ts
912
- var version = "2.4.0-beta.1";
1133
+ var version = "2.4.0-beta.3";
913
1134
 
914
1135
  ;// CONCATENATED MODULE: ./src/internal/globalVars.ts
915
1136
  var GlobalVars = /** @class */ (function () {
@@ -1289,92 +1510,8 @@ var teamsDeepLinkProtocol = 'https';
1289
1510
  */
1290
1511
  var teamsDeepLinkHost = 'teams.microsoft.com';
1291
1512
 
1292
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/rng.js
1293
- // Unique ID creation requires a high quality random # generator. In the browser we therefore
1294
- // require the crypto API and do not support built-in fallback to lower quality random number
1295
- // generators (like Math.random()).
1296
- var getRandomValues;
1297
- var rnds8 = new Uint8Array(16);
1298
- function rng() {
1299
- // lazy load so that environments that need to polyfill have a chance to do so
1300
- if (!getRandomValues) {
1301
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
1302
- // find the complete implementation of crypto (msCrypto) on IE11.
1303
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
1304
-
1305
- if (!getRandomValues) {
1306
- throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
1307
- }
1308
- }
1309
-
1310
- return getRandomValues(rnds8);
1311
- }
1312
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/regex.js
1313
- /* harmony default export */ const regex = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i);
1314
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/validate.js
1315
-
1316
-
1317
- function validate(uuid) {
1318
- return typeof uuid === 'string' && regex.test(uuid);
1319
- }
1320
-
1321
- /* harmony default export */ const esm_browser_validate = (validate);
1322
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/stringify.js
1323
-
1324
- /**
1325
- * Convert array of 16 byte values to UUID string format of the form:
1326
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
1327
- */
1328
-
1329
- var byteToHex = [];
1330
-
1331
- for (var i = 0; i < 256; ++i) {
1332
- byteToHex.push((i + 0x100).toString(16).substr(1));
1333
- }
1334
-
1335
- function stringify(arr) {
1336
- var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1337
- // Note: Be careful editing this code! It's been tuned for performance
1338
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
1339
- var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
1340
- // of the following:
1341
- // - One or more input array values don't map to a hex octet (leading to
1342
- // "undefined" in the uuid)
1343
- // - Invalid input values for the RFC `version` or `variant` fields
1344
-
1345
- if (!esm_browser_validate(uuid)) {
1346
- throw TypeError('Stringified UUID is invalid');
1347
- }
1348
-
1349
- return uuid;
1350
- }
1351
-
1352
- /* harmony default export */ const esm_browser_stringify = (stringify);
1353
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/v4.js
1354
-
1355
-
1356
-
1357
- function v4(options, buf, offset) {
1358
- options = options || {};
1359
- var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
1360
-
1361
- rnds[6] = rnds[6] & 0x0f | 0x40;
1362
- rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
1363
-
1364
- if (buf) {
1365
- offset = offset || 0;
1366
-
1367
- for (var i = 0; i < 16; ++i) {
1368
- buf[offset + i] = rnds[i];
1369
- }
1370
-
1371
- return buf;
1372
- }
1373
-
1374
- return esm_browser_stringify(rnds);
1375
- }
1376
-
1377
- /* harmony default export */ const esm_browser_v4 = (v4);
1513
+ // EXTERNAL MODULE: ../../node_modules/uuid/index.js
1514
+ var uuid = __webpack_require__(22);
1378
1515
  ;// CONCATENATED MODULE: ./src/internal/utils.ts
1379
1516
  /* eslint-disable @typescript-eslint/ban-types */
1380
1517
  /* eslint-disable @typescript-eslint/no-unused-vars */
@@ -1502,7 +1639,7 @@ function compareSDKVersions(v1, v2) {
1502
1639
  * Limited to Microsoft-internal use
1503
1640
  */
1504
1641
  function generateGUID() {
1505
- return esm_browser_v4();
1642
+ return uuid.v4();
1506
1643
  }
1507
1644
  /**
1508
1645
  * @internal
@@ -2241,10 +2378,11 @@ var runtime = {
2241
2378
  notifications: undefined,
2242
2379
  pages: {
2243
2380
  appButton: undefined,
2244
- tabs: undefined,
2245
- config: undefined,
2246
2381
  backStack: undefined,
2382
+ config: undefined,
2383
+ currentApp: undefined,
2247
2384
  fullTrust: undefined,
2385
+ tabs: undefined,
2248
2386
  },
2249
2387
  people: undefined,
2250
2388
  permissions: undefined,
@@ -2483,7 +2621,7 @@ var dialog;
2483
2621
  * Submit the dialog module and close the dialog
2484
2622
  *
2485
2623
  * @param result - The result to be sent to the bot or the app. Typically a JSON object or a serialized version of it
2486
- * @param appIds - Helps to validate that the call originates from the same appId as the one that invoked the task module
2624
+ * @param appIds - Valid application(s) that can receive the result of the submitted dialogs. Specifying this parameter helps prevent malicious apps from retrieving the dialog result. Multiple app IDs can be specified because a web app from a single underlying domain can power multiple apps across different environments and branding schemes.
2487
2625
  */
2488
2626
  function submit(result, appIds) {
2489
2627
  ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);
@@ -3033,8 +3171,7 @@ var app_app;
3033
3171
  * Initializes the library.
3034
3172
  *
3035
3173
  * @remarks
3036
- * This must be called before any other SDK calls
3037
- * but after the frame is loaded successfully.
3174
+ * Initialize must have completed successfully (as determined by the resolved Promise) before any other library calls are made
3038
3175
  *
3039
3176
  * @param validMessageOrigins - Optionally specify a list of cross frame message origins. They must have
3040
3177
  * https: protocol otherwise they will be ignored. Example: https:www.example.com
@@ -3713,6 +3850,9 @@ var pages;
3713
3850
  if (saveHandler) {
3714
3851
  saveHandler(saveEvent);
3715
3852
  }
3853
+ else if (Communication.childWindow) {
3854
+ sendMessageEventToChild('settings.save', [result]);
3855
+ }
3716
3856
  else {
3717
3857
  // If no handler is registered, we assume success.
3718
3858
  saveEvent.notifySuccess();
@@ -3761,6 +3901,9 @@ var pages;
3761
3901
  if (removeHandler) {
3762
3902
  removeHandler(removeEvent);
3763
3903
  }
3904
+ else if (Communication.childWindow) {
3905
+ sendMessageEventToChild('settings.remove', []);
3906
+ }
3764
3907
  else {
3765
3908
  // If no handler is registered, we assume success.
3766
3909
  removeEvent.notifySuccess();
@@ -3862,7 +4005,13 @@ var pages;
3862
4005
  backStack.registerBackButtonHandlerHelper = registerBackButtonHandlerHelper;
3863
4006
  function handleBackButtonPress() {
3864
4007
  if (!backButtonPressHandler || !backButtonPressHandler()) {
3865
- navigateBack();
4008
+ if (Communication.childWindow) {
4009
+ // If the current window did not handle it let the child window
4010
+ sendMessageEventToChild('backButtonPress', []);
4011
+ }
4012
+ else {
4013
+ navigateBack();
4014
+ }
3866
4015
  }
3867
4016
  }
3868
4017
  /**
@@ -3978,6 +4127,58 @@ var pages;
3978
4127
  }
3979
4128
  appButton.isSupported = isSupported;
3980
4129
  })(appButton = pages.appButton || (pages.appButton = {}));
4130
+ /**
4131
+ * Provides functions for navigating without needing to specify your application ID.
4132
+ *
4133
+ * @beta
4134
+ */
4135
+ var currentApp;
4136
+ (function (currentApp) {
4137
+ /**
4138
+ * Navigate within the currently running application with page ID, and sub-page ID (for navigating to
4139
+ * specific content within the page).
4140
+ * @param params - Parameters for the navigation
4141
+ * @returns a promise that will resolve if the navigation was successful
4142
+ *
4143
+ * @beta
4144
+ */
4145
+ function navigateTo(params) {
4146
+ return new Promise(function (resolve) {
4147
+ ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4148
+ if (!isSupported()) {
4149
+ throw errorNotSupportedOnPlatform;
4150
+ }
4151
+ resolve(sendAndHandleSdkError('pages.currentApp.navigateTo', params));
4152
+ });
4153
+ }
4154
+ currentApp.navigateTo = navigateTo;
4155
+ /**
4156
+ * Navigate to the currently running application's first static page defined in the application
4157
+ * manifest.
4158
+ * @beta
4159
+ */
4160
+ function navigateToDefaultPage() {
4161
+ return new Promise(function (resolve) {
4162
+ ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4163
+ if (!isSupported()) {
4164
+ throw errorNotSupportedOnPlatform;
4165
+ }
4166
+ resolve(sendAndHandleSdkError('pages.currentApp.navigateToDefaultPage'));
4167
+ });
4168
+ }
4169
+ currentApp.navigateToDefaultPage = navigateToDefaultPage;
4170
+ /**
4171
+ * Checks if pages.currentApp capability is supported by the host
4172
+ * @returns true if the pages.currentApp capability is enabled in runtime.supports.pages.currentApp and
4173
+ * false if it is disabled
4174
+ *
4175
+ * @beta
4176
+ */
4177
+ function isSupported() {
4178
+ return runtime.supports.pages ? (runtime.supports.pages.currentApp ? true : false) : false;
4179
+ }
4180
+ currentApp.isSupported = isSupported;
4181
+ })(currentApp = pages.currentApp || (pages.currentApp = {}));
3981
4182
  })(pages || (pages = {}));
3982
4183
 
3983
4184
  ;// CONCATENATED MODULE: ./src/internal/handlers.ts
@@ -4029,6 +4230,10 @@ function callHandler(name, args) {
4029
4230
  var result = handler.apply(this, args);
4030
4231
  return [true, result];
4031
4232
  }
4233
+ else if (Communication.childWindow) {
4234
+ sendMessageEventToChild(name, [args]);
4235
+ return [false, undefined];
4236
+ }
4032
4237
  else {
4033
4238
  callHandlerLogger('Handler for action message %s not found.', name);
4034
4239
  return [false, undefined];
@@ -4139,7 +4344,12 @@ function handleBeforeUnload() {
4139
4344
  sendMessageToParent('readyToUnload', []);
4140
4345
  };
4141
4346
  if (!HandlersPrivate.beforeUnloadHandler || !HandlersPrivate.beforeUnloadHandler(readyToUnload)) {
4142
- readyToUnload();
4347
+ if (Communication.childWindow) {
4348
+ sendMessageEventToChild('beforeUnload');
4349
+ }
4350
+ else {
4351
+ readyToUnload();
4352
+ }
4143
4353
  }
4144
4354
  }
4145
4355
 
@@ -7981,7 +8191,7 @@ var tasks;
7981
8191
  * Submit the task module.
7982
8192
  *
7983
8193
  * @param result - Contains the result to be sent to the bot or the app. Typically a JSON object or a serialized version of it
7984
- * @param appIds - Helps to validate that the call originates from the same appId as the one that invoked the task module
8194
+ * @param appIds - Valid application(s) that can receive the result of the submitted dialogs. Specifying this parameter helps prevent malicious apps from retrieving the dialog result. Multiple app IDs can be specified because a web app from a single underlying domain can power multiple apps across different environments and branding schemes.
7985
8195
  */
7986
8196
  function submitTask(result, appIds) {
7987
8197
  dialog.submit(result, appIds);
@@ -8038,302 +8248,6 @@ var tasks;
8038
8248
  tasks.getDefaultSizeIfNotProvided = getDefaultSizeIfNotProvided;
8039
8249
  })(tasks || (tasks = {}));
8040
8250
 
8041
- ;// CONCATENATED MODULE: ./src/internal/liveShareHost.ts
8042
-
8043
-
8044
-
8045
- /**
8046
- * @hidden
8047
- * @internal
8048
- * Limited to Microsoft-internal use
8049
- * ------
8050
- * Allowed roles during a meeting.
8051
- */
8052
- var UserMeetingRole;
8053
- (function (UserMeetingRole) {
8054
- UserMeetingRole["guest"] = "Guest";
8055
- UserMeetingRole["attendee"] = "Attendee";
8056
- UserMeetingRole["presenter"] = "Presenter";
8057
- UserMeetingRole["organizer"] = "Organizer";
8058
- })(UserMeetingRole || (UserMeetingRole = {}));
8059
- /**
8060
- * @hidden
8061
- * @internal
8062
- * Limited to Microsoft-internal use
8063
- * ------
8064
- * State of the current Live Share sessions backing fluid container.
8065
- */
8066
- var ContainerState;
8067
- (function (ContainerState) {
8068
- /**
8069
- * The call to `LiveShareHost.setContainerId()` successfully created the container mapping
8070
- * for the current Live Share session.
8071
- */
8072
- ContainerState["added"] = "Added";
8073
- /**
8074
- * A container mapping for the current Live Share Session already exists and should be used
8075
- * when joining the sessions Fluid container.
8076
- */
8077
- ContainerState["alreadyExists"] = "AlreadyExists";
8078
- /**
8079
- * The call to `LiveShareHost.setContainerId()` failed to create the container mapping due to
8080
- * another client having already set the container ID for the current Live Share session.
8081
- */
8082
- ContainerState["conflict"] = "Conflict";
8083
- /**
8084
- * A container mapping for the current Live Share session doesn't exist yet.
8085
- */
8086
- ContainerState["notFound"] = "NotFound";
8087
- })(ContainerState || (ContainerState = {}));
8088
- /**
8089
- * @hidden
8090
- * @internal
8091
- * Limited to Microsoft-internal use
8092
- * ------
8093
- * Interface for hosting a Live Share session within a client like Teams.
8094
- */
8095
- var LiveShareHost = /** @class */ (function () {
8096
- function LiveShareHost() {
8097
- }
8098
- /**
8099
- * @hidden
8100
- * @internal
8101
- * Limited to Microsoft-internal use
8102
- * ------
8103
- * Returns the Fluid Tenant connection info for user's current context.
8104
- */
8105
- LiveShareHost.prototype.getFluidTenantInfo = function () {
8106
- return new Promise(function (resolve) {
8107
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8108
- resolve(sendAndHandleSdkError('interactive.getFluidTenantInfo'));
8109
- });
8110
- };
8111
- /**
8112
- * @hidden
8113
- * @internal
8114
- * Limited to Microsoft-internal use
8115
- * ------
8116
- * Returns the fluid access token for mapped container Id.
8117
- *
8118
- * @param containerId Fluid's container Id for the request. Undefined for new containers.
8119
- * @returns token for connecting to Fluid's session.
8120
- */
8121
- LiveShareHost.prototype.getFluidToken = function (containerId) {
8122
- return new Promise(function (resolve) {
8123
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8124
- // eslint-disable-next-line strict-null-checks/all
8125
- resolve(sendAndHandleSdkError('interactive.getFluidToken', containerId));
8126
- });
8127
- };
8128
- /**
8129
- * @hidden
8130
- * @internal
8131
- * Limited to Microsoft-internal use
8132
- * ------
8133
- * Returns the ID of the fluid container associated with the user's current context.
8134
- */
8135
- LiveShareHost.prototype.getFluidContainerId = function () {
8136
- return new Promise(function (resolve) {
8137
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8138
- resolve(sendAndHandleSdkError('interactive.getFluidContainerId'));
8139
- });
8140
- };
8141
- /**
8142
- * @hidden
8143
- * @internal
8144
- * Limited to Microsoft-internal use
8145
- * ------
8146
- * Sets the ID of the fluid container associated with the current context.
8147
- *
8148
- * @remarks
8149
- * If this returns false, the client should delete the container they created and then call
8150
- * `getFluidContainerId()` to get the ID of the container being used.
8151
- * @param containerId ID of the fluid container the client created.
8152
- * @returns A data structure with a `containerState` indicating the success or failure of the request.
8153
- */
8154
- LiveShareHost.prototype.setFluidContainerId = function (containerId) {
8155
- return new Promise(function (resolve) {
8156
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8157
- resolve(sendAndHandleSdkError('interactive.setFluidContainerId', containerId));
8158
- });
8159
- };
8160
- /**
8161
- * @hidden
8162
- * @internal
8163
- * Limited to Microsoft-internal use
8164
- * ------
8165
- * Returns the shared clock server's current time.
8166
- */
8167
- LiveShareHost.prototype.getNtpTime = function () {
8168
- return new Promise(function (resolve) {
8169
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8170
- resolve(sendAndHandleSdkError('interactive.getNtpTime'));
8171
- });
8172
- };
8173
- /**
8174
- * @hidden
8175
- * @internal
8176
- * Limited to Microsoft-internal use
8177
- * ------
8178
- * Associates the fluid client ID with a set of user roles.
8179
- *
8180
- * @param clientId The ID for the current user's Fluid client. Changes on reconnects.
8181
- * @returns The roles for the current user.
8182
- */
8183
- LiveShareHost.prototype.registerClientId = function (clientId) {
8184
- return new Promise(function (resolve) {
8185
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8186
- resolve(sendAndHandleSdkError('interactive.registerClientId', clientId));
8187
- });
8188
- };
8189
- /**
8190
- * @hidden
8191
- * @internal
8192
- * Limited to Microsoft-internal use
8193
- * ------
8194
- * Returns the roles associated with a client ID.
8195
- *
8196
- * @param clientId The Client ID the message was received from.
8197
- * @returns The roles for a given client. Returns `undefined` if the client ID hasn't been registered yet.
8198
- */
8199
- LiveShareHost.prototype.getClientRoles = function (clientId) {
8200
- return new Promise(function (resolve) {
8201
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8202
- resolve(sendAndHandleSdkError('interactive.getClientRoles', clientId));
8203
- });
8204
- };
8205
- return LiveShareHost;
8206
- }());
8207
-
8208
-
8209
- ;// CONCATENATED MODULE: ./src/public/liveShare.ts
8210
- var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
8211
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
8212
- return new (P || (P = Promise))(function (resolve, reject) {
8213
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8214
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8215
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8216
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8217
- });
8218
- };
8219
- var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
8220
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
8221
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
8222
- function verb(n) { return function (v) { return step([n, v]); }; }
8223
- function step(op) {
8224
- if (f) throw new TypeError("Generator is already executing.");
8225
- while (_) try {
8226
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
8227
- if (y = 0, t) op = [op[0] & 2, t.value];
8228
- switch (op[0]) {
8229
- case 0: case 1: t = op; break;
8230
- case 4: _.label++; return { value: op[1], done: false };
8231
- case 5: _.label++; y = op[1]; op = [0]; continue;
8232
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
8233
- default:
8234
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
8235
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
8236
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
8237
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
8238
- if (t[2]) _.ops.pop();
8239
- _.trys.pop(); continue;
8240
- }
8241
- op = body.call(thisArg, _);
8242
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
8243
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
8244
- }
8245
- };
8246
-
8247
- /**
8248
- * Namespace to interact with the Live Share module-specific part of the SDK.
8249
- *
8250
- * @beta
8251
- */
8252
- var liveShare;
8253
- (function (liveShare) {
8254
- var LIVE_SHARE_PACKAGE = '@microsoft/live-share';
8255
- var LIVE_SHARE_HOST = new LiveShareHost();
8256
- var client;
8257
- var initializing = false;
8258
- /**
8259
- * Initializes the Live Share client.
8260
- * @param options Optional. Configuration options passed to the Live Share client.
8261
- *
8262
- * @beta
8263
- */
8264
- function initialize(options) {
8265
- return __awaiter(this, void 0, void 0, function () {
8266
- var pkg, err_1;
8267
- return __generator(this, function (_a) {
8268
- switch (_a.label) {
8269
- case 0:
8270
- if (initializing || client) {
8271
- throw new Error('Live Share has already been initialized.');
8272
- }
8273
- _a.label = 1;
8274
- case 1:
8275
- _a.trys.push([1, 3, 4, 5]);
8276
- initializing = true;
8277
- return [4 /*yield*/, __webpack_require__(703)(LIVE_SHARE_PACKAGE)];
8278
- case 2:
8279
- pkg = (_a.sent());
8280
- client = new pkg.LiveShareClient(options, LIVE_SHARE_HOST);
8281
- return [3 /*break*/, 5];
8282
- case 3:
8283
- err_1 = _a.sent();
8284
- throw new Error('Unable to initialize Live Share client. Ensure that your project includes "@microsoft/live-share"');
8285
- case 4:
8286
- initializing = false;
8287
- return [7 /*endfinally*/];
8288
- case 5: return [2 /*return*/];
8289
- }
8290
- });
8291
- });
8292
- }
8293
- liveShare.initialize = initialize;
8294
- /**
8295
- * Connects to the fluid container for the current teams context.
8296
- *
8297
- * @remarks
8298
- * The first client joining the container will create the container resulting in the
8299
- * `onContainerFirstCreated` callback being called. This callback can be used to set the initial
8300
- * state of of the containers object prior to the container being attached.
8301
- * @param fluidContainerSchema Fluid objects to create.
8302
- * @param onContainerFirstCreated Optional. Callback that's called when the container is first created.
8303
- * @returns The fluid `container` and `services` objects to use along with a `created` flag that if true means the container had to be created.
8304
- *
8305
- * @beta
8306
- */
8307
- function joinContainer(fluidContainerSchema, onContainerFirstCreated) {
8308
- return __awaiter(this, void 0, void 0, function () {
8309
- return __generator(this, function (_a) {
8310
- switch (_a.label) {
8311
- case 0:
8312
- if (!client) return [3 /*break*/, 2];
8313
- return [4 /*yield*/, client.joinContainer(fluidContainerSchema, onContainerFirstCreated)];
8314
- case 1: return [2 /*return*/, _a.sent()];
8315
- case 2: throw new Error('Live Share must first be initialized');
8316
- }
8317
- });
8318
- });
8319
- }
8320
- liveShare.joinContainer = joinContainer;
8321
- /**
8322
- * @hidden
8323
- * Hide from docs
8324
- * ------
8325
- * Returns the LiveShareHost object. Called by existing apps that use the TeamsFluidClient
8326
- * directly. This prevents existing apps from breaking and will be removed when Live Share
8327
- * goes GA.
8328
- *
8329
- * @beta
8330
- */
8331
- function getHost() {
8332
- return LIVE_SHARE_HOST;
8333
- }
8334
- liveShare.getHost = getHost;
8335
- })(liveShare || (liveShare = {}));
8336
-
8337
8251
  ;// CONCATENATED MODULE: ./src/public/index.ts
8338
8252
 
8339
8253
 
@@ -8366,7 +8280,6 @@ var liveShare;
8366
8280
 
8367
8281
 
8368
8282
 
8369
-
8370
8283
 
8371
8284
 
8372
8285