@tiptap/extension-text-align
Advanced tools
Comparing version 2.0.0-beta.2 to 2.0.0-beta.3
@@ -6,2 +6,13 @@ # Change Log | ||
# [2.0.0-beta.3](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-text-align@2.0.0-beta.2...@tiptap/extension-text-align@2.0.0-beta.3) (2021-04-07) | ||
### Features | ||
* add resetAttributes() command, deprecate resetNodeAttributes() ([3334d93](https://github.com/ueberdosis/tiptap-next/commit/3334d930f30bd4acb5c314b4ec1934b6a1e0b712)) | ||
# [2.0.0-beta.2](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-text-align@2.0.0-beta.1...@tiptap/extension-text-align@2.0.0-beta.2) (2021-04-07) | ||
@@ -8,0 +19,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tiptap/core")):"function"==typeof define&&define.amd?define(["exports","@tiptap/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@tiptap/extension-text-align"]={},t["@tiptap/core"])}(this,(function(t,e){"use strict";const i=e.Extension.create({name:"textAlign",defaultOptions:{types:["heading","paragraph"],alignments:["left","center","right","justify"],defaultAlignment:"left"},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,renderHTML:t=>({style:`text-align: ${t.textAlign}`}),parseHTML:t=>({textAlign:t.style.textAlign||this.options.defaultAlignment})}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>!!this.options.alignments.includes(t)&&this.options.types.every((i=>e.updateAttributes(i,{textAlign:t}))),unsetTextAlign:()=>({commands:t})=>this.options.types.every((e=>t.resetNodeAttributes(e,"textAlign")))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});t.TextAlign=i,t.default=i,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tiptap/core")):"function"==typeof define&&define.amd?define(["exports","@tiptap/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@tiptap/extension-text-align"]={},t["@tiptap/core"])}(this,(function(t,e){"use strict";const i=e.Extension.create({name:"textAlign",defaultOptions:{types:["heading","paragraph"],alignments:["left","center","right","justify"],defaultAlignment:"left"},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,renderHTML:t=>({style:`text-align: ${t.textAlign}`}),parseHTML:t=>({textAlign:t.style.textAlign||this.options.defaultAlignment})}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>!!this.options.alignments.includes(t)&&this.options.types.every((i=>e.updateAttributes(i,{textAlign:t}))),unsetTextAlign:()=>({commands:t})=>this.options.types.every((e=>t.resetAttributes(e,"textAlign")))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});t.TextAlign=i,t.default=i,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=tiptap-extension-text-align.bundle.umd.min.js.map |
@@ -41,3 +41,3 @@ 'use strict'; | ||
unsetTextAlign: () => ({ commands }) => { | ||
return this.options.types.every(type => commands.resetNodeAttributes(type, 'textAlign')); | ||
return this.options.types.every(type => commands.resetAttributes(type, 'textAlign')); | ||
}, | ||
@@ -44,0 +44,0 @@ }; |
@@ -37,3 +37,3 @@ import { Extension } from '@tiptap/core'; | ||
unsetTextAlign: () => ({ commands }) => { | ||
return this.options.types.every(type => commands.resetNodeAttributes(type, 'textAlign')); | ||
return this.options.types.every(type => commands.resetAttributes(type, 'textAlign')); | ||
}, | ||
@@ -40,0 +40,0 @@ }; |
@@ -41,3 +41,3 @@ (function (global, factory) { | ||
unsetTextAlign: () => ({ commands }) => { | ||
return this.options.types.every(type => commands.resetNodeAttributes(type, 'textAlign')); | ||
return this.options.types.every(type => commands.resetAttributes(type, 'textAlign')); | ||
}, | ||
@@ -44,0 +44,0 @@ }; |
{ | ||
"name": "@tiptap/extension-text-align", | ||
"description": "text align extension for tiptap", | ||
"version": "2.0.0-beta.2", | ||
"version": "2.0.0-beta.3", | ||
"homepage": "https://tiptap.dev", | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "41a044417e5bafab5a660ac06b8db3d5acd3e4a7" | ||
"gitHead": "7b1d8d103c9d74263fd5c8a6dc146ac5ec4077f5" | ||
} |
@@ -62,3 +62,3 @@ import { Command, Extension } from '@tiptap/core' | ||
unsetTextAlign: () => ({ commands }) => { | ||
return this.options.types.every(type => commands.resetNodeAttributes(type, 'textAlign')) | ||
return this.options.types.every(type => commands.resetAttributes(type, 'textAlign')) | ||
}, | ||
@@ -65,0 +65,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
32295