@microsoft/teams-js 2.4.2 → 2.5.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.
- package/dist/MicrosoftTeams.d.ts +284 -14
- package/dist/MicrosoftTeams.js +314 -61
- package/dist/MicrosoftTeams.js.map +1 -1
- package/dist/MicrosoftTeams.min.js +1 -1
- package/dist/MicrosoftTeams.min.js.map +1 -1
- package/package.json +1 -34
package/dist/MicrosoftTeams.js
CHANGED
@@ -1046,17 +1046,20 @@ __webpack_require__.d(__webpack_exports__, {
|
|
1046
1046
|
"ActionObjectType": () => (/* reexport */ ActionObjectType),
|
1047
1047
|
"ChannelType": () => (/* reexport */ ChannelType),
|
1048
1048
|
"ChildAppWindow": () => (/* reexport */ ChildAppWindow),
|
1049
|
+
"ContainerState": () => (/* reexport */ ContainerState),
|
1049
1050
|
"DialogDimension": () => (/* reexport */ DialogDimension),
|
1050
1051
|
"ErrorCode": () => (/* reexport */ ErrorCode),
|
1051
1052
|
"FileOpenPreference": () => (/* reexport */ FileOpenPreference),
|
1052
1053
|
"FrameContexts": () => (/* reexport */ FrameContexts),
|
1053
1054
|
"HostClientType": () => (/* reexport */ HostClientType),
|
1054
1055
|
"HostName": () => (/* reexport */ HostName),
|
1056
|
+
"LiveShareHost": () => (/* reexport */ LiveShareHost),
|
1055
1057
|
"NotificationTypes": () => (/* reexport */ NotificationTypes),
|
1056
1058
|
"ParentAppWindow": () => (/* reexport */ ParentAppWindow),
|
1057
1059
|
"SecondaryM365ContentIdName": () => (/* reexport */ SecondaryM365ContentIdName),
|
1058
1060
|
"TaskModuleDimension": () => (/* reexport */ TaskModuleDimension),
|
1059
1061
|
"TeamType": () => (/* reexport */ TeamType),
|
1062
|
+
"UserMeetingRole": () => (/* reexport */ UserMeetingRole),
|
1060
1063
|
"UserSettingTypes": () => (/* reexport */ UserSettingTypes),
|
1061
1064
|
"UserTeamRole": () => (/* reexport */ UserTeamRole),
|
1062
1065
|
"ViewerActionTypes": () => (/* reexport */ ViewerActionTypes),
|
@@ -1130,7 +1133,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
1130
1133
|
});
|
1131
1134
|
|
1132
1135
|
;// CONCATENATED MODULE: ./src/public/version.ts
|
1133
|
-
var version = "2.
|
1136
|
+
var version = "2.5.0-beta.0";
|
1134
1137
|
|
1135
1138
|
;// CONCATENATED MODULE: ./src/internal/globalVars.ts
|
1136
1139
|
var GlobalVars = /** @class */ (function () {
|
@@ -1478,12 +1481,14 @@ var validOrigins = [
|
|
1478
1481
|
'outlook.office365.com',
|
1479
1482
|
'outlook-sdf.office365.com',
|
1480
1483
|
'*.teams.microsoft.com',
|
1484
|
+
'*.www.office.com',
|
1481
1485
|
'www.office.com',
|
1482
1486
|
'word.office.com',
|
1483
1487
|
'excel.office.com',
|
1484
1488
|
'powerpoint.office.com',
|
1485
1489
|
'www.officeppe.com',
|
1486
|
-
'*.www.
|
1490
|
+
'*.www.microsoft365.com',
|
1491
|
+
'www.microsoft365.com',
|
1487
1492
|
];
|
1488
1493
|
/**
|
1489
1494
|
* @hidden
|
@@ -1510,6 +1515,21 @@ var teamsDeepLinkProtocol = 'https';
|
|
1510
1515
|
*/
|
1511
1516
|
var teamsDeepLinkHost = 'teams.microsoft.com';
|
1512
1517
|
|
1518
|
+
// EXTERNAL MODULE: ./node_modules/debug/src/browser.js
|
1519
|
+
var browser = __webpack_require__(227);
|
1520
|
+
;// CONCATENATED MODULE: ./src/internal/telemetry.ts
|
1521
|
+
|
1522
|
+
var topLevelLogger = (0,browser.debug)('teamsJs');
|
1523
|
+
/**
|
1524
|
+
* @internal
|
1525
|
+
* Limited to Microsoft-internal use
|
1526
|
+
*
|
1527
|
+
* Returns a logger for a given namespace, within the pre-defined top-level teamsJs namespace
|
1528
|
+
*/
|
1529
|
+
function getLogger(namespace) {
|
1530
|
+
return topLevelLogger.extend(namespace);
|
1531
|
+
}
|
1532
|
+
|
1513
1533
|
// EXTERNAL MODULE: ../../node_modules/uuid/index.js
|
1514
1534
|
var uuid = __webpack_require__(22);
|
1515
1535
|
;// CONCATENATED MODULE: ./src/internal/utils.ts
|
@@ -1843,7 +1863,33 @@ function createTeamsAppLink(params) {
|
|
1843
1863
|
|
1844
1864
|
|
1845
1865
|
|
1866
|
+
|
1867
|
+
var internalLogger = getLogger('internal');
|
1868
|
+
var ensureInitializeCalledLogger = internalLogger.extend('ensureInitializeCalled');
|
1869
|
+
var ensureInitializedLogger = internalLogger.extend('ensureInitialized');
|
1846
1870
|
/**
|
1871
|
+
* Ensures `initialize` was called. This function does NOT verify that a response from Host was received and initialization completed.
|
1872
|
+
*
|
1873
|
+
* `ensureInitializeCalled` should only be used for APIs which:
|
1874
|
+
* - work in all FrameContexts
|
1875
|
+
* - are part of a required Capability
|
1876
|
+
* - are suspected to be used directly after calling `initialize`, potentially without awaiting the `initialize` call itself
|
1877
|
+
*
|
1878
|
+
* For most APIs {@link ensureInitialized} is the right validation function to use instead.
|
1879
|
+
*
|
1880
|
+
* @internal
|
1881
|
+
* Limited to Microsoft-internal use
|
1882
|
+
*/
|
1883
|
+
function ensureInitializeCalled() {
|
1884
|
+
if (!GlobalVars.initializeCalled) {
|
1885
|
+
ensureInitializeCalledLogger('The library has not yet been initialized.');
|
1886
|
+
throw new Error('The library has not yet been initialized');
|
1887
|
+
}
|
1888
|
+
}
|
1889
|
+
/**
|
1890
|
+
* Ensures `initialize` was called and response from Host was received and processed.
|
1891
|
+
* If expected FrameContexts are provided, it also validates that the current FrameContext matches one of the expected ones.
|
1892
|
+
*
|
1847
1893
|
* @internal
|
1848
1894
|
* Limited to Microsoft-internal use
|
1849
1895
|
*/
|
@@ -1852,10 +1898,11 @@ function ensureInitialized() {
|
|
1852
1898
|
for (var _i = 0; _i < arguments.length; _i++) {
|
1853
1899
|
expectedFrameContexts[_i] = arguments[_i];
|
1854
1900
|
}
|
1855
|
-
if (!GlobalVars.
|
1901
|
+
if (!GlobalVars.initializeCompleted) {
|
1902
|
+
ensureInitializedLogger('The library has not yet been initialized. initializeCalled: %s', GlobalVars.initializeCalled.toString());
|
1856
1903
|
throw new Error('The library has not yet been initialized');
|
1857
1904
|
}
|
1858
|
-
if (
|
1905
|
+
if (expectedFrameContexts && expectedFrameContexts.length > 0) {
|
1859
1906
|
var found = false;
|
1860
1907
|
for (var i = 0; i < expectedFrameContexts.length; i++) {
|
1861
1908
|
if (expectedFrameContexts[i] === GlobalVars.frameContext) {
|
@@ -1940,21 +1987,6 @@ function processAdditionalValidOrigins(validMessageOrigins) {
|
|
1940
1987
|
GlobalVars.additionalValidOrigins = combinedOriginUrls;
|
1941
1988
|
}
|
1942
1989
|
|
1943
|
-
// EXTERNAL MODULE: ./node_modules/debug/src/browser.js
|
1944
|
-
var browser = __webpack_require__(227);
|
1945
|
-
;// CONCATENATED MODULE: ./src/internal/telemetry.ts
|
1946
|
-
|
1947
|
-
var topLevelLogger = (0,browser.debug)('teamsJs');
|
1948
|
-
/**
|
1949
|
-
* @internal
|
1950
|
-
* Limited to Microsoft-internal use
|
1951
|
-
*
|
1952
|
-
* Returns a logger for a given namespace, within the pre-defined top-level teamsJs namespace
|
1953
|
-
*/
|
1954
|
-
function getLogger(namespace) {
|
1955
|
-
return topLevelLogger.extend(namespace);
|
1956
|
-
}
|
1957
|
-
|
1958
1990
|
;// CONCATENATED MODULE: ./src/public/authentication.ts
|
1959
1991
|
|
1960
1992
|
|
@@ -1965,8 +1997,6 @@ function getLogger(namespace) {
|
|
1965
1997
|
* Namespace to interact with the authentication-specific part of the SDK.
|
1966
1998
|
*
|
1967
1999
|
* This object is used for starting or completing authentication flows.
|
1968
|
-
*
|
1969
|
-
* @beta
|
1970
2000
|
*/
|
1971
2001
|
var authentication;
|
1972
2002
|
(function (authentication) {
|
@@ -2069,7 +2099,7 @@ var authentication;
|
|
2069
2099
|
});
|
2070
2100
|
}
|
2071
2101
|
function getAuthToken(authTokenRequest) {
|
2072
|
-
|
2102
|
+
ensureInitializeCalled();
|
2073
2103
|
return getAuthTokenHelper(authTokenRequest)
|
2074
2104
|
.then(function (value) {
|
2075
2105
|
if (authTokenRequest && authTokenRequest.successCallback) {
|
@@ -2105,7 +2135,7 @@ var authentication;
|
|
2105
2135
|
});
|
2106
2136
|
}
|
2107
2137
|
function getUser(userRequest) {
|
2108
|
-
|
2138
|
+
ensureInitializeCalled();
|
2109
2139
|
return getUserHelper()
|
2110
2140
|
.then(function (value) {
|
2111
2141
|
if (userRequest && userRequest.successCallback) {
|
@@ -2477,6 +2507,10 @@ var versionConstants = {
|
|
2477
2507
|
capability: { webStorage: {} },
|
2478
2508
|
hostClientTypes: [HostClientType.desktop],
|
2479
2509
|
},
|
2510
|
+
{
|
2511
|
+
capability: { profile: {} },
|
2512
|
+
hostClientTypes: [HostClientType.desktop, HostClientType.web],
|
2513
|
+
},
|
2480
2514
|
],
|
2481
2515
|
'2.0.5': [
|
2482
2516
|
{
|
@@ -2572,6 +2606,8 @@ var dialog;
|
|
2572
2606
|
* Function is called during app initialization
|
2573
2607
|
* @internal
|
2574
2608
|
* Limited to Microsoft-internal use
|
2609
|
+
*
|
2610
|
+
* @beta
|
2575
2611
|
*/
|
2576
2612
|
function initialize() {
|
2577
2613
|
registerHandler('messageForChild', handleDialogMessage, false);
|
@@ -2601,6 +2637,8 @@ var dialog;
|
|
2601
2637
|
* @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.
|
2602
2638
|
*
|
2603
2639
|
* @returns a function that can be used to send messages to the dialog.
|
2640
|
+
*
|
2641
|
+
* @beta
|
2604
2642
|
*/
|
2605
2643
|
function open(urlDialogInfo, submitHandler, messageFromChildHandler) {
|
2606
2644
|
ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
@@ -2620,8 +2658,12 @@ var dialog;
|
|
2620
2658
|
/**
|
2621
2659
|
* Submit the dialog module and close the dialog
|
2622
2660
|
*
|
2623
|
-
* @param result - The result to be sent to the bot or the app. Typically a JSON object or a serialized version of it
|
2661
|
+
* @param result - The result to be sent to the bot or the app. Typically a JSON object or a serialized version of it,
|
2662
|
+
* If this function is called from a dialog while {@link M365ContentAction} is set in the context object by the host, result will be ignored
|
2663
|
+
*
|
2624
2664
|
* @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.
|
2665
|
+
*
|
2666
|
+
* @beta
|
2625
2667
|
*/
|
2626
2668
|
function submit(result, appIds) {
|
2627
2669
|
ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);
|
@@ -2639,6 +2681,8 @@ var dialog;
|
|
2639
2681
|
* This function is only called from inside of a dialog
|
2640
2682
|
*
|
2641
2683
|
* @param message - The message to send to the parent
|
2684
|
+
*
|
2685
|
+
* @beta
|
2642
2686
|
*/
|
2643
2687
|
function sendMessageToParentFromDialog(
|
2644
2688
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
@@ -2654,6 +2698,8 @@ var dialog;
|
|
2654
2698
|
* Send message to the dialog from the parent
|
2655
2699
|
*
|
2656
2700
|
* @param message - The message to send
|
2701
|
+
*
|
2702
|
+
* @beta
|
2657
2703
|
*/
|
2658
2704
|
function sendMessageToDialog(
|
2659
2705
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
@@ -2672,6 +2718,8 @@ var dialog;
|
|
2672
2718
|
* This function is only called from inside of a dialog.
|
2673
2719
|
*
|
2674
2720
|
* @param listener - The listener that will be triggered.
|
2721
|
+
*
|
2722
|
+
* @beta
|
2675
2723
|
*/
|
2676
2724
|
function registerOnMessageFromParent(listener) {
|
2677
2725
|
ensureInitialized(FrameContexts.task);
|
@@ -2694,6 +2742,8 @@ var dialog;
|
|
2694
2742
|
* Checks if dialog module is supported by the host
|
2695
2743
|
*
|
2696
2744
|
* @returns boolean to represent whether dialog module is supported
|
2745
|
+
*
|
2746
|
+
* @beta
|
2697
2747
|
*/
|
2698
2748
|
function isSupported() {
|
2699
2749
|
return runtime.supports.dialog ? true : false;
|
@@ -2701,6 +2751,8 @@ var dialog;
|
|
2701
2751
|
dialog.isSupported = isSupported;
|
2702
2752
|
/**
|
2703
2753
|
* Namespace to update the dialog
|
2754
|
+
*
|
2755
|
+
* @beta
|
2704
2756
|
*/
|
2705
2757
|
var update;
|
2706
2758
|
(function (update) {
|
@@ -2708,6 +2760,8 @@ var dialog;
|
|
2708
2760
|
* Update dimensions - height/width of a dialog.
|
2709
2761
|
*
|
2710
2762
|
* @param dimensions - An object containing width and height properties.
|
2763
|
+
*
|
2764
|
+
* @beta
|
2711
2765
|
*/
|
2712
2766
|
function resize(dimensions) {
|
2713
2767
|
ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);
|
@@ -2721,6 +2775,8 @@ var dialog;
|
|
2721
2775
|
* Checks if dialog.update capability is supported by the host
|
2722
2776
|
*
|
2723
2777
|
* @returns boolean to represent whether dialog.update is supported
|
2778
|
+
*
|
2779
|
+
* @beta
|
2724
2780
|
*/
|
2725
2781
|
function isSupported() {
|
2726
2782
|
return runtime.supports.dialog ? (runtime.supports.dialog.update ? true : false) : false;
|
@@ -2729,6 +2785,8 @@ var dialog;
|
|
2729
2785
|
})(update = dialog.update || (dialog.update = {}));
|
2730
2786
|
/**
|
2731
2787
|
* Namespace to open a dialog that sends results to the bot framework
|
2788
|
+
*
|
2789
|
+
* @beta
|
2732
2790
|
*/
|
2733
2791
|
var bot;
|
2734
2792
|
(function (bot) {
|
@@ -2740,6 +2798,8 @@ var dialog;
|
|
2740
2798
|
* @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.
|
2741
2799
|
*
|
2742
2800
|
* @returns a function that can be used to send messages to the dialog.
|
2801
|
+
*
|
2802
|
+
* @beta
|
2743
2803
|
*/
|
2744
2804
|
function open(botUrlDialogInfo, submitHandler, messageFromChildHandler) {
|
2745
2805
|
ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
@@ -2760,6 +2820,8 @@ var dialog;
|
|
2760
2820
|
* Checks if dialog.bot capability is supported by the host
|
2761
2821
|
*
|
2762
2822
|
* @returns boolean to represent whether dialog.bot is supported
|
2823
|
+
*
|
2824
|
+
* @beta
|
2763
2825
|
*/
|
2764
2826
|
function isSupported() {
|
2765
2827
|
return runtime.supports.dialog ? (runtime.supports.dialog.bot ? true : false) : false;
|
@@ -2773,6 +2835,8 @@ var dialog;
|
|
2773
2835
|
*
|
2774
2836
|
* @internal
|
2775
2837
|
* Limited to Microsoft-internal use
|
2838
|
+
*
|
2839
|
+
* @beta
|
2776
2840
|
*/
|
2777
2841
|
function getDialogInfoFromUrlDialogInfo(urlDialogInfo) {
|
2778
2842
|
var dialogInfo = {
|
@@ -2792,6 +2856,8 @@ var dialog;
|
|
2792
2856
|
*
|
2793
2857
|
* @internal
|
2794
2858
|
* Limited to Microsoft-internal use
|
2859
|
+
*
|
2860
|
+
* @beta
|
2795
2861
|
*/
|
2796
2862
|
function getDialogInfoFromBotUrlDialogInfo(botUrlDialogInfo) {
|
2797
2863
|
var dialogInfo = {
|
@@ -3013,7 +3079,8 @@ var teamsCore;
|
|
3013
3079
|
* @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
|
3014
3080
|
*/
|
3015
3081
|
function registerOnLoadHandlerHelper(handler, versionSpecificHelper) {
|
3016
|
-
|
3082
|
+
// allow for registration cleanup even when not finished initializing
|
3083
|
+
handler && ensureInitialized();
|
3017
3084
|
if (versionSpecificHelper) {
|
3018
3085
|
versionSpecificHelper();
|
3019
3086
|
}
|
@@ -3049,7 +3116,8 @@ var teamsCore;
|
|
3049
3116
|
* @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
|
3050
3117
|
*/
|
3051
3118
|
function registerBeforeUnloadHandlerHelper(handler, versionSpecificHelper) {
|
3052
|
-
|
3119
|
+
// allow for registration cleanup even when not finished initializing
|
3120
|
+
handler && ensureInitialized();
|
3053
3121
|
if (versionSpecificHelper) {
|
3054
3122
|
versionSpecificHelper();
|
3055
3123
|
}
|
@@ -3089,8 +3157,6 @@ var teamsCore;
|
|
3089
3157
|
|
3090
3158
|
/**
|
3091
3159
|
* Namespace to interact with app initialization and lifecycle.
|
3092
|
-
*
|
3093
|
-
* @beta
|
3094
3160
|
*/
|
3095
3161
|
var app_app;
|
3096
3162
|
(function (app) {
|
@@ -3152,7 +3218,7 @@ var app_app;
|
|
3152
3218
|
* @returns whether the Teams client SDK has been initialized.
|
3153
3219
|
*/
|
3154
3220
|
function isInitialized() {
|
3155
|
-
return GlobalVars.
|
3221
|
+
return GlobalVars.initializeCompleted;
|
3156
3222
|
}
|
3157
3223
|
app.isInitialized = isInitialized;
|
3158
3224
|
/**
|
@@ -3318,7 +3384,7 @@ var app_app;
|
|
3318
3384
|
*/
|
3319
3385
|
function getContext() {
|
3320
3386
|
return new Promise(function (resolve) {
|
3321
|
-
|
3387
|
+
ensureInitializeCalled();
|
3322
3388
|
resolve(sendAndUnwrap('getContext'));
|
3323
3389
|
}).then(function (legacyContext) { return transformLegacyContextToAppContext(legacyContext); }); // converts globalcontext to app.context
|
3324
3390
|
}
|
@@ -3327,7 +3393,7 @@ var app_app;
|
|
3327
3393
|
* Notifies the frame that app has loaded and to hide the loading indicator if one is shown.
|
3328
3394
|
*/
|
3329
3395
|
function notifyAppLoaded() {
|
3330
|
-
|
3396
|
+
ensureInitializeCalled();
|
3331
3397
|
sendMessageToParent(app.Messages.AppLoaded, [version]);
|
3332
3398
|
}
|
3333
3399
|
app.notifyAppLoaded = notifyAppLoaded;
|
@@ -3335,7 +3401,7 @@ var app_app;
|
|
3335
3401
|
* Notifies the frame that app initialization is successful and is ready for user interaction.
|
3336
3402
|
*/
|
3337
3403
|
function notifySuccess() {
|
3338
|
-
|
3404
|
+
ensureInitializeCalled();
|
3339
3405
|
sendMessageToParent(app.Messages.Success, [version]);
|
3340
3406
|
}
|
3341
3407
|
app.notifySuccess = notifySuccess;
|
@@ -3346,7 +3412,7 @@ var app_app;
|
|
3346
3412
|
* during initialization as well as an optional message.
|
3347
3413
|
*/
|
3348
3414
|
function notifyFailure(appInitializationFailedRequest) {
|
3349
|
-
|
3415
|
+
ensureInitializeCalled();
|
3350
3416
|
sendMessageToParent(app.Messages.Failure, [
|
3351
3417
|
appInitializationFailedRequest.reason,
|
3352
3418
|
appInitializationFailedRequest.message,
|
@@ -3359,7 +3425,7 @@ var app_app;
|
|
3359
3425
|
* @param expectedFailureRequest - The expected failure request containing the reason and an optional message
|
3360
3426
|
*/
|
3361
3427
|
function notifyExpectedFailure(expectedFailureRequest) {
|
3362
|
-
|
3428
|
+
ensureInitializeCalled();
|
3363
3429
|
sendMessageToParent(app.Messages.ExpectedFailure, [expectedFailureRequest.reason, expectedFailureRequest.message]);
|
3364
3430
|
}
|
3365
3431
|
app.notifyExpectedFailure = notifyExpectedFailure;
|
@@ -3372,7 +3438,8 @@ var app_app;
|
|
3372
3438
|
* @param handler - The handler to invoke when the user changes their theme.
|
3373
3439
|
*/
|
3374
3440
|
function registerOnThemeChangeHandler(handler) {
|
3375
|
-
|
3441
|
+
// allow for registration cleanup even when not called initialize
|
3442
|
+
handler && ensureInitializeCalled();
|
3376
3443
|
handlers_registerOnThemeChangeHandler(handler);
|
3377
3444
|
}
|
3378
3445
|
app.registerOnThemeChangeHandler = registerOnThemeChangeHandler;
|
@@ -3501,14 +3568,14 @@ function transformLegacyContextToAppContext(legacyContext) {
|
|
3501
3568
|
|
3502
3569
|
/**
|
3503
3570
|
* Navigation-specific part of the SDK.
|
3504
|
-
*
|
3505
|
-
* @beta
|
3506
3571
|
*/
|
3507
3572
|
var pages;
|
3508
3573
|
(function (pages) {
|
3509
3574
|
/**
|
3510
3575
|
* Return focus to the host. Will move focus forward or backward based on where the application container falls in
|
3511
3576
|
* the F6/tab order in the host.
|
3577
|
+
* On mobile hosts or hosts where there is no keyboard interaction or UI notion of "focus" this function has no
|
3578
|
+
* effect and will be a no-op when called.
|
3512
3579
|
* @param navigateForward - Determines the direction to focus in host.
|
3513
3580
|
*/
|
3514
3581
|
function returnFocus(navigateForward) {
|
@@ -3523,6 +3590,8 @@ var pages;
|
|
3523
3590
|
* @hidden
|
3524
3591
|
*
|
3525
3592
|
* Registers a handler for specifying focus when it passes from the host to the application.
|
3593
|
+
* On mobile hosts or hosts where there is no UI notion of "focus" the handler registered with
|
3594
|
+
* this function will never be called.
|
3526
3595
|
*
|
3527
3596
|
* @param handler - The handler for placing focus within the application.
|
3528
3597
|
*
|
@@ -3625,6 +3694,7 @@ var pages;
|
|
3625
3694
|
pages.navigateToApp = navigateToApp;
|
3626
3695
|
/**
|
3627
3696
|
* Shares a deep link that a user can use to navigate back to a specific state in this page.
|
3697
|
+
* Please note that this method does yet work on mobile hosts.
|
3628
3698
|
*
|
3629
3699
|
* @param deepLinkParameters - ID and label for the link and fallback URL.
|
3630
3700
|
*/
|
@@ -3643,6 +3713,8 @@ var pages;
|
|
3643
3713
|
/**
|
3644
3714
|
* Registers a handler for changes from or to full-screen view for a tab.
|
3645
3715
|
* Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
|
3716
|
+
* On hosts where there is no support for making an app full screen, the handler registered
|
3717
|
+
* with this function will never be called.
|
3646
3718
|
* @param handler - The handler to invoke when the user toggles full-screen view for a tab.
|
3647
3719
|
*/
|
3648
3720
|
function registerFullScreenHandler(handler) {
|
@@ -3803,7 +3875,8 @@ var pages;
|
|
3803
3875
|
* @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
|
3804
3876
|
*/
|
3805
3877
|
function registerOnSaveHandlerHelper(handler, versionSpecificHelper) {
|
3806
|
-
|
3878
|
+
// allow for registration cleanup even when not finished initializing
|
3879
|
+
handler && ensureInitialized(FrameContexts.settings);
|
3807
3880
|
if (versionSpecificHelper) {
|
3808
3881
|
versionSpecificHelper();
|
3809
3882
|
}
|
@@ -3837,7 +3910,8 @@ var pages;
|
|
3837
3910
|
* @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
|
3838
3911
|
*/
|
3839
3912
|
function registerOnRemoveHandlerHelper(handler, versionSpecificHelper) {
|
3840
|
-
|
3913
|
+
// allow for registration cleanup even when not finished initializing
|
3914
|
+
handler && ensureInitialized(FrameContexts.remove, FrameContexts.settings);
|
3841
3915
|
if (versionSpecificHelper) {
|
3842
3916
|
versionSpecificHelper();
|
3843
3917
|
}
|
@@ -3995,7 +4069,8 @@ var pages;
|
|
3995
4069
|
* @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
|
3996
4070
|
*/
|
3997
4071
|
function registerBackButtonHandlerHelper(handler, versionSpecificHelper) {
|
3998
|
-
|
4072
|
+
// allow for registration cleanup even when not finished initializing
|
4073
|
+
handler && ensureInitialized();
|
3999
4074
|
if (versionSpecificHelper) {
|
4000
4075
|
versionSpecificHelper();
|
4001
4076
|
}
|
@@ -4281,7 +4356,8 @@ function doesHandlerExist(name) {
|
|
4281
4356
|
* @param registrationHelper - The helper function containing logic pertaining to a specific version of the API.
|
4282
4357
|
*/
|
4283
4358
|
function registerHandlerHelper(name, handler, contexts, registrationHelper) {
|
4284
|
-
|
4359
|
+
// allow for registration cleanup even when not finished initializing
|
4360
|
+
handler && ensureInitialized.apply(void 0, contexts);
|
4285
4361
|
if (registrationHelper) {
|
4286
4362
|
registrationHelper();
|
4287
4363
|
}
|
@@ -4731,7 +4807,6 @@ function handleChildMessage(evt) {
|
|
4731
4807
|
}
|
4732
4808
|
else {
|
4733
4809
|
// No handler, proxy to parent
|
4734
|
-
// tslint:disable-next-line:no-any
|
4735
4810
|
sendMessageToParent(message_1.func, message_1.args, function () {
|
4736
4811
|
var args = [];
|
4737
4812
|
for (var _i = 0; _i < arguments.length; _i++) {
|
@@ -4803,9 +4878,7 @@ function waitForMessageQueue(targetWindow, callback) {
|
|
4803
4878
|
* @internal
|
4804
4879
|
* Limited to Microsoft-internal use
|
4805
4880
|
*/
|
4806
|
-
function sendMessageResponseToChild(id,
|
4807
|
-
// tslint:disable-next-line:no-any
|
4808
|
-
args, isPartialResponse) {
|
4881
|
+
function sendMessageResponseToChild(id, args, isPartialResponse) {
|
4809
4882
|
var targetWindow = Communication.childWindow;
|
4810
4883
|
/* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
|
4811
4884
|
var response = createMessageResponse(id, args, isPartialResponse);
|
@@ -4822,9 +4895,7 @@ args, isPartialResponse) {
|
|
4822
4895
|
* @internal
|
4823
4896
|
* Limited to Microsoft-internal use
|
4824
4897
|
*/
|
4825
|
-
function sendMessageEventToChild(actionName,
|
4826
|
-
// tslint:disable-next-line: no-any
|
4827
|
-
args) {
|
4898
|
+
function sendMessageEventToChild(actionName, args) {
|
4828
4899
|
var targetWindow = Communication.childWindow;
|
4829
4900
|
/* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
|
4830
4901
|
var customEvent = createMessageEvent(actionName, args);
|
@@ -4842,7 +4913,6 @@ args) {
|
|
4842
4913
|
* @internal
|
4843
4914
|
* Limited to Microsoft-internal use
|
4844
4915
|
*/
|
4845
|
-
// tslint:disable-next-line:no-any
|
4846
4916
|
function createMessageRequest(func, args) {
|
4847
4917
|
return {
|
4848
4918
|
id: CommunicationPrivate.nextMessageId++,
|
@@ -4855,7 +4925,6 @@ function createMessageRequest(func, args) {
|
|
4855
4925
|
* @internal
|
4856
4926
|
* Limited to Microsoft-internal use
|
4857
4927
|
*/
|
4858
|
-
// tslint:disable-next-line:no-any
|
4859
4928
|
function createMessageResponse(id, args, isPartialResponse) {
|
4860
4929
|
return {
|
4861
4930
|
id: id,
|
@@ -4870,7 +4939,6 @@ function createMessageResponse(id, args, isPartialResponse) {
|
|
4870
4939
|
* @internal
|
4871
4940
|
* Limited to Microsoft-internal use
|
4872
4941
|
*/
|
4873
|
-
// tslint:disable-next-line:no-any
|
4874
4942
|
function createMessageEvent(func, args) {
|
4875
4943
|
return {
|
4876
4944
|
func: func,
|
@@ -4905,7 +4973,8 @@ var logs;
|
|
4905
4973
|
* Limited to Microsoft-internal use
|
4906
4974
|
*/
|
4907
4975
|
function registerGetLogHandler(handler) {
|
4908
|
-
|
4976
|
+
// allow for registration cleanup even when not finished initializing
|
4977
|
+
handler && ensureInitialized();
|
4909
4978
|
if (!isSupported()) {
|
4910
4979
|
throw errorNotSupportedOnPlatform;
|
4911
4980
|
}
|
@@ -5014,11 +5083,7 @@ function uploadCustomApp(manifestBlob, onComplete) {
|
|
5014
5083
|
* @internal
|
5015
5084
|
* Limited to Microsoft-internal use
|
5016
5085
|
*/
|
5017
|
-
function sendCustomMessage(actionName,
|
5018
|
-
// tslint:disable-next-line:no-any
|
5019
|
-
args,
|
5020
|
-
// tslint:disable-next-line:no-any
|
5021
|
-
callback) {
|
5086
|
+
function sendCustomMessage(actionName, args, callback) {
|
5022
5087
|
ensureInitialized();
|
5023
5088
|
sendMessageToParent(actionName, args, callback);
|
5024
5089
|
}
|
@@ -5034,9 +5099,7 @@ callback) {
|
|
5034
5099
|
* @internal
|
5035
5100
|
* Limited to Microsoft-internal use
|
5036
5101
|
*/
|
5037
|
-
function sendCustomEvent(actionName,
|
5038
|
-
// tslint:disable-next-line:no-any
|
5039
|
-
args) {
|
5102
|
+
function sendCustomEvent(actionName, args) {
|
5040
5103
|
ensureInitialized();
|
5041
5104
|
//validate childWindow
|
5042
5105
|
if (!Communication.childWindow) {
|
@@ -6102,6 +6165,8 @@ var chat;
|
|
6102
6165
|
* @param openChatRequest: {@link OpenSingleChatRequest}- a request object that contains a user's email as well as an optional message parameter.
|
6103
6166
|
*
|
6104
6167
|
* @returns Promise resolved upon completion
|
6168
|
+
*
|
6169
|
+
* @beta
|
6105
6170
|
*/
|
6106
6171
|
function openChat(openChatRequest) {
|
6107
6172
|
return new Promise(function (resolve) {
|
@@ -6130,6 +6195,8 @@ var chat;
|
|
6130
6195
|
* @param openChatRequest: {@link OpenGroupChatRequest} - a request object that contains a list of user emails as well as optional parameters for message and topic (display name for the group chat).
|
6131
6196
|
*
|
6132
6197
|
* @returns Promise resolved upon completion
|
6198
|
+
*
|
6199
|
+
* @beta
|
6133
6200
|
*/
|
6134
6201
|
function openGroupChat(openChatRequest) {
|
6135
6202
|
return new Promise(function (resolve) {
|
@@ -6163,6 +6230,13 @@ var chat;
|
|
6163
6230
|
});
|
6164
6231
|
}
|
6165
6232
|
chat.openGroupChat = openGroupChat;
|
6233
|
+
/**
|
6234
|
+
* Checks if chat capability is supported by the host
|
6235
|
+
*
|
6236
|
+
* @returns boolean to represent whether the chat capability is supported
|
6237
|
+
*
|
6238
|
+
* @beta
|
6239
|
+
*/
|
6166
6240
|
function isSupported() {
|
6167
6241
|
return runtime.supports.chat ? true : false;
|
6168
6242
|
}
|
@@ -7015,6 +7089,8 @@ var profile;
|
|
7015
7089
|
* Opens a profile card at a specified position to show profile information about a persona.
|
7016
7090
|
* @param showProfileRequest The parameters to position the card and identify the target user.
|
7017
7091
|
* @returns Promise that will be fulfilled when the operation has completed
|
7092
|
+
*
|
7093
|
+
* @beta
|
7018
7094
|
*/
|
7019
7095
|
function showProfile(showProfileRequest) {
|
7020
7096
|
ensureInitialized(FrameContexts.content);
|
@@ -7039,6 +7115,13 @@ var profile;
|
|
7039
7115
|
});
|
7040
7116
|
}
|
7041
7117
|
profile.showProfile = showProfile;
|
7118
|
+
/**
|
7119
|
+
* Checks if the profile capability is supported by the host
|
7120
|
+
*
|
7121
|
+
* @returns boolean to represent whether the profile capability is supported
|
7122
|
+
*
|
7123
|
+
* @beta
|
7124
|
+
*/
|
7042
7125
|
function isSupported() {
|
7043
7126
|
return runtime.supports.profile ? true : false;
|
7044
7127
|
}
|
@@ -7630,7 +7713,7 @@ function print() {
|
|
7630
7713
|
* @param callback - The callback to invoke when the {@link Context} object is retrieved.
|
7631
7714
|
*/
|
7632
7715
|
function getContext(callback) {
|
7633
|
-
|
7716
|
+
ensureInitializeCalled();
|
7634
7717
|
app_app.getContext().then(function (context) {
|
7635
7718
|
if (callback) {
|
7636
7719
|
callback(transformAppContextToLegacyContext(context));
|
@@ -8248,6 +8331,175 @@ var tasks;
|
|
8248
8331
|
tasks.getDefaultSizeIfNotProvided = getDefaultSizeIfNotProvided;
|
8249
8332
|
})(tasks || (tasks = {}));
|
8250
8333
|
|
8334
|
+
;// CONCATENATED MODULE: ./src/public/liveShareHost.ts
|
8335
|
+
|
8336
|
+
|
8337
|
+
|
8338
|
+
/**
|
8339
|
+
* @hidden
|
8340
|
+
* Allowed roles during a meeting.
|
8341
|
+
*
|
8342
|
+
* @beta
|
8343
|
+
*/
|
8344
|
+
var UserMeetingRole;
|
8345
|
+
(function (UserMeetingRole) {
|
8346
|
+
UserMeetingRole["guest"] = "Guest";
|
8347
|
+
UserMeetingRole["attendee"] = "Attendee";
|
8348
|
+
UserMeetingRole["presenter"] = "Presenter";
|
8349
|
+
UserMeetingRole["organizer"] = "Organizer";
|
8350
|
+
})(UserMeetingRole || (UserMeetingRole = {}));
|
8351
|
+
/**
|
8352
|
+
* @hidden
|
8353
|
+
* State of the current Live Share sessions backing fluid container.
|
8354
|
+
*
|
8355
|
+
* @beta
|
8356
|
+
*/
|
8357
|
+
var ContainerState;
|
8358
|
+
(function (ContainerState) {
|
8359
|
+
/**
|
8360
|
+
* The call to `LiveShareHost.setContainerId()` successfully created the container mapping
|
8361
|
+
* for the current Live Share session.
|
8362
|
+
*/
|
8363
|
+
ContainerState["added"] = "Added";
|
8364
|
+
/**
|
8365
|
+
* A container mapping for the current Live Share Session already exists and should be used
|
8366
|
+
* when joining the sessions Fluid container.
|
8367
|
+
*/
|
8368
|
+
ContainerState["alreadyExists"] = "AlreadyExists";
|
8369
|
+
/**
|
8370
|
+
* The call to `LiveShareHost.setContainerId()` failed to create the container mapping due to
|
8371
|
+
* another client having already set the container ID for the current Live Share session.
|
8372
|
+
*/
|
8373
|
+
ContainerState["conflict"] = "Conflict";
|
8374
|
+
/**
|
8375
|
+
* A container mapping for the current Live Share session doesn't exist yet.
|
8376
|
+
*/
|
8377
|
+
ContainerState["notFound"] = "NotFound";
|
8378
|
+
})(ContainerState || (ContainerState = {}));
|
8379
|
+
/**
|
8380
|
+
* Live Share host implementation for O365 and Teams clients.
|
8381
|
+
*
|
8382
|
+
* @beta
|
8383
|
+
*/
|
8384
|
+
var LiveShareHost = /** @class */ (function () {
|
8385
|
+
function LiveShareHost() {
|
8386
|
+
}
|
8387
|
+
/**
|
8388
|
+
* @hidden
|
8389
|
+
* Returns the Fluid Tenant connection info for user's current context.
|
8390
|
+
*
|
8391
|
+
* @beta
|
8392
|
+
*/
|
8393
|
+
LiveShareHost.prototype.getFluidTenantInfo = function () {
|
8394
|
+
return new Promise(function (resolve) {
|
8395
|
+
ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
|
8396
|
+
resolve(sendAndHandleSdkError('interactive.getFluidTenantInfo'));
|
8397
|
+
});
|
8398
|
+
};
|
8399
|
+
/**
|
8400
|
+
* @hidden
|
8401
|
+
* Returns the fluid access token for mapped container Id.
|
8402
|
+
*
|
8403
|
+
* @param containerId Fluid's container Id for the request. Undefined for new containers.
|
8404
|
+
* @returns token for connecting to Fluid's session.
|
8405
|
+
*
|
8406
|
+
* @beta
|
8407
|
+
*/
|
8408
|
+
LiveShareHost.prototype.getFluidToken = function (containerId) {
|
8409
|
+
return new Promise(function (resolve) {
|
8410
|
+
ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
|
8411
|
+
// eslint-disable-next-line strict-null-checks/all
|
8412
|
+
resolve(sendAndHandleSdkError('interactive.getFluidToken', containerId));
|
8413
|
+
});
|
8414
|
+
};
|
8415
|
+
/**
|
8416
|
+
* @hidden
|
8417
|
+
* Returns the ID of the fluid container associated with the user's current context.
|
8418
|
+
*
|
8419
|
+
* @beta
|
8420
|
+
*/
|
8421
|
+
LiveShareHost.prototype.getFluidContainerId = function () {
|
8422
|
+
return new Promise(function (resolve) {
|
8423
|
+
ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
|
8424
|
+
resolve(sendAndHandleSdkError('interactive.getFluidContainerId'));
|
8425
|
+
});
|
8426
|
+
};
|
8427
|
+
/**
|
8428
|
+
* @hidden
|
8429
|
+
* Sets the ID of the fluid container associated with the current context.
|
8430
|
+
*
|
8431
|
+
* @remarks
|
8432
|
+
* If this returns false, the client should delete the container they created and then call
|
8433
|
+
* `getFluidContainerId()` to get the ID of the container being used.
|
8434
|
+
* @param containerId ID of the fluid container the client created.
|
8435
|
+
* @returns A data structure with a `containerState` indicating the success or failure of the request.
|
8436
|
+
*
|
8437
|
+
* @beta
|
8438
|
+
*/
|
8439
|
+
LiveShareHost.prototype.setFluidContainerId = function (containerId) {
|
8440
|
+
return new Promise(function (resolve) {
|
8441
|
+
ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
|
8442
|
+
resolve(sendAndHandleSdkError('interactive.setFluidContainerId', containerId));
|
8443
|
+
});
|
8444
|
+
};
|
8445
|
+
/**
|
8446
|
+
* @hidden
|
8447
|
+
* Returns the shared clock server's current time.
|
8448
|
+
*
|
8449
|
+
* @beta
|
8450
|
+
*/
|
8451
|
+
LiveShareHost.prototype.getNtpTime = function () {
|
8452
|
+
return new Promise(function (resolve) {
|
8453
|
+
ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
|
8454
|
+
resolve(sendAndHandleSdkError('interactive.getNtpTime'));
|
8455
|
+
});
|
8456
|
+
};
|
8457
|
+
/**
|
8458
|
+
* @hidden
|
8459
|
+
* Associates the fluid client ID with a set of user roles.
|
8460
|
+
*
|
8461
|
+
* @param clientId The ID for the current user's Fluid client. Changes on reconnects.
|
8462
|
+
* @returns The roles for the current user.
|
8463
|
+
*
|
8464
|
+
* @beta
|
8465
|
+
*/
|
8466
|
+
LiveShareHost.prototype.registerClientId = function (clientId) {
|
8467
|
+
return new Promise(function (resolve) {
|
8468
|
+
ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
|
8469
|
+
resolve(sendAndHandleSdkError('interactive.registerClientId', clientId));
|
8470
|
+
});
|
8471
|
+
};
|
8472
|
+
/**
|
8473
|
+
* @hidden
|
8474
|
+
* Returns the roles associated with a client ID.
|
8475
|
+
*
|
8476
|
+
* @param clientId The Client ID the message was received from.
|
8477
|
+
* @returns The roles for a given client. Returns `undefined` if the client ID hasn't been registered yet.
|
8478
|
+
*
|
8479
|
+
* @beta
|
8480
|
+
*/
|
8481
|
+
LiveShareHost.prototype.getClientRoles = function (clientId) {
|
8482
|
+
return new Promise(function (resolve) {
|
8483
|
+
ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
|
8484
|
+
resolve(sendAndHandleSdkError('interactive.getClientRoles', clientId));
|
8485
|
+
});
|
8486
|
+
};
|
8487
|
+
/**
|
8488
|
+
* Returns a host instance for the client that can be passed to the `LiveShareClient` class.
|
8489
|
+
*
|
8490
|
+
* @remarks
|
8491
|
+
* The application must first be initialized and may only be called from `meetingStage` or `sidePanel` contexts.
|
8492
|
+
*
|
8493
|
+
* @beta
|
8494
|
+
*/
|
8495
|
+
LiveShareHost.create = function () {
|
8496
|
+
ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
|
8497
|
+
return new LiveShareHost();
|
8498
|
+
};
|
8499
|
+
return LiveShareHost;
|
8500
|
+
}());
|
8501
|
+
|
8502
|
+
|
8251
8503
|
;// CONCATENATED MODULE: ./src/public/index.ts
|
8252
8504
|
|
8253
8505
|
|
@@ -8280,6 +8532,7 @@ var tasks;
|
|
8280
8532
|
|
8281
8533
|
|
8282
8534
|
|
8535
|
+
|
8283
8536
|
|
8284
8537
|
|
8285
8538
|
|