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

prosemirror-commands

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prosemirror-commands - npm Package Compare versions

Comparing version 1.1.5 to 1.1.6

6

CHANGELOG.md

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

## 1.1.6 (2021-02-10)
### Bug fixes
Improve behavior of enter when the entire document is selected.
## 1.1.5 (2021-01-14)

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

12

dist/index.es.js

@@ -278,7 +278,7 @@ import { liftTarget, canJoin, joinPoint, canSplit, ReplaceAroundStep, findWrapping } from 'prosemirror-transform';

function createParagraphNear(state, dispatch) {
var ref = state.selection;
var $from = ref.$from;
var $to = ref.$to;
if ($from.parent.inlineContent || $to.parent.inlineContent) { return false }
var type = defaultBlockAt($from.parent.contentMatchAt($to.indexAfter()));
var sel = state.selection;
var $from = sel.$from;
var $to = sel.$to;
if (!(sel instanceof NodeSelection) || $from.parent.inlineContent) { return false }
var type = defaultBlockAt($to.parent.contentMatchAt($to.indexAfter()));
if (!type || !type.isTextblock) { return false }

@@ -332,3 +332,3 @@ if (dispatch) {

var tr = state.tr;
if (state.selection instanceof TextSelection) { tr.deleteSelection(); }
if (state.selection instanceof TextSelection || state.selection instanceof AllSelection) { tr.deleteSelection(); }
var deflt = $from.depth == 0 ? null : defaultBlockAt($from.node(-1).contentMatchAt($from.indexAfter(-1)));

@@ -335,0 +335,0 @@ var types = atEnd && deflt ? [{type: deflt}] : null;

@@ -282,7 +282,7 @@ 'use strict';

function createParagraphNear(state, dispatch) {
var ref = state.selection;
var $from = ref.$from;
var $to = ref.$to;
if ($from.parent.inlineContent || $to.parent.inlineContent) { return false }
var type = defaultBlockAt($from.parent.contentMatchAt($to.indexAfter()));
var sel = state.selection;
var $from = sel.$from;
var $to = sel.$to;
if (!(sel instanceof prosemirrorState.NodeSelection) || $from.parent.inlineContent) { return false }
var type = defaultBlockAt($to.parent.contentMatchAt($to.indexAfter()));
if (!type || !type.isTextblock) { return false }

@@ -336,3 +336,3 @@ if (dispatch) {

var tr = state.tr;
if (state.selection instanceof prosemirrorState.TextSelection) { tr.deleteSelection(); }
if (state.selection instanceof prosemirrorState.TextSelection || state.selection instanceof prosemirrorState.AllSelection) { tr.deleteSelection(); }
var deflt = $from.depth == 0 ? null : defaultBlockAt($from.node(-1).contentMatchAt($from.indexAfter(-1)));

@@ -339,0 +339,0 @@ var types = atEnd && deflt ? [{type: deflt}] : null;

{
"name": "prosemirror-commands",
"version": "1.1.5",
"version": "1.1.6",
"description": "Editing commands for ProseMirror",

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

@@ -263,5 +263,5 @@ import {joinPoint, canJoin, findWrapping, liftTarget, canSplit, ReplaceAroundStep} from "prosemirror-transform"

export function createParagraphNear(state, dispatch) {
let {$from, $to} = state.selection
if ($from.parent.inlineContent || $to.parent.inlineContent) return false
let type = defaultBlockAt($from.parent.contentMatchAt($to.indexAfter()))
let sel = state.selection, {$from, $to} = sel
if (!(sel instanceof NodeSelection) || $from.parent.inlineContent) return false
let type = defaultBlockAt($to.parent.contentMatchAt($to.indexAfter()))
if (!type || !type.isTextblock) return false

@@ -312,3 +312,3 @@ if (dispatch) {

let tr = state.tr
if (state.selection instanceof TextSelection) tr.deleteSelection()
if (state.selection instanceof TextSelection || state.selection instanceof AllSelection) tr.deleteSelection()
let deflt = $from.depth == 0 ? null : defaultBlockAt($from.node(-1).contentMatchAt($from.indexAfter(-1)))

@@ -315,0 +315,0 @@ let types = atEnd && deflt ? [{type: deflt}] : null

Sorry, the diff of this file is not supported yet

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