@lookit/templates 1.1.0 → 2.0.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/index.browser.js +440 -7047
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.min.js +6361 -4
- package/dist/index.browser.min.js.map +1 -1
- package/dist/index.cjs +223 -25243
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +9 -5
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +223 -25243
- package/dist/index.js.map +1 -1
- package/package.json +11 -8
- package/dist/consentVideoTemplate.d.ts +0 -8
- package/dist/errors.d.ts +0 -18
- package/dist/exitSurveyTemplate.d.ts +0 -95
- package/dist/uploadingVideoTemplate.d.ts +0 -8
- package/dist/utils.d.ts +0 -14
- package/dist/videoConfigTemplate.d.ts +0 -33
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookit/templates",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "CHS jsPsych trial templates and their translations",
|
|
5
5
|
"homepage": "https://github.com/lookit/lookit-jspsych#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -24,18 +24,21 @@
|
|
|
24
24
|
"dev": "rollup --config rollup.config.dev.mjs --watch",
|
|
25
25
|
"test": "jest --coverage"
|
|
26
26
|
},
|
|
27
|
-
"
|
|
28
|
-
"@jspsych/config": "^2.0.0",
|
|
29
|
-
"@types/js-yaml": "^4.0.9",
|
|
27
|
+
"dependencies": {
|
|
30
28
|
"handlebars": "^4.7.8",
|
|
31
29
|
"i18next": "^23.16.4",
|
|
32
30
|
"i18next-icu": "^2.3.0",
|
|
33
|
-
"js-yaml": "^4.1.0"
|
|
31
|
+
"js-yaml": "^4.1.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@jspsych/config": "^3.0.1",
|
|
35
|
+
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
36
|
+
"@types/js-yaml": "^4.0.9",
|
|
34
37
|
"rollup-plugin-dotenv": "^0.5.1",
|
|
35
|
-
"rollup-plugin-
|
|
38
|
+
"rollup-plugin-string": "^3.0.0"
|
|
36
39
|
},
|
|
37
40
|
"peerDependencies": {
|
|
38
|
-
"@lookit/data": "^0.
|
|
39
|
-
"jspsych": "^8.0.
|
|
41
|
+
"@lookit/data": "^0.2.0",
|
|
42
|
+
"jspsych": "^8.0.3"
|
|
40
43
|
}
|
|
41
44
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { PluginInfo, TrialType } from "jspsych";
|
|
2
|
-
/**
|
|
3
|
-
* Translate, render, and get consent document HTML.
|
|
4
|
-
*
|
|
5
|
-
* @param trial - JsPsych trial object containing trial params
|
|
6
|
-
* @returns Consent document HTML
|
|
7
|
-
*/
|
|
8
|
-
export declare const consentVideo: (trial: TrialType<PluginInfo>) => string;
|
package/dist/errors.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/** Error thrown when specified language isn't found */
|
|
2
|
-
export declare class LocaleNotFoundError extends Error {
|
|
3
|
-
/**
|
|
4
|
-
* This will be thrown when attempting to init i18n
|
|
5
|
-
*
|
|
6
|
-
* @param baseName - Language a2code with region
|
|
7
|
-
*/
|
|
8
|
-
constructor(baseName: string);
|
|
9
|
-
}
|
|
10
|
-
/** Error thrown when researcher selects template that isn't available. */
|
|
11
|
-
export declare class ConsentTemplateNotFound extends Error {
|
|
12
|
-
/**
|
|
13
|
-
* This will let the researcher know that their template isn't found.
|
|
14
|
-
*
|
|
15
|
-
* @param template - Supplied name of consent template.
|
|
16
|
-
*/
|
|
17
|
-
constructor(template: string);
|
|
18
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { PluginInfo, TrialType } from "jspsych";
|
|
2
|
-
/**
|
|
3
|
-
* Translate survey text to desired locale.
|
|
4
|
-
*
|
|
5
|
-
* @param trial - Trial data including user supplied parameters.
|
|
6
|
-
* @returns Survey json
|
|
7
|
-
*/
|
|
8
|
-
export declare const exitSurvey: (trial: TrialType<PluginInfo>) => {
|
|
9
|
-
pages: {
|
|
10
|
-
elements: ({
|
|
11
|
-
description: string;
|
|
12
|
-
inputType: string;
|
|
13
|
-
isRequired: boolean;
|
|
14
|
-
maxValueExpression: string;
|
|
15
|
-
name: "birthDate";
|
|
16
|
-
title: string;
|
|
17
|
-
type: string;
|
|
18
|
-
enableIf?: undefined;
|
|
19
|
-
valueFalse?: undefined;
|
|
20
|
-
valueTrue?: undefined;
|
|
21
|
-
choices?: undefined;
|
|
22
|
-
defaultValue?: undefined;
|
|
23
|
-
autoGrow?: undefined;
|
|
24
|
-
rows?: undefined;
|
|
25
|
-
} | {
|
|
26
|
-
description: string;
|
|
27
|
-
enableIf: string;
|
|
28
|
-
isRequired: boolean;
|
|
29
|
-
name: "databraryShare";
|
|
30
|
-
title: string;
|
|
31
|
-
type: string;
|
|
32
|
-
valueFalse: string;
|
|
33
|
-
valueTrue: string;
|
|
34
|
-
inputType?: undefined;
|
|
35
|
-
maxValueExpression?: undefined;
|
|
36
|
-
choices?: undefined;
|
|
37
|
-
defaultValue?: undefined;
|
|
38
|
-
autoGrow?: undefined;
|
|
39
|
-
rows?: undefined;
|
|
40
|
-
} | {
|
|
41
|
-
choices: {
|
|
42
|
-
text: string;
|
|
43
|
-
value: string;
|
|
44
|
-
}[];
|
|
45
|
-
description: string;
|
|
46
|
-
enableIf: string;
|
|
47
|
-
isRequired: boolean;
|
|
48
|
-
name: "useOfMedia";
|
|
49
|
-
title: string;
|
|
50
|
-
type: string;
|
|
51
|
-
inputType?: undefined;
|
|
52
|
-
maxValueExpression?: undefined;
|
|
53
|
-
valueFalse?: undefined;
|
|
54
|
-
valueTrue?: undefined;
|
|
55
|
-
defaultValue?: undefined;
|
|
56
|
-
autoGrow?: undefined;
|
|
57
|
-
rows?: undefined;
|
|
58
|
-
} | {
|
|
59
|
-
choices: {
|
|
60
|
-
text: string;
|
|
61
|
-
value: boolean;
|
|
62
|
-
}[];
|
|
63
|
-
defaultValue: never[];
|
|
64
|
-
isRequired: boolean;
|
|
65
|
-
name: "withdrawal";
|
|
66
|
-
title: string;
|
|
67
|
-
type: string;
|
|
68
|
-
description?: undefined;
|
|
69
|
-
inputType?: undefined;
|
|
70
|
-
maxValueExpression?: undefined;
|
|
71
|
-
enableIf?: undefined;
|
|
72
|
-
valueFalse?: undefined;
|
|
73
|
-
valueTrue?: undefined;
|
|
74
|
-
autoGrow?: undefined;
|
|
75
|
-
rows?: undefined;
|
|
76
|
-
} | {
|
|
77
|
-
autoGrow: boolean;
|
|
78
|
-
name: "feedback";
|
|
79
|
-
rows: number;
|
|
80
|
-
title: string;
|
|
81
|
-
type: string;
|
|
82
|
-
description?: undefined;
|
|
83
|
-
inputType?: undefined;
|
|
84
|
-
isRequired?: undefined;
|
|
85
|
-
maxValueExpression?: undefined;
|
|
86
|
-
enableIf?: undefined;
|
|
87
|
-
valueFalse?: undefined;
|
|
88
|
-
valueTrue?: undefined;
|
|
89
|
-
choices?: undefined;
|
|
90
|
-
defaultValue?: undefined;
|
|
91
|
-
})[];
|
|
92
|
-
name: string;
|
|
93
|
-
}[];
|
|
94
|
-
showQuestionNumbers: string;
|
|
95
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { PluginInfo, TrialType } from "jspsych";
|
|
2
|
-
/**
|
|
3
|
-
* Get translated template for uploading video message.
|
|
4
|
-
*
|
|
5
|
-
* @param trial - JsPsych trial object containing trial params
|
|
6
|
-
* @returns Uploading video message HTML
|
|
7
|
-
*/
|
|
8
|
-
export declare const uploadingVideo: (trial: TrialType<PluginInfo>) => string;
|
package/dist/utils.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { PluginInfo, TrialType } from "jspsych";
|
|
2
|
-
/**
|
|
3
|
-
* Pulled from EFP. Function to convert researcher's text to HTML.
|
|
4
|
-
*
|
|
5
|
-
* @param text - Text
|
|
6
|
-
* @returns Formatted string
|
|
7
|
-
*/
|
|
8
|
-
export declare const expFormat: (text?: string | string[]) => string;
|
|
9
|
-
/**
|
|
10
|
-
* Initialize i18next with parameters from trial.
|
|
11
|
-
*
|
|
12
|
-
* @param trial - Trial data including user supplied parameters.
|
|
13
|
-
*/
|
|
14
|
-
export declare const setLocale: (trial: TrialType<PluginInfo>) => void;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { PluginInfo, TrialType } from "jspsych";
|
|
2
|
-
type VideoConfigTemplateParams = {
|
|
3
|
-
webcam_container_id: string;
|
|
4
|
-
reload_button_id_cam: string;
|
|
5
|
-
camera_selection_id: string;
|
|
6
|
-
mic_selection_id: string;
|
|
7
|
-
step1_id: string;
|
|
8
|
-
step2_id: string;
|
|
9
|
-
step3_id: string;
|
|
10
|
-
step_complete_class: string;
|
|
11
|
-
reload_button_id_text: string;
|
|
12
|
-
next_button_id: string;
|
|
13
|
-
waiting_for_access_msg_id: string;
|
|
14
|
-
checking_mic_msg_id: string;
|
|
15
|
-
access_problem_msg_id: string;
|
|
16
|
-
setup_problem_msg_id: string;
|
|
17
|
-
chromeInitialPrompt: string;
|
|
18
|
-
chromeAlwaysAllow: string;
|
|
19
|
-
chromePermissions: string;
|
|
20
|
-
firefoxInitialPrompt: string;
|
|
21
|
-
firefoxChooseDevice: string;
|
|
22
|
-
firefoxDevicesBlocked: string;
|
|
23
|
-
checkmarkIcon: string;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Get translated template for video config.
|
|
27
|
-
*
|
|
28
|
-
* @param trial - JsPsych trial object containing trial params
|
|
29
|
-
* @param html_params - Additional context variables for the template.
|
|
30
|
-
* @returns Video config HTML
|
|
31
|
-
*/
|
|
32
|
-
export declare const videoConfig: (trial: TrialType<PluginInfo>, html_params: VideoConfigTemplateParams) => string;
|
|
33
|
-
export {};
|