cognikit 1.0.2 → 1.1.0
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/builders/classification/index.d.ts +24 -0
- package/dist/builders/fill-blanks/index.d.ts +48 -0
- package/dist/client.js +2574 -2666
- package/dist/client.js.map +4 -4
- package/dist/core/builders/index.d.ts +48 -0
- package/dist/core/index.d.ts +2 -1
- package/dist/core/{BaseInteraction.d.ts → interactions/index.d.ts} +11 -12
- package/dist/engines/index.d.ts +0 -1
- package/dist/engines/tables/index.d.ts +40 -2
- package/dist/engines/tables/{implementation/utils.d.ts → utils.d.ts} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2570 -2662
- package/dist/index.js.map +4 -4
- package/dist/interactions/adjacency-table/index.d.ts +6 -7
- package/dist/interactions/classification-matrix/index.d.ts +7 -6
- package/dist/interactions/fill-blanks/index.d.ts +36 -2
- package/dist/interactions/index.d.ts +0 -2
- package/dist/interactions/list-recall/index.d.ts +27 -1
- package/dist/interactions/lookup-table/index.d.ts +6 -7
- package/dist/interactions/mark-the-words/index.d.ts +34 -2
- package/dist/interactions/mcq-mrq/index.d.ts +37 -2
- package/dist/interactions/nary-choice-table/index.d.ts +7 -13
- package/dist/interactions/open-classification/index.d.ts +9 -6
- package/dist/interactions/rank-order/index.d.ts +49 -2
- package/dist/interactions/registry.d.ts +5 -5
- package/dist/interactions/sequential-classification/index.d.ts +8 -6
- package/dist/interactions/simultaneous-association/index.d.ts +7 -12
- package/dist/{shared/managers → managers}/AnimationsManager.d.ts +6 -1
- package/dist/managers/DragAndDropManager.d.ts +37 -0
- package/dist/{core/utilities/ProgressTracker.d.ts → managers/ProgressManager.d.ts} +8 -8
- package/dist/managers/ScoringManager.d.ts +73 -0
- package/dist/managers/index.d.ts +4 -0
- package/dist/shared/config.d.ts +1 -1
- package/dist/shared/index.d.ts +0 -2
- package/dist/shared/utils.d.ts +2 -1
- package/dist/shell/builders/index.d.ts +29 -0
- package/dist/shell/index.d.ts +2 -1
- package/dist/shell/{simple-shell/script.d.ts → interactions/index.d.ts} +8 -7
- package/dist/types/Builders.d.ts +17 -0
- package/dist/types/Data.d.ts +49 -9
- package/dist/types/Global.d.ts +2 -23
- package/dist/types/Grading.d.ts +2 -0
- package/dist/types/Input.d.ts +12 -16
- package/dist/types/Interactions.d.ts +10 -14
- package/dist/types/Tables.d.ts +2 -2
- package/dist/ui/{misc/block.d.ts → block/index.d.ts} +1 -1
- package/dist/ui/{misc/chip/chip.d.ts → chip/index.d.ts} +8 -4
- package/dist/ui/{misc/dialog.d.ts → dialog/index.d.ts} +0 -1
- package/dist/ui/index.d.ts +4 -1
- package/dist/ui/input/index.d.ts +22 -1
- package/dist/ui/{misc/media.d.ts → media/index.d.ts} +1 -1
- package/package.json +1 -1
- package/public/app.js +5874 -8649
- package/public/app.js.map +4 -4
- package/public/assets/images/landscape.jpg +0 -0
- package/public/assets/images/mountains.jpg +0 -0
- package/public/builders.html +87 -0
- package/public/examples/data.ts +167 -0
- package/public/index.html +1008 -779
- package/dist/core/utilities/index.d.ts +0 -1
- package/dist/engines/tables/implementation/graders.d.ts +0 -23
- package/dist/engines/tables/implementation/index.d.ts +0 -4
- package/dist/engines/tables/implementation/parsers.d.ts +0 -36
- package/dist/engines/tables/implementation/validators.d.ts +0 -9
- package/dist/engines/tables/script.d.ts +0 -37
- package/dist/engines/text/implementation/graders.d.ts +0 -69
- package/dist/engines/text/implementation/index.d.ts +0 -3
- package/dist/engines/text/implementation/parsers.d.ts +0 -9
- package/dist/engines/text/implementation/validators.d.ts +0 -41
- package/dist/engines/text/index.d.ts +0 -2
- package/dist/engines/text/script.d.ts +0 -56
- package/dist/interactions/categorize-the-words/index.d.ts +0 -2
- package/dist/interactions/categorize-the-words/sequential.d.ts +0 -33
- package/dist/interactions/categorize-the-words/static.d.ts +0 -22
- package/dist/interactions/fill-blanks/sequential.d.ts +0 -32
- package/dist/interactions/fill-blanks/static.d.ts +0 -23
- package/dist/interactions/list-recall/script.d.ts +0 -25
- package/dist/interactions/mark-the-words/sequential.d.ts +0 -34
- package/dist/interactions/mark-the-words/static.d.ts +0 -40
- package/dist/interactions/mcq-mrq/implementation/grader.d.ts +0 -20
- package/dist/interactions/mcq-mrq/implementation/index.d.ts +0 -3
- package/dist/interactions/mcq-mrq/implementation/parser.d.ts +0 -21
- package/dist/interactions/mcq-mrq/implementation/validator.d.ts +0 -17
- package/dist/interactions/mcq-mrq/script.d.ts +0 -37
- package/dist/interactions/rank-order/implementation/grader.d.ts +0 -15
- package/dist/interactions/rank-order/implementation/index.d.ts +0 -3
- package/dist/interactions/rank-order/implementation/parser.d.ts +0 -25
- package/dist/interactions/rank-order/implementation/validator.d.ts +0 -3
- package/dist/interactions/rank-order/script.d.ts +0 -39
- package/dist/interactions/shared/association-implementation/grader.d.ts +0 -3
- package/dist/interactions/shared/association-implementation/index.d.ts +0 -1
- package/dist/interactions/shared/association-implementation/validator.d.ts +0 -0
- package/dist/interactions/shared/classification-implementation/grader.d.ts +0 -3
- package/dist/interactions/shared/classification-implementation/index.d.ts +0 -1
- package/dist/interactions/shared/classification-implementation/parser.d.ts +0 -11
- package/dist/interactions/shared/classification-implementation/validator.d.ts +0 -3
- package/dist/interactions/text-transformation/index.d.ts +0 -2
- package/dist/interactions/text-transformation/sequential.d.ts +0 -37
- package/dist/interactions/text-transformation/static.d.ts +0 -47
- package/dist/shared/dsl.d.ts +0 -9
- package/dist/shared/managers/index.d.ts +0 -3
- package/dist/shared/types.d.ts +0 -25
- package/dist/shell/simple-shell/index.d.ts +0 -1
- package/dist/types/Text.d.ts +0 -125
- package/dist/ui/input/input/index.d.ts +0 -1
- package/dist/ui/input/input/input.d.ts +0 -22
- package/dist/ui/misc/chip/index.d.ts +0 -1
- package/dist/ui/misc/index.d.ts +0 -4
- package/public/assets/images/pointing-hand.svg +0 -1
- package/public/examples/chip.html +0 -495
- package/public/scalable-bare.html +0 -432
- package/public/tables-demo.html +0 -534
- package/public/text-interactions-demo.html +0 -604
- /package/dist/{interactions/list-recall/implementation → builders/list}/index.d.ts +0 -0
- /package/dist/{core/utilities/ScoringTracker.d.ts → builders/matching/inde.d.ts} +0 -0
- /package/dist/{ui/input/color → builders/ordering}/index.d.ts +0 -0
- /package/dist/{ui/input/letter → builders/tables}/index.d.ts +0 -0
- /package/dist/{interactions/list-recall/implementation/grader.d.ts → builders/text/index.d.ts} +0 -0
- /package/dist/interactions/{list-recall/implementation/parser.d.ts → exp/CategorizeTheWords.d.ts} +0 -0
- /package/dist/interactions/{list-recall/implementation/validator.d.ts → exp/DndFillBlanks.d.ts} +0 -0
- /package/dist/interactions/{shared/association-implementation/parser.d.ts → exp/TextTransformation.d.ts} +0 -0
- /package/dist/{shared/managers → managers}/SoundManager.d.ts +0 -0
- /package/dist/ui/{input/color/color-picker.d.ts → exp/color/index.d.ts} +0 -0
- /package/dist/ui/{input/letter/letter-picker.d.ts → exp/letter/index.d.ts} +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { BuilderMode, ParsingResult, ValidationResult, ValidationIssue } from "@/types/Builders";
|
|
2
|
+
import { InteractionData } from "@/types/Data";
|
|
3
|
+
import { Variant } from "@/types/Global";
|
|
4
|
+
/**
|
|
5
|
+
* The BUILDER is NOT intended to work as a full application.
|
|
6
|
+
* It's primary purpose is to serve as a medium to do exactly that in an easier way.
|
|
7
|
+
*
|
|
8
|
+
* It manages state and the necessary methods to implement screen
|
|
9
|
+
* swithching and data submission.
|
|
10
|
+
*/
|
|
11
|
+
export declare abstract class BaseBuilder<T extends InteractionData> extends HTMLElement {
|
|
12
|
+
abstract readonly grammarExamples: string[];
|
|
13
|
+
syncBuildingModes: boolean;
|
|
14
|
+
initializationIssues: ValidationIssue[];
|
|
15
|
+
activeVariant: Variant;
|
|
16
|
+
private _mode;
|
|
17
|
+
private _initialized;
|
|
18
|
+
private _initialData;
|
|
19
|
+
protected _data: T;
|
|
20
|
+
private _grammarParserState;
|
|
21
|
+
private _$wrap;
|
|
22
|
+
protected _$manualFormContainer: HTMLDivElement;
|
|
23
|
+
private _$grammarParserEntry;
|
|
24
|
+
constructor(data?: T);
|
|
25
|
+
abstract initialize(): void;
|
|
26
|
+
abstract parse(grammar: string): ParsingResult<T>;
|
|
27
|
+
abstract validate(data: T): ValidationResult;
|
|
28
|
+
abstract toTxtGrammar(data: T): string;
|
|
29
|
+
protected abstract loadManualForm(data: T): void;
|
|
30
|
+
protected abstract build(): T | null;
|
|
31
|
+
connectedCallback(): void;
|
|
32
|
+
disconnectedCallback(): void;
|
|
33
|
+
protected showCurrentActiveScreen(): void;
|
|
34
|
+
private hydrateInitialData;
|
|
35
|
+
private collectCurrentData;
|
|
36
|
+
private syncModeState;
|
|
37
|
+
/**
|
|
38
|
+
* Easily implement tab-switching in shell
|
|
39
|
+
*/
|
|
40
|
+
get mode(): BuilderMode;
|
|
41
|
+
set mode(value: BuilderMode);
|
|
42
|
+
get variant(): Variant;
|
|
43
|
+
set variant(newVariant: Variant);
|
|
44
|
+
/**
|
|
45
|
+
* This will generate the data taken from whichever mode is active at the time.
|
|
46
|
+
*/
|
|
47
|
+
getData(): ParsingResult<T>;
|
|
48
|
+
}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { BaseInteraction } from "./
|
|
1
|
+
export { BaseInteraction } from "./interactions";
|
|
2
|
+
export { BaseBuilder } from "./builders";
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Variant } from "
|
|
3
|
-
import { Validator } from "
|
|
4
|
-
import { InteractionConfig, InteractionMechanic } from "
|
|
5
|
-
import { InteractionData } from "
|
|
6
|
-
import { NormalizedAssets } from "
|
|
7
|
-
import { AnimationsManager, SoundManager } from "../shared/managers";
|
|
1
|
+
import { ScoringManager, AnimationsManager, ProgressManager } from "@/managers";
|
|
2
|
+
import type { Variant } from "@/types/Global";
|
|
3
|
+
import type { Validator } from "@/types/Builders";
|
|
4
|
+
import type { InteractionConfig, InteractionMechanic } from "@/types/Interactions";
|
|
5
|
+
import type { InteractionData } from "@/types/Data";
|
|
6
|
+
import type { NormalizedAssets } from "@/types/Assets";
|
|
8
7
|
export type InteractionEventMap = {
|
|
9
8
|
'interaction:ready': CustomEvent<{
|
|
10
9
|
id: string;
|
|
@@ -36,11 +35,12 @@ export declare abstract class BaseInteraction<T extends InteractionData> extends
|
|
|
36
35
|
isValid: boolean;
|
|
37
36
|
implementsProgress: boolean;
|
|
38
37
|
protected data: T;
|
|
39
|
-
config: InteractionConfig;
|
|
40
38
|
protected assets: NormalizedAssets | null;
|
|
41
|
-
|
|
39
|
+
config: InteractionConfig;
|
|
40
|
+
scoringManager: ScoringManager;
|
|
41
|
+
progressManager: ProgressManager;
|
|
42
42
|
protected animationsManager: AnimationsManager;
|
|
43
|
-
|
|
43
|
+
currentLives: number;
|
|
44
44
|
private _initialized;
|
|
45
45
|
errors: string;
|
|
46
46
|
constructor(data: T, config: InteractionConfig, assets?: NormalizedAssets | null, validator?: Validator);
|
|
@@ -68,10 +68,9 @@ export declare abstract class BaseInteraction<T extends InteractionData> extends
|
|
|
68
68
|
protected emitComplete(): void;
|
|
69
69
|
protected emitHintShown(message?: string): void;
|
|
70
70
|
protected emitError(error: Error, message?: string): void;
|
|
71
|
-
onChange(newVariant: Variant): void;
|
|
72
|
-
setSteps(steps: number): void;
|
|
73
71
|
submit(): void;
|
|
74
72
|
hint(): void;
|
|
73
|
+
setSteps(steps: number): void;
|
|
75
74
|
reset(): void;
|
|
76
75
|
set(variant: Variant): void;
|
|
77
76
|
get(): Variant;
|
package/dist/engines/index.d.ts
CHANGED
|
@@ -1,2 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { Variant } from "@/types/Global";
|
|
2
|
+
import type { TableConfiguration, TableState, CellGradingState, TableCompletion } from "@/types/Tables";
|
|
3
|
+
type EduTableElement = HTMLElement & {
|
|
4
|
+
config: TableConfiguration;
|
|
5
|
+
getValue(): TableState;
|
|
6
|
+
setValue(next: TableState): void;
|
|
7
|
+
getState(): TableCompletion;
|
|
8
|
+
reset(): void;
|
|
9
|
+
};
|
|
10
|
+
export * from "./utils";
|
|
11
|
+
export declare class EduTable extends HTMLElement implements EduTableElement {
|
|
12
|
+
private _config;
|
|
13
|
+
private _state;
|
|
14
|
+
private _mounted;
|
|
15
|
+
static get observedAttributes(): string[];
|
|
16
|
+
private $wrapEl;
|
|
17
|
+
constructor();
|
|
18
|
+
connectedCallback(): void;
|
|
19
|
+
disconnectedCallback(): void;
|
|
20
|
+
set config(v: TableConfiguration);
|
|
21
|
+
get config(): TableConfiguration;
|
|
22
|
+
get value(): TableState;
|
|
23
|
+
set value(v: TableState);
|
|
24
|
+
getValue(): TableState;
|
|
25
|
+
setValue(next: TableState): void;
|
|
26
|
+
getState(): TableCompletion;
|
|
27
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
28
|
+
private initState;
|
|
29
|
+
private render;
|
|
30
|
+
private renderCell;
|
|
31
|
+
reset(): void;
|
|
32
|
+
setGradingState(gradingState: CellGradingState): void;
|
|
33
|
+
clearGradingState(): void;
|
|
34
|
+
private onChange;
|
|
35
|
+
private onInput;
|
|
36
|
+
private applyCellValue;
|
|
37
|
+
private emitChange;
|
|
38
|
+
get variant(): Variant;
|
|
39
|
+
set variant(v: Variant);
|
|
40
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export * from "./core";
|
|
|
8
8
|
export type { AssetType, AssetRegistryInput, Asset, ImageAsset, AudioAsset, VideoAsset, HtmlAsset, TtsAsset, NormalizedAssets } from "./types/Assets";
|
|
9
9
|
export type { InteractionData, ClassificationData, AssociationData, SeriationData, FreeRecallData, RecognitionData } from "./types/Data";
|
|
10
10
|
export type { GradingResult, GradingState } from "./types/Grading";
|
|
11
|
-
export type { InteractionMechanic,
|
|
11
|
+
export type { InteractionMechanic, InteractionConfig } from "./types/Interactions";
|
|
12
12
|
export type { CognikitThemeVariableName, CognikitThemeVariables, CognikitThemeName, CognikitConfig } from "./shared/config";
|