@qaiddev/thumbs-embed 1.0.6 → 1.0.8

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/index.d.ts CHANGED
@@ -47,7 +47,7 @@ declare interface ElementBounds {
47
47
  }
48
48
 
49
49
  /**
50
- * Configuration options for the FeedbackEmbed
50
+ * Configuration options for the QaidFeedback
51
51
  */
52
52
  export declare interface FeedbackConfig {
53
53
  /** Required: API endpoint URL for submitting feedback */
@@ -58,6 +58,8 @@ export declare interface FeedbackConfig {
58
58
  container?: string;
59
59
  /** Custom CSS class to apply to thumb buttons. When provided, default button styles are not applied */
60
60
  buttonClass?: string;
61
+ /** Button layout direction. Default: 'horizontal' */
62
+ direction?: "horizontal" | "vertical";
61
63
  /** Position of the feedback buttons. Default: 'bottom-right'. Ignored if container is provided */
62
64
  position?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
63
65
  /** Offset from edge in pixels. Default: { x: 16, y: 16 } */
@@ -84,10 +86,6 @@ export declare interface FeedbackConfig {
84
86
  text?: {
85
87
  /** Tooltip text for buttons */
86
88
  tooltip?: string;
87
- /** Banner text during targeting */
88
- bannerText?: string;
89
- /** Banner hint text */
90
- bannerHint?: string;
91
89
  /** Modal title */
92
90
  modalTitle?: string;
93
91
  /** Modal subtitle */
@@ -126,6 +124,8 @@ export declare interface FeedbackConfig {
126
124
  negativeIcon?: string;
127
125
  /** When true, hide thumbs up/down buttons (only show video button if enabled). Default: false */
128
126
  hideThumbs?: boolean;
127
+ /** Custom CSS to inject into the embed's shadow root for theming */
128
+ css?: string;
129
129
  /** Screenshot capture method. "dom" uses html2canvas (no permission), "permission" uses Screen Capture API. Default: "permission" */
130
130
  screenshotMethod?: "dom" | "permission";
131
131
  /** Screenshot options */
@@ -150,16 +150,90 @@ export declare interface FeedbackData {
150
150
  }
151
151
 
152
152
  /**
153
- * FeedbackEmbed - Standalone feedback collection embed
153
+ * Payload for updating feedback with a message
154
+ */
155
+ export declare interface FeedbackMessagePayload {
156
+ message: string | null;
157
+ }
158
+
159
+ /**
160
+ * Payload sent to the feedback API
161
+ */
162
+ export declare interface FeedbackPayload {
163
+ feedbackType: "up" | "down";
164
+ pageUrl: string;
165
+ /** API key for authenticating with the feedback service */
166
+ apiKey?: string;
167
+ elementSelector: string | null;
168
+ elementText: string | null;
169
+ consoleErrors: ConsoleError[];
170
+ screenWidth: number;
171
+ screenHeight: number;
172
+ clickX: number;
173
+ clickY: number;
174
+ scrollX: number;
175
+ scrollY: number;
176
+ /** Base64-encoded screenshot image (WebP) */
177
+ screenshot: string | null;
178
+ /** Random UUID stored in visitor's localStorage (for anonymous feedback) */
179
+ visitorId: string;
180
+ /** Element bounds for server-side screenshot fallback when client screenshot fails */
181
+ elementBounds?: ElementBounds | null;
182
+ /** User agent string for server-side rendering consistency */
183
+ userAgent?: string;
184
+ }
185
+
186
+ /**
187
+ * Response from the feedback API
188
+ */
189
+ export declare interface FeedbackResponse {
190
+ id: number;
191
+ }
192
+
193
+ /**
194
+ * Detect the best supported MIME type for recording
195
+ */
196
+ export declare function getSupportedMimeType(): string;
197
+
198
+ /**
199
+ * Check if DOM screenshot capture is supported
200
+ * Requires canvas and basic DOM APIs
201
+ */
202
+ export declare function isDomScreenshotSupported(): boolean;
203
+
204
+ /**
205
+ * Check if video recording is supported in this browser
206
+ */
207
+ export declare function isVideoRecordingSupported(): boolean;
208
+
209
+ export declare interface NetworkCapture {
210
+ errors: NetworkError[];
211
+ restore: () => void;
212
+ }
213
+
214
+ /**
215
+ * Network error captured during the session
154
216
  */
155
- export declare class FeedbackEmbed {
217
+ export declare interface NetworkError {
218
+ url: string;
219
+ method: string;
220
+ status: number;
221
+ statusText: string;
222
+ requestBody?: string;
223
+ responseBody?: string;
224
+ timestamp: number;
225
+ }
226
+
227
+ /**
228
+ * QaidFeedback - Standalone feedback collection embed
229
+ */
230
+ export declare class QaidFeedback {
156
231
  private config;
157
232
  private state;
158
233
  private feedbackData;
159
234
  private selectedBounds;
160
235
  private feedbackId;
161
236
  private mousePos;
162
- private lastHighlighted;
163
237
  private isMobile;
164
238
  private visitorId;
165
239
  private consoleCapture;
@@ -170,25 +244,39 @@ export declare class FeedbackEmbed {
170
244
  private videoPreview;
171
245
  private isRecording;
172
246
  private isSendingVideo;
173
- private container;
247
+ private shadowHost;
248
+ private shadowRoot;
249
+ private overlayShadowHost;
250
+ private overlayShadowRoot;
251
+ private buttonsContainer;
174
252
  private isUserProvidedContainer;
175
253
  private overlayContainer;
176
254
  private captureLayer;
177
255
  private crosshairH;
178
256
  private crosshairV;
179
257
  private scope;
258
+ private highlightBox;
180
259
  private marker;
181
260
  private modalContainer;
182
261
  private backdrop;
262
+ private cssVars;
183
263
  private boundKeyDown;
184
264
  private boundMouseMove;
185
265
  private boundClick;
186
266
  private boundResize;
187
267
  constructor(config: FeedbackConfig);
268
+ private applyVars;
188
269
  private init;
189
270
  private checkMobile;
190
271
  private handleResize;
191
272
  private createEmbed;
273
+ /**
274
+ * Lazily create a separate overlay shadow host on document.body.
275
+ * This host contains all full-page elements (targeting overlay, marker,
276
+ * backdrop, modal, recording indicator, video preview) so they escape
277
+ * clip-path / transform containing blocks in user containers.
278
+ */
279
+ private ensureOverlayHost;
192
280
  private tooltipElement;
193
281
  private showTooltip;
194
282
  private hideTooltip;
@@ -229,81 +317,6 @@ export declare class FeedbackEmbed {
229
317
  destroy(): void;
230
318
  }
231
319
 
232
- /**
233
- * Payload for updating feedback with a message
234
- */
235
- export declare interface FeedbackMessagePayload {
236
- message: string | null;
237
- }
238
-
239
- /**
240
- * Payload sent to the feedback API
241
- */
242
- export declare interface FeedbackPayload {
243
- feedbackType: "up" | "down";
244
- pageUrl: string;
245
- /** API key for authenticating with the feedback service */
246
- apiKey?: string;
247
- elementSelector: string | null;
248
- elementText: string | null;
249
- consoleErrors: ConsoleError[];
250
- screenWidth: number;
251
- screenHeight: number;
252
- clickX: number;
253
- clickY: number;
254
- scrollX: number;
255
- scrollY: number;
256
- /** Base64-encoded screenshot image (WebP) */
257
- screenshot: string | null;
258
- /** Random UUID stored in visitor's localStorage (for anonymous feedback) */
259
- visitorId: string;
260
- /** Element bounds for server-side screenshot fallback when client screenshot fails */
261
- elementBounds?: ElementBounds | null;
262
- /** User agent string for server-side rendering consistency */
263
- userAgent?: string;
264
- }
265
-
266
- /**
267
- * Response from the feedback API
268
- */
269
- export declare interface FeedbackResponse {
270
- id: number;
271
- }
272
-
273
- /**
274
- * Detect the best supported MIME type for recording
275
- */
276
- export declare function getSupportedMimeType(): string;
277
-
278
- /**
279
- * Check if DOM screenshot capture is supported
280
- * Requires canvas and basic DOM APIs
281
- */
282
- export declare function isDomScreenshotSupported(): boolean;
283
-
284
- /**
285
- * Check if video recording is supported in this browser
286
- */
287
- export declare function isVideoRecordingSupported(): boolean;
288
-
289
- export declare interface NetworkCapture {
290
- errors: NetworkError[];
291
- restore: () => void;
292
- }
293
-
294
- /**
295
- * Network error captured during the session
296
- */
297
- export declare interface NetworkError {
298
- url: string;
299
- method: string;
300
- status: number;
301
- statusText: string;
302
- requestBody?: string;
303
- responseBody?: string;
304
- timestamp: number;
305
- }
306
-
307
320
  /**
308
321
  * Fully resolved configuration with all defaults applied
309
322
  * Used internally by the embed after processing user config
@@ -313,6 +326,7 @@ export declare interface ResolvedFeedbackConfig {
313
326
  apiKey: string;
314
327
  container: string;
315
328
  buttonClass: string;
329
+ direction: "horizontal" | "vertical";
316
330
  position: "bottom-right" | "bottom-left" | "top-right" | "top-left";
317
331
  offset: {
318
332
  x: number;
@@ -328,8 +342,6 @@ export declare interface ResolvedFeedbackConfig {
328
342
  buttonSize: "small" | "medium" | "large";
329
343
  text: {
330
344
  tooltip: string;
331
- bannerText: string;
332
- bannerHint: string;
333
345
  modalTitle: string;
334
346
  modalSubtitle: string;
335
347
  placeholder: string;
@@ -351,6 +363,7 @@ export declare interface ResolvedFeedbackConfig {
351
363
  positiveIcon: string;
352
364
  negativeIcon: string;
353
365
  hideThumbs: boolean;
366
+ css: string;
354
367
  captureVideo: boolean;
355
368
  videoOptions: {
356
369
  maxDuration: number;