@speakableio/core 1.0.48 → 1.0.50

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.
@@ -1594,6 +1594,11 @@ import { useMutation as useMutation2, useQueries, useQuery as useQuery3 } from "
1594
1594
  import { useMemo } from "react";
1595
1595
 
1596
1596
  // src/domains/cards/card.model.ts
1597
+ var ConversationPageMode = /* @__PURE__ */ ((ConversationPageMode2) => {
1598
+ ConversationPageMode2["VoiceAndText"] = "voice_and_text";
1599
+ ConversationPageMode2["PhoneCall"] = "phone_call";
1600
+ return ConversationPageMode2;
1601
+ })(ConversationPageMode || {});
1597
1602
  var ActivityPageType = /* @__PURE__ */ ((ActivityPageType2) => {
1598
1603
  ActivityPageType2["READ_REPEAT"] = "READ_REPEAT";
1599
1604
  ActivityPageType2["READ_RESPOND"] = "READ_RESPOND";
@@ -1604,6 +1609,7 @@ var ActivityPageType = /* @__PURE__ */ ((ActivityPageType2) => {
1604
1609
  ActivityPageType2["MULTIPLE_CHOICE"] = "MULTIPLE_CHOICE";
1605
1610
  ActivityPageType2["MEDIA_PAGE"] = "MEDIA_PAGE";
1606
1611
  ActivityPageType2["SHORT_ANSWER"] = "SHORT_ANSWER";
1612
+ ActivityPageType2["CONVERSATION"] = "CONVERSATION";
1607
1613
  return ActivityPageType2;
1608
1614
  })(ActivityPageType || {});
1609
1615
  var RESPOND_PAGE_ACTIVITY_TYPES = [
@@ -1622,6 +1628,7 @@ var RESPOND_AUDIO_PAGE_ACTIVITY_TYPES = [
1622
1628
  "RESPOND" /* RESPOND */,
1623
1629
  "READ_RESPOND" /* READ_RESPOND */
1624
1630
  ];
1631
+ var CONVERSATION_PAGE_ACTIVITY_TYPES = ["CONVERSATION" /* CONVERSATION */];
1625
1632
 
1626
1633
  // src/domains/cards/card.constants.ts
1627
1634
  var FeedbackTypesCard = /* @__PURE__ */ ((FeedbackTypesCard2) => {
@@ -1951,6 +1958,10 @@ var checkIsShortAnswerPage = (cardType) => {
1951
1958
  if (cardType === void 0) return false;
1952
1959
  return cardType === "SHORT_ANSWER" /* SHORT_ANSWER */;
1953
1960
  };
1961
+ var checkIsConversationPage = (cardType) => {
1962
+ if (cardType === void 0) return false;
1963
+ return cardType === "CONVERSATION" /* CONVERSATION */;
1964
+ };
1954
1965
  var checkTypePageActivity = (cardType) => {
1955
1966
  const isRespondAudio = checkIsRespondAudioPage(cardType);
1956
1967
  const isRespondWritten = checkIsRespondWrittenPage(cardType);
@@ -1959,7 +1970,8 @@ var checkTypePageActivity = (cardType) => {
1959
1970
  const isRepeat = checkIsRepeatPage(cardType);
1960
1971
  const isMediaPage = checkIsMediaPage(cardType);
1961
1972
  const isShortAnswer = checkIsShortAnswerPage(cardType);
1962
- const isNoOneOfThem = !isRespond && !isMC && !isRepeat && !isMediaPage && !isShortAnswer;
1973
+ const isConversation = checkIsConversationPage(cardType);
1974
+ const isNoOneOfThem = !isRespond && !isMC && !isRepeat && !isMediaPage && !isShortAnswer && !isConversation;
1963
1975
  if (isNoOneOfThem) {
1964
1976
  return {
1965
1977
  isRespondAudio: false,
@@ -1969,7 +1981,8 @@ var checkTypePageActivity = (cardType) => {
1969
1981
  isRepeat: true,
1970
1982
  isMediaPage: false,
1971
1983
  isShortAnswer: false,
1972
- hasSomeType: false
1984
+ hasSomeType: false,
1985
+ isConversation: false
1973
1986
  };
1974
1987
  }
1975
1988
  return {
@@ -1980,7 +1993,8 @@ var checkTypePageActivity = (cardType) => {
1980
1993
  isRepeat,
1981
1994
  isMediaPage,
1982
1995
  isShortAnswer,
1983
- hasSomeType: true
1996
+ hasSomeType: true,
1997
+ isConversation
1984
1998
  };
1985
1999
  };
1986
2000
 
@@ -1991,7 +2005,9 @@ function extractTextFromRichText(richText) {
1991
2005
  }
1992
2006
  function getPagePrompt(card) {
1993
2007
  if (!card) return { has: false, text: "", rich_text: "", isTextEqualToRichText: false };
1994
- const { isMC, isRepeat, isRespond, isShortAnswer } = checkTypePageActivity(card == null ? void 0 : card.type);
2008
+ const { isMC, isRepeat, isRespond, isShortAnswer, isConversation } = checkTypePageActivity(
2009
+ card == null ? void 0 : card.type
2010
+ );
1995
2011
  const hidePrompt = (card == null ? void 0 : card.hidePrompt) === true;
1996
2012
  const createReturnObject = (text, richText) => {
1997
2013
  const plainText = text || "";
@@ -2006,6 +2022,9 @@ function getPagePrompt(card) {
2006
2022
  if (isRepeat) {
2007
2023
  return createReturnObject(card == null ? void 0 : card.target_text, card == null ? void 0 : card.rich_text);
2008
2024
  }
2025
+ if (isConversation) {
2026
+ return createReturnObject(card == null ? void 0 : card.goal, card == null ? void 0 : card.rich_text);
2027
+ }
2009
2028
  if (isRespond && !hidePrompt) {
2010
2029
  return createReturnObject(card == null ? void 0 : card.prompt, card == null ? void 0 : card.rich_text);
2011
2030
  }
@@ -3767,6 +3786,8 @@ export {
3767
3786
  BASE_MULTIPLE_CHOICE_FIELD_VALUES,
3768
3787
  BASE_REPEAT_FIELD_VALUES,
3769
3788
  BASE_RESPOND_FIELD_VALUES,
3789
+ CONVERSATION_PAGE_ACTIVITY_TYPES,
3790
+ ConversationPageMode,
3770
3791
  FeedbackTypesCard,
3771
3792
  FsCtx,
3772
3793
  LENIENCY_OPTIONS,
@@ -3783,6 +3804,7 @@ export {
3783
3804
  VerificationCardStatus,
3784
3805
  assignmentQueryKeys,
3785
3806
  cardsQueryKeys,
3807
+ checkIsConversationPage,
3786
3808
  checkIsMCPage,
3787
3809
  checkIsMediaPage,
3788
3810
  checkIsRepeatPage,