@deepfrog/pangents-widget 2.2.1 → 2.2.2

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.
@@ -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-DgFZhnDu.cjs.js");module.exports=e.Chatbot;
9
+ "use strict";require("react/jsx-runtime"),require("react");const e=require("./widget-embed-DCSN_j6Y.cjs.js");module.exports=e.Chatbot;
10
10
  //# sourceMappingURL=widget-embed.cjs.js.map
@@ -8,7 +8,7 @@
8
8
  })();
9
9
  import "react/jsx-runtime";
10
10
  import "react";
11
- import { C } from "./widget-embed-B3A5H6pf.es.js";
11
+ import { C } from "./widget-embed-DzLM7DN8.es.js";
12
12
  export {
13
13
  C as default
14
14
  };
package/dist/widget.js CHANGED
@@ -23743,10 +23743,6 @@ class EnhancedErrorHandler {
23743
23743
  console.warn("[Enhanced Error Handler] No API key provided for validation");
23744
23744
  return false;
23745
23745
  }
23746
- if (!apiKey.startsWith("pangents_wk_") || apiKey.length < 20) {
23747
- console.warn("[Enhanced Error Handler] Invalid API key format");
23748
- return false;
23749
- }
23750
23746
  return true;
23751
23747
  }
23752
23748
  // Generate error fingerprint for duplicate detection
@@ -35166,14 +35162,14 @@ class ApiKeyValidator {
35166
35162
  if (!this.validateApiKeyFormat(sanitized)) {
35167
35163
  return {
35168
35164
  isValid: false,
35169
- error: "Invalid API key format. Expected format: pangents_wk_[alphanumeric characters]"
35165
+ error: "Invalid API key format."
35170
35166
  };
35171
35167
  }
35172
35168
  return { isValid: true };
35173
35169
  } catch (error) {
35174
35170
  return {
35175
35171
  isValid: false,
35176
- error: error instanceof Error ? error.message : "Invalid API key"
35172
+ error: error instanceof Error ? error.message : "Invalid API key format."
35177
35173
  };
35178
35174
  }
35179
35175
  }
@@ -36228,8 +36224,11 @@ function WidgetContent() {
36228
36224
  });
36229
36225
  }
36230
36226
  };
36227
+ const prevAuthRef = reactExports.useRef({});
36231
36228
  reactExports.useEffect(() => {
36232
- validateKey();
36229
+ const force = prevAuthRef.current.apiKey !== apiKey || prevAuthRef.current.tenantId !== tenantId;
36230
+ validateKey(force);
36231
+ prevAuthRef.current = { apiKey, tenantId };
36233
36232
  }, [apiKey, tenantId]);
36234
36233
  const handleRetry = () => {
36235
36234
  validateKey(true);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepfrog/pangents-widget",
3
3
  "private": false,
4
- "version": "2.2.1",
4
+ "version": "2.2.2",
5
5
  "description": "Pangents AI - Embeddable AI widget for web applications",
6
6
  "type": "module",
7
7
  "main": "dist/index.cjs.js",