@verbb/formie-browser 1.0.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 +5 -0
- package/LICENSE.md +40 -0
- package/README.md +34 -0
- package/dist/chunks/address-finder-DfMCiW89.js +47 -0
- package/dist/chunks/api-CbqEMQT5.js +181 -0
- package/dist/chunks/api-DE7LfK-R.js +960 -0
- package/dist/chunks/api-DOfDzYC_.js +538 -0
- package/dist/chunks/async-B3DUf1GZ.js +26 -0
- package/dist/chunks/bpoint-Ciy3yY9Q.js +34 -0
- package/dist/chunks/calculations-CkYAqO_-.js +197 -0
- package/dist/chunks/captcha-eu-DnOWhMwr.js +43 -0
- package/dist/chunks/checkbox-radio-0x7Tc0br.js +197 -0
- package/dist/chunks/chunk-K6L4z4UQ.js +24 -0
- package/dist/chunks/conditions-4fXKhEJS.js +609 -0
- package/dist/chunks/date-picker-B6iZkjHS.js +6204 -0
- package/dist/chunks/debug-KnZeKYBI.js +39 -0
- package/dist/chunks/dist-D09GnXMW.js +2663 -0
- package/dist/chunks/event-names-DamGPtXR.js +51 -0
- package/dist/chunks/eway-DEAYcwT0.js +86 -0
- package/dist/chunks/field-references.keys-BpBZ_quS.js +24 -0
- package/dist/chunks/field-references.resolver-Ba6xhiJC.js +183 -0
- package/dist/chunks/file-upload-Bh63PQSE.js +430 -0
- package/dist/chunks/friendly-captcha-v1-CqO4WVre.js +40 -0
- package/dist/chunks/friendly-captcha-v2-CyykcJcM.js +47 -0
- package/dist/chunks/friendly-challenge-Dg8XkStd.js +1101 -0
- package/dist/chunks/go-cardless-CuND59rR.js +26 -0
- package/dist/chunks/google-address--uR8WDSm.js +208 -0
- package/dist/chunks/hcaptcha-CmaFUesv.js +72 -0
- package/dist/chunks/hidden-CYnZYple.js +36 -0
- package/dist/chunks/http-18nn97DZ.js +29 -0
- package/dist/chunks/i18n-vUh-KGiH.js +55 -0
- package/dist/chunks/loqate-BICNJlVK.js +97 -0
- package/dist/chunks/mollie-DwlsgHZ1.js +26 -0
- package/dist/chunks/moneris-B_IFZFTx.js +159 -0
- package/dist/chunks/opayo-U2x_TOII.js +192 -0
- package/dist/chunks/paddle-BqXFrc79.js +75 -0
- package/dist/chunks/paypal-Cn_DYGDb.js +121 -0
- package/dist/chunks/payway-Rnq796eC.js +75 -0
- package/dist/chunks/phone-country-B6Me4lK0.js +3317 -0
- package/dist/chunks/place-kit-ldUl-u9w.js +56 -0
- package/dist/chunks/placekit-autocomplete.esm-D-lGeaZl.js +1771 -0
- package/dist/chunks/recaptcha-enterprise-DPJNyv1X.js +72 -0
- package/dist/chunks/recaptcha-shared-DTI4qWVR.js +22 -0
- package/dist/chunks/recaptcha-v2-checkbox-zFjpvJ5c.js +49 -0
- package/dist/chunks/recaptcha-v2-invisible-CnYtkNvz.js +62 -0
- package/dist/chunks/recaptcha-v3-EAlWhnkX.js +33 -0
- package/dist/chunks/repeater-CXD1eLSn.js +151 -0
- package/dist/chunks/rich-text-DkmZRhGj.js +442 -0
- package/dist/chunks/scripts-BGD_iU_6.js +41 -0
- package/dist/chunks/sdk-B7u9fTlP.js +2103 -0
- package/dist/chunks/shared-DC6_1u8X.js +85 -0
- package/dist/chunks/signature-E9KyYXS1.js +765 -0
- package/dist/chunks/snaptcha-CCDunGeb.js +8 -0
- package/dist/chunks/square-BLqK51rS.js +61 -0
- package/dist/chunks/stripe-B8gHpZNC.js +273 -0
- package/dist/chunks/styles-BIh6g7V_.js +22 -0
- package/dist/chunks/summary-EcNE0cvg.js +191 -0
- package/dist/chunks/table-yxEDL6kA.js +124 -0
- package/dist/chunks/text-limit-D0H_Ca2c.js +179 -0
- package/dist/chunks/theme-classes-vSHpdCUO.js +59 -0
- package/dist/chunks/turnstile-DP0bdR7T.js +68 -0
- package/dist/chunks/utils-ByrEVYrJ.js +49584 -0
- package/dist/css/formie-base.css +78 -0
- package/dist/css/formie-theme.css +19 -0
- package/dist/css/formie.css +2 -0
- package/dist/css/theme/_buttons.css +249 -0
- package/dist/css/theme/_loading.css +37 -0
- package/dist/css/theme/_messages.css +39 -0
- package/dist/css/theme/_progress.css +62 -0
- package/dist/css/theme/_tokens.css +361 -0
- package/dist/css/theme/_typography.css +70 -0
- package/dist/css/theme/fields/_address.css +17 -0
- package/dist/css/theme/fields/_check-radio.css +108 -0
- package/dist/css/theme/fields/_file.css +58 -0
- package/dist/css/theme/fields/_group.css +13 -0
- package/dist/css/theme/fields/_input.css +48 -0
- package/dist/css/theme/fields/_nested.css +19 -0
- package/dist/css/theme/fields/_repeater.css +69 -0
- package/dist/css/theme/fields/_rich-text.css +201 -0
- package/dist/css/theme/fields/_select.css +37 -0
- package/dist/css/theme/fields/_signature.css +39 -0
- package/dist/css/theme/fields/_summary.css +53 -0
- package/dist/css/theme/fields/_table.css +121 -0
- package/dist/css/theme/fields/_text-limit.css +10 -0
- package/dist/css/theme/forms/_field.css +62 -0
- package/dist/css/theme/forms/_form.css +166 -0
- package/dist/css/theme/integrations/_payment-modal.css +32 -0
- package/dist/css/theme/integrations/_paypal.css +10 -0
- package/dist/css/theme/integrations/_payway.css +10 -0
- package/dist/css/theme/integrations/_stripe.css +24 -0
- package/dist/css/theme/utilities/_accessibility.css +13 -0
- package/dist/css/theme-base/_controls.css +41 -0
- package/dist/css/theme-base/_primitives.css +34 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3206 -0
- package/dist/js/compatibility/dom-adapter.d.ts +12 -0
- package/dist/js/compatibility/dom-adapter.d.ts.map +1 -0
- package/dist/js/compatibility/event-map.d.ts +25 -0
- package/dist/js/compatibility/event-map.d.ts.map +1 -0
- package/dist/js/compatibility/validator-adapter.d.ts +17 -0
- package/dist/js/compatibility/validator-adapter.d.ts.map +1 -0
- package/dist/js/contracts/client.d.ts +40 -0
- package/dist/js/contracts/client.d.ts.map +1 -0
- package/dist/js/contracts/common.d.ts +5 -0
- package/dist/js/contracts/common.d.ts.map +1 -0
- package/dist/js/contracts/modules.d.ts +47 -0
- package/dist/js/contracts/modules.d.ts.map +1 -0
- package/dist/js/contracts/schema.d.ts +79 -0
- package/dist/js/contracts/schema.d.ts.map +1 -0
- package/dist/js/contracts/theme.d.ts +2 -0
- package/dist/js/contracts/theme.d.ts.map +1 -0
- package/dist/js/core/create-formie-client.d.ts +3 -0
- package/dist/js/core/create-formie-client.d.ts.map +1 -0
- package/dist/js/core/dom-events.d.ts +2 -0
- package/dist/js/core/dom-events.d.ts.map +1 -0
- package/dist/js/core/formie.d.ts +27 -0
- package/dist/js/core/formie.d.ts.map +1 -0
- package/dist/js/core/hydrate-modules.d.ts +22 -0
- package/dist/js/core/hydrate-modules.d.ts.map +1 -0
- package/dist/js/core/page-client-event.d.ts +9 -0
- package/dist/js/core/page-client-event.d.ts.map +1 -0
- package/dist/js/core/page-tab-errors.d.ts +2 -0
- package/dist/js/core/page-tab-errors.d.ts.map +1 -0
- package/dist/js/core/submit-flow.d.ts +21 -0
- package/dist/js/core/submit-flow.d.ts.map +1 -0
- package/dist/js/core/submit-result-state.d.ts +8 -0
- package/dist/js/core/submit-result-state.d.ts.map +1 -0
- package/dist/js/core/submit-result-ui.d.ts +10 -0
- package/dist/js/core/submit-result-ui.d.ts.map +1 -0
- package/dist/js/events/event-bus.d.ts +21 -0
- package/dist/js/events/event-bus.d.ts.map +1 -0
- package/dist/js/modules/address/address-finder.d.ts +2 -0
- package/dist/js/modules/address/address-finder.d.ts.map +1 -0
- package/dist/js/modules/address/api.d.ts +8 -0
- package/dist/js/modules/address/api.d.ts.map +1 -0
- package/dist/js/modules/address/constants.d.ts +15 -0
- package/dist/js/modules/address/constants.d.ts.map +1 -0
- package/dist/js/modules/address/factories.d.ts +35 -0
- package/dist/js/modules/address/factories.d.ts.map +1 -0
- package/dist/js/modules/address/google-address.d.ts +2 -0
- package/dist/js/modules/address/google-address.d.ts.map +1 -0
- package/dist/js/modules/address/host.d.ts +30 -0
- package/dist/js/modules/address/host.d.ts.map +1 -0
- package/dist/js/modules/address/index.d.ts +3 -0
- package/dist/js/modules/address/index.d.ts.map +1 -0
- package/dist/js/modules/address/loqate.d.ts +2 -0
- package/dist/js/modules/address/loqate.d.ts.map +1 -0
- package/dist/js/modules/address/place-kit.d.ts +2 -0
- package/dist/js/modules/address/place-kit.d.ts.map +1 -0
- package/dist/js/modules/captchas/api.d.ts +9 -0
- package/dist/js/modules/captchas/api.d.ts.map +1 -0
- package/dist/js/modules/captchas/captcha-eu.d.ts +2 -0
- package/dist/js/modules/captchas/captcha-eu.d.ts.map +1 -0
- package/dist/js/modules/captchas/constants.d.ts +5 -0
- package/dist/js/modules/captchas/constants.d.ts.map +1 -0
- package/dist/js/modules/captchas/factories.d.ts +63 -0
- package/dist/js/modules/captchas/factories.d.ts.map +1 -0
- package/dist/js/modules/captchas/friendly-captcha-v1.d.ts +2 -0
- package/dist/js/modules/captchas/friendly-captcha-v1.d.ts.map +1 -0
- package/dist/js/modules/captchas/friendly-captcha-v2.d.ts +2 -0
- package/dist/js/modules/captchas/friendly-captcha-v2.d.ts.map +1 -0
- package/dist/js/modules/captchas/hcaptcha.d.ts +2 -0
- package/dist/js/modules/captchas/hcaptcha.d.ts.map +1 -0
- package/dist/js/modules/captchas/host.d.ts +78 -0
- package/dist/js/modules/captchas/host.d.ts.map +1 -0
- package/dist/js/modules/captchas/index.d.ts +3 -0
- package/dist/js/modules/captchas/index.d.ts.map +1 -0
- package/dist/js/modules/captchas/recaptcha-enterprise.d.ts +2 -0
- package/dist/js/modules/captchas/recaptcha-enterprise.d.ts.map +1 -0
- package/dist/js/modules/captchas/recaptcha-shared.d.ts +26 -0
- package/dist/js/modules/captchas/recaptcha-shared.d.ts.map +1 -0
- package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts +2 -0
- package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts.map +1 -0
- package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts +2 -0
- package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts.map +1 -0
- package/dist/js/modules/captchas/recaptcha-v3.d.ts +2 -0
- package/dist/js/modules/captchas/recaptcha-v3.d.ts.map +1 -0
- package/dist/js/modules/captchas/snaptcha.d.ts +2 -0
- package/dist/js/modules/captchas/snaptcha.d.ts.map +1 -0
- package/dist/js/modules/captchas/turnstile.d.ts +2 -0
- package/dist/js/modules/captchas/turnstile.d.ts.map +1 -0
- package/dist/js/modules/captchas/utils.d.ts +13 -0
- package/dist/js/modules/captchas/utils.d.ts.map +1 -0
- package/dist/js/modules/fields/calculations.d.ts +3 -0
- package/dist/js/modules/fields/calculations.d.ts.map +1 -0
- package/dist/js/modules/fields/checkbox-radio.d.ts +3 -0
- package/dist/js/modules/fields/checkbox-radio.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/config.d.ts +5 -0
- package/dist/js/modules/fields/conditions/config.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/effects.d.ts +2 -0
- package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/evaluator.d.ts +6 -0
- package/dist/js/modules/fields/conditions/evaluator.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/references.d.ts +5 -0
- package/dist/js/modules/fields/conditions/references.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/transforms.d.ts +3 -0
- package/dist/js/modules/fields/conditions/transforms.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/types.d.ts +30 -0
- package/dist/js/modules/fields/conditions/types.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/values.d.ts +5 -0
- package/dist/js/modules/fields/conditions/values.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions.d.ts +3 -0
- package/dist/js/modules/fields/conditions.d.ts.map +1 -0
- package/dist/js/modules/fields/date-picker.d.ts +3 -0
- package/dist/js/modules/fields/date-picker.d.ts.map +1 -0
- package/dist/js/modules/fields/file-upload.d.ts +3 -0
- package/dist/js/modules/fields/file-upload.d.ts.map +1 -0
- package/dist/js/modules/fields/hidden.d.ts +3 -0
- package/dist/js/modules/fields/hidden.d.ts.map +1 -0
- package/dist/js/modules/fields/index.d.ts +3 -0
- package/dist/js/modules/fields/index.d.ts.map +1 -0
- package/dist/js/modules/fields/phone-country.d.ts +3 -0
- package/dist/js/modules/fields/phone-country.d.ts.map +1 -0
- package/dist/js/modules/fields/repeater.d.ts +3 -0
- package/dist/js/modules/fields/repeater.d.ts.map +1 -0
- package/dist/js/modules/fields/rich-text.d.ts +3 -0
- package/dist/js/modules/fields/rich-text.d.ts.map +1 -0
- package/dist/js/modules/fields/shared.d.ts +20 -0
- package/dist/js/modules/fields/shared.d.ts.map +1 -0
- package/dist/js/modules/fields/signature.d.ts +3 -0
- package/dist/js/modules/fields/signature.d.ts.map +1 -0
- package/dist/js/modules/fields/summary.d.ts +3 -0
- package/dist/js/modules/fields/summary.d.ts.map +1 -0
- package/dist/js/modules/fields/table.d.ts +3 -0
- package/dist/js/modules/fields/table.d.ts.map +1 -0
- package/dist/js/modules/fields/text-limit.d.ts +3 -0
- package/dist/js/modules/fields/text-limit.d.ts.map +1 -0
- package/dist/js/modules/loader.d.ts +11 -0
- package/dist/js/modules/loader.d.ts.map +1 -0
- package/dist/js/modules/payments/api.d.ts +8 -0
- package/dist/js/modules/payments/api.d.ts.map +1 -0
- package/dist/js/modules/payments/bpoint.d.ts +2 -0
- package/dist/js/modules/payments/bpoint.d.ts.map +1 -0
- package/dist/js/modules/payments/constants.d.ts +5 -0
- package/dist/js/modules/payments/constants.d.ts.map +1 -0
- package/dist/js/modules/payments/eway.d.ts +9 -0
- package/dist/js/modules/payments/eway.d.ts.map +1 -0
- package/dist/js/modules/payments/factories.d.ts +54 -0
- package/dist/js/modules/payments/factories.d.ts.map +1 -0
- package/dist/js/modules/payments/go-cardless.d.ts +2 -0
- package/dist/js/modules/payments/go-cardless.d.ts.map +1 -0
- package/dist/js/modules/payments/host.d.ts +70 -0
- package/dist/js/modules/payments/host.d.ts.map +1 -0
- package/dist/js/modules/payments/index.d.ts +3 -0
- package/dist/js/modules/payments/index.d.ts.map +1 -0
- package/dist/js/modules/payments/mollie.d.ts +2 -0
- package/dist/js/modules/payments/mollie.d.ts.map +1 -0
- package/dist/js/modules/payments/moneris.d.ts +2 -0
- package/dist/js/modules/payments/moneris.d.ts.map +1 -0
- package/dist/js/modules/payments/opayo.d.ts +25 -0
- package/dist/js/modules/payments/opayo.d.ts.map +1 -0
- package/dist/js/modules/payments/paddle.d.ts +2 -0
- package/dist/js/modules/payments/paddle.d.ts.map +1 -0
- package/dist/js/modules/payments/paypal.d.ts +2 -0
- package/dist/js/modules/payments/paypal.d.ts.map +1 -0
- package/dist/js/modules/payments/payway.d.ts +2 -0
- package/dist/js/modules/payments/payway.d.ts.map +1 -0
- package/dist/js/modules/payments/square.d.ts +2 -0
- package/dist/js/modules/payments/square.d.ts.map +1 -0
- package/dist/js/modules/payments/stripe.d.ts +2 -0
- package/dist/js/modules/payments/stripe.d.ts.map +1 -0
- package/dist/js/modules/payments/utils.d.ts +17 -0
- package/dist/js/modules/payments/utils.d.ts.map +1 -0
- package/dist/js/modules/registry.d.ts +9 -0
- package/dist/js/modules/registry.d.ts.map +1 -0
- package/dist/js/modules/styles.d.ts +2 -0
- package/dist/js/modules/styles.d.ts.map +1 -0
- package/dist/js/submit/pipeline.d.ts +18 -0
- package/dist/js/submit/pipeline.d.ts.map +1 -0
- package/dist/js/theme/theme-classes.d.ts +10 -0
- package/dist/js/theme/theme-classes.d.ts.map +1 -0
- package/dist/js/transport/forms-api.d.ts +11 -0
- package/dist/js/transport/forms-api.d.ts.map +1 -0
- package/dist/js/utils/async.d.ts +8 -0
- package/dist/js/utils/async.d.ts.map +1 -0
- package/dist/js/utils/debug.d.ts +10 -0
- package/dist/js/utils/debug.d.ts.map +1 -0
- package/dist/js/utils/event-names.d.ts +13 -0
- package/dist/js/utils/event-names.d.ts.map +1 -0
- package/dist/js/utils/field-references.d.ts +6 -0
- package/dist/js/utils/field-references.d.ts.map +1 -0
- package/dist/js/utils/field-references.keys.d.ts +4 -0
- package/dist/js/utils/field-references.keys.d.ts.map +1 -0
- package/dist/js/utils/field-references.parser.d.ts +3 -0
- package/dist/js/utils/field-references.parser.d.ts.map +1 -0
- package/dist/js/utils/field-references.registry.d.ts +3 -0
- package/dist/js/utils/field-references.registry.d.ts.map +1 -0
- package/dist/js/utils/field-references.resolver.d.ts +4 -0
- package/dist/js/utils/field-references.resolver.d.ts.map +1 -0
- package/dist/js/utils/field-references.types.d.ts +27 -0
- package/dist/js/utils/field-references.types.d.ts.map +1 -0
- package/dist/js/utils/fields.d.ts +5 -0
- package/dist/js/utils/fields.d.ts.map +1 -0
- package/dist/js/utils/http.d.ts +9 -0
- package/dist/js/utils/http.d.ts.map +1 -0
- package/dist/js/utils/i18n.d.ts +7 -0
- package/dist/js/utils/i18n.d.ts.map +1 -0
- package/dist/js/utils/scripts.d.ts +13 -0
- package/dist/js/utils/scripts.d.ts.map +1 -0
- package/dist/js/utils/unload-warning.d.ts +10 -0
- package/dist/js/utils/unload-warning.d.ts.map +1 -0
- package/dist/js/validation/rules/email.d.ts +4 -0
- package/dist/js/validation/rules/email.d.ts.map +1 -0
- package/dist/js/validation/rules/match.d.ts +4 -0
- package/dist/js/validation/rules/match.d.ts.map +1 -0
- package/dist/js/validation/rules/number.d.ts +4 -0
- package/dist/js/validation/rules/number.d.ts.map +1 -0
- package/dist/js/validation/rules/required.d.ts +4 -0
- package/dist/js/validation/rules/required.d.ts.map +1 -0
- package/dist/js/validation/rules/shared.d.ts +7 -0
- package/dist/js/validation/rules/shared.d.ts.map +1 -0
- package/dist/js/validation/rules/url.d.ts +4 -0
- package/dist/js/validation/rules/url.d.ts.map +1 -0
- package/dist/js/validation/rules.d.ts +10 -0
- package/dist/js/validation/rules.d.ts.map +1 -0
- package/dist/js/validation/types.d.ts +44 -0
- package/dist/js/validation/types.d.ts.map +1 -0
- package/dist/js/validation/validator.d.ts +53 -0
- package/dist/js/validation/validator.d.ts.map +1 -0
- package/package.json +78 -0
- package/src/css/formie-base.css +78 -0
- package/src/css/formie-theme.css +19 -0
- package/src/css/formie.css +2 -0
- package/src/css/theme/_buttons.css +249 -0
- package/src/css/theme/_loading.css +37 -0
- package/src/css/theme/_messages.css +39 -0
- package/src/css/theme/_progress.css +62 -0
- package/src/css/theme/_tokens.css +361 -0
- package/src/css/theme/_typography.css +70 -0
- package/src/css/theme/fields/_address.css +17 -0
- package/src/css/theme/fields/_check-radio.css +108 -0
- package/src/css/theme/fields/_file.css +58 -0
- package/src/css/theme/fields/_group.css +13 -0
- package/src/css/theme/fields/_input.css +48 -0
- package/src/css/theme/fields/_nested.css +19 -0
- package/src/css/theme/fields/_repeater.css +69 -0
- package/src/css/theme/fields/_rich-text.css +201 -0
- package/src/css/theme/fields/_select.css +37 -0
- package/src/css/theme/fields/_signature.css +39 -0
- package/src/css/theme/fields/_summary.css +53 -0
- package/src/css/theme/fields/_table.css +121 -0
- package/src/css/theme/fields/_text-limit.css +10 -0
- package/src/css/theme/forms/_field.css +62 -0
- package/src/css/theme/forms/_form.css +166 -0
- package/src/css/theme/integrations/_payment-modal.css +32 -0
- package/src/css/theme/integrations/_paypal.css +10 -0
- package/src/css/theme/integrations/_payway.css +10 -0
- package/src/css/theme/integrations/_stripe.css +24 -0
- package/src/css/theme/utilities/_accessibility.css +13 -0
- package/src/css/theme-base/_controls.css +41 -0
- package/src/css/theme-base/_primitives.css +34 -0
- package/src/icons/rich-text/aligncenter.svg +6 -0
- package/src/icons/rich-text/alignleft.svg +6 -0
- package/src/icons/rich-text/alignright.svg +6 -0
- package/src/icons/rich-text/bold.svg +4 -0
- package/src/icons/rich-text/clear.svg +6 -0
- package/src/icons/rich-text/code.svg +4 -0
- package/src/icons/rich-text/heading1.svg +3 -0
- package/src/icons/rich-text/heading2.svg +3 -0
- package/src/icons/rich-text/image.svg +6 -0
- package/src/icons/rich-text/italic.svg +5 -0
- package/src/icons/rich-text/line.svg +3 -0
- package/src/icons/rich-text/link.svg +4 -0
- package/src/icons/rich-text/olist.svg +8 -0
- package/src/icons/rich-text/paragraph.svg +3 -0
- package/src/icons/rich-text/quote.svg +4 -0
- package/src/icons/rich-text/strikethrough.svg +4 -0
- package/src/icons/rich-text/ulist.svg +8 -0
- package/src/icons/rich-text/underline.svg +4 -0
- package/src/index.ts +125 -0
- package/src/js/compatibility/dom-adapter.ts +129 -0
- package/src/js/compatibility/event-map.ts +72 -0
- package/src/js/compatibility/validator-adapter.ts +105 -0
- package/src/js/contracts/client.ts +43 -0
- package/src/js/contracts/common.ts +14 -0
- package/src/js/contracts/modules.ts +53 -0
- package/src/js/contracts/schema.ts +83 -0
- package/src/js/contracts/theme.ts +1 -0
- package/src/js/core/create-formie-client.ts +1519 -0
- package/src/js/core/dom-events.ts +8 -0
- package/src/js/core/formie.ts +242 -0
- package/src/js/core/hydrate-modules.ts +102 -0
- package/src/js/core/page-client-event.ts +129 -0
- package/src/js/core/page-tab-errors.ts +37 -0
- package/src/js/core/submit-flow.ts +120 -0
- package/src/js/core/submit-result-state.ts +597 -0
- package/src/js/core/submit-result-ui.ts +448 -0
- package/src/js/events/event-bus.ts +109 -0
- package/src/js/modules/address/address-finder.ts +85 -0
- package/src/js/modules/address/api.ts +22 -0
- package/src/js/modules/address/constants.ts +15 -0
- package/src/js/modules/address/factories.ts +203 -0
- package/src/js/modules/address/google-address.ts +345 -0
- package/src/js/modules/address/host.ts +137 -0
- package/src/js/modules/address/index.ts +10 -0
- package/src/js/modules/address/loqate.ts +128 -0
- package/src/js/modules/address/place-kit.ts +94 -0
- package/src/js/modules/captchas/api.ts +25 -0
- package/src/js/modules/captchas/captcha-eu.ts +86 -0
- package/src/js/modules/captchas/constants.ts +4 -0
- package/src/js/modules/captchas/factories.ts +485 -0
- package/src/js/modules/captchas/friendly-captcha-v1.ts +65 -0
- package/src/js/modules/captchas/friendly-captcha-v2.ts +84 -0
- package/src/js/modules/captchas/hcaptcha.ts +153 -0
- package/src/js/modules/captchas/host.ts +448 -0
- package/src/js/modules/captchas/index.ts +16 -0
- package/src/js/modules/captchas/recaptcha-enterprise.ts +138 -0
- package/src/js/modules/captchas/recaptcha-shared.ts +69 -0
- package/src/js/modules/captchas/recaptcha-v2-checkbox.ts +72 -0
- package/src/js/modules/captchas/recaptcha-v2-invisible.ts +108 -0
- package/src/js/modules/captchas/recaptcha-v3.ts +62 -0
- package/src/js/modules/captchas/snaptcha.ts +10 -0
- package/src/js/modules/captchas/turnstile.ts +131 -0
- package/src/js/modules/captchas/utils.ts +85 -0
- package/src/js/modules/fields/calculations.ts +273 -0
- package/src/js/modules/fields/checkbox-radio.ts +295 -0
- package/src/js/modules/fields/conditions/config.ts +79 -0
- package/src/js/modules/fields/conditions/effects.ts +166 -0
- package/src/js/modules/fields/conditions/evaluator.ts +44 -0
- package/src/js/modules/fields/conditions/references.ts +165 -0
- package/src/js/modules/fields/conditions/transforms.ts +206 -0
- package/src/js/modules/fields/conditions/types.ts +33 -0
- package/src/js/modules/fields/conditions/values.ts +115 -0
- package/src/js/modules/fields/conditions.ts +229 -0
- package/src/js/modules/fields/date-picker.ts +272 -0
- package/src/js/modules/fields/file-upload.ts +628 -0
- package/src/js/modules/fields/hidden.ts +58 -0
- package/src/js/modules/fields/index.ts +19 -0
- package/src/js/modules/fields/phone-country.ts +226 -0
- package/src/js/modules/fields/repeater.ts +231 -0
- package/src/js/modules/fields/rich-text.ts +217 -0
- package/src/js/modules/fields/shared.ts +238 -0
- package/src/js/modules/fields/signature.ts +202 -0
- package/src/js/modules/fields/summary.ts +272 -0
- package/src/js/modules/fields/table.ts +197 -0
- package/src/js/modules/fields/text-limit.ts +280 -0
- package/src/js/modules/loader.ts +331 -0
- package/src/js/modules/payments/api.ts +20 -0
- package/src/js/modules/payments/bpoint.ts +48 -0
- package/src/js/modules/payments/constants.ts +17 -0
- package/src/js/modules/payments/eway.ts +132 -0
- package/src/js/modules/payments/factories.ts +332 -0
- package/src/js/modules/payments/go-cardless.ts +37 -0
- package/src/js/modules/payments/host.ts +459 -0
- package/src/js/modules/payments/index.ts +17 -0
- package/src/js/modules/payments/mollie.ts +38 -0
- package/src/js/modules/payments/moneris.ts +216 -0
- package/src/js/modules/payments/opayo.ts +272 -0
- package/src/js/modules/payments/paddle.ts +111 -0
- package/src/js/modules/payments/payment.ts +183 -0
- package/src/js/modules/payments/paypal.ts +214 -0
- package/src/js/modules/payments/payway.ts +114 -0
- package/src/js/modules/payments/square.ts +106 -0
- package/src/js/modules/payments/stripe.ts +426 -0
- package/src/js/modules/payments/stub-payment-module.ts +87 -0
- package/src/js/modules/payments/utils.ts +60 -0
- package/src/js/modules/registry.ts +38 -0
- package/src/js/modules/styles.ts +29 -0
- package/src/js/submit/pipeline.ts +514 -0
- package/src/js/theme/theme-classes.ts +106 -0
- package/src/js/transport/forms-api.ts +345 -0
- package/src/js/utils/async.ts +81 -0
- package/src/js/utils/debug.ts +59 -0
- package/src/js/utils/event-names.ts +60 -0
- package/src/js/utils/field-references.keys.ts +47 -0
- package/src/js/utils/field-references.parser.ts +121 -0
- package/src/js/utils/field-references.registry.ts +50 -0
- package/src/js/utils/field-references.resolver.ts +115 -0
- package/src/js/utils/field-references.ts +11 -0
- package/src/js/utils/field-references.types.ts +31 -0
- package/src/js/utils/fields.ts +58 -0
- package/src/js/utils/http.ts +51 -0
- package/src/js/utils/i18n.ts +98 -0
- package/src/js/utils/scripts.ts +84 -0
- package/src/js/utils/unload-warning.ts +190 -0
- package/src/js/validation/rules/email.ts +18 -0
- package/src/js/validation/rules/match.ts +26 -0
- package/src/js/validation/rules/minmax.ts +47 -0
- package/src/js/validation/rules/number.ts +55 -0
- package/src/js/validation/rules/pattern.ts +29 -0
- package/src/js/validation/rules/required.ts +30 -0
- package/src/js/validation/rules/shared.ts +47 -0
- package/src/js/validation/rules/url.ts +23 -0
- package/src/js/validation/rules.ts +16 -0
- package/src/js/validation/types.ts +50 -0
- package/src/js/validation/validator.ts +643 -0
- package/src/vendor.d.ts +100 -0
- package/src/vite-env.d.ts +22 -0
- package/vite-dev.mjs +22 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { t as ensureModuleStyles } from "./styles-BIh6g7V_.js";
|
|
2
|
+
import { r as Le } from "./dist-D09GnXMW.js";
|
|
3
|
+
import { c as retainFormValidators, i as getModuleFieldTarget, s as releaseFormValidators } from "./shared-DC6_1u8X.js";
|
|
4
|
+
//#region src/css/theme/fields/_text-limit.css?inline
|
|
5
|
+
var _text_limit_default = "@layer formie-theme{.formie-limit-number{font-weight:var(--formie-font-weight-semibold);color:var(--formie-color-text)}.formie-limit-number-error{color:var(--formie-color-danger)}}";
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/js/modules/fields/text-limit.ts
|
|
8
|
+
var INPUT_SELECTOR = "input[data-formie-single-line-text-input], textarea[data-formie-multi-line-text-input]";
|
|
9
|
+
var TEXT_LIMIT_VALIDATORS = [
|
|
10
|
+
"textMinCharacterLimit",
|
|
11
|
+
"textMaxCharacterLimit",
|
|
12
|
+
"textMinWordLimit",
|
|
13
|
+
"textMaxWordLimit"
|
|
14
|
+
];
|
|
15
|
+
var VALIDATOR_SCOPE = "text-limit";
|
|
16
|
+
var ALLOW_OVERTYPE_ATTR = "data-formie-text-limit-allow-overtype";
|
|
17
|
+
var limitTargetCache = /* @__PURE__ */ new WeakMap();
|
|
18
|
+
ensureModuleStyles("text-limit", [_text_limit_default]);
|
|
19
|
+
function isTextLimitInput(input) {
|
|
20
|
+
return input instanceof HTMLInputElement || input instanceof HTMLTextAreaElement;
|
|
21
|
+
}
|
|
22
|
+
function getLimitValue(input, attribute) {
|
|
23
|
+
return parseInt(input.getAttribute(attribute) || "", 10) || 0;
|
|
24
|
+
}
|
|
25
|
+
function hasAnyLimitAttributes(input) {
|
|
26
|
+
return input.hasAttribute("data-formie-min-chars") || input.hasAttribute("data-formie-max-chars") || input.hasAttribute("data-formie-min-words") || input.hasAttribute("data-formie-max-words");
|
|
27
|
+
}
|
|
28
|
+
function hasCounterLimitAttributes(input) {
|
|
29
|
+
return input.hasAttribute("data-formie-max-chars") || input.hasAttribute("data-formie-max-words");
|
|
30
|
+
}
|
|
31
|
+
function allowsOvertype(input) {
|
|
32
|
+
return input.hasAttribute(ALLOW_OVERTYPE_ATTR);
|
|
33
|
+
}
|
|
34
|
+
function hasNoRawValue(input) {
|
|
35
|
+
return input.value === "";
|
|
36
|
+
}
|
|
37
|
+
function registerValidators(form) {
|
|
38
|
+
retainFormValidators(form, VALIDATOR_SCOPE, (validator) => {
|
|
39
|
+
validator.addValidator("textMinCharacterLimit", ({ input }) => {
|
|
40
|
+
if (!isTextLimitInput(input)) return true;
|
|
41
|
+
const limit = getLimitValue(input, "data-formie-min-chars");
|
|
42
|
+
if (!limit || hasNoRawValue(input)) return true;
|
|
43
|
+
return Le(input.value).graphemeCount >= limit;
|
|
44
|
+
}, ({ label, input, t }) => {
|
|
45
|
+
return t("{attribute} must be no less than {min} characters.", {
|
|
46
|
+
attribute: label,
|
|
47
|
+
min: input.getAttribute("data-formie-min-chars") || ""
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
validator.addValidator("textMaxCharacterLimit", ({ input }) => {
|
|
51
|
+
if (!isTextLimitInput(input)) return true;
|
|
52
|
+
if (allowsOvertype(input)) return true;
|
|
53
|
+
const limit = getLimitValue(input, "data-formie-max-chars");
|
|
54
|
+
if (!limit || hasNoRawValue(input)) return true;
|
|
55
|
+
return Le(input.value).graphemeCount <= limit;
|
|
56
|
+
}, ({ label, input, t }) => {
|
|
57
|
+
return t("{attribute} must be no greater than {max} characters.", {
|
|
58
|
+
attribute: label,
|
|
59
|
+
max: input.getAttribute("data-formie-max-chars") || ""
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
validator.addValidator("textMinWordLimit", ({ input }) => {
|
|
63
|
+
if (!isTextLimitInput(input)) return true;
|
|
64
|
+
const limit = getLimitValue(input, "data-formie-min-words");
|
|
65
|
+
if (!limit || input.value.trim() === "") return true;
|
|
66
|
+
return Le(input.value).wordCount >= limit;
|
|
67
|
+
}, ({ label, input, t }) => {
|
|
68
|
+
return t("{attribute} must be no less than {min} words.", {
|
|
69
|
+
attribute: label,
|
|
70
|
+
min: input.getAttribute("data-formie-min-words") || ""
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
validator.addValidator("textMaxWordLimit", ({ input }) => {
|
|
74
|
+
if (!isTextLimitInput(input)) return true;
|
|
75
|
+
if (allowsOvertype(input)) return true;
|
|
76
|
+
const limit = getLimitValue(input, "data-formie-max-words");
|
|
77
|
+
if (!limit || input.value.trim() === "") return true;
|
|
78
|
+
return Le(input.value).wordCount <= limit;
|
|
79
|
+
}, ({ label, input, t }) => {
|
|
80
|
+
return t("{attribute} must be no greater than {max} words.", {
|
|
81
|
+
attribute: label,
|
|
82
|
+
max: input.getAttribute("data-formie-max-words") || ""
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function unregisterValidators(form) {
|
|
88
|
+
releaseFormValidators(form, VALIDATOR_SCOPE, TEXT_LIMIT_VALIDATORS);
|
|
89
|
+
}
|
|
90
|
+
function getLimitTarget(input) {
|
|
91
|
+
if (limitTargetCache.has(input)) return limitTargetCache.get(input) || null;
|
|
92
|
+
const field = input.closest("[data-formie-field-handle]");
|
|
93
|
+
if (!field) {
|
|
94
|
+
limitTargetCache.set(input, null);
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
const existingTarget = field.querySelector("[data-formie-limit-text]");
|
|
98
|
+
if (existingTarget) {
|
|
99
|
+
limitTargetCache.set(input, existingTarget);
|
|
100
|
+
return existingTarget;
|
|
101
|
+
}
|
|
102
|
+
const control = field.querySelector("[data-formie-field-control]");
|
|
103
|
+
const target = document.createElement("div");
|
|
104
|
+
target.className = "formie-field-limit formie-limit-text";
|
|
105
|
+
target.setAttribute("data-formie-field-limit", "true");
|
|
106
|
+
target.setAttribute("data-formie-limit-text", "true");
|
|
107
|
+
if (control?.parentElement) {
|
|
108
|
+
control.insertAdjacentElement("afterend", target);
|
|
109
|
+
limitTargetCache.set(input, target);
|
|
110
|
+
return target;
|
|
111
|
+
}
|
|
112
|
+
field.appendChild(target);
|
|
113
|
+
limitTargetCache.set(input, target);
|
|
114
|
+
return target;
|
|
115
|
+
}
|
|
116
|
+
function renderCounter(target, remaining, unit) {
|
|
117
|
+
const number = document.createElement("span");
|
|
118
|
+
number.className = remaining < 0 ? "formie-limit-number formie-limit-number-error" : "formie-limit-number";
|
|
119
|
+
number.textContent = String(remaining);
|
|
120
|
+
target.replaceChildren(number, document.createTextNode(` ${Math.abs(remaining) === 1 ? unit : `${unit}s`} left`));
|
|
121
|
+
}
|
|
122
|
+
function updateCounter(input) {
|
|
123
|
+
const maxChars = getLimitValue(input, "data-formie-max-chars");
|
|
124
|
+
const maxWords = getLimitValue(input, "data-formie-max-words");
|
|
125
|
+
const target = getLimitTarget(input);
|
|
126
|
+
if (!target) return;
|
|
127
|
+
const metrics = Le(input.value);
|
|
128
|
+
if (maxChars > 0) {
|
|
129
|
+
renderCounter(target, maxChars - metrics.graphemeCount, "character");
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (maxWords > 0) renderCounter(target, maxWords - metrics.wordCount, "word");
|
|
133
|
+
}
|
|
134
|
+
var textLimitModule = {
|
|
135
|
+
id: "text-limit",
|
|
136
|
+
kind: "field",
|
|
137
|
+
match: (ctx) => {
|
|
138
|
+
return !!ctx.target.querySelector(INPUT_SELECTOR);
|
|
139
|
+
},
|
|
140
|
+
setup: async (ctx) => {
|
|
141
|
+
const options = ctx.options || {};
|
|
142
|
+
const field = getModuleFieldTarget(ctx);
|
|
143
|
+
const inputs = Array.from((field || ctx.target).querySelectorAll(INPUT_SELECTOR)).filter((input) => {
|
|
144
|
+
return (input instanceof HTMLInputElement || input instanceof HTMLTextAreaElement) && hasAnyLimitAttributes(input);
|
|
145
|
+
});
|
|
146
|
+
const counterInputs = inputs.filter((input) => {
|
|
147
|
+
return hasCounterLimitAttributes(input);
|
|
148
|
+
});
|
|
149
|
+
if (options.allowOvertype) inputs.forEach((input) => {
|
|
150
|
+
input.setAttribute(ALLOW_OVERTYPE_ATTR, "true");
|
|
151
|
+
});
|
|
152
|
+
registerValidators(ctx.form);
|
|
153
|
+
const unbinds = counterInputs.map((input) => {
|
|
154
|
+
const handler = () => {
|
|
155
|
+
updateCounter(input);
|
|
156
|
+
};
|
|
157
|
+
input.addEventListener("input", handler);
|
|
158
|
+
input.addEventListener("change", handler);
|
|
159
|
+
updateCounter(input);
|
|
160
|
+
return () => {
|
|
161
|
+
input.removeEventListener("input", handler);
|
|
162
|
+
input.removeEventListener("change", handler);
|
|
163
|
+
};
|
|
164
|
+
});
|
|
165
|
+
await ctx.emit("formie:module:text-limit:init", { count: inputs.length });
|
|
166
|
+
return { destroy: () => {
|
|
167
|
+
unbinds.forEach((unbind) => {
|
|
168
|
+
unbind();
|
|
169
|
+
});
|
|
170
|
+
if (options.allowOvertype) inputs.forEach((input) => {
|
|
171
|
+
input.removeAttribute(ALLOW_OVERTYPE_ATTR);
|
|
172
|
+
});
|
|
173
|
+
unregisterValidators(ctx.form);
|
|
174
|
+
ctx.emit("formie:module:text-limit:destroy", {});
|
|
175
|
+
} };
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
//#endregion
|
|
179
|
+
export { textLimitModule };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//#region src/js/theme/theme-classes.ts
|
|
2
|
+
var themeRegistry = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
var THEME_ROOT_SELECTORS = "[data-formie-form], [data-formie], form";
|
|
4
|
+
function splitClasses(value) {
|
|
5
|
+
if (!value) return [];
|
|
6
|
+
return (Array.isArray(value) ? value : [value]).flatMap((item) => {
|
|
7
|
+
return String(item).split(/\s+/);
|
|
8
|
+
}).map((item) => {
|
|
9
|
+
return item.trim();
|
|
10
|
+
}).filter(Boolean);
|
|
11
|
+
}
|
|
12
|
+
function uniqueClasses(classes) {
|
|
13
|
+
return Array.from(new Set(classes));
|
|
14
|
+
}
|
|
15
|
+
function resolveThemeClassMap(source) {
|
|
16
|
+
if (!source) return {};
|
|
17
|
+
const directMatch = themeRegistry.get(source);
|
|
18
|
+
if (directMatch) return directMatch;
|
|
19
|
+
const root = source.closest(THEME_ROOT_SELECTORS);
|
|
20
|
+
if (!root) return {};
|
|
21
|
+
return themeRegistry.get(root) || {};
|
|
22
|
+
}
|
|
23
|
+
function normalizeThemeClassMap(theme) {
|
|
24
|
+
const normalized = {};
|
|
25
|
+
Object.entries(theme || {}).forEach(([key, value]) => {
|
|
26
|
+
const classes = uniqueClasses(splitClasses(value));
|
|
27
|
+
if (classes.length) normalized[key] = classes;
|
|
28
|
+
});
|
|
29
|
+
return normalized;
|
|
30
|
+
}
|
|
31
|
+
function registerThemeClassMap(target, theme, form) {
|
|
32
|
+
const normalized = normalizeThemeClassMap(theme);
|
|
33
|
+
const resolvedForm = form || (target instanceof HTMLFormElement ? target : target.querySelector("form"));
|
|
34
|
+
themeRegistry.set(target, normalized);
|
|
35
|
+
if (resolvedForm) themeRegistry.set(resolvedForm, normalized);
|
|
36
|
+
return normalized;
|
|
37
|
+
}
|
|
38
|
+
function getThemeClasses(source, key) {
|
|
39
|
+
return resolveThemeClassMap(source)[key] || [];
|
|
40
|
+
}
|
|
41
|
+
function addThemeClasses(target, source, ...keys) {
|
|
42
|
+
const classes = uniqueClasses(keys.flatMap((key) => {
|
|
43
|
+
return getThemeClasses(source, key);
|
|
44
|
+
}));
|
|
45
|
+
if (classes.length) target.classList.add(...classes);
|
|
46
|
+
}
|
|
47
|
+
function removeThemeClasses(target, source, ...keys) {
|
|
48
|
+
const classes = uniqueClasses(keys.flatMap((key) => {
|
|
49
|
+
return getThemeClasses(source, key);
|
|
50
|
+
}));
|
|
51
|
+
if (classes.length) target.classList.remove(...classes);
|
|
52
|
+
}
|
|
53
|
+
function toggleThemeClasses(target, source, key, enabled) {
|
|
54
|
+
getThemeClasses(source, key).forEach((className) => {
|
|
55
|
+
target.classList.toggle(className, enabled);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { toggleThemeClasses as i, registerThemeClassMap as n, removeThemeClasses as r, addThemeClasses as t };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { a as CAPTCHA_PROVIDER_LOAD_TIMEOUT_MS, i as CAPTCHA_EXECUTE_WAIT_FOR_VALUE_MS, o as CAPTCHA_SUBMIT_WAIT_FOR_VALUE_MS, r as getScriptAttributes, t as defineCaptchaModule } from "./api-DOfDzYC_.js";
|
|
2
|
+
import { r as loadScriptAndEnsureGlobal } from "./scripts-BGD_iU_6.js";
|
|
3
|
+
//#region src/js/modules/captchas/turnstile.ts
|
|
4
|
+
function getTurnstileWaitForValueMs(provider) {
|
|
5
|
+
const appearance = provider.appearance || "always";
|
|
6
|
+
return (provider.execution || (appearance === "execute" ? "execute" : "render")) === "execute" ? CAPTCHA_EXECUTE_WAIT_FOR_VALUE_MS : CAPTCHA_SUBMIT_WAIT_FOR_VALUE_MS;
|
|
7
|
+
}
|
|
8
|
+
async function loadTurnstileGlobal(options) {
|
|
9
|
+
const { async, defer } = getScriptAttributes(options.loadingMethod);
|
|
10
|
+
return loadScriptAndEnsureGlobal("turnstile", {
|
|
11
|
+
id: "FORMIE_TURNSTILE_SCRIPT",
|
|
12
|
+
src: "https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",
|
|
13
|
+
async,
|
|
14
|
+
defer,
|
|
15
|
+
timeoutMs: CAPTCHA_PROVIDER_LOAD_TIMEOUT_MS
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
var turnstileModule = defineCaptchaModule({
|
|
19
|
+
id: "turnstile",
|
|
20
|
+
defaultPlaceholderSelector: "[data-turnstile-placeholder]",
|
|
21
|
+
defaultTokenFieldNames: ["cf-turnstile-response"],
|
|
22
|
+
load: ({ options }) => {
|
|
23
|
+
return loadTurnstileGlobal(options.provider);
|
|
24
|
+
},
|
|
25
|
+
mount: ({ api, container, provider, services }) => {
|
|
26
|
+
const appearance = provider.appearance || "always";
|
|
27
|
+
const execution = provider.execution || (appearance === "execute" ? "execute" : "render");
|
|
28
|
+
return api.render(container, {
|
|
29
|
+
sitekey: provider.siteKey || "",
|
|
30
|
+
theme: provider.theme || "auto",
|
|
31
|
+
size: provider.size || "normal",
|
|
32
|
+
appearance,
|
|
33
|
+
execution,
|
|
34
|
+
callback: (token) => {
|
|
35
|
+
if (typeof token === "string" && token.trim() !== "") services.tokens.write(token.trim());
|
|
36
|
+
services.errors.clear();
|
|
37
|
+
},
|
|
38
|
+
"expired-callback": () => {
|
|
39
|
+
services.tokens.clear();
|
|
40
|
+
services.errors.clear();
|
|
41
|
+
},
|
|
42
|
+
"timeout-callback": () => {
|
|
43
|
+
services.tokens.clear();
|
|
44
|
+
services.errors.clear();
|
|
45
|
+
},
|
|
46
|
+
"error-callback": () => {
|
|
47
|
+
services.tokens.clear();
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
screen: ({ api, widget, placeholder, services, provider, stageCtx }) => {
|
|
52
|
+
if (services.tokens.has()) return;
|
|
53
|
+
api.execute(widget);
|
|
54
|
+
return services.tokens.wait(getTurnstileWaitForValueMs(provider)).then((hasToken) => {
|
|
55
|
+
if (!hasToken) {
|
|
56
|
+
const message = services.errors.getDefaultMessage();
|
|
57
|
+
services.errors.show(message, placeholder);
|
|
58
|
+
stageCtx.abort(message);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
unmount: ({ api, widget, services }) => {
|
|
63
|
+
api.reset(widget);
|
|
64
|
+
services.tokens.clear();
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
//#endregion
|
|
68
|
+
export { turnstileModule };
|