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.
@@ -16661,26 +16661,27 @@ var TangramConstructPlugin = (function (jspsych) {
16661
16661
  const CONFIG = {
16662
16662
  color: {
16663
16663
  bands: {
16664
- silhouette: { fillEven: "#eef2ff", fillOdd: "#f6f7fb", stroke: "#c7d2fe" },
16665
- workspace: { fillEven: "#f3f4f6", fillOdd: "#f9fafb", stroke: "#e5e7eb" }
16664
+ silhouette: { fillEven: "#fff2ccff", fillOdd: "#fff2ccff", stroke: "#b1b1b1" },
16665
+ workspace: { fillEven: "#fff2ccff", fillOdd: "#fff2ccff", stroke: "#b1b1b1" }
16666
16666
  },
16667
- completion: { fill: "#dcfce7", stroke: "#86efac" },
16668
- silhouetteMask: "#94a3b8",
16667
+ completion: { fill: "#ccfff2", stroke: "#13da57" },
16668
+ silhouetteMask: "#374151",
16669
16669
  anchors: { invalid: "#7dd3fc", valid: "#475569" },
16670
- piece: { draggingFill: "#1d4ed8", validFill: "#60a5fa", invalidFill: "#ef4444", invalidStroke: "#dc2626", selectedStroke: "#111827", allGreenStroke: "#86efac", borderStroke: "#374151" },
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: "#eef2ff", labelFill: "#374151" }
16672
+ blueprint: { fill: "#374151", selectedStroke: "#111827", badgeFill: "#000000", labelFill: "#ffffff" }
16673
16673
  },
16674
16674
  opacity: {
16675
- blueprint: 0.95,
16676
- silhouetteMask: 0.45,
16677
- anchors: { valid: 0.8, invalid: 0.5 },
16678
- piece: { invalid: 0.35, dragging: 0.6, locked: 0.7, normal: 0.95 }
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: 1, pieceSelectedPx: 1.5, allGreenStrokePx: 6, pieceBorderPx: 1 },
16682
+ stroke: { bandPx: 5, pieceSelectedPx: 3, allGreenStrokePx: 10, pieceBorderPx: 2 },
16682
16683
  anchorRadiusPx: { valid: 1, invalid: 1 },
16683
- badgeFontPx: 12,
16684
+ badgeFontPx: 16,
16684
16685
  centerBadge: { fractionOfOuterR: 0.15, minPx: 20, marginPx: 4 }
16685
16686
  },
16686
16687
  layout: {
@@ -20258,6 +20259,7 @@ var TangramConstructPlugin = (function (jspsych) {
20258
20259
  "medtriangle",
20259
20260
  "largetriangle"
20260
20261
  ]);
20262
+ const PRIMITIVE_BLUEPRINTS_ORDERED = [...PRIMITIVE_BLUEPRINTS].sort((a, b) => params.primitiveOrder.indexOf(a.kind) - params.primitiveOrder.indexOf(b.kind));
20261
20263
  const sectors = params.tangrams.map((tangramSpec, index) => {
20262
20264
  const filteredTans = tangramSpec.solutionTans.filter((tan) => {
20263
20265
  const tanName = tan.name ?? tan.kind;
@@ -20284,7 +20286,7 @@ var TangramConstructPlugin = (function (jspsych) {
20284
20286
  const firstMacro = params.quickstash_macros[0];
20285
20287
  if (firstMacro && "parts" in firstMacro && firstMacro.parts && firstMacro.parts[0] && "anchorOffset" in firstMacro.parts[0]) {
20286
20288
  const primsByKind = /* @__PURE__ */ new Map();
20287
- PRIMITIVE_BLUEPRINTS.forEach((p) => primsByKind.set(p.kind, p));
20289
+ PRIMITIVE_BLUEPRINTS_ORDERED.forEach((p) => primsByKind.set(p.kind, p));
20288
20290
  quickstash = params.quickstash_macros.map(
20289
20291
  (anchorComposite) => convertAnchorCompositeToPixels(anchorComposite, primsByKind, CONFIG.layout.grid.stepPx)
20290
20292
  // Use current CONFIG grid step
@@ -20296,7 +20298,7 @@ var TangramConstructPlugin = (function (jspsych) {
20296
20298
  const gameBoardProps = {
20297
20299
  sectors,
20298
20300
  quickstash,
20299
- primitives: PRIMITIVE_BLUEPRINTS,
20301
+ primitives: PRIMITIVE_BLUEPRINTS_ORDERED,
20300
20302
  layout: params.layout,
20301
20303
  target: params.target,
20302
20304
  input: params.input,
@@ -20327,6 +20329,12 @@ var TangramConstructPlugin = (function (jspsych) {
20327
20329
  default: [],
20328
20330
  description: "Array of MacroSpec objects created in prep trial"
20329
20331
  },
20332
+ /** Array of primitive names in the order they should be displayed */
20333
+ primitive_order: {
20334
+ type: jspsych.ParameterType.OBJECT,
20335
+ default: ["square", "smalltriangle", "parallelogram", "medtriangle", "largetriangle"],
20336
+ description: "Array of primitive names in the order they should be displayed"
20337
+ },
20330
20338
  /** Whether to place pieces in workspace or directly on silhouette */
20331
20339
  target: {
20332
20340
  type: jspsych.ParameterType.SELECT,
@@ -20428,6 +20436,7 @@ var TangramConstructPlugin = (function (jspsych) {
20428
20436
  const params = {
20429
20437
  tangrams: trial.tangrams,
20430
20438
  quickstash_macros: trial.quickstash_macros,
20439
+ primitiveOrder: trial.primitive_order,
20431
20440
  target: trial.target,
20432
20441
  input: trial.input,
20433
20442
  layout: trial.layout,