@tiptap/extension-text-align
Advanced tools
Comparing version 2.0.0-alpha.3 to 2.0.0-alpha.4
@@ -6,2 +6,10 @@ # Change Log | ||
# [2.0.0-alpha.4](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-text-align@2.0.0-alpha.3...@tiptap/extension-text-align@2.0.0-alpha.4) (2020-12-02) | ||
**Note:** Version bump only for package @tiptap/extension-text-align | ||
# [2.0.0-alpha.3](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-text-align@2.0.0-alpha.2...@tiptap/extension-text-align@2.0.0-alpha.3) (2020-11-19) | ||
@@ -8,0 +16,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@tiptap/core")):"function"==typeof define&&define.amd?define(["@tiptap/core"],e):(t="undefined"!=typeof globalThis?globalThis:t||self)["@tiptap/extension-text-align"]=e(t["@tiptap/core"])}(this,(function(t){"use strict";return t.Extension.create({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{Enter:()=>this.editor.commands.splitBlock({withAttributes:!0}),"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")}}})})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@tiptap/core")):"function"==typeof define&&define.amd?define(["@tiptap/core"],e):(t="undefined"!=typeof globalThis?globalThis:t||self)["@tiptap/extension-text-align"]=e(t["@tiptap/core"])}(this,(function(t){"use strict";return t.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{Enter:()=>this.editor.commands.splitBlock({withAttributes:!0}),"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")}}})})); | ||
//# sourceMappingURL=tiptap-extension-text-align.bundle.umd.min.js.map |
@@ -6,2 +6,3 @@ 'use strict'; | ||
const TextAlign = core.Extension.create({ | ||
name: 'textAlign', | ||
defaultOptions: { | ||
@@ -8,0 +9,0 @@ types: ['heading', 'paragraph'], |
import { Extension } from '@tiptap/core'; | ||
const TextAlign = Extension.create({ | ||
name: 'textAlign', | ||
defaultOptions: { | ||
@@ -5,0 +6,0 @@ types: ['heading', 'paragraph'], |
@@ -8,2 +8,3 @@ (function (global, factory) { | ||
const TextAlign = core.Extension.create({ | ||
name: 'textAlign', | ||
defaultOptions: { | ||
@@ -10,0 +11,0 @@ types: ['heading', 'paragraph'], |
{ | ||
"name": "@tiptap/extension-text-align", | ||
"version": "2.0.0-alpha.3", | ||
"description": "text align extension for tiptap", | ||
"version": "2.0.0-alpha.4", | ||
"homepage": "https://tiptap.dev", | ||
@@ -26,3 +27,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "7966af0fec4e65f83d7e5a22ccb9fc420a9a6728" | ||
"gitHead": "a884cb81de8783d0097741c1ddb97a82ea88ae0e" | ||
} |
@@ -10,2 +10,4 @@ import { Command, Extension } from '@tiptap/core' | ||
const TextAlign = Extension.create({ | ||
name: 'textAlign', | ||
defaultOptions: <TextAlignOptions>{ | ||
@@ -12,0 +14,0 @@ types: ['heading', 'paragraph'], |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32091
292