@speakableio/core 0.1.20 → 0.1.22

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.d.mts CHANGED
@@ -2,10 +2,12 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
3
  import * as _tanstack_react_query from '@tanstack/react-query';
4
4
  import { QueryClient } from '@tanstack/react-query';
5
+ import * as firebase_firestore from 'firebase/firestore';
5
6
  import { Firestore, Timestamp as Timestamp$1, FieldValue } from 'firebase/firestore';
6
7
  import { FirebaseFirestoreTypes, Timestamp } from '@react-native-firebase/firestore';
7
8
 
8
9
  type FirebaseInstance = FirebaseFirestoreTypes.Module | Firestore;
10
+ type FirestoreHelpers = typeof firebase_firestore;
9
11
  type CustomTimestamp = Timestamp | Timestamp$1;
10
12
  type CallableFunction<T = any, R = any> = (data: T) => Promise<R>;
11
13
 
@@ -728,12 +730,13 @@ declare const useCreateNotification: () => {
728
730
  createNotification: (type: SpeakableNotificationType, data: any) => Promise<any>;
729
731
  };
730
732
 
731
- type FsClient = ReturnType<typeof createFsClient>;
732
- declare function createFsClient({ db, platform, httpsCallable, }: {
733
+ type FsClient = ReturnType<typeof createFsClientBase>;
734
+ declare function createFsClientBase({ db, helpers, httpsCallable, logEvent, }: {
733
735
  db: FirebaseInstance;
734
- platform: 'web' | 'native';
736
+ helpers: FirestoreHelpers;
735
737
  httpsCallable: (name: string) => CallableFunction;
736
- }): Promise<{
738
+ logEvent: (name: string, data: any) => void;
739
+ }): {
737
740
  assignmentRepo: {
738
741
  getAssignment: (params: {
739
742
  assignmentId: string;
@@ -908,7 +911,7 @@ declare function createFsClient({ db, platform, httpsCallable, }: {
908
911
  cardId: string;
909
912
  }) => Promise<CardActivityWithId | null>;
910
913
  };
911
- }>;
914
+ };
912
915
 
913
916
  interface UserProfile {
914
917
  googleClassroomUserId: string;
@@ -969,21 +972,24 @@ interface FsContext {
969
972
  permissions: Permissions;
970
973
  }
971
974
  declare const FsCtx: React.Context<FsContext | null>;
972
- declare function SpeakableProvider({ db, platform, children, queryClient, user, permissions, httpsCallable, }: {
973
- user: User;
974
- db: FirebaseInstance;
975
- platform: 'web' | 'native';
976
- queryClient: QueryClient;
977
- permissions: Permissions;
978
- httpsCallable: (name: string) => CallableFunction;
975
+ declare function SpeakableProvider({ user, children, queryClient, permissions, fsClient, }: {
979
976
  children: React.ReactNode;
977
+ fsClient: FsClient;
978
+ permissions: Permissions;
979
+ queryClient: QueryClient;
980
+ user: User;
980
981
  }): react_jsx_runtime.JSX.Element | null;
981
982
  declare function useSpeakableApi(): FsContext;
982
983
 
983
- declare function useActivity({ id, isAssignment, onAssignmentSubmitted, }: {
984
+ declare function useActivity({ id, isAssignment, onAssignmentSubmitted, ltiData, }: {
984
985
  id: string;
985
986
  isAssignment: boolean;
986
987
  onAssignmentSubmitted: (assignmentId: string) => void;
988
+ ltiData?: {
989
+ lineItemId?: string;
990
+ lti_id?: string;
991
+ serviceKey?: string;
992
+ };
987
993
  }): {
988
994
  set: {
989
995
  data: SetWithId | null | undefined;
@@ -1093,9 +1099,16 @@ declare function useActivity({ id, isAssignment, onAssignmentSubmitted, }: {
1093
1099
  message?: undefined;
1094
1100
  }>;
1095
1101
  updateCard: (cardId: string, cardScore: CardScore) => void;
1096
- logGradingStandardEntry: () => void;
1102
+ logGradingStandardEntry: ({ cardId, gradingStandard, type, }: {
1103
+ cardId: string;
1104
+ gradingStandard: {
1105
+ level: string;
1106
+ justification: string;
1107
+ };
1108
+ type: "actfl" | "wida" | "custom";
1109
+ }) => void;
1097
1110
  };
1098
1111
  };
1099
1112
  };
1100
1113
 
1101
- export { ALLOWED_CARD_ACTIVITY_TYPES_FOR_SUMMARY, type Assignment, type AssignmentWithId, BASE_MULTIPLE_CHOICE_FIELD_VALUES, BASE_REPEAT_FIELD_VALUES, BASE_RESPOND_FIELD_VALUES, type CardActivity, CardActivityType, type CardActivityWithId, type CardScore, FeedbackTypesCard, type FsClient, FsCtx, LENIENCY_OPTIONS, LeniencyCard, MULTIPLE_CHOICE_CARD_ACTIVITY_TYPES, REPEAT_CARD_ACTIVITY_TYPES, RESPOND_AUDIO_CARD_ACTIVITY_TYPES, RESPOND_CARD_ACTIVITY_TYPES, RESPOND_WRITE_CARD_ACTIVITY_TYPES, type RefsCardsFiresotre, type RefsSetsFirestore, SPEAKABLE_NOTIFICATIONS, STUDENT_LEVELS_OPTIONS, type Score, type ScoreWithId, type Set, type SetWithId, type SpeakableNotificationType, SpeakableNotificationTypes, SpeakableProvider, VerificationCardStatus, assignmentQueryKeys, cardsQueryKeys, createAssignmentRepo, createCardRepo, createFsClient, createSetRepo, getCardFromCache, getSetFromCache, refsCardsFiresotre, refsSetsFirestore, setsQueryKeys, updateCardInCache, updateSetInCache, useActivity, useAssignment, useCards, useCreateCard, useCreateCards, useCreateNotification, useSet, useSpeakableApi };
1114
+ export { ALLOWED_CARD_ACTIVITY_TYPES_FOR_SUMMARY, type Assignment, type AssignmentWithId, BASE_MULTIPLE_CHOICE_FIELD_VALUES, BASE_REPEAT_FIELD_VALUES, BASE_RESPOND_FIELD_VALUES, type CardActivity, CardActivityType, type CardActivityWithId, type CardScore, FeedbackTypesCard, type FsClient, FsCtx, LENIENCY_OPTIONS, LeniencyCard, MULTIPLE_CHOICE_CARD_ACTIVITY_TYPES, REPEAT_CARD_ACTIVITY_TYPES, RESPOND_AUDIO_CARD_ACTIVITY_TYPES, RESPOND_CARD_ACTIVITY_TYPES, RESPOND_WRITE_CARD_ACTIVITY_TYPES, type RefsCardsFiresotre, type RefsSetsFirestore, SPEAKABLE_NOTIFICATIONS, STUDENT_LEVELS_OPTIONS, type Score, type ScoreWithId, type Set, type SetWithId, type SpeakableNotificationType, SpeakableNotificationTypes, SpeakableProvider, VerificationCardStatus, assignmentQueryKeys, cardsQueryKeys, createAssignmentRepo, createCardRepo, createFsClientBase, createSetRepo, getCardFromCache, getSetFromCache, refsCardsFiresotre, refsSetsFirestore, setsQueryKeys, updateCardInCache, updateSetInCache, useActivity, useAssignment, useCards, useCreateCard, useCreateCards, useCreateNotification, useSet, useSpeakableApi };
package/dist/index.d.ts CHANGED
@@ -2,10 +2,12 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
3
  import * as _tanstack_react_query from '@tanstack/react-query';
4
4
  import { QueryClient } from '@tanstack/react-query';
5
+ import * as firebase_firestore from 'firebase/firestore';
5
6
  import { Firestore, Timestamp as Timestamp$1, FieldValue } from 'firebase/firestore';
6
7
  import { FirebaseFirestoreTypes, Timestamp } from '@react-native-firebase/firestore';
7
8
 
8
9
  type FirebaseInstance = FirebaseFirestoreTypes.Module | Firestore;
10
+ type FirestoreHelpers = typeof firebase_firestore;
9
11
  type CustomTimestamp = Timestamp | Timestamp$1;
10
12
  type CallableFunction<T = any, R = any> = (data: T) => Promise<R>;
11
13
 
@@ -728,12 +730,13 @@ declare const useCreateNotification: () => {
728
730
  createNotification: (type: SpeakableNotificationType, data: any) => Promise<any>;
729
731
  };
730
732
 
731
- type FsClient = ReturnType<typeof createFsClient>;
732
- declare function createFsClient({ db, platform, httpsCallable, }: {
733
+ type FsClient = ReturnType<typeof createFsClientBase>;
734
+ declare function createFsClientBase({ db, helpers, httpsCallable, logEvent, }: {
733
735
  db: FirebaseInstance;
734
- platform: 'web' | 'native';
736
+ helpers: FirestoreHelpers;
735
737
  httpsCallable: (name: string) => CallableFunction;
736
- }): Promise<{
738
+ logEvent: (name: string, data: any) => void;
739
+ }): {
737
740
  assignmentRepo: {
738
741
  getAssignment: (params: {
739
742
  assignmentId: string;
@@ -908,7 +911,7 @@ declare function createFsClient({ db, platform, httpsCallable, }: {
908
911
  cardId: string;
909
912
  }) => Promise<CardActivityWithId | null>;
910
913
  };
911
- }>;
914
+ };
912
915
 
913
916
  interface UserProfile {
914
917
  googleClassroomUserId: string;
@@ -969,21 +972,24 @@ interface FsContext {
969
972
  permissions: Permissions;
970
973
  }
971
974
  declare const FsCtx: React.Context<FsContext | null>;
972
- declare function SpeakableProvider({ db, platform, children, queryClient, user, permissions, httpsCallable, }: {
973
- user: User;
974
- db: FirebaseInstance;
975
- platform: 'web' | 'native';
976
- queryClient: QueryClient;
977
- permissions: Permissions;
978
- httpsCallable: (name: string) => CallableFunction;
975
+ declare function SpeakableProvider({ user, children, queryClient, permissions, fsClient, }: {
979
976
  children: React.ReactNode;
977
+ fsClient: FsClient;
978
+ permissions: Permissions;
979
+ queryClient: QueryClient;
980
+ user: User;
980
981
  }): react_jsx_runtime.JSX.Element | null;
981
982
  declare function useSpeakableApi(): FsContext;
982
983
 
983
- declare function useActivity({ id, isAssignment, onAssignmentSubmitted, }: {
984
+ declare function useActivity({ id, isAssignment, onAssignmentSubmitted, ltiData, }: {
984
985
  id: string;
985
986
  isAssignment: boolean;
986
987
  onAssignmentSubmitted: (assignmentId: string) => void;
988
+ ltiData?: {
989
+ lineItemId?: string;
990
+ lti_id?: string;
991
+ serviceKey?: string;
992
+ };
987
993
  }): {
988
994
  set: {
989
995
  data: SetWithId | null | undefined;
@@ -1093,9 +1099,16 @@ declare function useActivity({ id, isAssignment, onAssignmentSubmitted, }: {
1093
1099
  message?: undefined;
1094
1100
  }>;
1095
1101
  updateCard: (cardId: string, cardScore: CardScore) => void;
1096
- logGradingStandardEntry: () => void;
1102
+ logGradingStandardEntry: ({ cardId, gradingStandard, type, }: {
1103
+ cardId: string;
1104
+ gradingStandard: {
1105
+ level: string;
1106
+ justification: string;
1107
+ };
1108
+ type: "actfl" | "wida" | "custom";
1109
+ }) => void;
1097
1110
  };
1098
1111
  };
1099
1112
  };
1100
1113
 
1101
- export { ALLOWED_CARD_ACTIVITY_TYPES_FOR_SUMMARY, type Assignment, type AssignmentWithId, BASE_MULTIPLE_CHOICE_FIELD_VALUES, BASE_REPEAT_FIELD_VALUES, BASE_RESPOND_FIELD_VALUES, type CardActivity, CardActivityType, type CardActivityWithId, type CardScore, FeedbackTypesCard, type FsClient, FsCtx, LENIENCY_OPTIONS, LeniencyCard, MULTIPLE_CHOICE_CARD_ACTIVITY_TYPES, REPEAT_CARD_ACTIVITY_TYPES, RESPOND_AUDIO_CARD_ACTIVITY_TYPES, RESPOND_CARD_ACTIVITY_TYPES, RESPOND_WRITE_CARD_ACTIVITY_TYPES, type RefsCardsFiresotre, type RefsSetsFirestore, SPEAKABLE_NOTIFICATIONS, STUDENT_LEVELS_OPTIONS, type Score, type ScoreWithId, type Set, type SetWithId, type SpeakableNotificationType, SpeakableNotificationTypes, SpeakableProvider, VerificationCardStatus, assignmentQueryKeys, cardsQueryKeys, createAssignmentRepo, createCardRepo, createFsClient, createSetRepo, getCardFromCache, getSetFromCache, refsCardsFiresotre, refsSetsFirestore, setsQueryKeys, updateCardInCache, updateSetInCache, useActivity, useAssignment, useCards, useCreateCard, useCreateCards, useCreateNotification, useSet, useSpeakableApi };
1114
+ export { ALLOWED_CARD_ACTIVITY_TYPES_FOR_SUMMARY, type Assignment, type AssignmentWithId, BASE_MULTIPLE_CHOICE_FIELD_VALUES, BASE_REPEAT_FIELD_VALUES, BASE_RESPOND_FIELD_VALUES, type CardActivity, CardActivityType, type CardActivityWithId, type CardScore, FeedbackTypesCard, type FsClient, FsCtx, LENIENCY_OPTIONS, LeniencyCard, MULTIPLE_CHOICE_CARD_ACTIVITY_TYPES, REPEAT_CARD_ACTIVITY_TYPES, RESPOND_AUDIO_CARD_ACTIVITY_TYPES, RESPOND_CARD_ACTIVITY_TYPES, RESPOND_WRITE_CARD_ACTIVITY_TYPES, type RefsCardsFiresotre, type RefsSetsFirestore, SPEAKABLE_NOTIFICATIONS, STUDENT_LEVELS_OPTIONS, type Score, type ScoreWithId, type Set, type SetWithId, type SpeakableNotificationType, SpeakableNotificationTypes, SpeakableProvider, VerificationCardStatus, assignmentQueryKeys, cardsQueryKeys, createAssignmentRepo, createCardRepo, createFsClientBase, createSetRepo, getCardFromCache, getSetFromCache, refsCardsFiresotre, refsSetsFirestore, setsQueryKeys, updateCardInCache, updateSetInCache, useActivity, useAssignment, useCards, useCreateCard, useCreateCards, useCreateNotification, useSet, useSpeakableApi };