@blackbaud/sky-addin-client 1.1.0 → 1.1.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # 1.1.3 (2022-05-12)
2
+ - Updated `allowedOrigins` to support Education Management
3
+
4
+ # 1.1.2 (2022-02-01)
5
+ - Updated `allowedOrigins` to support congregant portal
6
+
7
+ # 1.1.1 (2021-06-01)
8
+ - Add support for sending custom events to the add-in host page.
9
+
1
10
  # 1.1.0 (2020-11-19)
2
11
  - Deprecate help widget related functionality.
3
12
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # sky-addin-client
2
2
  [![npm](https://img.shields.io/npm/v/@blackbaud/sky-addin-client.svg)](https://www.npmjs.com/package/@blackbaud/sky-addin-client)
3
- [![status](https://travis-ci.org/blackbaud/sky-addin-client.svg?branch=master)](https://travis-ci.org/blackbaud/sky-addin-client)
3
+ [![coverage](https://codecov.io/github/blackbaud/sky-addin-client/coverage.svg?branch=master)](https://codecov.io/github/blackbaud/sky-addin-client/)
4
4
 
5
5
  The SKY Add-in Client Library facilitates creating custom add-ins to extend UI experiences within Blackbaud applications. Developers can register the add-in URL with their SKY API application, and at runtime the add-in will be loaded into an iframe within the application. This library must be used in the add-in for it to render within the Blackbaud application. The `AddinClient` class will integrate with the host page, passing data and commands between the host and the add-in's iframe.
6
6
 
@@ -50,6 +50,7 @@ All add-ins must use this library in order to show in the host application. You
50
50
  Your `init` function will be called with an arguments object that contains:
51
51
  - `envId` - The environment ID for the host page
52
52
  - `context` - Additional context of the host page, which will vary for different extension points.
53
+ - `supportedEventTypes` - The supported event types that are handled by the host page.
53
54
  - `ready` - A callback to inform the add-in client that the add-in is initialized and ready to be shown.
54
55
 
55
56
  Using the information provided in the `init` arguments, the add-in should determine if and how it should be rendered. Then it should call the `ready` callback, informing the host page.
@@ -155,6 +156,59 @@ var client = new AddinClient({
155
156
  });
156
157
  ```
157
158
 
159
+ #### Entry form add-ins
160
+ For entry form add-ins, the URL for the add-in will be rendered in a visible iframe on the entry form, where you can render any custom content. The iframe will initially be hidden until an initialize protocol is completed between the host and the add-in.
161
+
162
+ The host page will handle rendering the container around the add-in iframe. When calling the `ready` callback, the `title` field will indicate the title for the vertical tab in the form. Initially, the vertical tab will be hidden, and will only show on the form if `showUI` is set to `true` in the callback. You can set it to `false` to indicate that the tab and add-in content should not be shown, based on the user's privileges or whether a user interface is appropriate for your use case.
163
+
164
+ Entry form add-ins support specific form events that may occur when user interaction causes form data to change, or when a form is saved or canceled. To handle form events, call the `addEventHandler` method on the `AddinClient` class, passing the event type and callback function to be invoked when the event occurs:
165
+
166
+ ```js
167
+ var client = new AddinClient({
168
+ callbacks: {
169
+ init: (args) => {
170
+ args.ready({
171
+ showUI: true,
172
+ title: 'Custom entry form tab'
173
+ });
174
+ }
175
+ }
176
+ });
177
+
178
+ // To handle add-in events, call the addEventHandler method
179
+ client.addEventHandler({
180
+ eventType: 'form-data-update',
181
+ callback: function (context) {
182
+ // get updated data from context object
183
+ }
184
+ });
185
+ ```
186
+
187
+ Entry forms may also support the `form-save` and `form-cancel` event types. These event types allow the add-in client to perform an asynchronous task (e.g. call a backend service) while the form is closing. The callback's `done()` function MUST be called to allow the form to close.
188
+
189
+ ```js
190
+ var client = new AddinClient({
191
+ callbacks: {
192
+ init: (args) => {
193
+ args.ready({
194
+ showUI: true,
195
+ title: 'Custom entry form tab'
196
+ });
197
+ }
198
+ }
199
+ });
200
+
201
+ // To handle add-in events, call the addEventHandler method
202
+ client.addEventHandler({
203
+ eventType: 'form-save',
204
+ callback: function (context, done) {
205
+ // handle the save event, asynchronously
206
+
207
+ done(); // When done, call the done function (tells the entry form it's OK to close)
208
+ }
209
+ });
210
+ ```
211
+
158
212
  #### Showing a modal
159
213
  Add-ins are capable of launching a "modal" user experience to show more details or gather additional input from the user. The modal will be rendered in a separate full-screen iframe to maximize the available real estate (meaning, it will not be scoped to the bounds of the add-in's iframe).
160
214
 
@@ -322,6 +376,44 @@ var client = new AddinClient({...});
322
376
  client.hideWait();
323
377
  ```
324
378
 
379
+ #### Sending custom events to the host page
380
+ **Blackbaud Internal Only**
381
+ An add-in can send a custom event to the host page, as long as the host supports the event type.
382
+ Before sending an event to the host page, you must register for `init` and check the `supportedEventTypes`
383
+ property to determine what event types the host page will handle.
384
+
385
+ ```js
386
+ var supportedEventTypes;
387
+
388
+ var client = new AddinClient({
389
+ callbacks: {
390
+ init: (args) => {
391
+ supportedEventTypes = args.supportedEventTypes;
392
+
393
+ args.ready({
394
+ showUI: true
395
+ });
396
+ }
397
+ }
398
+ });
399
+
400
+ // Before sending event, check to make sure the event is supported by the host page
401
+ if (supportedEventTypes.includes('my-event-type')) {
402
+ // To send add-in events to the host, call the sendEvent method
403
+ client.sendEvent({
404
+ type: 'my-event-type',
405
+ context: { /* context object to pass to host page */ }
406
+ }).then(() => {
407
+ // host page received the event
408
+ }).catch((err) => {
409
+ // an error occurred while attempting to send the event
410
+ });
411
+ }
412
+ ```
413
+
414
+ To determine the add-in extension points that support custom events,
415
+ please see https://developer.blackbaud.com/skyapi/docs/addins/concepts/extension-points.
416
+
325
417
  ## Authentication
326
418
  SKY add-ins support a single-sign-on (SSO) mechanism that can be used to correlate the Blackbaud user with a user in the add-in's native system.
327
419
 
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BBSkyAddinClient=t():e.BBSkyAddinClient=t()}(window,(function(){return function(e){var t={};function s(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,s),n.l=!0,n.exports}return s.m=e,s.c=t,s.d=function(e,t,o){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(s.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)s.d(o,n,function(t){return e[t]}.bind(null,n));return o},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=0)}([function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var s in e)t.hasOwnProperty(s)||(t[s]=e[s])}(s(1))},function(e,t,s){"use strict";function o(e){for(var s in e)t.hasOwnProperty(s)||(t[s]=e[s])}Object.defineProperty(t,"__esModule",{value:!0}),o(s(2)),o(s(3))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=[/^https\:\/\/[\w\-\.]+\.blackbaud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaud\-dev\.com$/,/^http\:\/\/[\w\-\.]+\.blackbaud\-dev\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudhosting\.com$/,/^https\:\/\/[\w\-\.]+\.bbcloudservices\.com$/,/^https\:\/\/localhost(\:[0-9]+)?$/,/^https\:\/\/secure[2|3|8]\.convio\.net$/,/^https\:\/\/testweb\.convio\.com$/,/^https\:\/\/[\w\-\.]+\.conviocloud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudcloud\.com$/],n=function(){function e(e){var t=this;this.args=e,this.authTokenRequests=[],this.lastAuthTokenRequestId=0,this.modalRequests=[],this.lastModalRequestId=0,this.registeredAddinEvents={},this.windowMessageHandler=function(e){t.handleMessage(e)},window.addEventListener("message",this.windowMessageHandler),this.raiseAddinReadyMessage()}return e.getQueryString=function(){return window.location.search},e.prototype.destroy=function(){window.removeEventListener("message",this.windowMessageHandler),this.heightChangeIntervalId&&clearInterval(this.heightChangeIntervalId)},e.prototype.navigate=function(e){this.postMessageToHostPage({message:{url:e.url},messageType:"navigate"})},e.prototype.getAuthToken=function(){return this.getUserIdentityToken()},e.prototype.getUserIdentityToken=function(){var e=this;return new Promise((function(t,s){var o=++e.lastAuthTokenRequestId;e.authTokenRequests[o]={reject:s,resolve:t},e.postMessageToHostPage({message:{authTokenRequestId:o},messageType:"get-auth-token"})}))},e.prototype.showModal=function(e){var t=this;return{modalClosed:new Promise((function(s,o){var n=++t.lastModalRequestId;t.modalRequests[n]={reject:o,resolve:s},t.postMessageToHostPage({message:{args:e,modalRequestId:n},messageType:"show-modal"})}))}},e.prototype.closeModal=function(e){this.postMessageToHostPage({message:e,messageType:"close-modal"})},e.prototype.openHelp=function(e){this.postMessageToHostPage({message:{helpKey:e.helpKey},messageType:"open-help"})},e.prototype.showToast=function(e){this.postMessageToHostPage({message:e,messageType:"show-toast"})},e.prototype.showFlyout=function(e){var t=this;return{flyoutClosed:new Promise((function(s,o){e.defaultWidth=e.defaultWidth||500,e.maxWidth=e.maxWidth||e.defaultWidth,e.minWidth=e.minWidth||320,t.flyoutRequest={reject:o,resolve:s},t.postMessageToHostPage({message:e,messageType:"show-flyout"})}))}},e.prototype.closeFlyout=function(){this.postMessageToHostPage({messageType:"close-flyout"})},e.prototype.showConfirm=function(e){var t=this;return new Promise((function(s,o){t.confirmRequest={reject:o,resolve:s},t.postMessageToHostPage({message:e,messageType:"show-confirm"})}))},e.prototype.showError=function(e){this.postMessageToHostPage({message:e,messageType:"show-error"})},e.prototype.showWait=function(){this.postMessageToHostPage({messageType:"show-wait"})},e.prototype.hideWait=function(){this.postMessageToHostPage({messageType:"hide-wait"})},e.prototype.addEventHandler=function(e,t){this.registeredAddinEvents[e]=t},e.prototype.raiseAddinReadyMessage=function(){this.postMessageToHostPage({messageType:"ready"},"*")},e.prototype.handleModalClosedMessage=function(e){var t=this.modalRequests,s=e.modalRequestId;t[s].resolve(e.context),t[s]=void 0},e.prototype.handleAuthTokenMessage=function(e){var t=this.authTokenRequests,s=e.message.authTokenRequestId,o=t[s];switch(e.messageType){case"auth-token":var n=e.message.authToken;o.resolve(n);break;case"auth-token-fail":o.reject(e.message.reason)}t[s]=void 0},e.prototype.handleMessage=function(e){var t=this,s=e.data;if(s&&"bb-addin-host"===s.source)if("host-ready"===s.messageType)this.setKnownAllowedHostOrigin(e.origin),this.trackHeightChangesOfAddinContent(),this.args.callbacks.init({context:s.message.context,envId:s.message.envId,ready:function(e){t.checkForHeightChangesOfAddinContent(),t.postMessageToHostPage({message:e,messageType:"addin-ready"})}});else if(this.isFromValidOrigin(e))switch(s.messageType){case"auth-token":case"auth-token-fail":this.handleAuthTokenMessage(s);break;case"modal-closed":this.handleModalClosedMessage(s.message);break;case"button-click":this.args.callbacks.buttonClick&&this.args.callbacks.buttonClick();break;case"update-context":this.args.callbacks.updateContext&&this.args.callbacks.updateContext(s.message);break;case"confirm-closed":this.confirmRequest&&(this.confirmRequest.resolve(s.message.reason),this.confirmRequest=void 0);break;case"flyout-closed":this.flyoutRequest&&(this.flyoutRequest.resolve(),this.flyoutRequest=void 0);break;case"flyout-next-click":this.args.callbacks.flyoutNextClick&&this.args.callbacks.flyoutNextClick();break;case"flyout-previous-click":this.args.callbacks.flyoutPreviousClick&&this.args.callbacks.flyoutPreviousClick();break;case"help-click":this.args.callbacks.helpClick&&this.args.callbacks.helpClick();break;case"settings-click":this.args.callbacks.settingsClick&&this.args.callbacks.settingsClick();break;case"host-event":this.processHostEvent(s.message)}else this.warnInvalidOrigin()},e.prototype.setKnownAllowedHostOrigin=function(e){for(var t=0,s=o;t<s.length;t++){if(s[t].test(e))return void(this.trustedOrigin=e)}},e.prototype.checkForHeightChangesOfAddinContent=function(){var e=document.documentElement.offsetHeight;e!==this.lastPostedIframeHeight&&(this.lastPostedIframeHeight=e,this.postMessageToHostPage({message:{height:e+"px"},messageType:"height-change"}))},e.prototype.trackHeightChangesOfAddinContent=function(){var e=this;this.heightChangeIntervalId=setInterval((function(){e.checkForHeightChangesOfAddinContent()}),1e3)},e.prototype.postMessageToHostPage=function(e,t){e.source="bb-addin-client",e.addinId=this.getQueryVariable("addinId"),(t=t||this.trustedOrigin)?window.parent.postMessage(e,t):this.warnInvalidOrigin()},e.prototype.processHostEvent=function(e){var t=this,s=e.context,o=this.registeredAddinEvents[s.type];(o?this.isBlockingEventType(s.type)?new Promise((function(e){o(s.context,(function(){e()}))})):new Promise((function(e){o(s.context),e()})):Promise.resolve()).then((function(){return t.postEventReceivedMessage(e.eventRequestId)}))},e.prototype.isBlockingEventType=function(e){switch(e){case"form-save":case"form-cancel":return!0}return!1},e.prototype.postEventReceivedMessage=function(e){this.postMessageToHostPage({message:{eventRequestId:e},messageType:"event-received"})},e.prototype.isFromValidOrigin=function(e){return e.origin===this.trustedOrigin},e.prototype.warnInvalidOrigin=function(){console.warn("The origin is not trusted because the host-ready message has not been sent or because the host origin is not a whitelisted origin.")},e.prototype.getQueryVariable=function(t){for(var s=0,o=e.getQueryString().substring(1).split("&");s<o.length;s++){var n=o[s].split("=");if(decodeURIComponent(n[0])===t)return decodeURIComponent(n[1])}},e}();t.AddinClient=n},function(e,t,s){"use strict";function o(e){for(var s in e)t.hasOwnProperty(s)||(t[s]=e[s])}Object.defineProperty(t,"__esModule",{value:!0}),o(s(4)),o(s(5)),o(s(6)),o(s(7)),o(s(8))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.None=0]="None",e[e.Add=1]="Add",e[e.Edit=2]="Edit",e[e.Delete=3]="Delete"}(t.AddinButtonStyle||(t.AddinButtonStyle={}))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Default=0]="Default",e[e.Primary=1]="Primary",e[e.Link=2]="Link"}(t.AddinConfirmButtonStyle||(t.AddinConfirmButtonStyle={}))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.None=0]="None",e[e.Text=1]="Text"}(t.AddinTabSummaryStyle||(t.AddinTabSummaryStyle={}))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.None=0]="None",e[e.Text=1]="Text",e[e.Check=2]="Check"}(t.AddinTileSummaryStyle||(t.AddinTileSummaryStyle={}))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Danger=0]="Danger",e[e.Info=1]="Info",e[e.Success=2]="Success",e[e.Warning=3]="Warning"}(t.AddinToastStyle||(t.AddinToastStyle={}))}])}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BBSkyAddinClient=t():e.BBSkyAddinClient=t()}(window,(function(){return function(e){var t={};function s(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,s),n.l=!0,n.exports}return s.m=e,s.c=t,s.d=function(e,t,o){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(s.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)s.d(o,n,function(t){return e[t]}.bind(null,n));return o},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=0)}([function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var s in e)t.hasOwnProperty(s)||(t[s]=e[s])}(s(1))},function(e,t,s){"use strict";function o(e){for(var s in e)t.hasOwnProperty(s)||(t[s]=e[s])}Object.defineProperty(t,"__esModule",{value:!0}),o(s(2)),o(s(3))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=[/^https\:\/\/[\w\-\.]+\.blackbaud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaud\-dev\.com$/,/^http\:\/\/[\w\-\.]+\.blackbaud\-dev\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudhosting\.com$/,/^https\:\/\/[\w\-\.]+\.bbcloudservices\.com$/,/^https\:\/\/localhost(\:[0-9]+)?$/,/^https\:\/\/secure[2|3|8]\.convio\.net$/,/^https\:\/\/testweb\.convio\.com$/,/^https\:\/\/[\w\-\.]+\.conviocloud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudcloud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudfaith\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudportal\.com$/,/^https\:\/\/[\w\-\.]+\.bbk12\.com$/,/^https\:\/\/[\w\-\.]+\.mycampus\-app\.com$/,/^https\:\/\/[\w\-\.]+\.myschoolapp\.com$/,/^https\:\/\/[\w\-\.]+\.myschoolautomation\.com$/,/^https\:\/\/[\w\-\.]+\.myschooldemo\.com$/,/^https\:\/\/[\w\-\.]+\.myschooltraining\.com$/],n=function(){function e(e){var t=this;this.args=e,this.authTokenRequests=[],this.lastAuthTokenRequestId=0,this.modalRequests=[],this.lastModalRequestId=0,this.registeredAddinEvents={},this.sentEvents={},this.pendingSentEvents={},this.eventRequestId=0,this.supportedEventTypes=[],this.windowMessageHandler=function(e){t.handleMessage(e)},window.addEventListener("message",this.windowMessageHandler),this.raiseAddinReadyMessage()}return e.getQueryString=function(){return window.location.search},e.prototype.destroy=function(){window.removeEventListener("message",this.windowMessageHandler),this.heightChangeIntervalId&&clearInterval(this.heightChangeIntervalId)},e.prototype.navigate=function(e){this.postMessageToHostPage({message:{url:e.url},messageType:"navigate"})},e.prototype.getAuthToken=function(){return this.getUserIdentityToken()},e.prototype.getUserIdentityToken=function(){var e=this;return new Promise((function(t,s){var o=++e.lastAuthTokenRequestId;e.authTokenRequests[o]={reject:s,resolve:t},e.postMessageToHostPage({message:{authTokenRequestId:o},messageType:"get-auth-token"})}))},e.prototype.showModal=function(e){var t=this;return{modalClosed:new Promise((function(s,o){var n=++t.lastModalRequestId;t.modalRequests[n]={reject:o,resolve:s},t.postMessageToHostPage({message:{args:e,modalRequestId:n},messageType:"show-modal"})}))}},e.prototype.closeModal=function(e){this.postMessageToHostPage({message:e,messageType:"close-modal"})},e.prototype.openHelp=function(e){this.postMessageToHostPage({message:{helpKey:e.helpKey},messageType:"open-help"})},e.prototype.showToast=function(e){this.postMessageToHostPage({message:e,messageType:"show-toast"})},e.prototype.showFlyout=function(e){var t=this;return{flyoutClosed:new Promise((function(s,o){e.defaultWidth=e.defaultWidth||500,e.maxWidth=e.maxWidth||e.defaultWidth,e.minWidth=e.minWidth||320,t.flyoutRequest={reject:o,resolve:s},t.postMessageToHostPage({message:e,messageType:"show-flyout"})}))}},e.prototype.closeFlyout=function(){this.postMessageToHostPage({messageType:"close-flyout"})},e.prototype.showConfirm=function(e){var t=this;return new Promise((function(s,o){t.confirmRequest={reject:o,resolve:s},t.postMessageToHostPage({message:e,messageType:"show-confirm"})}))},e.prototype.showError=function(e){this.postMessageToHostPage({message:e,messageType:"show-error"})},e.prototype.showWait=function(){this.postMessageToHostPage({messageType:"show-wait"})},e.prototype.hideWait=function(){this.postMessageToHostPage({messageType:"hide-wait"})},e.prototype.addEventHandler=function(e,t){this.registeredAddinEvents[e]=t},e.prototype.sendEvent=function(e){var t=this;return new Promise((function(s,o){var n=e.type;t.supportedEventTypes.includes(n)||o("Event type not supported");var i=t.pendingSentEvents[n];i&&(clearTimeout(i.timeoutId),i.reject("Event cancelled"));var a=setTimeout((function(){delete t.pendingSentEvents[n],t.postMessageToHostPage({message:{event:e,eventRequestId:t.eventRequestId},messageType:"client-event"}),t.sentEvents[t.eventRequestId]=s,t.eventRequestId++}),200);t.pendingSentEvents[n]={reject:o,timeoutId:a}}))},e.prototype.raiseAddinReadyMessage=function(){this.postMessageToHostPage({messageType:"ready"},"*")},e.prototype.handleModalClosedMessage=function(e){var t=this.modalRequests,s=e.modalRequestId;t[s].resolve(e.context),t[s]=void 0},e.prototype.handleAuthTokenMessage=function(e){var t=this.authTokenRequests,s=e.message.authTokenRequestId,o=t[s];switch(e.messageType){case"auth-token":var n=e.message.authToken;o.resolve(n);break;case"auth-token-fail":o.reject(e.message.reason)}t[s]=void 0},e.prototype.handleMessage=function(e){var t=this,s=e.data;if(s&&"bb-addin-host"===s.source)if("host-ready"===s.messageType)this.setKnownAllowedHostOrigin(e.origin),this.trackHeightChangesOfAddinContent(),this.supportedEventTypes=s.message.supportedEventTypes,this.args.callbacks.init({context:s.message.context,envId:s.message.envId,ready:function(e){t.checkForHeightChangesOfAddinContent(),t.postMessageToHostPage({message:e,messageType:"addin-ready"})},supportedEventTypes:s.message.supportedEventTypes});else if(this.isFromValidOrigin(e))switch(s.messageType){case"auth-token":case"auth-token-fail":this.handleAuthTokenMessage(s);break;case"modal-closed":this.handleModalClosedMessage(s.message);break;case"button-click":this.args.callbacks.buttonClick&&this.args.callbacks.buttonClick();break;case"update-context":this.args.callbacks.updateContext&&this.args.callbacks.updateContext(s.message);break;case"confirm-closed":this.confirmRequest&&(this.confirmRequest.resolve(s.message.reason),this.confirmRequest=void 0);break;case"flyout-closed":this.flyoutRequest&&(this.flyoutRequest.resolve(),this.flyoutRequest=void 0);break;case"flyout-next-click":this.args.callbacks.flyoutNextClick&&this.args.callbacks.flyoutNextClick();break;case"flyout-previous-click":this.args.callbacks.flyoutPreviousClick&&this.args.callbacks.flyoutPreviousClick();break;case"help-click":this.args.callbacks.helpClick&&this.args.callbacks.helpClick();break;case"settings-click":this.args.callbacks.settingsClick&&this.args.callbacks.settingsClick();break;case"host-event":this.processHostEvent(s.message);break;case"event-received":this.resolveClientEvent(s.message)}else this.warnInvalidOrigin()},e.prototype.setKnownAllowedHostOrigin=function(e){for(var t=0,s=o;t<s.length;t++){if(s[t].test(e))return void(this.trustedOrigin=e)}},e.prototype.checkForHeightChangesOfAddinContent=function(){var e=document.documentElement.offsetHeight;e!==this.lastPostedIframeHeight&&(this.lastPostedIframeHeight=e,this.postMessageToHostPage({message:{height:e+"px"},messageType:"height-change"}))},e.prototype.trackHeightChangesOfAddinContent=function(){var e=this;this.heightChangeIntervalId=setInterval((function(){e.checkForHeightChangesOfAddinContent()}),1e3)},e.prototype.postMessageToHostPage=function(e,t){e.source="bb-addin-client",e.addinId=this.getQueryVariable("addinId"),(t=t||this.trustedOrigin)?window.parent.postMessage(e,t):this.warnInvalidOrigin()},e.prototype.processHostEvent=function(e){var t=this,s=e.context,o=this.registeredAddinEvents[s.type];(o?this.isBlockingEventType(s.type)?new Promise((function(e){o(s.context,(function(){e()}))})):new Promise((function(e){o(s.context),e()})):Promise.resolve()).then((function(){return t.postEventReceivedMessage(e.eventRequestId)}))},e.prototype.isBlockingEventType=function(e){switch(e){case"form-save":case"form-cancel":return!0}return!1},e.prototype.postEventReceivedMessage=function(e){this.postMessageToHostPage({message:{eventRequestId:e},messageType:"event-received"})},e.prototype.resolveClientEvent=function(e){var t=e.eventRequestId,s=this.sentEvents[t];s&&(s(),delete this.sentEvents[t])},e.prototype.isFromValidOrigin=function(e){return e.origin===this.trustedOrigin},e.prototype.warnInvalidOrigin=function(){console.warn("The origin is not trusted because the host-ready message has not been sent or because the host origin is not a whitelisted origin.")},e.prototype.getQueryVariable=function(t){for(var s=0,o=e.getQueryString().substring(1).split("&");s<o.length;s++){var n=o[s].split("=");if(decodeURIComponent(n[0])===t)return decodeURIComponent(n[1])}},e}();t.AddinClient=n},function(e,t,s){"use strict";function o(e){for(var s in e)t.hasOwnProperty(s)||(t[s]=e[s])}Object.defineProperty(t,"__esModule",{value:!0}),o(s(4)),o(s(5)),o(s(6)),o(s(7)),o(s(8))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.None=0]="None",e[e.Add=1]="Add",e[e.Edit=2]="Edit",e[e.Delete=3]="Delete"}(t.AddinButtonStyle||(t.AddinButtonStyle={}))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Default=0]="Default",e[e.Primary=1]="Primary",e[e.Link=2]="Link"}(t.AddinConfirmButtonStyle||(t.AddinConfirmButtonStyle={}))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.None=0]="None",e[e.Text=1]="Text"}(t.AddinTabSummaryStyle||(t.AddinTabSummaryStyle={}))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.None=0]="None",e[e.Text=1]="Text",e[e.Check=2]="Check"}(t.AddinTileSummaryStyle||(t.AddinTileSummaryStyle={}))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Danger=0]="Danger",e[e.Info=1]="Info",e[e.Success=2]="Success",e[e.Warning=3]="Warning"}(t.AddinToastStyle||(t.AddinToastStyle={}))}])}));
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BBSkyAddinClient=t():e.BBSkyAddinClient=t()}(window,function(){return function(s){var o={};function n(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return s[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}return n.m=s,n.c=o,n.d=function(e,t,s){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__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 s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(s,o,function(e){return t[e]}.bind(null,o));return s},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,s,t){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),function(e){for(var t in e)s.hasOwnProperty(t)||(s[t]=e[t])}(t(1))},function(e,s,t){"use strict";function o(e){for(var t in e)s.hasOwnProperty(t)||(s[t]=e[t])}Object.defineProperty(s,"__esModule",{value:!0}),o(t(2)),o(t(3))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=[/^https\:\/\/[\w\-\.]+\.blackbaud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaud\-dev\.com$/,/^http\:\/\/[\w\-\.]+\.blackbaud\-dev\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudhosting\.com$/,/^https\:\/\/[\w\-\.]+\.bbcloudservices\.com$/,/^https\:\/\/localhost(\:[0-9]+)?$/,/^https\:\/\/secure[2|3|8]\.convio\.net$/,/^https\:\/\/testweb\.convio\.com$/,/^https\:\/\/[\w\-\.]+\.conviocloud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudcloud\.com$/],n=function(){function n(e){var t=this;this.args=e,this.authTokenRequests=[],this.lastAuthTokenRequestId=0,this.modalRequests=[],this.lastModalRequestId=0,this.registeredAddinEvents={},this.windowMessageHandler=function(e){t.handleMessage(e)},window.addEventListener("message",this.windowMessageHandler),this.raiseAddinReadyMessage()}return n.getQueryString=function(){return window.location.search},n.prototype.destroy=function(){window.removeEventListener("message",this.windowMessageHandler),this.heightChangeIntervalId&&clearInterval(this.heightChangeIntervalId)},n.prototype.navigate=function(e){this.postMessageToHostPage({message:{url:e.url},messageType:"navigate"})},n.prototype.getAuthToken=function(){return this.getUserIdentityToken()},n.prototype.getUserIdentityToken=function(){var o=this;return new Promise(function(e,t){var s=++o.lastAuthTokenRequestId;o.authTokenRequests[s]={reject:t,resolve:e},o.postMessageToHostPage({message:{authTokenRequestId:s},messageType:"get-auth-token"})})},n.prototype.showModal=function(o){var n=this;return{modalClosed:new Promise(function(e,t){var s=++n.lastModalRequestId;n.modalRequests[s]={reject:t,resolve:e},n.postMessageToHostPage({message:{args:o,modalRequestId:s},messageType:"show-modal"})})}},n.prototype.closeModal=function(e){this.postMessageToHostPage({message:e,messageType:"close-modal"})},n.prototype.openHelp=function(e){this.postMessageToHostPage({message:{helpKey:e.helpKey},messageType:"open-help"})},n.prototype.showToast=function(e){this.postMessageToHostPage({message:e,messageType:"show-toast"})},n.prototype.showFlyout=function(s){var o=this;return{flyoutClosed:new Promise(function(e,t){s.defaultWidth=s.defaultWidth||500,s.maxWidth=s.maxWidth||s.defaultWidth,s.minWidth=s.minWidth||320,o.flyoutRequest={reject:t,resolve:e},o.postMessageToHostPage({message:s,messageType:"show-flyout"})})}},n.prototype.closeFlyout=function(){this.postMessageToHostPage({messageType:"close-flyout"})},n.prototype.showConfirm=function(s){var o=this;return new Promise(function(e,t){o.confirmRequest={reject:t,resolve:e},o.postMessageToHostPage({message:s,messageType:"show-confirm"})})},n.prototype.showError=function(e){this.postMessageToHostPage({message:e,messageType:"show-error"})},n.prototype.showWait=function(){this.postMessageToHostPage({messageType:"show-wait"})},n.prototype.hideWait=function(){this.postMessageToHostPage({messageType:"hide-wait"})},n.prototype.addEventHandler=function(e,t){this.registeredAddinEvents[e]=t},n.prototype.raiseAddinReadyMessage=function(){this.postMessageToHostPage({messageType:"ready"},"*")},n.prototype.handleModalClosedMessage=function(e){var t=this.modalRequests,s=e.modalRequestId;t[s].resolve(e.context),t[s]=void 0},n.prototype.handleAuthTokenMessage=function(e){var t=this.authTokenRequests,s=e.message.authTokenRequestId,o=t[s];switch(e.messageType){case"auth-token":var n=e.message.authToken;o.resolve(n);break;case"auth-token-fail":o.reject(e.message.reason)}t[s]=void 0},n.prototype.handleMessage=function(e){var t=this,s=e.data;if(s&&"bb-addin-host"===s.source)if("host-ready"===s.messageType)this.setKnownAllowedHostOrigin(e.origin),this.trackHeightChangesOfAddinContent(),this.args.callbacks.init({context:s.message.context,envId:s.message.envId,ready:function(e){t.checkForHeightChangesOfAddinContent(),t.postMessageToHostPage({message:e,messageType:"addin-ready"})}});else if(this.isFromValidOrigin(e))switch(s.messageType){case"auth-token":case"auth-token-fail":this.handleAuthTokenMessage(s);break;case"modal-closed":this.handleModalClosedMessage(s.message);break;case"button-click":this.args.callbacks.buttonClick&&this.args.callbacks.buttonClick();break;case"update-context":this.args.callbacks.updateContext&&this.args.callbacks.updateContext(s.message);break;case"confirm-closed":this.confirmRequest&&(this.confirmRequest.resolve(s.message.reason),this.confirmRequest=void 0);break;case"flyout-closed":this.flyoutRequest&&(this.flyoutRequest.resolve(),this.flyoutRequest=void 0);break;case"flyout-next-click":this.args.callbacks.flyoutNextClick&&this.args.callbacks.flyoutNextClick();break;case"flyout-previous-click":this.args.callbacks.flyoutPreviousClick&&this.args.callbacks.flyoutPreviousClick();break;case"help-click":this.args.callbacks.helpClick&&this.args.callbacks.helpClick();break;case"settings-click":this.args.callbacks.settingsClick&&this.args.callbacks.settingsClick();break;case"host-event":this.processHostEvent(s.message)}else this.warnInvalidOrigin()},n.prototype.setKnownAllowedHostOrigin=function(e){for(var t=0,s=o;t<s.length;t++){if(s[t].test(e))return void(this.trustedOrigin=e)}},n.prototype.checkForHeightChangesOfAddinContent=function(){var e=document.documentElement.offsetHeight;e!==this.lastPostedIframeHeight&&(this.lastPostedIframeHeight=e,this.postMessageToHostPage({message:{height:e+"px"},messageType:"height-change"}))},n.prototype.trackHeightChangesOfAddinContent=function(){var e=this;this.heightChangeIntervalId=setInterval(function(){e.checkForHeightChangesOfAddinContent()},1e3)},n.prototype.postMessageToHostPage=function(e,t){e.source="bb-addin-client",e.addinId=this.getQueryVariable("addinId"),(t=t||this.trustedOrigin)?window.parent.postMessage(e,t):this.warnInvalidOrigin()},n.prototype.processHostEvent=function(e){var t=this,s=e.context,o=this.registeredAddinEvents[s.type];(o?this.isBlockingEventType(s.type)?new Promise(function(e){o(s.context,function(){e()})}):new Promise(function(e){o(s.context),e()}):Promise.resolve()).then(function(){return t.postEventReceivedMessage(e.eventRequestId)})},n.prototype.isBlockingEventType=function(e){switch(e){case"form-save":case"form-cancel":return!0}return!1},n.prototype.postEventReceivedMessage=function(e){this.postMessageToHostPage({message:{eventRequestId:e},messageType:"event-received"})},n.prototype.isFromValidOrigin=function(e){return e.origin===this.trustedOrigin},n.prototype.warnInvalidOrigin=function(){console.warn("The origin is not trusted because the host-ready message has not been sent or because the host origin is not a whitelisted origin.")},n.prototype.getQueryVariable=function(e){for(var t=0,s=n.getQueryString().substring(1).split("&");t<s.length;t++){var o=s[t].split("=");if(decodeURIComponent(o[0])===e)return decodeURIComponent(o[1])}},n}();t.AddinClient=n},function(e,s,t){"use strict";function o(e){for(var t in e)s.hasOwnProperty(t)||(s[t]=e[t])}Object.defineProperty(s,"__esModule",{value:!0}),o(t(4)),o(t(5)),o(t(6)),o(t(7)),o(t(8))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.None=0]="None",e[e.Add=1]="Add",e[e.Edit=2]="Edit",e[e.Delete=3]="Delete"}(t.AddinButtonStyle||(t.AddinButtonStyle={}))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Default=0]="Default",e[e.Primary=1]="Primary",e[e.Link=2]="Link"}(t.AddinConfirmButtonStyle||(t.AddinConfirmButtonStyle={}))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.None=0]="None",e[e.Text=1]="Text"}(t.AddinTabSummaryStyle||(t.AddinTabSummaryStyle={}))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.None=0]="None",e[e.Text=1]="Text",e[e.Check=2]="Check"}(t.AddinTileSummaryStyle||(t.AddinTileSummaryStyle={}))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Danger=0]="Danger",e[e.Info=1]="Info",e[e.Success=2]="Success",e[e.Warning=3]="Warning"}(t.AddinToastStyle||(t.AddinToastStyle={}))}])});
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BBSkyAddinClient=t():e.BBSkyAddinClient=t()}(window,function(){return function(s){var o={};function n(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return s[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}return n.m=s,n.c=o,n.d=function(e,t,s){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__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 s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(s,o,function(e){return t[e]}.bind(null,o));return s},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,s,t){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),function(e){for(var t in e)s.hasOwnProperty(t)||(s[t]=e[t])}(t(1))},function(e,s,t){"use strict";function o(e){for(var t in e)s.hasOwnProperty(t)||(s[t]=e[t])}Object.defineProperty(s,"__esModule",{value:!0}),o(t(2)),o(t(3))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=[/^https\:\/\/[\w\-\.]+\.blackbaud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaud\-dev\.com$/,/^http\:\/\/[\w\-\.]+\.blackbaud\-dev\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudhosting\.com$/,/^https\:\/\/[\w\-\.]+\.bbcloudservices\.com$/,/^https\:\/\/localhost(\:[0-9]+)?$/,/^https\:\/\/secure[2|3|8]\.convio\.net$/,/^https\:\/\/testweb\.convio\.com$/,/^https\:\/\/[\w\-\.]+\.conviocloud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudcloud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudfaith\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudportal\.com$/,/^https\:\/\/[\w\-\.]+\.bbk12\.com$/,/^https\:\/\/[\w\-\.]+\.mycampus\-app\.com$/,/^https\:\/\/[\w\-\.]+\.myschoolapp\.com$/,/^https\:\/\/[\w\-\.]+\.myschoolautomation\.com$/,/^https\:\/\/[\w\-\.]+\.myschooldemo\.com$/,/^https\:\/\/[\w\-\.]+\.myschooltraining\.com$/],n=function(){function n(e){var t=this;this.args=e,this.authTokenRequests=[],this.lastAuthTokenRequestId=0,this.modalRequests=[],this.lastModalRequestId=0,this.registeredAddinEvents={},this.sentEvents={},this.pendingSentEvents={},this.eventRequestId=0,this.supportedEventTypes=[],this.windowMessageHandler=function(e){t.handleMessage(e)},window.addEventListener("message",this.windowMessageHandler),this.raiseAddinReadyMessage()}return n.getQueryString=function(){return window.location.search},n.prototype.destroy=function(){window.removeEventListener("message",this.windowMessageHandler),this.heightChangeIntervalId&&clearInterval(this.heightChangeIntervalId)},n.prototype.navigate=function(e){this.postMessageToHostPage({message:{url:e.url},messageType:"navigate"})},n.prototype.getAuthToken=function(){return this.getUserIdentityToken()},n.prototype.getUserIdentityToken=function(){var o=this;return new Promise(function(e,t){var s=++o.lastAuthTokenRequestId;o.authTokenRequests[s]={reject:t,resolve:e},o.postMessageToHostPage({message:{authTokenRequestId:s},messageType:"get-auth-token"})})},n.prototype.showModal=function(o){var n=this;return{modalClosed:new Promise(function(e,t){var s=++n.lastModalRequestId;n.modalRequests[s]={reject:t,resolve:e},n.postMessageToHostPage({message:{args:o,modalRequestId:s},messageType:"show-modal"})})}},n.prototype.closeModal=function(e){this.postMessageToHostPage({message:e,messageType:"close-modal"})},n.prototype.openHelp=function(e){this.postMessageToHostPage({message:{helpKey:e.helpKey},messageType:"open-help"})},n.prototype.showToast=function(e){this.postMessageToHostPage({message:e,messageType:"show-toast"})},n.prototype.showFlyout=function(s){var o=this;return{flyoutClosed:new Promise(function(e,t){s.defaultWidth=s.defaultWidth||500,s.maxWidth=s.maxWidth||s.defaultWidth,s.minWidth=s.minWidth||320,o.flyoutRequest={reject:t,resolve:e},o.postMessageToHostPage({message:s,messageType:"show-flyout"})})}},n.prototype.closeFlyout=function(){this.postMessageToHostPage({messageType:"close-flyout"})},n.prototype.showConfirm=function(s){var o=this;return new Promise(function(e,t){o.confirmRequest={reject:t,resolve:e},o.postMessageToHostPage({message:s,messageType:"show-confirm"})})},n.prototype.showError=function(e){this.postMessageToHostPage({message:e,messageType:"show-error"})},n.prototype.showWait=function(){this.postMessageToHostPage({messageType:"show-wait"})},n.prototype.hideWait=function(){this.postMessageToHostPage({messageType:"hide-wait"})},n.prototype.addEventHandler=function(e,t){this.registeredAddinEvents[e]=t},n.prototype.sendEvent=function(i){var a=this;return new Promise(function(e,t){var s=i.type;a.supportedEventTypes.includes(s)||t("Event type not supported");var o=a.pendingSentEvents[s];o&&(clearTimeout(o.timeoutId),o.reject("Event cancelled"));var n=setTimeout(function(){delete a.pendingSentEvents[s],a.postMessageToHostPage({message:{event:i,eventRequestId:a.eventRequestId},messageType:"client-event"}),a.sentEvents[a.eventRequestId]=e,a.eventRequestId++},200);a.pendingSentEvents[s]={reject:t,timeoutId:n}})},n.prototype.raiseAddinReadyMessage=function(){this.postMessageToHostPage({messageType:"ready"},"*")},n.prototype.handleModalClosedMessage=function(e){var t=this.modalRequests,s=e.modalRequestId;t[s].resolve(e.context),t[s]=void 0},n.prototype.handleAuthTokenMessage=function(e){var t=this.authTokenRequests,s=e.message.authTokenRequestId,o=t[s];switch(e.messageType){case"auth-token":var n=e.message.authToken;o.resolve(n);break;case"auth-token-fail":o.reject(e.message.reason)}t[s]=void 0},n.prototype.handleMessage=function(e){var t=this,s=e.data;if(s&&"bb-addin-host"===s.source)if("host-ready"===s.messageType)this.setKnownAllowedHostOrigin(e.origin),this.trackHeightChangesOfAddinContent(),this.supportedEventTypes=s.message.supportedEventTypes,this.args.callbacks.init({context:s.message.context,envId:s.message.envId,ready:function(e){t.checkForHeightChangesOfAddinContent(),t.postMessageToHostPage({message:e,messageType:"addin-ready"})},supportedEventTypes:s.message.supportedEventTypes});else if(this.isFromValidOrigin(e))switch(s.messageType){case"auth-token":case"auth-token-fail":this.handleAuthTokenMessage(s);break;case"modal-closed":this.handleModalClosedMessage(s.message);break;case"button-click":this.args.callbacks.buttonClick&&this.args.callbacks.buttonClick();break;case"update-context":this.args.callbacks.updateContext&&this.args.callbacks.updateContext(s.message);break;case"confirm-closed":this.confirmRequest&&(this.confirmRequest.resolve(s.message.reason),this.confirmRequest=void 0);break;case"flyout-closed":this.flyoutRequest&&(this.flyoutRequest.resolve(),this.flyoutRequest=void 0);break;case"flyout-next-click":this.args.callbacks.flyoutNextClick&&this.args.callbacks.flyoutNextClick();break;case"flyout-previous-click":this.args.callbacks.flyoutPreviousClick&&this.args.callbacks.flyoutPreviousClick();break;case"help-click":this.args.callbacks.helpClick&&this.args.callbacks.helpClick();break;case"settings-click":this.args.callbacks.settingsClick&&this.args.callbacks.settingsClick();break;case"host-event":this.processHostEvent(s.message);break;case"event-received":this.resolveClientEvent(s.message)}else this.warnInvalidOrigin()},n.prototype.setKnownAllowedHostOrigin=function(e){for(var t=0,s=o;t<s.length;t++){if(s[t].test(e))return void(this.trustedOrigin=e)}},n.prototype.checkForHeightChangesOfAddinContent=function(){var e=document.documentElement.offsetHeight;e!==this.lastPostedIframeHeight&&(this.lastPostedIframeHeight=e,this.postMessageToHostPage({message:{height:e+"px"},messageType:"height-change"}))},n.prototype.trackHeightChangesOfAddinContent=function(){var e=this;this.heightChangeIntervalId=setInterval(function(){e.checkForHeightChangesOfAddinContent()},1e3)},n.prototype.postMessageToHostPage=function(e,t){e.source="bb-addin-client",e.addinId=this.getQueryVariable("addinId"),(t=t||this.trustedOrigin)?window.parent.postMessage(e,t):this.warnInvalidOrigin()},n.prototype.processHostEvent=function(e){var t=this,s=e.context,o=this.registeredAddinEvents[s.type];(o?this.isBlockingEventType(s.type)?new Promise(function(e){o(s.context,function(){e()})}):new Promise(function(e){o(s.context),e()}):Promise.resolve()).then(function(){return t.postEventReceivedMessage(e.eventRequestId)})},n.prototype.isBlockingEventType=function(e){switch(e){case"form-save":case"form-cancel":return!0}return!1},n.prototype.postEventReceivedMessage=function(e){this.postMessageToHostPage({message:{eventRequestId:e},messageType:"event-received"})},n.prototype.resolveClientEvent=function(e){var t=e.eventRequestId,s=this.sentEvents[t];s&&(s(),delete this.sentEvents[t])},n.prototype.isFromValidOrigin=function(e){return e.origin===this.trustedOrigin},n.prototype.warnInvalidOrigin=function(){console.warn("The origin is not trusted because the host-ready message has not been sent or because the host origin is not a whitelisted origin.")},n.prototype.getQueryVariable=function(e){for(var t=0,s=n.getQueryString().substring(1).split("&");t<s.length;t++){var o=s[t].split("=");if(decodeURIComponent(o[0])===e)return decodeURIComponent(o[1])}},n}();t.AddinClient=n},function(e,s,t){"use strict";function o(e){for(var t in e)s.hasOwnProperty(t)||(s[t]=e[t])}Object.defineProperty(s,"__esModule",{value:!0}),o(t(4)),o(t(5)),o(t(6)),o(t(7)),o(t(8))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.None=0]="None",e[e.Add=1]="Add",e[e.Edit=2]="Edit",e[e.Delete=3]="Delete"}(t.AddinButtonStyle||(t.AddinButtonStyle={}))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Default=0]="Default",e[e.Primary=1]="Primary",e[e.Link=2]="Link"}(t.AddinConfirmButtonStyle||(t.AddinConfirmButtonStyle={}))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.None=0]="None",e[e.Text=1]="Text"}(t.AddinTabSummaryStyle||(t.AddinTabSummaryStyle={}))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.None=0]="None",e[e.Text=1]="Text",e[e.Check=2]="Check"}(t.AddinTileSummaryStyle||(t.AddinTileSummaryStyle={}))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Danger=0]="Danger",e[e.Info=1]="Info",e[e.Success=2]="Success",e[e.Warning=3]="Warning"}(t.AddinToastStyle||(t.AddinToastStyle={}))}])});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blackbaud/sky-addin-client",
3
- "version": "1.1.0",
3
+ "version": "1.1.3",
4
4
  "description": "SKY add-in client",
5
5
  "main": "dist/bundles/sky-addin-client.umd.js",
6
6
  "module": "index.js",
@@ -1,5 +1,6 @@
1
1
  import { AddinClientArgs } from './client-interfaces/addin-client-args';
2
2
  import { AddinClientCloseModalArgs } from './client-interfaces/addin-client-close-modal-args';
3
+ import { AddinClientEventArgs } from './client-interfaces/addin-client-event-args';
3
4
  import { AddinClientNavigateArgs } from './client-interfaces/addin-client-navigate-args';
4
5
  import { AddinClientOpenHelpArgs } from './client-interfaces/addin-client-open-help-args';
5
6
  import { AddinClientShowConfirmArgs } from './client-interfaces/addin-client-show-confirm-args';
@@ -71,6 +72,29 @@ export declare class AddinClient {
71
72
  * Value - The callback function to be executed when the event type occurs.
72
73
  */
73
74
  private registeredAddinEvents;
75
+ /**
76
+ * Stores the add-in events that have been sent to the host page.
77
+ * Key - the event request ID.
78
+ * Value - The Promise resolve function to be executed when the event is received by the host.
79
+ */
80
+ private sentEvents;
81
+ /**
82
+ * Stores the pending add-in events that are queued to be sent to the host page after 200
83
+ * milliseconds have expired.
84
+ * Key - the event type.
85
+ * Value - The Promise reject function to be executed if the event fails to be sent to the host page.
86
+ */
87
+ private pendingSentEvents;
88
+ /**
89
+ * The event request ID counter.
90
+ * The ID is incremented and assigned to each event that is sent.
91
+ */
92
+ private eventRequestId;
93
+ /**
94
+ * An array of event types that are supported by the host page.
95
+ * The add-in client will throw an error if an event is attempted but not one the supported types.
96
+ */
97
+ private supportedEventTypes;
74
98
  /**
75
99
  * @returns {string} Returns the current query string path for the window, prefixed with ?.
76
100
  */
@@ -155,6 +179,15 @@ export declare class AddinClient {
155
179
  * @param callback The callback to execute when the event occurs.
156
180
  */
157
181
  addEventHandler(eventType: string, callback: AddinEventCallback): void;
182
+ /**
183
+ * Sends an event to be handled by the host page.
184
+ * Supported for Blackbaud internal only
185
+ * @returns {Promise<void>} Returns a Promise which will resolve when the add-in host page receives the message, or
186
+ * rejects if a subsequent event occurs, for the same event type, within 200 milliseconds.
187
+ * The Promise also rejects if an event type is not one of the supported types from the host page.
188
+ * @see AddinClientInitArgs#supportedEventTypes
189
+ */
190
+ sendEvent(args: AddinClientEventArgs): Promise<void>;
158
191
  /**
159
192
  * Post a message to the host page informing it that the add-in is
160
193
  * now started and listening for messages from the host.
@@ -217,7 +250,16 @@ export declare class AddinClient {
217
250
  * @param type The event type.
218
251
  */
219
252
  private isBlockingEventType;
253
+ /**
254
+ * Posts a message to the host page to indicate that a certain event has been received.
255
+ * @param eventRequestId The ID of the event request that was received.
256
+ */
220
257
  private postEventReceivedMessage;
258
+ /**
259
+ * Attemps to resolve the Promise for a client event that has been received by the host page.
260
+ * @param message Message data that includes the ID of the event that was received.
261
+ */
262
+ private resolveClientEvent;
221
263
  /**
222
264
  * Checks whether a MessageEvent is from the execetd host origin.
223
265
  * @param event
@@ -13,7 +13,15 @@ var allowedOrigins = [
13
13
  /^https\:\/\/secure[2|3|8]\.convio\.net$/,
14
14
  /^https\:\/\/testweb\.convio\.com$/,
15
15
  /^https\:\/\/[\w\-\.]+\.conviocloud\.com$/,
16
- /^https\:\/\/[\w\-\.]+\.blackbaudcloud\.com$/
16
+ /^https\:\/\/[\w\-\.]+\.blackbaudcloud\.com$/,
17
+ /^https\:\/\/[\w\-\.]+\.blackbaudfaith\.com$/,
18
+ /^https\:\/\/[\w\-\.]+\.blackbaudportal\.com$/,
19
+ /^https\:\/\/[\w\-\.]+\.bbk12\.com$/,
20
+ /^https\:\/\/[\w\-\.]+\.mycampus\-app\.com$/,
21
+ /^https\:\/\/[\w\-\.]+\.myschoolapp\.com$/,
22
+ /^https\:\/\/[\w\-\.]+\.myschoolautomation\.com$/,
23
+ /^https\:\/\/[\w\-\.]+\.myschooldemo\.com$/,
24
+ /^https\:\/\/[\w\-\.]+\.myschooltraining\.com$/
17
25
  ];
18
26
  /**
19
27
  * Client for interacting with the parent page hosting the add-in.
@@ -44,6 +52,29 @@ var AddinClient = /** @class */ (function () {
44
52
  * Value - The callback function to be executed when the event type occurs.
45
53
  */
46
54
  this.registeredAddinEvents = {};
55
+ /**
56
+ * Stores the add-in events that have been sent to the host page.
57
+ * Key - the event request ID.
58
+ * Value - The Promise resolve function to be executed when the event is received by the host.
59
+ */
60
+ this.sentEvents = {};
61
+ /**
62
+ * Stores the pending add-in events that are queued to be sent to the host page after 200
63
+ * milliseconds have expired.
64
+ * Key - the event type.
65
+ * Value - The Promise reject function to be executed if the event fails to be sent to the host page.
66
+ */
67
+ this.pendingSentEvents = {};
68
+ /**
69
+ * The event request ID counter.
70
+ * The ID is incremented and assigned to each event that is sent.
71
+ */
72
+ this.eventRequestId = 0;
73
+ /**
74
+ * An array of event types that are supported by the host page.
75
+ * The add-in client will throw an error if an event is attempted but not one the supported types.
76
+ */
77
+ this.supportedEventTypes = [];
47
78
  this.windowMessageHandler = function (event) {
48
79
  _this.handleMessage(event);
49
80
  };
@@ -252,6 +283,45 @@ var AddinClient = /** @class */ (function () {
252
283
  AddinClient.prototype.addEventHandler = function (eventType, callback) {
253
284
  this.registeredAddinEvents[eventType] = callback;
254
285
  };
286
+ /**
287
+ * Sends an event to be handled by the host page.
288
+ * Supported for Blackbaud internal only
289
+ * @returns {Promise<void>} Returns a Promise which will resolve when the add-in host page receives the message, or
290
+ * rejects if a subsequent event occurs, for the same event type, within 200 milliseconds.
291
+ * The Promise also rejects if an event type is not one of the supported types from the host page.
292
+ * @see AddinClientInitArgs#supportedEventTypes
293
+ */
294
+ AddinClient.prototype.sendEvent = function (args) {
295
+ var _this = this;
296
+ return new Promise(function (resolve, reject) {
297
+ var eventType = args.type;
298
+ if (!_this.supportedEventTypes.includes(eventType)) {
299
+ reject('Event type not supported');
300
+ }
301
+ var pendingEvent = _this.pendingSentEvents[eventType];
302
+ if (pendingEvent) {
303
+ // cancel and reject pending event
304
+ clearTimeout(pendingEvent.timeoutId);
305
+ pendingEvent.reject('Event cancelled');
306
+ }
307
+ var timeoutId = setTimeout(function () {
308
+ delete _this.pendingSentEvents[eventType];
309
+ _this.postMessageToHostPage({
310
+ message: {
311
+ event: args,
312
+ eventRequestId: _this.eventRequestId
313
+ },
314
+ messageType: 'client-event'
315
+ });
316
+ _this.sentEvents[_this.eventRequestId] = resolve;
317
+ _this.eventRequestId++;
318
+ }, 200);
319
+ _this.pendingSentEvents[eventType] = {
320
+ reject: reject,
321
+ timeoutId: timeoutId
322
+ };
323
+ });
324
+ };
255
325
  /**
256
326
  * Post a message to the host page informing it that the add-in is
257
327
  * now started and listening for messages from the host.
@@ -316,6 +386,8 @@ var AddinClient = /** @class */ (function () {
316
386
  // communications with the host page will be blocked.
317
387
  this.setKnownAllowedHostOrigin(event.origin);
318
388
  this.trackHeightChangesOfAddinContent();
389
+ // set the supported event types
390
+ this.supportedEventTypes = data.message.supportedEventTypes;
319
391
  // Pass key data to the add-in for it to initiailze.
320
392
  this.args.callbacks.init({
321
393
  context: data.message.context,
@@ -328,7 +400,8 @@ var AddinClient = /** @class */ (function () {
328
400
  message: args,
329
401
  messageType: 'addin-ready'
330
402
  });
331
- }
403
+ },
404
+ supportedEventTypes: data.message.supportedEventTypes
332
405
  });
333
406
  }
334
407
  else if (this.isFromValidOrigin(event)) {
@@ -387,6 +460,9 @@ var AddinClient = /** @class */ (function () {
387
460
  case 'host-event':
388
461
  this.processHostEvent(data.message);
389
462
  break;
463
+ case 'event-received':
464
+ this.resolveClientEvent(data.message);
465
+ break;
390
466
  }
391
467
  }
392
468
  else {
@@ -500,6 +576,10 @@ var AddinClient = /** @class */ (function () {
500
576
  }
501
577
  return false;
502
578
  };
579
+ /**
580
+ * Posts a message to the host page to indicate that a certain event has been received.
581
+ * @param eventRequestId The ID of the event request that was received.
582
+ */
503
583
  AddinClient.prototype.postEventReceivedMessage = function (eventRequestId) {
504
584
  this.postMessageToHostPage({
505
585
  message: {
@@ -508,6 +588,18 @@ var AddinClient = /** @class */ (function () {
508
588
  messageType: 'event-received'
509
589
  });
510
590
  };
591
+ /**
592
+ * Attemps to resolve the Promise for a client event that has been received by the host page.
593
+ * @param message Message data that includes the ID of the event that was received.
594
+ */
595
+ AddinClient.prototype.resolveClientEvent = function (message) {
596
+ var requestId = message.eventRequestId;
597
+ var promiseResolve = this.sentEvents[requestId];
598
+ if (promiseResolve) {
599
+ promiseResolve();
600
+ delete this.sentEvents[requestId];
601
+ }
602
+ };
511
603
  /**
512
604
  * Checks whether a MessageEvent is from the execetd host origin.
513
605
  * @param event
@@ -1 +1 @@
1
- {"version":3,"file":"addin-client.js","sourceRoot":"","sources":["../../../src/addin/addin-client.ts"],"names":[],"mappings":";;AAgBA;;GAEG;AACH,IAAM,cAAc,GAAG;IACrB,wCAAwC;IACxC,6CAA6C;IAC7C,4CAA4C;IAC5C,+CAA+C;IAC/C,8CAA8C;IAC9C,mCAAmC;IACnC,yCAAyC;IACzC,mCAAmC;IACnC,0CAA0C;IAC1C,6CAA6C;CAC9C,CAAC;AAcF;;GAEG;AACH;IAmEE,qBAAoB,IAAqB;QAAzC,iBAUC;QAVmB,SAAI,GAAJ,IAAI,CAAiB;QAjEzC;;WAEG;QACK,sBAAiB,GAAU,EAAE,CAAC;QAEtC;;WAEG;QACK,2BAAsB,GAAG,CAAC,CAAC;QAEnC;;WAEG;QACK,kBAAa,GAAU,EAAE,CAAC;QAElC;;WAEG;QACK,uBAAkB,GAAG,CAAC,CAAC;QA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;OAGG;IACK,wCAAkB,GAA1B,UAA2B,OAAY;QACrC,IAAM,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC;QACzC,IAAM,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,cAAc,EAAE;YAClB,cAAc,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;SACnC;IACH,CAAC;IAED;;;OAGG;IACK,uCAAiB,GAAzB,UAA0B,KAAmB;QAC3C,OAAO,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,aAAa,CAAC;IAC7C,CAAC;IAED;;OAEG;IACK,uCAAiB,GAAzB;QACE,OAAO,CAAC,IAAI,CACV,wEAAwE;YACxE,8DAA8D,CAC/D,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACK,sCAAgB,GAAxB,UAAyB,QAAa;QACpC,IAAM,KAAK,GAAG,WAAW,CAAC,cAAc,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACxD,IAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9B,KAAgB,UAAI,EAAJ,aAAI,EAAJ,kBAAI,EAAJ,IAAI,EAAE;YAAjB,IAAM,CAAC,aAAA;YACV,IAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC1B,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;gBAC5C,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;aACpC;SACF;IACH,CAAC;IAEH,kBAAC;AAAD,CAAC,AArrBD,IAqrBC;AArrBY,kCAAW"}
@@ -11,6 +11,10 @@ export interface AddinClientInitArgs {
11
11
  * Additional context of the host page, which will vary for different extension points.
12
12
  */
13
13
  context?: any;
14
+ /**
15
+ * Event types that are supported by the host page.
16
+ */
17
+ supportedEventTypes?: string[];
14
18
  /**
15
19
  * Call to inform the add-in client that the add-in is initialized and ready to be shown.
16
20
  * @param args Arguments describing how the add-in should render.
@@ -32,4 +32,8 @@ export interface AddinHostMessage {
32
32
  * auth-token-fail message or action message for closing a dialog.
33
33
  */
34
34
  reason?: string;
35
+ /**
36
+ * Event types that are supported by the host page.
37
+ */
38
+ supportedEventTypes?: string[];
35
39
  }