@deepfrog/pangents-widget 2.2.0 → 2.2.1
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/README.md +55 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{widget-embed-CtD27t5y.es.js → widget-embed-B3A5H6pf.es.js} +20 -17
- package/dist/widget-embed-B3A5H6pf.es.js.map +1 -0
- package/dist/{widget-embed-BPoilyw_.cjs.js → widget-embed-DgFZhnDu.cjs.js} +2 -2
- package/dist/widget-embed-DgFZhnDu.cjs.js.map +1 -0
- package/dist/widget-embed.cjs.js +1 -1
- package/dist/widget-embed.es.js +1 -1
- package/dist/widget.js +19 -16
- package/package.json +1 -1
- package/dist/widget-embed-BPoilyw_.cjs.js.map +0 -1
- package/dist/widget-embed-CtD27t5y.es.js.map +0 -1
package/dist/widget-embed.cjs.js
CHANGED
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
}
|
|
7
7
|
} catch (error) {}
|
|
8
8
|
})();
|
|
9
|
-
"use strict";require("react/jsx-runtime"),require("react");const e=require("./widget-embed-
|
|
9
|
+
"use strict";require("react/jsx-runtime"),require("react");const e=require("./widget-embed-DgFZhnDu.cjs.js");module.exports=e.Chatbot;
|
|
10
10
|
//# sourceMappingURL=widget-embed.cjs.js.map
|
package/dist/widget-embed.es.js
CHANGED
package/dist/widget.js
CHANGED
|
@@ -23700,7 +23700,7 @@ class EnhancedErrorHandler {
|
|
|
23700
23700
|
// 30 seconds
|
|
23701
23701
|
constructor() {
|
|
23702
23702
|
__publicField(this, "errorQueue", []);
|
|
23703
|
-
__publicField(this, "isOnline", navigator.onLine);
|
|
23703
|
+
__publicField(this, "isOnline", typeof navigator !== "undefined" ? navigator.onLine : true);
|
|
23704
23704
|
__publicField(this, "maxQueueSize", 50);
|
|
23705
23705
|
// Reduced from 100
|
|
23706
23706
|
__publicField(this, "retryAttempts", 2);
|
|
@@ -23716,6 +23716,7 @@ class EnhancedErrorHandler {
|
|
|
23716
23716
|
}
|
|
23717
23717
|
// Setup event listeners for online/offline status
|
|
23718
23718
|
setupEventListeners() {
|
|
23719
|
+
if (typeof window === "undefined") return;
|
|
23719
23720
|
window.addEventListener("online", () => {
|
|
23720
23721
|
this.isOnline = true;
|
|
23721
23722
|
this.flushErrorQueue();
|
|
@@ -23782,8 +23783,8 @@ class EnhancedErrorHandler {
|
|
|
23782
23783
|
action: (context == null ? void 0 : context.action) || "Unknown",
|
|
23783
23784
|
userId: context == null ? void 0 : context.userId,
|
|
23784
23785
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
23785
|
-
userAgent: navigator.userAgent,
|
|
23786
|
-
url: window.location.href,
|
|
23786
|
+
userAgent: typeof navigator !== "undefined" ? navigator.userAgent : "server",
|
|
23787
|
+
url: typeof window !== "undefined" ? window.location.href : "",
|
|
23787
23788
|
apiKey: (context == null ? void 0 : context.apiKey) ? context.apiKey.substring(0, 20) + "..." : void 0
|
|
23788
23789
|
};
|
|
23789
23790
|
const severity = this.determineSeverity(apiError);
|
|
@@ -23816,8 +23817,8 @@ class EnhancedErrorHandler {
|
|
|
23816
23817
|
action: (context == null ? void 0 : context.action) || "Runtime",
|
|
23817
23818
|
userId: context == null ? void 0 : context.userId,
|
|
23818
23819
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
23819
|
-
userAgent: navigator.userAgent,
|
|
23820
|
-
url: window.location.href
|
|
23820
|
+
userAgent: typeof navigator !== "undefined" ? navigator.userAgent : "server",
|
|
23821
|
+
url: typeof window !== "undefined" ? window.location.href : ""
|
|
23821
23822
|
};
|
|
23822
23823
|
const errorReport = {
|
|
23823
23824
|
error: apiError,
|
|
@@ -23896,9 +23897,9 @@ class EnhancedErrorHandler {
|
|
|
23896
23897
|
await api2.post("/errors/report", {
|
|
23897
23898
|
errors: errorsToSend,
|
|
23898
23899
|
clientInfo: {
|
|
23899
|
-
userAgent: navigator.userAgent,
|
|
23900
|
+
userAgent: typeof navigator !== "undefined" ? navigator.userAgent : "server",
|
|
23900
23901
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
23901
|
-
url: window.location.href,
|
|
23902
|
+
url: typeof window !== "undefined" ? window.location.href : "",
|
|
23902
23903
|
circuitBreakerState: this.circuitBreaker.getState(),
|
|
23903
23904
|
remainingRateLimit: this.rateLimiter.getRemainingRequests()
|
|
23904
23905
|
}
|
|
@@ -23933,15 +23934,17 @@ class EnhancedErrorHandler {
|
|
|
23933
23934
|
// Show user notification based on error severity
|
|
23934
23935
|
showUserNotification(error, severity) {
|
|
23935
23936
|
const message = this.getUserFriendlyMessage(error);
|
|
23936
|
-
|
|
23937
|
-
|
|
23938
|
-
|
|
23939
|
-
|
|
23940
|
-
|
|
23941
|
-
|
|
23942
|
-
|
|
23943
|
-
|
|
23944
|
-
|
|
23937
|
+
if (typeof window !== "undefined") {
|
|
23938
|
+
window.dispatchEvent(new CustomEvent("error:notification", {
|
|
23939
|
+
detail: {
|
|
23940
|
+
message,
|
|
23941
|
+
severity,
|
|
23942
|
+
error,
|
|
23943
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
23944
|
+
canRetry: this.canRetryError(error)
|
|
23945
|
+
}
|
|
23946
|
+
}));
|
|
23947
|
+
}
|
|
23945
23948
|
}
|
|
23946
23949
|
// Determine if error can be retried
|
|
23947
23950
|
canRetryError(error) {
|