Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ed-components/ed-components

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ed-components/ed-components

A set of web-components for education.

  • 0.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

ed-components · GitHub license npm version

A set of web-components for education.

Components

Not ready for production yet. These components are used for research.

Wrapper components

Single answer components

WIP

Importing all elements

Components are published as npm packages, you can easily import all components and register it with the ed-components file including side-effects.

import  "https://esm.sh/@ed-components/ed-components/ed-components";

You can also install locally with npm i @ed-components/ed-components and then in your code.

import  "@ed-components/ed-components/ed-components";

A registerComponents function is also provided.

import  registerElements from "https://esm.sh/@ed-components/ed-components";
registerElements()

With local package:

import  registerElements from "@ed-components/ed-components";
registerElements()

You also can register the elements you use and rename them. See dedicated pages for each component.

Styling

Via CSS custom properties (variables) inspired by bootstrap.

  • --ed-primary
  • --ed-success
  • --ed-danger

User interface layout

Ideas comes from Edx licensed CC-BY-SA.

The learner view of a problem from edx CC-BY-SA

  1. Problem text.
  2. Response field.
  3. Rendered answer.
  4. Submit.
  5. Attempts.
  6. Save.
  7. Reset.
  8. Show Answer.
  9. Feedback.

Feedbacks view in edx

Development

Programming guide

  1. Element class names are on the form EdXyzElement and have a static method define that allow to register element in the custom registry with default name ed-xyz. See webcomponents.guide.
  2. The documenation of components follows Custom Element manifest JSDoc.

Testing with Web Test Runner

All components are tested from the components directory.

To execute all tests npm run test, in watch mode: npm run test:watch.

To execute test for a single component, pass the test group to wtr:

npm run test -- --group ed-survey

TODO

  • Share submit button with localization.
  • Localize.

Keywords

FAQs

Package last updated on 15 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc