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

@tiptap/extension-horizontal-rule

Package Overview
Dependencies
Maintainers
2
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/extension-horizontal-rule - npm Package Compare versions

Comparing version 2.0.0-beta.30 to 2.0.0-beta.31

11

dist/tiptap-extension-horizontal-rule.cjs.js

@@ -33,11 +33,10 @@ 'use strict';

if (dispatch) {
const { parent, pos } = tr.selection.$from;
const posAfter = pos + 1;
const nodeAfter = tr.doc.nodeAt(posAfter);
if (nodeAfter) {
tr.setSelection(prosemirrorState.TextSelection.create(tr.doc, posAfter));
const { $to } = tr.selection;
const posAfter = $to.end();
if ($to.nodeAfter) {
tr.setSelection(prosemirrorState.TextSelection.create(tr.doc, $to.pos));
}
else {
// add node after horizontal rule if it’s the end of the document
const node = (_a = parent.type.contentMatch.defaultType) === null || _a === void 0 ? void 0 : _a.create();
const node = (_a = $to.parent.type.contentMatch.defaultType) === null || _a === void 0 ? void 0 : _a.create();
if (node) {

@@ -44,0 +43,0 @@ tr.insert(posAfter, node);

@@ -29,11 +29,10 @@ import { Node, mergeAttributes, nodeInputRule } from '@tiptap/core';

if (dispatch) {
const { parent, pos } = tr.selection.$from;
const posAfter = pos + 1;
const nodeAfter = tr.doc.nodeAt(posAfter);
if (nodeAfter) {
tr.setSelection(TextSelection.create(tr.doc, posAfter));
const { $to } = tr.selection;
const posAfter = $to.end();
if ($to.nodeAfter) {
tr.setSelection(TextSelection.create(tr.doc, $to.pos));
}
else {
// add node after horizontal rule if it’s the end of the document
const node = (_a = parent.type.contentMatch.defaultType) === null || _a === void 0 ? void 0 : _a.create();
const node = (_a = $to.parent.type.contentMatch.defaultType) === null || _a === void 0 ? void 0 : _a.create();
if (node) {

@@ -40,0 +39,0 @@ tr.insert(posAfter, node);

@@ -32,11 +32,10 @@ (function (global, factory) {

if (dispatch) {
const { parent, pos } = tr.selection.$from;
const posAfter = pos + 1;
const nodeAfter = tr.doc.nodeAt(posAfter);
if (nodeAfter) {
tr.setSelection(prosemirrorState.TextSelection.create(tr.doc, posAfter));
const { $to } = tr.selection;
const posAfter = $to.end();
if ($to.nodeAfter) {
tr.setSelection(prosemirrorState.TextSelection.create(tr.doc, $to.pos));
}
else {
// add node after horizontal rule if it’s the end of the document
const node = (_a = parent.type.contentMatch.defaultType) === null || _a === void 0 ? void 0 : _a.create();
const node = (_a = $to.parent.type.contentMatch.defaultType) === null || _a === void 0 ? void 0 : _a.create();
if (node) {

@@ -43,0 +42,0 @@ tr.insert(posAfter, node);

{
"name": "@tiptap/extension-horizontal-rule",
"description": "horizontal rule extension for tiptap",
"version": "2.0.0-beta.30",
"version": "2.0.0-beta.31",
"homepage": "https://tiptap.dev",

@@ -34,3 +34,3 @@ "keywords": [

},
"gitHead": "621cfa2f7e98a48525fa22f9d97a92fc08368966"
"gitHead": "28b8f610fb8330067c94ea7c7de6726ccc6bb9d5"
}

@@ -52,11 +52,10 @@ import {

if (dispatch) {
const { parent, pos } = tr.selection.$from
const posAfter = pos + 1
const nodeAfter = tr.doc.nodeAt(posAfter)
const { $to } = tr.selection
const posAfter = $to.end()
if (nodeAfter) {
tr.setSelection(TextSelection.create(tr.doc, posAfter))
if ($to.nodeAfter) {
tr.setSelection(TextSelection.create(tr.doc, $to.pos))
} else {
// add node after horizontal rule if it’s the end of the document
const node = parent.type.contentMatch.defaultType?.create()
const node = $to.parent.type.contentMatch.defaultType?.create()

@@ -63,0 +62,0 @@ if (node) {

Sorry, the diff of this file is not supported yet

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