@microsoft/teams-js 2.52.0 → 2.53.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/public/shortcutRelay.d.ts +0 -7
- package/dist/esm/packages/teams-js/src/public/shortcutRelay.js +1 -1
- package/dist/esm/packages/teams-js/src/public/version.js +1 -1
- package/dist/umd/MicrosoftTeams.js +8 -10
- 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 +1 -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.53.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.53.0/js/MicrosoftTeams.min.js"
|
|
49
|
+
integrity="sha384-UFKwOGC8ix6vOFFC4vH8hSpjwkQXZmSjCx8aaxwhbtm+6joQdNvD7b4pPk82cYAD"
|
|
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.53.0/dist/MicrosoftTeams.min.js"></script>
|
|
55
55
|
|
|
56
56
|
<!-- Microsoft Teams JavaScript API (via local) -->
|
|
57
57
|
<script src="MicrosoftTeams.min.js"></script>
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Allows host shortcuts to function in your application by forwarding keyboard shortcuts to the host.
|
|
3
3
|
*
|
|
4
|
-
* This functionality is in Beta.
|
|
5
|
-
* @beta
|
|
6
4
|
* @module
|
|
7
5
|
*/
|
|
8
6
|
/**
|
|
@@ -26,20 +24,17 @@ export type OverridableShortcutHandler = (event: KeyboardEvent, data: Overridabl
|
|
|
26
24
|
* • Pass `undefined` to remove an existing handler.
|
|
27
25
|
* • Returns the previous handler so callers can restore it if needed.
|
|
28
26
|
*
|
|
29
|
-
* @beta
|
|
30
27
|
*/
|
|
31
28
|
export declare function setOverridableShortcutHandler(handler: OverridableShortcutHandler | undefined): OverridableShortcutHandler | undefined;
|
|
32
29
|
/**
|
|
33
30
|
* Reset the state of the shortcut relay capability.
|
|
34
31
|
* This is useful for tests to ensure a clean state.
|
|
35
32
|
*
|
|
36
|
-
* @beta
|
|
37
33
|
*/
|
|
38
34
|
export declare function resetIsShortcutRelayCapabilityEnabled(): void;
|
|
39
35
|
/**
|
|
40
36
|
* Enable capability to support host shortcuts.
|
|
41
37
|
*
|
|
42
|
-
* @beta
|
|
43
38
|
*/
|
|
44
39
|
export declare function enableShortcutRelayCapability(): Promise<void>;
|
|
45
40
|
/**
|
|
@@ -48,13 +43,11 @@ export declare function enableShortcutRelayCapability(): Promise<void>;
|
|
|
48
43
|
*
|
|
49
44
|
* @throws Error if {@link app.initialize} has not successfully completed
|
|
50
45
|
*
|
|
51
|
-
* @beta
|
|
52
46
|
*/
|
|
53
47
|
export declare function isSupported(): boolean;
|
|
54
48
|
/**
|
|
55
49
|
* Allow apps to define zones where shortcuts should not be forwarded to the host.
|
|
56
50
|
* This is useful for input fields for password where shortcuts should not trigger host actions.
|
|
57
51
|
*
|
|
58
|
-
* @beta
|
|
59
52
|
*/
|
|
60
53
|
export declare const DISABLE_SHORTCUT_FORWARDING_ATTRIBUTE = "data-disable-shortcuts-forwarding";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{callFunctionInHost as e,callFunctionInHostAndHandleResponse as r}from"../internal/communication.js";import{registerHandler as o}from"../internal/handlers.js";import{ensureInitialized as n}from"../internal/internalAPIs.js";import{ResponseHandler as s}from"../internal/responseHandler.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{errorNotSupportedOnPlatform as a}from"./constants.js";import{runtime as c}from"./runtime.js";class h{constructor(t){this.event=t}serialize(){return{altKey:this.event.altKey,bubbles:this.event.bubbles,cancelBubble:this.event.cancelBubble,charCode:this.event.charCode,code:this.event.code,composed:this.event.composed,ctrlKey:this.event.ctrlKey,defaultPrevented:this.event.defaultPrevented,detail:this.event.detail,eventPhase:this.event.eventPhase,isComposing:this.event.isComposing,isTrusted:this.event.isTrusted,key:this.event.key,keyCode:this.event.keyCode,location:this.event.location,metaKey:this.event.metaKey,repeat:this.event.repeat,returnValue:this.event.returnValue,shiftKey:this.event.shiftKey,timeStamp:this.event.timeStamp,type:this.event.type,which:this.event.which}}}function u(t){return t.toLowerCase().split("+").sort().join("+")}function l(t,e){if(function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey||!!t.key&&"escape"===t.key.toLowerCase()}(e)){const r=function(t){return[t.ctrlKey&&"ctrl",t.shiftKey&&"shift",t.altKey&&"alt",t.metaKey&&"meta",t.key.toLowerCase()].filter(Boolean).sort().join("+")}(e);if(t.has(r))return{matchedShortcut:r,isOverridable:
|
|
1
|
+
import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{callFunctionInHost as e,callFunctionInHostAndHandleResponse as r}from"../internal/communication.js";import{registerHandler as o}from"../internal/handlers.js";import{ensureInitialized as n}from"../internal/internalAPIs.js";import{ResponseHandler as s}from"../internal/responseHandler.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{errorNotSupportedOnPlatform as a}from"./constants.js";import{runtime as c}from"./runtime.js";class h{constructor(t){this.event=t}serialize(){return{altKey:this.event.altKey,bubbles:this.event.bubbles,cancelBubble:this.event.cancelBubble,charCode:this.event.charCode,code:this.event.code,composed:this.event.composed,ctrlKey:this.event.ctrlKey,defaultPrevented:this.event.defaultPrevented,detail:this.event.detail,eventPhase:this.event.eventPhase,isComposing:this.event.isComposing,isTrusted:this.event.isTrusted,key:this.event.key,keyCode:this.event.keyCode,location:this.event.location,metaKey:this.event.metaKey,repeat:this.event.repeat,returnValue:this.event.returnValue,shiftKey:this.event.shiftKey,timeStamp:this.event.timeStamp,type:this.event.type,which:this.event.which}}}function u(t){return t.toLowerCase().split("+").sort().join("+")}function l(t,e){if(function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey||!!t.key&&"escape"===t.key.toLowerCase()||!!t.key&&/^F\d+$/i.test(t.key)}(e)){const r=function(t){return[t.ctrlKey&&"ctrl",t.shiftKey&&"shift",t.altKey&&"alt",t.metaKey&&"meta",t.key.toLowerCase()].filter(Boolean).sort().join("+")}(e);if(t.has(r))return{matchedShortcut:r,isOverridable:y.has(r)}}return{matchedShortcut:void 0,isOverridable:!1}}function d(t){f.clear(),t.shortcuts.forEach(t=>{f.add(u(t))}),y.clear(),t.overridableShortcuts.forEach(t=>{y.add(u(t))})}class v extends s{validate(t){return t&&Array.isArray(t.shortcuts)&&Array.isArray(t.overridableShortcuts)}deserialize(t){return t}}function m(t){if(t.target.closest(`[${C}]`))return;const{matchedShortcut:r,isOverridable:o}=l(f,t);if(!r)return;if(o&&p){if(p(t,{matchedShortcut:r}))return}const n=new h(t);e("shortcutRelay.forwardShortcutEvent",[n],i("v2","shortcutRelay.forwardShortcutEvent")),t.preventDefault(),t.stopImmediatePropagation()}const y=new Set,f=new Set;let p,b=!1;function w(t){if(!k())throw a;const e=p;return p=t,e}function K(){if(!k())throw a;b=!1,f.clear(),y.clear(),p=void 0,document.removeEventListener("keydown",m,{capture:!0})}function S(){return t(this,void 0,void 0,function*(){if(!k())throw a;var t;d(yield r("shortcutRelay.getHostShortcuts",[],new v,i("v2","shortcutRelay.getHostShortcuts"))),b||document.addEventListener("keydown",m,{capture:!0}),b=!0,t=t=>{d(t)},o(i("v2","shortcutRelay.hostShortcutChanged"),"shortcutRelay.hostShortcutChanged",t)})}function k(){return!(!n(c)||!c.supports.shortcutRelay)}const C="data-disable-shortcuts-forwarding";export{C as DISABLE_SHORTCUT_FORWARDING_ATTRIBUTE,S as enableShortcutRelayCapability,k as isSupported,K as resetIsShortcutRelayCapabilityEnabled,w as setOverridableShortcutHandler};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="2.
|
|
1
|
+
const o="2.53.0";export{o as version};
|
|
@@ -4679,7 +4679,7 @@ function isSerializable(arg) {
|
|
|
4679
4679
|
* @hidden
|
|
4680
4680
|
* Package version.
|
|
4681
4681
|
*/
|
|
4682
|
-
const version = "2.
|
|
4682
|
+
const version = "2.53.0";
|
|
4683
4683
|
|
|
4684
4684
|
;// ./src/public/featureFlags.ts
|
|
4685
4685
|
// 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.
|
|
@@ -20349,8 +20349,6 @@ function marketplace_isSupported() {
|
|
|
20349
20349
|
/**
|
|
20350
20350
|
* Allows host shortcuts to function in your application by forwarding keyboard shortcuts to the host.
|
|
20351
20351
|
*
|
|
20352
|
-
* This functionality is in Beta.
|
|
20353
|
-
* @beta
|
|
20354
20352
|
* @module
|
|
20355
20353
|
*/
|
|
20356
20354
|
var shortcutRelay_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
@@ -20429,10 +20427,15 @@ function eventToCanonicalShortcut(e) {
|
|
|
20429
20427
|
/**
|
|
20430
20428
|
* Checks if the event is a valid shortcut event.
|
|
20431
20429
|
* A valid shortcut event is one that has at least one modifier key pressed
|
|
20432
|
-
* (ctrl, shift, alt, meta)
|
|
20430
|
+
* (ctrl, shift, alt, meta), the Escape key, or a function key (F1–F24).
|
|
20433
20431
|
*/
|
|
20434
20432
|
function isValidShortcutEvent(e) {
|
|
20435
|
-
return e.ctrlKey ||
|
|
20433
|
+
return (e.ctrlKey ||
|
|
20434
|
+
e.shiftKey ||
|
|
20435
|
+
e.altKey ||
|
|
20436
|
+
e.metaKey ||
|
|
20437
|
+
(!!e.key && e.key.toLowerCase() === 'escape') ||
|
|
20438
|
+
(!!e.key && /^F\d+$/i.test(e.key)));
|
|
20436
20439
|
}
|
|
20437
20440
|
function isMatchingShortcut(shortcuts, e) {
|
|
20438
20441
|
if (isValidShortcutEvent(e)) {
|
|
@@ -20532,7 +20535,6 @@ let isShortcutRelayCapabilityEnabled = false;
|
|
|
20532
20535
|
* • Pass `undefined` to remove an existing handler.
|
|
20533
20536
|
* • Returns the previous handler so callers can restore it if needed.
|
|
20534
20537
|
*
|
|
20535
|
-
* @beta
|
|
20536
20538
|
*/
|
|
20537
20539
|
function setOverridableShortcutHandler(handler) {
|
|
20538
20540
|
if (!shortcutRelay_isSupported()) {
|
|
@@ -20546,7 +20548,6 @@ function setOverridableShortcutHandler(handler) {
|
|
|
20546
20548
|
* Reset the state of the shortcut relay capability.
|
|
20547
20549
|
* This is useful for tests to ensure a clean state.
|
|
20548
20550
|
*
|
|
20549
|
-
* @beta
|
|
20550
20551
|
*/
|
|
20551
20552
|
function resetIsShortcutRelayCapabilityEnabled() {
|
|
20552
20553
|
if (!shortcutRelay_isSupported()) {
|
|
@@ -20561,7 +20562,6 @@ function resetIsShortcutRelayCapabilityEnabled() {
|
|
|
20561
20562
|
/**
|
|
20562
20563
|
* Enable capability to support host shortcuts.
|
|
20563
20564
|
*
|
|
20564
|
-
* @beta
|
|
20565
20565
|
*/
|
|
20566
20566
|
function enableShortcutRelayCapability() {
|
|
20567
20567
|
return shortcutRelay_awaiter(this, void 0, void 0, function* () {
|
|
@@ -20588,7 +20588,6 @@ function enableShortcutRelayCapability() {
|
|
|
20588
20588
|
*
|
|
20589
20589
|
* @throws Error if {@link app.initialize} has not successfully completed
|
|
20590
20590
|
*
|
|
20591
|
-
* @beta
|
|
20592
20591
|
*/
|
|
20593
20592
|
function shortcutRelay_isSupported() {
|
|
20594
20593
|
return ensureInitialized(runtime) && runtime.supports.shortcutRelay ? true : false;
|
|
@@ -20597,7 +20596,6 @@ function shortcutRelay_isSupported() {
|
|
|
20597
20596
|
* Allow apps to define zones where shortcuts should not be forwarded to the host.
|
|
20598
20597
|
* This is useful for input fields for password where shortcuts should not trigger host actions.
|
|
20599
20598
|
*
|
|
20600
|
-
* @beta
|
|
20601
20599
|
*/
|
|
20602
20600
|
const DISABLE_SHORTCUT_FORWARDING_ATTRIBUTE = 'data-disable-shortcuts-forwarding';
|
|
20603
20601
|
|