@tiptap/extension-superscript 3.20.2 → 3.20.3
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 +5 -5
- package/dist/index.cjs +0 -82
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -38
- package/dist/index.d.ts +0 -38
- package/dist/index.js +0 -55
- package/dist/index.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": "3.20.
|
|
4
|
+
"version": "3.20.3",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"dist"
|
|
32
32
|
],
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@tiptap/core": "^3.20.
|
|
35
|
-
"@tiptap/pm": "^3.20.
|
|
34
|
+
"@tiptap/core": "^3.20.3",
|
|
35
|
+
"@tiptap/pm": "^3.20.3"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@tiptap/core": "^3.20.
|
|
39
|
-
"@tiptap/pm": "^3.20.
|
|
38
|
+
"@tiptap/core": "^3.20.3",
|
|
39
|
+
"@tiptap/pm": "^3.20.3"
|
|
40
40
|
},
|
|
41
41
|
"repository": {
|
|
42
42
|
"type": "git",
|
package/dist/index.cjs
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
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);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var index_exports = {};
|
|
22
|
-
__export(index_exports, {
|
|
23
|
-
Superscript: () => Superscript,
|
|
24
|
-
default: () => index_default
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(index_exports);
|
|
27
|
-
|
|
28
|
-
// src/superscript.ts
|
|
29
|
-
var import_core = require("@tiptap/core");
|
|
30
|
-
var Superscript = import_core.Mark.create({
|
|
31
|
-
name: "superscript",
|
|
32
|
-
addOptions() {
|
|
33
|
-
return {
|
|
34
|
-
HTMLAttributes: {}
|
|
35
|
-
};
|
|
36
|
-
},
|
|
37
|
-
parseHTML() {
|
|
38
|
-
return [
|
|
39
|
-
{
|
|
40
|
-
tag: "sup"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
style: "vertical-align",
|
|
44
|
-
getAttrs(value) {
|
|
45
|
-
if (value !== "super") {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
];
|
|
52
|
-
},
|
|
53
|
-
renderHTML({ HTMLAttributes }) {
|
|
54
|
-
return ["sup", (0, import_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
55
|
-
},
|
|
56
|
-
addCommands() {
|
|
57
|
-
return {
|
|
58
|
-
setSuperscript: () => ({ commands }) => {
|
|
59
|
-
return commands.setMark(this.name);
|
|
60
|
-
},
|
|
61
|
-
toggleSuperscript: () => ({ commands }) => {
|
|
62
|
-
return commands.toggleMark(this.name);
|
|
63
|
-
},
|
|
64
|
-
unsetSuperscript: () => ({ commands }) => {
|
|
65
|
-
return commands.unsetMark(this.name);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
},
|
|
69
|
-
addKeyboardShortcuts() {
|
|
70
|
-
return {
|
|
71
|
-
"Mod-.": () => this.editor.commands.toggleSuperscript()
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
// src/index.ts
|
|
77
|
-
var index_default = Superscript;
|
|
78
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
79
|
-
0 && (module.exports = {
|
|
80
|
-
Superscript
|
|
81
|
-
});
|
|
82
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/superscript.ts"],"sourcesContent":["import { Superscript } from './superscript.js'\n\nexport * from './superscript.js'\n\nexport default Superscript\n","import { Mark, mergeAttributes } from '@tiptap/core'\nimport type { StyleParseRule } from '@tiptap/pm/model'\n\nexport interface SuperscriptExtensionOptions {\n /**\n * HTML attributes to add to the superscript element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n superscript: {\n /**\n * Set a superscript mark\n * @example editor.commands.setSuperscript()\n */\n setSuperscript: () => ReturnType\n /**\n * Toggle a superscript mark\n * @example editor.commands.toggleSuperscript()\n */\n toggleSuperscript: () => ReturnType\n /**\n * Unset a superscript mark\n * @example editor.commands.unsetSuperscript()\n */\n unsetSuperscript: () => ReturnType\n }\n }\n}\n\n/**\n * This extension allows you to create superscript text.\n * @see https://www.tiptap.dev/api/marks/superscript\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 return null\n },\n } as StyleParseRule,\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['sup', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setSuperscript:\n () =>\n ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleSuperscript:\n () =>\n ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetSuperscript:\n () =>\n ({ commands }) => {\n return commands.unsetMark(this.name)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-.': () => this.editor.commands.toggleSuperscript(),\n }\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAsC;AAsC/B,IAAM,cAAc,iBAAK,OAAoC;AAAA,EAClE,MAAM;AAAA,EAEN,aAAa;AACX,WAAO;AAAA,MACL,gBAAgB,CAAC;AAAA,IACnB;AAAA,EACF;AAAA,EAEA,YAAY;AACV,WAAO;AAAA,MACL;AAAA,QACE,KAAK;AAAA,MACP;AAAA,MACA;AAAA,QACE,OAAO;AAAA,QACP,SAAS,OAAO;AAEd,cAAI,UAAU,SAAS;AACrB,mBAAO;AAAA,UACT;AAGA,iBAAO;AAAA,QACT;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EAEA,WAAW,EAAE,eAAe,GAAG;AAC7B,WAAO,CAAC,WAAO,6BAAgB,KAAK,QAAQ,gBAAgB,cAAc,GAAG,CAAC;AAAA,EAChF;AAAA,EAEA,cAAc;AACZ,WAAO;AAAA,MACL,gBACE,MACA,CAAC,EAAE,SAAS,MAAM;AAChB,eAAO,SAAS,QAAQ,KAAK,IAAI;AAAA,MACnC;AAAA,MACF,mBACE,MACA,CAAC,EAAE,SAAS,MAAM;AAChB,eAAO,SAAS,WAAW,KAAK,IAAI;AAAA,MACtC;AAAA,MACF,kBACE,MACA,CAAC,EAAE,SAAS,MAAM;AAChB,eAAO,SAAS,UAAU,KAAK,IAAI;AAAA,MACrC;AAAA,IACJ;AAAA,EACF;AAAA,EAEA,uBAAuB;AACrB,WAAO;AAAA,MACL,SAAS,MAAM,KAAK,OAAO,SAAS,kBAAkB;AAAA,IACxD;AAAA,EACF;AACF,CAAC;;;AD5FD,IAAO,gBAAQ;","names":[]}
|
package/dist/index.d.cts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Mark } from '@tiptap/core';
|
|
2
|
-
|
|
3
|
-
interface SuperscriptExtensionOptions {
|
|
4
|
-
/**
|
|
5
|
-
* HTML attributes to add to the superscript element.
|
|
6
|
-
* @default {}
|
|
7
|
-
* @example { class: 'foo' }
|
|
8
|
-
*/
|
|
9
|
-
HTMLAttributes: Record<string, any>;
|
|
10
|
-
}
|
|
11
|
-
declare module '@tiptap/core' {
|
|
12
|
-
interface Commands<ReturnType> {
|
|
13
|
-
superscript: {
|
|
14
|
-
/**
|
|
15
|
-
* Set a superscript mark
|
|
16
|
-
* @example editor.commands.setSuperscript()
|
|
17
|
-
*/
|
|
18
|
-
setSuperscript: () => ReturnType;
|
|
19
|
-
/**
|
|
20
|
-
* Toggle a superscript mark
|
|
21
|
-
* @example editor.commands.toggleSuperscript()
|
|
22
|
-
*/
|
|
23
|
-
toggleSuperscript: () => ReturnType;
|
|
24
|
-
/**
|
|
25
|
-
* Unset a superscript mark
|
|
26
|
-
* @example editor.commands.unsetSuperscript()
|
|
27
|
-
*/
|
|
28
|
-
unsetSuperscript: () => ReturnType;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* This extension allows you to create superscript text.
|
|
34
|
-
* @see https://www.tiptap.dev/api/marks/superscript
|
|
35
|
-
*/
|
|
36
|
-
declare const Superscript: Mark<SuperscriptExtensionOptions, any>;
|
|
37
|
-
|
|
38
|
-
export { Superscript, type SuperscriptExtensionOptions, Superscript as default };
|
package/dist/index.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Mark } from '@tiptap/core';
|
|
2
|
-
|
|
3
|
-
interface SuperscriptExtensionOptions {
|
|
4
|
-
/**
|
|
5
|
-
* HTML attributes to add to the superscript element.
|
|
6
|
-
* @default {}
|
|
7
|
-
* @example { class: 'foo' }
|
|
8
|
-
*/
|
|
9
|
-
HTMLAttributes: Record<string, any>;
|
|
10
|
-
}
|
|
11
|
-
declare module '@tiptap/core' {
|
|
12
|
-
interface Commands<ReturnType> {
|
|
13
|
-
superscript: {
|
|
14
|
-
/**
|
|
15
|
-
* Set a superscript mark
|
|
16
|
-
* @example editor.commands.setSuperscript()
|
|
17
|
-
*/
|
|
18
|
-
setSuperscript: () => ReturnType;
|
|
19
|
-
/**
|
|
20
|
-
* Toggle a superscript mark
|
|
21
|
-
* @example editor.commands.toggleSuperscript()
|
|
22
|
-
*/
|
|
23
|
-
toggleSuperscript: () => ReturnType;
|
|
24
|
-
/**
|
|
25
|
-
* Unset a superscript mark
|
|
26
|
-
* @example editor.commands.unsetSuperscript()
|
|
27
|
-
*/
|
|
28
|
-
unsetSuperscript: () => ReturnType;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* This extension allows you to create superscript text.
|
|
34
|
-
* @see https://www.tiptap.dev/api/marks/superscript
|
|
35
|
-
*/
|
|
36
|
-
declare const Superscript: Mark<SuperscriptExtensionOptions, any>;
|
|
37
|
-
|
|
38
|
-
export { Superscript, type SuperscriptExtensionOptions, Superscript as default };
|
package/dist/index.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
// src/superscript.ts
|
|
2
|
-
import { Mark, mergeAttributes } from "@tiptap/core";
|
|
3
|
-
var 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
|
-
if (value !== "super") {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
];
|
|
25
|
-
},
|
|
26
|
-
renderHTML({ HTMLAttributes }) {
|
|
27
|
-
return ["sup", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
28
|
-
},
|
|
29
|
-
addCommands() {
|
|
30
|
-
return {
|
|
31
|
-
setSuperscript: () => ({ commands }) => {
|
|
32
|
-
return commands.setMark(this.name);
|
|
33
|
-
},
|
|
34
|
-
toggleSuperscript: () => ({ commands }) => {
|
|
35
|
-
return commands.toggleMark(this.name);
|
|
36
|
-
},
|
|
37
|
-
unsetSuperscript: () => ({ commands }) => {
|
|
38
|
-
return commands.unsetMark(this.name);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
},
|
|
42
|
-
addKeyboardShortcuts() {
|
|
43
|
-
return {
|
|
44
|
-
"Mod-.": () => this.editor.commands.toggleSuperscript()
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
// src/index.ts
|
|
50
|
-
var index_default = Superscript;
|
|
51
|
-
export {
|
|
52
|
-
Superscript,
|
|
53
|
-
index_default as default
|
|
54
|
-
};
|
|
55
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/superscript.ts","../src/index.ts"],"sourcesContent":["import { Mark, mergeAttributes } from '@tiptap/core'\nimport type { StyleParseRule } from '@tiptap/pm/model'\n\nexport interface SuperscriptExtensionOptions {\n /**\n * HTML attributes to add to the superscript element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n superscript: {\n /**\n * Set a superscript mark\n * @example editor.commands.setSuperscript()\n */\n setSuperscript: () => ReturnType\n /**\n * Toggle a superscript mark\n * @example editor.commands.toggleSuperscript()\n */\n toggleSuperscript: () => ReturnType\n /**\n * Unset a superscript mark\n * @example editor.commands.unsetSuperscript()\n */\n unsetSuperscript: () => ReturnType\n }\n }\n}\n\n/**\n * This extension allows you to create superscript text.\n * @see https://www.tiptap.dev/api/marks/superscript\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 return null\n },\n } as StyleParseRule,\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['sup', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setSuperscript:\n () =>\n ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleSuperscript:\n () =>\n ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetSuperscript:\n () =>\n ({ commands }) => {\n return commands.unsetMark(this.name)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-.': () => this.editor.commands.toggleSuperscript(),\n }\n },\n})\n","import { Superscript } from './superscript.js'\n\nexport * from './superscript.js'\n\nexport default Superscript\n"],"mappings":";AAAA,SAAS,MAAM,uBAAuB;AAsC/B,IAAM,cAAc,KAAK,OAAoC;AAAA,EAClE,MAAM;AAAA,EAEN,aAAa;AACX,WAAO;AAAA,MACL,gBAAgB,CAAC;AAAA,IACnB;AAAA,EACF;AAAA,EAEA,YAAY;AACV,WAAO;AAAA,MACL;AAAA,QACE,KAAK;AAAA,MACP;AAAA,MACA;AAAA,QACE,OAAO;AAAA,QACP,SAAS,OAAO;AAEd,cAAI,UAAU,SAAS;AACrB,mBAAO;AAAA,UACT;AAGA,iBAAO;AAAA,QACT;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EAEA,WAAW,EAAE,eAAe,GAAG;AAC7B,WAAO,CAAC,OAAO,gBAAgB,KAAK,QAAQ,gBAAgB,cAAc,GAAG,CAAC;AAAA,EAChF;AAAA,EAEA,cAAc;AACZ,WAAO;AAAA,MACL,gBACE,MACA,CAAC,EAAE,SAAS,MAAM;AAChB,eAAO,SAAS,QAAQ,KAAK,IAAI;AAAA,MACnC;AAAA,MACF,mBACE,MACA,CAAC,EAAE,SAAS,MAAM;AAChB,eAAO,SAAS,WAAW,KAAK,IAAI;AAAA,MACtC;AAAA,MACF,kBACE,MACA,CAAC,EAAE,SAAS,MAAM;AAChB,eAAO,SAAS,UAAU,KAAK,IAAI;AAAA,MACrC;AAAA,IACJ;AAAA,EACF;AAAA,EAEA,uBAAuB;AACrB,WAAO;AAAA,MACL,SAAS,MAAM,KAAK,OAAO,SAAS,kBAAkB;AAAA,IACxD;AAAA,EACF;AACF,CAAC;;;AC5FD,IAAO,gBAAQ;","names":[]}
|