cognikit 0.1.1 → 0.2.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/client.d.ts +11 -0
- package/dist/client.js +4601 -0
- package/dist/client.js.map +7 -0
- package/dist/index.d.ts +10 -4
- package/dist/index.js +2085 -2002
- package/dist/index.js.map +4 -4
- package/dist/interactions/categorize-the-words/static.d.ts +1 -1
- package/dist/interactions/fill-blanks/static.d.ts +1 -1
- package/dist/interactions/mark-the-words/static.d.ts +1 -1
- package/dist/interactions/text-transformation/static.d.ts +1 -1
- package/dist/shared/config.d.ts +26 -0
- package/dist/shared/icons.d.ts +3 -0
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/managers/SoundManager.d.ts +1 -2
- package/dist/shared/ssr.d.ts +1 -0
- package/package.json +63 -58
- package/public/app.js +10221 -9851
- package/public/app.js.map +4 -4
|
@@ -16,7 +16,7 @@ export declare class CategorizeTheWords extends BaseInteraction<TextEngineClassi
|
|
|
16
16
|
getCurrentState(): TextEngineClassificationUserData;
|
|
17
17
|
isInteractionComplete(): boolean;
|
|
18
18
|
onHint(): void;
|
|
19
|
-
grade(): import("
|
|
19
|
+
grade(): import("../..").GradingResult;
|
|
20
20
|
submit(): void;
|
|
21
21
|
reset(): void;
|
|
22
22
|
}
|
|
@@ -17,7 +17,7 @@ export declare class FillBlanks extends BaseInteraction<TextEngineBlanksData> {
|
|
|
17
17
|
isInteractionComplete(): boolean;
|
|
18
18
|
onHint(): void;
|
|
19
19
|
private getHintText;
|
|
20
|
-
grade(): import("
|
|
20
|
+
grade(): import("../..").GradingResult;
|
|
21
21
|
submit(): void;
|
|
22
22
|
reset(): void;
|
|
23
23
|
}
|
|
@@ -35,6 +35,6 @@ export declare class MarkTheWords extends BaseInteraction<TextEngineBaseData> {
|
|
|
35
35
|
onHint(): void;
|
|
36
36
|
getUserData(): TextEngineBaseUserData;
|
|
37
37
|
submit(): void;
|
|
38
|
-
grade(): import("
|
|
38
|
+
grade(): import("../..").GradingResult;
|
|
39
39
|
reset(): void;
|
|
40
40
|
}
|
|
@@ -37,7 +37,7 @@ export declare class TextTransformation extends BaseInteraction<TextEngineBaseDa
|
|
|
37
37
|
onHint(): void;
|
|
38
38
|
getUserData(): TextEngineBaseUserData;
|
|
39
39
|
submit(): void;
|
|
40
|
-
grade(): import("
|
|
40
|
+
grade(): import("../..").GradingResult;
|
|
41
41
|
reset(): void;
|
|
42
42
|
/**
|
|
43
43
|
* Set the expected transformations after construction
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SoundName } from "./managers/SoundManager";
|
|
2
|
+
export type CognikitThemeVariableName = "--edu-bg" | "--edu-card" | "--edu-ink" | "--edu-second-ink" | "--edu-third-ink" | "--edu-inverted-ink" | "--edu-success" | "--edu-error" | "--edu-warning" | "--edu-neutral" | "--edu-first-accent" | "--edu-second-accent" | "--edu-third-accent" | "--edu-border" | "--edu-muted" | "--edu-radius" | "--edu-shadow-color" | "--edu-pad" | "--edu-mar";
|
|
3
|
+
export type CognikitThemeVariables = Record<CognikitThemeVariableName, string>;
|
|
4
|
+
export type CognikitThemeName = "default-light" | "default-dark" | "ocean-light" | "ocean-dark" | "forest-light" | "forest-dark";
|
|
5
|
+
export type CognikitConfig = {
|
|
6
|
+
audioBaseUrl?: string | null;
|
|
7
|
+
soundFiles?: Partial<Record<SoundName, string>>;
|
|
8
|
+
injectThemeVariables?: boolean;
|
|
9
|
+
theme?: CognikitThemeName | null;
|
|
10
|
+
themeVariables?: Partial<CognikitThemeVariables> | null;
|
|
11
|
+
};
|
|
12
|
+
export declare const cognikitThemePresets: Record<CognikitThemeName, CognikitThemeVariables>;
|
|
13
|
+
export declare const defaultCognikitThemeVariables: CognikitThemeVariables;
|
|
14
|
+
declare const cognikitConfig: Required<Omit<CognikitConfig, "theme" | "themeVariables">> & {
|
|
15
|
+
theme: CognikitThemeName | null;
|
|
16
|
+
themeVariables: Partial<CognikitThemeVariables>;
|
|
17
|
+
};
|
|
18
|
+
export declare function configureCognikit(config: CognikitConfig): void;
|
|
19
|
+
export declare function getCognikitConfig(): Readonly<typeof cognikitConfig>;
|
|
20
|
+
export declare function getCognikitThemePresets(): Readonly<typeof cognikitThemePresets>;
|
|
21
|
+
export declare function resolveCognikitTheme(theme?: CognikitThemeName | null, themeVariables?: Partial<CognikitThemeVariables>): CognikitThemeVariables;
|
|
22
|
+
export declare function setCognikitTheme(theme: CognikitThemeName | null, themeVariables?: Partial<CognikitThemeVariables>): void;
|
|
23
|
+
export declare function resetCognikitTheme(): void;
|
|
24
|
+
export declare function ensureCognikitTheme(): void;
|
|
25
|
+
export declare function resolveConfiguredSoundUrl(soundName: SoundName, defaultFilename: string): string | null;
|
|
26
|
+
export {};
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* SoundManager - Centralized audio playback utility
|
|
3
3
|
*
|
|
4
4
|
* Features:
|
|
5
|
-
* - Play local sounds
|
|
5
|
+
* - Play configured local sounds
|
|
6
6
|
* - Play sounds from external URLs
|
|
7
7
|
* - Preload and cache audio for better performance
|
|
8
8
|
* - Volume control with fade effects
|
|
@@ -22,7 +22,6 @@ export declare class SoundManager {
|
|
|
22
22
|
isEnabled: boolean;
|
|
23
23
|
private audioCache;
|
|
24
24
|
private activeSounds;
|
|
25
|
-
private baseUrl;
|
|
26
25
|
private localSounds;
|
|
27
26
|
constructor();
|
|
28
27
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ensureCognikitSSRCompatibility(): void;
|
package/package.json
CHANGED
|
@@ -1,59 +1,64 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
2
|
+
"name": "cognikit",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"author": "Yahir Adolfo de los Santos Beras",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "https://github.com/YerCodeWorld/cognikit.git",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"psychometrics",
|
|
9
|
+
"quizzes",
|
|
10
|
+
"education",
|
|
11
|
+
"practice",
|
|
12
|
+
"tests",
|
|
13
|
+
"learning",
|
|
14
|
+
"psycology",
|
|
15
|
+
"cognitive"
|
|
16
|
+
],
|
|
17
|
+
"homepage": "https://github.com/YerCodeWorld/cognikit.git#readme",
|
|
18
|
+
"bugs": "https://github.com/YerCodeWorld/cognikit.git/issues",
|
|
19
|
+
"type": "module",
|
|
20
|
+
"private": false,
|
|
21
|
+
"main": "./dist/index.js",
|
|
22
|
+
"module": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"import": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts"
|
|
28
|
+
},
|
|
29
|
+
"./client": {
|
|
30
|
+
"import": "./dist/client.js",
|
|
31
|
+
"types": "./dist/client.d.ts"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"public",
|
|
37
|
+
"README.md",
|
|
38
|
+
"LICENSE"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"clean": "rimraf dist public-dist",
|
|
42
|
+
"types": "tsc -p tsconfig.json",
|
|
43
|
+
"build:lib": "esbuild src/index.ts src/client.ts --bundle --format=esm --platform=browser --outdir=dist --sourcemap --minify --external:react --external:react-dom --loader:.html=text --loader:.css=text --banner:js=\"var HTMLElement = globalThis.HTMLElement ?? class {}; var customElements = globalThis.customElements ?? { get() { return undefined; }, define() {} };\"",
|
|
44
|
+
"build:demo": "esbuild src/index.ts --bundle --format=esm --platform=browser --outfile=public/app.js --sourcemap --loader:.html=text --loader:.css=text --banner:js=\"var HTMLElement = globalThis.HTMLElement ?? class {}; var customElements = globalThis.customElements ?? { get() { return undefined; }, define() {} };\"",
|
|
45
|
+
"build": "pnpm clean && pnpm build:lib && pnpm types && pnpm build:demo",
|
|
46
|
+
"prepublishOnly": "pnpm build",
|
|
47
|
+
"dev:build": "esbuild src/index.ts --bundle --format=esm --platform=browser --outfile=public/app.js --sourcemap --watch=forever --loader:.html=text --loader:.css=text --banner:js=\"var HTMLElement = globalThis.HTMLElement ?? class {}; var customElements = globalThis.customElements ?? { get() { return undefined; }, define() {} };\"",
|
|
48
|
+
"dev:serve": "browser-sync start --server public --port 3008 --files 'public/**/*' --no-open --no-notify",
|
|
49
|
+
"dev": "npm-run-all --parallel dev:build dev:serve",
|
|
50
|
+
"dev:watch": "esbuild src/index.ts --bundle --format=esm --platform=browser --outfile=public/app.js --sourcemap --watch=forever --loader:.html=text --loader:.css=text --banner:js=\"var HTMLElement = globalThis.HTMLElement ?? class {}; var customElements = globalThis.customElements ?? { get() { return undefined; }, define() {} };\" & while inotifywait -r -e modify,create,delete,move src; do pnpm build:lib; done",
|
|
51
|
+
"serve": "serve public -l 3008"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"browser-sync": "^3.0.4",
|
|
55
|
+
"esbuild": "^0.23.0",
|
|
56
|
+
"npm-run-all": "^4.1.5",
|
|
57
|
+
"rimraf": "^6.0.0",
|
|
58
|
+
"serve": "^14.2.3",
|
|
59
|
+
"typescript": "^5.6.3"
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"js-yaml": "^4.1.1"
|
|
63
|
+
}
|
|
64
|
+
}
|