jspsych-tangram 0.0.14 → 0.0.15

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.
Files changed (46) hide show
  1. package/dist/afc/index.browser.js +17751 -0
  2. package/dist/afc/index.browser.js.map +1 -0
  3. package/dist/afc/index.browser.min.js +42 -0
  4. package/dist/afc/index.browser.min.js.map +1 -0
  5. package/dist/afc/index.cjs +443 -0
  6. package/dist/afc/index.cjs.map +1 -0
  7. package/dist/afc/index.d.ts +169 -0
  8. package/dist/afc/index.js +441 -0
  9. package/dist/afc/index.js.map +1 -0
  10. package/dist/construct/index.browser.js +4538 -3890
  11. package/dist/construct/index.browser.js.map +1 -1
  12. package/dist/construct/index.browser.min.js +13 -13
  13. package/dist/construct/index.browser.min.js.map +1 -1
  14. package/dist/construct/index.cjs +4 -8
  15. package/dist/construct/index.cjs.map +1 -1
  16. package/dist/construct/index.js +4 -8
  17. package/dist/construct/index.js.map +1 -1
  18. package/dist/index.cjs +374 -16
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.ts +178 -12
  21. package/dist/index.js +374 -17
  22. package/dist/index.js.map +1 -1
  23. package/dist/nback/index.browser.js +4536 -3919
  24. package/dist/nback/index.browser.js.map +1 -1
  25. package/dist/nback/index.browser.min.js +12 -12
  26. package/dist/nback/index.browser.min.js.map +1 -1
  27. package/dist/nback/index.cjs +6 -41
  28. package/dist/nback/index.cjs.map +1 -1
  29. package/dist/nback/index.js +6 -41
  30. package/dist/nback/index.js.map +1 -1
  31. package/dist/prep/index.browser.js +4538 -3892
  32. package/dist/prep/index.browser.js.map +1 -1
  33. package/dist/prep/index.browser.min.js +13 -13
  34. package/dist/prep/index.browser.min.js.map +1 -1
  35. package/dist/prep/index.cjs +5 -11
  36. package/dist/prep/index.cjs.map +1 -1
  37. package/dist/prep/index.js +5 -11
  38. package/dist/prep/index.js.map +1 -1
  39. package/package.json +1 -1
  40. package/src/index.ts +2 -1
  41. package/src/plugins/tangram-afc/AFCApp.tsx +341 -0
  42. package/src/plugins/tangram-afc/index.ts +140 -0
  43. package/src/plugins/tangram-nback/NBackApp.tsx +2 -2
  44. package/tangram-construct.min.js +13 -13
  45. package/tangram-nback.min.js +12 -12
  46. package/tangram-prep.min.js +13 -13
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { JsPsychPlugin, ParameterType, JsPsych, TrialType } from 'jspsych';
2
2
 
3
- declare const info$2: {
3
+ declare const info$3: {
4
4
  name: string;
5
5
  version: string;
6
6
  parameters: {
@@ -127,7 +127,7 @@ declare const info$2: {
127
127
  };
128
128
  citations: string;
129
129
  };
130
- type Info$2 = typeof info$2;
130
+ type Info$3 = typeof info$3;
131
131
  /**
132
132
  * **tangram-construct**
133
133
  *
@@ -136,7 +136,7 @@ type Info$2 = typeof info$2;
136
136
  * @author Justin Yang & Sean Paul Anderson
137
137
  * @see {@link https://github.com/cogtoolslab/tangram_construction.git/tree/main/experiments/jspsych-tangram-prep}
138
138
  */
139
- declare class TangramConstructPlugin implements JsPsychPlugin<Info$2> {
139
+ declare class TangramConstructPlugin implements JsPsychPlugin<Info$3> {
140
140
  private jsPsych;
141
141
  static info: {
142
142
  name: string;
@@ -270,10 +270,10 @@ declare class TangramConstructPlugin implements JsPsychPlugin<Info$2> {
270
270
  * Launches the trial by invoking startConstructionTrial
271
271
  * with the display element, parameters, and jsPsych instance.
272
272
  */
273
- trial(display_element: HTMLElement, trial: TrialType<Info$2>): void;
273
+ trial(display_element: HTMLElement, trial: TrialType<Info$3>): void;
274
274
  }
275
275
 
276
- declare const info$1: {
276
+ declare const info$2: {
277
277
  name: string;
278
278
  version: string;
279
279
  parameters: {
@@ -356,7 +356,7 @@ declare const info$1: {
356
356
  };
357
357
  citations: string;
358
358
  };
359
- type Info$1 = typeof info$1;
359
+ type Info$2 = typeof info$2;
360
360
  /**
361
361
  * **tangram-prep**
362
362
  *
@@ -364,7 +364,7 @@ type Info$1 = typeof info$1;
364
364
  *
365
365
  * @author Justin Yang & Sean Paul Anderson
366
366
  */
367
- declare class TangramPrepPlugin implements JsPsychPlugin<Info$1> {
367
+ declare class TangramPrepPlugin implements JsPsychPlugin<Info$2> {
368
368
  private jsPsych;
369
369
  static info: {
370
370
  name: string;
@@ -454,10 +454,10 @@ declare class TangramPrepPlugin implements JsPsychPlugin<Info$1> {
454
454
  * Launches the trial by invoking startPrepTrial
455
455
  * with the display element, parameters, and jsPsych instance.
456
456
  */
457
- trial(display_element: HTMLElement, trial: TrialType<Info$1>): void;
457
+ trial(display_element: HTMLElement, trial: TrialType<Info$2>): void;
458
458
  }
459
459
 
460
- declare const info: {
460
+ declare const info$1: {
461
461
  name: string;
462
462
  version: string;
463
463
  parameters: {
@@ -545,7 +545,7 @@ declare const info: {
545
545
  };
546
546
  citations: string;
547
547
  };
548
- type Info = typeof info;
548
+ type Info$1 = typeof info$1;
549
549
  /**
550
550
  * **tangram-nback**
551
551
  *
@@ -555,7 +555,7 @@ type Info = typeof info;
555
555
  * @author Justin Yang & Sean Paul Anderson
556
556
  * @see {@link https://github.com/cogtoolslab/tangram_construction.git/tree/main/experiments/jspsych-tangram-prep}
557
557
  */
558
- declare class TangramNBackPlugin implements JsPsychPlugin<Info> {
558
+ declare class TangramNBackPlugin implements JsPsychPlugin<Info$1> {
559
559
  private jsPsych;
560
560
  static info: {
561
561
  name: string;
@@ -650,7 +650,173 @@ declare class TangramNBackPlugin implements JsPsychPlugin<Info> {
650
650
  * Launches the trial by invoking startNBackTrial
651
651
  * with the display element, parameters, and jsPsych instance.
652
652
  */
653
+ trial(display_element: HTMLElement, trial: TrialType<Info$1>): void;
654
+ }
655
+
656
+ declare const info: {
657
+ name: string;
658
+ version: string;
659
+ parameters: {
660
+ /** Left tangram specification to display */
661
+ tangram_left: {
662
+ type: ParameterType;
663
+ default: undefined;
664
+ description: string;
665
+ };
666
+ /** Right tangram specification to display */
667
+ tangram_right: {
668
+ type: ParameterType;
669
+ default: undefined;
670
+ description: string;
671
+ };
672
+ /** HTML content to display above the tangrams as instructions */
673
+ instructions: {
674
+ type: ParameterType;
675
+ default: string;
676
+ description: string;
677
+ };
678
+ /** Text to display on left response button */
679
+ button_text_left: {
680
+ type: ParameterType;
681
+ default: string;
682
+ description: string;
683
+ };
684
+ /** Text to display on right response button */
685
+ button_text_right: {
686
+ type: ParameterType;
687
+ default: string;
688
+ description: string;
689
+ };
690
+ /** Whether to show tangram decomposed into individual primitives with borders */
691
+ show_tangram_decomposition: {
692
+ type: ParameterType;
693
+ default: boolean;
694
+ description: string;
695
+ };
696
+ /** Whether to use distinct colors for each primitive shape type */
697
+ use_primitive_colors: {
698
+ type: ParameterType;
699
+ default: boolean;
700
+ description: string;
701
+ };
702
+ /** Indices mapping primitives to colors from the color palette */
703
+ primitive_color_indices: {
704
+ type: ParameterType;
705
+ default: number[];
706
+ description: string;
707
+ };
708
+ /** Callback fired when trial ends */
709
+ onTrialEnd: {
710
+ type: ParameterType;
711
+ default: undefined;
712
+ description: string;
713
+ };
714
+ };
715
+ data: {
716
+ /** Reaction time in milliseconds */
717
+ rt: {
718
+ type: ParameterType;
719
+ description: string;
720
+ };
721
+ /** Response choice */
722
+ response: {
723
+ type: ParameterType;
724
+ description: string;
725
+ };
726
+ };
727
+ citations: string;
728
+ };
729
+ type Info = typeof info;
730
+ /**
731
+ * **tangram-afc**
732
+ *
733
+ * A jsPsych plugin for alternative forced choice (AFC) trials displaying two tangrams
734
+ * side-by-side with response buttons.
735
+ *
736
+ * @author Justin Yang & Sean Paul Anderson
737
+ * @see {@link https://github.com/cogtoolslab/tangram_construction.git/tree/main/experiments/jspsych-tangram-prep}
738
+ */
739
+ declare class TangramAFCPlugin implements JsPsychPlugin<Info> {
740
+ private jsPsych;
741
+ static info: {
742
+ name: string;
743
+ version: string;
744
+ parameters: {
745
+ /** Left tangram specification to display */
746
+ tangram_left: {
747
+ type: ParameterType;
748
+ default: undefined;
749
+ description: string;
750
+ };
751
+ /** Right tangram specification to display */
752
+ tangram_right: {
753
+ type: ParameterType;
754
+ default: undefined;
755
+ description: string;
756
+ };
757
+ /** HTML content to display above the tangrams as instructions */
758
+ instructions: {
759
+ type: ParameterType;
760
+ default: string;
761
+ description: string;
762
+ };
763
+ /** Text to display on left response button */
764
+ button_text_left: {
765
+ type: ParameterType;
766
+ default: string;
767
+ description: string;
768
+ };
769
+ /** Text to display on right response button */
770
+ button_text_right: {
771
+ type: ParameterType;
772
+ default: string;
773
+ description: string;
774
+ };
775
+ /** Whether to show tangram decomposed into individual primitives with borders */
776
+ show_tangram_decomposition: {
777
+ type: ParameterType;
778
+ default: boolean;
779
+ description: string;
780
+ };
781
+ /** Whether to use distinct colors for each primitive shape type */
782
+ use_primitive_colors: {
783
+ type: ParameterType;
784
+ default: boolean;
785
+ description: string;
786
+ };
787
+ /** Indices mapping primitives to colors from the color palette */
788
+ primitive_color_indices: {
789
+ type: ParameterType;
790
+ default: number[];
791
+ description: string;
792
+ };
793
+ /** Callback fired when trial ends */
794
+ onTrialEnd: {
795
+ type: ParameterType;
796
+ default: undefined;
797
+ description: string;
798
+ };
799
+ };
800
+ data: {
801
+ /** Reaction time in milliseconds */
802
+ rt: {
803
+ type: ParameterType;
804
+ description: string;
805
+ };
806
+ /** Response choice */
807
+ response: {
808
+ type: ParameterType;
809
+ description: string;
810
+ };
811
+ };
812
+ citations: string;
813
+ };
814
+ constructor(jsPsych: JsPsych);
815
+ /**
816
+ * Launches the trial by invoking startAFCTrial
817
+ * with the display element, parameters, and jsPsych instance.
818
+ */
653
819
  trial(display_element: HTMLElement, trial: TrialType<Info>): void;
654
820
  }
655
821
 
656
- export { TangramConstructPlugin, TangramNBackPlugin, TangramPrepPlugin };
822
+ export { TangramAFCPlugin, TangramConstructPlugin, TangramNBackPlugin, TangramPrepPlugin };