@triagly/sdk 1.4.0-beta.6 → 1.4.0-beta.7
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 +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +9 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/screenshot.d.ts +42 -0
- package/dist/screenshot.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EACb,WAAW,EACX,YAAY,EACb,MAAM,SAAS,CAAC;AAKjB,qBAAa,OAAO;IAClB,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,GAAG,CAAa;IACxB,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,aAAa,CAA8B;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EACb,WAAW,EACX,YAAY,EACb,MAAM,SAAS,CAAC;AAKjB,qBAAa,OAAO;IAClB,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,GAAG,CAAa;IACxB,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,aAAa,CAA8B;IACnD,OAAO,CAAC,aAAa,CAAqB;gBAE9B,MAAM,EAAE,aAAa;IAyDjC;;OAEG;IACH,OAAO,CAAC,IAAI;IAkBZ;;OAEG;YACW,YAAY;IA0D1B;;OAEG;IACH,IAAI,IAAI,IAAI;IAIZ;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAKjC;;;OAGG;IACG,MAAM,CAAC,IAAI,EAAE,YAAY,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBxE;;OAEG;IACH,OAAO,IAAI,IAAI;CAKhB;AAGD,cAAc,SAAS,CAAC;AAexB,eAAe,OAAO,CAAC"}
|
package/dist/index.esm.js
CHANGED
|
@@ -2446,6 +2446,9 @@ class Triagly {
|
|
|
2446
2446
|
this.api = new TriaglyAPI(apiKey, this.config.environment || 'production', this.config.apiUrl, this.config.getToken, this.config.turnstileSiteKey);
|
|
2447
2447
|
this.widget = new FeedbackWidget(this.config);
|
|
2448
2448
|
this.rateLimiter = new RateLimiter(apiKey, 3, 5 * 60 * 1000);
|
|
2449
|
+
this.submitHandler = (e) => {
|
|
2450
|
+
this.handleSubmit(e.detail);
|
|
2451
|
+
};
|
|
2449
2452
|
// Initialize console logger if enabled
|
|
2450
2453
|
if (this.config.captureConsole !== false) {
|
|
2451
2454
|
this.consoleLogger = new ConsoleLogger(this.config.consoleLogLimit, this.config.consoleLogLevels);
|
|
@@ -2467,11 +2470,11 @@ class Triagly {
|
|
|
2467
2470
|
// DOM is already ready
|
|
2468
2471
|
this.widget.init();
|
|
2469
2472
|
}
|
|
2470
|
-
//
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2473
|
+
// Remove any previously registered listener before adding a fresh one.
|
|
2474
|
+
// This prevents stacked listeners when the SDK is re-initialized (e.g. React
|
|
2475
|
+
// re-renders) which would cause duplicate submissions.
|
|
2476
|
+
document.removeEventListener('triagly:submit', this.submitHandler);
|
|
2477
|
+
document.addEventListener('triagly:submit', this.submitHandler);
|
|
2475
2478
|
}
|
|
2476
2479
|
/**
|
|
2477
2480
|
* Handle feedback submission
|
|
@@ -2567,7 +2570,7 @@ class Triagly {
|
|
|
2567
2570
|
destroy() {
|
|
2568
2571
|
this.widget.destroy();
|
|
2569
2572
|
this.consoleLogger?.stop();
|
|
2570
|
-
document.removeEventListener('triagly:submit',
|
|
2573
|
+
document.removeEventListener('triagly:submit', this.submitHandler);
|
|
2571
2574
|
}
|
|
2572
2575
|
}
|
|
2573
2576
|
// Auto-initialize if config is in window
|