blocks can specify primary category

This commit is contained in:
Loren Norman 2025-07-24 11:51:42 -04:00
parent eaaaf03b4f
commit 38a850cdd7
3 changed files with 4 additions and 1 deletions

View file

@ -4,6 +4,7 @@ export default {
name: "Compare Numbers",
colour: 120,
inputsInline: true,
primaryCategory: "Math",
description: "Numerically compare two given values using the selected math operation.",
connections: {

View file

@ -4,6 +4,7 @@ export default {
name: "Compare Text",
colour: 180,
inputsInline: true,
primaryCategory: "Logic",
description: "Compare two chunks of text for equality, inequality, or inclusion.",
connections: {

View file

@ -40,7 +40,7 @@ class BlockDefinition {
disabled = false
categories = []
primaryCategory = null
getCategories() {
@ -131,6 +131,7 @@ BlockDefinition.parseRawDefinition = function(rawBlockDefinition, definitionPath
blockDef.definitionJS = rawBlockDefinition
blockDef.type = rawBlockDefinition.type
blockDef.name = rawBlockDefinition.name
blockDef.primaryCategory = rawBlockDefinition.primaryCategory
blockDef.description = rawBlockDefinition.description
? niceTemplate(rawBlockDefinition.description)
: ""