@microsoft/teams-js 2.55.1-beta.0 → 2.56.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/README.md +4 -4
- package/dist/esm/packages/teams-js/dts/internal/telemetry.d.ts +4 -0
- package/dist/esm/packages/teams-js/dts/internal/validOrigins.d.ts +7 -0
- package/dist/esm/packages/teams-js/dts/private/contextualSearch.d.ts +99 -0
- package/dist/esm/packages/teams-js/dts/private/index.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/public/featureFlags.d.ts +9 -0
- package/dist/esm/packages/teams-js/dts/public/runtime.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/public/search.d.ts +40 -40
- package/dist/esm/packages/teams-js/dts/public/uuidObject.d.ts +2 -2
- package/dist/esm/packages/teams-js/src/index.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/validOrigins.js +1 -1
- package/dist/esm/packages/teams-js/src/private/contextualSearch.js +1 -0
- package/dist/esm/packages/teams-js/src/public/featureFlags.js +1 -1
- package/dist/esm/packages/teams-js/src/public/version.js +1 -1
- package/dist/umd/MicrosoftTeams.js +191 -47
- package/dist/umd/MicrosoftTeams.js.map +1 -1
- package/dist/umd/MicrosoftTeams.min.js +1 -1
- package/dist/umd/MicrosoftTeams.min.js.map +1 -1
- package/package.json +53 -1
|
@@ -1027,6 +1027,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
1027
1027
|
call: () => (/* reexport */ call_namespaceObject),
|
|
1028
1028
|
chat: () => (/* reexport */ chat_namespaceObject),
|
|
1029
1029
|
clipboard: () => (/* reexport */ clipboard_namespaceObject),
|
|
1030
|
+
contextualSearch: () => (/* reexport */ contextualSearch_namespaceObject),
|
|
1030
1031
|
conversations: () => (/* reexport */ conversations_namespaceObject),
|
|
1031
1032
|
copilot: () => (/* reexport */ copilot_namespaceObject),
|
|
1032
1033
|
dialog: () => (/* reexport */ dialog_namespaceObject),
|
|
@@ -1342,6 +1343,17 @@ __webpack_require__.d(logs_namespaceObject, {
|
|
|
1342
1343
|
registerGetLogHandler: () => (registerGetLogHandler)
|
|
1343
1344
|
});
|
|
1344
1345
|
|
|
1346
|
+
// NAMESPACE OBJECT: ./src/private/contextualSearch.ts
|
|
1347
|
+
var contextualSearch_namespaceObject = {};
|
|
1348
|
+
__webpack_require__.r(contextualSearch_namespaceObject);
|
|
1349
|
+
__webpack_require__.d(contextualSearch_namespaceObject, {
|
|
1350
|
+
closeContextualSearch: () => (closeContextualSearch),
|
|
1351
|
+
isSupported: () => (contextualSearch_isSupported),
|
|
1352
|
+
openContextualSearch: () => (openContextualSearch),
|
|
1353
|
+
registerOnContextualSearchClosedHandler: () => (registerOnContextualSearchClosedHandler),
|
|
1354
|
+
registerOnContextualSearchOpenedHandler: () => (registerOnContextualSearchOpenedHandler)
|
|
1355
|
+
});
|
|
1356
|
+
|
|
1345
1357
|
// NAMESPACE OBJECT: ./src/private/conversations.ts
|
|
1346
1358
|
var conversations_namespaceObject = {};
|
|
1347
1359
|
__webpack_require__.r(conversations_namespaceObject);
|
|
@@ -4201,8 +4213,8 @@ class UUID {
|
|
|
4201
4213
|
}
|
|
4202
4214
|
/**
|
|
4203
4215
|
* @hidden
|
|
4204
|
-
* Checks if the incoming id is an instance of
|
|
4205
|
-
* @param id An object to check if it's an instance of
|
|
4216
|
+
* Checks if the incoming id is an instance of UUID
|
|
4217
|
+
* @param id An object to check if it's an instance of UUID
|
|
4206
4218
|
* @throws Error with a message describing the violation
|
|
4207
4219
|
* @internal
|
|
4208
4220
|
* Limited to Microsoft-internal use
|
|
@@ -4695,7 +4707,7 @@ function isSerializable(arg) {
|
|
|
4695
4707
|
* @hidden
|
|
4696
4708
|
* Package version.
|
|
4697
4709
|
*/
|
|
4698
|
-
const version = "2.
|
|
4710
|
+
const version = "2.56.0";
|
|
4699
4711
|
|
|
4700
4712
|
;// ./src/public/featureFlags.ts
|
|
4701
4713
|
// All build feature flags are defined inside this object. Any build feature flag must have its own unique getter and setter function. This pattern allows for client apps to treeshake unused code and avoid including code guarded by this feature flags in the final bundle. If this property isn't desired, use the below runtime feature flags object.
|
|
@@ -4730,8 +4742,9 @@ function resetBuildFeatureFlags() {
|
|
|
4730
4742
|
const defaultFeatureFlags = {
|
|
4731
4743
|
disableEnforceOriginMatchForChildResponses: false,
|
|
4732
4744
|
};
|
|
4733
|
-
// Object that stores the current runtime feature flag state
|
|
4734
|
-
|
|
4745
|
+
// Object that stores the current runtime feature flag state. A copy is taken so that callers of
|
|
4746
|
+
// getCurrentFeatureFlagsState() never receive a reference to defaultFeatureFlags itself.
|
|
4747
|
+
let runtimeFeatureFlags = Object.assign({}, defaultFeatureFlags);
|
|
4735
4748
|
/**
|
|
4736
4749
|
* @returns The current state of the runtime feature flags.
|
|
4737
4750
|
*/
|
|
@@ -4754,6 +4767,17 @@ function overwriteFeatureFlagsState(newFeatureFlags) {
|
|
|
4754
4767
|
setFeatureFlagsState(Object.assign(Object.assign({}, runtimeFeatureFlags), newFeatureFlags));
|
|
4755
4768
|
return getCurrentFeatureFlagsState();
|
|
4756
4769
|
}
|
|
4770
|
+
/**
|
|
4771
|
+
* @hidden
|
|
4772
|
+
* @internal
|
|
4773
|
+
* Limited to Microsoft-internal use.
|
|
4774
|
+
*
|
|
4775
|
+
* Restores the runtime feature flags to their default values. This mirrors {@link resetBuildFeatureFlags}
|
|
4776
|
+
* and is intended for test teardown so that a flag set by one test cannot leak into later ones.
|
|
4777
|
+
*/
|
|
4778
|
+
function resetFeatureFlagsState() {
|
|
4779
|
+
setFeatureFlagsState(Object.assign({}, defaultFeatureFlags));
|
|
4780
|
+
}
|
|
4757
4781
|
|
|
4758
4782
|
;// ./src/internal/messageObjects.ts
|
|
4759
4783
|
var messageObjects_rest = (undefined && undefined.__rest) || function (s, e) {
|
|
@@ -6994,18 +7018,27 @@ function getValidOriginsListFromCDN(shouldDisableCache = false) {
|
|
|
6994
7018
|
}
|
|
6995
7019
|
});
|
|
6996
7020
|
}
|
|
7021
|
+
/**
|
|
7022
|
+
* @internal
|
|
7023
|
+
* Limited to Microsoft-internal use
|
|
7024
|
+
*
|
|
7025
|
+
* Exported so the JSON validation can be unit tested directly.
|
|
7026
|
+
*/
|
|
6997
7027
|
function isValidOriginsJSONValid(validOriginsJSON) {
|
|
6998
|
-
let validOriginsCDN
|
|
7028
|
+
let validOriginsCDN;
|
|
6999
7029
|
try {
|
|
7000
7030
|
validOriginsCDN = JSON.parse(validOriginsJSON);
|
|
7001
7031
|
}
|
|
7002
7032
|
catch (_) {
|
|
7003
7033
|
return false;
|
|
7004
7034
|
}
|
|
7005
|
-
if (!validOriginsCDN.validOrigins) {
|
|
7035
|
+
if (!validOriginsCDN || !Array.isArray(validOriginsCDN.validOrigins)) {
|
|
7006
7036
|
return false;
|
|
7007
7037
|
}
|
|
7008
7038
|
for (const validOrigin of validOriginsCDN.validOrigins) {
|
|
7039
|
+
if (typeof validOrigin !== 'string') {
|
|
7040
|
+
return false;
|
|
7041
|
+
}
|
|
7009
7042
|
try {
|
|
7010
7043
|
new URL('https://' + validOrigin);
|
|
7011
7044
|
}
|
|
@@ -9526,6 +9559,115 @@ function openFilePreview(filePreviewParameters) {
|
|
|
9526
9559
|
sendMessageToParent(getApiVersionTag(privateAPIsTelemetryVersionNumber, "openFilePreview" /* ApiName.PrivateAPIs_OpenFilePreview */), 'openFilePreview', params);
|
|
9527
9560
|
}
|
|
9528
9561
|
|
|
9562
|
+
;// ./src/private/contextualSearch.ts
|
|
9563
|
+
/**
|
|
9564
|
+
* @hidden
|
|
9565
|
+
* Module to interact with the Teams Contextual Search pane.
|
|
9566
|
+
*
|
|
9567
|
+
* @internal
|
|
9568
|
+
* Limited to Microsoft-internal use
|
|
9569
|
+
*
|
|
9570
|
+
* @module
|
|
9571
|
+
*/
|
|
9572
|
+
|
|
9573
|
+
|
|
9574
|
+
|
|
9575
|
+
|
|
9576
|
+
|
|
9577
|
+
|
|
9578
|
+
/**
|
|
9579
|
+
* v1 APIs telemetry file: All APIs in this capability file should
|
|
9580
|
+
* send API version v1 only.
|
|
9581
|
+
*/
|
|
9582
|
+
const contextualSearchTelemetryVersionNumber = "v1" /* ApiVersionNumber.V_1 */;
|
|
9583
|
+
/**
|
|
9584
|
+
* Opens the contextual search pane.
|
|
9585
|
+
*
|
|
9586
|
+
* The returned promise resolves when the host has processed the request.
|
|
9587
|
+
*
|
|
9588
|
+
* @param request - Optional parameters for opening contextual search.
|
|
9589
|
+
* @returns Promise resolved when the host processes the request.
|
|
9590
|
+
*
|
|
9591
|
+
* @hidden
|
|
9592
|
+
* @internal
|
|
9593
|
+
* Limited to Microsoft-internal use
|
|
9594
|
+
*/
|
|
9595
|
+
function openContextualSearch(request) {
|
|
9596
|
+
ensureInitialized(runtime, FrameContexts.content);
|
|
9597
|
+
if (!contextualSearch_isSupported()) {
|
|
9598
|
+
throw errorNotSupportedOnPlatform;
|
|
9599
|
+
}
|
|
9600
|
+
const args = [request === null || request === void 0 ? void 0 : request.triggerSource];
|
|
9601
|
+
return callFunctionInHost("contextualSearch.openContextualSearch" /* ApiName.ContextualSearch_OpenContextualSearch */, args, getApiVersionTag(contextualSearchTelemetryVersionNumber, "contextualSearch.openContextualSearch" /* ApiName.ContextualSearch_OpenContextualSearch */));
|
|
9602
|
+
}
|
|
9603
|
+
/**
|
|
9604
|
+
* Closes the contextual search pane.
|
|
9605
|
+
*
|
|
9606
|
+
* The returned promise resolves when the host has processed the request.
|
|
9607
|
+
*
|
|
9608
|
+
* @returns Promise resolved when the host processes the request.
|
|
9609
|
+
*
|
|
9610
|
+
* @hidden
|
|
9611
|
+
* @internal
|
|
9612
|
+
* Limited to Microsoft-internal use
|
|
9613
|
+
*/
|
|
9614
|
+
function closeContextualSearch() {
|
|
9615
|
+
ensureInitialized(runtime, FrameContexts.content);
|
|
9616
|
+
if (!contextualSearch_isSupported()) {
|
|
9617
|
+
throw errorNotSupportedOnPlatform;
|
|
9618
|
+
}
|
|
9619
|
+
return callFunctionInHost("contextualSearch.closeContextualSearch" /* ApiName.ContextualSearch_CloseContextualSearch */, [], getApiVersionTag(contextualSearchTelemetryVersionNumber, "contextualSearch.closeContextualSearch" /* ApiName.ContextualSearch_CloseContextualSearch */));
|
|
9620
|
+
}
|
|
9621
|
+
/**
|
|
9622
|
+
* Registers a handler invoked when the contextual search pane becomes visible.
|
|
9623
|
+
*
|
|
9624
|
+
* This includes pane visibility changes initiated by host entry points such as
|
|
9625
|
+
* keyboard shortcuts or autosuggest.
|
|
9626
|
+
*
|
|
9627
|
+
* @param handler - Handler invoked when contextual search becomes visible.
|
|
9628
|
+
*
|
|
9629
|
+
* @hidden
|
|
9630
|
+
* @internal
|
|
9631
|
+
* Limited to Microsoft-internal use
|
|
9632
|
+
*/
|
|
9633
|
+
function registerOnContextualSearchOpenedHandler(handler) {
|
|
9634
|
+
registerHandlerHelper(getApiVersionTag(contextualSearchTelemetryVersionNumber, "contextualSearch.registerOpenContextualSearchHandler" /* ApiName.ContextualSearch_RegisterOpenContextualSearchHandler */), 'contextualSearchOpened', handler, [FrameContexts.content], () => {
|
|
9635
|
+
if (!contextualSearch_isSupported()) {
|
|
9636
|
+
throw errorNotSupportedOnPlatform;
|
|
9637
|
+
}
|
|
9638
|
+
});
|
|
9639
|
+
}
|
|
9640
|
+
/**
|
|
9641
|
+
* Registers a handler invoked when the contextual search pane is closed.
|
|
9642
|
+
*
|
|
9643
|
+
* @param handler - Handler invoked when contextual search is closed.
|
|
9644
|
+
*
|
|
9645
|
+
* @hidden
|
|
9646
|
+
* @internal
|
|
9647
|
+
* Limited to Microsoft-internal use
|
|
9648
|
+
*/
|
|
9649
|
+
function registerOnContextualSearchClosedHandler(handler) {
|
|
9650
|
+
registerHandlerHelper(getApiVersionTag(contextualSearchTelemetryVersionNumber, "contextualSearch.registerCloseContextualSearchHandler" /* ApiName.ContextualSearch_RegisterCloseContextualSearchHandler */), 'contextualSearchClosed', handler, [FrameContexts.content], () => {
|
|
9651
|
+
if (!contextualSearch_isSupported()) {
|
|
9652
|
+
throw errorNotSupportedOnPlatform;
|
|
9653
|
+
}
|
|
9654
|
+
});
|
|
9655
|
+
}
|
|
9656
|
+
/**
|
|
9657
|
+
* Checks whether the contextual search capability is supported by the host.
|
|
9658
|
+
*
|
|
9659
|
+
* @returns Whether contextual search is supported.
|
|
9660
|
+
*
|
|
9661
|
+
* @throws Error if {@linkcode app.initialize} has not completed successfully.
|
|
9662
|
+
*
|
|
9663
|
+
* @hidden
|
|
9664
|
+
* @internal
|
|
9665
|
+
* Limited to Microsoft-internal use
|
|
9666
|
+
*/
|
|
9667
|
+
function contextualSearch_isSupported() {
|
|
9668
|
+
return ensureInitialized(runtime) && !!runtime.supports.contextualSearch;
|
|
9669
|
+
}
|
|
9670
|
+
|
|
9529
9671
|
;// ./src/private/conversations.ts
|
|
9530
9672
|
/**
|
|
9531
9673
|
* @hidden
|
|
@@ -14924,6 +15066,8 @@ class SerializableContentSizeArgs {
|
|
|
14924
15066
|
|
|
14925
15067
|
|
|
14926
15068
|
|
|
15069
|
+
|
|
15070
|
+
|
|
14927
15071
|
|
|
14928
15072
|
|
|
14929
15073
|
|
|
@@ -18310,46 +18454,46 @@ const onChangeHandlerName = 'search.queryChange';
|
|
|
18310
18454
|
const onClosedHandlerName = 'search.queryClose';
|
|
18311
18455
|
const onExecutedHandlerName = 'search.queryExecute';
|
|
18312
18456
|
/**
|
|
18313
|
-
|
|
18314
|
-
|
|
18315
|
-
|
|
18316
|
-
|
|
18317
|
-
|
|
18318
|
-
|
|
18319
|
-
|
|
18320
|
-
|
|
18321
|
-
|
|
18322
|
-
|
|
18323
|
-
|
|
18324
|
-
|
|
18325
|
-
|
|
18326
|
-
|
|
18327
|
-
|
|
18328
|
-
|
|
18329
|
-
|
|
18330
|
-
|
|
18331
|
-
|
|
18332
|
-
|
|
18333
|
-
|
|
18334
|
-
|
|
18335
|
-
|
|
18336
|
-
|
|
18337
|
-
|
|
18338
|
-
|
|
18339
|
-
|
|
18340
|
-
|
|
18341
|
-
|
|
18342
|
-
|
|
18343
|
-
|
|
18344
|
-
|
|
18345
|
-
|
|
18346
|
-
|
|
18347
|
-
|
|
18348
|
-
|
|
18349
|
-
|
|
18350
|
-
|
|
18351
|
-
|
|
18352
|
-
|
|
18457
|
+
* Allows the caller to register for various events fired by the host search experience.
|
|
18458
|
+
* Calling this function indicates that your application intends to plug into the host's search box and handle search events,
|
|
18459
|
+
* when the user is actively using your page/tab.
|
|
18460
|
+
*
|
|
18461
|
+
* The host may visually update its search box, e.g. with the name or icon of your application.
|
|
18462
|
+
*
|
|
18463
|
+
* Your application should *not* re-render inside of these callbacks, there may be a large number
|
|
18464
|
+
* of onChangeHandler calls if the user is typing rapidly in the search box.
|
|
18465
|
+
*
|
|
18466
|
+
* @param onClosedHandler - This handler will be called when the user exits or cancels their search.
|
|
18467
|
+
* Should be used to return your application to its most recent, non-search state. The value of {@link SearchQuery.searchTerm}
|
|
18468
|
+
* will be whatever the last query was before ending search.
|
|
18469
|
+
*
|
|
18470
|
+
* @param onExecuteHandler - The handler will be called when the user executes their
|
|
18471
|
+
* search (by pressing Enter for example). Should be used to display the full list of search results.
|
|
18472
|
+
* The value of {@link SearchQuery.searchTerm} is the complete query the user entered in the search box.
|
|
18473
|
+
*
|
|
18474
|
+
* @param onChangeHandler - This optional handler will be called when the user first starts using the
|
|
18475
|
+
* host's search box and as the user types their query. Can be used to put your application into a
|
|
18476
|
+
* word-wheeling state or to display suggestions as the user is typing.
|
|
18477
|
+
*
|
|
18478
|
+
* This handler will be called with an empty {@link SearchQuery.searchTerm} when search is beginning, and subsequently,
|
|
18479
|
+
* with the current contents of the search box.
|
|
18480
|
+
* @example
|
|
18481
|
+
* ``` ts
|
|
18482
|
+
* search.registerHandlers(
|
|
18483
|
+
* query => {
|
|
18484
|
+
* console.log(`Update your application to handle the search experience being closed. Last query: ${query.searchTerm}`);
|
|
18485
|
+
* },
|
|
18486
|
+
* query => {
|
|
18487
|
+
* console.log(`Update your application to handle an executed search result: ${query.searchTerm}`);
|
|
18488
|
+
* },
|
|
18489
|
+
* query => {
|
|
18490
|
+
* console.log(`Update your application with the changed search query: ${query.searchTerm}`);
|
|
18491
|
+
* },
|
|
18492
|
+
* );
|
|
18493
|
+
* ```
|
|
18494
|
+
*
|
|
18495
|
+
* @beta
|
|
18496
|
+
*/
|
|
18353
18497
|
function registerHandlers(onClosedHandler, onExecuteHandler, onChangeHandler) {
|
|
18354
18498
|
ensureInitialized(runtime, FrameContexts.content);
|
|
18355
18499
|
if (!search_isSupported()) {
|