@siteping/widget 0.9.9 → 0.9.10

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/dist/types.d.ts CHANGED
@@ -82,6 +82,32 @@ export interface SitepingConfig {
82
82
  } | undefined;
83
83
  /** Called when the widget is skipped (production mode, mobile viewport) */
84
84
  onSkip?: (reason: "production" | "mobile") => void;
85
+ /**
86
+ * Auto-focus a specific annotation when its ID appears in the URL query
87
+ * string. Lets hosts deeplink directly into a feedback from external
88
+ * systems (Zammad tickets, Slack notifications, dashboard rows).
89
+ *
90
+ * When enabled, the widget reads the configured query parameter from
91
+ * `window.location.search` right after the initial markers load. If the
92
+ * value matches a visible feedback ID, the widget scrolls the annotation
93
+ * into view, pins its highlight, and pulses the marker — the same visual
94
+ * affordance a marker click produces.
95
+ *
96
+ * - `false` / `undefined` (default): no URL parsing. Existing behavior
97
+ * unchanged, no host URL inspection.
98
+ * - `true`: enabled with default query parameter name `siteping`.
99
+ * - object: enabled with a custom parameter name. Use this to avoid
100
+ * clashes with host-app query keys.
101
+ *
102
+ * Only the initial load triggers focus. Subsequent URL changes (SPA
103
+ * navigation, `history.pushState`, hash updates) are ignored —
104
+ * deliberate, to avoid surprising re-scrolls during normal browsing.
105
+ * Hosts that need re-focus on route change can call
106
+ * `instance.focusFeedback(id)` explicitly.
107
+ */
108
+ deepLink?: boolean | {
109
+ param?: string;
110
+ } | undefined;
85
111
  /**
86
112
  * Pre-fill author identity from the host application — typically the
87
113
  * currently signed-in user. When set, the widget uses these values
@@ -137,6 +163,17 @@ export interface SitepingInstance {
137
163
  close: () => void;
138
164
  /** Reload feedbacks from server */
139
165
  refresh: () => void;
166
+ /**
167
+ * Scroll the matching annotation into view, pin its highlight, and
168
+ * pulse its marker. Returns `true` when a visible feedback matched the
169
+ * given ID, `false` otherwise (unknown ID, feedback on another URL when
170
+ * `scopeAnnotationsByUrl` filtered it out, or markers not yet loaded).
171
+ *
172
+ * Counterpart to the `deepLink` config option for hosts that prefer to
173
+ * drive focus from JS (e.g., a notification click handler) instead of a
174
+ * URL query parameter.
175
+ */
176
+ focusFeedback: (feedbackId: string) => boolean;
140
177
  /** Subscribe to a public widget event */
141
178
  on: <K extends keyof SitepingPublicEvents>(event: K, listener: (...args: SitepingPublicEvents[K]) => void) => () => void;
142
179
  /** Unsubscribe from a public widget event */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siteping/widget",
3
- "version": "0.9.9",
3
+ "version": "0.9.10",
4
4
  "description": "Feedback widget for client review during development — annotations, bugs, questions directly on the site",
5
5
  "type": "module",
6
6
  "sideEffects": false,