jspsych-tangram 0.0.5 → 0.0.7
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 +23 -14
- package/dist/construct/index.browser.js.map +1 -1
- package/dist/construct/index.browser.min.js +11 -11
- package/dist/construct/index.browser.min.js.map +1 -1
- package/dist/construct/index.cjs +23 -14
- package/dist/construct/index.cjs.map +1 -1
- package/dist/construct/index.d.ts +12 -0
- package/dist/construct/index.js +23 -14
- package/dist/construct/index.js.map +1 -1
- package/dist/index.cjs +34 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +24 -0
- package/dist/index.js +34 -16
- package/dist/index.js.map +1 -1
- package/dist/prep/index.browser.js +24 -14
- package/dist/prep/index.browser.js.map +1 -1
- package/dist/prep/index.browser.min.js +11 -11
- package/dist/prep/index.browser.min.js.map +1 -1
- package/dist/prep/index.cjs +24 -14
- package/dist/prep/index.cjs.map +1 -1
- package/dist/prep/index.d.ts +12 -0
- package/dist/prep/index.js +24 -14
- package/dist/prep/index.js.map +1 -1
- package/package.json +1 -1
- package/src/core/config/config.ts +13 -12
- package/src/plugins/tangram-construct/ConstructionApp.tsx +6 -2
- package/src/plugins/tangram-construct/index.ts +7 -0
- package/src/plugins/tangram-prep/PrepApp.tsx +8 -2
- package/src/plugins/tangram-prep/index.ts +7 -0
- package/tangram-construct.min.js +11 -11
- package/tangram-prep.min.js +11 -11
|
@@ -16661,26 +16661,27 @@ var TangramPrepPlugin = (function (jspsych) {
|
|
|
16661
16661
|
const CONFIG = {
|
|
16662
16662
|
color: {
|
|
16663
16663
|
bands: {
|
|
16664
|
-
silhouette: { fillEven: "#
|
|
16665
|
-
workspace: { fillEven: "#
|
|
16664
|
+
silhouette: { fillEven: "#fff2ccff", fillOdd: "#fff2ccff", stroke: "#b1b1b1" },
|
|
16665
|
+
workspace: { fillEven: "#fff2ccff", fillOdd: "#fff2ccff", stroke: "#b1b1b1" }
|
|
16666
16666
|
},
|
|
16667
|
-
completion: { fill: "#
|
|
16668
|
-
silhouetteMask: "#
|
|
16667
|
+
completion: { fill: "#ccfff2", stroke: "#13da57" },
|
|
16668
|
+
silhouetteMask: "#374151",
|
|
16669
16669
|
anchors: { invalid: "#7dd3fc", valid: "#475569" },
|
|
16670
|
-
piece: { draggingFill: "#
|
|
16670
|
+
piece: { draggingFill: "#8e7cc3ff", validFill: "#8e7cc3ff", invalidFill: "#ef4444", invalidStroke: "#dc2626", selectedStroke: "#674ea7", allGreenStroke: "#86efac", borderStroke: "#674ea7" },
|
|
16671
16671
|
ui: { light: "#60a5fa", dark: "#1d4ed8" },
|
|
16672
|
-
blueprint: { fill: "#374151", selectedStroke: "#111827", badgeFill: "#
|
|
16672
|
+
blueprint: { fill: "#374151", selectedStroke: "#111827", badgeFill: "#000000", labelFill: "#ffffff" }
|
|
16673
16673
|
},
|
|
16674
16674
|
opacity: {
|
|
16675
|
-
blueprint: 0.
|
|
16676
|
-
silhouetteMask: 0.
|
|
16677
|
-
anchors: { valid: 0.
|
|
16678
|
-
|
|
16675
|
+
blueprint: 0.4,
|
|
16676
|
+
silhouetteMask: 0.25,
|
|
16677
|
+
//anchors: { valid: 0.80, invalid: 0.50 },
|
|
16678
|
+
anchors: { invalid: 0, valid: 0 },
|
|
16679
|
+
piece: { invalid: 0.35, dragging: 0.75, locked: 1, normal: 1 }
|
|
16679
16680
|
},
|
|
16680
16681
|
size: {
|
|
16681
|
-
stroke: { bandPx:
|
|
16682
|
+
stroke: { bandPx: 5, pieceSelectedPx: 3, allGreenStrokePx: 10, pieceBorderPx: 2 },
|
|
16682
16683
|
anchorRadiusPx: { valid: 1, invalid: 1 },
|
|
16683
|
-
badgeFontPx:
|
|
16684
|
+
badgeFontPx: 16,
|
|
16684
16685
|
centerBadge: { fractionOfOuterR: 0.15, minPx: 20, marginPx: 4 }
|
|
16685
16686
|
},
|
|
16686
16687
|
layout: {
|
|
@@ -20259,9 +20260,11 @@ var TangramPrepPlugin = (function (jspsych) {
|
|
|
20259
20260
|
layoutMode,
|
|
20260
20261
|
requireAllSlots,
|
|
20261
20262
|
quickstashMacros,
|
|
20263
|
+
primitiveOrder,
|
|
20262
20264
|
onInteraction,
|
|
20263
20265
|
onTrialEnd
|
|
20264
20266
|
} = params;
|
|
20267
|
+
const PRIMITIVE_BLUEPRINTS_ORDERED = [...PRIMITIVE_BLUEPRINTS].sort((a, b) => primitiveOrder.indexOf(a.kind) - primitiveOrder.indexOf(b.kind));
|
|
20265
20268
|
const prepSectors = Array.from({ length: numQuickstashSlots }, (_, i) => ({
|
|
20266
20269
|
id: `prep-sector-${i}`,
|
|
20267
20270
|
tangramId: `prep-sector-${i}`,
|
|
@@ -20275,7 +20278,7 @@ var TangramPrepPlugin = (function (jspsych) {
|
|
|
20275
20278
|
const handleControllerReady = (controller, layout, force) => {
|
|
20276
20279
|
if (quickstashMacros && quickstashMacros.length > 0 && layout) {
|
|
20277
20280
|
const primsByKind = /* @__PURE__ */ new Map();
|
|
20278
|
-
|
|
20281
|
+
PRIMITIVE_BLUEPRINTS_ORDERED.forEach((p) => primsByKind.set(p.kind, p));
|
|
20279
20282
|
quickstashMacros.forEach((anchorComposite, macroIndex) => {
|
|
20280
20283
|
const sectorId = `prep-sector-${macroIndex}`;
|
|
20281
20284
|
const compositeBlueprint = convertAnchorCompositeToPixels(
|
|
@@ -20332,7 +20335,7 @@ var TangramPrepPlugin = (function (jspsych) {
|
|
|
20332
20335
|
sectors: prepSectors,
|
|
20333
20336
|
quickstash: [],
|
|
20334
20337
|
// No pre-made macros
|
|
20335
|
-
primitives:
|
|
20338
|
+
primitives: PRIMITIVE_BLUEPRINTS_ORDERED,
|
|
20336
20339
|
layout: layoutMode,
|
|
20337
20340
|
target: "workspace",
|
|
20338
20341
|
// Pieces go in sectors
|
|
@@ -20393,6 +20396,12 @@ var TangramPrepPlugin = (function (jspsych) {
|
|
|
20393
20396
|
default: [],
|
|
20394
20397
|
description: "Array of AnchorComposite objects to edit as primitive pieces"
|
|
20395
20398
|
},
|
|
20399
|
+
/** Array of primitive names in the order they should be displayed */
|
|
20400
|
+
primitive_order: {
|
|
20401
|
+
type: jspsych.ParameterType.OBJECT,
|
|
20402
|
+
default: ["square", "smalltriangle", "parallelogram", "medtriangle", "largetriangle"],
|
|
20403
|
+
description: "Array of primitive names in the order they should be displayed"
|
|
20404
|
+
},
|
|
20396
20405
|
/** Callback fired after each interaction (optional analytics hook) */
|
|
20397
20406
|
onInteraction: {
|
|
20398
20407
|
type: jspsych.ParameterType.FUNCTION,
|
|
@@ -20443,6 +20452,7 @@ var TangramPrepPlugin = (function (jspsych) {
|
|
|
20443
20452
|
layoutMode: trial.layout,
|
|
20444
20453
|
requireAllSlots: trial.require_all_slots,
|
|
20445
20454
|
quickstashMacros: trial.quickstash_macros,
|
|
20455
|
+
primitiveOrder: trial.primitive_order,
|
|
20446
20456
|
onInteraction: trial.onInteraction,
|
|
20447
20457
|
onTrialEnd: wrappedOnTrialEnd
|
|
20448
20458
|
};
|