jspsych 7.3.4 → 8.0.1

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 +18 -8
  3. package/dist/index.browser.js +3097 -4286
  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 +2331 -4066
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.ts +984 -6
  10. package/dist/index.js +2330 -4066
  11. package/dist/index.js.map +1 -1
  12. package/package.json +6 -5
  13. package/src/ExtensionManager.spec.ts +121 -0
  14. package/src/ExtensionManager.ts +100 -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,7 +330,6 @@
330
330
  }
331
331
 
332
332
  .jspsych-content {
333
- max-width: 95%; /* this is mainly an IE 10-11 fix */
334
333
  text-align: center;
335
334
  margin: auto; /* this is for overflowing content */
336
335
  }
@@ -356,11 +355,24 @@
356
355
  font-size: 14px;
357
356
  }
358
357
 
359
- /* 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
+
360
372
  .jspsych-btn {
361
373
  display: inline-block;
362
- padding: 6px 12px;
363
- margin: 0px;
374
+ padding: 8px 12px;
375
+ margin: 0.75em;
364
376
  font-size: 14px;
365
377
  font-weight: 400;
366
378
  font-family: "Open Sans", "Arial", sans-serif;
@@ -409,7 +421,6 @@
409
421
  outline: none;
410
422
  }
411
423
 
412
- /* track */
413
424
  .jspsych-slider::-webkit-slider-runnable-track {
414
425
  appearance: none;
415
426
  -webkit-appearance: none;
@@ -444,7 +455,6 @@
444
455
  border: 1px solid #aaa;
445
456
  }
446
457
 
447
- /* thumb */
448
458
  .jspsych-slider::-webkit-slider-thumb {
449
459
  border: 1px solid #666;
450
460
  height: 24px;
@@ -475,7 +485,7 @@
475
485
  margin-top: -2px;
476
486
  }
477
487
 
478
- /* jsPsych progress bar */
488
+ /* progress bar */
479
489
  #jspsych-progressbar-container {
480
490
  color: #555;
481
491
  border-bottom: 1px solid #dedede;
@@ -508,7 +518,7 @@
508
518
  height: 100%;
509
519
  }
510
520
 
511
- /* Control appearance of jsPsych.data.displayData() */
521
+ /* Appearance of jsPsych.data.displayData() */
512
522
  #jspsych-data-display {
513
523
  text-align: left;
514
524
  }