@microsoft/teams-js
Advanced tools
Comparing version 1.4.0-beta.8 to 1.4.0-beta.9
@@ -117,4 +117,2 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var utils_1 = __webpack_require__(2); | ||
"use strict"; | ||
if (!String.prototype.startsWith) { | ||
@@ -125,3 +123,3 @@ String.prototype.startsWith = function (search, pos) { | ||
} | ||
var version = "1.3.6"; | ||
var version = "1.4.0-beta.9"; | ||
var validOrigins = [ | ||
@@ -274,3 +272,2 @@ "https://teams.microsoft.com", | ||
var printCapabilityEnabled = false; | ||
var implicitExecuteDeepLink = false; | ||
var themeChangeHandler; | ||
@@ -382,26 +379,2 @@ handlers["themeChange"] = handleThemeChange; | ||
/** | ||
* Enable implicit teams deep link execution | ||
*/ | ||
function enableImplicitExecuteDeepLink() { | ||
if (!implicitExecuteDeepLink) { | ||
implicitExecuteDeepLink = true; | ||
ensureInitialized(); | ||
// adding click handler to all deep links | ||
var elements_1 = document.getElementsByTagName("a"); | ||
var _loop_1 = function (index) { | ||
if (utils_1.isTeamsDeepLink(elements_1[index].href)) { | ||
elements_1[index].onclick = function (event) { | ||
executeDeepLink(elements_1[index].href); | ||
event.preventDefault(); | ||
event.stopImmediatePropagation(); | ||
}; | ||
} | ||
}; | ||
for (var index = 0; index < elements_1.length; index++) { | ||
_loop_1(index); | ||
} | ||
} | ||
} | ||
exports.enableImplicitExecuteDeepLink = enableImplicitExecuteDeepLink; | ||
/** | ||
* default print handler | ||
@@ -830,3 +803,5 @@ */ | ||
ensureInitialized(frameContexts.content, frameContexts.settings, frameContexts.remove, frameContexts.task); | ||
if (hostClientType === "desktop" /* desktop */) { | ||
if (hostClientType === "desktop" /* desktop */ | ||
|| hostClientType === "android" /* android */ | ||
|| hostClientType === "ios" /* ios */) { | ||
// Convert any relative URLs into absolute URLs before sending them over to the parent window. | ||
@@ -1351,14 +1326,2 @@ var link = document.createElement("a"); | ||
/***/ }), | ||
/* 2 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isTeamsDeepLink = function (link) { | ||
return link && link.indexOf("https://teams.microsoft.com/l") === 0; | ||
}; | ||
/***/ }) | ||
@@ -1365,0 +1328,0 @@ /******/ ]); |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("microsoftTeams",[],e):"object"==typeof exports?exports.microsoftTeams=e():t.microsoftTeams=e()}(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n(1))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(2);String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return this.substr(!e||e<0?0:+e,t.length)===t});var o="1.3.6";function r(t){for(var e="^",n=t.split("."),i=0;i<n.length;i++)e+=(i>0?"[.]":"")+n[i].replace("*","[^/^.]+");return e+="$"}var a=function(t){for(var e="",n=0;n<t.length;n++)e+=(0===n?"":"|")+r(t[n]);return new RegExp(e)}(["https://teams.microsoft.com","https://teams.microsoft.us","https://int.teams.microsoft.com","https://devspaces.skype.com","https://ssauth.skype.com","http://dev.local","https://msft.spoppe.com","https://*.sharepoint.com","https://*.sharepoint-df.com","https://*.sharepointonline.com","https://outlook.office.com","https://outlook-sdf.office.com"]),s={},u={settings:"settings",content:"content",authentication:"authentication",remove:"remove",task:"task"};!function(t){var e,n,i,o=function(){return function(){this.enabled=!0}}();t.MenuItem=o,function(t){t.dropDown="dropDown",t.popOver="popOver"}(t.MenuListType||(t.MenuListType={})),s.navBarMenuItemPress=function(t){e&&e(t)||(j(),F(f,"handleNavBarMenuItemPress",[t]))},s.actionMenuItemPress=function(t){n&&n(t)||(j(),F(f,"handleActionMenuItemPress",[t]))},s.setModuleView=function(t){i&&i(t)||(j(),F(f,"viewConfigItemPress",[t]))},t.setUpViews=function(t,e){j(),i=e,F(f,"setUpViews",[t])},t.setNavBarMenu=function(t,n){j(),e=n,F(f,"setNavBarMenu",[t])},t.showActionMenu=function(t,e){j(),n=e,F(f,"showActionMenu",[t])}}(e.menus||(e.menus={}));var c,f,l,h,d,p,v,g,m,y,b,w=!1,k=!1,T=[],C=[],M=0,E={},I=!1,S=!1;function O(){window.print()}function P(t){j(),g=t}function x(t){j(),m=t}function N(t){j(),y=t}function L(){j();var t=F(f,"navigateBack",[]);E[t]=function(t){if(!t)throw new Error("Back navigation is not supported in the current client or context.")}}function _(t){j(u.content);var e=F(f,"executeDeepLink",[t]);E[e]=function(t,e){if(!t)throw new Error(e)}}function j(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!w)throw new Error("The library has not yet been initialized");if(p&&t&&t.length>0){for(var n=!1,i=0;i<t.length;i++)if(t[i]===p){n=!0;break}if(!n)throw new Error("This call is not allowed in the '"+p+"' context")}}function D(t){if("id"in t.data){var e=t.data,n=E[e.id];n&&(n.apply(null,e.args),delete E[e.id])}else if("func"in t.data){e=t.data;var i=s[e.func];i&&i.apply(this,e.args)}}function U(t){return t===f?T:t===h?C:[]}function B(t){return t===f?l:t===h?d:null}function A(t){for(var e=B(t),n=U(t);t&&e&&n.length>0;)t.postMessage(n.shift(),e)}function H(t,e){var n=c.setInterval(function(){0===U(t).length&&(clearInterval(n),e())},100)}function F(t,e,n){var i=function(t,e){return{id:M++,func:t,args:e||[]}}(e,n);if(k)c&&c.nativeInterface&&c.nativeInterface.framelessPostMessage(JSON.stringify(i));else{var o=B(t);t&&o?t.postMessage(i,o):U(t).push(i)}return i.id}function z(t,e,n){var i=function(t,e){return{id:t,args:e||[]}}(e,n),o=B(t);t&&o&&t.postMessage(i,o)}s.themeChange=function(t){g&&g(t);h&&F(h,"themeChange",[t])},s.fullScreenChange=function(t){m&&m(t)},s.backButtonPress=function(){y&&y()||L()},e.initialize=function(t){if(void 0===t&&(t=window),!w){w=!0;var e=function(t){return function(t){if(t&&t.data&&"object"==typeof t.data){var e=t.source||t.originalEvent.source,n=t.origin||t.originalEvent.origin;e===c||n!==c.location.origin&&!a.test(n.toLowerCase())||(function(t,e){f&&t!==f?h&&t!==h||(h=t,d=e):(f=t,l=e),f&&f.closed&&(f=null,l=null),h&&h.closed&&(h=null,d=null),A(f),A(h)}(e,n),e===f?D(t):e===h&&function(t){if("id"in t.data&&"func"in t.data){var e=t.data,n=s[e.func];if(n){var i=n.apply(this,e.args);i&&z(h,e.id,Array.isArray(i)?i:[i])}else{var o=F(f,e.func,e.args);E[o]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];h&&z(h,e.id,t)}}}}(t))}}(t)};(f=(c=t).parent!==c.self?c.parent:c.opener)?c.addEventListener("message",e,!1):(k=!0,window.onNativeMessage=D);try{l="*";var n=F(f,"initialize",[o]);E[n]=function(t,e){p=t,v=e}}finally{l=null}this._uninitialize=function(){p&&(P(null),x(null),N(null)),p===u.settings&&b.registerOnSaveHandler(null),p===u.remove&&b.registerOnRemoveHandler(null),k||c.removeEventListener("message",e,!1),w=!1,f=null,l=null,T=[],h=null,d=null,C=[],M=0,E={},p=null,v=null,k=!1}}},e._uninitialize=function(){},e.enablePrintCapability=function(){I||(I=!0,j(),document.addEventListener("keydown",function(t){(t.ctrlKey||t.metaKey)&&80===t.keyCode&&(O(),t.cancelBubble=!0,t.preventDefault(),t.stopImmediatePropagation())}))},e.enableImplicitExecuteDeepLink=function(){if(!S){S=!0,j();for(var t=document.getElementsByTagName("a"),e=function(e){i.isTeamsDeepLink(t[e].href)&&(t[e].onclick=function(n){_(t[e].href),n.preventDefault(),n.stopImmediatePropagation()})},n=0;n<t.length;n++)e(n)}},e.print=O,e.getContext=function(t){j();var e=F(f,"getContext");E[e]=t},e.registerOnThemeChangeHandler=P,e.registerFullScreenHandler=x,e.registerBackButtonHandler=N,e.navigateBack=L,e.navigateCrossDomain=function(t){j(u.content,u.settings,u.remove,u.task);var e=F(f,"navigateCrossDomain",[t]);E[e]=function(t){if(!t)throw new Error("Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.")}},e.getTabInstances=function(t,e){j();var n=F(f,"getTabInstances",[e]);E[n]=t},e.getUserJoinedTeams=function(t,e){j();var n=F(f,"getUserJoinedTeams",[e]);E[n]=t},e.getMruTabInstances=function(t,e){j();var n=F(f,"getMruTabInstances",[e]);E[n]=t},e.shareDeepLink=function(t){j(u.content),F(f,"shareDeepLink",[t.subEntityId,t.subEntityLabel,t.subEntityWebUrl])},e.openFilePreview=function(t){j(u.content);var e=[t.entityId,t.title,t.description,t.type,t.objectUrl,t.downloadUrl,t.webPreviewUrl,t.webEditUrl,t.baseUrl,t.editFile,t.subEntityId];F(f,"openFilePreview",e)},e.showNotification=function(t){j(u.content);var e=[t.message,t.notificationType];F(f,"showNotification",e)},e.executeDeepLink=_,e.uploadCustomApp=function(t){j();var e=F(f,"uploadCustomApp",[t]);E[e]=function(t,e){if(!t)throw new Error(e)}},e.navigateToTab=function(t){j();var e=F(f,"navigateToTab",[t]);E[e]=function(t){if(!t)throw new Error("Invalid internalTabInstanceId and/or channelId were/was provided")}},function(t){var e,n;s["settings.save"]=function(t){var n=new i(t);e?e(n):n.notifySuccess()},s["settings.remove"]=function(){var t=new o;n?n(t):t.notifySuccess()},t.setValidityState=function(t){j(u.settings,u.remove),F(f,"settings.setValidityState",[t])},t.getSettings=function(t){j(u.content,u.settings,u.remove);var e=F(f,"settings.getSettings");E[e]=t},t.setSettings=function(t){j(u.content,u.settings);var e=F(f,"settings.setSettings",[t]);E[e]=function(t,e){if(!t)throw new Error(e)}},t.registerOnSaveHandler=function(t){j(u.settings),e=t},t.registerOnRemoveHandler=function(t){j(u.remove),n=t};var i=function(){function t(t){this.notified=!1,this.result=t||{}}return t.prototype.notifySuccess=function(){this.ensureNotNotified(),F(f,"settings.save.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),F(f,"settings.save.failure",[t]),this.notified=!0},t.prototype.ensureNotNotified=function(){if(this.notified)throw new Error("The SaveEvent may only notify success or failure once.")},t}();var o=function(){function t(){this.notified=!1}return t.prototype.notifySuccess=function(){this.ensureNotNotified(),F(f,"settings.remove.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),F(f,"settings.remove.failure",[t]),this.notified=!0},t.prototype.ensureNotNotified=function(){if(this.notified)throw new Error("The removeEvent may only notify success or failure once.")},t}()}(b=e.settings||(e.settings={})),function(t){var e,n;function i(){o();try{h&&h.close()}finally{h=null,d=null}}function o(){n&&(clearInterval(n),n=0),delete s.initialize,delete s.navigateCrossDomain}function r(t){try{e&&e.failureCallback&&e.failureCallback(t)}finally{e=null,i()}}function a(t,e,n){if(t){var i=document.createElement("a");i.href=decodeURIComponent(t),i.host&&i.host!==window.location.host&&"outlook.office.com"===i.host&&i.search.indexOf("client_type=Win32_Outlook")>-1&&(e&&"result"===e&&(n&&(i.href=l(i.href,"result",n)),c.location.assign(l(i.href,"authSuccess",""))),e&&"reason"===e&&(n&&(i.href=l(i.href,"reason",n)),c.location.assign(l(i.href,"authFailure",""))))}}function l(t,e,n){var i=t.indexOf("#"),o=-1===i?"#":t.substr(i);return o=o+"&"+e+(""!==n?"="+n:""),(t=-1===i?t:t.substr(0,i))+o}s["authentication.authenticate.success"]=function(t){try{e&&e.successCallback&&e.successCallback(t)}finally{e=null,i()}},s["authentication.authenticate.failure"]=r,t.registerAuthenticationHandlers=function(t){e=t},t.authenticate=function(t){var a=void 0!==t?t:e;if(j(u.content,u.settings,u.remove,u.task),"desktop"===v){var l=document.createElement("a");l.href=a.url;var p=F(f,"authentication.authenticate",[l.href,a.width,a.height]);E[p]=function(t,e){t?a.successCallback(e):a.failureCallback(e)}}else!function(t){e=t,i();var a=e.width||600,f=e.height||400;a=Math.min(a,c.outerWidth-400),f=Math.min(f,c.outerHeight-200);var l=document.createElement("a");l.href=e.url;var p=void 0!==c.screenLeft?c.screenLeft:c.screenX,g=void 0!==c.screenTop?c.screenTop:c.screenY;p+=c.outerWidth/2-a/2,g+=c.outerHeight/2-f/2,(h=c.open(l.href,"_blank","toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top="+g+", left="+p+", width="+a+", height="+f))?(o(),n=c.setInterval(function(){if(!h||h.closed)r("CancelledByUser");else{var t=d;try{d="*",F(h,"ping")}finally{d=t}}},100),s.initialize=function(){return[u.authentication,v]},s.navigateCrossDomain=function(t){return!1}):r("FailedToOpenWindow")}(a)},t.getAuthToken=function(t){j();var e=F(f,"authentication.getAuthToken",[t.resources]);E[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}},t.getUser=function(t){j();var e=F(f,"authentication.getUser");E[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}},t.notifySuccess=function(t,e){a(e,"result",t),j(u.authentication),F(f,"authentication.authenticate.success",[t]),H(f,function(){return setTimeout(function(){return c.close()},200)})},t.notifyFailure=function(t,e){a(e,"reason",t),j(u.authentication),F(f,"authentication.authenticate.failure",[t]),H(f,function(){return setTimeout(function(){return c.close()},200)})}}(e.authentication||(e.authentication={})),e.sendCustomMessage=function(t,e){return j(),F(f,t,e)},function(t){t.startTask=function(t,e){j(u.content);var n=F(f,"tasks.startTask",[t]);E[n]=e},t.submitTask=function(t,e){j(u.content,u.task),F(f,"tasks.completeTask",[t,Array.isArray(e)?e:[e]])}}(e.tasks||(e.tasks={})),e.getChatMembers=function(t){j();var e=F(f,"getChatMembers");E[e]=t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isTeamsDeepLink=function(t){return t&&0===t.indexOf("https://teams.microsoft.com/l")}}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("microsoftTeams",[],e):"object"==typeof exports?exports.microsoftTeams=e():t.microsoftTeams=e()}(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n(1))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return this.substr(!e||e<0?0:+e,t.length)===t});var i="1.4.0-beta.9";function o(t){for(var e="^",n=t.split("."),i=0;i<n.length;i++)e+=(i>0?"[.]":"")+n[i].replace("*","[^/^.]+");return e+="$"}var r=function(t){for(var e="",n=0;n<t.length;n++)e+=(0===n?"":"|")+o(t[n]);return new RegExp(e)}(["https://teams.microsoft.com","https://teams.microsoft.us","https://int.teams.microsoft.com","https://devspaces.skype.com","https://ssauth.skype.com","http://dev.local","https://msft.spoppe.com","https://*.sharepoint.com","https://*.sharepoint-df.com","https://*.sharepointonline.com","https://outlook.office.com","https://outlook-sdf.office.com"]),a={},s={settings:"settings",content:"content",authentication:"authentication",remove:"remove",task:"task"};!function(t){var e,n,i,o=function(){return function(){this.enabled=!0}}();t.MenuItem=o,function(t){t.dropDown="dropDown",t.popOver="popOver"}(t.MenuListType||(t.MenuListType={})),a.navBarMenuItemPress=function(t){e&&e(t)||(x(),B(c,"handleNavBarMenuItemPress",[t]))},a.actionMenuItemPress=function(t){n&&n(t)||(x(),B(c,"handleActionMenuItemPress",[t]))},a.setModuleView=function(t){i&&i(t)||(x(),B(c,"viewConfigItemPress",[t]))},t.setUpViews=function(t,e){x(),i=e,B(c,"setUpViews",[t])},t.setNavBarMenu=function(t,n){x(),e=n,B(c,"setNavBarMenu",[t])},t.showActionMenu=function(t,e){x(),n=e,B(c,"showActionMenu",[t])}}(e.menus||(e.menus={}));var u,c,f,l,d,h,v,p,g,m,y,b=!1,w=!1,k=[],T=[],C=0,M={},E=!1;function I(){window.print()}function S(t){x(),p=t}function O(t){x(),g=t}function P(t){x(),m=t}function N(){x();var t=B(c,"navigateBack",[]);M[t]=function(t){if(!t)throw new Error("Back navigation is not supported in the current client or context.")}}function x(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!b)throw new Error("The library has not yet been initialized");if(h&&t&&t.length>0){for(var n=!1,i=0;i<t.length;i++)if(t[i]===h){n=!0;break}if(!n)throw new Error("This call is not allowed in the '"+h+"' context")}}function U(t){if("id"in t.data){var e=t.data,n=M[e.id];n&&(n.apply(null,e.args),delete M[e.id])}else if("func"in t.data){e=t.data;var i=a[e.func];i&&i.apply(this,e.args)}}function _(t){return t===c?k:t===l?T:[]}function j(t){return t===c?f:t===l?d:null}function L(t){for(var e=j(t),n=_(t);t&&e&&n.length>0;)t.postMessage(n.shift(),e)}function A(t,e){var n=u.setInterval(function(){0===_(t).length&&(clearInterval(n),e())},100)}function B(t,e,n){var i=function(t,e){return{id:C++,func:t,args:e||[]}}(e,n);if(w)u&&u.nativeInterface&&u.nativeInterface.framelessPostMessage(JSON.stringify(i));else{var o=j(t);t&&o?t.postMessage(i,o):_(t).push(i)}return i.id}function D(t,e,n){var i=function(t,e){return{id:t,args:e||[]}}(e,n),o=j(t);t&&o&&t.postMessage(i,o)}a.themeChange=function(t){p&&p(t);l&&B(l,"themeChange",[t])},a.fullScreenChange=function(t){g&&g(t)},a.backButtonPress=function(){m&&m()||N()},e.initialize=function(t){if(void 0===t&&(t=window),!b){b=!0;var e=function(t){return function(t){if(t&&t.data&&"object"==typeof t.data){var e=t.source||t.originalEvent.source,n=t.origin||t.originalEvent.origin;e===u||n!==u.location.origin&&!r.test(n.toLowerCase())||(function(t,e){c&&t!==c?l&&t!==l||(l=t,d=e):(c=t,f=e),c&&c.closed&&(c=null,f=null),l&&l.closed&&(l=null,d=null),L(c),L(l)}(e,n),e===c?U(t):e===l&&function(t){if("id"in t.data&&"func"in t.data){var e=t.data,n=a[e.func];if(n){var i=n.apply(this,e.args);i&&D(l,e.id,Array.isArray(i)?i:[i])}else{var o=B(c,e.func,e.args);M[o]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];l&&D(l,e.id,t)}}}}(t))}}(t)};(c=(u=t).parent!==u.self?u.parent:u.opener)?u.addEventListener("message",e,!1):(w=!0,window.onNativeMessage=U);try{f="*";var n=B(c,"initialize",[i]);M[n]=function(t,e){h=t,v=e}}finally{f=null}this._uninitialize=function(){h&&(S(null),O(null),P(null)),h===s.settings&&y.registerOnSaveHandler(null),h===s.remove&&y.registerOnRemoveHandler(null),w||u.removeEventListener("message",e,!1),b=!1,c=null,f=null,k=[],l=null,d=null,T=[],C=0,M={},h=null,v=null,w=!1}}},e._uninitialize=function(){},e.enablePrintCapability=function(){E||(E=!0,x(),document.addEventListener("keydown",function(t){(t.ctrlKey||t.metaKey)&&80===t.keyCode&&(I(),t.cancelBubble=!0,t.preventDefault(),t.stopImmediatePropagation())}))},e.print=I,e.getContext=function(t){x();var e=B(c,"getContext");M[e]=t},e.registerOnThemeChangeHandler=S,e.registerFullScreenHandler=O,e.registerBackButtonHandler=P,e.navigateBack=N,e.navigateCrossDomain=function(t){x(s.content,s.settings,s.remove,s.task);var e=B(c,"navigateCrossDomain",[t]);M[e]=function(t){if(!t)throw new Error("Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.")}},e.getTabInstances=function(t,e){x();var n=B(c,"getTabInstances",[e]);M[n]=t},e.getUserJoinedTeams=function(t,e){x();var n=B(c,"getUserJoinedTeams",[e]);M[n]=t},e.getMruTabInstances=function(t,e){x();var n=B(c,"getMruTabInstances",[e]);M[n]=t},e.shareDeepLink=function(t){x(s.content),B(c,"shareDeepLink",[t.subEntityId,t.subEntityLabel,t.subEntityWebUrl])},e.openFilePreview=function(t){x(s.content);var e=[t.entityId,t.title,t.description,t.type,t.objectUrl,t.downloadUrl,t.webPreviewUrl,t.webEditUrl,t.baseUrl,t.editFile,t.subEntityId];B(c,"openFilePreview",e)},e.showNotification=function(t){x(s.content);var e=[t.message,t.notificationType];B(c,"showNotification",e)},e.executeDeepLink=function(t){x(s.content);var e=B(c,"executeDeepLink",[t]);M[e]=function(t,e){if(!t)throw new Error(e)}},e.uploadCustomApp=function(t){x();var e=B(c,"uploadCustomApp",[t]);M[e]=function(t,e){if(!t)throw new Error(e)}},e.navigateToTab=function(t){x();var e=B(c,"navigateToTab",[t]);M[e]=function(t){if(!t)throw new Error("Invalid internalTabInstanceId and/or channelId were/was provided")}},function(t){var e,n;a["settings.save"]=function(t){var n=new i(t);e?e(n):n.notifySuccess()},a["settings.remove"]=function(){var t=new o;n?n(t):t.notifySuccess()},t.setValidityState=function(t){x(s.settings,s.remove),B(c,"settings.setValidityState",[t])},t.getSettings=function(t){x(s.content,s.settings,s.remove);var e=B(c,"settings.getSettings");M[e]=t},t.setSettings=function(t){x(s.content,s.settings);var e=B(c,"settings.setSettings",[t]);M[e]=function(t,e){if(!t)throw new Error(e)}},t.registerOnSaveHandler=function(t){x(s.settings),e=t},t.registerOnRemoveHandler=function(t){x(s.remove),n=t};var i=function(){function t(t){this.notified=!1,this.result=t||{}}return t.prototype.notifySuccess=function(){this.ensureNotNotified(),B(c,"settings.save.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),B(c,"settings.save.failure",[t]),this.notified=!0},t.prototype.ensureNotNotified=function(){if(this.notified)throw new Error("The SaveEvent may only notify success or failure once.")},t}();var o=function(){function t(){this.notified=!1}return t.prototype.notifySuccess=function(){this.ensureNotNotified(),B(c,"settings.remove.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),B(c,"settings.remove.failure",[t]),this.notified=!0},t.prototype.ensureNotNotified=function(){if(this.notified)throw new Error("The removeEvent may only notify success or failure once.")},t}()}(y=e.settings||(e.settings={})),function(t){var e,n;function i(){o();try{l&&l.close()}finally{l=null,d=null}}function o(){n&&(clearInterval(n),n=0),delete a.initialize,delete a.navigateCrossDomain}function r(t){try{e&&e.failureCallback&&e.failureCallback(t)}finally{e=null,i()}}function f(t,e,n){if(t){var i=document.createElement("a");i.href=decodeURIComponent(t),i.host&&i.host!==window.location.host&&"outlook.office.com"===i.host&&i.search.indexOf("client_type=Win32_Outlook")>-1&&(e&&"result"===e&&(n&&(i.href=h(i.href,"result",n)),u.location.assign(h(i.href,"authSuccess",""))),e&&"reason"===e&&(n&&(i.href=h(i.href,"reason",n)),u.location.assign(h(i.href,"authFailure",""))))}}function h(t,e,n){var i=t.indexOf("#"),o=-1===i?"#":t.substr(i);return o=o+"&"+e+(""!==n?"="+n:""),(t=-1===i?t:t.substr(0,i))+o}a["authentication.authenticate.success"]=function(t){try{e&&e.successCallback&&e.successCallback(t)}finally{e=null,i()}},a["authentication.authenticate.failure"]=r,t.registerAuthenticationHandlers=function(t){e=t},t.authenticate=function(t){var f=void 0!==t?t:e;if(x(s.content,s.settings,s.remove,s.task),"desktop"===v||"android"===v||"ios"===v){var h=document.createElement("a");h.href=f.url;var p=B(c,"authentication.authenticate",[h.href,f.width,f.height]);M[p]=function(t,e){t?f.successCallback(e):f.failureCallback(e)}}else!function(t){e=t,i();var c=e.width||600,f=e.height||400;c=Math.min(c,u.outerWidth-400),f=Math.min(f,u.outerHeight-200);var h=document.createElement("a");h.href=e.url;var p=void 0!==u.screenLeft?u.screenLeft:u.screenX,g=void 0!==u.screenTop?u.screenTop:u.screenY;p+=u.outerWidth/2-c/2,g+=u.outerHeight/2-f/2,(l=u.open(h.href,"_blank","toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top="+g+", left="+p+", width="+c+", height="+f))?(o(),n=u.setInterval(function(){if(!l||l.closed)r("CancelledByUser");else{var t=d;try{d="*",B(l,"ping")}finally{d=t}}},100),a.initialize=function(){return[s.authentication,v]},a.navigateCrossDomain=function(t){return!1}):r("FailedToOpenWindow")}(f)},t.getAuthToken=function(t){x();var e=B(c,"authentication.getAuthToken",[t.resources]);M[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}},t.getUser=function(t){x();var e=B(c,"authentication.getUser");M[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}},t.notifySuccess=function(t,e){f(e,"result",t),x(s.authentication),B(c,"authentication.authenticate.success",[t]),A(c,function(){return setTimeout(function(){return u.close()},200)})},t.notifyFailure=function(t,e){f(e,"reason",t),x(s.authentication),B(c,"authentication.authenticate.failure",[t]),A(c,function(){return setTimeout(function(){return u.close()},200)})}}(e.authentication||(e.authentication={})),e.sendCustomMessage=function(t,e){return x(),B(c,t,e)},function(t){t.startTask=function(t,e){x(s.content);var n=B(c,"tasks.startTask",[t]);M[n]=e},t.submitTask=function(t,e){x(s.content,s.task),B(c,"tasks.completeTask",[t,Array.isArray(e)?e:[e]])}}(e.tasks||(e.tasks={})),e.getChatMembers=function(t){x();var e=B(c,"getChatMembers");M[e]=t}}])}); |
export * from "./MicrosoftTeams"; |
@@ -290,6 +290,2 @@ export declare const enum HostClientType { | ||
/** | ||
* Enable implicit teams deep link execution | ||
*/ | ||
export declare function enableImplicitExecuteDeepLink(): void; | ||
/** | ||
* default print handler | ||
@@ -799,2 +795,10 @@ */ | ||
sharepoint?: any; | ||
/** | ||
* The type of license for the current users tenant. | ||
*/ | ||
tenantSKU?: string; | ||
/** | ||
* The license type for the current user. | ||
*/ | ||
userLicenseType?: string; | ||
} | ||
@@ -801,0 +805,0 @@ export interface DeepLinkParameters { |
{ | ||
"name": "@microsoft/teams-js", | ||
"author": "Microsoft Teams", | ||
"version": "1.4.0-beta.8", | ||
"version": "1.4.0-beta.9", | ||
"description": "Microsoft Client SDK for building app for Microsoft teams", | ||
@@ -49,2 +49,2 @@ "main": "./dist/MicrosoftTeams.min.js", | ||
} | ||
} | ||
} |
@@ -30,3 +30,3 @@ # [Microsoft Teams JavaScript Library](https://msdn.microsoft.com/en-us/microsoft-teams/) | ||
You can access [these files on unpkg](https://unpkg.com/@microsoft/teams-js@1.3.6/dist/MicrosoftTeams.min.js), download them, or point your package manager to them. | ||
You can access [these files on unpkg](https://unpkg.com/@microsoft/teams-js@1.4.0-beta.9/dist/MicrosoftTeams.min.js), download them, or point your package manager to them. | ||
@@ -51,6 +51,6 @@ ## Usage | ||
<!-- Microsoft Teams JavaScript API (via CDN) --> | ||
<script src="https://unpkg.com/@microsoft/teams-js@1.3.6/dist/MicrosoftTeams.min.js" integrity="sha384-bw/tQKCO7OgnYN29MFvAaRlOI7YaLpqeRtWhE//yfPA9pFx5THAydRA7o43Vt2JS" crossorigin="anonymous"></script> | ||
<script src="https://unpkg.com/@microsoft/teams-js@1.4.0-beta.9/dist/MicrosoftTeams.min.js" integrity="sha384-wEKnQvQeXbo30jDLL1R90V0UW+RjonEDSoHs2agqyiNnjTmv+fpXLlqHp+lRAFQm" crossorigin="anonymous"></script> | ||
<!-- Microsoft Teams JavaScript API (via npm) --> | ||
<script src="node_modules/@microsoft/teams-js@1.3.6/dist/MicrosoftTeams.min.js"></script> | ||
<script src="node_modules/@microsoft/teams-js@1.4.0-beta.9/dist/MicrosoftTeams.min.js"></script> | ||
@@ -57,0 +57,0 @@ <!-- Microsoft Teams JavaScript API (via local) --> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
200155
8
2276