@magmamath/students-features 1.3.2 → 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/helpers.js +1 -5
- package/dist/commonjs/features/chatbot/helpers.js.map +1 -1
- package/dist/commonjs/features/chatbot/index.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatBotModel.js +6 -7
- package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js +1 -2
- package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js +4 -2
- package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
- package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js +2 -3
- package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -1
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js +4 -8
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -1
- package/dist/commonjs/index.js +23 -38
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/shared/translation/constants.js +2 -17
- package/dist/commonjs/shared/translation/constants.js.map +1 -1
- package/dist/commonjs/shared/translation/helpers.js +8 -38
- package/dist/commonjs/shared/translation/helpers.js.map +1 -1
- package/dist/commonjs/shared/translation/hooks.js +7 -15
- package/dist/commonjs/shared/translation/hooks.js.map +1 -1
- package/dist/commonjs/shared/translation/index.js +0 -25
- package/dist/commonjs/shared/translation/index.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/{localization/en.json → schema.json} +43 -38
- package/dist/module/features/chatbot/helpers.js +1 -5
- package/dist/module/features/chatbot/helpers.js.map +1 -1
- package/dist/module/features/chatbot/index.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatBotModel.js +6 -7
- package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatBoxTextManager.js +1 -2
- package/dist/module/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
- package/dist/module/features/chatbot/model/DefaultMessageCreator.js +3 -2
- package/dist/module/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
- package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js +3 -4
- package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -1
- package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js +5 -9
- package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -1
- package/dist/module/index.js +0 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/shared/translation/constants.js +1 -15
- package/dist/module/shared/translation/constants.js.map +1 -1
- package/dist/module/shared/translation/helpers.js +6 -33
- package/dist/module/shared/translation/helpers.js.map +1 -1
- package/dist/module/shared/translation/hooks.js +7 -14
- package/dist/module/shared/translation/hooks.js.map +1 -1
- package/dist/module/shared/translation/index.js +2 -3
- package/dist/module/shared/translation/index.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/{localization/en.json → schema.json} +43 -38
- package/dist/typescript/commonjs/features/chatbot/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/index.d.ts +1 -1
- package/dist/typescript/commonjs/features/chatbot/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts +1 -2
- package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +6 -8
- package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +1 -1
- package/dist/typescript/commonjs/index.d.ts +0 -1
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/lib/components/ConditionalWrapper.d.ts +1 -1
- package/dist/typescript/commonjs/shared/translation/constants.d.ts +1 -368
- package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/helpers.d.ts +1 -5
- package/dist/typescript/commonjs/shared/translation/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/hooks.d.ts +1 -3
- package/dist/typescript/commonjs/shared/translation/hooks.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/index.d.ts +3 -3
- package/dist/typescript/commonjs/shared/translation/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/types.d.ts +3 -4
- package/dist/typescript/commonjs/shared/translation/types.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/index.d.ts +1 -1
- package/dist/typescript/module/features/chatbot/index.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts +1 -2
- package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/api.types.d.ts +6 -8
- package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +1 -1
- package/dist/typescript/module/index.d.ts +0 -1
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/dist/typescript/module/lib/components/ConditionalWrapper.d.ts +1 -1
- package/dist/typescript/module/shared/translation/constants.d.ts +1 -368
- package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/helpers.d.ts +1 -5
- package/dist/typescript/module/shared/translation/helpers.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/hooks.d.ts +1 -3
- package/dist/typescript/module/shared/translation/hooks.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/index.d.ts +3 -3
- package/dist/typescript/module/shared/translation/index.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/types.d.ts +3 -4
- package/dist/typescript/module/shared/translation/types.d.ts.map +1 -1
- package/package.json +9 -4
- package/src/features/chatbot/helpers.ts +0 -2
- package/src/features/chatbot/index.ts +1 -9
- package/src/features/chatbot/model/ChatBotModel.ts +10 -7
- package/src/features/chatbot/model/ChatBoxTextManager.ts +2 -3
- package/src/features/chatbot/model/DefaultMessageCreator.ts +3 -3
- package/src/features/chatbot/types/api.types.ts +6 -11
- package/src/features/exampleSolution/components/ExampleSolutionModalContent.tsx +3 -4
- package/src/features/exampleSolution/model/ExampleSolutionApi.ts +5 -9
- package/src/index.ts +0 -1
- package/src/shared/translation/constants.ts +1 -16
- package/src/shared/translation/helpers.ts +5 -45
- package/src/shared/translation/hooks.ts +6 -22
- package/src/shared/translation/index.ts +3 -3
- package/src/shared/translation/react-i18next.d.ts +21 -0
- package/src/shared/translation/{localization/en.json → schema.json} +43 -38
- package/src/shared/translation/types.ts +3 -19
- package/dist/commonjs/lib/types/keys.js +0 -2
- package/dist/commonjs/lib/types/keys.js.map +0 -1
- package/dist/commonjs/shared/translation/localization/ca.json +0 -61
- package/dist/commonjs/shared/translation/localization/de.json +0 -61
- package/dist/commonjs/shared/translation/localization/gb.json +0 -61
- package/dist/commonjs/shared/translation/localization/sct.json +0 -61
- package/dist/commonjs/shared/translation/localization/sw.json +0 -61
- package/dist/commonjs/shared/translation/model.js +0 -15
- package/dist/commonjs/shared/translation/model.js.map +0 -1
- package/dist/commonjs/shared/translation/validation.types.js +0 -6
- package/dist/commonjs/shared/translation/validation.types.js.map +0 -1
- package/dist/module/lib/types/keys.js +0 -2
- package/dist/module/lib/types/keys.js.map +0 -1
- package/dist/module/shared/translation/localization/ca.json +0 -61
- package/dist/module/shared/translation/localization/de.json +0 -61
- package/dist/module/shared/translation/localization/gb.json +0 -61
- package/dist/module/shared/translation/localization/sct.json +0 -61
- package/dist/module/shared/translation/localization/sw.json +0 -61
- package/dist/module/shared/translation/model.js +0 -11
- package/dist/module/shared/translation/model.js.map +0 -1
- package/dist/module/shared/translation/validation.types.js +0 -4
- package/dist/module/shared/translation/validation.types.js.map +0 -1
- package/dist/typescript/commonjs/lib/types/keys.d.ts +0 -8
- package/dist/typescript/commonjs/lib/types/keys.d.ts.map +0 -1
- package/dist/typescript/commonjs/shared/translation/model.d.ts +0 -125
- package/dist/typescript/commonjs/shared/translation/model.d.ts.map +0 -1
- package/dist/typescript/commonjs/shared/translation/validation.types.d.ts +0 -21
- package/dist/typescript/commonjs/shared/translation/validation.types.d.ts.map +0 -1
- package/dist/typescript/module/lib/types/keys.d.ts +0 -8
- package/dist/typescript/module/lib/types/keys.d.ts.map +0 -1
- package/dist/typescript/module/shared/translation/model.d.ts +0 -125
- package/dist/typescript/module/shared/translation/model.d.ts.map +0 -1
- package/dist/typescript/module/shared/translation/validation.types.d.ts +0 -21
- package/dist/typescript/module/shared/translation/validation.types.d.ts.map +0 -1
- package/src/lib/types/keys.ts +0 -18
- package/src/shared/translation/localization/ca.json +0 -61
- package/src/shared/translation/localization/de.json +0 -61
- package/src/shared/translation/localization/gb.json +0 -61
- package/src/shared/translation/localization/sct.json +0 -61
- package/src/shared/translation/localization/sw.json +0 -61
- package/src/shared/translation/model.ts +0 -16
- package/src/shared/translation/validation.types.ts +0 -34
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { createEvent, createStore } from 'effector'
|
|
2
|
-
import { Translations } from './types'
|
|
3
|
-
import { LOCALIZATION_CONFIGS } from './constants'
|
|
4
|
-
import { Locale } from '@magmamath/frontend-config'
|
|
5
|
-
|
|
6
|
-
export const setLocalization = createEvent<
|
|
7
|
-
Translations | ((config: typeof LOCALIZATION_CONFIGS) => Translations)
|
|
8
|
-
>()
|
|
9
|
-
|
|
10
|
-
export const $localization = createStore<Translations>(LOCALIZATION_CONFIGS[Locale.US]).on(
|
|
11
|
-
setLocalization,
|
|
12
|
-
(state, payload) => {
|
|
13
|
-
if (typeof payload === 'function') return payload(LOCALIZATION_CONFIGS)
|
|
14
|
-
return payload
|
|
15
|
-
},
|
|
16
|
-
)
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import enTranslations from './localization/en.json'
|
|
2
|
-
import swTranslations from './localization/sw.json'
|
|
3
|
-
import gbTranslations from './localization/gb.json'
|
|
4
|
-
import caTranslations from './localization/ca.json'
|
|
5
|
-
import sctTranslations from './localization/sct.json'
|
|
6
|
-
|
|
7
|
-
type Extends<T, U> = T extends U ? true : false
|
|
8
|
-
|
|
9
|
-
type ExtendsAll<Candidate, Types extends unknown[]> = Types extends [infer Head, ...infer Tail]
|
|
10
|
-
? Extends<Candidate, Head> extends true
|
|
11
|
-
? ExtendsAll<Candidate, Tail>
|
|
12
|
-
: false
|
|
13
|
-
: true
|
|
14
|
-
|
|
15
|
-
type FindDominantType<Types extends unknown[]> = Types extends [
|
|
16
|
-
infer First,
|
|
17
|
-
...infer Rest extends unknown[],
|
|
18
|
-
]
|
|
19
|
-
? ExtendsAll<First, Rest> extends true
|
|
20
|
-
? First
|
|
21
|
-
: FindDominantType<Rest>
|
|
22
|
-
: never
|
|
23
|
-
|
|
24
|
-
type DominantTranslation = FindDominantType<
|
|
25
|
-
[
|
|
26
|
-
typeof enTranslations,
|
|
27
|
-
typeof swTranslations,
|
|
28
|
-
typeof gbTranslations,
|
|
29
|
-
typeof caTranslations,
|
|
30
|
-
typeof sctTranslations,
|
|
31
|
-
]
|
|
32
|
-
>
|
|
33
|
-
|
|
34
|
-
export type ISValidTranslation<T extends DominantTranslation> = T
|