@tiptap/extension-text-align
Advanced tools
Comparing version 3.0.0-next.3 to 3.0.0-next.4
@@ -58,7 +58,7 @@ // src/text-align.ts | ||
// src/index.ts | ||
var src_default = TextAlign; | ||
var index_default = TextAlign; | ||
export { | ||
TextAlign, | ||
src_default as default | ||
index_default as default | ||
}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@tiptap/extension-text-align", | ||
"description": "text align extension for tiptap", | ||
"version": "3.0.0-next.3", | ||
"version": "3.0.0-next.4", | ||
"homepage": "https://tiptap.dev", | ||
@@ -18,3 +18,6 @@ "keywords": [ | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"types": { | ||
"import": "./dist/index.d.ts", | ||
"require": "./dist/index.d.cts" | ||
}, | ||
"import": "./dist/index.js", | ||
@@ -32,3 +35,3 @@ "require": "./dist/index.cjs" | ||
"devDependencies": { | ||
"@tiptap/core": "^3.0.0-next.3" | ||
"@tiptap/core": "^3.0.0-next.4" | ||
}, | ||
@@ -44,4 +47,5 @@ "peerDependencies": { | ||
"scripts": { | ||
"build": "tsup" | ||
"build": "tsup", | ||
"lint": "prettier ./src/ --check && eslint --cache --quiet --no-error-on-unmatched-pattern ./src/" | ||
} | ||
} | ||
} |
# @tiptap/extension-text-align | ||
[![Version](https://img.shields.io/npm/v/@tiptap/extension-text-align.svg?label=version)](https://www.npmjs.com/package/@tiptap/extension-text-align) | ||
@@ -8,8 +9,11 @@ [![Downloads](https://img.shields.io/npm/dm/@tiptap/extension-text-align.svg)](https://npmcharts.com/compare/tiptap?minimal=true) | ||
## Introduction | ||
Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as *New York Times*, *The Guardian* or *Atlassian*. | ||
Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as _New York Times_, _The Guardian_ or _Atlassian_. | ||
## Official Documentation | ||
Documentation can be found on the [Tiptap website](https://tiptap.dev). | ||
## License | ||
Tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md). |
@@ -9,3 +9,3 @@ import { Extension } from '@tiptap/core' | ||
*/ | ||
types: string[], | ||
types: string[] | ||
@@ -17,3 +17,3 @@ /** | ||
*/ | ||
alignments: string[], | ||
alignments: string[] | ||
@@ -25,3 +25,3 @@ /** | ||
*/ | ||
defaultAlignment: string | null, | ||
defaultAlignment: string | null | ||
} | ||
@@ -37,3 +37,3 @@ | ||
*/ | ||
setTextAlign: (alignment: string) => ReturnType, | ||
setTextAlign: (alignment: string) => ReturnType | ||
/** | ||
@@ -43,3 +43,3 @@ * Unset the text align attribute | ||
*/ | ||
unsetTextAlign: () => ReturnType, | ||
unsetTextAlign: () => ReturnType | ||
} | ||
@@ -91,17 +91,19 @@ } | ||
return { | ||
setTextAlign: (alignment: string) => ({ commands }) => { | ||
if (!this.options.alignments.includes(alignment)) { | ||
return false | ||
} | ||
setTextAlign: | ||
(alignment: string) => | ||
({ commands }) => { | ||
if (!this.options.alignments.includes(alignment)) { | ||
return false | ||
} | ||
return this.options.types | ||
.map(type => commands.updateAttributes(type, { textAlign: alignment })) | ||
.every(response => response) | ||
}, | ||
return this.options.types | ||
.map(type => commands.updateAttributes(type, { textAlign: alignment })) | ||
.every(response => response) | ||
}, | ||
unsetTextAlign: () => ({ commands }) => { | ||
return this.options.types | ||
.map(type => commands.resetAttributes(type, 'textAlign')) | ||
.every(response => response) | ||
}, | ||
unsetTextAlign: | ||
() => | ||
({ commands }) => { | ||
return this.options.types.map(type => commands.resetAttributes(type, 'textAlign')).every(response => response) | ||
}, | ||
} | ||
@@ -108,0 +110,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
Unstable ownership
Supply chain riskA new collaborator has begun publishing package versions. Package stability and security risk may be elevated.
Found 1 instance in 1 package
22737
11
295
19
1