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

@tiptap/extension-text-align

Package Overview
Dependencies
Maintainers
4
Versions
184
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 2.3.2 to 2.4.0

12

dist/index.js
import { Extension } from '@tiptap/core';
/**
* This extension allows you to align text.
* @see https://www.tiptap.dev/api/extensions/text-align
*/
const TextAlign = Extension.create({

@@ -37,6 +41,10 @@ name: 'textAlign',

}
return this.options.types.every(type => commands.updateAttributes(type, { textAlign: alignment }));
return this.options.types
.map(type => commands.updateAttributes(type, { textAlign: alignment }))
.every(response => response);
},
unsetTextAlign: () => ({ commands }) => {
return this.options.types.every(type => commands.resetAttributes(type, 'textAlign'));
return this.options.types
.map(type => commands.resetAttributes(type, 'textAlign'))
.every(response => response);
},

@@ -43,0 +51,0 @@ };

@@ -7,2 +7,6 @@ (function (global, factory) {

/**
* This extension allows you to align text.
* @see https://www.tiptap.dev/api/extensions/text-align
*/
const TextAlign = core.Extension.create({

@@ -42,6 +46,10 @@ name: 'textAlign',

}
return this.options.types.every(type => commands.updateAttributes(type, { textAlign: alignment }));
return this.options.types
.map(type => commands.updateAttributes(type, { textAlign: alignment }))
.every(response => response);
},
unsetTextAlign: () => ({ commands }) => {
return this.options.types.every(type => commands.resetAttributes(type, 'textAlign'));
return this.options.types
.map(type => commands.resetAttributes(type, 'textAlign'))
.every(response => response);
},

@@ -48,0 +56,0 @@ };

import { Extension } from '@tiptap/core';
export interface TextAlignOptions {
/**
* The types where the text align attribute can be applied.
* @default []
* @example ['heading', 'paragraph']
*/
types: string[];
/**
* The alignments which are allowed.
* @default ['left', 'center', 'right', 'justify']
* @example ['left', 'right']
*/
alignments: string[];
/**
* The default alignment.
* @default 'left'
* @example 'center'
*/
defaultAlignment: string;

@@ -12,2 +27,4 @@ }

* Set the text align attribute
* @param alignment The alignment
* @example editor.commands.setTextAlign('left')
*/

@@ -17,2 +34,3 @@ setTextAlign: (alignment: string) => ReturnType;

* Unset the text align attribute
* @example editor.commands.unsetTextAlign()
*/

@@ -23,2 +41,6 @@ unsetTextAlign: () => ReturnType;

}
/**
* This extension allows you to align text.
* @see https://www.tiptap.dev/api/extensions/text-align
*/
export declare const TextAlign: Extension<TextAlignOptions, any>;

4

package.json
{
"name": "@tiptap/extension-text-align",
"description": "text align extension for tiptap",
"version": "2.3.2",
"version": "2.4.0",
"homepage": "https://tiptap.dev",

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

"devDependencies": {
"@tiptap/core": "^2.3.2"
"@tiptap/core": "^2.4.0"
},

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

import { Extension } from '@tiptap/core'
export interface TextAlignOptions {
/**
* The types where the text align attribute can be applied.
* @default []
* @example ['heading', 'paragraph']
*/
types: string[],
/**
* The alignments which are allowed.
* @default ['left', 'center', 'right', 'justify']
* @example ['left', 'right']
*/
alignments: string[],
/**
* The default alignment.
* @default 'left'
* @example 'center'
*/
defaultAlignment: string,

@@ -14,2 +31,4 @@ }

* Set the text align attribute
* @param alignment The alignment
* @example editor.commands.setTextAlign('left')
*/

@@ -19,2 +38,3 @@ setTextAlign: (alignment: string) => ReturnType,

* Unset the text align attribute
* @example editor.commands.unsetTextAlign()
*/

@@ -26,2 +46,6 @@ unsetTextAlign: () => ReturnType,

/**
* This extension allows you to align text.
* @see https://www.tiptap.dev/api/extensions/text-align
*/
export const TextAlign = Extension.create<TextAlignOptions>({

@@ -66,7 +90,11 @@ name: 'textAlign',

return this.options.types.every(type => commands.updateAttributes(type, { textAlign: alignment }))
return this.options.types
.map(type => commands.updateAttributes(type, { textAlign: alignment }))
.every(response => response)
},
unsetTextAlign: () => ({ commands }) => {
return this.options.types.every(type => commands.resetAttributes(type, 'textAlign'))
return this.options.types
.map(type => commands.resetAttributes(type, 'textAlign'))
.every(response => response)
},

@@ -73,0 +101,0 @@ }

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