@blackbaud/sky-addin-client 1.2.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +18 -0
- package/bundles/sky-addin-client.global-es2015.js +80 -29
- package/bundles/sky-addin-client.global-es2015.min.js +1 -1
- package/bundles/sky-addin-client.global.js +81 -30
- package/bundles/sky-addin-client.global.min.js +1 -1
- package/bundles/sky-addin-client.umd-es2015.js +80 -29
- package/bundles/sky-addin-client.umd-es2015.min.js +1 -1
- package/bundles/sky-addin-client.umd.js +81 -30
- package/bundles/sky-addin-client.umd.min.js +1 -1
- package/package.json +2 -2
- package/src/addin/addin-client.d.ts +5 -0
- package/src/addin/addin-client.js +28 -4
- package/src/addin/addin-client.js.map +1 -1
- package/src/addin/addin-client.spec.js +80 -2
- package/src/addin/addin-client.spec.js.map +1 -1
- package/src/addin/client-interfaces/addin-box-config.d.ts +14 -0
- package/src/addin/client-interfaces/addin-box-config.js +3 -0
- package/src/addin/client-interfaces/addin-box-config.js.map +1 -0
- package/src/addin/client-interfaces/addin-box-control.d.ts +13 -0
- package/src/addin/client-interfaces/addin-box-control.js +3 -0
- package/src/addin/client-interfaces/addin-box-control.js.map +1 -0
- package/src/addin/client-interfaces/addin-client-args.d.ts +5 -0
- package/src/addin/client-interfaces/addin-client-callbacks.d.ts +4 -0
- package/src/addin/client-interfaces/addin-client-config.d.ts +9 -0
- package/src/addin/client-interfaces/addin-client-config.js +3 -0
- package/src/addin/client-interfaces/addin-client-config.js.map +1 -0
- package/src/addin/client-interfaces/addin-client-ready-args.d.ts +5 -0
- package/src/addin/client-interfaces/index.d.ts +3 -0
- package/src/addin/client-interfaces/index.js +3 -0
- package/src/addin/client-interfaces/index.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# 1.4.0 (2024-08-21)
|
|
2
|
+
- Added a `actionClick` callback for Box Add-ins to allow developers to take action when actions are clicked.
|
|
3
|
+
- Added `AddinBoxConfig` interface for defining configuration options for `Box add-ins`.
|
|
4
|
+
|
|
5
|
+
# 1.3.0 (2024-06-18)
|
|
6
|
+
- Added `AddinClientConfig` interface to allow additional host origins to be supplied by an `AddinClient`.
|
|
7
|
+
|
|
1
8
|
# 1.2.2 (2024-04-25)
|
|
2
9
|
- Updated `allowedOrigins` to support Good Move and fix EMC portal issues
|
|
3
10
|
|
package/README.md
CHANGED
|
@@ -69,6 +69,24 @@ var client = new AddinClient({
|
|
|
69
69
|
});
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
+
You can also allow additional origins where your add-in client may run within a Blackbaud host page. Additional origins are supplied as regular expression patterns. The `AddinClient` already allows several Blackbaud host origins by default. If you find a need to extend the defaults, you may do so by populating the `AddinClientConfig`'s `allowedOrigins` property.
|
|
73
|
+
|
|
74
|
+
```js
|
|
75
|
+
var client = new AddinClient({
|
|
76
|
+
callbacks: {
|
|
77
|
+
init: (args) => {
|
|
78
|
+
args.ready({
|
|
79
|
+
showUI: true,
|
|
80
|
+
title: 'My Custom Tile Title'
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
allowedOrigins: [
|
|
85
|
+
/^https\:\/\/[\w\-\.]+\.additionalblackbauddomain\.com$/,
|
|
86
|
+
]
|
|
87
|
+
});
|
|
88
|
+
```
|
|
89
|
+
|
|
72
90
|
#### Tile add-ins
|
|
73
91
|
For tile add-ins, the URL for the add-in will be rendered in a visible iframe on the page, 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.
|
|
74
92
|
|
|
@@ -45,7 +45,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
45
45
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
46
46
|
__exportStar(__webpack_require__(2), exports);
|
|
47
47
|
__exportStar(__webpack_require__(3), exports);
|
|
48
|
-
__exportStar(__webpack_require__(
|
|
48
|
+
__exportStar(__webpack_require__(34), exports);
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
/***/ }),
|
|
@@ -56,8 +56,8 @@ __exportStar(__webpack_require__(31), exports);
|
|
|
56
56
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
57
57
|
exports.AddinClient = void 0;
|
|
58
58
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
* Collection of regexs for our whitelist of host origins.
|
|
60
|
+
*/
|
|
61
61
|
const allowedOrigins = [
|
|
62
62
|
/^https\:\/\/[\w\-\.]+\.blackbaud\.com$/,
|
|
63
63
|
/^https\:\/\/[\w\-\.]+\.blackbaud\-dev\.com$/,
|
|
@@ -199,6 +199,11 @@ class AddinClient {
|
|
|
199
199
|
* The add-in client will throw an error if an event is attempted but not one the supported types.
|
|
200
200
|
*/
|
|
201
201
|
this.supportedEventTypes = [];
|
|
202
|
+
/**
|
|
203
|
+
* Collection of regexs for our whitelist of host origins.
|
|
204
|
+
*/
|
|
205
|
+
this.allowedOrigins = allowedOrigins;
|
|
206
|
+
this.initConfig(args.config);
|
|
202
207
|
this.windowMessageHandler = (event) => {
|
|
203
208
|
this.handleMessage(event);
|
|
204
209
|
};
|
|
@@ -432,6 +437,20 @@ class AddinClient {
|
|
|
432
437
|
};
|
|
433
438
|
});
|
|
434
439
|
}
|
|
440
|
+
initConfig(config) {
|
|
441
|
+
var _a;
|
|
442
|
+
if (((_a = config === null || config === void 0 ? void 0 : config.allowedOrigins) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
443
|
+
// append custom allowed origins
|
|
444
|
+
this.allowedOrigins = this.allowedOrigins.concat(config.allowedOrigins);
|
|
445
|
+
// remove duplicates
|
|
446
|
+
this.allowedOrigins = this.allowedOrigins.reduce((acc, curr) => {
|
|
447
|
+
if (!acc.find((a) => a.source === curr.source)) {
|
|
448
|
+
acc.push(curr);
|
|
449
|
+
}
|
|
450
|
+
return acc;
|
|
451
|
+
}, []);
|
|
452
|
+
}
|
|
453
|
+
}
|
|
435
454
|
/**
|
|
436
455
|
* Post a message to the host page informing it that the add-in is
|
|
437
456
|
* now started and listening for messages from the host.
|
|
@@ -517,6 +536,11 @@ class AddinClient {
|
|
|
517
536
|
else if (this.isFromValidOrigin(event)) {
|
|
518
537
|
/* tslint:disable-next-line switch-default */
|
|
519
538
|
switch (data.messageType) {
|
|
539
|
+
case 'action-click':
|
|
540
|
+
if (this.args.callbacks.actionClick) {
|
|
541
|
+
this.args.callbacks.actionClick(data.message.reason);
|
|
542
|
+
}
|
|
543
|
+
break;
|
|
520
544
|
case 'auth-token':
|
|
521
545
|
case 'auth-token-fail':
|
|
522
546
|
this.handleAuthTokenMessage(data);
|
|
@@ -593,7 +617,7 @@ class AddinClient {
|
|
|
593
617
|
* @param hostOrigin
|
|
594
618
|
*/
|
|
595
619
|
setKnownAllowedHostOrigin(hostOrigin) {
|
|
596
|
-
for (const allowedOrigin of allowedOrigins) {
|
|
620
|
+
for (const allowedOrigin of this.allowedOrigins) {
|
|
597
621
|
if (allowedOrigin.test(hostOrigin)) {
|
|
598
622
|
this.trustedOrigin = hostOrigin;
|
|
599
623
|
return;
|
|
@@ -792,6 +816,9 @@ __exportStar(__webpack_require__(27), exports);
|
|
|
792
816
|
__exportStar(__webpack_require__(28), exports);
|
|
793
817
|
__exportStar(__webpack_require__(29), exports);
|
|
794
818
|
__exportStar(__webpack_require__(30), exports);
|
|
819
|
+
__exportStar(__webpack_require__(31), exports);
|
|
820
|
+
__exportStar(__webpack_require__(32), exports);
|
|
821
|
+
__exportStar(__webpack_require__(33), exports);
|
|
795
822
|
|
|
796
823
|
|
|
797
824
|
/***/ }),
|
|
@@ -808,21 +835,6 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
808
835
|
|
|
809
836
|
|
|
810
837
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
811
|
-
exports.AddinButtonStyle = void 0;
|
|
812
|
-
/*
|
|
813
|
-
* Defines the style of the button
|
|
814
|
-
*/
|
|
815
|
-
var AddinButtonStyle;
|
|
816
|
-
(function (AddinButtonStyle) {
|
|
817
|
-
// No style (default)
|
|
818
|
-
AddinButtonStyle[AddinButtonStyle["None"] = 0] = "None";
|
|
819
|
-
// The button represents an "add" operation
|
|
820
|
-
AddinButtonStyle[AddinButtonStyle["Add"] = 1] = "Add";
|
|
821
|
-
// The button represents an "edit" operation
|
|
822
|
-
AddinButtonStyle[AddinButtonStyle["Edit"] = 2] = "Edit";
|
|
823
|
-
// The button represents a "delete" operation
|
|
824
|
-
AddinButtonStyle[AddinButtonStyle["Delete"] = 3] = "Delete";
|
|
825
|
-
})(AddinButtonStyle = exports.AddinButtonStyle || (exports.AddinButtonStyle = {}));
|
|
826
838
|
|
|
827
839
|
|
|
828
840
|
/***/ }),
|
|
@@ -839,6 +851,21 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
839
851
|
|
|
840
852
|
|
|
841
853
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
854
|
+
exports.AddinButtonStyle = void 0;
|
|
855
|
+
/*
|
|
856
|
+
* Defines the style of the button
|
|
857
|
+
*/
|
|
858
|
+
var AddinButtonStyle;
|
|
859
|
+
(function (AddinButtonStyle) {
|
|
860
|
+
// No style (default)
|
|
861
|
+
AddinButtonStyle[AddinButtonStyle["None"] = 0] = "None";
|
|
862
|
+
// The button represents an "add" operation
|
|
863
|
+
AddinButtonStyle[AddinButtonStyle["Add"] = 1] = "Add";
|
|
864
|
+
// The button represents an "edit" operation
|
|
865
|
+
AddinButtonStyle[AddinButtonStyle["Edit"] = 2] = "Edit";
|
|
866
|
+
// The button represents a "delete" operation
|
|
867
|
+
AddinButtonStyle[AddinButtonStyle["Delete"] = 3] = "Delete";
|
|
868
|
+
})(AddinButtonStyle = exports.AddinButtonStyle || (exports.AddinButtonStyle = {}));
|
|
842
869
|
|
|
843
870
|
|
|
844
871
|
/***/ }),
|
|
@@ -982,6 +1009,30 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
982
1009
|
/***/ ((__unused_webpack_module, exports) => {
|
|
983
1010
|
|
|
984
1011
|
|
|
1012
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
/***/ }),
|
|
1016
|
+
/* 26 */
|
|
1017
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1018
|
+
|
|
1019
|
+
|
|
1020
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1021
|
+
|
|
1022
|
+
|
|
1023
|
+
/***/ }),
|
|
1024
|
+
/* 27 */
|
|
1025
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1026
|
+
|
|
1027
|
+
|
|
1028
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1029
|
+
|
|
1030
|
+
|
|
1031
|
+
/***/ }),
|
|
1032
|
+
/* 28 */
|
|
1033
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1034
|
+
|
|
1035
|
+
|
|
985
1036
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
986
1037
|
exports.AddinConfirmButtonStyle = void 0;
|
|
987
1038
|
/**
|
|
@@ -1000,7 +1051,7 @@ var AddinConfirmButtonStyle;
|
|
|
1000
1051
|
|
|
1001
1052
|
|
|
1002
1053
|
/***/ }),
|
|
1003
|
-
/*
|
|
1054
|
+
/* 29 */
|
|
1004
1055
|
/***/ ((__unused_webpack_module, exports) => {
|
|
1005
1056
|
|
|
1006
1057
|
|
|
@@ -1008,7 +1059,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1008
1059
|
|
|
1009
1060
|
|
|
1010
1061
|
/***/ }),
|
|
1011
|
-
/*
|
|
1062
|
+
/* 30 */
|
|
1012
1063
|
/***/ ((__unused_webpack_module, exports) => {
|
|
1013
1064
|
|
|
1014
1065
|
|
|
@@ -1027,7 +1078,7 @@ var AddinTabSummaryStyle;
|
|
|
1027
1078
|
|
|
1028
1079
|
|
|
1029
1080
|
/***/ }),
|
|
1030
|
-
/*
|
|
1081
|
+
/* 31 */
|
|
1031
1082
|
/***/ ((__unused_webpack_module, exports) => {
|
|
1032
1083
|
|
|
1033
1084
|
|
|
@@ -1035,7 +1086,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1035
1086
|
|
|
1036
1087
|
|
|
1037
1088
|
/***/ }),
|
|
1038
|
-
/*
|
|
1089
|
+
/* 32 */
|
|
1039
1090
|
/***/ ((__unused_webpack_module, exports) => {
|
|
1040
1091
|
|
|
1041
1092
|
|
|
@@ -1056,7 +1107,7 @@ var AddinTileSummaryStyle;
|
|
|
1056
1107
|
|
|
1057
1108
|
|
|
1058
1109
|
/***/ }),
|
|
1059
|
-
/*
|
|
1110
|
+
/* 33 */
|
|
1060
1111
|
/***/ ((__unused_webpack_module, exports) => {
|
|
1061
1112
|
|
|
1062
1113
|
|
|
@@ -1079,7 +1130,7 @@ var AddinToastStyle;
|
|
|
1079
1130
|
|
|
1080
1131
|
|
|
1081
1132
|
/***/ }),
|
|
1082
|
-
/*
|
|
1133
|
+
/* 34 */
|
|
1083
1134
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1084
1135
|
|
|
1085
1136
|
|
|
@@ -1098,12 +1149,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
1098
1149
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1099
1150
|
};
|
|
1100
1151
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1101
|
-
__exportStar(__webpack_require__(
|
|
1102
|
-
__exportStar(__webpack_require__(
|
|
1152
|
+
__exportStar(__webpack_require__(35), exports);
|
|
1153
|
+
__exportStar(__webpack_require__(36), exports);
|
|
1103
1154
|
|
|
1104
1155
|
|
|
1105
1156
|
/***/ }),
|
|
1106
|
-
/*
|
|
1157
|
+
/* 35 */
|
|
1107
1158
|
/***/ ((__unused_webpack_module, exports) => {
|
|
1108
1159
|
|
|
1109
1160
|
|
|
@@ -1111,7 +1162,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1111
1162
|
|
|
1112
1163
|
|
|
1113
1164
|
/***/ }),
|
|
1114
|
-
/*
|
|
1165
|
+
/* 36 */
|
|
1115
1166
|
/***/ ((__unused_webpack_module, exports) => {
|
|
1116
1167
|
|
|
1117
1168
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={789:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var a=Object.getOwnPropertyDescriptor(t,s);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,a)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),a=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),a(s(983),t)},903:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddinClient=void 0;const s=[/^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$/,/^https\:\/\/[\w\-\.]+\.blackbaudwp\.com$/,/^https\:\/\/[\w\-\.]+\.carrytheload\.org$/,/^https\:\/\/[\w\-\.]+\.ummsfoundation\.org$/,/^http\:\/\/[\w\-\.]+\.lcrf\.org$/,/^https\:\/\/[\w\-\.]+\.go2\.org$/,/^https\:\/\/[\w\-\.]+\.nationwidechildrens\.org$/,/^https\:\/\/[\w\-\.]+\.lupus\.org$/,/^https\:\/\/[\w\-\.]+\.operationsmile\.ca$/,/^https\:\/\/[\w\-\.]+\.convio\.net$/,/^https\:\/\/[\w\-\.]+\.ontariospca\.ca$/,/^https\:\/\/[\w\-\.]+\.brighamandwomens\.org$/,/^https\:\/\/[\w\-\.]+\.northernlighthealth\.org$/,/^http\:\/\/[\w\-\.]+\.convio\.net$/,/^https\:\/\/[\w\-\.]+\.alpha1\.org$/,/^https\:\/\/[\w\-\.]+\.pscpartners\.org$/,/^https\:\/\/[\w\-\.]+\.mercyforanimals\.org$/,/^https\:\/\/[\w\-\.]+\.braintumor\.org$/,/^https\:\/\/[\w\-\.]+\.cancer\.ca$/,/^https\:\/\/[\w\-\.]+\.phoenixchildrensfoundation\.org$/,/^https\:\/\/[\w\-\.]+\.ocmc\.org$/,/^https\:\/\/[\w\-\.]+\.stlouischildrens\.org$/,/^https\:\/\/[\w\-\.]+\.choa\.org$/,/^https\:\/\/[\w\-\.]+\.acsevents\.org$/,/^https\:\/\/[\w\-\.]+\.operationsmile\.org$/,/^https\:\/\/[\w\-\.]+\.mdmercy\.com$/,/^https\:\/\/[\w\-\.]+\.cookchildrens\.org$/,/^https\:\/\/[\w\-\.]+\.chla\.org$/,/^https\:\/\/[\w\-\.]+\.nleomf\.org$/,/^https\:\/\/[\w\-\.]+\.pwatoronto\.org$/,/^https\:\/\/[\w\-\.]+\.jfsla\.org$/,/^https\:\/\/[\w\-\.]+\.roswellpark\.org$/,/^https\:\/\/[\w\-\.]+\.alsagoldenwest\.org$/,/^https\:\/\/[\w\-\.]+\.cancercarefoundation\.ca$/,/^https\:\/\/[\w\-\.]+\.alsnc\.org$/,/^https\:\/\/[\w\-\.]+\.alsanm\.org$/,/^https\:\/\/[\w\-\.]+\.waysidewaifs\.org$/,/^https\:\/\/[\w\-\.]+\.bladdercancercanada\.org$/,/^https\:\/\/[\w\-\.]+\.jimmyfund\.org$/,/^https\:\/\/[\w\-\.]+\.info\-komen\.org$/,/^https\:\/\/[\w\-\.]+\.mountsinai\.org$/,/^https\:\/\/[\w\-\.]+\.walkforpd\.ca$/,/^https\:\/\/[\w\-\.]+\.alsoregon\.org$/,/^https\:\/\/[\w\-\.]+\.feedhopenow\.org$/,/^https\:\/\/[\w\-\.]+\.trilliumgiving\.ca$/,/^https\:\/\/[\w\-\.]+\.swimacrossamerica\.org$/,/^https\:\/\/ovariancanada\.org$/,/^https\:\/\/[\w\-\.]+\.ovariancanada\.org$/,/^https\:\/\/[\w\-\.]+\.alsunitedchicago\.org$/,/^https\:\/\/[\w\-\.]+\.fredhutch\.org$/,/^https\:\/\/[\w\-\.]+\.hss\.edu$/,/^https\:\/\/[\w\-\.]+\.nyghfoundation\.ca$/,/^https\:\/\/[\w\-\.]+\.natureconservancy\.ca$/,/^https\:\/\/[\w\-\.]+\.llscanada\.org$/,/^https\:\/\/[\w\-\.]+\.als\-ny\.org$/,/^https\:\/\/[\w\-\.]+\.zerocancer\.org$/,/^https\:\/\/[\w\-\.]+\.alsmidatlantic\.org$/,/^https\:\/\/[\w\-\.]+\.habitat\.ca$/,/^https\:\/\/[\w\-\.]+\.stamfordhospitalfoundation\.org$/,/^https\:\/\/[\w\-\.]+\.alsohio\.org$/,/^https\:\/\/[\w\-\.]+\.cancercarefdn\.mb\.ca$/,/^https\:\/\/[\w\-\.]+\.baycrestfoundation\.org$/,/^https\:\/\/[\w\-\.]+\.southlake\.ca$/,/^https\:\/\/[\w\-\.]+\.parkinson\.ca$/];class o{static getQueryString(){return window.location.search}constructor(e){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=e=>{this.handleMessage(e)},window.addEventListener("message",this.windowMessageHandler),this.raiseAddinReadyMessage()}destroy(){window.removeEventListener("message",this.windowMessageHandler),this.heightChangeIntervalId&&clearInterval(this.heightChangeIntervalId)}navigate(e){this.postMessageToHostPage({message:{url:e.url},messageType:"navigate"})}getAuthToken(){return this.getUserIdentityToken()}getUserIdentityToken(){return new Promise(((e,t)=>{const s=++this.lastAuthTokenRequestId;this.authTokenRequests[s]={reject:t,resolve:e},this.postMessageToHostPage({message:{authTokenRequestId:s},messageType:"get-auth-token"})}))}showModal(e){return{modalClosed:new Promise(((t,s)=>{const o=++this.lastModalRequestId;this.modalRequests[o]={reject:s,resolve:t},this.postMessageToHostPage({message:{args:e,modalRequestId:o},messageType:"show-modal"})}))}}closeModal(e){this.postMessageToHostPage({message:e,messageType:"close-modal"})}openHelp(e){this.postMessageToHostPage({message:{helpKey:e.helpKey},messageType:"open-help"})}showToast(e){this.postMessageToHostPage({message:e,messageType:"show-toast"})}showFlyout(e){return{flyoutClosed:new Promise(((t,s)=>{e.defaultWidth=e.defaultWidth,e.maxWidth=e.maxWidth,e.minWidth=e.minWidth,this.flyoutRequest={reject:s,resolve:t},this.postMessageToHostPage({message:e,messageType:"show-flyout"})}))}}closeFlyout(){this.postMessageToHostPage({messageType:"close-flyout"})}showConfirm(e){return new Promise(((t,s)=>{this.confirmRequest={reject:s,resolve:t},this.postMessageToHostPage({message:e,messageType:"show-confirm"})}))}showError(e){this.postMessageToHostPage({message:e,messageType:"show-error"})}showWait(){this.postMessageToHostPage({messageType:"show-wait"})}hideWait(){this.postMessageToHostPage({messageType:"hide-wait"})}addEventHandler(e,t){this.registeredAddinEvents[e]=t}sendEvent(e){return new Promise(((t,s)=>{const o=e.type;this.supportedEventTypes.includes(o)||s("Event type not supported");const a=this.pendingSentEvents[o];a&&(clearTimeout(a.timeoutId),a.reject("Event cancelled"));const n=setTimeout((()=>{delete this.pendingSentEvents[o],this.postMessageToHostPage({message:{event:e,eventRequestId:this.eventRequestId},messageType:"client-event"}),this.sentEvents[this.eventRequestId]=t,this.eventRequestId++}),200);this.pendingSentEvents[o]={reject:s,timeoutId:n}}))}raiseAddinReadyMessage(){this.postMessageToHostPage({messageType:"ready"},"*")}handleModalClosedMessage(e){const t=this.modalRequests,s=e.modalRequestId;t[s].resolve(e.context),t[s]=void 0}handleAuthTokenMessage(e){const t=this.authTokenRequests,s=e.message.authTokenRequestId,o=t[s];switch(e.messageType){case"auth-token":const t=e.message.authToken;o.resolve(t);break;case"auth-token-fail":o.reject(e.message.reason)}t[s]=void 0}handleMessage(e){const t=e.data;if(t&&"bb-addin-host"===t.source)if("host-ready"===t.messageType)this.setKnownAllowedHostOrigin(e.origin),this.trackHeightChangesOfAddinContent(),this.supportedEventTypes=t.message.supportedEventTypes,this.args.callbacks.init({context:t.message.context,envId:t.message.envId,ready:e=>{this.checkForHeightChangesOfAddinContent(),this.postMessageToHostPage({message:e,messageType:"addin-ready"})},supportedEventTypes:t.message.supportedEventTypes,themeSettings:t.message.themeSettings});else if(this.isFromValidOrigin(e))switch(t.messageType){case"auth-token":case"auth-token-fail":this.handleAuthTokenMessage(t);break;case"modal-closed":this.handleModalClosedMessage(t.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(t.message);break;case"confirm-closed":this.confirmRequest&&(this.confirmRequest.resolve(t.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"theme-change":this.args.callbacks.themeChange&&this.args.callbacks.themeChange(t.message.themeSettings);break;case"host-event":this.processHostEvent(t.message);break;case"event-received":this.resolveClientEvent(t.message)}else this.warnInvalidOrigin()}setKnownAllowedHostOrigin(e){for(const t of s)if(t.test(e))return void(this.trustedOrigin=e)}checkForHeightChangesOfAddinContent(){const e=document.documentElement.offsetHeight;e!==this.lastPostedIframeHeight&&(this.lastPostedIframeHeight=e,this.postMessageToHostPage({message:{height:e+"px"},messageType:"height-change"}))}trackHeightChangesOfAddinContent(){this.heightChangeIntervalId=setInterval((()=>{this.checkForHeightChangesOfAddinContent()}),1e3)}postMessageToHostPage(e,t){e.source="bb-addin-client",e.addinId=this.getQueryVariable("addinId"),(t=t||this.trustedOrigin)?window.parent.postMessage(e,t):this.warnInvalidOrigin()}processHostEvent(e){const t=e.context,s=this.registeredAddinEvents[t.type];let o;o=s?this.isBlockingEventType(t.type)?new Promise((e=>{s(t.context,(()=>{e()}))})):new Promise((e=>{s(t.context),e()})):Promise.resolve(),o.then((()=>this.postEventReceivedMessage(e.eventRequestId)))}isBlockingEventType(e){switch(e){case"form-save":case"form-cancel":return!0}return!1}postEventReceivedMessage(e){this.postMessageToHostPage({message:{eventRequestId:e},messageType:"event-received"})}resolveClientEvent(e){const t=e.eventRequestId,s=this.sentEvents[t];s&&(s(),delete this.sentEvents[t])}isFromValidOrigin(e){return e.origin===this.trustedOrigin}warnInvalidOrigin(){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.")}getQueryVariable(e){const t=o.getQueryString().substring(1).split("&");for(const s of t){const t=s.split("=");if(decodeURIComponent(t[0])===e)return decodeURIComponent(t[1])}}}t.AddinClient=o},714:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},819:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinButtonStyle=void 0,(s=t.AddinButtonStyle||(t.AddinButtonStyle={}))[s.None=0]="None",s[s.Add=1]="Add",s[s.Edit=2]="Edit",s[s.Delete=3]="Delete"},676:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},233:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},455:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},75:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},258:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},413:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},954:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},663:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},542:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},610:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},95:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},581:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},342:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},790:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},212:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},88:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},90:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},948:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},468:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinConfirmButtonStyle=void 0,(s=t.AddinConfirmButtonStyle||(t.AddinConfirmButtonStyle={}))[s.Default=0]="Default",s[s.Primary=1]="Primary",s[s.Link=2]="Link"},756:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},545:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},993:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinTabSummaryStyle=void 0,(s=t.AddinTabSummaryStyle||(t.AddinTabSummaryStyle={}))[s.None=0]="None",s[s.Text=1]="Text"},518:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},590:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinTileSummaryStyle=void 0,(s=t.AddinTileSummaryStyle||(t.AddinTileSummaryStyle={}))[s.None=0]="None",s[s.Text=1]="Text",s[s.Check=2]="Check"},480:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinToastStyle=void 0,(s=t.AddinToastStyle||(t.AddinToastStyle={}))[s.Danger=0]="Danger",s[s.Info=1]="Info",s[s.Success=2]="Success",s[s.Warning=3]="Warning"},142:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var a=Object.getOwnPropertyDescriptor(t,s);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,a)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),a=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),a(s(714),t),a(s(819),t),a(s(676),t),a(s(233),t),a(s(455),t),a(s(75),t),a(s(258),t),a(s(413),t),a(s(954),t),a(s(663),t),a(s(542),t),a(s(610),t),a(s(95),t),a(s(581),t),a(s(342),t),a(s(790),t),a(s(212),t),a(s(88),t),a(s(90),t),a(s(948),t),a(s(756),t),a(s(468),t),a(s(545),t),a(s(993),t),a(s(518),t),a(s(590),t),a(s(480),t)},220:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},606:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},57:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var a=Object.getOwnPropertyDescriptor(t,s);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,a)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),a=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),a(s(220),t),a(s(606),t)},983:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var a=Object.getOwnPropertyDescriptor(t,s);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,a)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),a=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),a(s(903),t),a(s(142),t),a(s(57),t)}},t={},s=function s(o){var a=t[o];if(void 0!==a)return a.exports;var n=t[o]={exports:{}};return e[o].call(n.exports,n,n.exports,s),n.exports}(789);window.BBSkyAddinClient=s})();
|
|
1
|
+
(()=>{"use strict";var e={789:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var a=Object.getOwnPropertyDescriptor(t,s);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,a)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),a=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),a(s(983),t)},903:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddinClient=void 0;const s=[/^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$/,/^https\:\/\/[\w\-\.]+\.blackbaudwp\.com$/,/^https\:\/\/[\w\-\.]+\.carrytheload\.org$/,/^https\:\/\/[\w\-\.]+\.ummsfoundation\.org$/,/^http\:\/\/[\w\-\.]+\.lcrf\.org$/,/^https\:\/\/[\w\-\.]+\.go2\.org$/,/^https\:\/\/[\w\-\.]+\.nationwidechildrens\.org$/,/^https\:\/\/[\w\-\.]+\.lupus\.org$/,/^https\:\/\/[\w\-\.]+\.operationsmile\.ca$/,/^https\:\/\/[\w\-\.]+\.convio\.net$/,/^https\:\/\/[\w\-\.]+\.ontariospca\.ca$/,/^https\:\/\/[\w\-\.]+\.brighamandwomens\.org$/,/^https\:\/\/[\w\-\.]+\.northernlighthealth\.org$/,/^http\:\/\/[\w\-\.]+\.convio\.net$/,/^https\:\/\/[\w\-\.]+\.alpha1\.org$/,/^https\:\/\/[\w\-\.]+\.pscpartners\.org$/,/^https\:\/\/[\w\-\.]+\.mercyforanimals\.org$/,/^https\:\/\/[\w\-\.]+\.braintumor\.org$/,/^https\:\/\/[\w\-\.]+\.cancer\.ca$/,/^https\:\/\/[\w\-\.]+\.phoenixchildrensfoundation\.org$/,/^https\:\/\/[\w\-\.]+\.ocmc\.org$/,/^https\:\/\/[\w\-\.]+\.stlouischildrens\.org$/,/^https\:\/\/[\w\-\.]+\.choa\.org$/,/^https\:\/\/[\w\-\.]+\.acsevents\.org$/,/^https\:\/\/[\w\-\.]+\.operationsmile\.org$/,/^https\:\/\/[\w\-\.]+\.mdmercy\.com$/,/^https\:\/\/[\w\-\.]+\.cookchildrens\.org$/,/^https\:\/\/[\w\-\.]+\.chla\.org$/,/^https\:\/\/[\w\-\.]+\.nleomf\.org$/,/^https\:\/\/[\w\-\.]+\.pwatoronto\.org$/,/^https\:\/\/[\w\-\.]+\.jfsla\.org$/,/^https\:\/\/[\w\-\.]+\.roswellpark\.org$/,/^https\:\/\/[\w\-\.]+\.alsagoldenwest\.org$/,/^https\:\/\/[\w\-\.]+\.cancercarefoundation\.ca$/,/^https\:\/\/[\w\-\.]+\.alsnc\.org$/,/^https\:\/\/[\w\-\.]+\.alsanm\.org$/,/^https\:\/\/[\w\-\.]+\.waysidewaifs\.org$/,/^https\:\/\/[\w\-\.]+\.bladdercancercanada\.org$/,/^https\:\/\/[\w\-\.]+\.jimmyfund\.org$/,/^https\:\/\/[\w\-\.]+\.info\-komen\.org$/,/^https\:\/\/[\w\-\.]+\.mountsinai\.org$/,/^https\:\/\/[\w\-\.]+\.walkforpd\.ca$/,/^https\:\/\/[\w\-\.]+\.alsoregon\.org$/,/^https\:\/\/[\w\-\.]+\.feedhopenow\.org$/,/^https\:\/\/[\w\-\.]+\.trilliumgiving\.ca$/,/^https\:\/\/[\w\-\.]+\.swimacrossamerica\.org$/,/^https\:\/\/ovariancanada\.org$/,/^https\:\/\/[\w\-\.]+\.ovariancanada\.org$/,/^https\:\/\/[\w\-\.]+\.alsunitedchicago\.org$/,/^https\:\/\/[\w\-\.]+\.fredhutch\.org$/,/^https\:\/\/[\w\-\.]+\.hss\.edu$/,/^https\:\/\/[\w\-\.]+\.nyghfoundation\.ca$/,/^https\:\/\/[\w\-\.]+\.natureconservancy\.ca$/,/^https\:\/\/[\w\-\.]+\.llscanada\.org$/,/^https\:\/\/[\w\-\.]+\.als\-ny\.org$/,/^https\:\/\/[\w\-\.]+\.zerocancer\.org$/,/^https\:\/\/[\w\-\.]+\.alsmidatlantic\.org$/,/^https\:\/\/[\w\-\.]+\.habitat\.ca$/,/^https\:\/\/[\w\-\.]+\.stamfordhospitalfoundation\.org$/,/^https\:\/\/[\w\-\.]+\.alsohio\.org$/,/^https\:\/\/[\w\-\.]+\.cancercarefdn\.mb\.ca$/,/^https\:\/\/[\w\-\.]+\.baycrestfoundation\.org$/,/^https\:\/\/[\w\-\.]+\.southlake\.ca$/,/^https\:\/\/[\w\-\.]+\.parkinson\.ca$/];class o{static getQueryString(){return window.location.search}constructor(e){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.allowedOrigins=s,this.initConfig(e.config),this.windowMessageHandler=e=>{this.handleMessage(e)},window.addEventListener("message",this.windowMessageHandler),this.raiseAddinReadyMessage()}destroy(){window.removeEventListener("message",this.windowMessageHandler),this.heightChangeIntervalId&&clearInterval(this.heightChangeIntervalId)}navigate(e){this.postMessageToHostPage({message:{url:e.url},messageType:"navigate"})}getAuthToken(){return this.getUserIdentityToken()}getUserIdentityToken(){return new Promise(((e,t)=>{const s=++this.lastAuthTokenRequestId;this.authTokenRequests[s]={reject:t,resolve:e},this.postMessageToHostPage({message:{authTokenRequestId:s},messageType:"get-auth-token"})}))}showModal(e){return{modalClosed:new Promise(((t,s)=>{const o=++this.lastModalRequestId;this.modalRequests[o]={reject:s,resolve:t},this.postMessageToHostPage({message:{args:e,modalRequestId:o},messageType:"show-modal"})}))}}closeModal(e){this.postMessageToHostPage({message:e,messageType:"close-modal"})}openHelp(e){this.postMessageToHostPage({message:{helpKey:e.helpKey},messageType:"open-help"})}showToast(e){this.postMessageToHostPage({message:e,messageType:"show-toast"})}showFlyout(e){return{flyoutClosed:new Promise(((t,s)=>{e.defaultWidth=e.defaultWidth,e.maxWidth=e.maxWidth,e.minWidth=e.minWidth,this.flyoutRequest={reject:s,resolve:t},this.postMessageToHostPage({message:e,messageType:"show-flyout"})}))}}closeFlyout(){this.postMessageToHostPage({messageType:"close-flyout"})}showConfirm(e){return new Promise(((t,s)=>{this.confirmRequest={reject:s,resolve:t},this.postMessageToHostPage({message:e,messageType:"show-confirm"})}))}showError(e){this.postMessageToHostPage({message:e,messageType:"show-error"})}showWait(){this.postMessageToHostPage({messageType:"show-wait"})}hideWait(){this.postMessageToHostPage({messageType:"hide-wait"})}addEventHandler(e,t){this.registeredAddinEvents[e]=t}sendEvent(e){return new Promise(((t,s)=>{const o=e.type;this.supportedEventTypes.includes(o)||s("Event type not supported");const a=this.pendingSentEvents[o];a&&(clearTimeout(a.timeoutId),a.reject("Event cancelled"));const i=setTimeout((()=>{delete this.pendingSentEvents[o],this.postMessageToHostPage({message:{event:e,eventRequestId:this.eventRequestId},messageType:"client-event"}),this.sentEvents[this.eventRequestId]=t,this.eventRequestId++}),200);this.pendingSentEvents[o]={reject:s,timeoutId:i}}))}initConfig(e){var t;(null===(t=null==e?void 0:e.allowedOrigins)||void 0===t?void 0:t.length)>0&&(this.allowedOrigins=this.allowedOrigins.concat(e.allowedOrigins),this.allowedOrigins=this.allowedOrigins.reduce(((e,t)=>(e.find((e=>e.source===t.source))||e.push(t),e)),[]))}raiseAddinReadyMessage(){this.postMessageToHostPage({messageType:"ready"},"*")}handleModalClosedMessage(e){const t=this.modalRequests,s=e.modalRequestId;t[s].resolve(e.context),t[s]=void 0}handleAuthTokenMessage(e){const t=this.authTokenRequests,s=e.message.authTokenRequestId,o=t[s];switch(e.messageType){case"auth-token":const t=e.message.authToken;o.resolve(t);break;case"auth-token-fail":o.reject(e.message.reason)}t[s]=void 0}handleMessage(e){const t=e.data;if(t&&"bb-addin-host"===t.source)if("host-ready"===t.messageType)this.setKnownAllowedHostOrigin(e.origin),this.trackHeightChangesOfAddinContent(),this.supportedEventTypes=t.message.supportedEventTypes,this.args.callbacks.init({context:t.message.context,envId:t.message.envId,ready:e=>{this.checkForHeightChangesOfAddinContent(),this.postMessageToHostPage({message:e,messageType:"addin-ready"})},supportedEventTypes:t.message.supportedEventTypes,themeSettings:t.message.themeSettings});else if(this.isFromValidOrigin(e))switch(t.messageType){case"action-click":this.args.callbacks.actionClick&&this.args.callbacks.actionClick(t.message.reason);break;case"auth-token":case"auth-token-fail":this.handleAuthTokenMessage(t);break;case"modal-closed":this.handleModalClosedMessage(t.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(t.message);break;case"confirm-closed":this.confirmRequest&&(this.confirmRequest.resolve(t.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"theme-change":this.args.callbacks.themeChange&&this.args.callbacks.themeChange(t.message.themeSettings);break;case"host-event":this.processHostEvent(t.message);break;case"event-received":this.resolveClientEvent(t.message)}else this.warnInvalidOrigin()}setKnownAllowedHostOrigin(e){for(const t of this.allowedOrigins)if(t.test(e))return void(this.trustedOrigin=e)}checkForHeightChangesOfAddinContent(){const e=document.documentElement.offsetHeight;e!==this.lastPostedIframeHeight&&(this.lastPostedIframeHeight=e,this.postMessageToHostPage({message:{height:e+"px"},messageType:"height-change"}))}trackHeightChangesOfAddinContent(){this.heightChangeIntervalId=setInterval((()=>{this.checkForHeightChangesOfAddinContent()}),1e3)}postMessageToHostPage(e,t){e.source="bb-addin-client",e.addinId=this.getQueryVariable("addinId"),(t=t||this.trustedOrigin)?window.parent.postMessage(e,t):this.warnInvalidOrigin()}processHostEvent(e){const t=e.context,s=this.registeredAddinEvents[t.type];let o;o=s?this.isBlockingEventType(t.type)?new Promise((e=>{s(t.context,(()=>{e()}))})):new Promise((e=>{s(t.context),e()})):Promise.resolve(),o.then((()=>this.postEventReceivedMessage(e.eventRequestId)))}isBlockingEventType(e){switch(e){case"form-save":case"form-cancel":return!0}return!1}postEventReceivedMessage(e){this.postMessageToHostPage({message:{eventRequestId:e},messageType:"event-received"})}resolveClientEvent(e){const t=e.eventRequestId,s=this.sentEvents[t];s&&(s(),delete this.sentEvents[t])}isFromValidOrigin(e){return e.origin===this.trustedOrigin}warnInvalidOrigin(){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.")}getQueryVariable(e){const t=o.getQueryString().substring(1).split("&");for(const s of t){const t=s.split("=");if(decodeURIComponent(t[0])===e)return decodeURIComponent(t[1])}}}t.AddinClient=o},93:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},294:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},714:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},819:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinButtonStyle=void 0,(s=t.AddinButtonStyle||(t.AddinButtonStyle={}))[s.None=0]="None",s[s.Add=1]="Add",s[s.Edit=2]="Edit",s[s.Delete=3]="Delete"},676:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},233:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},455:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},407:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},75:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},258:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},413:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},954:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},663:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},542:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},610:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},95:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},581:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},342:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},790:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},212:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},88:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},90:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},948:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},468:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinConfirmButtonStyle=void 0,(s=t.AddinConfirmButtonStyle||(t.AddinConfirmButtonStyle={}))[s.Default=0]="Default",s[s.Primary=1]="Primary",s[s.Link=2]="Link"},756:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},545:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},993:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinTabSummaryStyle=void 0,(s=t.AddinTabSummaryStyle||(t.AddinTabSummaryStyle={}))[s.None=0]="None",s[s.Text=1]="Text"},518:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},590:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinTileSummaryStyle=void 0,(s=t.AddinTileSummaryStyle||(t.AddinTileSummaryStyle={}))[s.None=0]="None",s[s.Text=1]="Text",s[s.Check=2]="Check"},480:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinToastStyle=void 0,(s=t.AddinToastStyle||(t.AddinToastStyle={}))[s.Danger=0]="Danger",s[s.Info=1]="Info",s[s.Success=2]="Success",s[s.Warning=3]="Warning"},142:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var a=Object.getOwnPropertyDescriptor(t,s);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,a)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),a=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),a(s(93),t),a(s(294),t),a(s(714),t),a(s(819),t),a(s(676),t),a(s(233),t),a(s(455),t),a(s(407),t),a(s(75),t),a(s(258),t),a(s(413),t),a(s(954),t),a(s(663),t),a(s(542),t),a(s(610),t),a(s(95),t),a(s(581),t),a(s(342),t),a(s(790),t),a(s(212),t),a(s(88),t),a(s(90),t),a(s(948),t),a(s(756),t),a(s(468),t),a(s(545),t),a(s(993),t),a(s(518),t),a(s(590),t),a(s(480),t)},220:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},606:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},57:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var a=Object.getOwnPropertyDescriptor(t,s);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,a)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),a=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),a(s(220),t),a(s(606),t)},983:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var a=Object.getOwnPropertyDescriptor(t,s);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,a)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),a=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),a(s(903),t),a(s(142),t),a(s(57),t)}},t={},s=function s(o){var a=t[o];if(void 0!==a)return a.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,s),i.exports}(789);window.BBSkyAddinClient=s})();
|
|
@@ -45,7 +45,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
45
45
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
46
46
|
__exportStar(__webpack_require__(2), exports);
|
|
47
47
|
__exportStar(__webpack_require__(3), exports);
|
|
48
|
-
__exportStar(__webpack_require__(
|
|
48
|
+
__exportStar(__webpack_require__(34), exports);
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
/***/ }),
|
|
@@ -56,8 +56,8 @@ __exportStar(__webpack_require__(31), exports);
|
|
|
56
56
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
57
57
|
exports.AddinClient = void 0;
|
|
58
58
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
* Collection of regexs for our whitelist of host origins.
|
|
60
|
+
*/
|
|
61
61
|
var allowedOrigins = [
|
|
62
62
|
/^https\:\/\/[\w\-\.]+\.blackbaud\.com$/,
|
|
63
63
|
/^https\:\/\/[\w\-\.]+\.blackbaud\-dev\.com$/,
|
|
@@ -193,6 +193,11 @@ var AddinClient = /** @class */ (function () {
|
|
|
193
193
|
* The add-in client will throw an error if an event is attempted but not one the supported types.
|
|
194
194
|
*/
|
|
195
195
|
this.supportedEventTypes = [];
|
|
196
|
+
/**
|
|
197
|
+
* Collection of regexs for our whitelist of host origins.
|
|
198
|
+
*/
|
|
199
|
+
this.allowedOrigins = allowedOrigins;
|
|
200
|
+
this.initConfig(args.config);
|
|
196
201
|
this.windowMessageHandler = function (event) {
|
|
197
202
|
_this.handleMessage(event);
|
|
198
203
|
};
|
|
@@ -438,6 +443,20 @@ var AddinClient = /** @class */ (function () {
|
|
|
438
443
|
};
|
|
439
444
|
});
|
|
440
445
|
};
|
|
446
|
+
AddinClient.prototype.initConfig = function (config) {
|
|
447
|
+
var _a;
|
|
448
|
+
if (((_a = config === null || config === void 0 ? void 0 : config.allowedOrigins) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
449
|
+
// append custom allowed origins
|
|
450
|
+
this.allowedOrigins = this.allowedOrigins.concat(config.allowedOrigins);
|
|
451
|
+
// remove duplicates
|
|
452
|
+
this.allowedOrigins = this.allowedOrigins.reduce(function (acc, curr) {
|
|
453
|
+
if (!acc.find(function (a) { return a.source === curr.source; })) {
|
|
454
|
+
acc.push(curr);
|
|
455
|
+
}
|
|
456
|
+
return acc;
|
|
457
|
+
}, []);
|
|
458
|
+
}
|
|
459
|
+
};
|
|
441
460
|
/**
|
|
442
461
|
* Post a message to the host page informing it that the add-in is
|
|
443
462
|
* now started and listening for messages from the host.
|
|
@@ -524,6 +543,11 @@ var AddinClient = /** @class */ (function () {
|
|
|
524
543
|
else if (this.isFromValidOrigin(event)) {
|
|
525
544
|
/* tslint:disable-next-line switch-default */
|
|
526
545
|
switch (data.messageType) {
|
|
546
|
+
case 'action-click':
|
|
547
|
+
if (this.args.callbacks.actionClick) {
|
|
548
|
+
this.args.callbacks.actionClick(data.message.reason);
|
|
549
|
+
}
|
|
550
|
+
break;
|
|
527
551
|
case 'auth-token':
|
|
528
552
|
case 'auth-token-fail':
|
|
529
553
|
this.handleAuthTokenMessage(data);
|
|
@@ -600,8 +624,8 @@ var AddinClient = /** @class */ (function () {
|
|
|
600
624
|
* @param hostOrigin
|
|
601
625
|
*/
|
|
602
626
|
AddinClient.prototype.setKnownAllowedHostOrigin = function (hostOrigin) {
|
|
603
|
-
for (var _i = 0,
|
|
604
|
-
var allowedOrigin =
|
|
627
|
+
for (var _i = 0, _a = this.allowedOrigins; _i < _a.length; _i++) {
|
|
628
|
+
var allowedOrigin = _a[_i];
|
|
605
629
|
if (allowedOrigin.test(hostOrigin)) {
|
|
606
630
|
this.trustedOrigin = hostOrigin;
|
|
607
631
|
return;
|
|
@@ -804,6 +828,9 @@ __exportStar(__webpack_require__(27), exports);
|
|
|
804
828
|
__exportStar(__webpack_require__(28), exports);
|
|
805
829
|
__exportStar(__webpack_require__(29), exports);
|
|
806
830
|
__exportStar(__webpack_require__(30), exports);
|
|
831
|
+
__exportStar(__webpack_require__(31), exports);
|
|
832
|
+
__exportStar(__webpack_require__(32), exports);
|
|
833
|
+
__exportStar(__webpack_require__(33), exports);
|
|
807
834
|
|
|
808
835
|
|
|
809
836
|
/***/ }),
|
|
@@ -820,21 +847,6 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
820
847
|
|
|
821
848
|
|
|
822
849
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
823
|
-
exports.AddinButtonStyle = void 0;
|
|
824
|
-
/*
|
|
825
|
-
* Defines the style of the button
|
|
826
|
-
*/
|
|
827
|
-
var AddinButtonStyle;
|
|
828
|
-
(function (AddinButtonStyle) {
|
|
829
|
-
// No style (default)
|
|
830
|
-
AddinButtonStyle[AddinButtonStyle["None"] = 0] = "None";
|
|
831
|
-
// The button represents an "add" operation
|
|
832
|
-
AddinButtonStyle[AddinButtonStyle["Add"] = 1] = "Add";
|
|
833
|
-
// The button represents an "edit" operation
|
|
834
|
-
AddinButtonStyle[AddinButtonStyle["Edit"] = 2] = "Edit";
|
|
835
|
-
// The button represents a "delete" operation
|
|
836
|
-
AddinButtonStyle[AddinButtonStyle["Delete"] = 3] = "Delete";
|
|
837
|
-
})(AddinButtonStyle = exports.AddinButtonStyle || (exports.AddinButtonStyle = {}));
|
|
838
850
|
|
|
839
851
|
|
|
840
852
|
/***/ }),
|
|
@@ -851,6 +863,21 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
851
863
|
|
|
852
864
|
|
|
853
865
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
866
|
+
exports.AddinButtonStyle = void 0;
|
|
867
|
+
/*
|
|
868
|
+
* Defines the style of the button
|
|
869
|
+
*/
|
|
870
|
+
var AddinButtonStyle;
|
|
871
|
+
(function (AddinButtonStyle) {
|
|
872
|
+
// No style (default)
|
|
873
|
+
AddinButtonStyle[AddinButtonStyle["None"] = 0] = "None";
|
|
874
|
+
// The button represents an "add" operation
|
|
875
|
+
AddinButtonStyle[AddinButtonStyle["Add"] = 1] = "Add";
|
|
876
|
+
// The button represents an "edit" operation
|
|
877
|
+
AddinButtonStyle[AddinButtonStyle["Edit"] = 2] = "Edit";
|
|
878
|
+
// The button represents a "delete" operation
|
|
879
|
+
AddinButtonStyle[AddinButtonStyle["Delete"] = 3] = "Delete";
|
|
880
|
+
})(AddinButtonStyle = exports.AddinButtonStyle || (exports.AddinButtonStyle = {}));
|
|
854
881
|
|
|
855
882
|
|
|
856
883
|
/***/ }),
|
|
@@ -994,6 +1021,30 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
994
1021
|
/***/ ((__unused_webpack_module, exports) => {
|
|
995
1022
|
|
|
996
1023
|
|
|
1024
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1025
|
+
|
|
1026
|
+
|
|
1027
|
+
/***/ }),
|
|
1028
|
+
/* 26 */
|
|
1029
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1030
|
+
|
|
1031
|
+
|
|
1032
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1033
|
+
|
|
1034
|
+
|
|
1035
|
+
/***/ }),
|
|
1036
|
+
/* 27 */
|
|
1037
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1041
|
+
|
|
1042
|
+
|
|
1043
|
+
/***/ }),
|
|
1044
|
+
/* 28 */
|
|
1045
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1046
|
+
|
|
1047
|
+
|
|
997
1048
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
998
1049
|
exports.AddinConfirmButtonStyle = void 0;
|
|
999
1050
|
/**
|
|
@@ -1012,7 +1063,7 @@ var AddinConfirmButtonStyle;
|
|
|
1012
1063
|
|
|
1013
1064
|
|
|
1014
1065
|
/***/ }),
|
|
1015
|
-
/*
|
|
1066
|
+
/* 29 */
|
|
1016
1067
|
/***/ ((__unused_webpack_module, exports) => {
|
|
1017
1068
|
|
|
1018
1069
|
|
|
@@ -1020,7 +1071,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1020
1071
|
|
|
1021
1072
|
|
|
1022
1073
|
/***/ }),
|
|
1023
|
-
/*
|
|
1074
|
+
/* 30 */
|
|
1024
1075
|
/***/ ((__unused_webpack_module, exports) => {
|
|
1025
1076
|
|
|
1026
1077
|
|
|
@@ -1039,7 +1090,7 @@ var AddinTabSummaryStyle;
|
|
|
1039
1090
|
|
|
1040
1091
|
|
|
1041
1092
|
/***/ }),
|
|
1042
|
-
/*
|
|
1093
|
+
/* 31 */
|
|
1043
1094
|
/***/ ((__unused_webpack_module, exports) => {
|
|
1044
1095
|
|
|
1045
1096
|
|
|
@@ -1047,7 +1098,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1047
1098
|
|
|
1048
1099
|
|
|
1049
1100
|
/***/ }),
|
|
1050
|
-
/*
|
|
1101
|
+
/* 32 */
|
|
1051
1102
|
/***/ ((__unused_webpack_module, exports) => {
|
|
1052
1103
|
|
|
1053
1104
|
|
|
@@ -1068,7 +1119,7 @@ var AddinTileSummaryStyle;
|
|
|
1068
1119
|
|
|
1069
1120
|
|
|
1070
1121
|
/***/ }),
|
|
1071
|
-
/*
|
|
1122
|
+
/* 33 */
|
|
1072
1123
|
/***/ ((__unused_webpack_module, exports) => {
|
|
1073
1124
|
|
|
1074
1125
|
|
|
@@ -1091,7 +1142,7 @@ var AddinToastStyle;
|
|
|
1091
1142
|
|
|
1092
1143
|
|
|
1093
1144
|
/***/ }),
|
|
1094
|
-
/*
|
|
1145
|
+
/* 34 */
|
|
1095
1146
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1096
1147
|
|
|
1097
1148
|
|
|
@@ -1110,12 +1161,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
1110
1161
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1111
1162
|
};
|
|
1112
1163
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1113
|
-
__exportStar(__webpack_require__(
|
|
1114
|
-
__exportStar(__webpack_require__(
|
|
1164
|
+
__exportStar(__webpack_require__(35), exports);
|
|
1165
|
+
__exportStar(__webpack_require__(36), exports);
|
|
1115
1166
|
|
|
1116
1167
|
|
|
1117
1168
|
/***/ }),
|
|
1118
|
-
/*
|
|
1169
|
+
/* 35 */
|
|
1119
1170
|
/***/ ((__unused_webpack_module, exports) => {
|
|
1120
1171
|
|
|
1121
1172
|
|
|
@@ -1123,7 +1174,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1123
1174
|
|
|
1124
1175
|
|
|
1125
1176
|
/***/ }),
|
|
1126
|
-
/*
|
|
1177
|
+
/* 36 */
|
|
1127
1178
|
/***/ ((__unused_webpack_module, exports) => {
|
|
1128
1179
|
|
|
1129
1180
|
|