@microsoft/teams-js 2.4.0 → 2.4.2-beta.0

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";
1133
+ var version = "2.4.2-beta.0";
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
@@ -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();
@@ -8105,302 +8248,6 @@ var tasks;
8105
8248
  tasks.getDefaultSizeIfNotProvided = getDefaultSizeIfNotProvided;
8106
8249
  })(tasks || (tasks = {}));
8107
8250
 
8108
- ;// CONCATENATED MODULE: ./src/internal/liveShareHost.ts
8109
-
8110
-
8111
-
8112
- /**
8113
- * @hidden
8114
- * @internal
8115
- * Limited to Microsoft-internal use
8116
- * ------
8117
- * Allowed roles during a meeting.
8118
- */
8119
- var UserMeetingRole;
8120
- (function (UserMeetingRole) {
8121
- UserMeetingRole["guest"] = "Guest";
8122
- UserMeetingRole["attendee"] = "Attendee";
8123
- UserMeetingRole["presenter"] = "Presenter";
8124
- UserMeetingRole["organizer"] = "Organizer";
8125
- })(UserMeetingRole || (UserMeetingRole = {}));
8126
- /**
8127
- * @hidden
8128
- * @internal
8129
- * Limited to Microsoft-internal use
8130
- * ------
8131
- * State of the current Live Share sessions backing fluid container.
8132
- */
8133
- var ContainerState;
8134
- (function (ContainerState) {
8135
- /**
8136
- * The call to `LiveShareHost.setContainerId()` successfully created the container mapping
8137
- * for the current Live Share session.
8138
- */
8139
- ContainerState["added"] = "Added";
8140
- /**
8141
- * A container mapping for the current Live Share Session already exists and should be used
8142
- * when joining the sessions Fluid container.
8143
- */
8144
- ContainerState["alreadyExists"] = "AlreadyExists";
8145
- /**
8146
- * The call to `LiveShareHost.setContainerId()` failed to create the container mapping due to
8147
- * another client having already set the container ID for the current Live Share session.
8148
- */
8149
- ContainerState["conflict"] = "Conflict";
8150
- /**
8151
- * A container mapping for the current Live Share session doesn't exist yet.
8152
- */
8153
- ContainerState["notFound"] = "NotFound";
8154
- })(ContainerState || (ContainerState = {}));
8155
- /**
8156
- * @hidden
8157
- * @internal
8158
- * Limited to Microsoft-internal use
8159
- * ------
8160
- * Interface for hosting a Live Share session within a client like Teams.
8161
- */
8162
- var LiveShareHost = /** @class */ (function () {
8163
- function LiveShareHost() {
8164
- }
8165
- /**
8166
- * @hidden
8167
- * @internal
8168
- * Limited to Microsoft-internal use
8169
- * ------
8170
- * Returns the Fluid Tenant connection info for user's current context.
8171
- */
8172
- LiveShareHost.prototype.getFluidTenantInfo = function () {
8173
- return new Promise(function (resolve) {
8174
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8175
- resolve(sendAndHandleSdkError('interactive.getFluidTenantInfo'));
8176
- });
8177
- };
8178
- /**
8179
- * @hidden
8180
- * @internal
8181
- * Limited to Microsoft-internal use
8182
- * ------
8183
- * Returns the fluid access token for mapped container Id.
8184
- *
8185
- * @param containerId Fluid's container Id for the request. Undefined for new containers.
8186
- * @returns token for connecting to Fluid's session.
8187
- */
8188
- LiveShareHost.prototype.getFluidToken = function (containerId) {
8189
- return new Promise(function (resolve) {
8190
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8191
- // eslint-disable-next-line strict-null-checks/all
8192
- resolve(sendAndHandleSdkError('interactive.getFluidToken', containerId));
8193
- });
8194
- };
8195
- /**
8196
- * @hidden
8197
- * @internal
8198
- * Limited to Microsoft-internal use
8199
- * ------
8200
- * Returns the ID of the fluid container associated with the user's current context.
8201
- */
8202
- LiveShareHost.prototype.getFluidContainerId = function () {
8203
- return new Promise(function (resolve) {
8204
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8205
- resolve(sendAndHandleSdkError('interactive.getFluidContainerId'));
8206
- });
8207
- };
8208
- /**
8209
- * @hidden
8210
- * @internal
8211
- * Limited to Microsoft-internal use
8212
- * ------
8213
- * Sets the ID of the fluid container associated with the current context.
8214
- *
8215
- * @remarks
8216
- * If this returns false, the client should delete the container they created and then call
8217
- * `getFluidContainerId()` to get the ID of the container being used.
8218
- * @param containerId ID of the fluid container the client created.
8219
- * @returns A data structure with a `containerState` indicating the success or failure of the request.
8220
- */
8221
- LiveShareHost.prototype.setFluidContainerId = function (containerId) {
8222
- return new Promise(function (resolve) {
8223
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8224
- resolve(sendAndHandleSdkError('interactive.setFluidContainerId', containerId));
8225
- });
8226
- };
8227
- /**
8228
- * @hidden
8229
- * @internal
8230
- * Limited to Microsoft-internal use
8231
- * ------
8232
- * Returns the shared clock server's current time.
8233
- */
8234
- LiveShareHost.prototype.getNtpTime = function () {
8235
- return new Promise(function (resolve) {
8236
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8237
- resolve(sendAndHandleSdkError('interactive.getNtpTime'));
8238
- });
8239
- };
8240
- /**
8241
- * @hidden
8242
- * @internal
8243
- * Limited to Microsoft-internal use
8244
- * ------
8245
- * Associates the fluid client ID with a set of user roles.
8246
- *
8247
- * @param clientId The ID for the current user's Fluid client. Changes on reconnects.
8248
- * @returns The roles for the current user.
8249
- */
8250
- LiveShareHost.prototype.registerClientId = function (clientId) {
8251
- return new Promise(function (resolve) {
8252
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8253
- resolve(sendAndHandleSdkError('interactive.registerClientId', clientId));
8254
- });
8255
- };
8256
- /**
8257
- * @hidden
8258
- * @internal
8259
- * Limited to Microsoft-internal use
8260
- * ------
8261
- * Returns the roles associated with a client ID.
8262
- *
8263
- * @param clientId The Client ID the message was received from.
8264
- * @returns The roles for a given client. Returns `undefined` if the client ID hasn't been registered yet.
8265
- */
8266
- LiveShareHost.prototype.getClientRoles = function (clientId) {
8267
- return new Promise(function (resolve) {
8268
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8269
- resolve(sendAndHandleSdkError('interactive.getClientRoles', clientId));
8270
- });
8271
- };
8272
- return LiveShareHost;
8273
- }());
8274
-
8275
-
8276
- ;// CONCATENATED MODULE: ./src/public/liveShare.ts
8277
- var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
8278
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
8279
- return new (P || (P = Promise))(function (resolve, reject) {
8280
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8281
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8282
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8283
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8284
- });
8285
- };
8286
- var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
8287
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
8288
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
8289
- function verb(n) { return function (v) { return step([n, v]); }; }
8290
- function step(op) {
8291
- if (f) throw new TypeError("Generator is already executing.");
8292
- while (_) try {
8293
- 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;
8294
- if (y = 0, t) op = [op[0] & 2, t.value];
8295
- switch (op[0]) {
8296
- case 0: case 1: t = op; break;
8297
- case 4: _.label++; return { value: op[1], done: false };
8298
- case 5: _.label++; y = op[1]; op = [0]; continue;
8299
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
8300
- default:
8301
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
8302
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
8303
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
8304
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
8305
- if (t[2]) _.ops.pop();
8306
- _.trys.pop(); continue;
8307
- }
8308
- op = body.call(thisArg, _);
8309
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
8310
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
8311
- }
8312
- };
8313
-
8314
- /**
8315
- * Namespace to interact with the Live Share module-specific part of the SDK.
8316
- *
8317
- * @beta
8318
- */
8319
- var liveShare;
8320
- (function (liveShare) {
8321
- var LIVE_SHARE_PACKAGE = '@microsoft/live-share';
8322
- var LIVE_SHARE_HOST = new LiveShareHost();
8323
- var client;
8324
- var initializing = false;
8325
- /**
8326
- * Initializes the Live Share client.
8327
- * @param options Optional. Configuration options passed to the Live Share client.
8328
- *
8329
- * @beta
8330
- */
8331
- function initialize(options) {
8332
- return __awaiter(this, void 0, void 0, function () {
8333
- var pkg, err_1;
8334
- return __generator(this, function (_a) {
8335
- switch (_a.label) {
8336
- case 0:
8337
- if (initializing || client) {
8338
- throw new Error('Live Share has already been initialized.');
8339
- }
8340
- _a.label = 1;
8341
- case 1:
8342
- _a.trys.push([1, 3, 4, 5]);
8343
- initializing = true;
8344
- return [4 /*yield*/, __webpack_require__(703)(LIVE_SHARE_PACKAGE)];
8345
- case 2:
8346
- pkg = (_a.sent());
8347
- client = new pkg.LiveShareClient(options, LIVE_SHARE_HOST);
8348
- return [3 /*break*/, 5];
8349
- case 3:
8350
- err_1 = _a.sent();
8351
- throw new Error('Unable to initialize Live Share client. Ensure that your project includes "@microsoft/live-share"');
8352
- case 4:
8353
- initializing = false;
8354
- return [7 /*endfinally*/];
8355
- case 5: return [2 /*return*/];
8356
- }
8357
- });
8358
- });
8359
- }
8360
- liveShare.initialize = initialize;
8361
- /**
8362
- * Connects to the fluid container for the current teams context.
8363
- *
8364
- * @remarks
8365
- * The first client joining the container will create the container resulting in the
8366
- * `onContainerFirstCreated` callback being called. This callback can be used to set the initial
8367
- * state of of the containers object prior to the container being attached.
8368
- * @param fluidContainerSchema Fluid objects to create.
8369
- * @param onContainerFirstCreated Optional. Callback that's called when the container is first created.
8370
- * @returns The fluid `container` and `services` objects to use along with a `created` flag that if true means the container had to be created.
8371
- *
8372
- * @beta
8373
- */
8374
- function joinContainer(fluidContainerSchema, onContainerFirstCreated) {
8375
- return __awaiter(this, void 0, void 0, function () {
8376
- return __generator(this, function (_a) {
8377
- switch (_a.label) {
8378
- case 0:
8379
- if (!client) return [3 /*break*/, 2];
8380
- return [4 /*yield*/, client.joinContainer(fluidContainerSchema, onContainerFirstCreated)];
8381
- case 1: return [2 /*return*/, _a.sent()];
8382
- case 2: throw new Error('Live Share must first be initialized');
8383
- }
8384
- });
8385
- });
8386
- }
8387
- liveShare.joinContainer = joinContainer;
8388
- /**
8389
- * @hidden
8390
- * Hide from docs
8391
- * ------
8392
- * Returns the LiveShareHost object. Called by existing apps that use the TeamsFluidClient
8393
- * directly. This prevents existing apps from breaking and will be removed when Live Share
8394
- * goes GA.
8395
- *
8396
- * @beta
8397
- */
8398
- function getHost() {
8399
- return LIVE_SHARE_HOST;
8400
- }
8401
- liveShare.getHost = getHost;
8402
- })(liveShare || (liveShare = {}));
8403
-
8404
8251
  ;// CONCATENATED MODULE: ./src/public/index.ts
8405
8252
 
8406
8253
 
@@ -8433,7 +8280,6 @@ var liveShare;
8433
8280
 
8434
8281
 
8435
8282
 
8436
-
8437
8283
 
8438
8284
 
8439
8285