New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@tiptap/extension-character-count

Package Overview
Dependencies
Maintainers
5
Versions
176
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/extension-character-count - npm Package Compare versions

Comparing version 2.10.2 to 2.10.3

22

dist/index.js

@@ -41,5 +41,27 @@ import { Extension } from '@tiptap/core';

addProseMirrorPlugins() {
let initialEvaluationDone = false;
return [
new Plugin({
key: new PluginKey('characterCount'),
appendTransaction: (transactions, oldState, newState) => {
if (initialEvaluationDone) {
return;
}
const limit = this.options.limit;
if (limit === null || limit === undefined || limit === 0) {
initialEvaluationDone = true;
return;
}
const initialContentSize = this.storage.characters({ node: newState.doc });
if (initialContentSize > limit) {
const over = initialContentSize - limit;
const from = 0;
const to = over;
console.warn(`[CharacterCount] Initial content exceeded limit of ${limit} characters. Content was automatically trimmed.`);
const tr = newState.tr.deleteRange(from, to);
initialEvaluationDone = true;
return tr;
}
initialEvaluationDone = true;
},
filterTransaction: (transaction, state) => {

@@ -46,0 +68,0 @@ const limit = this.options.limit;

@@ -44,5 +44,27 @@ (function (global, factory) {

addProseMirrorPlugins() {
let initialEvaluationDone = false;
return [
new state.Plugin({
key: new state.PluginKey('characterCount'),
appendTransaction: (transactions, oldState, newState) => {
if (initialEvaluationDone) {
return;
}
const limit = this.options.limit;
if (limit === null || limit === undefined || limit === 0) {
initialEvaluationDone = true;
return;
}
const initialContentSize = this.storage.characters({ node: newState.doc });
if (initialContentSize > limit) {
const over = initialContentSize - limit;
const from = 0;
const to = over;
console.warn(`[CharacterCount] Initial content exceeded limit of ${limit} characters. Content was automatically trimmed.`);
const tr = newState.tr.deleteRange(from, to);
initialEvaluationDone = true;
return tr;
}
initialEvaluationDone = true;
},
filterTransaction: (transaction, state) => {

@@ -49,0 +71,0 @@ const limit = this.options.limit;

6

package.json
{
"name": "@tiptap/extension-character-count",
"description": "font family extension for tiptap",
"version": "2.10.2",
"version": "2.10.3",
"homepage": "https://tiptap.dev",

@@ -32,4 +32,4 @@ "keywords": [

"devDependencies": {
"@tiptap/core": "^2.10.2",
"@tiptap/pm": "^2.10.2"
"@tiptap/core": "^2.10.3",
"@tiptap/pm": "^2.10.3"
},

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

@@ -96,5 +96,35 @@ import { Extension } from '@tiptap/core'

addProseMirrorPlugins() {
let initialEvaluationDone = false
return [
new Plugin({
key: new PluginKey('characterCount'),
appendTransaction: (transactions, oldState, newState) => {
if (initialEvaluationDone) {
return
}
const limit = this.options.limit
if (limit === null || limit === undefined || limit === 0) {
initialEvaluationDone = true
return
}
const initialContentSize = this.storage.characters({ node: newState.doc })
if (initialContentSize > limit) {
const over = initialContentSize - limit
const from = 0
const to = over
console.warn(`[CharacterCount] Initial content exceeded limit of ${limit} characters. Content was automatically trimmed.`)
const tr = newState.tr.deleteRange(from, to)
initialEvaluationDone = true
return tr
}
initialEvaluationDone = true
},
filterTransaction: (transaction, state) => {

@@ -101,0 +131,0 @@ const limit = this.options.limit

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

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