@hortonstudio/main 1.7.15 → 1.7.16

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 (2) hide show
  1. package/autoInit/form.js +15 -0
  2. package/package.json +1 -1
package/autoInit/form.js CHANGED
@@ -1,4 +1,19 @@
1
1
  export function init() {
2
+ // Honeypot spam prevention
3
+ document.addEventListener('submit', (e) => {
4
+ const form = e.target;
5
+ if (form.tagName !== 'FORM') return;
6
+
7
+ const honeypot = form.querySelector('[data-hs-form="form-handler"]');
8
+ if (honeypot && honeypot.value) {
9
+ // Honeypot filled - likely a bot
10
+ e.preventDefault();
11
+ e.stopPropagation();
12
+ e.stopImmediatePropagation();
13
+ return false;
14
+ }
15
+ }, true);
16
+
2
17
  // Simple Custom Select Component for Webflow
3
18
  (function() {
4
19
  'use strict';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hortonstudio/main",
3
- "version": "1.7.15",
3
+ "version": "1.7.16",
4
4
  "description": "Animation and utility library for client websites",
5
5
  "main": "index.js",
6
6
  "type": "module",