A hyperscript helper for creating Slate documents with JSX-like syntax.
90
{
"context": "This criteria evaluates the engineer's ability to integrate a custom editor factory with slate-hyperscript using the createHyperscript function. The focus is on correct usage of the creators option for custom factory logic and the elements option for element shortcuts.",
"type": "weighted_checklist",
"checklist": [
{
"name": "createHyperscript usage",
"description": "Uses the createHyperscript function from slate-hyperscript to create a custom hyperscript helper",
"max_score": 15
},
{
"name": "Custom editor creator",
"description": "Implements a custom creator function for the 'editor' tag and passes it via the creators option to createHyperscript",
"max_score": 25
},
{
"name": "Editor metadata",
"description": "The custom editor creator adds both id and createdAt properties to created editors",
"max_score": 15
},
{
"name": "ID counter logic",
"description": "The id property uses a counter that starts at 1 and increments with each editor created (maintains state across calls)",
"max_score": 10
},
{
"name": "Validation logic",
"description": "The custom editor creator validates that editors have at least one child and throws an error with the specified message when validation fails",
"max_score": 15
},
{
"name": "Element shortcuts",
"description": "Uses the elements option to define shortcuts for paragraph and heading elements with the correct default properties (paragraph with type: 'paragraph', heading with type: 'heading' and level: 1)",
"max_score": 15
},
{
"name": "JSX export",
"description": "Exports the custom hyperscript helper as jsx so it can be used with JSX syntax in tests",
"max_score": 5
}
]
}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