@tiptap/extension-typography 2.0.0-beta.209 → 2.0.0-beta.210

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/index.cjs ADDED
@@ -0,0 +1,192 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/typography.ts
2
+ var _core = require('@tiptap/core');
3
+ var emDash = _core.textInputRule.call(void 0, {
4
+ find: /--$/,
5
+ replace: "\u2014"
6
+ });
7
+ var ellipsis = _core.textInputRule.call(void 0, {
8
+ find: /\.\.\.$/,
9
+ replace: "\u2026"
10
+ });
11
+ var openDoubleQuote = _core.textInputRule.call(void 0, {
12
+ find: /(?:^|[\s{[(<'"\u2018\u201C])(")$/,
13
+ replace: "\u201C"
14
+ });
15
+ var closeDoubleQuote = _core.textInputRule.call(void 0, {
16
+ find: /"$/,
17
+ replace: "\u201D"
18
+ });
19
+ var openSingleQuote = _core.textInputRule.call(void 0, {
20
+ find: /(?:^|[\s{[(<'"\u2018\u201C])(')$/,
21
+ replace: "\u2018"
22
+ });
23
+ var closeSingleQuote = _core.textInputRule.call(void 0, {
24
+ find: /'$/,
25
+ replace: "\u2019"
26
+ });
27
+ var leftArrow = _core.textInputRule.call(void 0, {
28
+ find: /<-$/,
29
+ replace: "\u2190"
30
+ });
31
+ var rightArrow = _core.textInputRule.call(void 0, {
32
+ find: /->$/,
33
+ replace: "\u2192"
34
+ });
35
+ var copyright = _core.textInputRule.call(void 0, {
36
+ find: /\(c\)$/,
37
+ replace: "\xA9"
38
+ });
39
+ var trademark = _core.textInputRule.call(void 0, {
40
+ find: /\(tm\)$/,
41
+ replace: "\u2122"
42
+ });
43
+ var servicemark = _core.textInputRule.call(void 0, {
44
+ find: /\(sm\)$/,
45
+ replace: "\u2120"
46
+ });
47
+ var registeredTrademark = _core.textInputRule.call(void 0, {
48
+ find: /\(r\)$/,
49
+ replace: "\xAE"
50
+ });
51
+ var oneHalf = _core.textInputRule.call(void 0, {
52
+ find: /1\/2$/,
53
+ replace: "\xBD"
54
+ });
55
+ var plusMinus = _core.textInputRule.call(void 0, {
56
+ find: /\+\/-$/,
57
+ replace: "\xB1"
58
+ });
59
+ var notEqual = _core.textInputRule.call(void 0, {
60
+ find: /!=$/,
61
+ replace: "\u2260"
62
+ });
63
+ var laquo = _core.textInputRule.call(void 0, {
64
+ find: /<<$/,
65
+ replace: "\xAB"
66
+ });
67
+ var raquo = _core.textInputRule.call(void 0, {
68
+ find: />>$/,
69
+ replace: "\xBB"
70
+ });
71
+ var multiplication = _core.textInputRule.call(void 0, {
72
+ find: /\d+\s?([*x])\s?\d+$/,
73
+ replace: "\xD7"
74
+ });
75
+ var superscriptTwo = _core.textInputRule.call(void 0, {
76
+ find: /\^2$/,
77
+ replace: "\xB2"
78
+ });
79
+ var superscriptThree = _core.textInputRule.call(void 0, {
80
+ find: /\^3$/,
81
+ replace: "\xB3"
82
+ });
83
+ var oneQuarter = _core.textInputRule.call(void 0, {
84
+ find: /1\/4$/,
85
+ replace: "\xBC"
86
+ });
87
+ var threeQuarters = _core.textInputRule.call(void 0, {
88
+ find: /3\/4$/,
89
+ replace: "\xBE"
90
+ });
91
+ var Typography = _core.Extension.create({
92
+ name: "typography",
93
+ addInputRules() {
94
+ const rules = [];
95
+ if (this.options.emDash !== false) {
96
+ rules.push(emDash);
97
+ }
98
+ if (this.options.ellipsis !== false) {
99
+ rules.push(ellipsis);
100
+ }
101
+ if (this.options.openDoubleQuote !== false) {
102
+ rules.push(openDoubleQuote);
103
+ }
104
+ if (this.options.closeDoubleQuote !== false) {
105
+ rules.push(closeDoubleQuote);
106
+ }
107
+ if (this.options.openSingleQuote !== false) {
108
+ rules.push(openSingleQuote);
109
+ }
110
+ if (this.options.closeSingleQuote !== false) {
111
+ rules.push(closeSingleQuote);
112
+ }
113
+ if (this.options.leftArrow !== false) {
114
+ rules.push(leftArrow);
115
+ }
116
+ if (this.options.rightArrow !== false) {
117
+ rules.push(rightArrow);
118
+ }
119
+ if (this.options.copyright !== false) {
120
+ rules.push(copyright);
121
+ }
122
+ if (this.options.trademark !== false) {
123
+ rules.push(trademark);
124
+ }
125
+ if (this.options.servicemark !== false) {
126
+ rules.push(servicemark);
127
+ }
128
+ if (this.options.registeredTrademark !== false) {
129
+ rules.push(registeredTrademark);
130
+ }
131
+ if (this.options.oneHalf !== false) {
132
+ rules.push(oneHalf);
133
+ }
134
+ if (this.options.plusMinus !== false) {
135
+ rules.push(plusMinus);
136
+ }
137
+ if (this.options.notEqual !== false) {
138
+ rules.push(notEqual);
139
+ }
140
+ if (this.options.laquo !== false) {
141
+ rules.push(laquo);
142
+ }
143
+ if (this.options.raquo !== false) {
144
+ rules.push(raquo);
145
+ }
146
+ if (this.options.multiplication !== false) {
147
+ rules.push(multiplication);
148
+ }
149
+ if (this.options.superscriptTwo !== false) {
150
+ rules.push(superscriptTwo);
151
+ }
152
+ if (this.options.superscriptThree !== false) {
153
+ rules.push(superscriptThree);
154
+ }
155
+ if (this.options.oneQuarter !== false) {
156
+ rules.push(oneQuarter);
157
+ }
158
+ if (this.options.threeQuarters !== false) {
159
+ rules.push(threeQuarters);
160
+ }
161
+ return rules;
162
+ }
163
+ });
164
+
165
+ // src/index.ts
166
+ var src_default = Typography;
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+ exports.Typography = Typography; exports.closeDoubleQuote = closeDoubleQuote; exports.closeSingleQuote = closeSingleQuote; exports.copyright = copyright; exports.default = src_default; exports.ellipsis = ellipsis; exports.emDash = emDash; exports.laquo = laquo; exports.leftArrow = leftArrow; exports.multiplication = multiplication; exports.notEqual = notEqual; exports.oneHalf = oneHalf; exports.oneQuarter = oneQuarter; exports.openDoubleQuote = openDoubleQuote; exports.openSingleQuote = openSingleQuote; exports.plusMinus = plusMinus; exports.raquo = raquo; exports.registeredTrademark = registeredTrademark; exports.rightArrow = rightArrow; exports.servicemark = servicemark; exports.superscriptThree = superscriptThree; exports.superscriptTwo = superscriptTwo; exports.threeQuarters = threeQuarters; exports.trademark = trademark;
@@ -0,0 +1,52 @@
1
+ import * as _tiptap_core from '@tiptap/core';
2
+ import { Extension } from '@tiptap/core';
3
+
4
+ interface TypographyOptions {
5
+ emDash: false;
6
+ ellipsis: false;
7
+ openDoubleQuote: false;
8
+ closeDoubleQuote: false;
9
+ openSingleQuote: false;
10
+ closeSingleQuote: false;
11
+ leftArrow: false;
12
+ rightArrow: false;
13
+ copyright: false;
14
+ trademark: false;
15
+ servicemark: false;
16
+ registeredTrademark: false;
17
+ oneHalf: false;
18
+ plusMinus: false;
19
+ notEqual: false;
20
+ laquo: false;
21
+ raquo: false;
22
+ multiplication: false;
23
+ superscriptTwo: false;
24
+ superscriptThree: false;
25
+ oneQuarter: false;
26
+ threeQuarters: false;
27
+ }
28
+ declare const emDash: _tiptap_core.InputRule;
29
+ declare const ellipsis: _tiptap_core.InputRule;
30
+ declare const openDoubleQuote: _tiptap_core.InputRule;
31
+ declare const closeDoubleQuote: _tiptap_core.InputRule;
32
+ declare const openSingleQuote: _tiptap_core.InputRule;
33
+ declare const closeSingleQuote: _tiptap_core.InputRule;
34
+ declare const leftArrow: _tiptap_core.InputRule;
35
+ declare const rightArrow: _tiptap_core.InputRule;
36
+ declare const copyright: _tiptap_core.InputRule;
37
+ declare const trademark: _tiptap_core.InputRule;
38
+ declare const servicemark: _tiptap_core.InputRule;
39
+ declare const registeredTrademark: _tiptap_core.InputRule;
40
+ declare const oneHalf: _tiptap_core.InputRule;
41
+ declare const plusMinus: _tiptap_core.InputRule;
42
+ declare const notEqual: _tiptap_core.InputRule;
43
+ declare const laquo: _tiptap_core.InputRule;
44
+ declare const raquo: _tiptap_core.InputRule;
45
+ declare const multiplication: _tiptap_core.InputRule;
46
+ declare const superscriptTwo: _tiptap_core.InputRule;
47
+ declare const superscriptThree: _tiptap_core.InputRule;
48
+ declare const oneQuarter: _tiptap_core.InputRule;
49
+ declare const threeQuarters: _tiptap_core.InputRule;
50
+ declare const Typography: Extension<TypographyOptions, any>;
51
+
52
+ export { Typography, TypographyOptions, 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 };
package/dist/index.js ADDED
@@ -0,0 +1,192 @@
1
+ // src/typography.ts
2
+ import { Extension, textInputRule } from "@tiptap/core";
3
+ var emDash = textInputRule({
4
+ find: /--$/,
5
+ replace: "\u2014"
6
+ });
7
+ var ellipsis = textInputRule({
8
+ find: /\.\.\.$/,
9
+ replace: "\u2026"
10
+ });
11
+ var openDoubleQuote = textInputRule({
12
+ find: /(?:^|[\s{[(<'"\u2018\u201C])(")$/,
13
+ replace: "\u201C"
14
+ });
15
+ var closeDoubleQuote = textInputRule({
16
+ find: /"$/,
17
+ replace: "\u201D"
18
+ });
19
+ var openSingleQuote = textInputRule({
20
+ find: /(?:^|[\s{[(<'"\u2018\u201C])(')$/,
21
+ replace: "\u2018"
22
+ });
23
+ var closeSingleQuote = textInputRule({
24
+ find: /'$/,
25
+ replace: "\u2019"
26
+ });
27
+ var leftArrow = textInputRule({
28
+ find: /<-$/,
29
+ replace: "\u2190"
30
+ });
31
+ var rightArrow = textInputRule({
32
+ find: /->$/,
33
+ replace: "\u2192"
34
+ });
35
+ var copyright = textInputRule({
36
+ find: /\(c\)$/,
37
+ replace: "\xA9"
38
+ });
39
+ var trademark = textInputRule({
40
+ find: /\(tm\)$/,
41
+ replace: "\u2122"
42
+ });
43
+ var servicemark = textInputRule({
44
+ find: /\(sm\)$/,
45
+ replace: "\u2120"
46
+ });
47
+ var registeredTrademark = textInputRule({
48
+ find: /\(r\)$/,
49
+ replace: "\xAE"
50
+ });
51
+ var oneHalf = textInputRule({
52
+ find: /1\/2$/,
53
+ replace: "\xBD"
54
+ });
55
+ var plusMinus = textInputRule({
56
+ find: /\+\/-$/,
57
+ replace: "\xB1"
58
+ });
59
+ var notEqual = textInputRule({
60
+ find: /!=$/,
61
+ replace: "\u2260"
62
+ });
63
+ var laquo = textInputRule({
64
+ find: /<<$/,
65
+ replace: "\xAB"
66
+ });
67
+ var raquo = textInputRule({
68
+ find: />>$/,
69
+ replace: "\xBB"
70
+ });
71
+ var multiplication = textInputRule({
72
+ find: /\d+\s?([*x])\s?\d+$/,
73
+ replace: "\xD7"
74
+ });
75
+ var superscriptTwo = textInputRule({
76
+ find: /\^2$/,
77
+ replace: "\xB2"
78
+ });
79
+ var superscriptThree = textInputRule({
80
+ find: /\^3$/,
81
+ replace: "\xB3"
82
+ });
83
+ var oneQuarter = textInputRule({
84
+ find: /1\/4$/,
85
+ replace: "\xBC"
86
+ });
87
+ var threeQuarters = textInputRule({
88
+ find: /3\/4$/,
89
+ replace: "\xBE"
90
+ });
91
+ var Typography = Extension.create({
92
+ name: "typography",
93
+ addInputRules() {
94
+ const rules = [];
95
+ if (this.options.emDash !== false) {
96
+ rules.push(emDash);
97
+ }
98
+ if (this.options.ellipsis !== false) {
99
+ rules.push(ellipsis);
100
+ }
101
+ if (this.options.openDoubleQuote !== false) {
102
+ rules.push(openDoubleQuote);
103
+ }
104
+ if (this.options.closeDoubleQuote !== false) {
105
+ rules.push(closeDoubleQuote);
106
+ }
107
+ if (this.options.openSingleQuote !== false) {
108
+ rules.push(openSingleQuote);
109
+ }
110
+ if (this.options.closeSingleQuote !== false) {
111
+ rules.push(closeSingleQuote);
112
+ }
113
+ if (this.options.leftArrow !== false) {
114
+ rules.push(leftArrow);
115
+ }
116
+ if (this.options.rightArrow !== false) {
117
+ rules.push(rightArrow);
118
+ }
119
+ if (this.options.copyright !== false) {
120
+ rules.push(copyright);
121
+ }
122
+ if (this.options.trademark !== false) {
123
+ rules.push(trademark);
124
+ }
125
+ if (this.options.servicemark !== false) {
126
+ rules.push(servicemark);
127
+ }
128
+ if (this.options.registeredTrademark !== false) {
129
+ rules.push(registeredTrademark);
130
+ }
131
+ if (this.options.oneHalf !== false) {
132
+ rules.push(oneHalf);
133
+ }
134
+ if (this.options.plusMinus !== false) {
135
+ rules.push(plusMinus);
136
+ }
137
+ if (this.options.notEqual !== false) {
138
+ rules.push(notEqual);
139
+ }
140
+ if (this.options.laquo !== false) {
141
+ rules.push(laquo);
142
+ }
143
+ if (this.options.raquo !== false) {
144
+ rules.push(raquo);
145
+ }
146
+ if (this.options.multiplication !== false) {
147
+ rules.push(multiplication);
148
+ }
149
+ if (this.options.superscriptTwo !== false) {
150
+ rules.push(superscriptTwo);
151
+ }
152
+ if (this.options.superscriptThree !== false) {
153
+ rules.push(superscriptThree);
154
+ }
155
+ if (this.options.oneQuarter !== false) {
156
+ rules.push(oneQuarter);
157
+ }
158
+ if (this.options.threeQuarters !== false) {
159
+ rules.push(threeQuarters);
160
+ }
161
+ return rules;
162
+ }
163
+ });
164
+
165
+ // src/index.ts
166
+ var src_default = Typography;
167
+ export {
168
+ Typography,
169
+ closeDoubleQuote,
170
+ closeSingleQuote,
171
+ copyright,
172
+ src_default as default,
173
+ ellipsis,
174
+ emDash,
175
+ laquo,
176
+ leftArrow,
177
+ multiplication,
178
+ notEqual,
179
+ oneHalf,
180
+ oneQuarter,
181
+ openDoubleQuote,
182
+ openSingleQuote,
183
+ plusMinus,
184
+ raquo,
185
+ registeredTrademark,
186
+ rightArrow,
187
+ servicemark,
188
+ superscriptThree,
189
+ superscriptTwo,
190
+ threeQuarters,
191
+ trademark
192
+ };
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.209",
4
+ "version": "2.0.0-beta.210",
5
5
  "homepage": "https://tiptap.dev",
6
6
  "keywords": [
7
7
  "tiptap",
@@ -15,28 +15,41 @@
15
15
  "type": "module",
16
16
  "exports": {
17
17
  ".": {
18
- "types": "./dist/packages/extension-typography/src/index.d.ts",
19
- "import": "./dist/tiptap-extension-typography.esm.js",
20
- "require": "./dist/tiptap-extension-typography.cjs"
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js",
20
+ "require": "./dist/index.cjs"
21
21
  }
22
22
  },
23
- "main": "dist/tiptap-extension-typography.cjs",
24
- "umd": "dist/tiptap-extension-typography.umd.js",
25
- "module": "dist/tiptap-extension-typography.esm.js",
26
- "types": "dist/packages/extension-typography/src/index.d.ts",
23
+ "main": "dist/index.cjs",
24
+ "module": "dist/index.js",
25
+ "types": "dist/index.d.ts",
27
26
  "files": [
28
27
  "src",
29
28
  "dist"
30
29
  ],
31
30
  "peerDependencies": {
32
- "@tiptap/core": "^2.0.0-beta.193"
31
+ "@tiptap/core": "^2.0.0-beta.209"
33
32
  },
34
33
  "devDependencies": {
35
- "@tiptap/core": "^2.0.0-beta.209"
34
+ "@tiptap/core": "^2.0.0-beta.210"
36
35
  },
37
36
  "repository": {
38
37
  "type": "git",
39
38
  "url": "https://github.com/ueberdosis/tiptap",
40
39
  "directory": "packages/extension-typography"
40
+ },
41
+ "scripts": {
42
+ "build": "tsup"
43
+ },
44
+ "tsup": {
45
+ "entry": [
46
+ "src/index.ts"
47
+ ],
48
+ "dts": true,
49
+ "splitting": true,
50
+ "format": [
51
+ "esm",
52
+ "cjs"
53
+ ]
41
54
  }
42
55
  }
@@ -1,3 +0,0 @@
1
- import { Typography } from './typography';
2
- export * from './typography';
3
- export default Typography;
@@ -1,48 +0,0 @@
1
- import { Extension } from '@tiptap/core';
2
- export interface TypographyOptions {
3
- emDash: false;
4
- ellipsis: false;
5
- openDoubleQuote: false;
6
- closeDoubleQuote: false;
7
- openSingleQuote: false;
8
- closeSingleQuote: false;
9
- leftArrow: false;
10
- rightArrow: false;
11
- copyright: false;
12
- trademark: false;
13
- servicemark: false;
14
- registeredTrademark: false;
15
- oneHalf: false;
16
- plusMinus: false;
17
- notEqual: false;
18
- laquo: false;
19
- raquo: false;
20
- multiplication: false;
21
- superscriptTwo: false;
22
- superscriptThree: false;
23
- oneQuarter: false;
24
- threeQuarters: false;
25
- }
26
- export declare const emDash: import("@tiptap/core").InputRule;
27
- export declare const ellipsis: import("@tiptap/core").InputRule;
28
- export declare const openDoubleQuote: import("@tiptap/core").InputRule;
29
- export declare const closeDoubleQuote: import("@tiptap/core").InputRule;
30
- export declare const openSingleQuote: import("@tiptap/core").InputRule;
31
- export declare const closeSingleQuote: import("@tiptap/core").InputRule;
32
- export declare const leftArrow: import("@tiptap/core").InputRule;
33
- export declare const rightArrow: import("@tiptap/core").InputRule;
34
- export declare const copyright: import("@tiptap/core").InputRule;
35
- export declare const trademark: import("@tiptap/core").InputRule;
36
- export declare const servicemark: import("@tiptap/core").InputRule;
37
- export declare const registeredTrademark: import("@tiptap/core").InputRule;
38
- export declare const oneHalf: import("@tiptap/core").InputRule;
39
- export declare const plusMinus: import("@tiptap/core").InputRule;
40
- export declare const notEqual: import("@tiptap/core").InputRule;
41
- export declare const laquo: import("@tiptap/core").InputRule;
42
- export declare const raquo: import("@tiptap/core").InputRule;
43
- export declare const multiplication: import("@tiptap/core").InputRule;
44
- export declare const superscriptTwo: import("@tiptap/core").InputRule;
45
- export declare const superscriptThree: import("@tiptap/core").InputRule;
46
- export declare const oneQuarter: import("@tiptap/core").InputRule;
47
- export declare const threeQuarters: import("@tiptap/core").InputRule;
48
- export declare const Typography: Extension<TypographyOptions, any>;
@@ -1,193 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var core = require('@tiptap/core');
6
-
7
- const emDash = core.textInputRule({
8
- find: /--$/,
9
- replace: '—',
10
- });
11
- const ellipsis = core.textInputRule({
12
- find: /\.\.\.$/,
13
- replace: '…',
14
- });
15
- const openDoubleQuote = core.textInputRule({
16
- find: /(?:^|[\s{[(<'"\u2018\u201C])(")$/,
17
- replace: '“',
18
- });
19
- const closeDoubleQuote = core.textInputRule({
20
- find: /"$/,
21
- replace: '”',
22
- });
23
- const openSingleQuote = core.textInputRule({
24
- find: /(?:^|[\s{[(<'"\u2018\u201C])(')$/,
25
- replace: '‘',
26
- });
27
- const closeSingleQuote = core.textInputRule({
28
- find: /'$/,
29
- replace: '’',
30
- });
31
- const leftArrow = core.textInputRule({
32
- find: /<-$/,
33
- replace: '←',
34
- });
35
- const rightArrow = core.textInputRule({
36
- find: /->$/,
37
- replace: '→',
38
- });
39
- const copyright = core.textInputRule({
40
- find: /\(c\)$/,
41
- replace: '©',
42
- });
43
- const trademark = core.textInputRule({
44
- find: /\(tm\)$/,
45
- replace: '™',
46
- });
47
- const servicemark = core.textInputRule({
48
- find: /\(sm\)$/,
49
- replace: '℠',
50
- });
51
- const registeredTrademark = core.textInputRule({
52
- find: /\(r\)$/,
53
- replace: '®',
54
- });
55
- const oneHalf = core.textInputRule({
56
- find: /1\/2$/,
57
- replace: '½',
58
- });
59
- const plusMinus = core.textInputRule({
60
- find: /\+\/-$/,
61
- replace: '±',
62
- });
63
- const notEqual = core.textInputRule({
64
- find: /!=$/,
65
- replace: '≠',
66
- });
67
- const laquo = core.textInputRule({
68
- find: /<<$/,
69
- replace: '«',
70
- });
71
- const raquo = core.textInputRule({
72
- find: />>$/,
73
- replace: '»',
74
- });
75
- const multiplication = core.textInputRule({
76
- find: /\d+\s?([*x])\s?\d+$/,
77
- replace: '×',
78
- });
79
- const superscriptTwo = core.textInputRule({
80
- find: /\^2$/,
81
- replace: '²',
82
- });
83
- const superscriptThree = core.textInputRule({
84
- find: /\^3$/,
85
- replace: '³',
86
- });
87
- const oneQuarter = core.textInputRule({
88
- find: /1\/4$/,
89
- replace: '¼',
90
- });
91
- const threeQuarters = core.textInputRule({
92
- find: /3\/4$/,
93
- replace: '¾',
94
- });
95
- const Typography = core.Extension.create({
96
- name: 'typography',
97
- addInputRules() {
98
- const rules = [];
99
- if (this.options.emDash !== false) {
100
- rules.push(emDash);
101
- }
102
- if (this.options.ellipsis !== false) {
103
- rules.push(ellipsis);
104
- }
105
- if (this.options.openDoubleQuote !== false) {
106
- rules.push(openDoubleQuote);
107
- }
108
- if (this.options.closeDoubleQuote !== false) {
109
- rules.push(closeDoubleQuote);
110
- }
111
- if (this.options.openSingleQuote !== false) {
112
- rules.push(openSingleQuote);
113
- }
114
- if (this.options.closeSingleQuote !== false) {
115
- rules.push(closeSingleQuote);
116
- }
117
- if (this.options.leftArrow !== false) {
118
- rules.push(leftArrow);
119
- }
120
- if (this.options.rightArrow !== false) {
121
- rules.push(rightArrow);
122
- }
123
- if (this.options.copyright !== false) {
124
- rules.push(copyright);
125
- }
126
- if (this.options.trademark !== false) {
127
- rules.push(trademark);
128
- }
129
- if (this.options.servicemark !== false) {
130
- rules.push(servicemark);
131
- }
132
- if (this.options.registeredTrademark !== false) {
133
- rules.push(registeredTrademark);
134
- }
135
- if (this.options.oneHalf !== false) {
136
- rules.push(oneHalf);
137
- }
138
- if (this.options.plusMinus !== false) {
139
- rules.push(plusMinus);
140
- }
141
- if (this.options.notEqual !== false) {
142
- rules.push(notEqual);
143
- }
144
- if (this.options.laquo !== false) {
145
- rules.push(laquo);
146
- }
147
- if (this.options.raquo !== false) {
148
- rules.push(raquo);
149
- }
150
- if (this.options.multiplication !== false) {
151
- rules.push(multiplication);
152
- }
153
- if (this.options.superscriptTwo !== false) {
154
- rules.push(superscriptTwo);
155
- }
156
- if (this.options.superscriptThree !== false) {
157
- rules.push(superscriptThree);
158
- }
159
- if (this.options.oneQuarter !== false) {
160
- rules.push(oneQuarter);
161
- }
162
- if (this.options.threeQuarters !== false) {
163
- rules.push(threeQuarters);
164
- }
165
- return rules;
166
- },
167
- });
168
-
169
- exports.Typography = Typography;
170
- exports.closeDoubleQuote = closeDoubleQuote;
171
- exports.closeSingleQuote = closeSingleQuote;
172
- exports.copyright = copyright;
173
- exports["default"] = Typography;
174
- exports.ellipsis = ellipsis;
175
- exports.emDash = emDash;
176
- exports.laquo = laquo;
177
- exports.leftArrow = leftArrow;
178
- exports.multiplication = multiplication;
179
- exports.notEqual = notEqual;
180
- exports.oneHalf = oneHalf;
181
- exports.oneQuarter = oneQuarter;
182
- exports.openDoubleQuote = openDoubleQuote;
183
- exports.openSingleQuote = openSingleQuote;
184
- exports.plusMinus = plusMinus;
185
- exports.raquo = raquo;
186
- exports.registeredTrademark = registeredTrademark;
187
- exports.rightArrow = rightArrow;
188
- exports.servicemark = servicemark;
189
- exports.superscriptThree = superscriptThree;
190
- exports.superscriptTwo = superscriptTwo;
191
- exports.threeQuarters = threeQuarters;
192
- exports.trademark = trademark;
193
- //# sourceMappingURL=tiptap-extension-typography.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tiptap-extension-typography.cjs","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,OAAO,EAAE,GAAG;AACb,CAAA,EAAC;AAEK,MAAM,gBAAgB,GAAGA,kBAAa,CAAC;AAC5C,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,OAAO,EAAE,GAAG;AACb,CAAA,EAAC;AAEK,MAAM,eAAe,GAAGA,kBAAa,CAAC;AAC3C,IAAA,IAAI,EAAE,kCAAkC;AACxC,IAAA,OAAO,EAAE,GAAG;AACb,CAAA,EAAC;AAEK,MAAM,gBAAgB,GAAGA,kBAAa,CAAC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C,YAAA,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;AAC1B,SAAA;AAED,QAAA,OAAO,KAAK,CAAA;KACb;AACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,166 +0,0 @@
1
- import { textInputRule, Extension } from '@tiptap/core';
2
-
3
- const emDash = textInputRule({
4
- find: /--$/,
5
- replace: '—',
6
- });
7
- const ellipsis = textInputRule({
8
- find: /\.\.\.$/,
9
- replace: '…',
10
- });
11
- const openDoubleQuote = textInputRule({
12
- find: /(?:^|[\s{[(<'"\u2018\u201C])(")$/,
13
- replace: '“',
14
- });
15
- const closeDoubleQuote = textInputRule({
16
- find: /"$/,
17
- replace: '”',
18
- });
19
- const openSingleQuote = textInputRule({
20
- find: /(?:^|[\s{[(<'"\u2018\u201C])(')$/,
21
- replace: '‘',
22
- });
23
- const closeSingleQuote = textInputRule({
24
- find: /'$/,
25
- replace: '’',
26
- });
27
- const leftArrow = textInputRule({
28
- find: /<-$/,
29
- replace: '←',
30
- });
31
- const rightArrow = textInputRule({
32
- find: /->$/,
33
- replace: '→',
34
- });
35
- const copyright = textInputRule({
36
- find: /\(c\)$/,
37
- replace: '©',
38
- });
39
- const trademark = textInputRule({
40
- find: /\(tm\)$/,
41
- replace: '™',
42
- });
43
- const servicemark = textInputRule({
44
- find: /\(sm\)$/,
45
- replace: '℠',
46
- });
47
- const registeredTrademark = textInputRule({
48
- find: /\(r\)$/,
49
- replace: '®',
50
- });
51
- const oneHalf = textInputRule({
52
- find: /1\/2$/,
53
- replace: '½',
54
- });
55
- const plusMinus = textInputRule({
56
- find: /\+\/-$/,
57
- replace: '±',
58
- });
59
- const notEqual = textInputRule({
60
- find: /!=$/,
61
- replace: '≠',
62
- });
63
- const laquo = textInputRule({
64
- find: /<<$/,
65
- replace: '«',
66
- });
67
- const raquo = textInputRule({
68
- find: />>$/,
69
- replace: '»',
70
- });
71
- const multiplication = textInputRule({
72
- find: /\d+\s?([*x])\s?\d+$/,
73
- replace: '×',
74
- });
75
- const superscriptTwo = textInputRule({
76
- find: /\^2$/,
77
- replace: '²',
78
- });
79
- const superscriptThree = textInputRule({
80
- find: /\^3$/,
81
- replace: '³',
82
- });
83
- const oneQuarter = textInputRule({
84
- find: /1\/4$/,
85
- replace: '¼',
86
- });
87
- const threeQuarters = textInputRule({
88
- find: /3\/4$/,
89
- replace: '¾',
90
- });
91
- const Typography = Extension.create({
92
- name: 'typography',
93
- addInputRules() {
94
- const rules = [];
95
- if (this.options.emDash !== false) {
96
- rules.push(emDash);
97
- }
98
- if (this.options.ellipsis !== false) {
99
- rules.push(ellipsis);
100
- }
101
- if (this.options.openDoubleQuote !== false) {
102
- rules.push(openDoubleQuote);
103
- }
104
- if (this.options.closeDoubleQuote !== false) {
105
- rules.push(closeDoubleQuote);
106
- }
107
- if (this.options.openSingleQuote !== false) {
108
- rules.push(openSingleQuote);
109
- }
110
- if (this.options.closeSingleQuote !== false) {
111
- rules.push(closeSingleQuote);
112
- }
113
- if (this.options.leftArrow !== false) {
114
- rules.push(leftArrow);
115
- }
116
- if (this.options.rightArrow !== false) {
117
- rules.push(rightArrow);
118
- }
119
- if (this.options.copyright !== false) {
120
- rules.push(copyright);
121
- }
122
- if (this.options.trademark !== false) {
123
- rules.push(trademark);
124
- }
125
- if (this.options.servicemark !== false) {
126
- rules.push(servicemark);
127
- }
128
- if (this.options.registeredTrademark !== false) {
129
- rules.push(registeredTrademark);
130
- }
131
- if (this.options.oneHalf !== false) {
132
- rules.push(oneHalf);
133
- }
134
- if (this.options.plusMinus !== false) {
135
- rules.push(plusMinus);
136
- }
137
- if (this.options.notEqual !== false) {
138
- rules.push(notEqual);
139
- }
140
- if (this.options.laquo !== false) {
141
- rules.push(laquo);
142
- }
143
- if (this.options.raquo !== false) {
144
- rules.push(raquo);
145
- }
146
- if (this.options.multiplication !== false) {
147
- rules.push(multiplication);
148
- }
149
- if (this.options.superscriptTwo !== false) {
150
- rules.push(superscriptTwo);
151
- }
152
- if (this.options.superscriptThree !== false) {
153
- rules.push(superscriptThree);
154
- }
155
- if (this.options.oneQuarter !== false) {
156
- rules.push(oneQuarter);
157
- }
158
- if (this.options.threeQuarters !== false) {
159
- rules.push(threeQuarters);
160
- }
161
- return rules;
162
- },
163
- });
164
-
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 };
166
- //# sourceMappingURL=tiptap-extension-typography.esm.js.map
@@ -1 +0,0 @@
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,IAA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AC1B,SAAA;AAED,QAAA,OAAO,KAAK,CAAA;KACb;AACF,CAAA;;;;"}
@@ -1,197 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tiptap/core')) :
3
- typeof define === 'function' && define.amd ? define(['exports', '@tiptap/core'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@tiptap/extension-typography"] = {}, global.core));
5
- })(this, (function (exports, core) { 'use strict';
6
-
7
- const emDash = core.textInputRule({
8
- find: /--$/,
9
- replace: '—',
10
- });
11
- const ellipsis = core.textInputRule({
12
- find: /\.\.\.$/,
13
- replace: '…',
14
- });
15
- const openDoubleQuote = core.textInputRule({
16
- find: /(?:^|[\s{[(<'"\u2018\u201C])(")$/,
17
- replace: '“',
18
- });
19
- const closeDoubleQuote = core.textInputRule({
20
- find: /"$/,
21
- replace: '”',
22
- });
23
- const openSingleQuote = core.textInputRule({
24
- find: /(?:^|[\s{[(<'"\u2018\u201C])(')$/,
25
- replace: '‘',
26
- });
27
- const closeSingleQuote = core.textInputRule({
28
- find: /'$/,
29
- replace: '’',
30
- });
31
- const leftArrow = core.textInputRule({
32
- find: /<-$/,
33
- replace: '←',
34
- });
35
- const rightArrow = core.textInputRule({
36
- find: /->$/,
37
- replace: '→',
38
- });
39
- const copyright = core.textInputRule({
40
- find: /\(c\)$/,
41
- replace: '©',
42
- });
43
- const trademark = core.textInputRule({
44
- find: /\(tm\)$/,
45
- replace: '™',
46
- });
47
- const servicemark = core.textInputRule({
48
- find: /\(sm\)$/,
49
- replace: '℠',
50
- });
51
- const registeredTrademark = core.textInputRule({
52
- find: /\(r\)$/,
53
- replace: '®',
54
- });
55
- const oneHalf = core.textInputRule({
56
- find: /1\/2$/,
57
- replace: '½',
58
- });
59
- const plusMinus = core.textInputRule({
60
- find: /\+\/-$/,
61
- replace: '±',
62
- });
63
- const notEqual = core.textInputRule({
64
- find: /!=$/,
65
- replace: '≠',
66
- });
67
- const laquo = core.textInputRule({
68
- find: /<<$/,
69
- replace: '«',
70
- });
71
- const raquo = core.textInputRule({
72
- find: />>$/,
73
- replace: '»',
74
- });
75
- const multiplication = core.textInputRule({
76
- find: /\d+\s?([*x])\s?\d+$/,
77
- replace: '×',
78
- });
79
- const superscriptTwo = core.textInputRule({
80
- find: /\^2$/,
81
- replace: '²',
82
- });
83
- const superscriptThree = core.textInputRule({
84
- find: /\^3$/,
85
- replace: '³',
86
- });
87
- const oneQuarter = core.textInputRule({
88
- find: /1\/4$/,
89
- replace: '¼',
90
- });
91
- const threeQuarters = core.textInputRule({
92
- find: /3\/4$/,
93
- replace: '¾',
94
- });
95
- const Typography = core.Extension.create({
96
- name: 'typography',
97
- addInputRules() {
98
- const rules = [];
99
- if (this.options.emDash !== false) {
100
- rules.push(emDash);
101
- }
102
- if (this.options.ellipsis !== false) {
103
- rules.push(ellipsis);
104
- }
105
- if (this.options.openDoubleQuote !== false) {
106
- rules.push(openDoubleQuote);
107
- }
108
- if (this.options.closeDoubleQuote !== false) {
109
- rules.push(closeDoubleQuote);
110
- }
111
- if (this.options.openSingleQuote !== false) {
112
- rules.push(openSingleQuote);
113
- }
114
- if (this.options.closeSingleQuote !== false) {
115
- rules.push(closeSingleQuote);
116
- }
117
- if (this.options.leftArrow !== false) {
118
- rules.push(leftArrow);
119
- }
120
- if (this.options.rightArrow !== false) {
121
- rules.push(rightArrow);
122
- }
123
- if (this.options.copyright !== false) {
124
- rules.push(copyright);
125
- }
126
- if (this.options.trademark !== false) {
127
- rules.push(trademark);
128
- }
129
- if (this.options.servicemark !== false) {
130
- rules.push(servicemark);
131
- }
132
- if (this.options.registeredTrademark !== false) {
133
- rules.push(registeredTrademark);
134
- }
135
- if (this.options.oneHalf !== false) {
136
- rules.push(oneHalf);
137
- }
138
- if (this.options.plusMinus !== false) {
139
- rules.push(plusMinus);
140
- }
141
- if (this.options.notEqual !== false) {
142
- rules.push(notEqual);
143
- }
144
- if (this.options.laquo !== false) {
145
- rules.push(laquo);
146
- }
147
- if (this.options.raquo !== false) {
148
- rules.push(raquo);
149
- }
150
- if (this.options.multiplication !== false) {
151
- rules.push(multiplication);
152
- }
153
- if (this.options.superscriptTwo !== false) {
154
- rules.push(superscriptTwo);
155
- }
156
- if (this.options.superscriptThree !== false) {
157
- rules.push(superscriptThree);
158
- }
159
- if (this.options.oneQuarter !== false) {
160
- rules.push(oneQuarter);
161
- }
162
- if (this.options.threeQuarters !== false) {
163
- rules.push(threeQuarters);
164
- }
165
- return rules;
166
- },
167
- });
168
-
169
- exports.Typography = Typography;
170
- exports.closeDoubleQuote = closeDoubleQuote;
171
- exports.closeSingleQuote = closeSingleQuote;
172
- exports.copyright = copyright;
173
- exports["default"] = Typography;
174
- exports.ellipsis = ellipsis;
175
- exports.emDash = emDash;
176
- exports.laquo = laquo;
177
- exports.leftArrow = leftArrow;
178
- exports.multiplication = multiplication;
179
- exports.notEqual = notEqual;
180
- exports.oneHalf = oneHalf;
181
- exports.oneQuarter = oneQuarter;
182
- exports.openDoubleQuote = openDoubleQuote;
183
- exports.openSingleQuote = openSingleQuote;
184
- exports.plusMinus = plusMinus;
185
- exports.raquo = raquo;
186
- exports.registeredTrademark = registeredTrademark;
187
- exports.rightArrow = rightArrow;
188
- exports.servicemark = servicemark;
189
- exports.superscriptThree = superscriptThree;
190
- exports.superscriptTwo = superscriptTwo;
191
- exports.threeQuarters = threeQuarters;
192
- exports.trademark = trademark;
193
-
194
- Object.defineProperty(exports, '__esModule', { value: true });
195
-
196
- }));
197
- //# sourceMappingURL=tiptap-extension-typography.umd.js.map
@@ -1 +0,0 @@
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,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