@tiptap/extension-superscript 2.0.0-beta.7 → 2.0.0-beta.8
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/package.json +2 -2
- package/dist/packages/extension-superscript/src/index.d.ts +0 -3
- package/dist/packages/extension-superscript/src/superscript.d.ts +0 -23
- package/dist/tiptap-extension-superscript.cjs.js +0 -56
- package/dist/tiptap-extension-superscript.cjs.js.map +0 -1
- package/dist/tiptap-extension-superscript.esm.js +0 -51
- package/dist/tiptap-extension-superscript.esm.js.map +0 -1
- package/dist/tiptap-extension-superscript.umd.js +0 -60
- package/dist/tiptap-extension-superscript.umd.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/extension-superscript",
|
|
3
3
|
"description": "superscript extension for tiptap",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.8",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"url": "https://github.com/ueberdosis/tiptap",
|
|
29
29
|
"directory": "packages/extension-superscript"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "fce16e805824972834d5a8ce8d60e3ff41d63c7e"
|
|
32
32
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Mark } from '@tiptap/core';
|
|
2
|
-
export interface SuperscriptExtensionOptions {
|
|
3
|
-
HTMLAttributes: Object;
|
|
4
|
-
}
|
|
5
|
-
declare module '@tiptap/core' {
|
|
6
|
-
interface Commands<ReturnType> {
|
|
7
|
-
superscript: {
|
|
8
|
-
/**
|
|
9
|
-
* Set a superscript mark
|
|
10
|
-
*/
|
|
11
|
-
setSuperscript: () => ReturnType;
|
|
12
|
-
/**
|
|
13
|
-
* Toggle a superscript mark
|
|
14
|
-
*/
|
|
15
|
-
toggleSuperscript: () => ReturnType;
|
|
16
|
-
/**
|
|
17
|
-
* Unset a superscript mark
|
|
18
|
-
*/
|
|
19
|
-
unsetSuperscript: () => ReturnType;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
export declare const Superscript: Mark<SuperscriptExtensionOptions, any>;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var core = require('@tiptap/core');
|
|
6
|
-
|
|
7
|
-
const Superscript = core.Mark.create({
|
|
8
|
-
name: 'superscript',
|
|
9
|
-
addOptions() {
|
|
10
|
-
return {
|
|
11
|
-
HTMLAttributes: {},
|
|
12
|
-
};
|
|
13
|
-
},
|
|
14
|
-
parseHTML() {
|
|
15
|
-
return [
|
|
16
|
-
{
|
|
17
|
-
tag: 'sup',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
style: 'vertical-align',
|
|
21
|
-
getAttrs(value) {
|
|
22
|
-
// Don’t match this rule if the vertical align isn’t super.
|
|
23
|
-
if (value !== 'super') {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
// If it falls through we’ll match, and this mark will be applied.
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
];
|
|
30
|
-
},
|
|
31
|
-
renderHTML({ HTMLAttributes }) {
|
|
32
|
-
return ['sup', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
33
|
-
},
|
|
34
|
-
addCommands() {
|
|
35
|
-
return {
|
|
36
|
-
setSuperscript: () => ({ commands }) => {
|
|
37
|
-
return commands.setMark('superscript');
|
|
38
|
-
},
|
|
39
|
-
toggleSuperscript: () => ({ commands }) => {
|
|
40
|
-
return commands.toggleMark('superscript');
|
|
41
|
-
},
|
|
42
|
-
unsetSuperscript: () => ({ commands }) => {
|
|
43
|
-
return commands.unsetMark('superscript');
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
},
|
|
47
|
-
addKeyboardShortcuts() {
|
|
48
|
-
return {
|
|
49
|
-
'Mod-.': () => this.editor.commands.toggleSuperscript(),
|
|
50
|
-
};
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
exports.Superscript = Superscript;
|
|
55
|
-
exports["default"] = Superscript;
|
|
56
|
-
//# sourceMappingURL=tiptap-extension-superscript.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tiptap-extension-superscript.cjs.js","sources":["../src/superscript.ts"],"sourcesContent":["import { Mark, mergeAttributes } from '@tiptap/core'\n\nexport interface SuperscriptExtensionOptions {\n HTMLAttributes: Object,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n superscript: {\n /**\n * Set a superscript mark\n */\n setSuperscript: () => ReturnType,\n /**\n * Toggle a superscript mark\n */\n toggleSuperscript: () => ReturnType,\n /**\n * Unset a superscript mark\n */\n unsetSuperscript: () => ReturnType,\n }\n }\n}\n\nexport const Superscript = Mark.create<SuperscriptExtensionOptions>({\n name: 'superscript',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'sup',\n },\n {\n style: 'vertical-align',\n getAttrs(value) {\n // Don’t match this rule if the vertical align isn’t super.\n if (value !== 'super') {\n return false\n }\n\n // If it falls through we’ll match, and this mark will be applied.\n },\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['sup', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setSuperscript: () => ({ commands }) => {\n return commands.setMark('superscript')\n },\n toggleSuperscript: () => ({ commands }) => {\n return commands.toggleMark('superscript')\n },\n unsetSuperscript: () => ({ commands }) => {\n return commands.unsetMark('superscript')\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-.': () => this.editor.commands.toggleSuperscript(),\n }\n },\n})\n"],"names":["Mark","mergeAttributes"],"mappings":";;;;;;MAyBa,WAAW,GAAGA,SAAI,CAAC,MAAM,CAA8B;IAClE,IAAI,EAAE,aAAa;IAEnB,UAAU;QACR,OAAO;YACL,cAAc,EAAE,EAAE;SACnB,CAAA;KACF;IAED,SAAS;QACP,OAAO;YACL;gBACE,GAAG,EAAE,KAAK;aACX;YACD;gBACE,KAAK,EAAE,gBAAgB;gBACvB,QAAQ,CAAC,KAAK;;oBAEZ,IAAI,KAAK,KAAK,OAAO,EAAE;wBACrB,OAAO,KAAK,CAAA;qBACb;;iBAGF;aACF;SACF,CAAA;KACF;IAED,UAAU,CAAC,EAAE,cAAc,EAAE;QAC3B,OAAO,CAAC,KAAK,EAAEC,oBAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC,CAAA;KAChF;IAED,WAAW;QACT,OAAO;YACL,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;gBACjC,OAAO,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;aACvC;YACD,iBAAiB,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;gBACpC,OAAO,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;aAC1C;YACD,gBAAgB,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;gBACnC,OAAO,QAAQ,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;aACzC;SACF,CAAA;KACF;IAED,oBAAoB;QAClB,OAAO;YACL,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,EAAE;SACxD,CAAA;KACF;CACF;;;;;"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Mark, mergeAttributes } from '@tiptap/core';
|
|
2
|
-
|
|
3
|
-
const Superscript = Mark.create({
|
|
4
|
-
name: 'superscript',
|
|
5
|
-
addOptions() {
|
|
6
|
-
return {
|
|
7
|
-
HTMLAttributes: {},
|
|
8
|
-
};
|
|
9
|
-
},
|
|
10
|
-
parseHTML() {
|
|
11
|
-
return [
|
|
12
|
-
{
|
|
13
|
-
tag: 'sup',
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
style: 'vertical-align',
|
|
17
|
-
getAttrs(value) {
|
|
18
|
-
// Don’t match this rule if the vertical align isn’t super.
|
|
19
|
-
if (value !== 'super') {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
// If it falls through we’ll match, and this mark will be applied.
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
];
|
|
26
|
-
},
|
|
27
|
-
renderHTML({ HTMLAttributes }) {
|
|
28
|
-
return ['sup', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
29
|
-
},
|
|
30
|
-
addCommands() {
|
|
31
|
-
return {
|
|
32
|
-
setSuperscript: () => ({ commands }) => {
|
|
33
|
-
return commands.setMark('superscript');
|
|
34
|
-
},
|
|
35
|
-
toggleSuperscript: () => ({ commands }) => {
|
|
36
|
-
return commands.toggleMark('superscript');
|
|
37
|
-
},
|
|
38
|
-
unsetSuperscript: () => ({ commands }) => {
|
|
39
|
-
return commands.unsetMark('superscript');
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
},
|
|
43
|
-
addKeyboardShortcuts() {
|
|
44
|
-
return {
|
|
45
|
-
'Mod-.': () => this.editor.commands.toggleSuperscript(),
|
|
46
|
-
};
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
export { Superscript, Superscript as default };
|
|
51
|
-
//# sourceMappingURL=tiptap-extension-superscript.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tiptap-extension-superscript.esm.js","sources":["../src/superscript.ts"],"sourcesContent":["import { Mark, mergeAttributes } from '@tiptap/core'\n\nexport interface SuperscriptExtensionOptions {\n HTMLAttributes: Object,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n superscript: {\n /**\n * Set a superscript mark\n */\n setSuperscript: () => ReturnType,\n /**\n * Toggle a superscript mark\n */\n toggleSuperscript: () => ReturnType,\n /**\n * Unset a superscript mark\n */\n unsetSuperscript: () => ReturnType,\n }\n }\n}\n\nexport const Superscript = Mark.create<SuperscriptExtensionOptions>({\n name: 'superscript',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'sup',\n },\n {\n style: 'vertical-align',\n getAttrs(value) {\n // Don’t match this rule if the vertical align isn’t super.\n if (value !== 'super') {\n return false\n }\n\n // If it falls through we’ll match, and this mark will be applied.\n },\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['sup', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setSuperscript: () => ({ commands }) => {\n return commands.setMark('superscript')\n },\n toggleSuperscript: () => ({ commands }) => {\n return commands.toggleMark('superscript')\n },\n unsetSuperscript: () => ({ commands }) => {\n return commands.unsetMark('superscript')\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-.': () => this.editor.commands.toggleSuperscript(),\n }\n },\n})\n"],"names":[],"mappings":";;MAyBa,WAAW,GAAG,IAAI,CAAC,MAAM,CAA8B;IAClE,IAAI,EAAE,aAAa;IAEnB,UAAU;QACR,OAAO;YACL,cAAc,EAAE,EAAE;SACnB,CAAA;KACF;IAED,SAAS;QACP,OAAO;YACL;gBACE,GAAG,EAAE,KAAK;aACX;YACD;gBACE,KAAK,EAAE,gBAAgB;gBACvB,QAAQ,CAAC,KAAK;;oBAEZ,IAAI,KAAK,KAAK,OAAO,EAAE;wBACrB,OAAO,KAAK,CAAA;qBACb;;iBAGF;aACF;SACF,CAAA;KACF;IAED,UAAU,CAAC,EAAE,cAAc,EAAE;QAC3B,OAAO,CAAC,KAAK,EAAE,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC,CAAA;KAChF;IAED,WAAW;QACT,OAAO;YACL,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;gBACjC,OAAO,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;aACvC;YACD,iBAAiB,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;gBACpC,OAAO,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;aAC1C;YACD,gBAAgB,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;gBACnC,OAAO,QAAQ,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;aACzC;SACF,CAAA;KACF;IAED,oBAAoB;QAClB,OAAO;YACL,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,EAAE;SACxD,CAAA;KACF;CACF;;;;"}
|
|
@@ -1,60 +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-superscript"] = {}, global.core));
|
|
5
|
-
})(this, (function (exports, core) { 'use strict';
|
|
6
|
-
|
|
7
|
-
const Superscript = core.Mark.create({
|
|
8
|
-
name: 'superscript',
|
|
9
|
-
addOptions() {
|
|
10
|
-
return {
|
|
11
|
-
HTMLAttributes: {},
|
|
12
|
-
};
|
|
13
|
-
},
|
|
14
|
-
parseHTML() {
|
|
15
|
-
return [
|
|
16
|
-
{
|
|
17
|
-
tag: 'sup',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
style: 'vertical-align',
|
|
21
|
-
getAttrs(value) {
|
|
22
|
-
// Don’t match this rule if the vertical align isn’t super.
|
|
23
|
-
if (value !== 'super') {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
// If it falls through we’ll match, and this mark will be applied.
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
];
|
|
30
|
-
},
|
|
31
|
-
renderHTML({ HTMLAttributes }) {
|
|
32
|
-
return ['sup', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
33
|
-
},
|
|
34
|
-
addCommands() {
|
|
35
|
-
return {
|
|
36
|
-
setSuperscript: () => ({ commands }) => {
|
|
37
|
-
return commands.setMark('superscript');
|
|
38
|
-
},
|
|
39
|
-
toggleSuperscript: () => ({ commands }) => {
|
|
40
|
-
return commands.toggleMark('superscript');
|
|
41
|
-
},
|
|
42
|
-
unsetSuperscript: () => ({ commands }) => {
|
|
43
|
-
return commands.unsetMark('superscript');
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
},
|
|
47
|
-
addKeyboardShortcuts() {
|
|
48
|
-
return {
|
|
49
|
-
'Mod-.': () => this.editor.commands.toggleSuperscript(),
|
|
50
|
-
};
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
exports.Superscript = Superscript;
|
|
55
|
-
exports["default"] = Superscript;
|
|
56
|
-
|
|
57
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
58
|
-
|
|
59
|
-
}));
|
|
60
|
-
//# sourceMappingURL=tiptap-extension-superscript.umd.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tiptap-extension-superscript.umd.js","sources":["../src/superscript.ts"],"sourcesContent":["import { Mark, mergeAttributes } from '@tiptap/core'\n\nexport interface SuperscriptExtensionOptions {\n HTMLAttributes: Object,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n superscript: {\n /**\n * Set a superscript mark\n */\n setSuperscript: () => ReturnType,\n /**\n * Toggle a superscript mark\n */\n toggleSuperscript: () => ReturnType,\n /**\n * Unset a superscript mark\n */\n unsetSuperscript: () => ReturnType,\n }\n }\n}\n\nexport const Superscript = Mark.create<SuperscriptExtensionOptions>({\n name: 'superscript',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'sup',\n },\n {\n style: 'vertical-align',\n getAttrs(value) {\n // Don’t match this rule if the vertical align isn’t super.\n if (value !== 'super') {\n return false\n }\n\n // If it falls through we’ll match, and this mark will be applied.\n },\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['sup', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setSuperscript: () => ({ commands }) => {\n return commands.setMark('superscript')\n },\n toggleSuperscript: () => ({ commands }) => {\n return commands.toggleMark('superscript')\n },\n unsetSuperscript: () => ({ commands }) => {\n return commands.unsetMark('superscript')\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-.': () => this.editor.commands.toggleSuperscript(),\n }\n },\n})\n"],"names":["Mark","mergeAttributes"],"mappings":";;;;;;QAyBa,WAAW,GAAGA,SAAI,CAAC,MAAM,CAA8B;MAClE,IAAI,EAAE,aAAa;MAEnB,UAAU;UACR,OAAO;cACL,cAAc,EAAE,EAAE;WACnB,CAAA;OACF;MAED,SAAS;UACP,OAAO;cACL;kBACE,GAAG,EAAE,KAAK;eACX;cACD;kBACE,KAAK,EAAE,gBAAgB;kBACvB,QAAQ,CAAC,KAAK;;sBAEZ,IAAI,KAAK,KAAK,OAAO,EAAE;0BACrB,OAAO,KAAK,CAAA;uBACb;;mBAGF;eACF;WACF,CAAA;OACF;MAED,UAAU,CAAC,EAAE,cAAc,EAAE;UAC3B,OAAO,CAAC,KAAK,EAAEC,oBAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC,CAAA;OAChF;MAED,WAAW;UACT,OAAO;cACL,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;kBACjC,OAAO,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;eACvC;cACD,iBAAiB,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;kBACpC,OAAO,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;eAC1C;cACD,gBAAgB,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;kBACnC,OAAO,QAAQ,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;eACzC;WACF,CAAA;OACF;MAED,oBAAoB;UAClB,OAAO;cACL,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,EAAE;WACxD,CAAA;OACF;GACF;;;;;;;;;;;"}
|