npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dodona/widgets

v0.1.7

Published

This repository hosts web components for the Dodona platform. Currently, it contains a single component: the **Parsons Puzzle**.

Readme

Dodona Widgets (@dodona/widgets)

This repository hosts web components for the Dodona platform. Currently, it contains a single component: the Parsons Puzzle.

Project Structure

  • src/common/: Shared utilities and styles
  • src/parsons/: Parsons Widget source
    • core/: Logic (Grader, Parser, i18n)
    • dw-parsons-puzzle.ts: Main component
    • dw-parsons-block.ts: Block component
  • demo/: Interactive Puzzle Builder & Demo page

Installation

npm install @dodona/widgets

[!IMPORTANT] This package requires lit and highlight.js as peer dependencies. Ensure they are installed in your project:

npm install lit highlight.js

Development

npm install
npm run dev
npm run build      # Build library (dist/)
npm run build:demo # Build demo application
npm run test
npm run lint:css
npm run format

Publishing

To publish a new version of the package:

  1. Login to npm (if not already logged in):
    npm login
  2. Bump the version:
    npm version patch # or minor, major
  3. Publish:
    npm publish
    (This will automatically run the build script before publishing).

Parsons Puzzle (dw-parsons-puzzle)

A web component for Parsons Puzzles, built with Lit.

Features

  • Drag and Drop Interface: Drag code blocks from source to solution.
  • Indentation Support: Drag blocks horizontally or use buttons to indent/unindent.
  • Distractors: Support for distractor blocks (incorrect code options).
  • Custom Separators: Configure block separators via attributes.
  • Syntax Highlighting: Python syntax highlighting using Highlight.js.
  • Accessibility: Keyboard accessible controls and ARIA support.
  • Internationalization: Support for English and Dutch with automatic language detection.
  • Theming: Fully customizable via CSS variables.

Usage

Basic Example

<script type="module" src="/src/index.ts"></script>

<dw-parsons-puzzle>
  <pre>
def hello():
    print("Hello World")
</pre>
</dw-parsons-puzzle>

Configuration

| Attribute | Type | Default | Description | | :--------------------- | :----- | :------ | :------------------------------------------------------------------ | | separator | String | --- | The separator string used to split code blocks. | | distractor-separator | String | ??? | The separator string used to mark subsequent blocks as distractors. | | language | String | en | The language for UI and feedback (en or nl). |

[!NOTE] If no separators are found in the content, the component will automatically split the code into blocks by line.

Internationalization

The component fully supports English (en) and Dutch (nl). This includes all UI buttons, tooltips, and pedagogical feedback from the grader.

Language Detection Priority:

  1. Direct Attribute: <dw-parsons-puzzle language="nl"></dw-parsons-puzzle>
  2. Parent Attribute: Looks for the closest ancestor with a lang attribute (e.g., <html lang="nl">).
  3. Fallback: Defaults to English (en).

The component automatically reacts to changes in the language attribute at runtime.

Events

The component dispatches a custom event when the solution is graded.

| Event Name | Detail Structure | Description | | :-------------- | :--------------- | :------------------------------------------------- | | puzzle-graded | GradingResult | Fired when the "Check Solution" button is clicked. |

Event Detail Example (e.detail):

{
  "isCorrect": false,
  "feedback": [
    { "key": "wrong_indent", "params": { "line": 2 } }
  ],
  "blockStatuses": {
    "block-id-123": "correct",
    "block-id-456": "indent"
  }
}

Listening for the event:

document.querySelector('dw-parsons-puzzle').addEventListener('puzzle-graded', (e) => {
  console.log('Is correct:', e.detail.isCorrect);
});

Theming

The component uses CSS variables for styling.

| Variable | Default | Description | | :------------------- | :-------- | :---------------------------------- | | --dw-primary-color | #6366f1 | Primary accent color (Indigo 500) | | --dw-on-primary-color| #fff | Text color on primary buttons | | --dw-bg-color | #f9fafb | Main background color | | --dw-surface-color | #fff | Block/Card background color | | --dw-border-color | #e5e7eb | Border color | | --dw-text-color | #1f2937 | Primary text color | | --dw-text-light | #6b7280 | Muted text color | | --dw-success-color | #10b981 | Success status color (Emerald 500) | | --dw-error-color | #ef4444 | Error status color (Red 500) | | --dw-warning-color | #f59e0b | Warning status color (Amber 500) |