@speakableio/core 1.0.53 → 1.0.54

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.
@@ -675,6 +675,12 @@ declare function getPagePrompt(card: PageActivityWithId | undefined): {
675
675
  text: string;
676
676
  rich_text: string;
677
677
  isTextEqualToRichText: boolean;
678
+ extraText: string;
679
+ } | {
680
+ has: boolean;
681
+ text: string;
682
+ rich_text: string;
683
+ isTextEqualToRichText: boolean;
678
684
  };
679
685
 
680
686
  declare const getTotalCompletedCards: (pageScores: Score["cards"] | undefined) => number;
@@ -675,6 +675,12 @@ declare function getPagePrompt(card: PageActivityWithId | undefined): {
675
675
  text: string;
676
676
  rich_text: string;
677
677
  isTextEqualToRichText: boolean;
678
+ extraText: string;
679
+ } | {
680
+ has: boolean;
681
+ text: string;
682
+ rich_text: string;
683
+ isTextEqualToRichText: boolean;
678
684
  };
679
685
 
680
686
  declare const getTotalCompletedCards: (pageScores: Score["cards"] | undefined) => number;
@@ -2124,21 +2124,22 @@ function getPagePrompt(card) {
2124
2124
  card == null ? void 0 : card.type
2125
2125
  );
2126
2126
  const hidePrompt = (card == null ? void 0 : card.hidePrompt) === true;
2127
- const createReturnObject = (text, richText) => {
2127
+ const createReturnObject = (text, richText, extraText) => {
2128
2128
  const plainText = text || "";
2129
2129
  const richTextPlain = extractTextFromRichText(richText);
2130
2130
  return {
2131
2131
  has: true,
2132
2132
  text: plainText,
2133
2133
  rich_text: richText || "",
2134
- isTextEqualToRichText: plainText.trim() === richTextPlain.trim()
2134
+ isTextEqualToRichText: plainText.trim() === richTextPlain.trim(),
2135
+ extraText: extraText || ""
2135
2136
  };
2136
2137
  };
2137
2138
  if (isRepeat) {
2138
2139
  return createReturnObject(card == null ? void 0 : card.target_text, card == null ? void 0 : card.rich_text);
2139
2140
  }
2140
2141
  if (isConversation) {
2141
- return createReturnObject(card == null ? void 0 : card.topic, card == null ? void 0 : card.rich_text);
2142
+ return createReturnObject(card == null ? void 0 : card.prompt, card == null ? void 0 : card.rich_text, card == null ? void 0 : card.goal);
2142
2143
  }
2143
2144
  if (isRespond && !hidePrompt) {
2144
2145
  return createReturnObject(card == null ? void 0 : card.prompt, card == null ? void 0 : card.rich_text);
@@ -2153,7 +2154,8 @@ function getPagePrompt(card) {
2153
2154
  has: false,
2154
2155
  text: "",
2155
2156
  rich_text: "",
2156
- isTextEqualToRichText: false
2157
+ isTextEqualToRichText: false,
2158
+ extraText: ""
2157
2159
  };
2158
2160
  }
2159
2161