@speakableio/core 0.1.63 → 0.1.65
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/dist/index.native.d.mts +564 -547
- package/dist/index.native.mjs +36 -0
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.web.d.mts +564 -547
- package/dist/index.web.js +36 -0
- package/dist/index.web.js.map +1 -1
- package/package.json +1 -1
package/dist/index.web.js
CHANGED
|
@@ -1871,6 +1871,41 @@ var checkTypePageActivity = (cardType) => {
|
|
|
1871
1871
|
};
|
|
1872
1872
|
};
|
|
1873
1873
|
|
|
1874
|
+
// src/domains/cards/utils/get-page-prompt.ts
|
|
1875
|
+
function getPagePrompt(card) {
|
|
1876
|
+
if (!card) return { has: false, text: "" };
|
|
1877
|
+
const { isMC, isRepeat, isRespond, isShortAnswer } = checkTypePageActivity(card == null ? void 0 : card.type);
|
|
1878
|
+
const hidePrompt = (card == null ? void 0 : card.hidePrompt) === true;
|
|
1879
|
+
if (isRepeat) {
|
|
1880
|
+
return {
|
|
1881
|
+
has: true,
|
|
1882
|
+
text: card == null ? void 0 : card.target_text
|
|
1883
|
+
};
|
|
1884
|
+
}
|
|
1885
|
+
if (isRespond && !hidePrompt) {
|
|
1886
|
+
return {
|
|
1887
|
+
has: true,
|
|
1888
|
+
text: card == null ? void 0 : card.prompt
|
|
1889
|
+
};
|
|
1890
|
+
}
|
|
1891
|
+
if (isMC) {
|
|
1892
|
+
return {
|
|
1893
|
+
has: true,
|
|
1894
|
+
text: card == null ? void 0 : card.question
|
|
1895
|
+
};
|
|
1896
|
+
}
|
|
1897
|
+
if (isShortAnswer && !hidePrompt) {
|
|
1898
|
+
return {
|
|
1899
|
+
has: true,
|
|
1900
|
+
text: card == null ? void 0 : card.prompt
|
|
1901
|
+
};
|
|
1902
|
+
}
|
|
1903
|
+
return {
|
|
1904
|
+
has: false,
|
|
1905
|
+
text: ""
|
|
1906
|
+
};
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1874
1909
|
// src/domains/sets/set.hooks.ts
|
|
1875
1910
|
import { useQuery as useQuery4 } from "@tanstack/react-query";
|
|
1876
1911
|
|
|
@@ -3068,6 +3103,7 @@ export {
|
|
|
3068
3103
|
creditQueryKeys,
|
|
3069
3104
|
debounce,
|
|
3070
3105
|
getCardFromCache,
|
|
3106
|
+
getPagePrompt,
|
|
3071
3107
|
getRespondCardTool,
|
|
3072
3108
|
getSetFromCache,
|
|
3073
3109
|
getWordHash,
|