@magmamath/students-features 1.3.3-rc.1 → 1.3.3-rc.2
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/commonjs/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
- package/dist/commonjs/shared/translation/hooks.js.map +1 -1
- package/dist/commonjs/shared/translation/react-i18next.d.js +5 -0
- package/dist/commonjs/shared/translation/react-i18next.d.js.map +1 -0
- package/dist/commonjs/shared/translation/schema.json +66 -0
- package/dist/commonjs/shared/translation/types.js +4 -0
- package/dist/module/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
- package/dist/module/shared/translation/hooks.js.map +1 -1
- package/dist/module/shared/translation/react-i18next.d.js +5 -0
- package/dist/module/shared/translation/react-i18next.d.js.map +1 -0
- package/dist/module/shared/translation/schema.json +66 -0
- package/dist/module/shared/translation/types.js +2 -0
- package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts +2 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/types.d.ts +3 -1
- package/dist/typescript/commonjs/shared/translation/types.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts +2 -1
- package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/types.d.ts +3 -1
- package/dist/typescript/module/shared/translation/types.d.ts.map +1 -1
- package/package.json +16 -16
- package/src/features/chatbot/model/ChatBoxTextManager.ts +3 -2
- package/src/shared/translation/helpers.ts +1 -1
- package/src/shared/translation/hooks.ts +1 -1
- package/src/shared/translation/react-i18next.d.ts +21 -0
- package/src/shared/translation/schema.json +66 -0
- package/src/shared/translation/types.ts +4 -1
- package/dist/commonjs/locales/schema.json +0 -1
- package/dist/module/locales/schema.json +0 -1
- package/src/locales/schema.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_DefaultMessageCreator","require","_helpers","ChatBotTextManager","messagesCreator","DefaultMessagesCreator","textGetter","getText","bindToLanguageChanged","messages","error","createMessage","options","createOption","start","endMessage","anotherHintOption","getHint","defaultMessages","update","cb","Object","assign","restore","exports"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/ChatBoxTextManager.ts"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;
|
|
1
|
+
{"version":3,"names":["_DefaultMessageCreator","require","_helpers","ChatBotTextManager","messagesCreator","DefaultMessagesCreator","textGetter","getText","bindToLanguageChanged","messages","error","createMessage","options","createOption","start","endMessage","anotherHintOption","getHint","defaultMessages","update","cb","Object","assign","restore","exports"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/ChatBoxTextManager.ts"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAIO,MAAME,kBAAkB,CAAC;EACbC,eAAe,GAAG,IAAIC,6CAAsB,CAAkB;IAC7EC,UAAU,EAAEC;EACd,CAAC,CAAC,CAACC,qBAAqB,CAAC,CAAC;EAEVC,QAAQ,GAAoB;IAC1CC,KAAK,EAAE,IAAI,CAACN,eAAe,CAACO,aAAa,CAAC,mBAAmB,EAAE;MAC7DC,OAAO,EAAE,CAAC,IAAI,CAACR,eAAe,CAACS,YAAY,CAAC,eAAe,CAAC;IAC9D,CAAC,CAAC;IACFC,KAAK,EAAE,IAAI,CAACV,eAAe,CAACO,aAAa,CAAC,kBAAkB,CAAC;IAC7DI,UAAU,EAAE,IAAI,CAACX,eAAe,CAACO,aAAa,CAAC,kBAAkB,CAAC;IAClEK,iBAAiB,EAAE,IAAI,CAACZ,eAAe,CAACS,YAAY,CAAC,kBAAkB,CAAC;IACxEI,OAAO,EAAE,IAAI,CAACb,eAAe,CAACS,YAAY,CAAC,cAAc;EAC3D,CAAC;EACgBK,eAAe,GAAG;IAAE,GAAG,IAAI,CAACT;EAAS,CAAC;EAEhDU,MAAMA,CACXC,EAAkF,EAClF;IACAC,MAAM,CAACC,MAAM,CAAC,IAAI,CAACb,QAAQ,EAAEW,EAAE,CAAC,IAAI,CAAChB,eAAe,CAAC,CAAC;EACxD;EAEOmB,OAAOA,CAAA,EAAG;IACfF,MAAM,CAACC,MAAM,CAAC,IAAI,CAACb,QAAQ,EAAE,IAAI,CAACS,eAAe,CAAC;EACpD;AACF;AAACM,OAAA,CAAArB,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactI18next","_constants","useText","t","useTranslation","NAMESPACE","useCallback","key","args","undefined","exports"],"sourceRoot":"../../../../src","sources":["shared/translation/hooks.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAGO,MAAMG,OAAO,GAAGA,CAAA,KAAe;EACpC,MAAM;IAAEC;EAAE,CAAC,GAAG,IAAAC,4BAAc,EAACC,oBAAS,CAAC;EACvC,OAAO,IAAAC,kBAAW,EAAU,CAACC,GAAG,EAAEC,IAAI,GAAG,IAAI,KAAKL,CAAC,CAACI,GAAG,EAAEC,IAAI,IAAIC,SAAS,
|
|
1
|
+
{"version":3,"names":["_react","require","_reactI18next","_constants","useText","t","useTranslation","NAMESPACE","useCallback","key","args","undefined","exports"],"sourceRoot":"../../../../src","sources":["shared/translation/hooks.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAGO,MAAMG,OAAO,GAAGA,CAAA,KAAe;EACpC,MAAM;IAAEC;EAAE,CAAC,GAAG,IAAAC,4BAAc,EAACC,oBAAS,CAAC;EACvC,OAAO,IAAAC,kBAAW,EAAU,CAACC,GAAG,EAAEC,IAAI,GAAG,IAAI,KAAKL,CAAC,CAACI,GAAG,EAAEC,IAAI,IAAIC,SAAS,CAAW,EAAE,CAACN,CAAC,CAAC,CAAC;AAC7F,CAAC;AAAAO,OAAA,CAAAR,OAAA,GAAAA,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["require"],"sourceRoot":"../../../../src","sources":["shared/translation/react-i18next.d.ts"],"mappings":";;AAAAA,OAAA;AACAA,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"chat": {
|
|
3
|
+
"anotherHint": "Give me another hint",
|
|
4
|
+
"answerAgain": "Answer again to get another hint!",
|
|
5
|
+
"errorMessage": "Something went wrong! Try again",
|
|
6
|
+
"getHint": "Get a hint",
|
|
7
|
+
"giveHint": "I need a hint",
|
|
8
|
+
"giveHintOpenChat": "I need a hint",
|
|
9
|
+
"howCanIHelp": "Hi! Do you want help?",
|
|
10
|
+
"inputPlaceholder": "Type...",
|
|
11
|
+
"needHint": "I need a hint",
|
|
12
|
+
"showError": "Show error"
|
|
13
|
+
},
|
|
14
|
+
"exampleSolution": {
|
|
15
|
+
"aha": "Aha!",
|
|
16
|
+
"errorMessage": "Something went wrong with generating an example solution",
|
|
17
|
+
"exampleSolution": "Example solution",
|
|
18
|
+
"letMeThink": "Let me think..."
|
|
19
|
+
},
|
|
20
|
+
"gifCelebrations": {
|
|
21
|
+
"almostThere": "Almost there",
|
|
22
|
+
"greatStart": "Great start!",
|
|
23
|
+
"onTheWay": "On the way!"
|
|
24
|
+
},
|
|
25
|
+
"keyboard": {
|
|
26
|
+
"area": "Area",
|
|
27
|
+
"length": "Length",
|
|
28
|
+
"time": "Time",
|
|
29
|
+
"volume": "Volume",
|
|
30
|
+
"weight": "Weight"
|
|
31
|
+
},
|
|
32
|
+
"locale": "en-SE",
|
|
33
|
+
"teacherFeedback": {
|
|
34
|
+
"noComments": "No comments yet"
|
|
35
|
+
},
|
|
36
|
+
"time": {
|
|
37
|
+
"dayAgo": "day ago",
|
|
38
|
+
"daysAgo": "{{count}} days ago",
|
|
39
|
+
"hourAgo": "hour ago",
|
|
40
|
+
"hoursAgo": "{{count}} hours ago",
|
|
41
|
+
"justNow": "just now",
|
|
42
|
+
"minuteAgo": "minute ago",
|
|
43
|
+
"minutesAgo": "{{count}} minutes ago",
|
|
44
|
+
"monthAgo": "month ago",
|
|
45
|
+
"monthsAgo": "{{count}} months ago",
|
|
46
|
+
"yearAgo": "year ago",
|
|
47
|
+
"yearsAgo": "{{count}} years ago"
|
|
48
|
+
},
|
|
49
|
+
"voice": {
|
|
50
|
+
"attempt": "Attempt '{{'number'}}'",
|
|
51
|
+
"cancel": "Cancel",
|
|
52
|
+
"delete": "Delete",
|
|
53
|
+
"deleteRecording": "Delete recording?",
|
|
54
|
+
"noMicrophoneAccess": "No microphone access.",
|
|
55
|
+
"noMicrophoneAccessBySystem": "Microphone access denied by system settings.",
|
|
56
|
+
"noMicrophoneFound": "No microphone found.",
|
|
57
|
+
"recordingDeleted": "Recording successfully deleted.",
|
|
58
|
+
"redo": "Redo",
|
|
59
|
+
"redoRecording": "Redo recording?",
|
|
60
|
+
"thisWillRemoveRecording": "This will remove your previous recording.",
|
|
61
|
+
"transcriptions": "Transcriptions",
|
|
62
|
+
"transcriptNotAvailable": "Transcript not available",
|
|
63
|
+
"uploadFailed": "Upload failed. Please try again.",
|
|
64
|
+
"youWontBeAbleToRecover": "You won't be able to recover this file once it's gone."
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DefaultMessagesCreator","getText","ChatBotTextManager","messagesCreator","textGetter","bindToLanguageChanged","messages","error","createMessage","options","createOption","start","endMessage","anotherHintOption","getHint","defaultMessages","update","cb","Object","assign","restore"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/ChatBoxTextManager.ts"],"mappings":";;AAAA,SAASA,sBAAsB,QAAQ,4BAAyB;AAChE,SAASC,OAAO,QAAQ,wCAAqC;
|
|
1
|
+
{"version":3,"names":["DefaultMessagesCreator","getText","ChatBotTextManager","messagesCreator","textGetter","bindToLanguageChanged","messages","error","createMessage","options","createOption","start","endMessage","anotherHintOption","getHint","defaultMessages","update","cb","Object","assign","restore"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/ChatBoxTextManager.ts"],"mappings":";;AAAA,SAASA,sBAAsB,QAAQ,4BAAyB;AAChE,SAASC,OAAO,QAAQ,wCAAqC;AAI7D,OAAO,MAAMC,kBAAkB,CAAC;EACbC,eAAe,GAAG,IAAIH,sBAAsB,CAAkB;IAC7EI,UAAU,EAAEH;EACd,CAAC,CAAC,CAACI,qBAAqB,CAAC,CAAC;EAEVC,QAAQ,GAAoB;IAC1CC,KAAK,EAAE,IAAI,CAACJ,eAAe,CAACK,aAAa,CAAC,mBAAmB,EAAE;MAC7DC,OAAO,EAAE,CAAC,IAAI,CAACN,eAAe,CAACO,YAAY,CAAC,eAAe,CAAC;IAC9D,CAAC,CAAC;IACFC,KAAK,EAAE,IAAI,CAACR,eAAe,CAACK,aAAa,CAAC,kBAAkB,CAAC;IAC7DI,UAAU,EAAE,IAAI,CAACT,eAAe,CAACK,aAAa,CAAC,kBAAkB,CAAC;IAClEK,iBAAiB,EAAE,IAAI,CAACV,eAAe,CAACO,YAAY,CAAC,kBAAkB,CAAC;IACxEI,OAAO,EAAE,IAAI,CAACX,eAAe,CAACO,YAAY,CAAC,cAAc;EAC3D,CAAC;EACgBK,eAAe,GAAG;IAAE,GAAG,IAAI,CAACT;EAAS,CAAC;EAEhDU,MAAMA,CACXC,EAAkF,EAClF;IACAC,MAAM,CAACC,MAAM,CAAC,IAAI,CAACb,QAAQ,EAAEW,EAAE,CAAC,IAAI,CAACd,eAAe,CAAC,CAAC;EACxD;EAEOiB,OAAOA,CAAA,EAAG;IACfF,MAAM,CAACC,MAAM,CAAC,IAAI,CAACb,QAAQ,EAAE,IAAI,CAACS,eAAe,CAAC;EACpD;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useTranslation","NAMESPACE","useText","t","key","args","undefined"],"sourceRoot":"../../../../src","sources":["shared/translation/hooks.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,SAAS,QAAQ,gBAAa;AAGvC,OAAO,MAAMC,OAAO,GAAGA,CAAA,KAAe;EACpC,MAAM;IAAEC;EAAE,CAAC,GAAGH,cAAc,CAACC,SAAS,CAAC;EACvC,OAAOF,WAAW,CAAU,CAACK,GAAG,EAAEC,IAAI,GAAG,IAAI,KAAKF,CAAC,CAACC,GAAG,EAAEC,IAAI,IAAIC,SAAS,
|
|
1
|
+
{"version":3,"names":["useCallback","useTranslation","NAMESPACE","useText","t","key","args","undefined"],"sourceRoot":"../../../../src","sources":["shared/translation/hooks.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,SAAS,QAAQ,gBAAa;AAGvC,OAAO,MAAMC,OAAO,GAAGA,CAAA,KAAe;EACpC,MAAM;IAAEC;EAAE,CAAC,GAAGH,cAAc,CAACC,SAAS,CAAC;EACvC,OAAOF,WAAW,CAAU,CAACK,GAAG,EAAEC,IAAI,GAAG,IAAI,KAAKF,CAAC,CAACC,GAAG,EAAEC,IAAI,IAAIC,SAAS,CAAW,EAAE,CAACH,CAAC,CAAC,CAAC;AAC7F,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["shared/translation/react-i18next.d.ts"],"mappings":";;AAAA,OAAO,SAAS;AAChB,OAAO,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"chat": {
|
|
3
|
+
"anotherHint": "Give me another hint",
|
|
4
|
+
"answerAgain": "Answer again to get another hint!",
|
|
5
|
+
"errorMessage": "Something went wrong! Try again",
|
|
6
|
+
"getHint": "Get a hint",
|
|
7
|
+
"giveHint": "I need a hint",
|
|
8
|
+
"giveHintOpenChat": "I need a hint",
|
|
9
|
+
"howCanIHelp": "Hi! Do you want help?",
|
|
10
|
+
"inputPlaceholder": "Type...",
|
|
11
|
+
"needHint": "I need a hint",
|
|
12
|
+
"showError": "Show error"
|
|
13
|
+
},
|
|
14
|
+
"exampleSolution": {
|
|
15
|
+
"aha": "Aha!",
|
|
16
|
+
"errorMessage": "Something went wrong with generating an example solution",
|
|
17
|
+
"exampleSolution": "Example solution",
|
|
18
|
+
"letMeThink": "Let me think..."
|
|
19
|
+
},
|
|
20
|
+
"gifCelebrations": {
|
|
21
|
+
"almostThere": "Almost there",
|
|
22
|
+
"greatStart": "Great start!",
|
|
23
|
+
"onTheWay": "On the way!"
|
|
24
|
+
},
|
|
25
|
+
"keyboard": {
|
|
26
|
+
"area": "Area",
|
|
27
|
+
"length": "Length",
|
|
28
|
+
"time": "Time",
|
|
29
|
+
"volume": "Volume",
|
|
30
|
+
"weight": "Weight"
|
|
31
|
+
},
|
|
32
|
+
"locale": "en-SE",
|
|
33
|
+
"teacherFeedback": {
|
|
34
|
+
"noComments": "No comments yet"
|
|
35
|
+
},
|
|
36
|
+
"time": {
|
|
37
|
+
"dayAgo": "day ago",
|
|
38
|
+
"daysAgo": "{{count}} days ago",
|
|
39
|
+
"hourAgo": "hour ago",
|
|
40
|
+
"hoursAgo": "{{count}} hours ago",
|
|
41
|
+
"justNow": "just now",
|
|
42
|
+
"minuteAgo": "minute ago",
|
|
43
|
+
"minutesAgo": "{{count}} minutes ago",
|
|
44
|
+
"monthAgo": "month ago",
|
|
45
|
+
"monthsAgo": "{{count}} months ago",
|
|
46
|
+
"yearAgo": "year ago",
|
|
47
|
+
"yearsAgo": "{{count}} years ago"
|
|
48
|
+
},
|
|
49
|
+
"voice": {
|
|
50
|
+
"attempt": "Attempt '{{'number'}}'",
|
|
51
|
+
"cancel": "Cancel",
|
|
52
|
+
"delete": "Delete",
|
|
53
|
+
"deleteRecording": "Delete recording?",
|
|
54
|
+
"noMicrophoneAccess": "No microphone access.",
|
|
55
|
+
"noMicrophoneAccessBySystem": "Microphone access denied by system settings.",
|
|
56
|
+
"noMicrophoneFound": "No microphone found.",
|
|
57
|
+
"recordingDeleted": "Recording successfully deleted.",
|
|
58
|
+
"redo": "Redo",
|
|
59
|
+
"redoRecording": "Redo recording?",
|
|
60
|
+
"thisWillRemoveRecording": "This will remove your previous recording.",
|
|
61
|
+
"transcriptions": "Transcriptions",
|
|
62
|
+
"transcriptNotAvailable": "Transcript not available",
|
|
63
|
+
"uploadFailed": "Upload failed. Please try again.",
|
|
64
|
+
"youWontBeAbleToRecover": "You won't be able to recover this file once it's gone."
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { DefaultMessagesCreator } from './DefaultMessageCreator';
|
|
2
2
|
import { ChatbotMessages } from '../types/model.types';
|
|
3
|
+
import { TranslationKeys } from '../../../shared/translation';
|
|
3
4
|
export declare class ChatBotTextManager {
|
|
4
5
|
private readonly messagesCreator;
|
|
5
6
|
readonly messages: ChatbotMessages;
|
|
6
7
|
private readonly defaultMessages;
|
|
7
|
-
update(cb: (manager: DefaultMessagesCreator<
|
|
8
|
+
update(cb: (manager: DefaultMessagesCreator<TranslationKeys>) => Partial<ChatbotMessages>): void;
|
|
8
9
|
restore(): void;
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=ChatBoxTextManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatBoxTextManager.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/ChatBoxTextManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"ChatBoxTextManager.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/ChatBoxTextManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAE7D,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAEN;IAE1B,SAAgB,QAAQ,EAAE,eAAe,CAQxC;IACD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAuB;IAEhD,MAAM,CACX,EAAE,EAAE,CAAC,OAAO,EAAE,sBAAsB,CAAC,eAAe,CAAC,KAAK,OAAO,CAAC,eAAe,CAAC;IAK7E,OAAO;CAGf"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { TFuncKey } from 'i18next';
|
|
2
|
+
import { NAMESPACE } from './constants';
|
|
3
|
+
export type TranslationKeys = TFuncKey<typeof NAMESPACE>;
|
|
2
4
|
export type GetText = (key: TranslationKeys, args?: Record<string, string> | null) => string;
|
|
3
5
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAA;AACxD,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,KAAK,MAAM,CAAA"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { DefaultMessagesCreator } from './DefaultMessageCreator';
|
|
2
2
|
import { ChatbotMessages } from '../types/model.types';
|
|
3
|
+
import { TranslationKeys } from '../../../shared/translation';
|
|
3
4
|
export declare class ChatBotTextManager {
|
|
4
5
|
private readonly messagesCreator;
|
|
5
6
|
readonly messages: ChatbotMessages;
|
|
6
7
|
private readonly defaultMessages;
|
|
7
|
-
update(cb: (manager: DefaultMessagesCreator<
|
|
8
|
+
update(cb: (manager: DefaultMessagesCreator<TranslationKeys>) => Partial<ChatbotMessages>): void;
|
|
8
9
|
restore(): void;
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=ChatBoxTextManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatBoxTextManager.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/ChatBoxTextManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"ChatBoxTextManager.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/ChatBoxTextManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAE7D,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAEN;IAE1B,SAAgB,QAAQ,EAAE,eAAe,CAQxC;IACD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAuB;IAEhD,MAAM,CACX,EAAE,EAAE,CAAC,OAAO,EAAE,sBAAsB,CAAC,eAAe,CAAC,KAAK,OAAO,CAAC,eAAe,CAAC;IAK7E,OAAO;CAGf"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { TFuncKey } from 'i18next';
|
|
2
|
+
import { NAMESPACE } from './constants';
|
|
3
|
+
export type TranslationKeys = TFuncKey<typeof NAMESPACE>;
|
|
2
4
|
export type GetText = (key: TranslationKeys, args?: Record<string, string> | null) => string;
|
|
3
5
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAA;AACxD,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,KAAK,MAAM,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magmamath/students-features",
|
|
3
|
-
"version": "1.3.3-rc.
|
|
3
|
+
"version": "1.3.3-rc.2",
|
|
4
4
|
"description": "Magmamath features library",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -21,31 +21,29 @@
|
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"@magmamath/frontend-config": "1.1.0",
|
|
23
23
|
"@magmamath/react-native-ui": "*",
|
|
24
|
-
"@react-native-masked-view/masked-view": "*",
|
|
25
24
|
"effector": "^23.2.3",
|
|
26
25
|
"effector-react": "^23.2.1",
|
|
27
|
-
"expo": ">=52.0.47",
|
|
28
|
-
"expo-audio": "^1.1.1",
|
|
29
|
-
"i18next": ">=22",
|
|
30
26
|
"patronum": "^2.3.0",
|
|
31
27
|
"react": "*",
|
|
32
|
-
"react-i18next": ">=11",
|
|
33
28
|
"react-native": "*",
|
|
34
29
|
"react-native-gesture-handler": "*",
|
|
35
|
-
"react-native-linear-gradient": "*",
|
|
36
30
|
"react-native-modalfy": "*",
|
|
37
31
|
"react-native-reanimated": ">=0.3.16",
|
|
38
|
-
"react-native-svg": "^15.10.0"
|
|
32
|
+
"react-native-svg": "^15.10.0",
|
|
33
|
+
"expo-audio": "^1.1.1",
|
|
34
|
+
"expo": ">=52.0.47",
|
|
35
|
+
"@react-native-masked-view/masked-view": "*",
|
|
36
|
+
"react-native-linear-gradient": "*",
|
|
37
|
+
"i18next": ">=22",
|
|
38
|
+
"react-i18next": ">=11"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@magmamath/frontend-config": "1.1.0",
|
|
42
41
|
"@magmamath/react-native-ui": "0.4.83",
|
|
43
|
-
"@
|
|
42
|
+
"@magmamath/frontend-config": "1.1.0",
|
|
44
43
|
"@react-native/eslint-config": "^0.73.1",
|
|
45
44
|
"@release-it/conventional-changelog": "^9.0.2",
|
|
46
45
|
"@types/jest": "^29.5.5",
|
|
47
46
|
"@types/react": "^18.2.44",
|
|
48
|
-
"axios": "^1.13.5",
|
|
49
47
|
"del-cli": "^5.1.0",
|
|
50
48
|
"effector": "^23.2.3",
|
|
51
49
|
"effector-react": "^23.2.1",
|
|
@@ -54,21 +52,23 @@
|
|
|
54
52
|
"eslint-plugin-prettier": "^5.0.1",
|
|
55
53
|
"expo": "^52.0.47",
|
|
56
54
|
"expo-audio": "^1.1.1",
|
|
57
|
-
"i18next": "^22.5.1",
|
|
58
55
|
"jest": "^29.7.0",
|
|
59
|
-
"patronum": "^2.3.0",
|
|
60
56
|
"prettier": "^3.0.3",
|
|
57
|
+
"patronum": "^2.3.0",
|
|
61
58
|
"react": "18.3.1",
|
|
62
|
-
"react-i18next": "^11.3.4",
|
|
63
59
|
"react-native": "0.76.3",
|
|
64
60
|
"react-native-builder-bob": "^0.33.3",
|
|
65
61
|
"react-native-gesture-handler": "^2.28.0",
|
|
66
|
-
"react-native-linear-gradient": "^2.8.3",
|
|
67
62
|
"react-native-modalfy": "^3.7.0",
|
|
68
63
|
"react-native-reanimated": "^3.17.2",
|
|
69
64
|
"react-native-svg": "^15.10.0",
|
|
70
65
|
"release-it": "^17.10.0",
|
|
71
|
-
"typescript": "^5.2.2"
|
|
66
|
+
"typescript": "^5.2.2",
|
|
67
|
+
"axios": "^1.13.5",
|
|
68
|
+
"@react-native-masked-view/masked-view": "^0.3.2",
|
|
69
|
+
"react-native-linear-gradient": "^2.8.3",
|
|
70
|
+
"i18next": "^22.5.1",
|
|
71
|
+
"react-i18next": "^11.3.4"
|
|
72
72
|
},
|
|
73
73
|
"resolutions": {
|
|
74
74
|
"@types/react": "^18.2.44"
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { DefaultMessagesCreator } from './DefaultMessageCreator'
|
|
2
2
|
import { getText } from '../../../shared/translation/helpers'
|
|
3
3
|
import { ChatbotMessages } from '../types/model.types'
|
|
4
|
+
import { TranslationKeys } from '../../../shared/translation'
|
|
4
5
|
|
|
5
6
|
export class ChatBotTextManager {
|
|
6
|
-
private readonly messagesCreator = new DefaultMessagesCreator<
|
|
7
|
+
private readonly messagesCreator = new DefaultMessagesCreator<TranslationKeys>({
|
|
7
8
|
textGetter: getText,
|
|
8
9
|
}).bindToLanguageChanged()
|
|
9
10
|
|
|
@@ -19,7 +20,7 @@ export class ChatBotTextManager {
|
|
|
19
20
|
private readonly defaultMessages = { ...this.messages }
|
|
20
21
|
|
|
21
22
|
public update(
|
|
22
|
-
cb: (manager: DefaultMessagesCreator<
|
|
23
|
+
cb: (manager: DefaultMessagesCreator<TranslationKeys>) => Partial<ChatbotMessages>,
|
|
23
24
|
) {
|
|
24
25
|
Object.assign(this.messages, cb(this.messagesCreator))
|
|
25
26
|
}
|
|
@@ -5,5 +5,5 @@ import { GetText } from './types'
|
|
|
5
5
|
|
|
6
6
|
export const useText = (): GetText => {
|
|
7
7
|
const { t } = useTranslation(NAMESPACE)
|
|
8
|
-
return useCallback<GetText>((key, args = null) => t(key, args ?? undefined), [t])
|
|
8
|
+
return useCallback<GetText>((key, args = null) => t(key, args ?? undefined) as string, [t])
|
|
9
9
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import 'i18next'
|
|
2
|
+
import 'react-i18next'
|
|
3
|
+
import schema from './schema.json'
|
|
4
|
+
|
|
5
|
+
declare module 'i18next' {
|
|
6
|
+
interface CustomTypeOptions {
|
|
7
|
+
defaultNS: 'students-features'
|
|
8
|
+
resources: {
|
|
9
|
+
['students-features']: typeof schema
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare module 'react-i18next' {
|
|
15
|
+
interface CustomTypeOptions {
|
|
16
|
+
defaultNS: 'students-features'
|
|
17
|
+
resources: {
|
|
18
|
+
['students-features']: typeof schema
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"chat": {
|
|
3
|
+
"anotherHint": "Give me another hint",
|
|
4
|
+
"answerAgain": "Answer again to get another hint!",
|
|
5
|
+
"errorMessage": "Something went wrong! Try again",
|
|
6
|
+
"getHint": "Get a hint",
|
|
7
|
+
"giveHint": "I need a hint",
|
|
8
|
+
"giveHintOpenChat": "I need a hint",
|
|
9
|
+
"howCanIHelp": "Hi! Do you want help?",
|
|
10
|
+
"inputPlaceholder": "Type...",
|
|
11
|
+
"needHint": "I need a hint",
|
|
12
|
+
"showError": "Show error"
|
|
13
|
+
},
|
|
14
|
+
"exampleSolution": {
|
|
15
|
+
"aha": "Aha!",
|
|
16
|
+
"errorMessage": "Something went wrong with generating an example solution",
|
|
17
|
+
"exampleSolution": "Example solution",
|
|
18
|
+
"letMeThink": "Let me think..."
|
|
19
|
+
},
|
|
20
|
+
"gifCelebrations": {
|
|
21
|
+
"almostThere": "Almost there",
|
|
22
|
+
"greatStart": "Great start!",
|
|
23
|
+
"onTheWay": "On the way!"
|
|
24
|
+
},
|
|
25
|
+
"keyboard": {
|
|
26
|
+
"area": "Area",
|
|
27
|
+
"length": "Length",
|
|
28
|
+
"time": "Time",
|
|
29
|
+
"volume": "Volume",
|
|
30
|
+
"weight": "Weight"
|
|
31
|
+
},
|
|
32
|
+
"locale": "en-SE",
|
|
33
|
+
"teacherFeedback": {
|
|
34
|
+
"noComments": "No comments yet"
|
|
35
|
+
},
|
|
36
|
+
"time": {
|
|
37
|
+
"dayAgo": "day ago",
|
|
38
|
+
"daysAgo": "{{count}} days ago",
|
|
39
|
+
"hourAgo": "hour ago",
|
|
40
|
+
"hoursAgo": "{{count}} hours ago",
|
|
41
|
+
"justNow": "just now",
|
|
42
|
+
"minuteAgo": "minute ago",
|
|
43
|
+
"minutesAgo": "{{count}} minutes ago",
|
|
44
|
+
"monthAgo": "month ago",
|
|
45
|
+
"monthsAgo": "{{count}} months ago",
|
|
46
|
+
"yearAgo": "year ago",
|
|
47
|
+
"yearsAgo": "{{count}} years ago"
|
|
48
|
+
},
|
|
49
|
+
"voice": {
|
|
50
|
+
"attempt": "Attempt '{{'number'}}'",
|
|
51
|
+
"cancel": "Cancel",
|
|
52
|
+
"delete": "Delete",
|
|
53
|
+
"deleteRecording": "Delete recording?",
|
|
54
|
+
"noMicrophoneAccess": "No microphone access.",
|
|
55
|
+
"noMicrophoneAccessBySystem": "Microphone access denied by system settings.",
|
|
56
|
+
"noMicrophoneFound": "No microphone found.",
|
|
57
|
+
"recordingDeleted": "Recording successfully deleted.",
|
|
58
|
+
"redo": "Redo",
|
|
59
|
+
"redoRecording": "Redo recording?",
|
|
60
|
+
"thisWillRemoveRecording": "This will remove your previous recording.",
|
|
61
|
+
"transcriptions": "Transcriptions",
|
|
62
|
+
"transcriptNotAvailable": "Transcript not available",
|
|
63
|
+
"uploadFailed": "Upload failed. Please try again.",
|
|
64
|
+
"youWontBeAbleToRecover": "You won't be able to recover this file once it's gone."
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { TFuncKey } from 'i18next'
|
|
2
|
+
import { NAMESPACE } from './constants'
|
|
3
|
+
|
|
4
|
+
export type TranslationKeys = TFuncKey<typeof NAMESPACE>
|
|
2
5
|
export type GetText = (key: TranslationKeys, args?: Record<string, string> | null) => string
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
package/src/locales/schema.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|