@microsoft/teams-js 2.0.0-beta.6-dev.14 → 2.0.0-beta.6-dev.15

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.
@@ -1122,7 +1122,7 @@ __webpack_require__.d(__webpack_exports__, {
1122
1122
  });
1123
1123
 
1124
1124
  ;// CONCATENATED MODULE: ./src/internal/constants.ts
1125
- var version = "2.0.0-beta.6-dev.14";
1125
+ var version = "2.0.0-beta.6-dev.15";
1126
1126
  /**
1127
1127
  * @hidden
1128
1128
  * The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
@@ -3370,6 +3370,9 @@ var pages;
3370
3370
  */
3371
3371
  function returnFocus(navigateForward) {
3372
3372
  ensureInitialized();
3373
+ if (!isSupported()) {
3374
+ throw errorNotSupportedOnPlatform;
3375
+ }
3373
3376
  sendMessageToParent('returnFocus', [navigateForward]);
3374
3377
  }
3375
3378
  pages.returnFocus = returnFocus;
@@ -3383,11 +3386,17 @@ var pages;
3383
3386
  */
3384
3387
  function registerFocusEnterHandler(handler) {
3385
3388
  ensureInitialized();
3389
+ if (!isSupported()) {
3390
+ throw errorNotSupportedOnPlatform;
3391
+ }
3386
3392
  registerHandler('focusEnter', handler);
3387
3393
  }
3388
3394
  pages.registerFocusEnterHandler = registerFocusEnterHandler;
3389
3395
  function setCurrentFrame(frameInfo) {
3390
3396
  ensureInitialized(FrameContexts.content);
3397
+ if (!isSupported()) {
3398
+ throw errorNotSupportedOnPlatform;
3399
+ }
3391
3400
  sendMessageToParent('setFrameContext', [frameInfo]);
3392
3401
  }
3393
3402
  pages.setCurrentFrame = setCurrentFrame;
@@ -3403,6 +3412,9 @@ var pages;
3403
3412
  function getConfig() {
3404
3413
  return new Promise(function (resolve) {
3405
3414
  ensureInitialized(FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
3415
+ if (!isSupported()) {
3416
+ throw errorNotSupportedOnPlatform;
3417
+ }
3406
3418
  resolve(sendAndUnwrap('settings.getSettings'));
3407
3419
  });
3408
3420
  }
@@ -3419,6 +3431,9 @@ var pages;
3419
3431
  function navigateCrossDomain(url) {
3420
3432
  return new Promise(function (resolve) {
3421
3433
  ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
3434
+ if (!isSupported()) {
3435
+ throw errorNotSupportedOnPlatform;
3436
+ }
3422
3437
  var errorMessage = 'Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.';
3423
3438
  resolve(sendAndHandleStatusAndReasonWithDefaultError('navigateCrossDomain', errorMessage, url));
3424
3439
  });
@@ -3436,6 +3451,9 @@ var pages;
3436
3451
  function navigateToApp(params) {
3437
3452
  return new Promise(function (resolve) {
3438
3453
  ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
3454
+ if (!isSupported()) {
3455
+ throw errorNotSupportedOnPlatform;
3456
+ }
3439
3457
  if (runtime.isLegacyTeams) {
3440
3458
  resolve(sendAndHandleStatusAndReason('executeDeepLink', createTeamsAppLink(params)));
3441
3459
  }
@@ -3452,6 +3470,9 @@ var pages;
3452
3470
  */
3453
3471
  function shareDeepLink(deepLinkParameters) {
3454
3472
  ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3473
+ if (!isSupported()) {
3474
+ throw errorNotSupportedOnPlatform;
3475
+ }
3455
3476
  sendMessageToParent('shareDeepLink', [
3456
3477
  deepLinkParameters.subPageId,
3457
3478
  deepLinkParameters.subPageLabel,
@@ -3466,6 +3487,9 @@ var pages;
3466
3487
  */
3467
3488
  function registerFullScreenHandler(handler) {
3468
3489
  ensureInitialized();
3490
+ if (!isSupported()) {
3491
+ throw errorNotSupportedOnPlatform;
3492
+ }
3469
3493
  registerHandler('fullScreenChange', handler);
3470
3494
  }
3471
3495
  pages.registerFullScreenHandler = registerFullScreenHandler;
@@ -3489,6 +3513,9 @@ var pages;
3489
3513
  function navigateToTab(tabInstance) {
3490
3514
  return new Promise(function (resolve) {
3491
3515
  ensureInitialized();
3516
+ if (!isSupported()) {
3517
+ throw errorNotSupportedOnPlatform;
3518
+ }
3492
3519
  var errorMessage = 'Invalid internalTabInstanceId and/or channelId were/was provided';
3493
3520
  resolve(sendAndHandleStatusAndReasonWithDefaultError('navigateToTab', errorMessage, tabInstance));
3494
3521
  });
@@ -3503,6 +3530,9 @@ var pages;
3503
3530
  function getTabInstances(tabInstanceParameters) {
3504
3531
  return new Promise(function (resolve) {
3505
3532
  ensureInitialized();
3533
+ if (!isSupported()) {
3534
+ throw errorNotSupportedOnPlatform;
3535
+ }
3506
3536
  resolve(sendAndUnwrap('getTabInstances', tabInstanceParameters));
3507
3537
  });
3508
3538
  }
@@ -3515,6 +3545,9 @@ var pages;
3515
3545
  function getMruTabInstances(tabInstanceParameters) {
3516
3546
  return new Promise(function (resolve) {
3517
3547
  ensureInitialized();
3548
+ if (!isSupported()) {
3549
+ throw errorNotSupportedOnPlatform;
3550
+ }
3518
3551
  resolve(sendAndUnwrap('getMruTabInstances', tabInstanceParameters));
3519
3552
  });
3520
3553
  }
@@ -3547,6 +3580,9 @@ var pages;
3547
3580
  */
3548
3581
  function setValidityState(validityState) {
3549
3582
  ensureInitialized(FrameContexts.settings, FrameContexts.remove);
3583
+ if (!isSupported()) {
3584
+ throw errorNotSupportedOnPlatform;
3585
+ }
3550
3586
  sendMessageToParent('settings.setValidityState', [validityState]);
3551
3587
  }
3552
3588
  config.setValidityState = setValidityState;
@@ -3559,6 +3595,9 @@ var pages;
3559
3595
  function setConfig(instanceConfig) {
3560
3596
  return new Promise(function (resolve) {
3561
3597
  ensureInitialized(FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
3598
+ if (!isSupported()) {
3599
+ throw errorNotSupportedOnPlatform;
3600
+ }
3562
3601
  resolve(sendAndHandleStatusAndReason('settings.setSettings', instanceConfig));
3563
3602
  });
3564
3603
  }
@@ -3572,6 +3611,9 @@ var pages;
3572
3611
  */
3573
3612
  function registerOnSaveHandler(handler) {
3574
3613
  ensureInitialized(FrameContexts.settings);
3614
+ if (!isSupported()) {
3615
+ throw errorNotSupportedOnPlatform;
3616
+ }
3575
3617
  saveHandler = handler;
3576
3618
  handler && sendMessageToParent('registerHandler', ['save']);
3577
3619
  }
@@ -3585,6 +3627,9 @@ var pages;
3585
3627
  */
3586
3628
  function registerOnRemoveHandler(handler) {
3587
3629
  ensureInitialized(FrameContexts.remove, FrameContexts.settings);
3630
+ if (!isSupported()) {
3631
+ throw errorNotSupportedOnPlatform;
3632
+ }
3588
3633
  removeHandler = handler;
3589
3634
  handler && sendMessageToParent('registerHandler', ['remove']);
3590
3635
  }
@@ -3605,6 +3650,9 @@ var pages;
3605
3650
  */
3606
3651
  function registerChangeConfigHandler(handler) {
3607
3652
  ensureInitialized(FrameContexts.content);
3653
+ if (!isSupported()) {
3654
+ throw errorNotSupportedOnPlatform;
3655
+ }
3608
3656
  registerHandler('changeSettings', handler);
3609
3657
  }
3610
3658
  config.registerChangeConfigHandler = registerChangeConfigHandler;
@@ -3695,6 +3743,9 @@ var pages;
3695
3743
  function navigateBack() {
3696
3744
  return new Promise(function (resolve) {
3697
3745
  ensureInitialized();
3746
+ if (!isSupported()) {
3747
+ throw errorNotSupportedOnPlatform;
3748
+ }
3698
3749
  var errorMessage = 'Back navigation is not supported in the current client or context.';
3699
3750
  resolve(sendAndHandleStatusAndReasonWithDefaultError('navigateBack', errorMessage));
3700
3751
  });
@@ -3708,6 +3759,10 @@ var pages;
3708
3759
  * @param handler The handler to invoke when the user presses their Team client's back button.
3709
3760
  */
3710
3761
  function registerBackButtonHandler(handler) {
3762
+ ensureInitialized();
3763
+ if (!isSupported()) {
3764
+ throw errorNotSupportedOnPlatform;
3765
+ }
3711
3766
  backButtonPressHandler = handler;
3712
3767
  handler && sendMessageToParent('registerHandler', ['backButton']);
3713
3768
  }
@@ -3735,6 +3790,9 @@ var pages;
3735
3790
  */
3736
3791
  function enterFullscreen() {
3737
3792
  ensureInitialized(FrameContexts.content);
3793
+ if (!isSupported()) {
3794
+ throw errorNotSupportedOnPlatform;
3795
+ }
3738
3796
  sendMessageToParent('enterFullscreen', []);
3739
3797
  }
3740
3798
  fullTrust.enterFullscreen = enterFullscreen;
@@ -3746,6 +3804,9 @@ var pages;
3746
3804
  */
3747
3805
  function exitFullscreen() {
3748
3806
  ensureInitialized(FrameContexts.content);
3807
+ if (!isSupported()) {
3808
+ throw errorNotSupportedOnPlatform;
3809
+ }
3749
3810
  sendMessageToParent('exitFullscreen', []);
3750
3811
  }
3751
3812
  fullTrust.exitFullscreen = exitFullscreen;
@@ -3769,6 +3830,9 @@ var pages;
3769
3830
  */
3770
3831
  function onClick(handler) {
3771
3832
  ensureInitialized(FrameContexts.content);
3833
+ if (!isSupported()) {
3834
+ throw errorNotSupportedOnPlatform;
3835
+ }
3772
3836
  registerHandler('appButtonClick', handler);
3773
3837
  }
3774
3838
  appButton.onClick = onClick;
@@ -3779,6 +3843,9 @@ var pages;
3779
3843
  */
3780
3844
  function onHoverEnter(handler) {
3781
3845
  ensureInitialized(FrameContexts.content);
3846
+ if (!isSupported()) {
3847
+ throw errorNotSupportedOnPlatform;
3848
+ }
3782
3849
  registerHandler('appButtonHoverEnter', handler);
3783
3850
  }
3784
3851
  appButton.onHoverEnter = onHoverEnter;
@@ -3789,6 +3856,9 @@ var pages;
3789
3856
  */
3790
3857
  function onHoverLeave(handler) {
3791
3858
  ensureInitialized(FrameContexts.content);
3859
+ if (!isSupported()) {
3860
+ throw errorNotSupportedOnPlatform;
3861
+ }
3792
3862
  registerHandler('appButtonHoverLeave', handler);
3793
3863
  }
3794
3864
  appButton.onHoverLeave = onHoverLeave;