jspsych 7.3.3 → 8.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.
Files changed (58) hide show
  1. package/README.md +1 -1
  2. package/css/jspsych.css +19 -11
  3. package/dist/index.browser.js +3082 -3399
  4. package/dist/index.browser.js.map +1 -1
  5. package/dist/index.browser.min.js +6 -2
  6. package/dist/index.browser.min.js.map +1 -1
  7. package/dist/index.cjs +2464 -3327
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.ts +990 -12
  10. package/dist/index.js +2463 -3325
  11. package/dist/index.js.map +1 -1
  12. package/package.json +6 -5
  13. package/src/ExtensionManager.spec.ts +123 -0
  14. package/src/ExtensionManager.ts +81 -0
  15. package/src/JsPsych.ts +195 -690
  16. package/src/ProgressBar.spec.ts +60 -0
  17. package/src/ProgressBar.ts +60 -0
  18. package/src/index.scss +29 -8
  19. package/src/index.ts +4 -9
  20. package/src/modules/data/DataCollection.ts +1 -1
  21. package/src/modules/data/DataColumn.ts +12 -1
  22. package/src/modules/data/index.ts +92 -103
  23. package/src/modules/extensions.ts +4 -0
  24. package/src/modules/plugin-api/AudioPlayer.ts +101 -0
  25. package/src/modules/plugin-api/KeyboardListenerAPI.ts +1 -1
  26. package/src/modules/plugin-api/MediaAPI.ts +48 -106
  27. package/src/modules/plugin-api/__mocks__/AudioPlayer.ts +38 -0
  28. package/src/modules/plugin-api/index.ts +11 -14
  29. package/src/modules/plugins.ts +26 -27
  30. package/src/modules/randomization.ts +1 -1
  31. package/src/timeline/Timeline.spec.ts +921 -0
  32. package/src/timeline/Timeline.ts +342 -0
  33. package/src/timeline/TimelineNode.ts +174 -0
  34. package/src/timeline/Trial.spec.ts +897 -0
  35. package/src/timeline/Trial.ts +419 -0
  36. package/src/timeline/index.ts +232 -0
  37. package/src/timeline/util.spec.ts +124 -0
  38. package/src/timeline/util.ts +146 -0
  39. package/dist/JsPsych.d.ts +0 -112
  40. package/dist/TimelineNode.d.ts +0 -34
  41. package/dist/migration.d.ts +0 -3
  42. package/dist/modules/data/DataCollection.d.ts +0 -46
  43. package/dist/modules/data/DataColumn.d.ts +0 -15
  44. package/dist/modules/data/index.d.ts +0 -25
  45. package/dist/modules/data/utils.d.ts +0 -3
  46. package/dist/modules/extensions.d.ts +0 -22
  47. package/dist/modules/plugin-api/HardwareAPI.d.ts +0 -15
  48. package/dist/modules/plugin-api/KeyboardListenerAPI.d.ts +0 -34
  49. package/dist/modules/plugin-api/MediaAPI.d.ts +0 -32
  50. package/dist/modules/plugin-api/SimulationAPI.d.ts +0 -44
  51. package/dist/modules/plugin-api/TimeoutAPI.d.ts +0 -17
  52. package/dist/modules/plugin-api/index.d.ts +0 -8
  53. package/dist/modules/plugins.d.ts +0 -136
  54. package/dist/modules/randomization.d.ts +0 -42
  55. package/dist/modules/turk.d.ts +0 -40
  56. package/dist/modules/utils.d.ts +0 -13
  57. package/src/TimelineNode.ts +0 -544
  58. package/src/modules/plugin-api/HardwareAPI.ts +0 -32
package/README.md CHANGED
@@ -63,6 +63,6 @@ Citations help us demonstrate that this library is used and valued, which allows
63
63
  jsPsych is open source project with [numerous contributors](https://github.com/jspsych/jsPsych/graphs/contributors).
64
64
  The project is currently managed by the core team of Josh de Leeuw ([@jodeleeuw](https://github.com/jodeleeuw)), Becky Gilbert ([@becky-gilbert](https://github.com/becky-gilbert)), and Björn Luchterhandt ([@bjoluc](https://github.com/bjoluc)).
65
65
 
66
- jsPsych was created by [Josh de Leeuw](http://www.twitter.com/joshdeleeuw).
66
+ jsPsych was created by [Josh de Leeuw](https://www.vassar.edu/faculty/jdeleeuw).
67
67
 
68
68
  We're also grateful for the generous support from a [Mozilla Open Source Support award](https://www.mozilla.org/en-US/moss/), which funded development of the library from 2020-2022.
package/css/jspsych.css CHANGED
@@ -330,11 +330,8 @@
330
330
  }
331
331
 
332
332
  .jspsych-content {
333
- max-width: 95%;
334
- /* this is mainly an IE 10-11 fix */
335
333
  text-align: center;
336
- margin: auto;
337
- /* this is for overflowing content */
334
+ margin: auto; /* this is for overflowing content */
338
335
  }
339
336
 
340
337
  .jspsych-top {
@@ -358,11 +355,24 @@
358
355
  font-size: 14px;
359
356
  }
360
357
 
361
- /* borrowing Bootstrap style for btn elements, but combining styles a bit */
358
+ /* Buttons and Button Groups */
359
+ .jspsych-btn-group-flex {
360
+ display: flex;
361
+ justify-content: center;
362
+ }
363
+
364
+ .jspsych-btn-group-grid {
365
+ display: grid;
366
+ grid-auto-columns: max-content;
367
+ max-width: fit-content;
368
+ margin-right: auto;
369
+ margin-left: auto;
370
+ }
371
+
362
372
  .jspsych-btn {
363
373
  display: inline-block;
364
- padding: 6px 12px;
365
- margin: 0px;
374
+ padding: 8px 12px;
375
+ margin: 0.75em;
366
376
  font-size: 14px;
367
377
  font-weight: 400;
368
378
  font-family: "Open Sans", "Arial", sans-serif;
@@ -411,7 +421,6 @@
411
421
  outline: none;
412
422
  }
413
423
 
414
- /* track */
415
424
  .jspsych-slider::-webkit-slider-runnable-track {
416
425
  appearance: none;
417
426
  -webkit-appearance: none;
@@ -446,7 +455,6 @@
446
455
  border: 1px solid #aaa;
447
456
  }
448
457
 
449
- /* thumb */
450
458
  .jspsych-slider::-webkit-slider-thumb {
451
459
  border: 1px solid #666;
452
460
  height: 24px;
@@ -477,7 +485,7 @@
477
485
  margin-top: -2px;
478
486
  }
479
487
 
480
- /* jsPsych progress bar */
488
+ /* progress bar */
481
489
  #jspsych-progressbar-container {
482
490
  color: #555;
483
491
  border-bottom: 1px solid #dedede;
@@ -510,7 +518,7 @@
510
518
  height: 100%;
511
519
  }
512
520
 
513
- /* Control appearance of jsPsych.data.displayData() */
521
+ /* Appearance of jsPsych.data.displayData() */
514
522
  #jspsych-data-display {
515
523
  text-align: left;
516
524
  }