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/prep/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 },
|
|
@@ -50,10 +51,15 @@ const CONFIG = {
|
|
|
50
51
|
quickstashDiamAnchors: 7,
|
|
51
52
|
// num anchors req'd to be in single quickstash slot
|
|
52
53
|
primitiveDiamAnchors: 5
|
|
53
|
-
}
|
|
54
|
+
},
|
|
55
|
+
defaults: { maxQuickstashSlots: 1 }
|
|
56
|
+
},
|
|
54
57
|
game: {
|
|
55
58
|
snapRadiusPx: 15,
|
|
56
|
-
showBorders: false
|
|
59
|
+
showBorders: false,
|
|
60
|
+
hideTouchingBorders: true,
|
|
61
|
+
silhouettesBelowPieces: true
|
|
62
|
+
}
|
|
57
63
|
};
|
|
58
64
|
|
|
59
65
|
function isComposite(bp) {
|
|
@@ -3472,14 +3478,20 @@ function GameBoard(props) {
|
|
|
3472
3478
|
lineHeight: 1.5,
|
|
3473
3479
|
textAlign: "center"
|
|
3474
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;
|
|
3475
3487
|
const timerStyle = {
|
|
3476
3488
|
position: "absolute",
|
|
3477
|
-
right:
|
|
3489
|
+
right: `${distanceFromRightEdgePx + offsetLeft}px`,
|
|
3478
3490
|
fontSize: "24px",
|
|
3479
3491
|
fontWeight: "bold",
|
|
3480
3492
|
fontFamily: "monospace",
|
|
3481
3493
|
color: "#333",
|
|
3482
|
-
|
|
3494
|
+
whiteSpace: "nowrap",
|
|
3483
3495
|
textAlign: "right"
|
|
3484
3496
|
};
|
|
3485
3497
|
const gameboardWrapperStyle = {
|