@sparted/shared-library 1.2.3-rc2 → 1.2.3-rc3
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.
|
@@ -13,7 +13,7 @@ export type ErrorText = {
|
|
|
13
13
|
export type MultipleChoiceQuestion = {
|
|
14
14
|
type: 'mcq';
|
|
15
15
|
gameMedia?: Media;
|
|
16
|
-
question
|
|
16
|
+
question: MultilingualLabel;
|
|
17
17
|
explanation?: MultilingualLabel;
|
|
18
18
|
explanationMedia?: Media;
|
|
19
19
|
multiselect?: boolean;
|
|
@@ -102,6 +102,7 @@ export declare const isGameSwipingCards: (game: Game) => game is SwipingCards;
|
|
|
102
102
|
export declare const isPartialGameMultipleChoiceQuestion: (game: DeepPartial<Game>) => game is {
|
|
103
103
|
type?: "mcq" | undefined;
|
|
104
104
|
gameMedia?: {
|
|
105
|
+
id?: number | undefined;
|
|
105
106
|
image?: {
|
|
106
107
|
id?: number | undefined;
|
|
107
108
|
url?: string | undefined;
|
|
@@ -188,6 +189,7 @@ export declare const isPartialGameMultipleChoiceQuestion: (game: DeepPartial<Gam
|
|
|
188
189
|
"th-TH"?: string | undefined;
|
|
189
190
|
} | undefined;
|
|
190
191
|
explanationMedia?: {
|
|
192
|
+
id?: number | undefined;
|
|
191
193
|
image?: {
|
|
192
194
|
id?: number | undefined;
|
|
193
195
|
url?: string | undefined;
|
|
@@ -245,6 +247,7 @@ export declare const isPartialGameMultipleChoiceQuestion: (game: DeepPartial<Gam
|
|
|
245
247
|
export declare const isPartialGameErrorText: (game: DeepPartial<Game>) => game is {
|
|
246
248
|
type?: "error-text" | undefined;
|
|
247
249
|
gameMedia?: {
|
|
250
|
+
id?: number | undefined;
|
|
248
251
|
image?: {
|
|
249
252
|
id?: number | undefined;
|
|
250
253
|
url?: string | undefined;
|
|
@@ -259,6 +262,7 @@ export declare const isPartialGameErrorText: (game: DeepPartial<Game>) => game i
|
|
|
259
262
|
} | undefined;
|
|
260
263
|
} | undefined;
|
|
261
264
|
explanationMedia?: {
|
|
265
|
+
id?: number | undefined;
|
|
262
266
|
image?: {
|
|
263
267
|
id?: number | undefined;
|
|
264
268
|
url?: string | undefined;
|
|
@@ -384,6 +388,7 @@ export declare const isPartialGameErrorText: (game: DeepPartial<Game>) => game i
|
|
|
384
388
|
export declare const isPartialGameOpenQuestion: (game: DeepPartial<Game>) => game is {
|
|
385
389
|
type?: "open-question" | undefined;
|
|
386
390
|
gameMedia?: {
|
|
391
|
+
id?: number | undefined;
|
|
387
392
|
image?: {
|
|
388
393
|
id?: number | undefined;
|
|
389
394
|
url?: string | undefined;
|
|
@@ -506,6 +511,7 @@ export declare const isPartialGameOpenQuestion: (game: DeepPartial<Game>) => gam
|
|
|
506
511
|
"th-TH"?: string | undefined;
|
|
507
512
|
} | undefined;
|
|
508
513
|
explanationMedia?: {
|
|
514
|
+
id?: number | undefined;
|
|
509
515
|
image?: {
|
|
510
516
|
id?: number | undefined;
|
|
511
517
|
url?: string | undefined;
|
|
@@ -524,6 +530,7 @@ export declare const isPartialGameOpenQuestion: (game: DeepPartial<Game>) => gam
|
|
|
524
530
|
export declare const isPartialGameNoInteraction: (game: DeepPartial<Game>) => game is {
|
|
525
531
|
type?: "no-interaction" | undefined;
|
|
526
532
|
firstMedia?: {
|
|
533
|
+
id?: number | undefined;
|
|
527
534
|
image?: {
|
|
528
535
|
id?: number | undefined;
|
|
529
536
|
url?: string | undefined;
|
|
@@ -538,6 +545,7 @@ export declare const isPartialGameNoInteraction: (game: DeepPartial<Game>) => ga
|
|
|
538
545
|
} | undefined;
|
|
539
546
|
} | undefined;
|
|
540
547
|
secondMedia?: {
|
|
548
|
+
id?: number | undefined;
|
|
541
549
|
image?: {
|
|
542
550
|
id?: number | undefined;
|
|
543
551
|
url?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sources":["../../../src/business/types/content.ts"],"sourcesContent":["import { DeepPartial } from 'ts-essentials';\n\nimport { 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
|
|
1
|
+
{"version":3,"file":"content.js","sources":["../../../src/business/types/content.ts"],"sourcesContent":["import { DeepPartial } from 'ts-essentials';\n\nimport { 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 SwipingCardPosition = 'left' | 'right' | 'top' | 'bottom';\n\nexport type SwipingCards = {\n type: 'swiping-cards';\n explanation?: MultilingualLabel;\n question?: MultilingualLabel;\n zones?: {\n position: SwipingCardPosition;\n text: MultilingualLabel;\n }[];\n cards?: {\n image?: Image;\n text?: MultilingualLabel;\n answer: SwipingCardPosition;\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: Record<string, GameType> = {\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};\n\nexport type ContentStatuses = Partial<{\n [languageCode in LanguageCode]: 'draft' | 'validated' | 'waiting-translation' | 'waiting-validation';\n}>;\n\nexport type ContentMetadata = {\n identifier: string;\n coverImage?: Image;\n name: MultilingualLabel;\n thematic: Thematic;\n};\n\nexport type Content = {\n archived: boolean;\n id: number;\n metadata: ContentMetadata;\n statuses: ContentStatuses;\n game?: Game;\n};\n\nexport const isGameMultipleChoiceQuestion = (game: Game): game is MultipleChoiceQuestion => game.type === GAME_TYPE.MCQ;\nexport const isGameErrorText = (game: Game): game is ErrorText => game.type === GAME_TYPE.ERROR_TEXT;\nexport const isGameOpenQuestion = (game: Game): game is OpenQuestion => game.type === GAME_TYPE.OPEN_QUESTION;\nexport const isGameNoInteraction = (game: Game): game is NoInteraction => game.type === GAME_TYPE.NO_INTERACTION;\nexport const isGamePictureSpot = (game: Game): game is PictureSpot => game.type === GAME_TYPE.PICTURE_SPOT;\nexport const isGameOrderingCards = (game: Game): game is OrderingCards => game.type === GAME_TYPE.ORDERING_CARDS;\nexport const isGameSwipingCards = (game: Game): game is SwipingCards => game.type === GAME_TYPE.SWIPING_CARDS;\n\nexport const isPartialGameMultipleChoiceQuestion = (\n game: DeepPartial<Game>,\n): game is DeepPartial<MultipleChoiceQuestion> => game.type === GAME_TYPE.MCQ;\nexport const isPartialGameErrorText = (game: DeepPartial<Game>): game is DeepPartial<ErrorText> =>\n game.type === GAME_TYPE.ERROR_TEXT;\nexport const isPartialGameOpenQuestion = (game: DeepPartial<Game>): game is DeepPartial<OpenQuestion> =>\n game.type === GAME_TYPE.OPEN_QUESTION;\nexport const isPartialGameNoInteraction = (game: DeepPartial<Game>): game is DeepPartial<NoInteraction> =>\n game.type === GAME_TYPE.NO_INTERACTION;\nexport const isPartialGamePictureSpot = (game: DeepPartial<Game>): game is DeepPartial<PictureSpot> =>\n game.type === GAME_TYPE.PICTURE_SPOT;\nexport const isPartialGameOrderingCards = (game: DeepPartial<Game>): game is DeepPartial<OrderingCards> =>\n game.type === GAME_TYPE.ORDERING_CARDS;\nexport const isPartialGameSwipingCards = (game: DeepPartial<Game>): game is DeepPartial<SwipingCards> =>\n game.type === GAME_TYPE.SWIPING_CARDS;\n"],"names":[],"mappings":";;;;AAuGa,MAAA,SAAS,GAA6B;AACjD,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;EAC9B;AAqBW,MAAA,4BAA4B,GAAG,CAAC,IAAU,KAAqC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI;AAC3G,MAAA,eAAe,GAAG,CAAC,IAAU,KAAwB,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,WAAW;AACxF,MAAA,kBAAkB,GAAG,CAAC,IAAU,KAA2B,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,cAAc;AACjG,MAAA,mBAAmB,GAAG,CA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