@tiptap/extension-text-align
Advanced tools
Comparing version 2.0.0-beta.1 to 2.0.0-beta.2
@@ -6,2 +6,13 @@ # Change Log | ||
# [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) | ||
### Features | ||
* add updateAttributes() command, deprecate updateNodeAttributes(), fix [#254](https://github.com/ueberdosis/tiptap-next/issues/254) ([aac32b4](https://github.com/ueberdosis/tiptap-next/commit/aac32b4df6a1dfd93500e09d3433fcd8acad5fbe)) | ||
# [2.0.0-beta.1](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-text-align@2.0.0-alpha.12...@tiptap/extension-text-align@2.0.0-beta.1) (2021-03-05) | ||
@@ -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.updateNodeAttributes(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.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})})); | ||
//# sourceMappingURL=tiptap-extension-text-align.bundle.umd.min.js.map |
@@ -38,3 +38,3 @@ 'use strict'; | ||
} | ||
return this.options.types.every(type => commands.updateNodeAttributes(type, { textAlign: alignment })); | ||
return this.options.types.every(type => commands.updateAttributes(type, { textAlign: alignment })); | ||
}, | ||
@@ -41,0 +41,0 @@ unsetTextAlign: () => ({ commands }) => { |
@@ -34,3 +34,3 @@ import { Extension } from '@tiptap/core'; | ||
} | ||
return this.options.types.every(type => commands.updateNodeAttributes(type, { textAlign: alignment })); | ||
return this.options.types.every(type => commands.updateAttributes(type, { textAlign: alignment })); | ||
}, | ||
@@ -37,0 +37,0 @@ unsetTextAlign: () => ({ commands }) => { |
@@ -38,3 +38,3 @@ (function (global, factory) { | ||
} | ||
return this.options.types.every(type => commands.updateNodeAttributes(type, { textAlign: alignment })); | ||
return this.options.types.every(type => commands.updateAttributes(type, { textAlign: alignment })); | ||
}, | ||
@@ -41,0 +41,0 @@ unsetTextAlign: () => ({ commands }) => { |
{ | ||
"name": "@tiptap/extension-text-align", | ||
"description": "text align extension for tiptap", | ||
"version": "2.0.0-beta.1", | ||
"version": "2.0.0-beta.2", | ||
"homepage": "https://tiptap.dev", | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "67781052b0ac805fbf82099a50e27f1dd28f8061" | ||
"gitHead": "41a044417e5bafab5a660ac06b8db3d5acd3e4a7" | ||
} |
@@ -59,3 +59,3 @@ import { Command, Extension } from '@tiptap/core' | ||
return this.options.types.every(type => commands.updateNodeAttributes(type, { textAlign: alignment })) | ||
return this.options.types.every(type => commands.updateAttributes(type, { textAlign: alignment })) | ||
}, | ||
@@ -62,0 +62,0 @@ unsetTextAlign: () => ({ commands }) => { |
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
31985