@ada-support/embed2 1.8.0 → 1.8.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.
@@ -13949,7 +13949,7 @@ const client = new BrowserClient({
13949
13949
  return event;
13950
13950
  },
13951
13951
  environment: "production",
13952
- release: "1.8.0-65176dc",
13952
+ release: "1.8.2-7423118",
13953
13953
  sampleRate: 0.25,
13954
13954
  autoSessionTracking: false,
13955
13955
  // Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
@@ -14524,7 +14524,7 @@ function getEmbedURL(_ref) {
14524
14524
  } else {
14525
14525
  host = `http://${handle}.localhost:9001`;
14526
14526
  }
14527
- return `${host}/embed/${frameName}/${"65176dc"}/index.html`;
14527
+ return `${host}/embed/${frameName}/${"7423118"}/index.html`;
14528
14528
  }
14529
14529
  function constructQueryString(query) {
14530
14530
  return Object.keys(query).map(key => {
@@ -15702,9 +15702,9 @@ async function log(message, extra, options) {
15702
15702
  service: "embed",
15703
15703
  env: "production",
15704
15704
  embedVersion: 2,
15705
- version: "1.8.0",
15705
+ version: "1.8.2",
15706
15706
  isNpm: true,
15707
- commitHash: "65176dc"
15707
+ commitHash: "7423118"
15708
15708
  }))
15709
15709
  });
15710
15710
  }
@@ -16237,6 +16237,7 @@ function proactiveConversation_objectSpread(e) { for (var r = 1; r < arguments.l
16237
16237
 
16238
16238
 
16239
16239
 
16240
+
16240
16241
  function proactiveShownWithinFrequency(proactiveConversationKey, frequency, handle) {
16241
16242
  switch (frequency) {
16242
16243
  case "always":
@@ -16286,8 +16287,13 @@ function proactiveTriggerImpl(_ref) {
16286
16287
  const {
16287
16288
  duration,
16288
16289
  delay,
16289
- frequency
16290
+ frequency,
16291
+ active
16290
16292
  } = proactiveConversation.modality_config.chat;
16293
+ if (!active) {
16294
+ warn("Proactive message is not active");
16295
+ return;
16296
+ }
16291
16297
 
16292
16298
  // Check if the proactive message has been shown within the specified frequency
16293
16299
  const doesPassFrequencyCheck = !proactiveShownWithinFrequency(messageKey, frequency, handle);
@@ -16840,7 +16846,7 @@ class ChatFrame extends d {
16840
16846
  const hostPageUrlParams = new URL(window.location.href).searchParams;
16841
16847
  const smsToken = hostPageUrlParams.get("adaSMSToken");
16842
16848
  const queryParams = {
16843
- embedVersion: "65176dc".slice(0, 7),
16849
+ embedVersion: "7423118".slice(0, 7),
16844
16850
  greeting,
16845
16851
  language,
16846
16852
  skipGreeting,
@@ -17813,7 +17819,8 @@ class Container extends d {
17813
17819
  adaSettings,
17814
17820
  chatterInLiveChat,
17815
17821
  messageService,
17816
- wasCampaignShownButNowClosed
17822
+ wasCampaignShownButNowClosed,
17823
+ setGlobalState
17817
17824
  } = this.props;
17818
17825
  const {
17819
17826
  toggleCallback
@@ -17895,6 +17902,13 @@ class Container extends d {
17895
17902
  if (isChatWebsocketConnected && isDrawerOpen && recentProactiveConversationKey) {
17896
17903
  const chatChannel = messageService.getChannel(CHAT_IFRAME);
17897
17904
  if (chatChannel) {
17905
+ // Set meta field to indicate that a proactive conversation has been injected
17906
+ // This can be used by the AI manager to customize the greeting
17907
+ setGlobalState({
17908
+ metaFields: {
17909
+ proactive_conversation: true
17910
+ }
17911
+ });
17898
17912
  chatChannel.postMessage(INJECT_PROACTIVE_CONVERSATION, {
17899
17913
  key: recentProactiveConversationKey
17900
17914
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-support/embed2",
3
- "version": "1.8.0",
3
+ "version": "1.8.2",
4
4
  "description": "",
5
5
  "main": "dist/npm-entry",
6
6
  "typings": "dist/npm-entry/index-npm.d.ts",