jspsych-tangram 0.0.19 → 0.0.20
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/construct/index.browser.js.map +1 -1
- package/dist/construct/index.browser.min.js.map +1 -1
- package/dist/construct/index.cjs.map +1 -1
- package/dist/construct/index.js.map +1 -1
- package/dist/grid/index.browser.js +5 -6
- package/dist/grid/index.browser.js.map +1 -1
- package/dist/grid/index.browser.min.js +11 -11
- package/dist/grid/index.browser.min.js.map +1 -1
- package/dist/grid/index.cjs +5 -6
- package/dist/grid/index.cjs.map +1 -1
- package/dist/grid/index.js +5 -6
- package/dist/grid/index.js.map +1 -1
- package/dist/index.cjs +5 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/plugins/tangram-construct/index.ts +3 -3
- package/src/plugins/tangram-grid/GridApp.tsx +7 -6
- package/tangram-grid.min.js +11 -11
package/package.json
CHANGED
|
@@ -32,7 +32,7 @@ const info = {
|
|
|
32
32
|
},
|
|
33
33
|
/** Input method for piece manipulation */
|
|
34
34
|
input: {
|
|
35
|
-
type: ParameterType.SELECT,
|
|
35
|
+
type: ParameterType.SELECT,
|
|
36
36
|
options: ["click", "drag"],
|
|
37
37
|
default: "drag",
|
|
38
38
|
description: "Input mode: drag (mouse/touch drag) or click (click to select/place)"
|
|
@@ -40,7 +40,7 @@ const info = {
|
|
|
40
40
|
/** Layout style for piece arrangement */
|
|
41
41
|
layout: {
|
|
42
42
|
type: ParameterType.SELECT,
|
|
43
|
-
options: ["circle", "semicircle"],
|
|
43
|
+
options: ["circle", "semicircle"],
|
|
44
44
|
default: "semicircle",
|
|
45
45
|
description: "Layout mode: full circle or semicircle piece arrangement"
|
|
46
46
|
},
|
|
@@ -189,7 +189,7 @@ class TangramConstructPlugin implements JsPsychPlugin<Info> {
|
|
|
189
189
|
|
|
190
190
|
// Use React wrapper to start the trial
|
|
191
191
|
const { root, display_element: element, jsPsych } = startConstructionTrial(display_element, params, this.jsPsych);
|
|
192
|
-
|
|
192
|
+
|
|
193
193
|
// Store React context for cleanup
|
|
194
194
|
(element as any).__reactContext = { root, jsPsych };
|
|
195
195
|
}
|
|
@@ -85,6 +85,9 @@ function GridView({ params }: GridViewProps) {
|
|
|
85
85
|
onTrialEnd
|
|
86
86
|
} = params;
|
|
87
87
|
|
|
88
|
+
// Extract non-callback params for trial data
|
|
89
|
+
const { onTrialEnd: _, ...trialParams } = params;
|
|
90
|
+
|
|
88
91
|
const trialStartTime = useRef<number>(Date.now());
|
|
89
92
|
const [response, setResponse] = useState<string>("");
|
|
90
93
|
const [cellSize, setCellSize] = useState<number>(100);
|
|
@@ -241,12 +244,10 @@ function GridView({ params }: GridViewProps) {
|
|
|
241
244
|
const trialData = {
|
|
242
245
|
response,
|
|
243
246
|
rt,
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
use_primitive_colors: usePrimitiveColors,
|
|
249
|
-
primitive_color_indices: primitiveColorIndices
|
|
247
|
+
trialParams: {
|
|
248
|
+
...trialParams,
|
|
249
|
+
tangramIDs: processedTangrams.map((t) => t.tangramId)
|
|
250
|
+
}
|
|
250
251
|
};
|
|
251
252
|
if (onTrialEnd) {
|
|
252
253
|
onTrialEnd(trialData);
|