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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ephox/darwin

v8.2.1

Published

This project's purpose is to handle selection and cursor navigation.

Downloads

2,717

Readme

Description

Once completed, it is hoped that darwin will provide a framework for taking over selection entirely (like a DOM-based editor). At this stage, it is only being used for tables.

Installation

darwin is available as an npm package. You can install it via the npm package @ephox/darwin

Install from npm

npm install @ephox/darwin

Usage

  1. Handling Webkit Up/Down in a Table

For Webkit browsers, when the user presses Up or Down, the native behaviour is to move to the next cell horizontally, not vertically. This confuses the user. The project darwin seeks to remedy this by potentially overriding the Up/Down key event.

With current the (element, offset) a. If the user is on a (or referencing a by the parent offset), and the respective adjacent node is the edge of cell, restart the process but start from the edge of the cell. If the adjacent node is not the edge, DO NOT OVERRIDE the key. The browser should naturally move to the adjacent node. b. If the user is not in a , continue the process

c. find the (x, y) coordinate of the (element, offset) and shift it in the respective direction. Continue shifting until we find an element that contains this (x, y) position and the element's y position is different from the initial y position. Note, if we don't ... then DO NOT OVERRIDE the key. d. find the element under the shifted (x, y) position, scrolling if necessary e. assess this element by comparing it with the original element

i. if the elements are in different rows, and the x values overlap, then this is the cell above/below the other one, and we have a successful override. OVERRIDE the key event. ii. if the elements are in different cells, and either different rows with a non x value overlap or the same row, repeat (c) with the respective edge of the cell. iii. DO NOT OVERRIDE the key event.

The purpose is that we are only overriding the key event if:

  1. we find an element that is horizontally aligned with the original element with a y value in the right direction.

Note, if we don't override the key, then the browser's default handling is considered good enough. This will be the case for pressing up/down near br tags that are not at the edge of the cell.