@4site/engrid-scripts 0.23.11 → 0.24.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/dist/app.js +2 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/interfaces/options.d.ts +0 -1
- package/dist/interfaces/options.js +0 -1
- package/dist/remember-me.js +34 -2
- package/dist/stripe-financial-connections.d.ts +14 -0
- package/dist/stripe-financial-connections.js +48 -0
- package/dist/supporter-hub.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/dist/app.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DonationAmount, DonationFrequency, EnForm, ProcessingFees, Country, } from "./events";
|
|
2
|
-
import { AmountLabel, Loader, ProgressBar, UpsellLightbox, ENGrid, OptionsDefaults, setRecurrFreq, PageBackground, MediaAttribution, ApplePay, A11y, CapitalizeFields, Ecard, ClickToExpand, Advocacy, DataAttributes, LiveVariables, iFrame, InputPlaceholders, InputHasValueAndFocus, ShowHideRadioCheckboxes, AutoCountrySelect, SkipToMainContentLink, SrcDefer, NeverBounce, AutoYear, Autocomplete, RememberMe, TranslateFields, ShowIfAmount, EngridLogger, OtherAmount, MinMaxAmount, Ticker, DataReplace, DataHide, AddNameToMessage, ExpandRegionName, AppVersion, UrlToForm, RequiredIfVisible, TidyContact, DataLayer, LiveCurrency, Autosubmit, EventTickets, SwapAmounts, DebugPanel, DebugHiddenFields, FreshAddress, BrandingHtml, CountryDisable, PremiumGift, DigitalWallets, MobileCTA, LiveFrequency, UniversalOptIn,
|
|
2
|
+
import { AmountLabel, Loader, ProgressBar, UpsellLightbox, ENGrid, OptionsDefaults, setRecurrFreq, PageBackground, MediaAttribution, ApplePay, A11y, CapitalizeFields, Ecard, ClickToExpand, Advocacy, DataAttributes, LiveVariables, iFrame, InputPlaceholders, InputHasValueAndFocus, ShowHideRadioCheckboxes, AutoCountrySelect, SkipToMainContentLink, SrcDefer, NeverBounce, AutoYear, Autocomplete, RememberMe, TranslateFields, ShowIfAmount, EngridLogger, OtherAmount, MinMaxAmount, Ticker, DataReplace, DataHide, AddNameToMessage, ExpandRegionName, AppVersion, UrlToForm, RequiredIfVisible, TidyContact, DataLayer, LiveCurrency, Autosubmit, EventTickets, SwapAmounts, DebugPanel, DebugHiddenFields, FreshAddress, BrandingHtml, CountryDisable, PremiumGift, DigitalWallets, MobileCTA, LiveFrequency, UniversalOptIn, StripeFinancialConnections, GiveBySelect, UrlParamsToBodyAttrs, ExitIntentLightbox, SupporterHub, FastFormFill, SetAttr, ShowIfPresent, ENValidators, CustomCurrency, VGS, PostalCodeValidator, CountryRedirect, WelcomeBack, EcardToTarget, UsOnlyForm, ThankYouPageConditionalContent, EmbeddedEcard, CheckboxLabel, UpsellCheckbox, PostDonationEmbed, FrequencyUpsell, CustomPremium, PreferredPaymentMethod, } from ".";
|
|
3
3
|
export class App extends ENGrid {
|
|
4
4
|
constructor(options) {
|
|
5
5
|
super();
|
|
@@ -262,9 +262,7 @@ export class App extends ENGrid {
|
|
|
262
262
|
new LiveFrequency();
|
|
263
263
|
// Universal Opt In
|
|
264
264
|
new UniversalOptIn();
|
|
265
|
-
|
|
266
|
-
if (this.options.Plaid)
|
|
267
|
-
new Plaid();
|
|
265
|
+
new StripeFinancialConnections();
|
|
268
266
|
//Exit Intent Lightbox
|
|
269
267
|
new ExitIntentLightbox();
|
|
270
268
|
new UrlParamsToBodyAttrs();
|
package/dist/index.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ export * from "./digital-wallets";
|
|
|
63
63
|
export * from "./mobile-cta";
|
|
64
64
|
export * from "./live-frequency";
|
|
65
65
|
export * from "./universal-opt-in";
|
|
66
|
-
export * from "./
|
|
66
|
+
export * from "./stripe-financial-connections";
|
|
67
67
|
export * from "./give-by-select";
|
|
68
68
|
export * from "./url-params-to-body-attrs";
|
|
69
69
|
export * from "./exit-intent-lightbox";
|
package/dist/index.js
CHANGED
|
@@ -63,7 +63,7 @@ export * from "./digital-wallets";
|
|
|
63
63
|
export * from "./mobile-cta";
|
|
64
64
|
export * from "./live-frequency";
|
|
65
65
|
export * from "./universal-opt-in";
|
|
66
|
-
export * from "./
|
|
66
|
+
export * from "./stripe-financial-connections";
|
|
67
67
|
export * from "./give-by-select";
|
|
68
68
|
export * from "./url-params-to-body-attrs";
|
|
69
69
|
export * from "./exit-intent-lightbox";
|
package/dist/remember-me.js
CHANGED
|
@@ -285,8 +285,40 @@ export class RememberMe {
|
|
|
285
285
|
setFieldValue(field, value, overwrite = false) {
|
|
286
286
|
value = decodeURIComponent(value || "");
|
|
287
287
|
if (field && value !== undefined) {
|
|
288
|
-
if (
|
|
289
|
-
field.
|
|
288
|
+
if ("type" in field) {
|
|
289
|
+
switch (field.type) {
|
|
290
|
+
case "select-one":
|
|
291
|
+
case "select-multiple": {
|
|
292
|
+
const selectField = field;
|
|
293
|
+
for (const option of Array.from(selectField.options)) {
|
|
294
|
+
if (option.value === value) {
|
|
295
|
+
if ((selectField.value && overwrite) || !selectField.value) {
|
|
296
|
+
option.selected = true;
|
|
297
|
+
selectField.dispatchEvent(new Event("change", { bubbles: true }));
|
|
298
|
+
}
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
break;
|
|
303
|
+
}
|
|
304
|
+
case "checkbox":
|
|
305
|
+
case "radio": {
|
|
306
|
+
const inputField = field;
|
|
307
|
+
if (inputField.value === value) {
|
|
308
|
+
inputField.checked = true;
|
|
309
|
+
inputField.dispatchEvent(new Event("change", { bubbles: true }));
|
|
310
|
+
}
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
case "textarea":
|
|
314
|
+
case "text":
|
|
315
|
+
default:
|
|
316
|
+
if ((field.value && overwrite) || !field.value) {
|
|
317
|
+
field.value = value;
|
|
318
|
+
field.dispatchEvent(new Event("change", { bubbles: true }));
|
|
319
|
+
field.dispatchEvent(new Event("blur", { bubbles: true }));
|
|
320
|
+
}
|
|
321
|
+
}
|
|
290
322
|
}
|
|
291
323
|
}
|
|
292
324
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This component improves EN's implementation of Stripe Financial Connections.
|
|
3
|
+
* Enhancements:
|
|
4
|
+
* - When the modal is closed, it re-enables the submit button.
|
|
5
|
+
*/
|
|
6
|
+
export declare class StripeFinancialConnections {
|
|
7
|
+
private stripeModalOpen;
|
|
8
|
+
private logger;
|
|
9
|
+
constructor();
|
|
10
|
+
isStripeModalNode(node: Node): boolean;
|
|
11
|
+
isStripeModalNodeWIthIframe(node: Node): boolean;
|
|
12
|
+
onStripeModalOpen(): void;
|
|
13
|
+
onStripeModalClose(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This component improves EN's implementation of Stripe Financial Connections.
|
|
3
|
+
* Enhancements:
|
|
4
|
+
* - When the modal is closed, it re-enables the submit button.
|
|
5
|
+
*/
|
|
6
|
+
import { ENGrid, EngridLogger } from ".";
|
|
7
|
+
export class StripeFinancialConnections {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.stripeModalOpen = false;
|
|
10
|
+
this.logger = new EngridLogger("Stripe Financial Connections", "black", "pink", "🏛️");
|
|
11
|
+
const observer = new MutationObserver((mutations) => {
|
|
12
|
+
mutations.forEach((mutation) => {
|
|
13
|
+
mutation.addedNodes.forEach((node) => {
|
|
14
|
+
if (!this.stripeModalOpen && this.isStripeModalNodeWIthIframe(node)) {
|
|
15
|
+
this.logger.log("Stripe Financial Connections modal opened.");
|
|
16
|
+
this.onStripeModalOpen();
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
mutation.removedNodes.forEach((node) => {
|
|
20
|
+
if (this.stripeModalOpen && this.isStripeModalNode(node)) {
|
|
21
|
+
this.logger.log("Stripe Financial Connections modal closed.");
|
|
22
|
+
this.onStripeModalClose();
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
observer.observe(document.body, {
|
|
28
|
+
childList: true,
|
|
29
|
+
subtree: true,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
isStripeModalNode(node) {
|
|
33
|
+
return (node instanceof HTMLElement &&
|
|
34
|
+
node.hasAttribute("data-react-aria-top-layer"));
|
|
35
|
+
}
|
|
36
|
+
isStripeModalNodeWIthIframe(node) {
|
|
37
|
+
return !!(this.isStripeModalNode(node) &&
|
|
38
|
+
node instanceof HTMLElement &&
|
|
39
|
+
node.querySelector('iframe[src*="js.stripe.com"]'));
|
|
40
|
+
}
|
|
41
|
+
onStripeModalOpen() {
|
|
42
|
+
this.stripeModalOpen = true;
|
|
43
|
+
}
|
|
44
|
+
onStripeModalClose() {
|
|
45
|
+
this.stripeModalOpen = false;
|
|
46
|
+
ENGrid.enableSubmit();
|
|
47
|
+
}
|
|
48
|
+
}
|
package/dist/supporter-hub.js
CHANGED
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AppVersion = "0.
|
|
1
|
+
export declare const AppVersion = "0.24.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const AppVersion = "0.
|
|
1
|
+
export const AppVersion = "0.24.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4site/engrid-scripts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "Scripts for the ENGRID Project",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"strongly-typed-events": "^2.0.9"
|
|
26
26
|
},
|
|
27
27
|
"homepage": "https://github.com/4site-interactive-studios/engrid#readme",
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "8e97b736562ae0864c67ba142e59ce4ea386367c",
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"nodemon": "^2.0.20"
|
|
31
31
|
}
|