@microsoft/teams-js
Advanced tools
Comparing version 1.4.0-beta.11 to 1.4.0-beta.12
@@ -285,2 +285,4 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
handlers["backButtonPress"] = handleBackButtonPress; | ||
var beforeUnloadHandler; | ||
handlers["beforeUnload"] = handleBeforeUnload; | ||
/** | ||
@@ -335,2 +337,3 @@ * Initializes the library. This must be called before any other SDK calls | ||
registerBackButtonHandler(null); | ||
registerBeforeUnloadHandler(null); | ||
} | ||
@@ -411,2 +414,4 @@ if (frameContext === frameContexts.settings) { | ||
themeChangeHandler = handler; | ||
handler && | ||
sendMessageRequest(parentWindow, "registerHandler", ["themeChange"]); | ||
} | ||
@@ -430,2 +435,4 @@ exports.registerOnThemeChangeHandler = registerOnThemeChangeHandler; | ||
fullScreenChangeHandler = handler; | ||
handler && | ||
sendMessageRequest(parentWindow, "registerHandler", ["fullScreen"]); | ||
} | ||
@@ -448,2 +455,4 @@ exports.registerFullScreenHandler = registerFullScreenHandler; | ||
backButtonPressHandler = handler; | ||
handler && | ||
sendMessageRequest(parentWindow, "registerHandler", ["backButton"]); | ||
} | ||
@@ -471,2 +480,22 @@ exports.registerBackButtonHandler = registerBackButtonHandler; | ||
/** | ||
* Registers a handler to be called before the page is unloaded. | ||
* @param handler The handler to invoke before the page is unloaded. If this handler returns true the page should | ||
* invoke the readyToUnload function provided to it once it's ready to be unloaded. | ||
*/ | ||
function registerBeforeUnloadHandler(handler) { | ||
ensureInitialized(); | ||
beforeUnloadHandler = handler; | ||
handler && | ||
sendMessageRequest(parentWindow, "registerHandler", ["beforeUnload"]); | ||
} | ||
exports.registerBeforeUnloadHandler = registerBeforeUnloadHandler; | ||
function handleBeforeUnload() { | ||
var readyToUnload = function () { | ||
sendMessageRequest(parentWindow, "readyToUnload", []); | ||
}; | ||
if (!beforeUnloadHandler || !beforeUnloadHandler(readyToUnload)) { | ||
readyToUnload(); | ||
} | ||
} | ||
/** | ||
* Navigates the frame to a new cross-domain URL. The domain of this URL must match at least one of the | ||
@@ -649,2 +678,3 @@ * valid domains specified in the validDomains block of the manifest; otherwise, an exception will be | ||
(function (settings) { | ||
var settingsHandler; | ||
var saveHandler; | ||
@@ -654,2 +684,3 @@ var removeHandler; | ||
handlers["settings.remove"] = handleRemove; | ||
handlers["settings.settings"] = settingsHandler; | ||
/** | ||
@@ -704,2 +735,3 @@ * Sets the validity state for the settings. | ||
saveHandler = handler; | ||
handler && sendMessageRequest(parentWindow, "registerHandler", ["save"]); | ||
} | ||
@@ -717,4 +749,16 @@ settings.registerOnSaveHandler = registerOnSaveHandler; | ||
removeHandler = handler; | ||
handler && sendMessageRequest(parentWindow, "registerHandler", ["remove"]); | ||
} | ||
settings.registerOnRemoveHandler = registerOnRemoveHandler; | ||
/** | ||
* Registers a handler for when the user reconfigurated tab | ||
* to create or update the underlying resource powering the content. | ||
* @param handler The handler to invoke when the user click on Settings. | ||
*/ | ||
function registerOnSettingsHandler(handler) { | ||
ensureInitialized(frameContexts.content); | ||
settingsHandler = handler; | ||
handler && sendMessageRequest(parentWindow, "registerHandler", ["settings"]); | ||
} | ||
settings.registerOnSettingsHandler = registerOnSettingsHandler; | ||
function handleSave(result) { | ||
@@ -721,0 +765,0 @@ var saveEvent = new SaveEventImpl(result); |
@@ -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";var i=this&&this.__rest||function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&(n[i[o]]=t[i[o]])}return n};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 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(),D(f,"handleNavBarMenuItemPress",[t]))},s.actionMenuItemPress=function(t){n&&n(t)||(j(),D(f,"handleActionMenuItemPress",[t]))},s.setModuleView=function(t){i&&i(t)||(j(),D(f,"viewConfigItemPress",[t]))},t.setUpViews=function(t,e){j(),i=e,D(f,"setUpViews",[t])},t.setNavBarMenu=function(t,n){j(),e=n,D(f,"setNavBarMenu",[t])},t.showActionMenu=function(t,e){j(),n=e,D(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=[],O=0,M={},E=!1;function S(){window.print()}function I(t){j(),g=t}function P(t){j(),m=t}function x(t){j(),y=t}function N(){j();var t=D(f,"navigateBack",[]);M[t]=function(t){if(!t)throw new Error("Back navigation is not supported in the current client or context.")}}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 _(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=s[e.func];i&&i.apply(this,e.args)}}function U(t){return t===f?T:t===h?C:[]}function L(t){return t===f?l:t===h?d:null}function A(t){for(var e=L(t),n=U(t);t&&e&&n.length>0;)t.postMessage(n.shift(),e)}function B(t,e){var n=c.setInterval(function(){0===U(t).length&&(clearInterval(n),e())},100)}function D(t,e,n){var i=function(t,e){return{id:O++,func:t,args:e||[]}}(e,n);if(k)c&&c.nativeInterface&&c.nativeInterface.framelessPostMessage(JSON.stringify(i));else{var o=L(t);t&&o?t.postMessage(i,o):U(t).push(i)}return i.id}function H(t,e,n){var i=function(t,e){return{id:t,args:e||[]}}(e,n),o=L(t);t&&o&&t.postMessage(i,o)}s.themeChange=function(t){g&&g(t);h&&D(h,"themeChange",[t])},s.fullScreenChange=function(t){m&&m(t)},s.backButtonPress=function(){y&&y()||N()},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?_(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&&H(h,e.id,Array.isArray(i)?i:[i])}else{var o=D(f,e.func,e.args);M[o]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];h&&H(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=_);try{l="*";var n=D(f,"initialize",[o]);M[n]=function(t,e){p=t,v=e}}finally{l=null}this._uninitialize=function(){p&&(I(null),P(null),x(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=[],O=0,M={},p=null,v=null,k=!1}}},e._uninitialize=function(){},e.enablePrintCapability=function(){E||(E=!0,j(),document.addEventListener("keydown",function(t){(t.ctrlKey||t.metaKey)&&80===t.keyCode&&(S(),t.cancelBubble=!0,t.preventDefault(),t.stopImmediatePropagation())}))},e.print=S,e.getContext=function(t){j();var e=D(f,"getContext");M[e]=t},e.registerOnThemeChangeHandler=I,e.registerFullScreenHandler=P,e.registerBackButtonHandler=x,e.navigateBack=N,e.navigateCrossDomain=function(t){j(u.content,u.settings,u.remove,u.task);var e=D(f,"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){j();var n=D(f,"getTabInstances",[e]);M[n]=t},e.getUserJoinedTeams=function(t,e){j();var n=D(f,"getUserJoinedTeams",[e]);M[n]=t},e.getMruTabInstances=function(t,e){j();var n=D(f,"getMruTabInstances",[e]);M[n]=t},e.shareDeepLink=function(t){j(u.content),D(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];D(f,"openFilePreview",e)},e.showNotification=function(t){j(u.content);var e=[t.message,t.notificationType];D(f,"showNotification",e)},e.executeDeepLink=function(t){j(u.content);var e=D(f,"executeDeepLink",[t]);M[e]=function(t,e){if(!t)throw new Error(e)}},e.uploadCustomApp=function(t){j();var e=D(f,"uploadCustomApp",[t]);M[e]=function(t,e){if(!t)throw new Error(e)}},e.navigateToTab=function(t){j();var e=D(f,"navigateToTab",[t]);M[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),D(f,"settings.setValidityState",[t])},t.getSettings=function(t){j(u.content,u.settings,u.remove);var e=D(f,"settings.getSettings");M[e]=t},t.setSettings=function(t){j(u.content,u.settings);var e=D(f,"settings.setSettings",[t]);M[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(),D(f,"settings.save.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),D(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(),D(f,"settings.remove.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),D(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||"android"===v||"ios"===v){var l=document.createElement("a");l.href=a.url;var p=D(f,"authentication.authenticate",[l.href,a.width,a.height]);M[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="*",D(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=D(f,"authentication.getAuthToken",[t.resources]);M[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}},t.getUser=function(t){j();var e=D(f,"authentication.getUser");M[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}},t.notifySuccess=function(t,e){a(e,"result",t),j(u.authentication),D(f,"authentication.authenticate.success",[t]),B(f,function(){return setTimeout(function(){return c.close()},200)})},t.notifyFailure=function(t,e){a(e,"reason",t),j(u.authentication),D(f,"authentication.authenticate.failure",[t]),B(f,function(){return setTimeout(function(){return c.close()},200)})}}(e.authentication||(e.authentication={})),e.sendCustomMessage=function(t,e){return j(),D(f,t,e)},function(t){t.startTask=function(t,e){j(u.content);var n=D(f,"tasks.startTask",[t]);M[n]=e},t.updateTask=function(t){j(u.content,u.task),t.width,t.height;var e=i(t,["width","height"]);if(Object.keys(e).length)throw new Error("updateTask requires a taskInfo argument containing only width and height");D(f,"tasks.updateTask",[t])},t.submitTask=function(t,e){j(u.content,u.task),D(f,"tasks.completeTask",[t,Array.isArray(e)?e:[e]])}}(e.tasks||(e.tasks={})),e.getChatMembers=function(t){j();var e=D(f,"getChatMembers");M[e]=t}}])}); | ||
!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";var i=this&&this.__rest||function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&(n[i[o]]=t[i[o]])}return n};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 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,d,h,g,p,v,m,y,b,w,k=!1,T=!1,C=[],O=[],M=0,S={},E=!1;function I(){window.print()}function P(t){j(),v=t,t&&F(f,"registerHandler",["themeChange"])}function x(t){j(),m=t,t&&F(f,"registerHandler",["fullScreen"])}function H(t){j(),y=t,t&&F(f,"registerHandler",["backButton"])}function N(){j();var t=F(f,"navigateBack",[]);S[t]=function(t){if(!t)throw new Error("Back navigation is not supported in the current client or context.")}}function U(t){j(),b=t,t&&F(f,"registerHandler",["beforeUnload"])}function j(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!k)throw new Error("The library has not yet been initialized");if(g&&t&&t.length>0){for(var n=!1,i=0;i<t.length;i++)if(t[i]===g){n=!0;break}if(!n)throw new Error("This call is not allowed in the '"+g+"' context")}}function _(t){if("id"in t.data){var e=t.data,n=S[e.id];n&&(n.apply(null,e.args),delete S[e.id])}else if("func"in t.data){e=t.data;var i=s[e.func];i&&i.apply(this,e.args)}}function B(t){return t===f?C:t===d?O:[]}function L(t){return t===f?l:t===d?h:null}function A(t){for(var e=L(t),n=B(t);t&&e&&n.length>0;)t.postMessage(n.shift(),e)}function D(t,e){var n=c.setInterval(function(){0===B(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(T)c&&c.nativeInterface&&c.nativeInterface.framelessPostMessage(JSON.stringify(i));else{var o=L(t);t&&o?t.postMessage(i,o):B(t).push(i)}return i.id}function z(t,e,n){var i=function(t,e){return{id:t,args:e||[]}}(e,n),o=L(t);t&&o&&t.postMessage(i,o)}s.themeChange=function(t){v&&v(t);d&&F(d,"themeChange",[t])},s.fullScreenChange=function(t){m&&m(t)},s.backButtonPress=function(){y&&y()||N()},s.beforeUnload=function(){var t=function(){F(f,"readyToUnload",[])};b&&b(t)||t()},e.initialize=function(t){if(void 0===t&&(t=window),!k){k=!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?d&&t!==d||(d=t,h=e):(f=t,l=e),f&&f.closed&&(f=null,l=null),d&&d.closed&&(d=null,h=null),A(f),A(d)}(e,n),e===f?_(t):e===d&&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(d,e.id,Array.isArray(i)?i:[i])}else{var o=F(f,e.func,e.args);S[o]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];d&&z(d,e.id,t)}}}}(t))}}(t)};(f=(c=t).parent!==c.self?c.parent:c.opener)?c.addEventListener("message",e,!1):(T=!0,window.onNativeMessage=_);try{l="*";var n=F(f,"initialize",[o]);S[n]=function(t,e){g=t,p=e}}finally{l=null}this._uninitialize=function(){g&&(P(null),x(null),H(null),U(null)),g===u.settings&&w.registerOnSaveHandler(null),g===u.remove&&w.registerOnRemoveHandler(null),T||c.removeEventListener("message",e,!1),k=!1,f=null,l=null,C=[],d=null,h=null,O=[],M=0,S={},g=null,p=null,T=!1}}},e._uninitialize=function(){},e.enablePrintCapability=function(){E||(E=!0,j(),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){j();var e=F(f,"getContext");S[e]=t},e.registerOnThemeChangeHandler=P,e.registerFullScreenHandler=x,e.registerBackButtonHandler=H,e.navigateBack=N,e.registerBeforeUnloadHandler=U,e.navigateCrossDomain=function(t){j(u.content,u.settings,u.remove,u.task);var e=F(f,"navigateCrossDomain",[t]);S[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]);S[n]=t},e.getUserJoinedTeams=function(t,e){j();var n=F(f,"getUserJoinedTeams",[e]);S[n]=t},e.getMruTabInstances=function(t,e){j();var n=F(f,"getMruTabInstances",[e]);S[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=function(t){j(u.content);var e=F(f,"executeDeepLink",[t]);S[e]=function(t,e){if(!t)throw new Error(e)}},e.uploadCustomApp=function(t){j();var e=F(f,"uploadCustomApp",[t]);S[e]=function(t,e){if(!t)throw new Error(e)}},e.navigateToTab=function(t){j();var e=F(f,"navigateToTab",[t]);S[e]=function(t){if(!t)throw new Error("Invalid internalTabInstanceId and/or channelId were/was provided")}},function(t){var e,n,i;s["settings.save"]=function(t){var e=new o(t);n?n(e):e.notifySuccess()},s["settings.remove"]=function(){var t=new r;i?i(t):t.notifySuccess()},s["settings.settings"]=e,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");S[e]=t},t.setSettings=function(t){j(u.content,u.settings);var e=F(f,"settings.setSettings",[t]);S[e]=function(t,e){if(!t)throw new Error(e)}},t.registerOnSaveHandler=function(t){j(u.settings),n=t,t&&F(f,"registerHandler",["save"])},t.registerOnRemoveHandler=function(t){j(u.remove),i=t,t&&F(f,"registerHandler",["remove"])},t.registerOnSettingsHandler=function(t){j(u.content),e=t,t&&F(f,"registerHandler",["settings"])};var o=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 r=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}()}(w=e.settings||(e.settings={})),function(t){var e,n;function i(){o();try{d&&d.close()}finally{d=null,h=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"===p||"android"===p||"ios"===p){var l=document.createElement("a");l.href=a.url;var g=F(f,"authentication.authenticate",[l.href,a.width,a.height]);S[g]=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 g=void 0!==c.screenLeft?c.screenLeft:c.screenX,v=void 0!==c.screenTop?c.screenTop:c.screenY;g+=c.outerWidth/2-a/2,v+=c.outerHeight/2-f/2,(d=c.open(l.href,"_blank","toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top="+v+", left="+g+", width="+a+", height="+f))?(o(),n=c.setInterval(function(){if(!d||d.closed)r("CancelledByUser");else{var t=h;try{h="*",F(d,"ping")}finally{h=t}}},100),s.initialize=function(){return[u.authentication,p]},s.navigateCrossDomain=function(t){return!1}):r("FailedToOpenWindow")}(a)},t.getAuthToken=function(t){j();var e=F(f,"authentication.getAuthToken",[t.resources]);S[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}},t.getUser=function(t){j();var e=F(f,"authentication.getUser");S[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]),D(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]),D(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]);S[n]=e},t.updateTask=function(t){j(u.content,u.task),t.width,t.height;var e=i(t,["width","height"]);if(Object.keys(e).length)throw new Error("updateTask requires a taskInfo argument containing only width and height");F(f,"tasks.updateTask",[t])},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");S[e]=t}}])}); |
@@ -1,2 +0,1 @@ | ||
import { PageContext } from "@microsoft/sp-page-context"; | ||
export declare const enum HostClientType { | ||
@@ -325,2 +324,8 @@ desktop = "desktop", | ||
/** | ||
* Registers a handler to be called before the page is unloaded. | ||
* @param handler The handler to invoke before the page is unloaded. If this handler returns true the page should | ||
* invoke the readyToUnload function provided to it once it's ready to be unloaded. | ||
*/ | ||
export declare function registerBeforeUnloadHandler(handler: (readyToUnload: () => void) => boolean): void; | ||
/** | ||
* Navigates the frame to a new cross-domain URL. The domain of this URL must match at least one of the | ||
@@ -445,2 +450,8 @@ * valid domains specified in the validDomains block of the manifest; otherwise, an exception will be | ||
function registerOnRemoveHandler(handler: (evt: RemoveEvent) => void): void; | ||
/** | ||
* Registers a handler for when the user reconfigurated tab | ||
* to create or update the underlying resource powering the content. | ||
* @param handler The handler to invoke when the user click on Settings. | ||
*/ | ||
function registerOnSettingsHandler(handler: () => void): void; | ||
interface Settings { | ||
@@ -796,3 +807,3 @@ /** | ||
*/ | ||
sharepoint?: PageContext; | ||
sharepoint?: any; | ||
/** | ||
@@ -799,0 +810,0 @@ * The type of license for the current users tenant. |
{ | ||
"name": "@microsoft/teams-js", | ||
"author": "Microsoft Teams", | ||
"version": "1.4.0-beta.11", | ||
"version": "1.4.0-beta.12", | ||
"description": "Microsoft Client SDK for building app for Microsoft teams", | ||
@@ -48,6 +48,3 @@ "main": "./dist/MicrosoftTeams.min.js", | ||
] | ||
}, | ||
"dependencies": { | ||
"@microsoft/sp-page-context": "^1.7.1" | ||
} | ||
} |
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
216507
0
2373
- Removed@microsoft/sp-page-context@^1.7.1
- Removed@microsoft/sp-core-library@1.20.0(transitive)
- Removed@microsoft/sp-diagnostics@1.20.0(transitive)
- Removed@microsoft/sp-dynamic-data@1.20.0(transitive)
- Removed@microsoft/sp-lodash-subset@1.20.0(transitive)
- Removed@microsoft/sp-module-interfaces@1.20.2(transitive)
- Removed@microsoft/sp-odata-types@1.20.0(transitive)
- Removed@microsoft/sp-page-context@1.20.0(transitive)
- Removed@rushstack/node-core-library@5.9.0(transitive)
- Removed@types/lodash@4.14.117(transitive)
- Removed@types/prop-types@15.7.13(transitive)
- Removed@types/react@17.0.83(transitive)
- Removed@types/react-dom@17.0.25(transitive)
- Removed@types/scheduler@0.16.8(transitive)
- Removedajv@8.13.0(transitive)
- Removedajv-draft-04@1.0.0(transitive)
- Removedajv-formats@3.0.1(transitive)
- Removedcommander@2.20.3(transitive)
- Removedcsstype@3.1.3(transitive)
- Removedfast-deep-equal@3.1.3(transitive)
- Removedfs-extra@7.0.1(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhasown@2.0.2(transitive)
- Removedimport-lazy@4.0.0(transitive)
- Removedis-core-module@2.15.1(transitive)
- Removedjju@1.4.0(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedjson-schema-traverse@1.0.0(transitive)
- Removedjsonfile@4.0.0(transitive)
- Removedlodash.get@4.4.2(transitive)
- Removedlodash.isequal@4.5.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedlru-cache@6.0.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedreact@17.0.2(transitive)
- Removedreact-dom@17.0.2(transitive)
- Removedrequire-from-string@2.0.2(transitive)
- Removedresolve@1.22.8(transitive)
- Removedscheduler@0.20.2(transitive)
- Removedsemver@7.5.4(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedtslib@2.3.1(transitive)
- Removeduniversalify@0.1.2(transitive)
- Removeduri-js@4.4.1(transitive)
- Removedvalidator@13.12.0(transitive)
- Removedyallist@4.0.0(transitive)
- Removedz-schema@4.2.4(transitive)