jspsych-tangram 0.0.13 → 0.0.14

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 (38) hide show
  1. package/dist/construct/index.browser.js +3873 -4515
  2. package/dist/construct/index.browser.js.map +1 -1
  3. package/dist/construct/index.browser.min.js +13 -13
  4. package/dist/construct/index.browser.min.js.map +1 -1
  5. package/dist/construct/index.cjs +16 -6
  6. package/dist/construct/index.cjs.map +1 -1
  7. package/dist/construct/index.js +16 -6
  8. package/dist/construct/index.js.map +1 -1
  9. package/dist/index.cjs +17 -7
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.js +17 -7
  12. package/dist/index.js.map +1 -1
  13. package/dist/nback/index.browser.js +3900 -4515
  14. package/dist/nback/index.browser.js.map +1 -1
  15. package/dist/nback/index.browser.min.js +12 -12
  16. package/dist/nback/index.browser.min.js.map +1 -1
  17. package/dist/nback/index.cjs +42 -5
  18. package/dist/nback/index.cjs.map +1 -1
  19. package/dist/nback/index.js +42 -5
  20. package/dist/nback/index.js.map +1 -1
  21. package/dist/prep/index.browser.js +3875 -4515
  22. package/dist/prep/index.browser.js.map +1 -1
  23. package/dist/prep/index.browser.min.js +13 -13
  24. package/dist/prep/index.browser.min.js.map +1 -1
  25. package/dist/prep/index.cjs +19 -7
  26. package/dist/prep/index.cjs.map +1 -1
  27. package/dist/prep/index.js +19 -7
  28. package/dist/prep/index.js.map +1 -1
  29. package/package.json +1 -1
  30. package/src/core/components/board/GameBoard.tsx +13 -42
  31. package/src/core/components/board/useGameBoard.ts +52 -0
  32. package/src/core/components/index.ts +4 -2
  33. package/src/core/components/pieces/BlueprintRing.tsx +0 -25
  34. package/src/core/components/pieces/useBlueprintRing.ts +39 -0
  35. package/src/plugins/tangram-nback/NBackApp.tsx +1 -1
  36. package/tangram-construct.min.js +13 -13
  37. package/tangram-nback.min.js +12 -12
  38. package/tangram-prep.min.js +13 -13
@@ -16,8 +16,9 @@ const CONFIG = {
16
16
  silhouetteMask: "#374151",
17
17
  anchors: { invalid: "#7dd3fc", valid: "#475569" },
18
18
  // validFill used here for placed composites
19
- piece: { draggingFill: "#8e7cc3", validFill: "#8e7cc3", invalidFill: "#d55c00", invalidStroke: "#dc2626", allGreenStroke: "#86efac"},
20
- blueprint: { fill: "#374151", badgeFill: "#000000", labelFill: "#ffffff" },
19
+ piece: { draggingFill: "#8e7cc3", validFill: "#8e7cc3", invalidFill: "#d55c00", invalidStroke: "#dc2626", selectedStroke: "#674ea7", allGreenStroke: "#86efac", borderStroke: "#674ea7" },
20
+ ui: { light: "#60a5fa", dark: "#1d4ed8" },
21
+ blueprint: { fill: "#374151", selectedStroke: "#111827", badgeFill: "#000000", labelFill: "#ffffff" },
21
22
  tangramDecomposition: { stroke: "#fef2cc" },
22
23
  primitiveColors: [
23
24
  // from seaborn "colorblind" palette, 6 colors, with red omitted
@@ -36,7 +37,7 @@ const CONFIG = {
36
37
  piece: { invalid: 1, dragging: 1, locked: 1, normal: 1 }
37
38
  },
38
39
  size: {
39
- stroke: { bandPx: 5, allGreenStrokePx: 10, tangramDecompositionPx: 1 },
40
+ stroke: { bandPx: 5, pieceSelectedPx: 5, allGreenStrokePx: 10, pieceBorderPx: 2, tangramDecompositionPx: 1 },
40
41
  anchorRadiusPx: { valid: 1, invalid: 1 },
41
42
  badgeFontPx: 16,
42
43
  centerBadge: { fractionOfOuterR: 0.15, minPx: 20, marginPx: 4 },
@@ -57,7 +58,10 @@ const CONFIG = {
57
58
  },
58
59
  game: {
59
60
  snapRadiusPx: 15,
60
- showBorders: false}
61
+ showBorders: false,
62
+ hideTouchingBorders: true,
63
+ silhouettesBelowPieces: true
64
+ }
61
65
  };
62
66
 
63
67
  function isComposite(bp) {
@@ -3476,14 +3480,20 @@ function GameBoard(props) {
3476
3480
  lineHeight: 1.5,
3477
3481
  textAlign: "center"
3478
3482
  };
3483
+ const scaleX = svgDimensions.width / viewBox.w;
3484
+ const rightEdgeOfSemicircleLogical = viewBox.w / 2 + layout.outerR;
3485
+ const distanceFromRightEdgeLogical = viewBox.w - rightEdgeOfSemicircleLogical;
3486
+ const distanceFromRightEdgePx = distanceFromRightEdgeLogical * scaleX;
3487
+ const charWidth = 24 * 0.6;
3488
+ const offsetLeft = charWidth * 5;
3479
3489
  const timerStyle = {
3480
3490
  position: "absolute",
3481
- right: 0,
3491
+ right: `${distanceFromRightEdgePx + offsetLeft}px`,
3482
3492
  fontSize: "24px",
3483
3493
  fontWeight: "bold",
3484
3494
  fontFamily: "monospace",
3485
3495
  color: "#333",
3486
- minWidth: "80px",
3496
+ whiteSpace: "nowrap",
3487
3497
  textAlign: "right"
3488
3498
  };
3489
3499
  const gameboardWrapperStyle = {