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

prosemirror-dropcursor

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prosemirror-dropcursor - npm Package Compare versions

Comparing version 1.1.2 to 1.2.0

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## 1.2.0 (2019-10-08)
### New features
`dropCursor` now takes a new option, `class`, to set the CSS class name of the cursor element. Add class option to in-code docs
## 1.1.2 (2019-09-05)

@@ -2,0 +8,0 @@

9

dist/dropcursor.js

@@ -15,7 +15,10 @@ 'use strict';

//
// color::? string
// color:: ?string
// The color of the cursor. Defaults to `black`.
//
// width::? number
// width:: ?number
// The precise width of the cursor in pixels. Defaults to 1.
//
// class:: ?string
// A CSS class name to add to the cursor element.
function dropCursor(options) {

@@ -35,2 +38,3 @@ if ( options === void 0 ) options = {};

this.color = options.color || "black";
this.class = options.class;
this.cursorPos = null;

@@ -93,2 +97,3 @@ this.element = null;

this.element = parent.appendChild(document.createElement("div"));
if (this.class) { this.element.className = this.class; }
this.element.style.cssText = "position: absolute; z-index: 50; pointer-events: none; background-color: " + this.color;

@@ -95,0 +100,0 @@ }

{
"name": "prosemirror-dropcursor",
"version": "1.1.2",
"version": "1.2.0",
"description": "Drop cursor plugin for ProseMirror",

@@ -5,0 +5,0 @@ "main": "dist/dropcursor.js",

@@ -37,3 +37,7 @@ # prosemirror-dropcursor

Supports two options: `color` to set the color of the cursor (defaults
to black) and `width` to set its with in pixels (defaults to 1).
- **`options`**`: ?Object`
- **`color`**`: ?string (default: black)`
- **`width`**`: ?number (default: 1)`
- **`class`**`: ?string`\
Adds a class to the cursor.\
*Layout overrides such as `width` are not recommended*

@@ -11,7 +11,10 @@ import {Plugin} from "prosemirror-state"

//
// color::? string
// color:: ?string
// The color of the cursor. Defaults to `black`.
//
// width::? number
// width:: ?number
// The precise width of the cursor in pixels. Defaults to 1.
//
// class:: ?string
// A CSS class name to add to the cursor element.
export function dropCursor(options = {}) {

@@ -28,2 +31,3 @@ return new Plugin({

this.color = options.color || "black"
this.class = options.class
this.cursorPos = null

@@ -79,2 +83,3 @@ this.element = null

this.element = parent.appendChild(document.createElement("div"))
if (this.class) this.element.className = this.class
this.element.style.cssText = "position: absolute; z-index: 50; pointer-events: none; background-color: " + this.color

@@ -81,0 +86,0 @@ }

Sorry, the diff of this file is not supported yet

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