@microsoft/teams-js 2.24.0-beta.1 → 2.24.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +4 -4
- package/dist/MicrosoftTeams.d.ts +12 -3
- package/dist/MicrosoftTeams.js +50 -25
- 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 +36 -1
package/README.md
CHANGED
@@ -24,7 +24,7 @@ To install the stable [version](https://learn.microsoft.com/javascript/api/overv
|
|
24
24
|
|
25
25
|
### Production
|
26
26
|
|
27
|
-
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.
|
27
|
+
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.24.0/js/MicrosoftTeams.min.js) or point your package manager at them.
|
28
28
|
|
29
29
|
## Usage
|
30
30
|
|
@@ -45,13 +45,13 @@ Reference the library inside of your `.html` page using:
|
|
45
45
|
```html
|
46
46
|
<!-- Microsoft Teams JavaScript API (via CDN) -->
|
47
47
|
<script
|
48
|
-
src="https://res.cdn.office.net/teams-js/2.
|
49
|
-
integrity="sha384-
|
48
|
+
src="https://res.cdn.office.net/teams-js/2.24.0/js/MicrosoftTeams.min.js"
|
49
|
+
integrity="sha384-79NK4sbfVpgLoDFqyfj18/S1Uj8jhLBeRGvKO1Cqw5634RznExQ90myY/qV/0gsN"
|
50
50
|
crossorigin="anonymous"
|
51
51
|
></script>
|
52
52
|
|
53
53
|
<!-- Microsoft Teams JavaScript API (via npm) -->
|
54
|
-
<script src="node_modules/@microsoft/teams-js@2.
|
54
|
+
<script src="node_modules/@microsoft/teams-js@2.24.0/dist/MicrosoftTeams.min.js"></script>
|
55
55
|
|
56
56
|
<!-- Microsoft Teams JavaScript API (via local) -->
|
57
57
|
<script src="MicrosoftTeams.min.js"></script>
|
package/dist/MicrosoftTeams.d.ts
CHANGED
@@ -4358,13 +4358,22 @@ export interface ResumeContext {
|
|
4358
4358
|
/**
|
4359
4359
|
* The content URL that is requested to be loaded
|
4360
4360
|
*/
|
4361
|
-
contentUrl:
|
4361
|
+
contentUrl: URL;
|
4362
4362
|
}
|
4363
4363
|
/**
|
4364
4364
|
* @deprecated
|
4365
4365
|
* As of 2.14.1, please use {@link ResumeContext} instead.
|
4366
4366
|
*/
|
4367
|
-
export
|
4367
|
+
export interface LoadContext {
|
4368
|
+
/**
|
4369
|
+
* The entity that is requested to be loaded
|
4370
|
+
*/
|
4371
|
+
entityId: string;
|
4372
|
+
/**
|
4373
|
+
* The content URL that is requested to be loaded
|
4374
|
+
*/
|
4375
|
+
contentUrl: string;
|
4376
|
+
}
|
4368
4377
|
/** Represents information about a frame within a tab or dialog module. */
|
4369
4378
|
export interface FrameInfo {
|
4370
4379
|
/**
|
@@ -5074,7 +5083,7 @@ export namespace app {
|
|
5074
5083
|
*
|
5075
5084
|
* @returns void
|
5076
5085
|
*/
|
5077
|
-
type registerBeforeSuspendOrTerminateHandlerFunctionType = () => void
|
5086
|
+
type registerBeforeSuspendOrTerminateHandlerFunctionType = () => Promise<void>;
|
5078
5087
|
/**
|
5079
5088
|
* Registers a handler to be called before the page is suspended or terminated. Once a user navigates away from an app,
|
5080
5089
|
* the handler will be invoked. App developers can use this handler to save unsaved data, pause sync calls etc.
|
package/dist/MicrosoftTeams.js
CHANGED
@@ -3395,7 +3395,7 @@ const _minRuntimeConfigToUninitialize = {
|
|
3395
3395
|
* @hidden
|
3396
3396
|
* Package version.
|
3397
3397
|
*/
|
3398
|
-
const version = "2.24.0
|
3398
|
+
const version = "2.24.0";
|
3399
3399
|
|
3400
3400
|
;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
|
3401
3401
|
|
@@ -6196,6 +6196,15 @@ var pages;
|
|
6196
6196
|
|
6197
6197
|
;// CONCATENATED MODULE: ./src/internal/handlers.ts
|
6198
6198
|
/* eslint-disable @typescript-eslint/ban-types */
|
6199
|
+
var handlers_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
6200
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
6201
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
6202
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6203
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6204
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
6205
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
6206
|
+
});
|
6207
|
+
};
|
6199
6208
|
|
6200
6209
|
|
6201
6210
|
|
@@ -6364,17 +6373,31 @@ function handlers_registerOnLoadHandler(apiVersionTag, handler) {
|
|
6364
6373
|
* @internal
|
6365
6374
|
* Limited to Microsoft-internal use
|
6366
6375
|
*/
|
6367
|
-
function handleLoad(
|
6376
|
+
function handleLoad(loadContext) {
|
6377
|
+
const resumeContext = convertToResumeContext(loadContext);
|
6368
6378
|
if (HandlersPrivate.resumeHandler) {
|
6369
|
-
HandlersPrivate.resumeHandler(
|
6379
|
+
HandlersPrivate.resumeHandler(resumeContext);
|
6380
|
+
if (Communication.childWindow) {
|
6381
|
+
sendMessageEventToChild('load', [resumeContext]);
|
6382
|
+
}
|
6370
6383
|
}
|
6371
6384
|
else if (HandlersPrivate.loadHandler) {
|
6372
|
-
HandlersPrivate.loadHandler(
|
6373
|
-
|
6374
|
-
|
6375
|
-
|
6385
|
+
HandlersPrivate.loadHandler(loadContext);
|
6386
|
+
if (Communication.childWindow) {
|
6387
|
+
sendMessageEventToChild('load', [loadContext]);
|
6388
|
+
}
|
6376
6389
|
}
|
6377
6390
|
}
|
6391
|
+
/**
|
6392
|
+
* @internal
|
6393
|
+
* Limited to Microsoft-internal use
|
6394
|
+
*/
|
6395
|
+
function convertToResumeContext(context) {
|
6396
|
+
return {
|
6397
|
+
entityId: context.entityId,
|
6398
|
+
contentUrl: new URL(context.contentUrl),
|
6399
|
+
};
|
6400
|
+
}
|
6378
6401
|
/**
|
6379
6402
|
* @internal
|
6380
6403
|
* Limited to Microsoft-internal use
|
@@ -6390,26 +6413,28 @@ function handlers_registerBeforeUnloadHandler(apiVersionTag, handler) {
|
|
6390
6413
|
* Limited to Microsoft-internal use
|
6391
6414
|
*/
|
6392
6415
|
function handleBeforeUnload() {
|
6393
|
-
|
6394
|
-
|
6395
|
-
|
6396
|
-
|
6397
|
-
HandlersPrivate.beforeSuspendOrTerminateHandler
|
6398
|
-
|
6399
|
-
|
6400
|
-
|
6401
|
-
|
6402
|
-
|
6403
|
-
|
6404
|
-
|
6405
|
-
else if (!HandlersPrivate.beforeUnloadHandler || !HandlersPrivate.beforeUnloadHandler(readyToUnload)) {
|
6406
|
-
if (Communication.childWindow) {
|
6407
|
-
sendMessageEventToChild('beforeUnload');
|
6416
|
+
return handlers_awaiter(this, void 0, void 0, function* () {
|
6417
|
+
const readyToUnload = () => {
|
6418
|
+
sendMessageToParent(getApiVersionTag("v2" /* ApiVersionNumber.V_2 */, "handleBeforeUnload" /* ApiName.HandleBeforeUnload */), 'readyToUnload', []);
|
6419
|
+
};
|
6420
|
+
if (HandlersPrivate.beforeSuspendOrTerminateHandler) {
|
6421
|
+
yield HandlersPrivate.beforeSuspendOrTerminateHandler();
|
6422
|
+
if (Communication.childWindow) {
|
6423
|
+
sendMessageEventToChild('beforeUnload');
|
6424
|
+
}
|
6425
|
+
else {
|
6426
|
+
readyToUnload();
|
6427
|
+
}
|
6408
6428
|
}
|
6409
|
-
else {
|
6410
|
-
|
6429
|
+
else if (!HandlersPrivate.beforeUnloadHandler || !HandlersPrivate.beforeUnloadHandler(readyToUnload)) {
|
6430
|
+
if (Communication.childWindow) {
|
6431
|
+
sendMessageEventToChild('beforeUnload');
|
6432
|
+
}
|
6433
|
+
else {
|
6434
|
+
readyToUnload();
|
6435
|
+
}
|
6411
6436
|
}
|
6412
|
-
}
|
6437
|
+
});
|
6413
6438
|
}
|
6414
6439
|
/**
|
6415
6440
|
* @internal
|