@xapp/stentor-form-widget-channel 1.85.0 → 1.87.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.
@@ -30,6 +30,59 @@ export interface FormWidgetEnv {
30
30
  * If true, it will automatically open the form widget, remove the ability to close it, remove the shadow boxing effect.
31
31
  */
32
32
  readonly enabled?: boolean;
33
+ /**
34
+ * Trigger configuration for auto-opening the form widget.
35
+ * These triggers show the form based on user behavior, unlike `enabled` which shows immediately.
36
+ */
37
+ readonly triggers?: {
38
+ /**
39
+ * Milliseconds before showing the form (timer-based trigger)
40
+ */
41
+ readonly delay?: number;
42
+ /**
43
+ * Show when user has scrolled past this percentage of the page (0-100)
44
+ */
45
+ readonly scrollPercent?: number;
46
+ /**
47
+ * Show when mouse leaves the viewport (exit intent detection)
48
+ */
49
+ readonly exitIntent?: boolean;
50
+ /**
51
+ * Pixels from top of viewport to trigger exit intent (default: 50)
52
+ */
53
+ readonly exitIntentThreshold?: number;
54
+ /**
55
+ * Milliseconds of no mouse/keyboard activity before showing
56
+ */
57
+ readonly inactivity?: number;
58
+ };
59
+ /**
60
+ * URL patterns to match. Uses includes() for matching.
61
+ * If provided, triggers only fire on matching URLs.
62
+ */
63
+ readonly patterns?: string[];
64
+ /**
65
+ * Minimum viewport width in pixels. Triggers won't fire below this width.
66
+ */
67
+ readonly minimumWidth?: number;
68
+ /**
69
+ * Trigger combination mode.
70
+ * - 'any' (default): first trigger that fires opens the form
71
+ * - 'all': all configured triggers must fire before opening
72
+ *
73
+ * Note: With 'all' mode, the form opens as soon as all configured triggers
74
+ * have fired at least once. If only one trigger is configured, 'all' mode
75
+ * behaves identically to 'any' mode.
76
+ *
77
+ * @example
78
+ * // With mode: 'all' and triggers: { delay: 5000, scrollPercent: 25 }
79
+ * // Form opens when BOTH 5 seconds have passed AND user has scrolled 25%
80
+ */
81
+ readonly mode?: 'any' | 'all';
82
+ /**
83
+ * sessionStorage key for persisting dismissed state (default: 'xafw-auto-open-dismissed')
84
+ */
85
+ readonly sessionKey?: string;
33
86
  };
34
87
  /**
35
88
  * Optional, used for autocomplete suggestions.
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "1.85.0",
7
+ "version": "1.87.0",
8
8
  "description": "Form Widget Channel for stentor 📣",
9
9
  "types": "lib/index",
10
10
  "main": "lib/index",
@@ -18,18 +18,18 @@
18
18
  "@types/chai": "4.3.20",
19
19
  "@types/sinon": "10.0.20",
20
20
  "@types/sinon-chai": "3.2.12",
21
- "@xapp/config": "0.2.3",
21
+ "@xapp/config": "0.3.0",
22
22
  "chai": "4.5.0",
23
23
  "mocha": "9.2.2",
24
24
  "sinon": "13.0.2",
25
25
  "sinon-chai": "3.7.0",
26
- "stentor-models": "1.68.6",
26
+ "stentor-models": "1.69.9",
27
27
  "ts-node": "10.9.2",
28
28
  "typescript": "5.9.3"
29
29
  },
30
30
  "dependencies": {
31
- "stentor-constants": "1.68.6",
32
- "stentor-guards": "1.68.6"
31
+ "stentor-constants": "1.69.9",
32
+ "stentor-guards": "1.69.9"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "stentor-models": "^1.0.0"
@@ -38,5 +38,5 @@
38
38
  "build": "tsc -d true -p .",
39
39
  "clean": "rm -rf ./lib/*"
40
40
  },
41
- "gitHead": "7e88fa85fbd4c05a32caffe37099e72a0534b86c"
41
+ "gitHead": "e4e9a6ff1e817ce27c3df845376892b980d9adcc"
42
42
  }