@hortonstudio/main 1.7.3 → 1.7.5

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/autoInit/form.js CHANGED
@@ -651,6 +651,28 @@ export function init() {
651
651
  finalAnimElement.click();
652
652
  }
653
653
 
654
+ // Store redirect URL for after successful submission
655
+ if (formWrapper && formWrapper.hasAttribute('data-hs-form-redirect')) {
656
+ const redirectUrl = formWrapper.getAttribute('data-hs-form-redirect');
657
+
658
+ if (redirectUrl && redirectUrl.trim()) {
659
+ // Set up redirect after form submission completes
660
+ const handleFormSubmissionComplete = () => {
661
+ // Small delay to ensure form submission is processed
662
+ setTimeout(() => {
663
+ try {
664
+ window.location.href = redirectUrl.trim();
665
+ } catch (error) {
666
+ console.error('Form redirect failed:', error);
667
+ }
668
+ }, 100);
669
+ };
670
+
671
+ // Listen for when the form submission completes
672
+ form.addEventListener('submit', handleFormSubmissionComplete, { once: true });
673
+ }
674
+ }
675
+
654
676
  // Prevent submission if configured to do so
655
677
  if (shouldPreventSubmit) {
656
678
  event.preventDefault();
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // Version:1.7.3
1
+ // Version:1.7.5
2
2
  const API_NAME = "hsmain";
3
3
 
4
4
  const initializeHsMain = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hortonstudio/main",
3
- "version": "1.7.3",
3
+ "version": "1.7.5",
4
4
  "description": "Animation and utility library for client websites",
5
5
  "main": "index.js",
6
6
  "type": "module",