CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-slate-hyperscript

A hyperscript helper for creating Slate documents with JSX-like syntax.

90

1.15x
Overview
Eval results
Files

rubric.jsonevals/scenario-9/

{
  "context": "This criteria evaluates how effectively the engineer uses slate-hyperscript's explicit selection feature with path and offset attributes to create Slate editor test fixtures. The focus is on proper usage of the <selection>, <anchor>, and <focus> tags with path and offset attributes.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Import slate-hyperscript",
      "description": "Correctly imports jsx or createHyperscript from slate-hyperscript package",
      "max_score": 10
    },
    {
      "name": "Use <editor> tag",
      "description": "Creates editor state using the <editor> JSX tag from slate-hyperscript",
      "max_score": 10
    },
    {
      "name": "Use <selection> tag",
      "description": "Uses the <selection> JSX tag to create explicit selections separate from the document structure",
      "max_score": 20
    },
    {
      "name": "Use <anchor> with path",
      "description": "Uses the <anchor> tag with path attribute (array of numbers) to specify the anchor point of the selection",
      "max_score": 15
    },
    {
      "name": "Use <anchor> with offset",
      "description": "Uses the <anchor> tag with offset attribute (number) to specify the character position within the anchor text node",
      "max_score": 10
    },
    {
      "name": "Use <focus> with path",
      "description": "Uses the <focus> tag with path attribute (array of numbers) to specify the focus point of the selection",
      "max_score": 15
    },
    {
      "name": "Use <focus> with offset",
      "description": "Uses the <focus> tag with offset attribute (number) to specify the character position within the focus text node",
      "max_score": 10
    },
    {
      "name": "Handle collapsed selections",
      "description": "Correctly creates collapsed selections (cursor) by using identical path and offset values for both anchor and focus",
      "max_score": 5
    },
    {
      "name": "Handle range selections",
      "description": "Correctly creates range selections with different path or offset values for anchor and focus",
      "max_score": 5
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-slate-hyperscript

tile.json