@verbb/formie-browser 1.0.5 → 1.0.7

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.
Files changed (98) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/chunks/{address-finder-yXU5yMjG.js → address-finder-k7_BXaRe.js} +1 -1
  3. package/dist/chunks/{api-DMK8NSUI.js → api-BUb6P-xu.js} +57 -51
  4. package/dist/chunks/{api-CmwLRq_n.js → api-DztsCJ4r.js} +178 -170
  5. package/dist/chunks/{bpoint-DSjqRv63.js → bpoint-2qDxlKD9.js} +1 -1
  6. package/dist/chunks/{calculations-CgVJcQ2P.js → calculations-CeDgB9jt.js} +13 -13
  7. package/dist/chunks/{captcha-eu-CWJb64_j.js → captcha-eu-CGm8Lbrj.js} +2 -2
  8. package/dist/chunks/{conditions-CZ3FU5QO.js → conditions-B6_nzpeE.js} +97 -85
  9. package/dist/chunks/dist-BQ4a9hmy.js +2659 -0
  10. package/dist/chunks/{eway-D3ctTbEk.js → eway-CImXrB4g.js} +2 -2
  11. package/dist/chunks/{friendly-captcha-v1-ByXzENYZ.js → friendly-captcha-v1-C_2reOXr.js} +1 -1
  12. package/dist/chunks/{friendly-captcha-v2-BPdlmhQu.js → friendly-captcha-v2-CLSAbkqx.js} +1 -1
  13. package/dist/chunks/{go-cardless-BwASSYSK.js → go-cardless-Bz7HHtH0.js} +1 -1
  14. package/dist/chunks/{google-address-OhKilPWE.js → google-address-BH3Zhi06.js} +1 -1
  15. package/dist/chunks/{hcaptcha-CdCd9oEi.js → hcaptcha-CGLAmgjO.js} +2 -2
  16. package/dist/chunks/{loqate-Cp2zvwpE.js → loqate-CJPzBmSm.js} +1 -1
  17. package/dist/chunks/{mollie-COG-ko2D.js → mollie-BtnB3KGh.js} +1 -1
  18. package/dist/chunks/{moneris-CMH8PlRc.js → moneris-Bd4vUk8b.js} +1 -1
  19. package/dist/chunks/{opayo-D2jsR5vh.js → opayo-B-eRIXo-.js} +4 -4
  20. package/dist/chunks/{paddle-DxF88RfC.js → paddle-BUFeEU4d.js} +2 -2
  21. package/dist/chunks/{paypal-b5pnwrA2.js → paypal-8Euw7Hrn.js} +2 -2
  22. package/dist/chunks/{payway-BJYu9DIR.js → payway-dV0SzJxy.js} +2 -2
  23. package/dist/chunks/{recaptcha-enterprise-BSwi8IVX.js → recaptcha-enterprise-XPId5-bS.js} +19 -20
  24. package/dist/chunks/{recaptcha-shared-B4zAescW.js → recaptcha-shared-CLYJvojk.js} +15 -3
  25. package/dist/chunks/{recaptcha-v2-checkbox-CnDQmsKa.js → recaptcha-v2-checkbox-Cy-0PEPc.js} +2 -2
  26. package/dist/chunks/{recaptcha-v2-invisible-Cz5uIlp-.js → recaptcha-v2-invisible-BwRH540O.js} +2 -2
  27. package/dist/chunks/recaptcha-v3-No4Ykrhk.js +28 -0
  28. package/dist/chunks/rich-text-D0sb8bmX.js +349 -0
  29. package/dist/chunks/scripts-CbQ7agX3.js +30 -0
  30. package/dist/chunks/{signature-CpgqHCEx.js → signature-xz4QO7CR.js} +107 -34
  31. package/dist/chunks/{snaptcha-vz1RnZ15.js → snaptcha-DKx98oon.js} +1 -1
  32. package/dist/chunks/{square-BP8RWAKB.js → square-reyJukb7.js} +2 -2
  33. package/dist/chunks/{stripe-MihN63uC.js → stripe-BC-2PBvY.js} +2 -2
  34. package/dist/chunks/{text-limit-B09elPDB.js → text-limit-DbgEFHLO.js} +1 -1
  35. package/dist/chunks/{turnstile-D_Pi1CKM.js → turnstile-DJakPzQD.js} +3 -3
  36. package/dist/chunks/upload-manager-BpqWSHmU.js +2558 -0
  37. package/dist/css/theme/_buttons.css +16 -0
  38. package/dist/css/theme/_tokens.css +2 -0
  39. package/dist/css/theme/fields/_signature.css +19 -0
  40. package/dist/css/theme/fields/_upload-manager.css +279 -0
  41. package/dist/index.js +629 -578
  42. package/dist/js/core/create-formie-client.d.ts.map +1 -1
  43. package/dist/js/core/error-aria-live.d.ts +6 -0
  44. package/dist/js/core/error-aria-live.d.ts.map +1 -0
  45. package/dist/js/core/submit-result-state.d.ts.map +1 -1
  46. package/dist/js/core/submit-result-ui.d.ts.map +1 -1
  47. package/dist/js/modules/captchas/factories.d.ts.map +1 -1
  48. package/dist/js/modules/captchas/host.d.ts +1 -0
  49. package/dist/js/modules/captchas/host.d.ts.map +1 -1
  50. package/dist/js/modules/captchas/recaptcha-enterprise.d.ts.map +1 -1
  51. package/dist/js/modules/captchas/recaptcha-shared.d.ts +1 -0
  52. package/dist/js/modules/captchas/recaptcha-shared.d.ts.map +1 -1
  53. package/dist/js/modules/captchas/recaptcha-v3.d.ts.map +1 -1
  54. package/dist/js/modules/captchas/turnstile.d.ts.map +1 -1
  55. package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -1
  56. package/dist/js/modules/fields/index.d.ts.map +1 -1
  57. package/dist/js/modules/fields/signature.d.ts.map +1 -1
  58. package/dist/js/modules/fields/upload-manager.d.ts +3 -0
  59. package/dist/js/modules/fields/upload-manager.d.ts.map +1 -0
  60. package/dist/js/utils/form-started-at.d.ts +2 -0
  61. package/dist/js/utils/form-started-at.d.ts.map +1 -0
  62. package/dist/js/utils/scripts.d.ts.map +1 -1
  63. package/dist/js/utils/unload-warning.d.ts.map +1 -1
  64. package/dist/js/validation/enter-key-guard.d.ts +2 -0
  65. package/dist/js/validation/enter-key-guard.d.ts.map +1 -0
  66. package/dist/js/validation/types.d.ts +1 -0
  67. package/dist/js/validation/types.d.ts.map +1 -1
  68. package/dist/js/validation/validator.d.ts.map +1 -1
  69. package/package.json +4 -2
  70. package/src/css/theme/_buttons.css +16 -0
  71. package/src/css/theme/_tokens.css +2 -0
  72. package/src/css/theme/fields/_signature.css +19 -0
  73. package/src/css/theme/fields/_upload-manager.css +279 -0
  74. package/src/js/core/create-formie-client.ts +7 -0
  75. package/src/js/core/error-aria-live.ts +45 -0
  76. package/src/js/core/submit-result-state.ts +4 -0
  77. package/src/js/core/submit-result-ui.ts +8 -4
  78. package/src/js/modules/captchas/factories.ts +4 -0
  79. package/src/js/modules/captchas/host.ts +14 -2
  80. package/src/js/modules/captchas/recaptcha-enterprise.ts +14 -11
  81. package/src/js/modules/captchas/recaptcha-shared.ts +14 -0
  82. package/src/js/modules/captchas/recaptcha-v3.ts +7 -4
  83. package/src/js/modules/captchas/turnstile.ts +9 -3
  84. package/src/js/modules/fields/conditions/effects.ts +42 -0
  85. package/src/js/modules/fields/index.ts +1 -0
  86. package/src/js/modules/fields/signature.ts +199 -15
  87. package/src/js/modules/fields/upload-manager.ts +1277 -0
  88. package/src/js/utils/form-started-at.ts +25 -0
  89. package/src/js/utils/scripts.ts +16 -0
  90. package/src/js/utils/unload-warning.ts +1 -0
  91. package/src/js/validation/enter-key-guard.ts +63 -0
  92. package/src/js/validation/types.ts +1 -0
  93. package/src/js/validation/validator.ts +14 -5
  94. package/src/vendor.d.ts +1 -1
  95. package/dist/chunks/dist-BF5GU3_9.js +0 -2674
  96. package/dist/chunks/recaptcha-v3-BtbbP111.js +0 -27
  97. package/dist/chunks/rich-text-Cv8ADyk-.js +0 -349
  98. package/dist/chunks/scripts-6CYSUGKQ.js +0 -24
@@ -1,6 +1,6 @@
1
- import { t as e } from "./api-CmwLRq_n.js";
1
+ import { t as e } from "./api-DztsCJ4r.js";
2
2
  import { r as t } from "./async-nPFRNQ06.js";
3
- import { r as n } from "./scripts-6CYSUGKQ.js";
3
+ import { r as n } from "./scripts-CbQ7agX3.js";
4
4
  //#region src/js/modules/payments/eway.ts
5
5
  var r = [{
6
6
  id: "FORMIE_EWAY_SCRIPT_MIN",
@@ -1,4 +1,4 @@
1
- import { t as e } from "./api-DMK8NSUI.js";
1
+ import { t as e } from "./api-BUb6P-xu.js";
2
2
  //#region src/js/modules/captchas/friendly-captcha-v1.ts
3
3
  var t = e({
4
4
  id: "friendly-captcha-v1",
@@ -1,4 +1,4 @@
1
- import { t as e } from "./api-DMK8NSUI.js";
1
+ import { t as e } from "./api-BUb6P-xu.js";
2
2
  //#region src/js/modules/captchas/friendly-captcha-v2.ts
3
3
  var t = e({
4
4
  id: "friendly-captcha-v2",
@@ -1,5 +1,5 @@
1
1
  import { s as e } from "./event-names-BCI2FLD8.js";
2
- import { t } from "./api-CmwLRq_n.js";
2
+ import { t } from "./api-DztsCJ4r.js";
3
3
  //#region src/js/modules/payments/go-cardless.ts
4
4
  var n = e("go-cardless", "redirect"), r = t({
5
5
  id: "go-cardless",
@@ -1,6 +1,6 @@
1
1
  import { n as e } from "./event-names-BCI2FLD8.js";
2
2
  import { t } from "./api-sPqGbOww.js";
3
- import { n, t as r } from "./scripts-6CYSUGKQ.js";
3
+ import { n, t as r } from "./scripts-CbQ7agX3.js";
4
4
  //#region src/js/modules/address/google-address.ts
5
5
  var i = "FORMIE_GOOGLE_ADDRESS_SCRIPT", a = "formieGoogleMapsReady", o = null;
6
6
  async function s(e) {
@@ -1,5 +1,5 @@
1
- import { a as e, r as t, t as n } from "./api-DMK8NSUI.js";
2
- import { n as r, t as i } from "./scripts-6CYSUGKQ.js";
1
+ import { a as e, r as t, t as n } from "./api-BUb6P-xu.js";
2
+ import { n as r, t as i } from "./scripts-CbQ7agX3.js";
3
3
  //#region src/js/modules/captchas/hcaptcha.ts
4
4
  async function a(n) {
5
5
  let a = typeof n.language == "string" && n.language.trim() !== "" ? n.language.trim() : "en", { async: o, defer: s } = t(n.loadingMethod), c = "FORMIE_HCAPTCHA_ONLOAD", l = window, u = l.hcaptcha;
@@ -1,6 +1,6 @@
1
1
  import { i as e } from "./constants-DVcJAvc5.js";
2
2
  import { t } from "./api-sPqGbOww.js";
3
- import { r as n } from "./scripts-6CYSUGKQ.js";
3
+ import { r as n } from "./scripts-CbQ7agX3.js";
4
4
  //#region src/js/modules/address/loqate.ts
5
5
  var r = "FORMIE_LOQATE_SCRIPT", i = t({
6
6
  id: "loqate",
@@ -1,5 +1,5 @@
1
1
  import { s as e } from "./event-names-BCI2FLD8.js";
2
- import { t } from "./api-CmwLRq_n.js";
2
+ import { t } from "./api-DztsCJ4r.js";
3
3
  //#region src/js/modules/payments/mollie.ts
4
4
  var n = e("mollie", "redirect"), r = t({
5
5
  id: "mollie",
@@ -1,4 +1,4 @@
1
- import { t as e } from "./api-CmwLRq_n.js";
1
+ import { t as e } from "./api-DztsCJ4r.js";
2
2
  //#region src/js/modules/payments/moneris.ts
3
3
  var t = {
4
4
  940: "Invalid profile ID (tokenization request).",
@@ -1,9 +1,9 @@
1
1
  import { s as e } from "./event-names-BCI2FLD8.js";
2
- import { t } from "./debug-BV0DvdHx.js";
3
- import { t as n } from "./api-CmwLRq_n.js";
4
- import { r } from "./scripts-6CYSUGKQ.js";
2
+ import { t } from "./api-DztsCJ4r.js";
3
+ import { t as n } from "./debug-BV0DvdHx.js";
4
+ import { r } from "./scripts-CbQ7agX3.js";
5
5
  //#region src/js/modules/payments/opayo.ts
6
- var i = "FORMIE_OPAYO_SCRIPT", a = "https://live.opayo.eu.elavon.com/api/v1/js/sagepay.js", o = "https://sandbox.opayo.eu.elavon.com/api/v1/js/sagepay.js", s = t("payments", "opayo"), c = e("opayo", "challenge"), l = "formie:payment:opayo:challenge:response", u = n({
6
+ var i = "FORMIE_OPAYO_SCRIPT", a = "https://live.opayo.eu.elavon.com/api/v1/js/sagepay.js", o = "https://sandbox.opayo.eu.elavon.com/api/v1/js/sagepay.js", s = n("payments", "opayo"), c = e("opayo", "challenge"), l = "formie:payment:opayo:challenge:response", u = t({
7
7
  id: "opayo",
8
8
  defaultRequiredInputSuffixes: ["opayoTokenId"],
9
9
  load: async (e) => {
@@ -1,6 +1,6 @@
1
1
  import { s as e } from "./event-names-BCI2FLD8.js";
2
- import { t } from "./api-CmwLRq_n.js";
3
- import { r as n } from "./scripts-6CYSUGKQ.js";
2
+ import { t } from "./api-DztsCJ4r.js";
3
+ import { r as n } from "./scripts-CbQ7agX3.js";
4
4
  //#region src/js/modules/payments/paddle.ts
5
5
  var r = "FORMIE_PADDLE_SCRIPT", i = e("paddle", "initialize"), a = t({
6
6
  id: "paddle",
@@ -1,5 +1,5 @@
1
- import { t as e } from "./api-CmwLRq_n.js";
2
- import { r as t } from "./scripts-6CYSUGKQ.js";
1
+ import { t as e } from "./api-DztsCJ4r.js";
2
+ import { r as t } from "./scripts-CbQ7agX3.js";
3
3
  import { t as n } from "./styles-BfoIZwJp.js";
4
4
  //#endregion
5
5
  //#region src/js/modules/payments/paypal.ts
@@ -1,5 +1,5 @@
1
- import { t as e } from "./api-CmwLRq_n.js";
2
- import { r as t } from "./scripts-6CYSUGKQ.js";
1
+ import { t as e } from "./api-DztsCJ4r.js";
2
+ import { r as t } from "./scripts-CbQ7agX3.js";
3
3
  import { t as n } from "./styles-BfoIZwJp.js";
4
4
  //#endregion
5
5
  //#region src/js/modules/payments/payway.ts
@@ -1,11 +1,11 @@
1
- import { t as e } from "./api-DMK8NSUI.js";
2
- import { t } from "./recaptcha-shared-B4zAescW.js";
1
+ import { t as e } from "./api-BUb6P-xu.js";
2
+ import { n as t, t as n } from "./recaptcha-shared-CLYJvojk.js";
3
3
  //#region src/js/modules/captchas/recaptcha-enterprise.ts
4
- var n = e({
4
+ var r = e({
5
5
  id: "recaptcha-enterprise",
6
6
  defaultPlaceholderSelector: "[data-recaptcha-placeholder]",
7
7
  defaultTokenFieldNames: ["g-recaptcha-response"],
8
- load: ({ options: e }) => t(e.provider, !0, (e.provider.enterpriseType === "score" || e.provider.enterpriseType === "policy") && e.provider.siteKey || void 0),
8
+ load: ({ options: e }) => n(e.provider, !0, (e.provider.enterpriseType === "score" || e.provider.enterpriseType === "policy") && e.provider.siteKey || void 0),
9
9
  mount: ({ api: e, container: t, provider: n, services: r }) => {
10
10
  let i = e.enterprise || e;
11
11
  return new Promise((e) => {
@@ -33,23 +33,22 @@ var n = e({
33
33
  });
34
34
  });
35
35
  },
36
- screen: async ({ api: e, widget: t, provider: n, placeholder: r, services: i, stageCtx: a }) => {
37
- let o = e.enterprise || e;
38
- if (n.enterpriseType === "checkbox") {
39
- if (i.tokens.has()) return;
40
- let e = i.errors.getDefaultMessage();
41
- i.errors.show(e, r), a.abort(e);
36
+ screen: async ({ api: e, widget: n, provider: r, placeholder: i, services: a, stageCtx: o }) => {
37
+ let s = e.enterprise || e;
38
+ if (r.enterpriseType === "checkbox") {
39
+ if (a.tokens.has()) return;
40
+ let e = a.errors.getDefaultMessage();
41
+ a.errors.show(e, i), o.abort(e);
42
42
  return;
43
43
  }
44
- if (!i.tokens.has()) {
45
- if (n.enterpriseType === "score" || n.enterpriseType === "policy") {
46
- let e = await o.execute(n.siteKey || "", { action: n.action || "submit" });
47
- typeof e == "string" && e.trim() !== "" && i.tokens.write(e.trim());
48
- } else o.execute(t);
49
- if (!await i.tokens.wait(12e4)) {
50
- let e = i.errors.getDefaultMessage();
51
- i.errors.show(e, r), a.abort(e);
52
- }
44
+ if (!a.tokens.has() && (await t(e, async () => {
45
+ if (r.enterpriseType === "score" || r.enterpriseType === "policy") {
46
+ let e = await s.execute(r.siteKey || "", { action: r.action || "submit" });
47
+ typeof e == "string" && e.trim() !== "" && a.tokens.write(e.trim());
48
+ } else s.execute(n);
49
+ }), !await a.tokens.wait(12e4))) {
50
+ let e = a.errors.getDefaultMessage();
51
+ a.errors.show(e, i), o.abort(e);
53
52
  }
54
53
  },
55
54
  reset: ({ api: e, widget: t, provider: n, services: r }) => {
@@ -62,4 +61,4 @@ var n = e({
62
61
  }
63
62
  });
64
63
  //#endregion
65
- export { n as recaptchaEnterpriseModule };
64
+ export { r as recaptchaEnterpriseModule };
@@ -1,5 +1,5 @@
1
- import { a as e, r as t } from "./api-DMK8NSUI.js";
2
- import { r as n } from "./scripts-6CYSUGKQ.js";
1
+ import { a as e, r as t } from "./api-BUb6P-xu.js";
2
+ import { r as n } from "./scripts-CbQ7agX3.js";
3
3
  //#region src/js/modules/captchas/recaptcha-shared.ts
4
4
  async function r(r, i = !1, a) {
5
5
  let o = typeof r.language == "string" && r.language.trim() !== "" ? r.language.trim() : "en", { async: s, defer: c } = t(r.loadingMethod), l = i ? "https://www.google.com/recaptcha/enterprise.js" : "https://www.recaptcha.net/recaptcha/api.js", u = typeof a == "string" && a.trim() !== "" ? a.trim() : "explicit", d = new URL(l);
@@ -11,5 +11,17 @@ async function r(r, i = !1, a) {
11
11
  timeoutMs: e
12
12
  });
13
13
  }
14
+ function i(e, t) {
15
+ let n = e.enterprise || e;
16
+ return new Promise((e, r) => {
17
+ try {
18
+ n.ready(() => {
19
+ Promise.resolve(t()).then(e).catch(r);
20
+ });
21
+ } catch (e) {
22
+ r(e);
23
+ }
24
+ });
25
+ }
14
26
  //#endregion
15
- export { r as t };
27
+ export { i as n, r as t };
@@ -1,5 +1,5 @@
1
- import { t as e } from "./api-DMK8NSUI.js";
2
- import { t } from "./recaptcha-shared-B4zAescW.js";
1
+ import { t as e } from "./api-BUb6P-xu.js";
2
+ import { t } from "./recaptcha-shared-CLYJvojk.js";
3
3
  //#region src/js/modules/captchas/recaptcha-v2-checkbox.ts
4
4
  var n = e({
5
5
  id: "recaptcha-v2-checkbox",
@@ -1,5 +1,5 @@
1
- import { t as e } from "./api-DMK8NSUI.js";
2
- import { t } from "./recaptcha-shared-B4zAescW.js";
1
+ import { t as e } from "./api-BUb6P-xu.js";
2
+ import { t } from "./recaptcha-shared-CLYJvojk.js";
3
3
  //#region src/js/modules/captchas/recaptcha-v2-invisible.ts
4
4
  async function n(e, t, n = 1e3) {
5
5
  let r = Date.now() + n;
@@ -0,0 +1,28 @@
1
+ import { t as e } from "./api-BUb6P-xu.js";
2
+ import { n as t, t as n } from "./recaptcha-shared-CLYJvojk.js";
3
+ //#region src/js/modules/captchas/recaptcha-v3.ts
4
+ var r = e({
5
+ id: "recaptcha-v3",
6
+ defaultPlaceholderSelector: "[data-recaptcha-placeholder]",
7
+ defaultTokenFieldNames: ["g-recaptcha-response"],
8
+ load: ({ options: e }) => n(e.provider, !1, e.provider.siteKey || void 0),
9
+ mount: ({ api: e, provider: t }) => new Promise((n) => {
10
+ e.ready(() => {
11
+ n(t.siteKey || "recaptcha-v3");
12
+ });
13
+ }),
14
+ screen: async ({ api: e, provider: n, placeholder: r, services: i, stageCtx: a }) => {
15
+ if (!i.tokens.has() && (await t(e, async () => {
16
+ let t = await e.execute(n.siteKey || "", { action: n.action || "submit" });
17
+ typeof t == "string" && t.trim() !== "" && i.tokens.write(t.trim());
18
+ }), !await i.tokens.wait(12e4))) {
19
+ let e = i.errors.getDefaultMessage();
20
+ i.errors.show(e, r), a.abort(e);
21
+ }
22
+ },
23
+ unmount: ({ services: e }) => {
24
+ e.tokens.clear();
25
+ }
26
+ });
27
+ //#endregion
28
+ export { r as recaptchaV3Module };