@tiptap/extension-typography
Advanced tools
Comparing version 2.3.2 to 2.4.0
@@ -91,4 +91,34 @@ import { Extension, textInputRule } from '@tiptap/core'; | ||
}); | ||
/** | ||
* This extension allows you to add typography replacements for specific characters. | ||
* @see https://www.tiptap.dev/api/extensions/typography | ||
*/ | ||
const Typography = Extension.create({ | ||
name: 'typography', | ||
addOptions() { | ||
return { | ||
closeDoubleQuote: '”', | ||
closeSingleQuote: '’', | ||
copyright: '©', | ||
ellipsis: '…', | ||
emDash: '—', | ||
laquo: '«', | ||
leftArrow: '←', | ||
multiplication: '×', | ||
notEqual: '≠', | ||
oneHalf: '½', | ||
oneQuarter: '¼', | ||
openDoubleQuote: '“', | ||
openSingleQuote: '‘', | ||
plusMinus: '±', | ||
raquo: '»', | ||
registeredTrademark: '®', | ||
rightArrow: '→', | ||
servicemark: '℠', | ||
superscriptThree: '³', | ||
superscriptTwo: '²', | ||
threeQuarters: '¾', | ||
trademark: '™', | ||
}; | ||
}, | ||
addInputRules() { | ||
@@ -95,0 +125,0 @@ const rules = []; |
@@ -95,4 +95,34 @@ (function (global, factory) { | ||
}); | ||
/** | ||
* This extension allows you to add typography replacements for specific characters. | ||
* @see https://www.tiptap.dev/api/extensions/typography | ||
*/ | ||
const Typography = core.Extension.create({ | ||
name: 'typography', | ||
addOptions() { | ||
return { | ||
closeDoubleQuote: '”', | ||
closeSingleQuote: '’', | ||
copyright: '©', | ||
ellipsis: '…', | ||
emDash: '—', | ||
laquo: '«', | ||
leftArrow: '←', | ||
multiplication: '×', | ||
notEqual: '≠', | ||
oneHalf: '½', | ||
oneQuarter: '¼', | ||
openDoubleQuote: '“', | ||
openSingleQuote: '‘', | ||
plusMinus: '±', | ||
raquo: '»', | ||
registeredTrademark: '®', | ||
rightArrow: '→', | ||
servicemark: '℠', | ||
superscriptThree: '³', | ||
superscriptTwo: '²', | ||
threeQuarters: '¾', | ||
trademark: '™', | ||
}; | ||
}, | ||
addInputRules() { | ||
@@ -99,0 +129,0 @@ const rules = []; |
import { Extension } from '@tiptap/core'; | ||
export interface TypographyOptions { | ||
/** | ||
* The em dash character. | ||
* @default '—' | ||
*/ | ||
emDash: false | string; | ||
/** | ||
* The ellipsis character. | ||
* @default '…' | ||
*/ | ||
ellipsis: false | string; | ||
/** | ||
* The open double quote character. | ||
* @default '“' | ||
*/ | ||
openDoubleQuote: false | string; | ||
/** | ||
* The close double quote character. | ||
* @default '”' | ||
*/ | ||
closeDoubleQuote: false | string; | ||
/** | ||
* The open single quote character. | ||
* @default '‘' | ||
*/ | ||
openSingleQuote: false | string; | ||
/** | ||
* The close single quote character. | ||
* @default '’' | ||
*/ | ||
closeSingleQuote: false | string; | ||
/** | ||
* The left arrow character. | ||
* @default '←' | ||
*/ | ||
leftArrow: false | string; | ||
/** | ||
* The right arrow character. | ||
* @default '→' | ||
*/ | ||
rightArrow: false | string; | ||
/** | ||
* The copyright character. | ||
* @default '©' | ||
*/ | ||
copyright: false | string; | ||
/** | ||
* The trademark character. | ||
* @default '™' | ||
*/ | ||
trademark: false | string; | ||
/** | ||
* The servicemark character. | ||
* @default '℠' | ||
*/ | ||
servicemark: false | string; | ||
/** | ||
* The registered trademark character. | ||
* @default '®' | ||
*/ | ||
registeredTrademark: false | string; | ||
/** | ||
* The one half character. | ||
* @default '½' | ||
*/ | ||
oneHalf: false | string; | ||
/** | ||
* The plus minus character. | ||
* @default '±' | ||
*/ | ||
plusMinus: false | string; | ||
/** | ||
* The not equal character. | ||
* @default '≠' | ||
*/ | ||
notEqual: false | string; | ||
/** | ||
* The laquo character. | ||
* @default '«' | ||
*/ | ||
laquo: false | string; | ||
/** | ||
* The raquo character. | ||
* @default '»' | ||
*/ | ||
raquo: false | string; | ||
/** | ||
* The multiplication character. | ||
* @default '×' | ||
*/ | ||
multiplication: false | string; | ||
/** | ||
* The superscript two character. | ||
* @default '²' | ||
*/ | ||
superscriptTwo: false | string; | ||
/** | ||
* The superscript three character. | ||
* @default '³' | ||
*/ | ||
superscriptThree: false | string; | ||
/** | ||
* The one quarter character. | ||
* @default '¼' | ||
*/ | ||
oneQuarter: false | string; | ||
/** | ||
* The three quarters character. | ||
* @default '¾' | ||
*/ | ||
threeQuarters: false | string; | ||
@@ -48,2 +136,6 @@ } | ||
export declare const threeQuarters: (override?: string) => import("@tiptap/core").InputRule; | ||
/** | ||
* This extension allows you to add typography replacements for specific characters. | ||
* @see https://www.tiptap.dev/api/extensions/typography | ||
*/ | ||
export declare const Typography: Extension<TypographyOptions, any>; |
{ | ||
"name": "@tiptap/extension-typography", | ||
"description": "typography 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, textInputRule } from '@tiptap/core' | ||
export interface TypographyOptions { | ||
/** | ||
* The em dash character. | ||
* @default '—' | ||
*/ | ||
emDash: false | string, | ||
/** | ||
* The ellipsis character. | ||
* @default '…' | ||
*/ | ||
ellipsis: false | string, | ||
/** | ||
* The open double quote character. | ||
* @default '“' | ||
*/ | ||
openDoubleQuote: false | string, | ||
/** | ||
* The close double quote character. | ||
* @default '”' | ||
*/ | ||
closeDoubleQuote: false | string, | ||
/** | ||
* The open single quote character. | ||
* @default '‘' | ||
*/ | ||
openSingleQuote: false | string, | ||
/** | ||
* The close single quote character. | ||
* @default '’' | ||
*/ | ||
closeSingleQuote: false | string, | ||
/** | ||
* The left arrow character. | ||
* @default '←' | ||
*/ | ||
leftArrow: false | string, | ||
/** | ||
* The right arrow character. | ||
* @default '→' | ||
*/ | ||
rightArrow: false | string, | ||
/** | ||
* The copyright character. | ||
* @default '©' | ||
*/ | ||
copyright: false | string, | ||
/** | ||
* The trademark character. | ||
* @default '™' | ||
*/ | ||
trademark: false | string, | ||
/** | ||
* The servicemark character. | ||
* @default '℠' | ||
*/ | ||
servicemark: false | string, | ||
/** | ||
* The registered trademark character. | ||
* @default '®' | ||
*/ | ||
registeredTrademark: false | string, | ||
/** | ||
* The one half character. | ||
* @default '½' | ||
*/ | ||
oneHalf: false | string, | ||
/** | ||
* The plus minus character. | ||
* @default '±' | ||
*/ | ||
plusMinus: false | string, | ||
/** | ||
* The not equal character. | ||
* @default '≠' | ||
*/ | ||
notEqual: false | string, | ||
/** | ||
* The laquo character. | ||
* @default '«' | ||
*/ | ||
laquo: false | string, | ||
/** | ||
* The raquo character. | ||
* @default '»' | ||
*/ | ||
raquo: false | string, | ||
/** | ||
* The multiplication character. | ||
* @default '×' | ||
*/ | ||
multiplication: false | string, | ||
/** | ||
* The superscript two character. | ||
* @default '²' | ||
*/ | ||
superscriptTwo: false | string, | ||
/** | ||
* The superscript three character. | ||
* @default '³' | ||
*/ | ||
superscriptThree: false | string, | ||
/** | ||
* The one quarter character. | ||
* @default '¼' | ||
*/ | ||
oneQuarter: false | string, | ||
/** | ||
* The three quarters character. | ||
* @default '¾' | ||
*/ | ||
threeQuarters: false | string, | ||
@@ -138,5 +247,36 @@ } | ||
/** | ||
* This extension allows you to add typography replacements for specific characters. | ||
* @see https://www.tiptap.dev/api/extensions/typography | ||
*/ | ||
export const Typography = Extension.create<TypographyOptions>({ | ||
name: 'typography', | ||
addOptions() { | ||
return { | ||
closeDoubleQuote: '”', | ||
closeSingleQuote: '’', | ||
copyright: '©', | ||
ellipsis: '…', | ||
emDash: '—', | ||
laquo: '«', | ||
leftArrow: '←', | ||
multiplication: '×', | ||
notEqual: '≠', | ||
oneHalf: '½', | ||
oneQuarter: '¼', | ||
openDoubleQuote: '“', | ||
openSingleQuote: '‘', | ||
plusMinus: '±', | ||
raquo: '»', | ||
registeredTrademark: '®', | ||
rightArrow: '→', | ||
servicemark: '℠', | ||
superscriptThree: '³', | ||
superscriptTwo: '²', | ||
threeQuarters: '¾', | ||
trademark: '™', | ||
} | ||
}, | ||
addInputRules() { | ||
@@ -143,0 +283,0 @@ const rules = [] |
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
90186
1087