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

@tiptap/extension-text-style

Package Overview
Dependencies
Maintainers
4
Versions
178
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/extension-text-style - npm Package Compare versions

Comparing version 2.0.0-beta.213 to 2.0.0-beta.214

dist/index.cjs.map

88

dist/index.js

@@ -1,50 +0,42 @@

// src/text-style.ts
import {
getMarkAttributes,
Mark,
mergeAttributes
} from "@tiptap/core";
var TextStyle = Mark.create({
name: "textStyle",
addOptions() {
return {
HTMLAttributes: {}
};
},
parseHTML() {
return [
{
tag: "span",
getAttrs: (element) => {
const hasStyles = element.hasAttribute("style");
if (!hasStyles) {
return false;
}
return {};
}
}
];
},
renderHTML({ HTMLAttributes }) {
return ["span", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
},
addCommands() {
return {
removeEmptyTextStyle: () => ({ state, commands }) => {
const attributes = getMarkAttributes(state, this.type);
const hasStyles = Object.entries(attributes).some(([, value]) => !!value);
if (hasStyles) {
return true;
}
return commands.unsetMark(this.name);
}
};
}
import { Mark, mergeAttributes, getMarkAttributes } from '@tiptap/core';
const TextStyle = Mark.create({
name: 'textStyle',
addOptions() {
return {
HTMLAttributes: {},
};
},
parseHTML() {
return [
{
tag: 'span',
getAttrs: element => {
const hasStyles = element.hasAttribute('style');
if (!hasStyles) {
return false;
}
return {};
},
},
];
},
renderHTML({ HTMLAttributes }) {
return ['span', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
},
addCommands() {
return {
removeEmptyTextStyle: () => ({ state, commands }) => {
const attributes = getMarkAttributes(state, this.type);
const hasStyles = Object.entries(attributes).some(([, value]) => !!value);
if (hasStyles) {
return true;
}
return commands.unsetMark(this.name);
},
};
},
});
// src/index.ts
var src_default = TextStyle;
export {
TextStyle,
src_default as default
};
export { TextStyle, TextStyle as default };
//# sourceMappingURL=index.js.map
{
"name": "@tiptap/extension-text-style",
"description": "text style extension for tiptap",
"version": "2.0.0-beta.213",
"version": "2.0.0-beta.214",
"homepage": "https://tiptap.dev",

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

".": {
"types": "./dist/index.d.ts",
"types": "./dist/packages/extension-text-style/src/index.d.ts",
"import": "./dist/index.js",

@@ -26,3 +26,4 @@ "require": "./dist/index.cjs"

"module": "dist/index.js",
"types": "dist/index.d.ts",
"umd": "dist/index.umd.js",
"types": "dist/packages/extension-text-style/src/index.d.ts",
"files": [

@@ -36,3 +37,3 @@ "src",

"devDependencies": {
"@tiptap/core": "^2.0.0-beta.213"
"@tiptap/core": "^2.0.0-beta.214"
},

@@ -45,15 +46,5 @@ "repository": {

"scripts": {
"build": "tsup"
},
"tsup": {
"entry": [
"src/index.ts"
],
"dts": true,
"splitting": true,
"format": [
"esm",
"cjs"
]
"clean": "rm -rf dist",
"build": "npm run clean && rollup -c"
}
}

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