@sparted/shared-library 1.1.0-rc5 → 1.1.0-rc7

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.
@@ -1,4 +1,4 @@
1
- import { MultilingualLabel } from './multilingual';
1
+ import { LanguageCode, MultilingualLabel } from './multilingual';
2
2
  import { Image, Media } from './media';
3
3
  import { Thematic } from './thematic';
4
4
  export type ErrorText = {
@@ -90,4 +90,20 @@ export type BaseContent = {
90
90
  coverImage?: Image;
91
91
  status: string;
92
92
  };
93
- export type Content = BaseContent & (ErrorText | MultipleChoiceQuestion | NoInteraction | OpenQuestion | OrderingCards | PictureSpot | SwipingCards);
93
+ export type ContentStatuses = Partial<{
94
+ [languageCode in LanguageCode]: 'draft' | 'validated' | 'waiting-translation' | 'waiting-validation';
95
+ }>;
96
+ export type Content = {
97
+ archived: boolean;
98
+ id: number;
99
+ metadata: {
100
+ coverImage: Image;
101
+ identifier?: string;
102
+ name: MultilingualLabel;
103
+ thematic: Thematic;
104
+ explanation?: string;
105
+ knowMore?: string;
106
+ };
107
+ statuses: ContentStatuses;
108
+ game?: Game;
109
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"content.js","sources":["../../../src/business/types/content.ts"],"sourcesContent":["import { MultilingualLabel } from './multilingual';\nimport { Image, Media } from './media';\nimport { Thematic } from './thematic';\n\nexport type ErrorText = {\n type: 'error-text';\n gameMedia?: Media;\n explanationMedia?: Media;\n explanation?: MultilingualLabel;\n wrongText?: MultilingualLabel;\n correctText?: MultilingualLabel;\n};\n\nexport type MultipleChoiceQuestion = {\n type: 'mcq';\n gameMedia?: Media;\n question?: MultilingualLabel;\n explanation?: MultilingualLabel;\n explanationMedia?: Media;\n multiselect?: boolean;\n choices?: {\n correct: boolean;\n text: MultilingualLabel;\n }[];\n};\n\nexport type NoInteraction = {\n type: 'no-interaction';\n firstMedia?: Media;\n secondMedia?: Media;\n title?: MultilingualLabel;\n text?: MultilingualLabel;\n};\n\nexport type OpenQuestion = {\n type: 'open-question';\n gameMedia?: Media;\n question?: MultilingualLabel;\n answer?: MultilingualLabel;\n explanation?: MultilingualLabel;\n explanationMedia?: Media;\n levenshteinDistance?: number;\n};\n\nexport type OrderingCards = {\n type: 'ordering-cards';\n explanation?: MultilingualLabel;\n question?: MultilingualLabel;\n topLabel?: MultilingualLabel;\n bottomLabel?: MultilingualLabel;\n cards: MultilingualLabel[];\n};\n\nexport type PictureSpot = {\n type: 'picture-spot';\n image?: Image;\n explanation?: MultilingualLabel;\n items?: {\n x: number;\n y: number;\n r: number;\n question: MultilingualLabel;\n description: MultilingualLabel;\n }[];\n};\n\nexport type SwipingCards = {\n type: 'swiping-cards';\n explanation?: MultilingualLabel;\n question?: MultilingualLabel;\n zones?: {\n position: 'left' | 'right' | 'top' | 'bottom';\n text: MultilingualLabel;\n }[];\n cards?: {\n image?: Image;\n text?: MultilingualLabel;\n answer: 'left' | 'right' | 'top' | 'bottom';\n }[];\n};\n\nexport type Game =\n | ErrorText\n | MultipleChoiceQuestion\n | NoInteraction\n | OpenQuestion\n | OrderingCards\n | PictureSpot\n | SwipingCards;\n\nexport type GameType =\n | 'error-text'\n | 'mcq'\n | 'open-question'\n | 'no-interaction'\n | 'picture-spot'\n | 'swiping-cards'\n | 'ordering-cards';\n\nexport const GAME_TYPE = {\n MCQ: 'mcq',\n ERROR_TEXT: 'error-text',\n OPEN_QUESTION: 'open-question',\n NO_INTERACTION: 'no-interaction',\n PICTURE_SPOT: 'picture-spot',\n ORDERING_CARDS: 'ordering-cards',\n SWIPING_CARDS: 'swiping-cards',\n} as const;\n\nexport type BaseContent = {\n id: number;\n identifier: string;\n name: MultilingualLabel;\n thematic: Thematic;\n coverImage?: Image;\n status: string;\n};\n\nexport type Content = BaseContent &\n (ErrorText | MultipleChoiceQuestion | NoInteraction | OpenQuestion | OrderingCards | PictureSpot | SwipingCards);\n"],"names":[],"mappings":";;;;AAmGa,MAAA,SAAS,GAAG;AACvB,IAAA,GAAG,EAAE,KAAK;AACV,IAAA,UAAU,EAAE,YAAY;AACxB,IAAA,aAAa,EAAE,eAAe;AAC9B,IAAA,cAAc,EAAE,gBAAgB;AAChC,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,cAAc,EAAE,gBAAgB;AAChC,IAAA,aAAa,EAAE,eAAe;;;;;"}
1
+ {"version":3,"file":"content.js","sources":["../../../src/business/types/content.ts"],"sourcesContent":["import { LanguageCode, MultilingualLabel } from './multilingual';\nimport { Image, Media } from './media';\nimport { Thematic } from './thematic';\n\nexport type ErrorText = {\n type: 'error-text';\n gameMedia?: Media;\n explanationMedia?: Media;\n explanation?: MultilingualLabel;\n wrongText?: MultilingualLabel;\n correctText?: MultilingualLabel;\n};\n\nexport type MultipleChoiceQuestion = {\n type: 'mcq';\n gameMedia?: Media;\n question?: MultilingualLabel;\n explanation?: MultilingualLabel;\n explanationMedia?: Media;\n multiselect?: boolean;\n choices?: {\n correct: boolean;\n text: MultilingualLabel;\n }[];\n};\n\nexport type NoInteraction = {\n type: 'no-interaction';\n firstMedia?: Media;\n secondMedia?: Media;\n title?: MultilingualLabel;\n text?: MultilingualLabel;\n};\n\nexport type OpenQuestion = {\n type: 'open-question';\n gameMedia?: Media;\n question?: MultilingualLabel;\n answer?: MultilingualLabel;\n explanation?: MultilingualLabel;\n explanationMedia?: Media;\n levenshteinDistance?: number;\n};\n\nexport type OrderingCards = {\n type: 'ordering-cards';\n explanation?: MultilingualLabel;\n question?: MultilingualLabel;\n topLabel?: MultilingualLabel;\n bottomLabel?: MultilingualLabel;\n cards: MultilingualLabel[];\n};\n\nexport type PictureSpot = {\n type: 'picture-spot';\n image?: Image;\n explanation?: MultilingualLabel;\n items?: {\n x: number;\n y: number;\n r: number;\n question: MultilingualLabel;\n description: MultilingualLabel;\n }[];\n};\n\nexport type SwipingCards = {\n type: 'swiping-cards';\n explanation?: MultilingualLabel;\n question?: MultilingualLabel;\n zones?: {\n position: 'left' | 'right' | 'top' | 'bottom';\n text: MultilingualLabel;\n }[];\n cards?: {\n image?: Image;\n text?: MultilingualLabel;\n answer: 'left' | 'right' | 'top' | 'bottom';\n }[];\n};\n\nexport type Game =\n | ErrorText\n | MultipleChoiceQuestion\n | NoInteraction\n | OpenQuestion\n | OrderingCards\n | PictureSpot\n | SwipingCards;\n\nexport type GameType =\n | 'error-text'\n | 'mcq'\n | 'open-question'\n | 'no-interaction'\n | 'picture-spot'\n | 'swiping-cards'\n | 'ordering-cards';\n\nexport const GAME_TYPE = {\n MCQ: 'mcq',\n ERROR_TEXT: 'error-text',\n OPEN_QUESTION: 'open-question',\n NO_INTERACTION: 'no-interaction',\n PICTURE_SPOT: 'picture-spot',\n ORDERING_CARDS: 'ordering-cards',\n SWIPING_CARDS: 'swiping-cards',\n} as const;\n\nexport type BaseContent = {\n id: number;\n identifier: string;\n name: MultilingualLabel;\n thematic: Thematic;\n coverImage?: Image;\n status: string;\n};\n\nexport type ContentStatuses = Partial<{\n [languageCode in LanguageCode]: 'draft' | 'validated' | 'waiting-translation' | 'waiting-validation';\n}>;\n\nexport type Content = {\n archived: boolean;\n id: number;\n metadata: {\n coverImage: Image;\n identifier?: string;\n name: MultilingualLabel;\n thematic: Thematic;\n explanation?: string;\n knowMore?: string;\n };\n statuses: ContentStatuses;\n game?: Game;\n};\n"],"names":[],"mappings":";;;;AAmGa,MAAA,SAAS,GAAG;AACvB,IAAA,GAAG,EAAE,KAAK;AACV,IAAA,UAAU,EAAE,YAAY;AACxB,IAAA,aAAa,EAAE,eAAe;AAC9B,IAAA,cAAc,EAAE,gBAAgB;AAChC,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,cAAc,EAAE,gBAAgB;AAChC,IAAA,aAAa,EAAE,eAAe;;;;;"}
@@ -3,8 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var content = require('./content.js');
6
+ var multilingual = require('./multilingual.js');
6
7
 
7
8
 
8
9
 
9
10
  exports.GAME_TYPE = content.GAME_TYPE;
11
+ exports.Languages = multilingual.Languages;
10
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -1,3 +1,40 @@
1
+ export declare const Languages: {
2
+ 'en-US': string;
3
+ 'fr-FR': string;
4
+ 'es-ES': string;
5
+ 'it-IT': string;
6
+ 'de-DE': string;
7
+ 'ru-RU': string;
8
+ 'nl-NL': string;
9
+ 'pt-BR': string;
10
+ 'zh-CN': string;
11
+ 'he-IL': string;
12
+ 'cs-CZ': string;
13
+ 'ko-KR': string;
14
+ 'ja-JP': string;
15
+ 'zh-TW': string;
16
+ 'bg-BG': string;
17
+ 'hr-HR': string;
18
+ 'da-DK': string;
19
+ 'fi-FI': string;
20
+ 'el-GR': string;
21
+ 'hu-HU': string;
22
+ 'nb-NO': string;
23
+ 'pl-PL': string;
24
+ 'pt-PT': string;
25
+ 'ro-RO': string;
26
+ 'sv-SE': string;
27
+ 'tr-TR': string;
28
+ sk: string;
29
+ sl: string;
30
+ 'et-EE': string;
31
+ 'id-ID': string;
32
+ ar: string;
33
+ lt: string;
34
+ 'lv-LV': string;
35
+ 'th-TH': string;
36
+ };
37
+ export type LanguageCode = keyof typeof Languages;
1
38
  export type MultilingualLabel = {
2
- [languageCode: string]: string;
39
+ [languageCode in LanguageCode]: string;
3
40
  };
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const Languages = {
6
+ 'en-US': 'us',
7
+ 'fr-FR': 'fr',
8
+ 'es-ES': 'es',
9
+ 'it-IT': 'it',
10
+ 'de-DE': 'de',
11
+ 'ru-RU': 'ru',
12
+ 'nl-NL': 'nl',
13
+ 'pt-BR': 'br',
14
+ 'zh-CN': 'cn',
15
+ 'he-IL': 'il',
16
+ 'cs-CZ': 'cz',
17
+ 'ko-KR': 'kr',
18
+ 'ja-JP': 'jp',
19
+ 'zh-TW': 'tw',
20
+ 'bg-BG': 'bg',
21
+ 'hr-HR': 'hr',
22
+ 'da-DK': 'dk',
23
+ 'fi-FI': 'fi',
24
+ 'el-GR': 'gr',
25
+ 'hu-HU': 'hu',
26
+ 'nb-NO': 'no',
27
+ 'pl-PL': 'pl',
28
+ 'pt-PT': 'pt',
29
+ 'ro-RO': 'ro',
30
+ 'sv-SE': 'se',
31
+ 'tr-TR': 'tr',
32
+ sk: 'sk',
33
+ sl: 'sl',
34
+ 'et-EE': 'ee',
35
+ 'id-ID': 'id',
36
+ ar: 'ar',
37
+ lt: 'lt',
38
+ 'lv-LV': 'lv',
39
+ 'th-TH': 'th',
40
+ };
41
+
42
+ exports.Languages = Languages;
43
+ //# sourceMappingURL=multilingual.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multilingual.js","sources":["../../../src/business/types/multilingual.ts"],"sourcesContent":["export const Languages = {\n 'en-US': 'us',\n 'fr-FR': 'fr',\n 'es-ES': 'es',\n 'it-IT': 'it',\n 'de-DE': 'de',\n 'ru-RU': 'ru',\n 'nl-NL': 'nl',\n 'pt-BR': 'br',\n 'zh-CN': 'cn',\n 'he-IL': 'il',\n 'cs-CZ': 'cz',\n 'ko-KR': 'kr',\n 'ja-JP': 'jp',\n 'zh-TW': 'tw',\n 'bg-BG': 'bg',\n 'hr-HR': 'hr',\n 'da-DK': 'dk',\n 'fi-FI': 'fi',\n 'el-GR': 'gr',\n 'hu-HU': 'hu',\n 'nb-NO': 'no',\n 'pl-PL': 'pl',\n 'pt-PT': 'pt',\n 'ro-RO': 'ro',\n 'sv-SE': 'se',\n 'tr-TR': 'tr',\n sk: 'sk',\n sl: 'sl',\n 'et-EE': 'ee',\n 'id-ID': 'id',\n ar: 'ar',\n lt: 'lt',\n 'lv-LV': 'lv',\n 'th-TH': 'th',\n};\n\nexport type LanguageCode = keyof typeof Languages;\n\nexport type MultilingualLabel = {\n [languageCode in LanguageCode]: string;\n};\n"],"names":[],"mappings":";;;;AAAa,MAAA,SAAS,GAAG;AACvB,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,EAAE,EAAE,IAAI;AACR,IAAA,EAAE,EAAE,IAAI;AACR,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,EAAE,EAAE,IAAI;AACR,IAAA,EAAE,EAAE,IAAI;AACR,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparted/shared-library",
3
- "version": "1.1.0-rc5",
3
+ "version": "1.1.0-rc7",
4
4
  "repository": "git@github.com:Sparted/shared-library.git",
5
5
  "author": {
6
6
  "name": "Sparted",
@@ -8,8 +8,8 @@
8
8
  "url": "https://www.sparted.com"
9
9
  },
10
10
  "license": "MIT",
11
- "sideEffets": false,
12
- "main": "cjs/index.js",
11
+ "module": "index.js",
12
+ "main": "index.js",
13
13
  "files": [
14
14
  "**/*",
15
15
  "**/**"