@tiptap/extension-typography 2.0.0-beta.20 → 2.0.0-beta.200
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/packages/extension-typography/src/typography.d.ts +2 -0
- package/dist/tiptap-extension-typography.cjs.js +8 -0
- package/dist/tiptap-extension-typography.cjs.js.map +1 -1
- package/dist/tiptap-extension-typography.esm.js +8 -1
- package/dist/tiptap-extension-typography.esm.js.map +1 -1
- package/dist/tiptap-extension-typography.umd.js +8 -0
- package/dist/tiptap-extension-typography.umd.js.map +1 -1
- package/package.json +3 -4
- package/src/typography.ts +10 -0
- package/LICENSE.md +0 -21
|
@@ -10,6 +10,7 @@ export interface TypographyOptions {
|
|
|
10
10
|
rightArrow: false;
|
|
11
11
|
copyright: false;
|
|
12
12
|
trademark: false;
|
|
13
|
+
servicemark: false;
|
|
13
14
|
registeredTrademark: false;
|
|
14
15
|
oneHalf: false;
|
|
15
16
|
plusMinus: false;
|
|
@@ -32,6 +33,7 @@ export declare const leftArrow: import("@tiptap/core").InputRule;
|
|
|
32
33
|
export declare const rightArrow: import("@tiptap/core").InputRule;
|
|
33
34
|
export declare const copyright: import("@tiptap/core").InputRule;
|
|
34
35
|
export declare const trademark: import("@tiptap/core").InputRule;
|
|
36
|
+
export declare const servicemark: import("@tiptap/core").InputRule;
|
|
35
37
|
export declare const registeredTrademark: import("@tiptap/core").InputRule;
|
|
36
38
|
export declare const oneHalf: import("@tiptap/core").InputRule;
|
|
37
39
|
export declare const plusMinus: import("@tiptap/core").InputRule;
|
|
@@ -44,6 +44,10 @@ const trademark = core.textInputRule({
|
|
|
44
44
|
find: /\(tm\)$/,
|
|
45
45
|
replace: '™',
|
|
46
46
|
});
|
|
47
|
+
const servicemark = core.textInputRule({
|
|
48
|
+
find: /\(sm\)$/,
|
|
49
|
+
replace: '℠',
|
|
50
|
+
});
|
|
47
51
|
const registeredTrademark = core.textInputRule({
|
|
48
52
|
find: /\(r\)$/,
|
|
49
53
|
replace: '®',
|
|
@@ -122,6 +126,9 @@ const Typography = core.Extension.create({
|
|
|
122
126
|
if (this.options.trademark !== false) {
|
|
123
127
|
rules.push(trademark);
|
|
124
128
|
}
|
|
129
|
+
if (this.options.servicemark !== false) {
|
|
130
|
+
rules.push(servicemark);
|
|
131
|
+
}
|
|
125
132
|
if (this.options.registeredTrademark !== false) {
|
|
126
133
|
rules.push(registeredTrademark);
|
|
127
134
|
}
|
|
@@ -178,6 +185,7 @@ exports.plusMinus = plusMinus;
|
|
|
178
185
|
exports.raquo = raquo;
|
|
179
186
|
exports.registeredTrademark = registeredTrademark;
|
|
180
187
|
exports.rightArrow = rightArrow;
|
|
188
|
+
exports.servicemark = servicemark;
|
|
181
189
|
exports.superscriptThree = superscriptThree;
|
|
182
190
|
exports.superscriptTwo = superscriptTwo;
|
|
183
191
|
exports.threeQuarters = threeQuarters;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiptap-extension-typography.cjs.js","sources":["../src/typography.ts"],"sourcesContent":["import { Extension, textInputRule } from '@tiptap/core'\n\nexport interface TypographyOptions {\n emDash: false,\n ellipsis: false,\n openDoubleQuote: false,\n closeDoubleQuote: false,\n openSingleQuote: false,\n closeSingleQuote: false,\n leftArrow: false,\n rightArrow: false,\n copyright: false,\n trademark: false,\n registeredTrademark: false,\n oneHalf: false,\n plusMinus: false,\n notEqual: false,\n laquo: false,\n raquo: false,\n multiplication: false,\n superscriptTwo: false,\n superscriptThree: false,\n oneQuarter: false,\n threeQuarters: false,\n}\n\nexport const emDash = textInputRule({\n find: /--$/,\n replace: '—',\n})\n\nexport const ellipsis = textInputRule({\n find: /\\.\\.\\.$/,\n replace: '…',\n})\n\nexport const openDoubleQuote = textInputRule({\n find: /(?:^|[\\s{[(<'\"\\u2018\\u201C])(\")$/,\n replace: '“',\n})\n\nexport const closeDoubleQuote = textInputRule({\n find: /\"$/,\n replace: '”',\n})\n\nexport const openSingleQuote = textInputRule({\n find: /(?:^|[\\s{[(<'\"\\u2018\\u201C])(')$/,\n replace: '‘',\n})\n\nexport const closeSingleQuote = textInputRule({\n find: /'$/,\n replace: '’',\n})\n\nexport const leftArrow = textInputRule({\n find: /<-$/,\n replace: '←',\n})\n\nexport const rightArrow = textInputRule({\n find: /->$/,\n replace: '→',\n})\n\nexport const copyright = textInputRule({\n find: /\\(c\\)$/,\n replace: '©',\n})\n\nexport const trademark = textInputRule({\n find: /\\(tm\\)$/,\n replace: '™',\n})\n\nexport const registeredTrademark = textInputRule({\n find: /\\(r\\)$/,\n replace: '®',\n})\n\nexport const oneHalf = textInputRule({\n find: /1\\/2$/,\n replace: '½',\n})\n\nexport const plusMinus = textInputRule({\n find: /\\+\\/-$/,\n replace: '±',\n})\n\nexport const notEqual = textInputRule({\n find: /!=$/,\n replace: '≠',\n})\n\nexport const laquo = textInputRule({\n find: /<<$/,\n replace: '«',\n})\n\nexport const raquo = textInputRule({\n find: />>$/,\n replace: '»',\n})\n\nexport const multiplication = textInputRule({\n find: /\\d+\\s?([*x])\\s?\\d+$/,\n replace: '×',\n})\n\nexport const superscriptTwo = textInputRule({\n find: /\\^2$/,\n replace: '²',\n})\n\nexport const superscriptThree = textInputRule({\n find: /\\^3$/,\n replace: '³',\n})\n\nexport const oneQuarter = textInputRule({\n find: /1\\/4$/,\n replace: '¼',\n})\n\nexport const threeQuarters = textInputRule({\n find: /3\\/4$/,\n replace: '¾',\n})\n\nexport const Typography = Extension.create<TypographyOptions>({\n name: 'typography',\n\n addInputRules() {\n const rules = []\n\n if (this.options.emDash !== false) {\n rules.push(emDash)\n }\n\n if (this.options.ellipsis !== false) {\n rules.push(ellipsis)\n }\n\n if (this.options.openDoubleQuote !== false) {\n rules.push(openDoubleQuote)\n }\n\n if (this.options.closeDoubleQuote !== false) {\n rules.push(closeDoubleQuote)\n }\n\n if (this.options.openSingleQuote !== false) {\n rules.push(openSingleQuote)\n }\n\n if (this.options.closeSingleQuote !== false) {\n rules.push(closeSingleQuote)\n }\n\n if (this.options.leftArrow !== false) {\n rules.push(leftArrow)\n }\n\n if (this.options.rightArrow !== false) {\n rules.push(rightArrow)\n }\n\n if (this.options.copyright !== false) {\n rules.push(copyright)\n }\n\n if (this.options.trademark !== false) {\n rules.push(trademark)\n }\n\n if (this.options.registeredTrademark !== false) {\n rules.push(registeredTrademark)\n }\n\n if (this.options.oneHalf !== false) {\n rules.push(oneHalf)\n }\n\n if (this.options.plusMinus !== false) {\n rules.push(plusMinus)\n }\n\n if (this.options.notEqual !== false) {\n rules.push(notEqual)\n }\n\n if (this.options.laquo !== false) {\n rules.push(laquo)\n }\n\n if (this.options.raquo !== false) {\n rules.push(raquo)\n }\n\n if (this.options.multiplication !== false) {\n rules.push(multiplication)\n }\n\n if (this.options.superscriptTwo !== false) {\n rules.push(superscriptTwo)\n }\n\n if (this.options.superscriptThree !== false) {\n rules.push(superscriptThree)\n }\n\n if (this.options.oneQuarter !== false) {\n rules.push(oneQuarter)\n }\n\n if (this.options.threeQuarters !== false) {\n rules.push(threeQuarters)\n }\n\n return rules\n },\n})\n"],"names":["textInputRule","Extension"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"tiptap-extension-typography.cjs.js","sources":["../src/typography.ts"],"sourcesContent":["import { Extension, textInputRule } from '@tiptap/core'\n\nexport interface TypographyOptions {\n emDash: false,\n ellipsis: false,\n openDoubleQuote: false,\n closeDoubleQuote: false,\n openSingleQuote: false,\n closeSingleQuote: false,\n leftArrow: false,\n rightArrow: false,\n copyright: false,\n trademark: false,\n servicemark: false,\n registeredTrademark: false,\n oneHalf: false,\n plusMinus: false,\n notEqual: false,\n laquo: false,\n raquo: false,\n multiplication: false,\n superscriptTwo: false,\n superscriptThree: false,\n oneQuarter: false,\n threeQuarters: false,\n}\n\nexport const emDash = textInputRule({\n find: /--$/,\n replace: '—',\n})\n\nexport const ellipsis = textInputRule({\n find: /\\.\\.\\.$/,\n replace: '…',\n})\n\nexport const openDoubleQuote = textInputRule({\n find: /(?:^|[\\s{[(<'\"\\u2018\\u201C])(\")$/,\n replace: '“',\n})\n\nexport const closeDoubleQuote = textInputRule({\n find: /\"$/,\n replace: '”',\n})\n\nexport const openSingleQuote = textInputRule({\n find: /(?:^|[\\s{[(<'\"\\u2018\\u201C])(')$/,\n replace: '‘',\n})\n\nexport const closeSingleQuote = textInputRule({\n find: /'$/,\n replace: '’',\n})\n\nexport const leftArrow = textInputRule({\n find: /<-$/,\n replace: '←',\n})\n\nexport const rightArrow = textInputRule({\n find: /->$/,\n replace: '→',\n})\n\nexport const copyright = textInputRule({\n find: /\\(c\\)$/,\n replace: '©',\n})\n\nexport const trademark = textInputRule({\n find: /\\(tm\\)$/,\n replace: '™',\n})\n\nexport const servicemark = textInputRule({\n find: /\\(sm\\)$/,\n replace: '℠',\n})\n\nexport const registeredTrademark = textInputRule({\n find: /\\(r\\)$/,\n replace: '®',\n})\n\nexport const oneHalf = textInputRule({\n find: /1\\/2$/,\n replace: '½',\n})\n\nexport const plusMinus = textInputRule({\n find: /\\+\\/-$/,\n replace: '±',\n})\n\nexport const notEqual = textInputRule({\n find: /!=$/,\n replace: '≠',\n})\n\nexport const laquo = textInputRule({\n find: /<<$/,\n replace: '«',\n})\n\nexport const raquo = textInputRule({\n find: />>$/,\n replace: '»',\n})\n\nexport const multiplication = textInputRule({\n find: /\\d+\\s?([*x])\\s?\\d+$/,\n replace: '×',\n})\n\nexport const superscriptTwo = textInputRule({\n find: /\\^2$/,\n replace: '²',\n})\n\nexport const superscriptThree = textInputRule({\n find: /\\^3$/,\n replace: '³',\n})\n\nexport const oneQuarter = textInputRule({\n find: /1\\/4$/,\n replace: '¼',\n})\n\nexport const threeQuarters = textInputRule({\n find: /3\\/4$/,\n replace: '¾',\n})\n\nexport const Typography = Extension.create<TypographyOptions>({\n name: 'typography',\n\n addInputRules() {\n const rules = []\n\n if (this.options.emDash !== false) {\n rules.push(emDash)\n }\n\n if (this.options.ellipsis !== false) {\n rules.push(ellipsis)\n }\n\n if (this.options.openDoubleQuote !== false) {\n rules.push(openDoubleQuote)\n }\n\n if (this.options.closeDoubleQuote !== false) {\n rules.push(closeDoubleQuote)\n }\n\n if (this.options.openSingleQuote !== false) {\n rules.push(openSingleQuote)\n }\n\n if (this.options.closeSingleQuote !== false) {\n rules.push(closeSingleQuote)\n }\n\n if (this.options.leftArrow !== false) {\n rules.push(leftArrow)\n }\n\n if (this.options.rightArrow !== false) {\n rules.push(rightArrow)\n }\n\n if (this.options.copyright !== false) {\n rules.push(copyright)\n }\n\n if (this.options.trademark !== false) {\n rules.push(trademark)\n }\n\n if (this.options.servicemark !== false) {\n rules.push(servicemark)\n }\n\n if (this.options.registeredTrademark !== false) {\n rules.push(registeredTrademark)\n }\n\n if (this.options.oneHalf !== false) {\n rules.push(oneHalf)\n }\n\n if (this.options.plusMinus !== false) {\n rules.push(plusMinus)\n }\n\n if (this.options.notEqual !== false) {\n rules.push(notEqual)\n }\n\n if (this.options.laquo !== false) {\n rules.push(laquo)\n }\n\n if (this.options.raquo !== false) {\n rules.push(raquo)\n }\n\n if (this.options.multiplication !== false) {\n rules.push(multiplication)\n }\n\n if (this.options.superscriptTwo !== false) {\n rules.push(superscriptTwo)\n }\n\n if (this.options.superscriptThree !== false) {\n rules.push(superscriptThree)\n }\n\n if (this.options.oneQuarter !== false) {\n rules.push(oneQuarter)\n }\n\n if (this.options.threeQuarters !== false) {\n rules.push(threeQuarters)\n }\n\n return rules\n },\n})\n"],"names":["textInputRule","Extension"],"mappings":";;;;;;AA2BO,MAAM,MAAM,GAAGA,kBAAa,CAAC;AAClC,IAAA,IAAI,EAAE,KAAK;AACX,IAAA,OAAO,EAAE,GAAG;AACb,CAAA,EAAC;AAEK,MAAM,QAAQ,GAAGA,kBAAa,CAAC;AACpC,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,OAAO,EAAE,GAAG;AACb,CAAA,EAAC;AAEK,MAAM,eAAe,GAAGA,kBAAa,CAAC;AAC3C,IAAA,IAAI,EAAE,kCAAkC;AACxC,IAAA,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C,OAAO,CAAC,gBAAgB,KAAK,KAAK,EAAE;AAC3C,YAAA,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;AAC7B,SAAA;AAED,QAAA,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,KAAK,KAAK,EAAE;AACrC,YAAA,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;AACvB,SAAA;AAED,QAAA,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,KAAK,KAAK,EAAE;AACxC,YAAA,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;AAC1B,SAAA;AAED,QAAA,OAAO,KAAK,CAAA;KACb;AACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -40,6 +40,10 @@ const trademark = textInputRule({
|
|
|
40
40
|
find: /\(tm\)$/,
|
|
41
41
|
replace: '™',
|
|
42
42
|
});
|
|
43
|
+
const servicemark = textInputRule({
|
|
44
|
+
find: /\(sm\)$/,
|
|
45
|
+
replace: '℠',
|
|
46
|
+
});
|
|
43
47
|
const registeredTrademark = textInputRule({
|
|
44
48
|
find: /\(r\)$/,
|
|
45
49
|
replace: '®',
|
|
@@ -118,6 +122,9 @@ const Typography = Extension.create({
|
|
|
118
122
|
if (this.options.trademark !== false) {
|
|
119
123
|
rules.push(trademark);
|
|
120
124
|
}
|
|
125
|
+
if (this.options.servicemark !== false) {
|
|
126
|
+
rules.push(servicemark);
|
|
127
|
+
}
|
|
121
128
|
if (this.options.registeredTrademark !== false) {
|
|
122
129
|
rules.push(registeredTrademark);
|
|
123
130
|
}
|
|
@@ -155,5 +162,5 @@ const Typography = Extension.create({
|
|
|
155
162
|
},
|
|
156
163
|
});
|
|
157
164
|
|
|
158
|
-
export { Typography, closeDoubleQuote, closeSingleQuote, copyright, Typography as default, ellipsis, emDash, laquo, leftArrow, multiplication, notEqual, oneHalf, oneQuarter, openDoubleQuote, openSingleQuote, plusMinus, raquo, registeredTrademark, rightArrow, superscriptThree, superscriptTwo, threeQuarters, trademark };
|
|
165
|
+
export { Typography, closeDoubleQuote, closeSingleQuote, copyright, Typography as default, ellipsis, emDash, laquo, leftArrow, multiplication, notEqual, oneHalf, oneQuarter, openDoubleQuote, openSingleQuote, plusMinus, raquo, registeredTrademark, rightArrow, servicemark, superscriptThree, superscriptTwo, threeQuarters, trademark };
|
|
159
166
|
//# sourceMappingURL=tiptap-extension-typography.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiptap-extension-typography.esm.js","sources":["../src/typography.ts"],"sourcesContent":["import { Extension, textInputRule } from '@tiptap/core'\n\nexport interface TypographyOptions {\n emDash: false,\n ellipsis: false,\n openDoubleQuote: false,\n closeDoubleQuote: false,\n openSingleQuote: false,\n closeSingleQuote: false,\n leftArrow: false,\n rightArrow: false,\n copyright: false,\n trademark: false,\n registeredTrademark: false,\n oneHalf: false,\n plusMinus: false,\n notEqual: false,\n laquo: false,\n raquo: false,\n multiplication: false,\n superscriptTwo: false,\n superscriptThree: false,\n oneQuarter: false,\n threeQuarters: false,\n}\n\nexport const emDash = textInputRule({\n find: /--$/,\n replace: '—',\n})\n\nexport const ellipsis = textInputRule({\n find: /\\.\\.\\.$/,\n replace: '…',\n})\n\nexport const openDoubleQuote = textInputRule({\n find: /(?:^|[\\s{[(<'\"\\u2018\\u201C])(\")$/,\n replace: '“',\n})\n\nexport const closeDoubleQuote = textInputRule({\n find: /\"$/,\n replace: '”',\n})\n\nexport const openSingleQuote = textInputRule({\n find: /(?:^|[\\s{[(<'\"\\u2018\\u201C])(')$/,\n replace: '‘',\n})\n\nexport const closeSingleQuote = textInputRule({\n find: /'$/,\n replace: '’',\n})\n\nexport const leftArrow = textInputRule({\n find: /<-$/,\n replace: '←',\n})\n\nexport const rightArrow = textInputRule({\n find: /->$/,\n replace: '→',\n})\n\nexport const copyright = textInputRule({\n find: /\\(c\\)$/,\n replace: '©',\n})\n\nexport const trademark = textInputRule({\n find: /\\(tm\\)$/,\n replace: '™',\n})\n\nexport const registeredTrademark = textInputRule({\n find: /\\(r\\)$/,\n replace: '®',\n})\n\nexport const oneHalf = textInputRule({\n find: /1\\/2$/,\n replace: '½',\n})\n\nexport const plusMinus = textInputRule({\n find: /\\+\\/-$/,\n replace: '±',\n})\n\nexport const notEqual = textInputRule({\n find: /!=$/,\n replace: '≠',\n})\n\nexport const laquo = textInputRule({\n find: /<<$/,\n replace: '«',\n})\n\nexport const raquo = textInputRule({\n find: />>$/,\n replace: '»',\n})\n\nexport const multiplication = textInputRule({\n find: /\\d+\\s?([*x])\\s?\\d+$/,\n replace: '×',\n})\n\nexport const superscriptTwo = textInputRule({\n find: /\\^2$/,\n replace: '²',\n})\n\nexport const superscriptThree = textInputRule({\n find: /\\^3$/,\n replace: '³',\n})\n\nexport const oneQuarter = textInputRule({\n find: /1\\/4$/,\n replace: '¼',\n})\n\nexport const threeQuarters = textInputRule({\n find: /3\\/4$/,\n replace: '¾',\n})\n\nexport const Typography = Extension.create<TypographyOptions>({\n name: 'typography',\n\n addInputRules() {\n const rules = []\n\n if (this.options.emDash !== false) {\n rules.push(emDash)\n }\n\n if (this.options.ellipsis !== false) {\n rules.push(ellipsis)\n }\n\n if (this.options.openDoubleQuote !== false) {\n rules.push(openDoubleQuote)\n }\n\n if (this.options.closeDoubleQuote !== false) {\n rules.push(closeDoubleQuote)\n }\n\n if (this.options.openSingleQuote !== false) {\n rules.push(openSingleQuote)\n }\n\n if (this.options.closeSingleQuote !== false) {\n rules.push(closeSingleQuote)\n }\n\n if (this.options.leftArrow !== false) {\n rules.push(leftArrow)\n }\n\n if (this.options.rightArrow !== false) {\n rules.push(rightArrow)\n }\n\n if (this.options.copyright !== false) {\n rules.push(copyright)\n }\n\n if (this.options.trademark !== false) {\n rules.push(trademark)\n }\n\n if (this.options.registeredTrademark !== false) {\n rules.push(registeredTrademark)\n }\n\n if (this.options.oneHalf !== false) {\n rules.push(oneHalf)\n }\n\n if (this.options.plusMinus !== false) {\n rules.push(plusMinus)\n }\n\n if (this.options.notEqual !== false) {\n rules.push(notEqual)\n }\n\n if (this.options.laquo !== false) {\n rules.push(laquo)\n }\n\n if (this.options.raquo !== false) {\n rules.push(raquo)\n }\n\n if (this.options.multiplication !== false) {\n rules.push(multiplication)\n }\n\n if (this.options.superscriptTwo !== false) {\n rules.push(superscriptTwo)\n }\n\n if (this.options.superscriptThree !== false) {\n rules.push(superscriptThree)\n }\n\n if (this.options.oneQuarter !== false) {\n rules.push(oneQuarter)\n }\n\n if (this.options.threeQuarters !== false) {\n rules.push(threeQuarters)\n }\n\n return rules\n },\n})\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"tiptap-extension-typography.esm.js","sources":["../src/typography.ts"],"sourcesContent":["import { Extension, textInputRule } from '@tiptap/core'\n\nexport interface TypographyOptions {\n emDash: false,\n ellipsis: false,\n openDoubleQuote: false,\n closeDoubleQuote: false,\n openSingleQuote: false,\n closeSingleQuote: false,\n leftArrow: false,\n rightArrow: false,\n copyright: false,\n trademark: false,\n servicemark: false,\n registeredTrademark: false,\n oneHalf: false,\n plusMinus: false,\n notEqual: false,\n laquo: false,\n raquo: false,\n multiplication: false,\n superscriptTwo: false,\n superscriptThree: false,\n oneQuarter: false,\n threeQuarters: false,\n}\n\nexport const emDash = textInputRule({\n find: /--$/,\n replace: '—',\n})\n\nexport const ellipsis = textInputRule({\n find: /\\.\\.\\.$/,\n replace: '…',\n})\n\nexport const openDoubleQuote = textInputRule({\n find: /(?:^|[\\s{[(<'\"\\u2018\\u201C])(\")$/,\n replace: '“',\n})\n\nexport const closeDoubleQuote = textInputRule({\n find: /\"$/,\n replace: '”',\n})\n\nexport const openSingleQuote = textInputRule({\n find: /(?:^|[\\s{[(<'\"\\u2018\\u201C])(')$/,\n replace: '‘',\n})\n\nexport const closeSingleQuote = textInputRule({\n find: /'$/,\n replace: '’',\n})\n\nexport const leftArrow = textInputRule({\n find: /<-$/,\n replace: '←',\n})\n\nexport const rightArrow = textInputRule({\n find: /->$/,\n replace: '→',\n})\n\nexport const copyright = textInputRule({\n find: /\\(c\\)$/,\n replace: '©',\n})\n\nexport const trademark = textInputRule({\n find: /\\(tm\\)$/,\n replace: '™',\n})\n\nexport const servicemark = textInputRule({\n find: /\\(sm\\)$/,\n replace: '℠',\n})\n\nexport const registeredTrademark = textInputRule({\n find: /\\(r\\)$/,\n replace: '®',\n})\n\nexport const oneHalf = textInputRule({\n find: /1\\/2$/,\n replace: '½',\n})\n\nexport const plusMinus = textInputRule({\n find: /\\+\\/-$/,\n replace: '±',\n})\n\nexport const notEqual = textInputRule({\n find: /!=$/,\n replace: '≠',\n})\n\nexport const laquo = textInputRule({\n find: /<<$/,\n replace: '«',\n})\n\nexport const raquo = textInputRule({\n find: />>$/,\n replace: '»',\n})\n\nexport const multiplication = textInputRule({\n find: /\\d+\\s?([*x])\\s?\\d+$/,\n replace: '×',\n})\n\nexport const superscriptTwo = textInputRule({\n find: /\\^2$/,\n replace: '²',\n})\n\nexport const superscriptThree = textInputRule({\n find: /\\^3$/,\n replace: '³',\n})\n\nexport const oneQuarter = textInputRule({\n find: /1\\/4$/,\n replace: '¼',\n})\n\nexport const threeQuarters = textInputRule({\n find: /3\\/4$/,\n replace: '¾',\n})\n\nexport const Typography = Extension.create<TypographyOptions>({\n name: 'typography',\n\n addInputRules() {\n const rules = []\n\n if (this.options.emDash !== false) {\n rules.push(emDash)\n }\n\n if (this.options.ellipsis !== false) {\n rules.push(ellipsis)\n }\n\n if (this.options.openDoubleQuote !== false) {\n rules.push(openDoubleQuote)\n }\n\n if (this.options.closeDoubleQuote !== false) {\n rules.push(closeDoubleQuote)\n }\n\n if (this.options.openSingleQuote !== false) {\n rules.push(openSingleQuote)\n }\n\n if (this.options.closeSingleQuote !== false) {\n rules.push(closeSingleQuote)\n }\n\n if (this.options.leftArrow !== false) {\n rules.push(leftArrow)\n }\n\n if (this.options.rightArrow !== false) {\n rules.push(rightArrow)\n }\n\n if (this.options.copyright !== false) {\n rules.push(copyright)\n }\n\n if (this.options.trademark !== false) {\n rules.push(trademark)\n }\n\n if (this.options.servicemark !== false) {\n rules.push(servicemark)\n }\n\n if (this.options.registeredTrademark !== false) {\n rules.push(registeredTrademark)\n }\n\n if (this.options.oneHalf !== false) {\n rules.push(oneHalf)\n }\n\n if (this.options.plusMinus !== false) {\n rules.push(plusMinus)\n }\n\n if (this.options.notEqual !== false) {\n rules.push(notEqual)\n }\n\n if (this.options.laquo !== false) {\n rules.push(laquo)\n }\n\n if (this.options.raquo !== false) {\n rules.push(raquo)\n }\n\n if (this.options.multiplication !== false) {\n rules.push(multiplication)\n }\n\n if (this.options.superscriptTwo !== false) {\n rules.push(superscriptTwo)\n }\n\n if (this.options.superscriptThree !== false) {\n rules.push(superscriptThree)\n }\n\n if (this.options.oneQuarter !== false) {\n rules.push(oneQuarter)\n }\n\n if (this.options.threeQuarters !== false) {\n rules.push(threeQuarters)\n }\n\n return rules\n },\n})\n"],"names":[],"mappings":";;AA2BO,MAAM,MAAM,GAAG,aAAa,CAAC;AAClC,IAAA,IAAI,EAAE,KAAK;AACX,IAAA,OAAO,EAAE,GAAG;AACb,CAAA,EAAC;AAEK,MAAM,QAAQ,GAAG,aAAa,CAAC;AACpC,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,OAAO,EAAE,GAAG;AACb,CAAA,EAAC;AAEK,MAAM,eAAe,GAAG,aAAa,CAAC;AAC3C,IAAA,IAAI,EAAE,kCAAkC;AACxC,IAAA,OAAO,EAAE,GAAG;AACb,CAAA,EAAC;AAEK,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAC5C,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,OAAO,EAAE,GAAG;AACb,CAAA,EAAC;AAEK,MAAM,eAAe,GAAG,aAAa,CAAC;AAC3C,IAAA,IAAI,EAAE,kCAAkC;AACxC,IAAA,OAAO,EAAE,GAAG;AACb,CAAA,EAAC;AAEK,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAC5C,IAAA,IAAI,EAAE,I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,QAAA,OAAO,KAAK,CAAA;KACb;AACF,CAAA;;;;"}
|
|
@@ -44,6 +44,10 @@
|
|
|
44
44
|
find: /\(tm\)$/,
|
|
45
45
|
replace: '™',
|
|
46
46
|
});
|
|
47
|
+
const servicemark = core.textInputRule({
|
|
48
|
+
find: /\(sm\)$/,
|
|
49
|
+
replace: '℠',
|
|
50
|
+
});
|
|
47
51
|
const registeredTrademark = core.textInputRule({
|
|
48
52
|
find: /\(r\)$/,
|
|
49
53
|
replace: '®',
|
|
@@ -122,6 +126,9 @@
|
|
|
122
126
|
if (this.options.trademark !== false) {
|
|
123
127
|
rules.push(trademark);
|
|
124
128
|
}
|
|
129
|
+
if (this.options.servicemark !== false) {
|
|
130
|
+
rules.push(servicemark);
|
|
131
|
+
}
|
|
125
132
|
if (this.options.registeredTrademark !== false) {
|
|
126
133
|
rules.push(registeredTrademark);
|
|
127
134
|
}
|
|
@@ -178,6 +185,7 @@
|
|
|
178
185
|
exports.raquo = raquo;
|
|
179
186
|
exports.registeredTrademark = registeredTrademark;
|
|
180
187
|
exports.rightArrow = rightArrow;
|
|
188
|
+
exports.servicemark = servicemark;
|
|
181
189
|
exports.superscriptThree = superscriptThree;
|
|
182
190
|
exports.superscriptTwo = superscriptTwo;
|
|
183
191
|
exports.threeQuarters = threeQuarters;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiptap-extension-typography.umd.js","sources":["../src/typography.ts"],"sourcesContent":["import { Extension, textInputRule } from '@tiptap/core'\n\nexport interface TypographyOptions {\n emDash: false,\n ellipsis: false,\n openDoubleQuote: false,\n closeDoubleQuote: false,\n openSingleQuote: false,\n closeSingleQuote: false,\n leftArrow: false,\n rightArrow: false,\n copyright: false,\n trademark: false,\n registeredTrademark: false,\n oneHalf: false,\n plusMinus: false,\n notEqual: false,\n laquo: false,\n raquo: false,\n multiplication: false,\n superscriptTwo: false,\n superscriptThree: false,\n oneQuarter: false,\n threeQuarters: false,\n}\n\nexport const emDash = textInputRule({\n find: /--$/,\n replace: '—',\n})\n\nexport const ellipsis = textInputRule({\n find: /\\.\\.\\.$/,\n replace: '…',\n})\n\nexport const openDoubleQuote = textInputRule({\n find: /(?:^|[\\s{[(<'\"\\u2018\\u201C])(\")$/,\n replace: '“',\n})\n\nexport const closeDoubleQuote = textInputRule({\n find: /\"$/,\n replace: '”',\n})\n\nexport const openSingleQuote = textInputRule({\n find: /(?:^|[\\s{[(<'\"\\u2018\\u201C])(')$/,\n replace: '‘',\n})\n\nexport const closeSingleQuote = textInputRule({\n find: /'$/,\n replace: '’',\n})\n\nexport const leftArrow = textInputRule({\n find: /<-$/,\n replace: '←',\n})\n\nexport const rightArrow = textInputRule({\n find: /->$/,\n replace: '→',\n})\n\nexport const copyright = textInputRule({\n find: /\\(c\\)$/,\n replace: '©',\n})\n\nexport const trademark = textInputRule({\n find: /\\(tm\\)$/,\n replace: '™',\n})\n\nexport const registeredTrademark = textInputRule({\n find: /\\(r\\)$/,\n replace: '®',\n})\n\nexport const oneHalf = textInputRule({\n find: /1\\/2$/,\n replace: '½',\n})\n\nexport const plusMinus = textInputRule({\n find: /\\+\\/-$/,\n replace: '±',\n})\n\nexport const notEqual = textInputRule({\n find: /!=$/,\n replace: '≠',\n})\n\nexport const laquo = textInputRule({\n find: /<<$/,\n replace: '«',\n})\n\nexport const raquo = textInputRule({\n find: />>$/,\n replace: '»',\n})\n\nexport const multiplication = textInputRule({\n find: /\\d+\\s?([*x])\\s?\\d+$/,\n replace: '×',\n})\n\nexport const superscriptTwo = textInputRule({\n find: /\\^2$/,\n replace: '²',\n})\n\nexport const superscriptThree = textInputRule({\n find: /\\^3$/,\n replace: '³',\n})\n\nexport const oneQuarter = textInputRule({\n find: /1\\/4$/,\n replace: '¼',\n})\n\nexport const threeQuarters = textInputRule({\n find: /3\\/4$/,\n replace: '¾',\n})\n\nexport const Typography = Extension.create<TypographyOptions>({\n name: 'typography',\n\n addInputRules() {\n const rules = []\n\n if (this.options.emDash !== false) {\n rules.push(emDash)\n }\n\n if (this.options.ellipsis !== false) {\n rules.push(ellipsis)\n }\n\n if (this.options.openDoubleQuote !== false) {\n rules.push(openDoubleQuote)\n }\n\n if (this.options.closeDoubleQuote !== false) {\n rules.push(closeDoubleQuote)\n }\n\n if (this.options.openSingleQuote !== false) {\n rules.push(openSingleQuote)\n }\n\n if (this.options.closeSingleQuote !== false) {\n rules.push(closeSingleQuote)\n }\n\n if (this.options.leftArrow !== false) {\n rules.push(leftArrow)\n }\n\n if (this.options.rightArrow !== false) {\n rules.push(rightArrow)\n }\n\n if (this.options.copyright !== false) {\n rules.push(copyright)\n }\n\n if (this.options.trademark !== false) {\n rules.push(trademark)\n }\n\n if (this.options.registeredTrademark !== false) {\n rules.push(registeredTrademark)\n }\n\n if (this.options.oneHalf !== false) {\n rules.push(oneHalf)\n }\n\n if (this.options.plusMinus !== false) {\n rules.push(plusMinus)\n }\n\n if (this.options.notEqual !== false) {\n rules.push(notEqual)\n }\n\n if (this.options.laquo !== false) {\n rules.push(laquo)\n }\n\n if (this.options.raquo !== false) {\n rules.push(raquo)\n }\n\n if (this.options.multiplication !== false) {\n rules.push(multiplication)\n }\n\n if (this.options.superscriptTwo !== false) {\n rules.push(superscriptTwo)\n }\n\n if (this.options.superscriptThree !== false) {\n rules.push(superscriptThree)\n }\n\n if (this.options.oneQuarter !== false) {\n rules.push(oneQuarter)\n }\n\n if (this.options.threeQuarters !== false) {\n rules.push(threeQuarters)\n }\n\n return rules\n },\n})\n"],"names":["textInputRule","Extension"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"tiptap-extension-typography.umd.js","sources":["../src/typography.ts"],"sourcesContent":["import { Extension, textInputRule } from '@tiptap/core'\n\nexport interface TypographyOptions {\n emDash: false,\n ellipsis: false,\n openDoubleQuote: false,\n closeDoubleQuote: false,\n openSingleQuote: false,\n closeSingleQuote: false,\n leftArrow: false,\n rightArrow: false,\n copyright: false,\n trademark: false,\n servicemark: false,\n registeredTrademark: false,\n oneHalf: false,\n plusMinus: false,\n notEqual: false,\n laquo: false,\n raquo: false,\n multiplication: false,\n superscriptTwo: false,\n superscriptThree: false,\n oneQuarter: false,\n threeQuarters: false,\n}\n\nexport const emDash = textInputRule({\n find: /--$/,\n replace: '—',\n})\n\nexport const ellipsis = textInputRule({\n find: /\\.\\.\\.$/,\n replace: '…',\n})\n\nexport const openDoubleQuote = textInputRule({\n find: /(?:^|[\\s{[(<'\"\\u2018\\u201C])(\")$/,\n replace: '“',\n})\n\nexport const closeDoubleQuote = textInputRule({\n find: /\"$/,\n replace: '”',\n})\n\nexport const openSingleQuote = textInputRule({\n find: /(?:^|[\\s{[(<'\"\\u2018\\u201C])(')$/,\n replace: '‘',\n})\n\nexport const closeSingleQuote = textInputRule({\n find: /'$/,\n replace: '’',\n})\n\nexport const leftArrow = textInputRule({\n find: /<-$/,\n replace: '←',\n})\n\nexport const rightArrow = textInputRule({\n find: /->$/,\n replace: '→',\n})\n\nexport const copyright = textInputRule({\n find: /\\(c\\)$/,\n replace: '©',\n})\n\nexport const trademark = textInputRule({\n find: /\\(tm\\)$/,\n replace: '™',\n})\n\nexport const servicemark = textInputRule({\n find: /\\(sm\\)$/,\n replace: '℠',\n})\n\nexport const registeredTrademark = textInputRule({\n find: /\\(r\\)$/,\n replace: '®',\n})\n\nexport const oneHalf = textInputRule({\n find: /1\\/2$/,\n replace: '½',\n})\n\nexport const plusMinus = textInputRule({\n find: /\\+\\/-$/,\n replace: '±',\n})\n\nexport const notEqual = textInputRule({\n find: /!=$/,\n replace: '≠',\n})\n\nexport const laquo = textInputRule({\n find: /<<$/,\n replace: '«',\n})\n\nexport const raquo = textInputRule({\n find: />>$/,\n replace: '»',\n})\n\nexport const multiplication = textInputRule({\n find: /\\d+\\s?([*x])\\s?\\d+$/,\n replace: '×',\n})\n\nexport const superscriptTwo = textInputRule({\n find: /\\^2$/,\n replace: '²',\n})\n\nexport const superscriptThree = textInputRule({\n find: /\\^3$/,\n replace: '³',\n})\n\nexport const oneQuarter = textInputRule({\n find: /1\\/4$/,\n replace: '¼',\n})\n\nexport const threeQuarters = textInputRule({\n find: /3\\/4$/,\n replace: '¾',\n})\n\nexport const Typography = Extension.create<TypographyOptions>({\n name: 'typography',\n\n addInputRules() {\n const rules = []\n\n if (this.options.emDash !== false) {\n rules.push(emDash)\n }\n\n if (this.options.ellipsis !== false) {\n rules.push(ellipsis)\n }\n\n if (this.options.openDoubleQuote !== false) {\n rules.push(openDoubleQuote)\n }\n\n if (this.options.closeDoubleQuote !== false) {\n rules.push(closeDoubleQuote)\n }\n\n if (this.options.openSingleQuote !== false) {\n rules.push(openSingleQuote)\n }\n\n if (this.options.closeSingleQuote !== false) {\n rules.push(closeSingleQuote)\n }\n\n if (this.options.leftArrow !== false) {\n rules.push(leftArrow)\n }\n\n if (this.options.rightArrow !== false) {\n rules.push(rightArrow)\n }\n\n if (this.options.copyright !== false) {\n rules.push(copyright)\n }\n\n if (this.options.trademark !== false) {\n rules.push(trademark)\n }\n\n if (this.options.servicemark !== false) {\n rules.push(servicemark)\n }\n\n if (this.options.registeredTrademark !== false) {\n rules.push(registeredTrademark)\n }\n\n if (this.options.oneHalf !== false) {\n rules.push(oneHalf)\n }\n\n if (this.options.plusMinus !== false) {\n rules.push(plusMinus)\n }\n\n if (this.options.notEqual !== false) {\n rules.push(notEqual)\n }\n\n if (this.options.laquo !== false) {\n rules.push(laquo)\n }\n\n if (this.options.raquo !== false) {\n rules.push(raquo)\n }\n\n if (this.options.multiplication !== false) {\n rules.push(multiplication)\n }\n\n if (this.options.superscriptTwo !== false) {\n rules.push(superscriptTwo)\n }\n\n if (this.options.superscriptThree !== false) {\n rules.push(superscriptThree)\n }\n\n if (this.options.oneQuarter !== false) {\n rules.push(oneQuarter)\n }\n\n if (this.options.threeQuarters !== false) {\n rules.push(threeQuarters)\n }\n\n return rules\n },\n})\n"],"names":["textInputRule","Extension"],"mappings":";;;;;;AA2BO,QAAM,MAAM,GAAGA,kBAAa,CAAC;EAClC,IAAA,IAAI,EAAE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C,cAAc,KAAK,KAAK,EAAE;EACzC,YAAA,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;EAC3B,SAAA;EAED,QAAA,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,KAAK,KAAK,EAAE;EACzC,YAAA,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;EAC3B,SAAA;EAED,QAAA,IAAI,IAAI,CAAC,OAAO,CAAC,gBAAgB,KAAK,KAAK,EAAE;EAC3C,YAAA,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;EAC7B,SAAA;EAED,QAAA,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,KAAK,KAAK,EAAE;EACrC,YAAA,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;EACvB,SAAA;EAED,QAAA,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,KAAK,KAAK,EAAE;EACxC,YAAA,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;EAC1B,SAAA;EAED,QAAA,OAAO,KAAK,CAAA;OACb;EACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/extension-typography",
|
|
3
3
|
"description": "typography extension for tiptap",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.200",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -21,12 +21,11 @@
|
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@tiptap/core": "^2.0.0-beta.
|
|
24
|
+
"@tiptap/core": "^2.0.0-beta.193"
|
|
25
25
|
},
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|
|
28
28
|
"url": "https://github.com/ueberdosis/tiptap",
|
|
29
29
|
"directory": "packages/extension-typography"
|
|
30
|
-
}
|
|
31
|
-
"gitHead": "3227b7736b26542f5b648262450b0af1a8667c1a"
|
|
30
|
+
}
|
|
32
31
|
}
|
package/src/typography.ts
CHANGED
|
@@ -11,6 +11,7 @@ export interface TypographyOptions {
|
|
|
11
11
|
rightArrow: false,
|
|
12
12
|
copyright: false,
|
|
13
13
|
trademark: false,
|
|
14
|
+
servicemark: false,
|
|
14
15
|
registeredTrademark: false,
|
|
15
16
|
oneHalf: false,
|
|
16
17
|
plusMinus: false,
|
|
@@ -74,6 +75,11 @@ export const trademark = textInputRule({
|
|
|
74
75
|
replace: '™',
|
|
75
76
|
})
|
|
76
77
|
|
|
78
|
+
export const servicemark = textInputRule({
|
|
79
|
+
find: /\(sm\)$/,
|
|
80
|
+
replace: '℠',
|
|
81
|
+
})
|
|
82
|
+
|
|
77
83
|
export const registeredTrademark = textInputRule({
|
|
78
84
|
find: /\(r\)$/,
|
|
79
85
|
replace: '®',
|
|
@@ -175,6 +181,10 @@ export const Typography = Extension.create<TypographyOptions>({
|
|
|
175
181
|
rules.push(trademark)
|
|
176
182
|
}
|
|
177
183
|
|
|
184
|
+
if (this.options.servicemark !== false) {
|
|
185
|
+
rules.push(servicemark)
|
|
186
|
+
}
|
|
187
|
+
|
|
178
188
|
if (this.options.registeredTrademark !== false) {
|
|
179
189
|
rules.push(registeredTrademark)
|
|
180
190
|
}
|
package/LICENSE.md
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021, überdosis GbR
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|