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