A hyperscript helper for creating Slate documents with JSX-like syntax.
90
{
"context": "This criteria evaluates how well the engineer uses slate-hyperscript's extensibility features to implement a custom document builder with element shortcuts, custom creators, and proper precedence handling. The focus is on correct usage of createHyperscript with its elements and creators options.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Import createHyperscript",
"description": "Solution imports the createHyperscript function from slate-hyperscript package",
"max_score": 10
},
{
"name": "Use elements option",
"description": "Solution uses the 'elements' option parameter in createHyperscript to define element shortcuts that map tag names to default properties",
"max_score": 25
},
{
"name": "Use creators option",
"description": "Solution uses the 'creators' option parameter in createHyperscript to define custom creator functions with the signature (tagName, attributes, children)",
"max_score": 25
},
{
"name": "Proper precedence",
"description": "Solution correctly implements the priority system where custom creators override element shortcuts, achieved by passing both elements and creators options to createHyperscript (the package handles precedence automatically)",
"max_score": 20
},
{
"name": "Return JSX function",
"description": "Solution returns the jsx function created by createHyperscript as the document builder function",
"max_score": 10
},
{
"name": "Handle children properly",
"description": "Custom creators correctly process children parameter and return properly structured Slate nodes with children arrays",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-slate-hyperscriptdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10