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

@tiptap/core

Package Overview
Dependencies
Maintainers
4
Versions
331
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/core - npm Package Compare versions

Comparing version 2.1.0-rc.14 to 2.1.0

4

package.json
{
"name": "@tiptap/core",
"description": "headless rich text editor",
"version": "2.1.0-rc.14",
"version": "2.1.0",
"homepage": "https://tiptap.dev",

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

"devDependencies": {
"@tiptap/pm": "^2.1.0-rc.14"
"@tiptap/pm": "^2.1.0"
},

@@ -38,0 +38,0 @@ "peerDependencies": {

import { NodeType } from '@tiptap/pm/model'
import { TextSelection } from '@tiptap/pm/state'
import { NodeSelection, TextSelection } from '@tiptap/pm/state'

@@ -55,2 +55,4 @@ import { InputRule, InputRuleFinder } from '../InputRule.js'

const { $to } = tr.selection
if (match[1]) {

@@ -78,7 +80,13 @@ const offset = match[0].lastIndexOf(match[1])

if (config.blockReplace && config.addExtraNewline) {
const { $to } = tr.selection
const posAfter = $to.end()
if ($to.nodeAfter) {
tr.setSelection(TextSelection.create(tr.doc, $to.pos))
console.log($to.node().type.name)
if ($to.nodeAfter.isTextblock) {
tr.setSelection(TextSelection.create(tr.doc, $to.pos + 1))
} else if ($to.nodeAfter.isBlock) {
tr.setSelection(NodeSelection.create(tr.doc, $to.pos))
} else {
tr.setSelection(TextSelection.create(tr.doc, $to.pos))
}
} else {

@@ -90,3 +98,3 @@ // add node after horizontal rule if it’s the end of the document

tr.insert(posAfter, node)
tr.setSelection(TextSelection.create(tr.doc, posAfter))
tr.setSelection(TextSelection.create(tr.doc, posAfter + 1))
}

@@ -93,0 +101,0 @@ }

@@ -17,3 +17,10 @@ export function mergeAttributes(...objects: Record<string, any>[]): Record<string, any> {

if (key === 'class') {
mergedAttributes[key] = [mergedAttributes[key], value].join(' ')
const valueClasses: string[] = value.split(' ')
const existingClasses: string[] = mergedAttributes[key].split(' ')
const insertClasses = valueClasses.filter(
valueClass => !existingClasses.includes(valueClass),
)
mergedAttributes[key] = [...existingClasses, ...insertClasses].join(' ')
} else if (key === 'style') {

@@ -20,0 +27,0 @@ mergedAttributes[key] = [mergedAttributes[key], value].join('; ')

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 too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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