@blackbaud/sky-addin-client 1.0.20 → 1.1.2
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 +12 -0
- package/README.md +99 -15
- package/bundles/sky-addin-client.umd.js +1 -1
- package/bundles/sky-addin-client.umd.min.js +1 -1
- package/package.json +3 -3
- package/src/addin/addin-client.d.ts +63 -3
- package/src/addin/addin-client.js +127 -6
- package/src/addin/addin-client.js.map +1 -1
- package/src/addin/client-interfaces/addin-client-callbacks.d.ts +1 -0
- package/src/addin/client-interfaces/addin-client-init-args.d.ts +4 -0
- package/src/addin/client-interfaces/addin-client-open-help-args.d.ts +1 -0
- package/src/addin/client-interfaces/addin-tile-config.d.ts +1 -0
- package/src/addin/host-interfaces/addin-host-message.d.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# 1.1.2 (2022-02-01)
|
|
2
|
+
- Updated `allowedOrigins` to support congregant portal
|
|
3
|
+
|
|
4
|
+
# 1.1.1 (2021-06-01)
|
|
5
|
+
- Add support for sending custom events to the add-in host page.
|
|
6
|
+
|
|
7
|
+
# 1.1.0 (2020-11-19)
|
|
8
|
+
- Deprecate help widget related functionality.
|
|
9
|
+
|
|
10
|
+
# 1.0.21 (2020-11-04)
|
|
11
|
+
- Add support for event handler to process blocking events from the add-in host.
|
|
12
|
+
|
|
1
13
|
# 1.0.20 (2020-07-28)
|
|
2
14
|
- Add event handler for processing events sent from the add-in host.
|
|
3
15
|
|
package/README.md
CHANGED
|
@@ -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.
|
|
@@ -73,10 +74,10 @@ For tile add-ins, the URL for the add-in will be rendered in a visible iframe on
|
|
|
73
74
|
The host page will handle rendering the tile component around the add-in iframe. When calling the `ready` callback, the `title` field will indicate the title for the tile. Initially, the entire tile will be hidden, and will show on the page if `showUI` is set to `true` in the callback. You can set it to `false` to indicate that the tile should not be shown, based on the user's privileges or context of the current record, etc.
|
|
74
75
|
|
|
75
76
|
Tile add-ins support an optional configuration object that can be used to further control the look/feel/behavior of the tile within the host application. For
|
|
76
|
-
example, to control whether any additional summary text/image is shown when the tile is collapsed, and control whether the "
|
|
77
|
+
example, to control whether any additional summary text/image is shown when the tile is collapsed, and control whether the "settings" icons appear
|
|
77
78
|
in the tile header.
|
|
78
79
|
|
|
79
|
-
Tile add-ins support optional callbacks for `
|
|
80
|
+
Tile add-ins support optional callbacks for `settingsClick`, which will be invoked whenever the user clicks the "settings" icons, respectively:
|
|
80
81
|
|
|
81
82
|
```js
|
|
82
83
|
var client = new AddinClient({
|
|
@@ -88,14 +89,10 @@ var client = new AddinClient({
|
|
|
88
89
|
tileConfig: {
|
|
89
90
|
summaryStyle: BBSkyAddinClient.AddinTileSummaryStyle.Text,
|
|
90
91
|
summaryText: '18 records',
|
|
91
|
-
showHelp: true,
|
|
92
92
|
showSettings: true
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
95
|
},
|
|
96
|
-
helpClick: () => {
|
|
97
|
-
// The user has clicked the "Help" icon in the tile header
|
|
98
|
-
},
|
|
99
96
|
settingsClick: () => {
|
|
100
97
|
// The user has clicked the "Settings" icon in the tile header
|
|
101
98
|
}
|
|
@@ -159,6 +156,59 @@ var client = new AddinClient({
|
|
|
159
156
|
});
|
|
160
157
|
```
|
|
161
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
|
+
|
|
162
212
|
#### Showing a modal
|
|
163
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).
|
|
164
214
|
|
|
@@ -216,15 +266,6 @@ var client = new AddinClient({...});
|
|
|
216
266
|
client.navigate({ url: '<target_url>' });
|
|
217
267
|
```
|
|
218
268
|
|
|
219
|
-
#### Opening the Blackbaud Help flyout
|
|
220
|
-
|
|
221
|
-
The add-in can instruct the parent page to display the Help flyout, and specify which topic to display. To do this, call the `openHelp` method on the `AddinClient` object. This function takes an object argument with property `helpKey` for the name of the help topic to display. A single .html file should be named.
|
|
222
|
-
|
|
223
|
-
```js
|
|
224
|
-
var client = new AddinClient({...});
|
|
225
|
-
client.openHelp({ helpKey: '<target_page>.html' });
|
|
226
|
-
```
|
|
227
|
-
|
|
228
269
|
#### Showing a toast
|
|
229
270
|
|
|
230
271
|
The add-in can instruct the parent page to show a toast. To do this, call the `showToast` method on the `AddinClient` object. This function takes an object argument with properties `message` and `style` representing the content and the display style of the toast.
|
|
@@ -335,6 +376,44 @@ var client = new AddinClient({...});
|
|
|
335
376
|
client.hideWait();
|
|
336
377
|
```
|
|
337
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
|
+
|
|
338
417
|
## Authentication
|
|
339
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.
|
|
340
419
|
|
|
@@ -389,3 +468,8 @@ catch (TokenValidationException ex)
|
|
|
389
468
|
Once the token has been validated, the add-in's backend will know the Blackbaud user ID and can determine if a user mapping exists for a user in the add-in's system. If a mapping exists, then the add-in's backend can immediately present the content for the add-in. If no user mapping exists, the add-in can prompt the user to login.
|
|
390
469
|
|
|
391
470
|
For more information on Blackbaud's SKY Add-in framework, please see https://developer.blackbaud.com/skyapi/docs/addins.
|
|
471
|
+
|
|
472
|
+
## Deprecated help support
|
|
473
|
+
|
|
474
|
+
Using the help widget experience in the context of an addin is generally not needed and contradicts BB's UX patterns.
|
|
475
|
+
As a result, the widget support has been deprecated and will be remove in the next major release.
|
|
@@ -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=e.context,s=this.registeredAddinEvents[t.type];s&&s(t.context),this.postMessageToHostPage({message:{eventRequestId:e.eventRequestId},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$/],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=e.context,s=this.registeredAddinEvents[t.type];s&&s(t.context),this.postMessageToHostPage({message:{eventRequestId:e.eventRequestId},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$/],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.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "SKY add-in client",
|
|
5
5
|
"main": "dist/bundles/sky-addin-client.umd.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"karma": "4.4.1",
|
|
50
50
|
"karma-browserstack-launcher": "1.5.1",
|
|
51
51
|
"karma-chrome-launcher": "3.1.0",
|
|
52
|
-
"karma-coverage": "
|
|
52
|
+
"karma-coverage": "1.1.2",
|
|
53
53
|
"karma-firefox-launcher": "1.3.0",
|
|
54
54
|
"karma-jasmine": "3.1.1",
|
|
55
55
|
"karma-mocha-reporter": "2.2.5",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"rimraf": "3.0.2",
|
|
61
61
|
"source-map-inline-loader": "github:blackbaud-bobbyearl/source-map-inline-loader",
|
|
62
62
|
"ts-loader": "6.2.2",
|
|
63
|
-
"tslint": "
|
|
63
|
+
"tslint": "5.18.0",
|
|
64
64
|
"tslint-loader": "3.5.4",
|
|
65
65
|
"typescript": "3.8.3",
|
|
66
66
|
"uglify-js": "3.8.1",
|
|
@@ -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';
|
|
@@ -9,6 +10,17 @@ import { AddinClientShowFlyoutResult } from './client-interfaces/addin-client-sh
|
|
|
9
10
|
import { AddinClientShowModalArgs } from './client-interfaces/addin-client-show-modal-args';
|
|
10
11
|
import { AddinClientShowModalResult } from './client-interfaces/addin-client-show-modal-result';
|
|
11
12
|
import { AddinClientShowToastArgs } from './client-interfaces/addin-client-show-toast-args';
|
|
13
|
+
/**
|
|
14
|
+
* Callback function to execute when an add-in event occurs.
|
|
15
|
+
* @param context Abitrary context object passed to the event callback.
|
|
16
|
+
* @param done Optional callback function to be executed when the client is done
|
|
17
|
+
* processing the event.
|
|
18
|
+
*
|
|
19
|
+
* The following event types require the 'done' callback to be provided:
|
|
20
|
+
* - 'form-save'
|
|
21
|
+
* - 'form-cancel'
|
|
22
|
+
*/
|
|
23
|
+
export declare type AddinEventCallback = (context: any, done?: () => void) => void;
|
|
12
24
|
/**
|
|
13
25
|
* Client for interacting with the parent page hosting the add-in.
|
|
14
26
|
*/
|
|
@@ -60,6 +72,29 @@ export declare class AddinClient {
|
|
|
60
72
|
* Value - The callback function to be executed when the event type occurs.
|
|
61
73
|
*/
|
|
62
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;
|
|
63
98
|
/**
|
|
64
99
|
* @returns {string} Returns the current query string path for the window, prefixed with ?.
|
|
65
100
|
*/
|
|
@@ -139,11 +174,20 @@ export declare class AddinClient {
|
|
|
139
174
|
*/
|
|
140
175
|
hideWait(): void;
|
|
141
176
|
/**
|
|
142
|
-
*
|
|
177
|
+
* Registers a callback to be executed when the specified event type occurs.
|
|
143
178
|
* @param eventType The event type to process.
|
|
144
|
-
* @param callback The callback to
|
|
179
|
+
* @param callback The callback to execute when the event occurs.
|
|
180
|
+
*/
|
|
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
|
|
145
189
|
*/
|
|
146
|
-
|
|
190
|
+
sendEvent(args: AddinClientEventArgs): Promise<void>;
|
|
147
191
|
/**
|
|
148
192
|
* Post a message to the host page informing it that the add-in is
|
|
149
193
|
* now started and listening for messages from the host.
|
|
@@ -200,6 +244,22 @@ export declare class AddinClient {
|
|
|
200
244
|
* that matches the event type.
|
|
201
245
|
*/
|
|
202
246
|
private processHostEvent;
|
|
247
|
+
/**
|
|
248
|
+
* Checks whether an event type is blocking and requires a response from the client
|
|
249
|
+
* before responding to the host.
|
|
250
|
+
* @param type The event type.
|
|
251
|
+
*/
|
|
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
|
+
*/
|
|
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;
|
|
203
263
|
/**
|
|
204
264
|
* Checks whether a MessageEvent is from the execetd host origin.
|
|
205
265
|
* @param event
|
|
@@ -13,7 +13,9 @@ 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$/
|
|
17
19
|
];
|
|
18
20
|
/**
|
|
19
21
|
* Client for interacting with the parent page hosting the add-in.
|
|
@@ -44,6 +46,29 @@ var AddinClient = /** @class */ (function () {
|
|
|
44
46
|
* Value - The callback function to be executed when the event type occurs.
|
|
45
47
|
*/
|
|
46
48
|
this.registeredAddinEvents = {};
|
|
49
|
+
/**
|
|
50
|
+
* Stores the add-in events that have been sent to the host page.
|
|
51
|
+
* Key - the event request ID.
|
|
52
|
+
* Value - The Promise resolve function to be executed when the event is received by the host.
|
|
53
|
+
*/
|
|
54
|
+
this.sentEvents = {};
|
|
55
|
+
/**
|
|
56
|
+
* Stores the pending add-in events that are queued to be sent to the host page after 200
|
|
57
|
+
* milliseconds have expired.
|
|
58
|
+
* Key - the event type.
|
|
59
|
+
* Value - The Promise reject function to be executed if the event fails to be sent to the host page.
|
|
60
|
+
*/
|
|
61
|
+
this.pendingSentEvents = {};
|
|
62
|
+
/**
|
|
63
|
+
* The event request ID counter.
|
|
64
|
+
* The ID is incremented and assigned to each event that is sent.
|
|
65
|
+
*/
|
|
66
|
+
this.eventRequestId = 0;
|
|
67
|
+
/**
|
|
68
|
+
* An array of event types that are supported by the host page.
|
|
69
|
+
* The add-in client will throw an error if an event is attempted but not one the supported types.
|
|
70
|
+
*/
|
|
71
|
+
this.supportedEventTypes = [];
|
|
47
72
|
this.windowMessageHandler = function (event) {
|
|
48
73
|
_this.handleMessage(event);
|
|
49
74
|
};
|
|
@@ -245,13 +270,52 @@ var AddinClient = /** @class */ (function () {
|
|
|
245
270
|
});
|
|
246
271
|
};
|
|
247
272
|
/**
|
|
248
|
-
*
|
|
273
|
+
* Registers a callback to be executed when the specified event type occurs.
|
|
249
274
|
* @param eventType The event type to process.
|
|
250
|
-
* @param callback The callback to
|
|
275
|
+
* @param callback The callback to execute when the event occurs.
|
|
251
276
|
*/
|
|
252
277
|
AddinClient.prototype.addEventHandler = function (eventType, callback) {
|
|
253
278
|
this.registeredAddinEvents[eventType] = callback;
|
|
254
279
|
};
|
|
280
|
+
/**
|
|
281
|
+
* Sends an event to be handled by the host page.
|
|
282
|
+
* Supported for Blackbaud internal only
|
|
283
|
+
* @returns {Promise<void>} Returns a Promise which will resolve when the add-in host page receives the message, or
|
|
284
|
+
* rejects if a subsequent event occurs, for the same event type, within 200 milliseconds.
|
|
285
|
+
* The Promise also rejects if an event type is not one of the supported types from the host page.
|
|
286
|
+
* @see AddinClientInitArgs#supportedEventTypes
|
|
287
|
+
*/
|
|
288
|
+
AddinClient.prototype.sendEvent = function (args) {
|
|
289
|
+
var _this = this;
|
|
290
|
+
return new Promise(function (resolve, reject) {
|
|
291
|
+
var eventType = args.type;
|
|
292
|
+
if (!_this.supportedEventTypes.includes(eventType)) {
|
|
293
|
+
reject('Event type not supported');
|
|
294
|
+
}
|
|
295
|
+
var pendingEvent = _this.pendingSentEvents[eventType];
|
|
296
|
+
if (pendingEvent) {
|
|
297
|
+
// cancel and reject pending event
|
|
298
|
+
clearTimeout(pendingEvent.timeoutId);
|
|
299
|
+
pendingEvent.reject('Event cancelled');
|
|
300
|
+
}
|
|
301
|
+
var timeoutId = setTimeout(function () {
|
|
302
|
+
delete _this.pendingSentEvents[eventType];
|
|
303
|
+
_this.postMessageToHostPage({
|
|
304
|
+
message: {
|
|
305
|
+
event: args,
|
|
306
|
+
eventRequestId: _this.eventRequestId
|
|
307
|
+
},
|
|
308
|
+
messageType: 'client-event'
|
|
309
|
+
});
|
|
310
|
+
_this.sentEvents[_this.eventRequestId] = resolve;
|
|
311
|
+
_this.eventRequestId++;
|
|
312
|
+
}, 200);
|
|
313
|
+
_this.pendingSentEvents[eventType] = {
|
|
314
|
+
reject: reject,
|
|
315
|
+
timeoutId: timeoutId
|
|
316
|
+
};
|
|
317
|
+
});
|
|
318
|
+
};
|
|
255
319
|
/**
|
|
256
320
|
* Post a message to the host page informing it that the add-in is
|
|
257
321
|
* now started and listening for messages from the host.
|
|
@@ -316,6 +380,8 @@ var AddinClient = /** @class */ (function () {
|
|
|
316
380
|
// communications with the host page will be blocked.
|
|
317
381
|
this.setKnownAllowedHostOrigin(event.origin);
|
|
318
382
|
this.trackHeightChangesOfAddinContent();
|
|
383
|
+
// set the supported event types
|
|
384
|
+
this.supportedEventTypes = data.message.supportedEventTypes;
|
|
319
385
|
// Pass key data to the add-in for it to initiailze.
|
|
320
386
|
this.args.callbacks.init({
|
|
321
387
|
context: data.message.context,
|
|
@@ -328,7 +394,8 @@ var AddinClient = /** @class */ (function () {
|
|
|
328
394
|
message: args,
|
|
329
395
|
messageType: 'addin-ready'
|
|
330
396
|
});
|
|
331
|
-
}
|
|
397
|
+
},
|
|
398
|
+
supportedEventTypes: data.message.supportedEventTypes
|
|
332
399
|
});
|
|
333
400
|
}
|
|
334
401
|
else if (this.isFromValidOrigin(event)) {
|
|
@@ -373,6 +440,7 @@ var AddinClient = /** @class */ (function () {
|
|
|
373
440
|
this.args.callbacks.flyoutPreviousClick();
|
|
374
441
|
}
|
|
375
442
|
break;
|
|
443
|
+
// TODO remove support for this message type when help support is removed in next major release
|
|
376
444
|
case 'help-click':
|
|
377
445
|
if (this.args.callbacks.helpClick) {
|
|
378
446
|
this.args.callbacks.helpClick();
|
|
@@ -386,6 +454,9 @@ var AddinClient = /** @class */ (function () {
|
|
|
386
454
|
case 'host-event':
|
|
387
455
|
this.processHostEvent(data.message);
|
|
388
456
|
break;
|
|
457
|
+
case 'event-received':
|
|
458
|
+
this.resolveClientEvent(data.message);
|
|
459
|
+
break;
|
|
389
460
|
}
|
|
390
461
|
}
|
|
391
462
|
else {
|
|
@@ -461,18 +532,68 @@ var AddinClient = /** @class */ (function () {
|
|
|
461
532
|
* that matches the event type.
|
|
462
533
|
*/
|
|
463
534
|
AddinClient.prototype.processHostEvent = function (message) {
|
|
535
|
+
var _this = this;
|
|
464
536
|
var eventArgs = message.context;
|
|
465
537
|
var callback = this.registeredAddinEvents[eventArgs.type];
|
|
538
|
+
var promise;
|
|
466
539
|
if (callback) {
|
|
467
|
-
|
|
540
|
+
if (this.isBlockingEventType(eventArgs.type)) {
|
|
541
|
+
promise = new Promise(function (resolve) {
|
|
542
|
+
callback(eventArgs.context, function () {
|
|
543
|
+
resolve();
|
|
544
|
+
});
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
else {
|
|
548
|
+
promise = new Promise(function (resolve) {
|
|
549
|
+
callback(eventArgs.context);
|
|
550
|
+
resolve();
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
else {
|
|
555
|
+
promise = Promise.resolve();
|
|
468
556
|
}
|
|
557
|
+
promise.then(function () { return _this.postEventReceivedMessage(message.eventRequestId); });
|
|
558
|
+
};
|
|
559
|
+
/**
|
|
560
|
+
* Checks whether an event type is blocking and requires a response from the client
|
|
561
|
+
* before responding to the host.
|
|
562
|
+
* @param type The event type.
|
|
563
|
+
*/
|
|
564
|
+
AddinClient.prototype.isBlockingEventType = function (type) {
|
|
565
|
+
switch (type) {
|
|
566
|
+
case 'form-save':
|
|
567
|
+
case 'form-cancel':
|
|
568
|
+
return true;
|
|
569
|
+
default: break;
|
|
570
|
+
}
|
|
571
|
+
return false;
|
|
572
|
+
};
|
|
573
|
+
/**
|
|
574
|
+
* Posts a message to the host page to indicate that a certain event has been received.
|
|
575
|
+
* @param eventRequestId The ID of the event request that was received.
|
|
576
|
+
*/
|
|
577
|
+
AddinClient.prototype.postEventReceivedMessage = function (eventRequestId) {
|
|
469
578
|
this.postMessageToHostPage({
|
|
470
579
|
message: {
|
|
471
|
-
eventRequestId:
|
|
580
|
+
eventRequestId: eventRequestId
|
|
472
581
|
},
|
|
473
582
|
messageType: 'event-received'
|
|
474
583
|
});
|
|
475
584
|
};
|
|
585
|
+
/**
|
|
586
|
+
* Attemps to resolve the Promise for a client event that has been received by the host page.
|
|
587
|
+
* @param message Message data that includes the ID of the event that was received.
|
|
588
|
+
*/
|
|
589
|
+
AddinClient.prototype.resolveClientEvent = function (message) {
|
|
590
|
+
var requestId = message.eventRequestId;
|
|
591
|
+
var promiseResolve = this.sentEvents[requestId];
|
|
592
|
+
if (promiseResolve) {
|
|
593
|
+
promiseResolve();
|
|
594
|
+
delete this.sentEvents[requestId];
|
|
595
|
+
}
|
|
596
|
+
};
|
|
476
597
|
/**
|
|
477
598
|
* Checks whether a MessageEvent is from the execetd host origin.
|
|
478
599
|
* @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;AAEF;;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;QAgC/B;;;;WAIG;QACK,0BAAqB,GAA4C,EAAE,CAA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C,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;aACpC;SACF;IACH,CAAC;IAEH,kBAAC;AAAD,CAAC,AArrBD,IAqrBC;AArrBY,kCAAW"}
|
|
@@ -25,6 +25,7 @@ export interface AddinClientCallbacks {
|
|
|
25
25
|
flyoutPreviousClick?: () => void;
|
|
26
26
|
/**
|
|
27
27
|
* Callback raised for tile add-ins indicating that the help button was clicked.
|
|
28
|
+
* @deprecated See _Deprecated help support_ in README
|
|
28
29
|
*/
|
|
29
30
|
helpClick?: () => void;
|
|
30
31
|
/**
|
|
@@ -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.
|