@speakableio/core 1.0.54 → 1.0.56

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.
@@ -828,8 +828,10 @@ var logGradingStandardLog = (data) => {
828
828
  };
829
829
 
830
830
  // src/constants/analytics.constants.ts
831
- var ANALYTICS_EVENT_TYPES = {
831
+ var SPEAKABLE_ANALYTICS = {
832
832
  VOICE_SUCCESS: "voice_success",
833
+ VOICE_FALLBACK_SUCCESS: "voice_fallback_success",
834
+ VOICE_FALLBACK_FAIL: "voice_fallback_fail",
833
835
  VOICE_FAIL: "voice_fail",
834
836
  RESPOND_CARD_SUCCESS: "respond_card_success",
835
837
  RESPOND_CARD_FAIL: "respond_card_fail",
@@ -875,20 +877,20 @@ var logOpenActivityPreview = (data = {}) => {
875
877
  var logSubmitAssignment = (data = {}) => {
876
878
  var _a, _b, _c;
877
879
  (_c = (_b = (_a = api).httpsCallable) == null ? void 0 : _b.call(_a, "handleCouresAnalyticsEvent")) == null ? void 0 : _c({
878
- eventType: ANALYTICS_EVENT_TYPES.SUBMISSION,
880
+ eventType: SPEAKABLE_ANALYTICS.SUBMISSION,
879
881
  ...data
880
882
  });
881
- api.logEvent(ANALYTICS_EVENT_TYPES.SUBMISSION, data);
883
+ api.logEvent(SPEAKABLE_ANALYTICS.SUBMISSION, data);
882
884
  };
883
885
  var logStartAssignment = (data = {}) => {
884
886
  var _a, _b, _c;
885
887
  if (data.courseId) {
886
888
  (_c = (_b = (_a = api).httpsCallable) == null ? void 0 : _b.call(_a, "handleCouresAnalyticsEvent")) == null ? void 0 : _c({
887
- eventType: ANALYTICS_EVENT_TYPES.ASSIGNMENT_STARTED,
889
+ eventType: SPEAKABLE_ANALYTICS.ASSIGNMENT_STARTED,
888
890
  ...data
889
891
  });
890
892
  }
891
- api.logEvent(ANALYTICS_EVENT_TYPES.ASSIGNMENT_STARTED, data);
893
+ api.logEvent(SPEAKABLE_ANALYTICS.ASSIGNMENT_STARTED, data);
892
894
  };
893
895
 
894
896
  // src/domains/assignment/utils/create-default-score.ts
@@ -3284,11 +3286,16 @@ var useUpdateStudentVocab = (page) => {
3284
3286
  try {
3285
3287
  await api.updateDoc(docPath, data);
3286
3288
  } catch (error) {
3287
- if (error instanceof Error && error.message === "not-found") {
3288
- data.firstSeen = serverTimestamp2();
3289
- await api.setDoc(docPath, data, { merge: true });
3289
+ if (error instanceof Error && "code" in error) {
3290
+ const firebaseError = error;
3291
+ if (firebaseError.code === "not-found") {
3292
+ data.firstSeen = serverTimestamp2();
3293
+ await api.setDoc(docPath, data, { merge: true });
3294
+ } else {
3295
+ console.error("Error actualizando vocabulario:", error);
3296
+ }
3290
3297
  } else {
3291
- console.log(error);
3298
+ console.error("Error desconocido:", error);
3292
3299
  }
3293
3300
  }
3294
3301
  try {
@@ -3799,6 +3806,7 @@ export {
3799
3806
  RESPOND_AUDIO_PAGE_ACTIVITY_TYPES,
3800
3807
  RESPOND_PAGE_ACTIVITY_TYPES,
3801
3808
  RESPOND_WRITE_PAGE_ACTIVITY_TYPES,
3809
+ SPEAKABLE_ANALYTICS,
3802
3810
  SPEAKABLE_NOTIFICATIONS,
3803
3811
  STUDENT_LEVELS_OPTIONS,
3804
3812
  SpeakableNotificationTypes,