@microsoft/teams-js 2.15.0 → 2.16.0-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.
@@ -2705,6 +2705,10 @@ export enum HostName {
2705
2705
  * Microsoft-internal test Host
2706
2706
  */
2707
2707
  orange = "Orange",
2708
+ /**
2709
+ * Microsoft connected workplace platform
2710
+ */
2711
+ places = "Places",
2708
2712
  /**
2709
2713
  * Teams
2710
2714
  */
@@ -1351,6 +1351,10 @@ var HostName;
1351
1351
  * Microsoft-internal test Host
1352
1352
  */
1353
1353
  HostName["orange"] = "Orange";
1354
+ /**
1355
+ * Microsoft connected workplace platform
1356
+ */
1357
+ HostName["places"] = "Places";
1354
1358
  /**
1355
1359
  * Teams
1356
1360
  */
@@ -2203,7 +2207,7 @@ var _minRuntimeConfigToUninitialize = {
2203
2207
  * @hidden
2204
2208
  * Package version.
2205
2209
  */
2206
- var version = "2.15.0";
2210
+ var version = "2.16.0-beta.0";
2207
2211
 
2208
2212
  ;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
2209
2213
 
@@ -3354,137 +3358,6 @@ var menus;
3354
3358
  menus.isSupported = isSupported;
3355
3359
  })(menus || (menus = {}));
3356
3360
 
3357
- ;// CONCATENATED MODULE: ./src/public/teamsAPIs.ts
3358
-
3359
- // Conflict with some names
3360
-
3361
-
3362
-
3363
-
3364
- /**
3365
- * Namespace containing the set of APIs that support Teams-specific functionalities.
3366
- */
3367
- var teamsCore;
3368
- (function (teamsCore) {
3369
- /**
3370
- * Enable print capability to support printing page using Ctrl+P and cmd+P
3371
- */
3372
- function enablePrintCapability() {
3373
- if (!GlobalVars.printCapabilityEnabled) {
3374
- ensureInitialized(runtime);
3375
- if (!isSupported()) {
3376
- throw errorNotSupportedOnPlatform;
3377
- }
3378
- GlobalVars.printCapabilityEnabled = true;
3379
- // adding ctrl+P and cmd+P handler
3380
- document.addEventListener('keydown', function (event) {
3381
- if ((event.ctrlKey || event.metaKey) && event.keyCode === 80) {
3382
- print();
3383
- event.cancelBubble = true;
3384
- event.preventDefault();
3385
- event.stopImmediatePropagation();
3386
- }
3387
- });
3388
- }
3389
- }
3390
- teamsCore.enablePrintCapability = enablePrintCapability;
3391
- /**
3392
- * default print handler
3393
- */
3394
- function print() {
3395
- ssrSafeWindow().print();
3396
- }
3397
- teamsCore.print = print;
3398
- /**
3399
- * Registers a handler to be called when the page has been requested to load.
3400
- *
3401
- * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/build-tabs-for-meeting?tabs=desktop%2Cmeeting-chat-view-desktop%2Cmeeting-stage-view-desktop%2Cchannel-meeting-desktop#app-caching)
3402
- * for a more detailed explanation about using this API.
3403
- *
3404
- * @param handler - The handler to invoke when the page is loaded.
3405
- *
3406
- * @beta
3407
- */
3408
- function registerOnLoadHandler(handler) {
3409
- registerOnLoadHandlerHelper(handler, function () {
3410
- if (handler && !isSupported()) {
3411
- throw errorNotSupportedOnPlatform;
3412
- }
3413
- });
3414
- }
3415
- teamsCore.registerOnLoadHandler = registerOnLoadHandler;
3416
- /**
3417
- * @hidden
3418
- * Undocumented helper function with shared code between deprecated version and current version of the registerOnLoadHandler API.
3419
- *
3420
- * @internal
3421
- * Limited to Microsoft-internal use
3422
- *
3423
- * @param handler - The handler to invoke when the page is loaded.
3424
- * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
3425
- */
3426
- function registerOnLoadHandlerHelper(handler, versionSpecificHelper) {
3427
- // allow for registration cleanup even when not finished initializing
3428
- handler && ensureInitialized(runtime);
3429
- if (handler && versionSpecificHelper) {
3430
- versionSpecificHelper();
3431
- }
3432
- handlers_registerOnLoadHandler(handler);
3433
- }
3434
- teamsCore.registerOnLoadHandlerHelper = registerOnLoadHandlerHelper;
3435
- /**
3436
- * Registers a handler to be called before the page is unloaded.
3437
- *
3438
- * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/build-tabs-for-meeting?tabs=desktop%2Cmeeting-chat-view-desktop%2Cmeeting-stage-view-desktop%2Cchannel-meeting-desktop#app-caching)
3439
- * for a more detailed explanation about using this API.
3440
- *
3441
- * @param handler - The handler to invoke before the page is unloaded. If this handler returns true the page should
3442
- * invoke the readyToUnload function provided to it once it's ready to be unloaded.
3443
- *
3444
- * @beta
3445
- */
3446
- function registerBeforeUnloadHandler(handler) {
3447
- registerBeforeUnloadHandlerHelper(handler, function () {
3448
- if (handler && !isSupported()) {
3449
- throw errorNotSupportedOnPlatform;
3450
- }
3451
- });
3452
- }
3453
- teamsCore.registerBeforeUnloadHandler = registerBeforeUnloadHandler;
3454
- /**
3455
- * @hidden
3456
- * Undocumented helper function with shared code between deprecated version and current version of the registerBeforeUnloadHandler API.
3457
- *
3458
- * @internal
3459
- * Limited to Microsoft-internal use
3460
- *
3461
- * @param handler - - The handler to invoke before the page is unloaded. If this handler returns true the page should
3462
- * invoke the readyToUnload function provided to it once it's ready to be unloaded.
3463
- * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
3464
- */
3465
- function registerBeforeUnloadHandlerHelper(handler, versionSpecificHelper) {
3466
- // allow for registration cleanup even when not finished initializing
3467
- handler && ensureInitialized(runtime);
3468
- if (handler && versionSpecificHelper) {
3469
- versionSpecificHelper();
3470
- }
3471
- handlers_registerBeforeUnloadHandler(handler);
3472
- }
3473
- teamsCore.registerBeforeUnloadHandlerHelper = registerBeforeUnloadHandlerHelper;
3474
- /**
3475
- * Checks if teamsCore capability is supported by the host
3476
- *
3477
- * @returns boolean to represent whether the teamsCore capability is supported
3478
- *
3479
- * @throws Error if {@linkcode app.initialize} has not successfully completed
3480
- *
3481
- */
3482
- function isSupported() {
3483
- return ensureInitialized(runtime) && runtime.supports.teamsCore ? true : false;
3484
- }
3485
- teamsCore.isSupported = isSupported;
3486
- })(teamsCore || (teamsCore = {}));
3487
-
3488
3361
  ;// CONCATENATED MODULE: ./src/public/app.ts
3489
3362
  /* eslint-disable @typescript-eslint/no-empty-function */
3490
3363
  /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
@@ -3503,8 +3376,6 @@ var teamsCore;
3503
3376
 
3504
3377
 
3505
3378
 
3506
-
3507
-
3508
3379
  /**
3509
3380
  * Namespace to interact with app initialization and lifecycle.
3510
3381
  */
@@ -3713,24 +3584,7 @@ var app;
3713
3584
  if (!GlobalVars.initializeCalled) {
3714
3585
  return;
3715
3586
  }
3716
- if (GlobalVars.frameContext) {
3717
- /* eslint-disable strict-null-checks/all */ /* Fix tracked by 5730662 */
3718
- registerOnThemeChangeHandler(null);
3719
- pages.backStack.registerBackButtonHandler(null);
3720
- pages.registerFullScreenHandler(null);
3721
- teamsCore.registerBeforeUnloadHandler(null);
3722
- teamsCore.registerOnLoadHandler(null);
3723
- logs.registerGetLogHandler(null); /* Fix tracked by 5730662 */
3724
- /* eslint-enable strict-null-checks/all */
3725
- }
3726
- if (GlobalVars.frameContext === FrameContexts.settings) {
3727
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
3728
- pages.config.registerOnSaveHandler(null);
3729
- }
3730
- if (GlobalVars.frameContext === FrameContexts.remove) {
3731
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
3732
- pages.config.registerOnRemoveHandler(null);
3733
- }
3587
+ uninitializeHandlers();
3734
3588
  GlobalVars.initializeCalled = false;
3735
3589
  GlobalVars.initializeCompleted = false;
3736
3590
  GlobalVars.initializePromise = null;
@@ -4681,6 +4535,29 @@ var handlersLogger = getLogger('handlers');
4681
4535
  var HandlersPrivate = /** @class */ (function () {
4682
4536
  function HandlersPrivate() {
4683
4537
  }
4538
+ /**
4539
+ * @internal
4540
+ * Limited to Microsoft-internal use
4541
+ * Initializes the handlers.
4542
+ */
4543
+ HandlersPrivate.initializeHandlers = function () {
4544
+ // ::::::::::::::::::::MicrosoftTeams SDK Internal :::::::::::::::::
4545
+ HandlersPrivate.handlers['themeChange'] = handleThemeChange;
4546
+ HandlersPrivate.handlers['load'] = handleLoad;
4547
+ HandlersPrivate.handlers['beforeUnload'] = handleBeforeUnload;
4548
+ pages.backStack._initialize();
4549
+ };
4550
+ /**
4551
+ * @internal
4552
+ * Limited to Microsoft-internal use
4553
+ * Uninitializes the handlers.
4554
+ */
4555
+ HandlersPrivate.uninitializeHandlers = function () {
4556
+ HandlersPrivate.handlers = {};
4557
+ HandlersPrivate.themeChangeHandler = null;
4558
+ HandlersPrivate.loadHandler = null;
4559
+ HandlersPrivate.beforeUnloadHandler = null;
4560
+ };
4684
4561
  HandlersPrivate.handlers = {};
4685
4562
  return HandlersPrivate;
4686
4563
  }());
@@ -4689,11 +4566,14 @@ var HandlersPrivate = /** @class */ (function () {
4689
4566
  * Limited to Microsoft-internal use
4690
4567
  */
4691
4568
  function initializeHandlers() {
4692
- // ::::::::::::::::::::MicrosoftTeams SDK Internal :::::::::::::::::
4693
- HandlersPrivate.handlers['themeChange'] = handleThemeChange;
4694
- HandlersPrivate.handlers['load'] = handleLoad;
4695
- HandlersPrivate.handlers['beforeUnload'] = handleBeforeUnload;
4696
- pages.backStack._initialize();
4569
+ HandlersPrivate.initializeHandlers();
4570
+ }
4571
+ /**
4572
+ * @internal
4573
+ * Limited to Microsoft-internal use
4574
+ */
4575
+ function uninitializeHandlers() {
4576
+ HandlersPrivate.uninitializeHandlers();
4697
4577
  }
4698
4578
  var callHandlerLogger = handlersLogger.extend('callHandler');
4699
4579
  /**
@@ -7952,6 +7832,137 @@ var mail;
7952
7832
  })(ComposeMailType = mail.ComposeMailType || (mail.ComposeMailType = {}));
7953
7833
  })(mail || (mail = {}));
7954
7834
 
7835
+ ;// CONCATENATED MODULE: ./src/public/teamsAPIs.ts
7836
+
7837
+ // Conflict with some names
7838
+
7839
+
7840
+
7841
+
7842
+ /**
7843
+ * Namespace containing the set of APIs that support Teams-specific functionalities.
7844
+ */
7845
+ var teamsCore;
7846
+ (function (teamsCore) {
7847
+ /**
7848
+ * Enable print capability to support printing page using Ctrl+P and cmd+P
7849
+ */
7850
+ function enablePrintCapability() {
7851
+ if (!GlobalVars.printCapabilityEnabled) {
7852
+ ensureInitialized(runtime);
7853
+ if (!isSupported()) {
7854
+ throw errorNotSupportedOnPlatform;
7855
+ }
7856
+ GlobalVars.printCapabilityEnabled = true;
7857
+ // adding ctrl+P and cmd+P handler
7858
+ document.addEventListener('keydown', function (event) {
7859
+ if ((event.ctrlKey || event.metaKey) && event.keyCode === 80) {
7860
+ print();
7861
+ event.cancelBubble = true;
7862
+ event.preventDefault();
7863
+ event.stopImmediatePropagation();
7864
+ }
7865
+ });
7866
+ }
7867
+ }
7868
+ teamsCore.enablePrintCapability = enablePrintCapability;
7869
+ /**
7870
+ * default print handler
7871
+ */
7872
+ function print() {
7873
+ ssrSafeWindow().print();
7874
+ }
7875
+ teamsCore.print = print;
7876
+ /**
7877
+ * Registers a handler to be called when the page has been requested to load.
7878
+ *
7879
+ * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/build-tabs-for-meeting?tabs=desktop%2Cmeeting-chat-view-desktop%2Cmeeting-stage-view-desktop%2Cchannel-meeting-desktop#app-caching)
7880
+ * for a more detailed explanation about using this API.
7881
+ *
7882
+ * @param handler - The handler to invoke when the page is loaded.
7883
+ *
7884
+ * @beta
7885
+ */
7886
+ function registerOnLoadHandler(handler) {
7887
+ registerOnLoadHandlerHelper(handler, function () {
7888
+ if (handler && !isSupported()) {
7889
+ throw errorNotSupportedOnPlatform;
7890
+ }
7891
+ });
7892
+ }
7893
+ teamsCore.registerOnLoadHandler = registerOnLoadHandler;
7894
+ /**
7895
+ * @hidden
7896
+ * Undocumented helper function with shared code between deprecated version and current version of the registerOnLoadHandler API.
7897
+ *
7898
+ * @internal
7899
+ * Limited to Microsoft-internal use
7900
+ *
7901
+ * @param handler - The handler to invoke when the page is loaded.
7902
+ * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
7903
+ */
7904
+ function registerOnLoadHandlerHelper(handler, versionSpecificHelper) {
7905
+ // allow for registration cleanup even when not finished initializing
7906
+ handler && ensureInitialized(runtime);
7907
+ if (handler && versionSpecificHelper) {
7908
+ versionSpecificHelper();
7909
+ }
7910
+ handlers_registerOnLoadHandler(handler);
7911
+ }
7912
+ teamsCore.registerOnLoadHandlerHelper = registerOnLoadHandlerHelper;
7913
+ /**
7914
+ * Registers a handler to be called before the page is unloaded.
7915
+ *
7916
+ * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/build-tabs-for-meeting?tabs=desktop%2Cmeeting-chat-view-desktop%2Cmeeting-stage-view-desktop%2Cchannel-meeting-desktop#app-caching)
7917
+ * for a more detailed explanation about using this API.
7918
+ *
7919
+ * @param handler - The handler to invoke before the page is unloaded. If this handler returns true the page should
7920
+ * invoke the readyToUnload function provided to it once it's ready to be unloaded.
7921
+ *
7922
+ * @beta
7923
+ */
7924
+ function registerBeforeUnloadHandler(handler) {
7925
+ registerBeforeUnloadHandlerHelper(handler, function () {
7926
+ if (handler && !isSupported()) {
7927
+ throw errorNotSupportedOnPlatform;
7928
+ }
7929
+ });
7930
+ }
7931
+ teamsCore.registerBeforeUnloadHandler = registerBeforeUnloadHandler;
7932
+ /**
7933
+ * @hidden
7934
+ * Undocumented helper function with shared code between deprecated version and current version of the registerBeforeUnloadHandler API.
7935
+ *
7936
+ * @internal
7937
+ * Limited to Microsoft-internal use
7938
+ *
7939
+ * @param handler - - The handler to invoke before the page is unloaded. If this handler returns true the page should
7940
+ * invoke the readyToUnload function provided to it once it's ready to be unloaded.
7941
+ * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
7942
+ */
7943
+ function registerBeforeUnloadHandlerHelper(handler, versionSpecificHelper) {
7944
+ // allow for registration cleanup even when not finished initializing
7945
+ handler && ensureInitialized(runtime);
7946
+ if (handler && versionSpecificHelper) {
7947
+ versionSpecificHelper();
7948
+ }
7949
+ handlers_registerBeforeUnloadHandler(handler);
7950
+ }
7951
+ teamsCore.registerBeforeUnloadHandlerHelper = registerBeforeUnloadHandlerHelper;
7952
+ /**
7953
+ * Checks if teamsCore capability is supported by the host
7954
+ *
7955
+ * @returns boolean to represent whether the teamsCore capability is supported
7956
+ *
7957
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
7958
+ *
7959
+ */
7960
+ function isSupported() {
7961
+ return ensureInitialized(runtime) && runtime.supports.teamsCore ? true : false;
7962
+ }
7963
+ teamsCore.isSupported = isSupported;
7964
+ })(teamsCore || (teamsCore = {}));
7965
+
7955
7966
  ;// CONCATENATED MODULE: ./src/public/people.ts
7956
7967
 
7957
7968