@tiptap/extension-typography 2.11.6 → 3.0.0-beta.0

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/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025, Tiptap GmbH
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.
package/README.md CHANGED
@@ -1,14 +1,18 @@
1
1
  # @tiptap/extension-typography
2
+
2
3
  [![Version](https://img.shields.io/npm/v/@tiptap/extension-typography.svg?label=version)](https://www.npmjs.com/package/@tiptap/extension-typography)
3
4
  [![Downloads](https://img.shields.io/npm/dm/@tiptap/extension-typography.svg)](https://npmcharts.com/compare/tiptap?minimal=true)
4
5
  [![License](https://img.shields.io/npm/l/@tiptap/extension-typography.svg)](https://www.npmjs.com/package/@tiptap/extension-typography)
5
6
  [![Sponsor](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub)](https://github.com/sponsors/ueberdosis)
6
7
 
7
8
  ## Introduction
8
- Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as *New York Times*, *The Guardian* or *Atlassian*.
9
+
10
+ Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as _New York Times_, _The Guardian_ or _Atlassian_.
9
11
 
10
12
  ## Official Documentation
13
+
11
14
  Documentation can be found on the [Tiptap website](https://tiptap.dev).
12
15
 
13
16
  ## License
17
+
14
18
  Tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md).
package/dist/index.cjs CHANGED
@@ -1,223 +1,268 @@
1
- 'use strict';
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2
19
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var core = require('@tiptap/core');
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ Typography: () => Typography,
24
+ closeDoubleQuote: () => closeDoubleQuote,
25
+ closeSingleQuote: () => closeSingleQuote,
26
+ copyright: () => copyright,
27
+ default: () => index_default,
28
+ ellipsis: () => ellipsis,
29
+ emDash: () => emDash,
30
+ laquo: () => laquo,
31
+ leftArrow: () => leftArrow,
32
+ multiplication: () => multiplication,
33
+ notEqual: () => notEqual,
34
+ oneHalf: () => oneHalf,
35
+ oneQuarter: () => oneQuarter,
36
+ openDoubleQuote: () => openDoubleQuote,
37
+ openSingleQuote: () => openSingleQuote,
38
+ plusMinus: () => plusMinus,
39
+ raquo: () => raquo,
40
+ registeredTrademark: () => registeredTrademark,
41
+ rightArrow: () => rightArrow,
42
+ servicemark: () => servicemark,
43
+ superscriptThree: () => superscriptThree,
44
+ superscriptTwo: () => superscriptTwo,
45
+ threeQuarters: () => threeQuarters,
46
+ trademark: () => trademark
47
+ });
48
+ module.exports = __toCommonJS(index_exports);
6
49
 
7
- const emDash = (override) => core.textInputRule({
8
- find: /--$/,
9
- replace: override !== null && override !== void 0 ? override : '—',
10
- });
11
- const ellipsis = (override) => core.textInputRule({
12
- find: /\.\.\.$/,
13
- replace: override !== null && override !== void 0 ? override : '…',
14
- });
15
- const openDoubleQuote = (override) => core.textInputRule({
16
- find: /(?:^|[\s{[(<'"\u2018\u201C])(")$/,
17
- replace: override !== null && override !== void 0 ? override : '“',
18
- });
19
- const closeDoubleQuote = (override) => core.textInputRule({
20
- find: /"$/,
21
- replace: override !== null && override !== void 0 ? override : '”',
22
- });
23
- const openSingleQuote = (override) => core.textInputRule({
24
- find: /(?:^|[\s{[(<'"\u2018\u201C])(')$/,
25
- replace: override !== null && override !== void 0 ? override : '‘',
26
- });
27
- const closeSingleQuote = (override) => core.textInputRule({
28
- find: /'$/,
29
- replace: override !== null && override !== void 0 ? override : '’',
30
- });
31
- const leftArrow = (override) => core.textInputRule({
32
- find: /<-$/,
33
- replace: override !== null && override !== void 0 ? override : '←',
34
- });
35
- const rightArrow = (override) => core.textInputRule({
36
- find: /->$/,
37
- replace: override !== null && override !== void 0 ? override : '→',
38
- });
39
- const copyright = (override) => core.textInputRule({
40
- find: /\(c\)$/,
41
- replace: override !== null && override !== void 0 ? override : '©',
42
- });
43
- const trademark = (override) => core.textInputRule({
44
- find: /\(tm\)$/,
45
- replace: override !== null && override !== void 0 ? override : '™',
46
- });
47
- const servicemark = (override) => core.textInputRule({
48
- find: /\(sm\)$/,
49
- replace: override !== null && override !== void 0 ? override : '℠',
50
- });
51
- const registeredTrademark = (override) => core.textInputRule({
52
- find: /\(r\)$/,
53
- replace: override !== null && override !== void 0 ? override : '®',
54
- });
55
- const oneHalf = (override) => core.textInputRule({
56
- find: /(?:^|\s)(1\/2)\s$/,
57
- replace: override !== null && override !== void 0 ? override : '½',
58
- });
59
- const plusMinus = (override) => core.textInputRule({
60
- find: /\+\/-$/,
61
- replace: override !== null && override !== void 0 ? override : '±',
62
- });
63
- const notEqual = (override) => core.textInputRule({
64
- find: /!=$/,
65
- replace: override !== null && override !== void 0 ? override : '≠',
66
- });
67
- const laquo = (override) => core.textInputRule({
68
- find: /<<$/,
69
- replace: override !== null && override !== void 0 ? override : '«',
70
- });
71
- const raquo = (override) => core.textInputRule({
72
- find: />>$/,
73
- replace: override !== null && override !== void 0 ? override : '»',
74
- });
75
- const multiplication = (override) => core.textInputRule({
76
- find: /\d+\s?([*x])\s?\d+$/,
77
- replace: override !== null && override !== void 0 ? override : '×',
78
- });
79
- const superscriptTwo = (override) => core.textInputRule({
80
- find: /\^2$/,
81
- replace: override !== null && override !== void 0 ? override : '²',
82
- });
83
- const superscriptThree = (override) => core.textInputRule({
84
- find: /\^3$/,
85
- replace: override !== null && override !== void 0 ? override : '³',
86
- });
87
- const oneQuarter = (override) => core.textInputRule({
88
- find: /(?:^|\s)(1\/4)\s$/,
89
- replace: override !== null && override !== void 0 ? override : '¼',
90
- });
91
- const threeQuarters = (override) => core.textInputRule({
92
- find: /(?:^|\s)(3\/4)\s$/,
93
- replace: override !== null && override !== void 0 ? override : '¾',
94
- });
95
- /**
96
- * This extension allows you to add typography replacements for specific characters.
97
- * @see https://www.tiptap.dev/api/extensions/typography
98
- */
99
- const Typography = core.Extension.create({
100
- name: 'typography',
101
- addOptions() {
102
- return {
103
- closeDoubleQuote: '”',
104
- closeSingleQuote: '’',
105
- copyright: '©',
106
- ellipsis: '…',
107
- emDash: '—',
108
- laquo: '«',
109
- leftArrow: '←',
110
- multiplication: '×',
111
- notEqual: '≠',
112
- oneHalf: '½',
113
- oneQuarter: '¼',
114
- openDoubleQuote: '“',
115
- openSingleQuote: '‘',
116
- plusMinus: '±',
117
- raquo: '»',
118
- registeredTrademark: '®',
119
- rightArrow: '→',
120
- servicemark: '℠',
121
- superscriptThree: '³',
122
- superscriptTwo: '²',
123
- threeQuarters: '¾',
124
- trademark: '™',
125
- };
126
- },
127
- addInputRules() {
128
- const rules = [];
129
- if (this.options.emDash !== false) {
130
- rules.push(emDash(this.options.emDash));
131
- }
132
- if (this.options.ellipsis !== false) {
133
- rules.push(ellipsis(this.options.ellipsis));
134
- }
135
- if (this.options.openDoubleQuote !== false) {
136
- rules.push(openDoubleQuote(this.options.openDoubleQuote));
137
- }
138
- if (this.options.closeDoubleQuote !== false) {
139
- rules.push(closeDoubleQuote(this.options.closeDoubleQuote));
140
- }
141
- if (this.options.openSingleQuote !== false) {
142
- rules.push(openSingleQuote(this.options.openSingleQuote));
143
- }
144
- if (this.options.closeSingleQuote !== false) {
145
- rules.push(closeSingleQuote(this.options.closeSingleQuote));
146
- }
147
- if (this.options.leftArrow !== false) {
148
- rules.push(leftArrow(this.options.leftArrow));
149
- }
150
- if (this.options.rightArrow !== false) {
151
- rules.push(rightArrow(this.options.rightArrow));
152
- }
153
- if (this.options.copyright !== false) {
154
- rules.push(copyright(this.options.copyright));
155
- }
156
- if (this.options.trademark !== false) {
157
- rules.push(trademark(this.options.trademark));
158
- }
159
- if (this.options.servicemark !== false) {
160
- rules.push(servicemark(this.options.servicemark));
161
- }
162
- if (this.options.registeredTrademark !== false) {
163
- rules.push(registeredTrademark(this.options.registeredTrademark));
164
- }
165
- if (this.options.oneHalf !== false) {
166
- rules.push(oneHalf(this.options.oneHalf));
167
- }
168
- if (this.options.plusMinus !== false) {
169
- rules.push(plusMinus(this.options.plusMinus));
170
- }
171
- if (this.options.notEqual !== false) {
172
- rules.push(notEqual(this.options.notEqual));
173
- }
174
- if (this.options.laquo !== false) {
175
- rules.push(laquo(this.options.laquo));
176
- }
177
- if (this.options.raquo !== false) {
178
- rules.push(raquo(this.options.raquo));
179
- }
180
- if (this.options.multiplication !== false) {
181
- rules.push(multiplication(this.options.multiplication));
182
- }
183
- if (this.options.superscriptTwo !== false) {
184
- rules.push(superscriptTwo(this.options.superscriptTwo));
185
- }
186
- if (this.options.superscriptThree !== false) {
187
- rules.push(superscriptThree(this.options.superscriptThree));
188
- }
189
- if (this.options.oneQuarter !== false) {
190
- rules.push(oneQuarter(this.options.oneQuarter));
191
- }
192
- if (this.options.threeQuarters !== false) {
193
- rules.push(threeQuarters(this.options.threeQuarters));
194
- }
195
- return rules;
196
- },
50
+ // src/typography.ts
51
+ var import_core = require("@tiptap/core");
52
+ var emDash = (override) => (0, import_core.textInputRule)({
53
+ find: /--$/,
54
+ replace: override != null ? override : "\u2014"
55
+ });
56
+ var ellipsis = (override) => (0, import_core.textInputRule)({
57
+ find: /\.\.\.$/,
58
+ replace: override != null ? override : "\u2026"
59
+ });
60
+ var openDoubleQuote = (override) => (0, import_core.textInputRule)({
61
+ find: /(?:^|[\s{[(<'"\u2018\u201C])(")$/,
62
+ replace: override != null ? override : "\u201C"
63
+ });
64
+ var closeDoubleQuote = (override) => (0, import_core.textInputRule)({
65
+ find: /"$/,
66
+ replace: override != null ? override : "\u201D"
67
+ });
68
+ var openSingleQuote = (override) => (0, import_core.textInputRule)({
69
+ find: /(?:^|[\s{[(<'"\u2018\u201C])(')$/,
70
+ replace: override != null ? override : "\u2018"
71
+ });
72
+ var closeSingleQuote = (override) => (0, import_core.textInputRule)({
73
+ find: /'$/,
74
+ replace: override != null ? override : "\u2019"
75
+ });
76
+ var leftArrow = (override) => (0, import_core.textInputRule)({
77
+ find: /<-$/,
78
+ replace: override != null ? override : "\u2190"
79
+ });
80
+ var rightArrow = (override) => (0, import_core.textInputRule)({
81
+ find: /->$/,
82
+ replace: override != null ? override : "\u2192"
83
+ });
84
+ var copyright = (override) => (0, import_core.textInputRule)({
85
+ find: /\(c\)$/,
86
+ replace: override != null ? override : "\xA9"
87
+ });
88
+ var trademark = (override) => (0, import_core.textInputRule)({
89
+ find: /\(tm\)$/,
90
+ replace: override != null ? override : "\u2122"
91
+ });
92
+ var servicemark = (override) => (0, import_core.textInputRule)({
93
+ find: /\(sm\)$/,
94
+ replace: override != null ? override : "\u2120"
95
+ });
96
+ var registeredTrademark = (override) => (0, import_core.textInputRule)({
97
+ find: /\(r\)$/,
98
+ replace: override != null ? override : "\xAE"
99
+ });
100
+ var oneHalf = (override) => (0, import_core.textInputRule)({
101
+ find: /(?:^|\s)(1\/2)\s$/,
102
+ replace: override != null ? override : "\xBD"
103
+ });
104
+ var plusMinus = (override) => (0, import_core.textInputRule)({
105
+ find: /\+\/-$/,
106
+ replace: override != null ? override : "\xB1"
107
+ });
108
+ var notEqual = (override) => (0, import_core.textInputRule)({
109
+ find: /!=$/,
110
+ replace: override != null ? override : "\u2260"
111
+ });
112
+ var laquo = (override) => (0, import_core.textInputRule)({
113
+ find: /<<$/,
114
+ replace: override != null ? override : "\xAB"
115
+ });
116
+ var raquo = (override) => (0, import_core.textInputRule)({
117
+ find: />>$/,
118
+ replace: override != null ? override : "\xBB"
119
+ });
120
+ var multiplication = (override) => (0, import_core.textInputRule)({
121
+ find: /\d+\s?([*x])\s?\d+$/,
122
+ replace: override != null ? override : "\xD7"
123
+ });
124
+ var superscriptTwo = (override) => (0, import_core.textInputRule)({
125
+ find: /\^2$/,
126
+ replace: override != null ? override : "\xB2"
127
+ });
128
+ var superscriptThree = (override) => (0, import_core.textInputRule)({
129
+ find: /\^3$/,
130
+ replace: override != null ? override : "\xB3"
131
+ });
132
+ var oneQuarter = (override) => (0, import_core.textInputRule)({
133
+ find: /(?:^|\s)(1\/4)\s$/,
134
+ replace: override != null ? override : "\xBC"
135
+ });
136
+ var threeQuarters = (override) => (0, import_core.textInputRule)({
137
+ find: /(?:^|\s)(3\/4)\s$/,
138
+ replace: override != null ? override : "\xBE"
139
+ });
140
+ var Typography = import_core.Extension.create({
141
+ name: "typography",
142
+ addOptions() {
143
+ return {
144
+ closeDoubleQuote: "\u201D",
145
+ closeSingleQuote: "\u2019",
146
+ copyright: "\xA9",
147
+ ellipsis: "\u2026",
148
+ emDash: "\u2014",
149
+ laquo: "\xAB",
150
+ leftArrow: "\u2190",
151
+ multiplication: "\xD7",
152
+ notEqual: "\u2260",
153
+ oneHalf: "\xBD",
154
+ oneQuarter: "\xBC",
155
+ openDoubleQuote: "\u201C",
156
+ openSingleQuote: "\u2018",
157
+ plusMinus: "\xB1",
158
+ raquo: "\xBB",
159
+ registeredTrademark: "\xAE",
160
+ rightArrow: "\u2192",
161
+ servicemark: "\u2120",
162
+ superscriptThree: "\xB3",
163
+ superscriptTwo: "\xB2",
164
+ threeQuarters: "\xBE",
165
+ trademark: "\u2122"
166
+ };
167
+ },
168
+ addInputRules() {
169
+ const rules = [];
170
+ if (this.options.emDash !== false) {
171
+ rules.push(emDash(this.options.emDash));
172
+ }
173
+ if (this.options.ellipsis !== false) {
174
+ rules.push(ellipsis(this.options.ellipsis));
175
+ }
176
+ if (this.options.openDoubleQuote !== false) {
177
+ rules.push(openDoubleQuote(this.options.openDoubleQuote));
178
+ }
179
+ if (this.options.closeDoubleQuote !== false) {
180
+ rules.push(closeDoubleQuote(this.options.closeDoubleQuote));
181
+ }
182
+ if (this.options.openSingleQuote !== false) {
183
+ rules.push(openSingleQuote(this.options.openSingleQuote));
184
+ }
185
+ if (this.options.closeSingleQuote !== false) {
186
+ rules.push(closeSingleQuote(this.options.closeSingleQuote));
187
+ }
188
+ if (this.options.leftArrow !== false) {
189
+ rules.push(leftArrow(this.options.leftArrow));
190
+ }
191
+ if (this.options.rightArrow !== false) {
192
+ rules.push(rightArrow(this.options.rightArrow));
193
+ }
194
+ if (this.options.copyright !== false) {
195
+ rules.push(copyright(this.options.copyright));
196
+ }
197
+ if (this.options.trademark !== false) {
198
+ rules.push(trademark(this.options.trademark));
199
+ }
200
+ if (this.options.servicemark !== false) {
201
+ rules.push(servicemark(this.options.servicemark));
202
+ }
203
+ if (this.options.registeredTrademark !== false) {
204
+ rules.push(registeredTrademark(this.options.registeredTrademark));
205
+ }
206
+ if (this.options.oneHalf !== false) {
207
+ rules.push(oneHalf(this.options.oneHalf));
208
+ }
209
+ if (this.options.plusMinus !== false) {
210
+ rules.push(plusMinus(this.options.plusMinus));
211
+ }
212
+ if (this.options.notEqual !== false) {
213
+ rules.push(notEqual(this.options.notEqual));
214
+ }
215
+ if (this.options.laquo !== false) {
216
+ rules.push(laquo(this.options.laquo));
217
+ }
218
+ if (this.options.raquo !== false) {
219
+ rules.push(raquo(this.options.raquo));
220
+ }
221
+ if (this.options.multiplication !== false) {
222
+ rules.push(multiplication(this.options.multiplication));
223
+ }
224
+ if (this.options.superscriptTwo !== false) {
225
+ rules.push(superscriptTwo(this.options.superscriptTwo));
226
+ }
227
+ if (this.options.superscriptThree !== false) {
228
+ rules.push(superscriptThree(this.options.superscriptThree));
229
+ }
230
+ if (this.options.oneQuarter !== false) {
231
+ rules.push(oneQuarter(this.options.oneQuarter));
232
+ }
233
+ if (this.options.threeQuarters !== false) {
234
+ rules.push(threeQuarters(this.options.threeQuarters));
235
+ }
236
+ return rules;
237
+ }
197
238
  });
198
239
 
199
- exports.Typography = Typography;
200
- exports.closeDoubleQuote = closeDoubleQuote;
201
- exports.closeSingleQuote = closeSingleQuote;
202
- exports.copyright = copyright;
203
- exports.default = Typography;
204
- exports.ellipsis = ellipsis;
205
- exports.emDash = emDash;
206
- exports.laquo = laquo;
207
- exports.leftArrow = leftArrow;
208
- exports.multiplication = multiplication;
209
- exports.notEqual = notEqual;
210
- exports.oneHalf = oneHalf;
211
- exports.oneQuarter = oneQuarter;
212
- exports.openDoubleQuote = openDoubleQuote;
213
- exports.openSingleQuote = openSingleQuote;
214
- exports.plusMinus = plusMinus;
215
- exports.raquo = raquo;
216
- exports.registeredTrademark = registeredTrademark;
217
- exports.rightArrow = rightArrow;
218
- exports.servicemark = servicemark;
219
- exports.superscriptThree = superscriptThree;
220
- exports.superscriptTwo = superscriptTwo;
221
- exports.threeQuarters = threeQuarters;
222
- exports.trademark = trademark;
223
- //# sourceMappingURL=index.cjs.map
240
+ // src/index.ts
241
+ var index_default = Typography;
242
+ // Annotate the CommonJS export names for ESM import in node:
243
+ 0 && (module.exports = {
244
+ Typography,
245
+ closeDoubleQuote,
246
+ closeSingleQuote,
247
+ copyright,
248
+ ellipsis,
249
+ emDash,
250
+ laquo,
251
+ leftArrow,
252
+ multiplication,
253
+ notEqual,
254
+ oneHalf,
255
+ oneQuarter,
256
+ openDoubleQuote,
257
+ openSingleQuote,
258
+ plusMinus,
259
+ raquo,
260
+ registeredTrademark,
261
+ rightArrow,
262
+ servicemark,
263
+ superscriptThree,
264
+ superscriptTwo,
265
+ threeQuarters,
266
+ trademark
267
+ });
268
+ //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/typography.ts"],"sourcesContent":["import { Extension, textInputRule } from '@tiptap/core'\n\nexport interface TypographyOptions {\n /**\n * The em dash character.\n * @default '—'\n */\n emDash: false | string,\n\n /**\n * The ellipsis character.\n * @default '…'\n */\n ellipsis: false | string,\n\n /**\n * The open double quote character.\n * @default '“'\n */\n openDoubleQuote: false | string,\n\n /**\n * The close double quote character.\n * @default '”'\n */\n closeDoubleQuote: false | string,\n\n /**\n * The open single quote character.\n * @default '‘'\n */\n openSingleQuote: false | string,\n\n /**\n * The close single quote character.\n * @default '’'\n */\n closeSingleQuote: false | string,\n\n /**\n * The left arrow character.\n * @default '←'\n */\n leftArrow: false | string,\n\n /**\n * The right arrow character.\n * @default '→'\n */\n rightArrow: false | string,\n\n /**\n * The copyright character.\n * @default '©'\n */\n copyright: false | string,\n\n /**\n * The trademark character.\n * @default '™'\n */\n trademark: false | string,\n\n /**\n * The servicemark character.\n * @default '℠'\n */\n servicemark: false | string,\n\n /**\n * The registered trademark character.\n * @default '®'\n */\n registeredTrademark: false | string,\n\n /**\n * The one half character.\n * @default '½'\n */\n oneHalf: false | string,\n\n /**\n * The plus minus character.\n * @default '±'\n */\n plusMinus: false | string,\n\n /**\n * The not equal character.\n * @default '≠'\n */\n notEqual: false | string,\n\n /**\n * The laquo character.\n * @default '«'\n */\n laquo: false | string,\n\n /**\n * The raquo character.\n * @default '»'\n */\n raquo: false | string,\n\n /**\n * The multiplication character.\n * @default '×'\n */\n multiplication: false | string,\n\n /**\n * The superscript two character.\n * @default '²'\n */\n superscriptTwo: false | string,\n\n /**\n * The superscript three character.\n * @default '³'\n */\n superscriptThree: false | string,\n\n /**\n * The one quarter character.\n * @default '¼'\n */\n oneQuarter: false | string,\n\n /**\n * The three quarters character.\n * @default '¾'\n */\n threeQuarters: false | string,\n}\n\nexport const emDash = (override?: string) => textInputRule({\n find: /--$/,\n replace: override ?? '—',\n})\n\nexport const ellipsis = (override?: string) => textInputRule({\n find: /\\.\\.\\.$/,\n replace: override ?? '…',\n})\n\nexport const openDoubleQuote = (override?: string) => textInputRule({\n find: /(?:^|[\\s{[(<'\"\\u2018\\u201C])(\")$/,\n replace: override ?? '“',\n})\n\nexport const closeDoubleQuote = (override?: string) => textInputRule({\n find: /\"$/,\n replace: override ?? '”',\n})\n\nexport const openSingleQuote = (override?: string) => textInputRule({\n find: /(?:^|[\\s{[(<'\"\\u2018\\u201C])(')$/,\n replace: override ?? '‘',\n})\n\nexport const closeSingleQuote = (override?: string) => textInputRule({\n find: /'$/,\n replace: override ?? '’',\n})\n\nexport const leftArrow = (override?: string) => textInputRule({\n find: /<-$/,\n replace: override ?? '←',\n})\n\nexport const rightArrow = (override?: string) => textInputRule({\n find: /->$/,\n replace: override ?? '→',\n})\n\nexport const copyright = (override?: string) => textInputRule({\n find: /\\(c\\)$/,\n replace: override ?? '©',\n})\n\nexport const trademark = (override?: string) => textInputRule({\n find: /\\(tm\\)$/,\n replace: override ?? '™',\n})\n\nexport const servicemark = (override?: string) => textInputRule({\n find: /\\(sm\\)$/,\n replace: override ?? '℠',\n})\n\nexport const registeredTrademark = (override?: string) => textInputRule({\n find: /\\(r\\)$/,\n replace: override ?? '®',\n})\n\nexport const oneHalf = (override?: string) => textInputRule({\n find: /(?:^|\\s)(1\\/2)\\s$/,\n replace: override ?? '½',\n})\n\nexport const plusMinus = (override?: string) => textInputRule({\n find: /\\+\\/-$/,\n replace: override ?? '±',\n})\n\nexport const notEqual = (override?: string) => textInputRule({\n find: /!=$/,\n replace: override ?? '≠',\n})\n\nexport const laquo = (override?: string) => textInputRule({\n find: /<<$/,\n replace: override ?? '«',\n})\n\nexport const raquo = (override?: string) => textInputRule({\n find: />>$/,\n replace: override ?? '»',\n})\n\nexport const multiplication = (override?: string) => textInputRule({\n find: /\\d+\\s?([*x])\\s?\\d+$/,\n replace: override ?? '×',\n})\n\nexport const superscriptTwo = (override?: string) => textInputRule({\n find: /\\^2$/,\n replace: override ?? '²',\n})\n\nexport const superscriptThree = (override?: string) => textInputRule({\n find: /\\^3$/,\n replace: override ?? '³',\n})\n\nexport const oneQuarter = (override?: string) => textInputRule({\n find: /(?:^|\\s)(1\\/4)\\s$/,\n replace: override ?? '¼',\n})\n\nexport const threeQuarters = (override?: string) => textInputRule({\n find: /(?:^|\\s)(3\\/4)\\s$/,\n replace: override ?? '¾',\n})\n\n/**\n * This extension allows you to add typography replacements for specific characters.\n * @see https://www.tiptap.dev/api/extensions/typography\n */\nexport const Typography = Extension.create<TypographyOptions>({\n name: 'typography',\n\n addOptions() {\n return {\n closeDoubleQuote: '”',\n closeSingleQuote: '’',\n copyright: '©',\n ellipsis: '…',\n emDash: '—',\n laquo: '«',\n leftArrow: '←',\n multiplication: '×',\n notEqual: '≠',\n oneHalf: '½',\n oneQuarter: '¼',\n openDoubleQuote: '“',\n openSingleQuote: '‘',\n plusMinus: '±',\n raquo: '»',\n registeredTrademark: '®',\n rightArrow: '→',\n servicemark: '℠',\n superscriptThree: '³',\n superscriptTwo: '²',\n threeQuarters: '¾',\n trademark: '™',\n }\n },\n\n addInputRules() {\n const rules = []\n\n if (this.options.emDash !== false) {\n rules.push(emDash(this.options.emDash))\n }\n\n if (this.options.ellipsis !== false) {\n rules.push(ellipsis(this.options.ellipsis))\n }\n\n if (this.options.openDoubleQuote !== false) {\n rules.push(openDoubleQuote(this.options.openDoubleQuote))\n }\n\n if (this.options.closeDoubleQuote !== false) {\n rules.push(closeDoubleQuote(this.options.closeDoubleQuote))\n }\n\n if (this.options.openSingleQuote !== false) {\n rules.push(openSingleQuote(this.options.openSingleQuote))\n }\n\n if (this.options.closeSingleQuote !== false) {\n rules.push(closeSingleQuote(this.options.closeSingleQuote))\n }\n\n if (this.options.leftArrow !== false) {\n rules.push(leftArrow(this.options.leftArrow))\n }\n\n if (this.options.rightArrow !== false) {\n rules.push(rightArrow(this.options.rightArrow))\n }\n\n if (this.options.copyright !== false) {\n rules.push(copyright(this.options.copyright))\n }\n\n if (this.options.trademark !== false) {\n rules.push(trademark(this.options.trademark))\n }\n\n if (this.options.servicemark !== false) {\n rules.push(servicemark(this.options.servicemark))\n }\n\n if (this.options.registeredTrademark !== false) {\n rules.push(registeredTrademark(this.options.registeredTrademark))\n }\n\n if (this.options.oneHalf !== false) {\n rules.push(oneHalf(this.options.oneHalf))\n }\n\n if (this.options.plusMinus !== false) {\n rules.push(plusMinus(this.options.plusMinus))\n }\n\n if (this.options.notEqual !== false) {\n rules.push(notEqual(this.options.notEqual))\n }\n\n if (this.options.laquo !== false) {\n rules.push(laquo(this.options.laquo))\n }\n\n if (this.options.raquo !== false) {\n rules.push(raquo(this.options.raquo))\n }\n\n if (this.options.multiplication !== false) {\n rules.push(multiplication(this.options.multiplication))\n }\n\n if (this.options.superscriptTwo !== false) {\n rules.push(superscriptTwo(this.options.superscriptTwo))\n }\n\n if (this.options.superscriptThree !== false) {\n rules.push(superscriptThree(this.options.superscriptThree))\n }\n\n if (this.options.oneQuarter !== false) {\n rules.push(oneQuarter(this.options.oneQuarter))\n }\n\n if (this.options.threeQuarters !== false) {\n rules.push(threeQuarters(this.options.threeQuarters))\n }\n\n return rules\n },\n})\n"],"names":["textInputRule","Extension"],"mappings":";;;;;;AAwIa,MAAA,MAAM,GAAG,CAAC,QAAiB,KAAKA,kBAAa,CAAC;AACzD,IAAA,IAAI,EAAE,KAAK;AACX,IAAA,OAAO,EAAE,QAAQ,KAAA,IAAA,IAAR,QAAQ,KAAR,KAAA,CAAA,GAAA,QAAQ,GAAI,GAAG;AACzB,CAAA;AAEY,MAAA,QAAQ,GAAG,CAAC,QAAiB,KAAKA,kBAAa,CAAC;AAC3D,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,OAAO,EAAE,QAAQ,KAAA,IAAA,IAAR,QAAQ,KAAR,KAAA,CAAA,GAAA,QAAQ,GAAI,GAAG;AACzB,CAAA;AAEY,MAAA,eAAe,GAAG,CAAC,QAAiB,KAAKA,kBAAa,CAAC;AAClE,IAAA,IAAI,EAAE,kCAAkC;AACxC,IAAA,OAAO,EAAE,QAAQ,KAAA,IAAA,IAAR,QAAQ,KAAR,KAAA,CAAA,GAAA,QAAQ,GAAI,GAAG;AACzB,CAAA;AAEY,MAAA,gBAAgB,GAAG,CAAC,QAAiB,KAAKA,kBAAa,CAAC;AACnE,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,OAAO,EAAE,QAAQ,KAAA,IAAA,IAAR,QAAQ,KAAR,KAAA,CAAA,GAAA,QAAQ,GAAI,GAAG;AACzB,CAAA;AAEY,MAAA,eAAe,GAAG,CAAC,QAAiB,KAAKA,kBAAa,CAAC;AAClE,IAAA,IAAI,EAAE,kCAAkC;AACxC,IAAA,OAAO,EAAE,QAAQ,KAAA,IAAA,IAAR,QAAQ,KAAR,KAAA,CAAA,GAAA,QAAQ,GAAI,GAAG;AACzB,CAAA;AAE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,KAAK,KAAK,EAAE;AACrC,YAAA,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;;QAGjD,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,KAAK,KAAK,EAAE;AACxC,YAAA,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;;AAGvD,QAAA,OAAO,KAAK;KACb;AACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"sources":["../src/index.ts","../src/typography.ts"],"sourcesContent":["import { Typography } from './typography.js'\n\nexport * from './typography.js'\n\nexport default Typography\n","import { Extension, textInputRule } from '@tiptap/core'\n\nexport interface TypographyOptions {\n /**\n * The em dash character.\n * @default '—'\n */\n emDash: false | string\n\n /**\n * The ellipsis character.\n * @default '…'\n */\n ellipsis: false | string\n\n /**\n * The open double quote character.\n * @default '“'\n */\n openDoubleQuote: false | string\n\n /**\n * The close double quote character.\n * @default '”'\n */\n closeDoubleQuote: false | string\n\n /**\n * The open single quote character.\n * @default '‘'\n */\n openSingleQuote: false | string\n\n /**\n * The close single quote character.\n * @default '’'\n */\n closeSingleQuote: false | string\n\n /**\n * The left arrow character.\n * @default '←'\n */\n leftArrow: false | string\n\n /**\n * The right arrow character.\n * @default '→'\n */\n rightArrow: false | string\n\n /**\n * The copyright character.\n * @default '©'\n */\n copyright: false | string\n\n /**\n * The trademark character.\n * @default '™'\n */\n trademark: false | string\n\n /**\n * The servicemark character.\n * @default '℠'\n */\n servicemark: false | string\n\n /**\n * The registered trademark character.\n * @default '®'\n */\n registeredTrademark: false | string\n\n /**\n * The one half character.\n * @default '½'\n */\n oneHalf: false | string\n\n /**\n * The plus minus character.\n * @default '±'\n */\n plusMinus: false | string\n\n /**\n * The not equal character.\n * @default '≠'\n */\n notEqual: false | string\n\n /**\n * The laquo character.\n * @default '«'\n */\n laquo: false | string\n\n /**\n * The raquo character.\n * @default '»'\n */\n raquo: false | string\n\n /**\n * The multiplication character.\n * @default '×'\n */\n multiplication: false | string\n\n /**\n * The superscript two character.\n * @default '²'\n */\n superscriptTwo: false | string\n\n /**\n * The superscript three character.\n * @default '³'\n */\n superscriptThree: false | string\n\n /**\n * The one quarter character.\n * @default '¼'\n */\n oneQuarter: false | string\n\n /**\n * The three quarters character.\n * @default '¾'\n */\n threeQuarters: false | string\n}\n\nexport const emDash = (override?: string) =>\n textInputRule({\n find: /--$/,\n replace: override ?? '—',\n })\n\nexport const ellipsis = (override?: string) =>\n textInputRule({\n find: /\\.\\.\\.$/,\n replace: override ?? '…',\n })\n\nexport const openDoubleQuote = (override?: string) =>\n textInputRule({\n find: /(?:^|[\\s{[(<'\"\\u2018\\u201C])(\")$/,\n replace: override ?? '“',\n })\n\nexport const closeDoubleQuote = (override?: string) =>\n textInputRule({\n find: /\"$/,\n replace: override ?? '”',\n })\n\nexport const openSingleQuote = (override?: string) =>\n textInputRule({\n find: /(?:^|[\\s{[(<'\"\\u2018\\u201C])(')$/,\n replace: override ?? '‘',\n })\n\nexport const closeSingleQuote = (override?: string) =>\n textInputRule({\n find: /'$/,\n replace: override ?? '’',\n })\n\nexport const leftArrow = (override?: string) =>\n textInputRule({\n find: /<-$/,\n replace: override ?? '←',\n })\n\nexport const rightArrow = (override?: string) =>\n textInputRule({\n find: /->$/,\n replace: override ?? '→',\n })\n\nexport const copyright = (override?: string) =>\n textInputRule({\n find: /\\(c\\)$/,\n replace: override ?? '©',\n })\n\nexport const trademark = (override?: string) =>\n textInputRule({\n find: /\\(tm\\)$/,\n replace: override ?? '™',\n })\n\nexport const servicemark = (override?: string) =>\n textInputRule({\n find: /\\(sm\\)$/,\n replace: override ?? '℠',\n })\n\nexport const registeredTrademark = (override?: string) =>\n textInputRule({\n find: /\\(r\\)$/,\n replace: override ?? '®',\n })\n\nexport const oneHalf = (override?: string) =>\n textInputRule({\n find: /(?:^|\\s)(1\\/2)\\s$/,\n replace: override ?? '½',\n })\n\nexport const plusMinus = (override?: string) =>\n textInputRule({\n find: /\\+\\/-$/,\n replace: override ?? '±',\n })\n\nexport const notEqual = (override?: string) =>\n textInputRule({\n find: /!=$/,\n replace: override ?? '≠',\n })\n\nexport const laquo = (override?: string) =>\n textInputRule({\n find: /<<$/,\n replace: override ?? '«',\n })\n\nexport const raquo = (override?: string) =>\n textInputRule({\n find: />>$/,\n replace: override ?? '»',\n })\n\nexport const multiplication = (override?: string) =>\n textInputRule({\n find: /\\d+\\s?([*x])\\s?\\d+$/,\n replace: override ?? '×',\n })\n\nexport const superscriptTwo = (override?: string) =>\n textInputRule({\n find: /\\^2$/,\n replace: override ?? '²',\n })\n\nexport const superscriptThree = (override?: string) =>\n textInputRule({\n find: /\\^3$/,\n replace: override ?? '³',\n })\n\nexport const oneQuarter = (override?: string) =>\n textInputRule({\n find: /(?:^|\\s)(1\\/4)\\s$/,\n replace: override ?? '¼',\n })\n\nexport const threeQuarters = (override?: string) =>\n textInputRule({\n find: /(?:^|\\s)(3\\/4)\\s$/,\n replace: override ?? '¾',\n })\n\n/**\n * This extension allows you to add typography replacements for specific characters.\n * @see https://www.tiptap.dev/api/extensions/typography\n */\nexport const Typography = Extension.create<TypographyOptions>({\n name: 'typography',\n\n addOptions() {\n return {\n closeDoubleQuote: '”',\n closeSingleQuote: '’',\n copyright: '©',\n ellipsis: '…',\n emDash: '—',\n laquo: '«',\n leftArrow: '←',\n multiplication: '×',\n notEqual: '≠',\n oneHalf: '½',\n oneQuarter: '¼',\n openDoubleQuote: '“',\n openSingleQuote: '‘',\n plusMinus: '±',\n raquo: '»',\n registeredTrademark: '®',\n rightArrow: '→',\n servicemark: '℠',\n superscriptThree: '³',\n superscriptTwo: '²',\n threeQuarters: '¾',\n trademark: '™',\n }\n },\n\n addInputRules() {\n const rules = []\n\n if (this.options.emDash !== false) {\n rules.push(emDash(this.options.emDash))\n }\n\n if (this.options.ellipsis !== false) {\n rules.push(ellipsis(this.options.ellipsis))\n }\n\n if (this.options.openDoubleQuote !== false) {\n rules.push(openDoubleQuote(this.options.openDoubleQuote))\n }\n\n if (this.options.closeDoubleQuote !== false) {\n rules.push(closeDoubleQuote(this.options.closeDoubleQuote))\n }\n\n if (this.options.openSingleQuote !== false) {\n rules.push(openSingleQuote(this.options.openSingleQuote))\n }\n\n if (this.options.closeSingleQuote !== false) {\n rules.push(closeSingleQuote(this.options.closeSingleQuote))\n }\n\n if (this.options.leftArrow !== false) {\n rules.push(leftArrow(this.options.leftArrow))\n }\n\n if (this.options.rightArrow !== false) {\n rules.push(rightArrow(this.options.rightArrow))\n }\n\n if (this.options.copyright !== false) {\n rules.push(copyright(this.options.copyright))\n }\n\n if (this.options.trademark !== false) {\n rules.push(trademark(this.options.trademark))\n }\n\n if (this.options.servicemark !== false) {\n rules.push(servicemark(this.options.servicemark))\n }\n\n if (this.options.registeredTrademark !== false) {\n rules.push(registeredTrademark(this.options.registeredTrademark))\n }\n\n if (this.options.oneHalf !== false) {\n rules.push(oneHalf(this.options.oneHalf))\n }\n\n if (this.options.plusMinus !== false) {\n rules.push(plusMinus(this.options.plusMinus))\n }\n\n if (this.options.notEqual !== false) {\n rules.push(notEqual(this.options.notEqual))\n }\n\n if (this.options.laquo !== false) {\n rules.push(laquo(this.options.laquo))\n }\n\n if (this.options.raquo !== false) {\n rules.push(raquo(this.options.raquo))\n }\n\n if (this.options.multiplication !== false) {\n rules.push(multiplication(this.options.multiplication))\n }\n\n if (this.options.superscriptTwo !== false) {\n rules.push(superscriptTwo(this.options.superscriptTwo))\n }\n\n if (this.options.superscriptThree !== false) {\n rules.push(superscriptThree(this.options.superscriptThree))\n }\n\n if (this.options.oneQuarter !== false) {\n rules.push(oneQuarter(this.options.oneQuarter))\n }\n\n if (this.options.threeQuarters !== false) {\n rules.push(threeQuarters(this.options.threeQuarters))\n }\n\n return rules\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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