@tiptap/extension-superscript 2.0.0-beta.4 → 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 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",
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": "345ea8cf8abba6422dabc6e548594fb8e2c30409"
31
+ "gitHead": "fce16e805824972834d5a8ce8d60e3ff41d63c7e"
32
32
  }
@@ -26,8 +26,10 @@ declare module '@tiptap/core' {
26
26
  export const Superscript = Mark.create<SuperscriptExtensionOptions>({
27
27
  name: 'superscript',
28
28
 
29
- defaultOptions: {
30
- HTMLAttributes: {},
29
+ addOptions() {
30
+ return {
31
+ HTMLAttributes: {},
32
+ }
31
33
  },
32
34
 
33
35
  parseHTML() {
package/CHANGELOG.md DELETED
@@ -1,27 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [2.0.0-beta.4](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-superscript@2.0.0-beta.3...@tiptap/extension-superscript@2.0.0-beta.4) (2021-07-26)
7
-
8
- **Note:** Version bump only for package @tiptap/extension-superscript
9
-
10
-
11
-
12
-
13
-
14
- # [2.0.0-beta.3](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-superscript@2.0.0-beta.2...@tiptap/extension-superscript@2.0.0-beta.3) (2021-06-15)
15
-
16
-
17
- ### Bug Fixes
18
-
19
- * revert excluding superscript from subscript, and vice versa to prevent error if not both extensions are used ([123f206](https://github.com/ueberdosis/tiptap/commit/123f2067e5ccc15f1fceee164e8bc461193cf8a0))
20
-
21
-
22
-
23
-
24
-
25
- # 2.0.0-beta.2 (2021-06-09)
26
-
27
- **Note:** Version bump only for package @tiptap/extension-superscript
@@ -1,3 +0,0 @@
1
- import { Superscript } from './superscript';
2
- export * from './superscript';
3
- export default Superscript;
@@ -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>;
@@ -1,54 +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
- defaultOptions: {
10
- HTMLAttributes: {},
11
- },
12
- parseHTML() {
13
- return [
14
- {
15
- tag: 'sup',
16
- },
17
- {
18
- style: 'vertical-align',
19
- getAttrs(value) {
20
- // Don’t match this rule if the vertical align isn’t super.
21
- if (value !== 'super') {
22
- return false;
23
- }
24
- // If it falls through we’ll match, and this mark will be applied.
25
- },
26
- },
27
- ];
28
- },
29
- renderHTML({ HTMLAttributes }) {
30
- return ['sup', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
31
- },
32
- addCommands() {
33
- return {
34
- setSuperscript: () => ({ commands }) => {
35
- return commands.setMark('superscript');
36
- },
37
- toggleSuperscript: () => ({ commands }) => {
38
- return commands.toggleMark('superscript');
39
- },
40
- unsetSuperscript: () => ({ commands }) => {
41
- return commands.unsetMark('superscript');
42
- },
43
- };
44
- },
45
- addKeyboardShortcuts() {
46
- return {
47
- 'Mod-.': () => this.editor.commands.toggleSuperscript(),
48
- };
49
- },
50
- });
51
-
52
- exports.Superscript = Superscript;
53
- exports.default = Superscript;
54
- //# 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 defaultOptions: {\n HTMLAttributes: {},\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,cAAc,EAAE;QACd,cAAc,EAAE,EAAE;KACnB;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,50 +0,0 @@
1
- import { Mark, mergeAttributes } from '@tiptap/core';
2
-
3
- const Superscript = Mark.create({
4
- name: 'superscript',
5
- defaultOptions: {
6
- HTMLAttributes: {},
7
- },
8
- parseHTML() {
9
- return [
10
- {
11
- tag: 'sup',
12
- },
13
- {
14
- style: 'vertical-align',
15
- getAttrs(value) {
16
- // Don’t match this rule if the vertical align isn’t super.
17
- if (value !== 'super') {
18
- return false;
19
- }
20
- // If it falls through we’ll match, and this mark will be applied.
21
- },
22
- },
23
- ];
24
- },
25
- renderHTML({ HTMLAttributes }) {
26
- return ['sup', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
27
- },
28
- addCommands() {
29
- return {
30
- setSuperscript: () => ({ commands }) => {
31
- return commands.setMark('superscript');
32
- },
33
- toggleSuperscript: () => ({ commands }) => {
34
- return commands.toggleMark('superscript');
35
- },
36
- unsetSuperscript: () => ({ commands }) => {
37
- return commands.unsetMark('superscript');
38
- },
39
- };
40
- },
41
- addKeyboardShortcuts() {
42
- return {
43
- 'Mod-.': () => this.editor.commands.toggleSuperscript(),
44
- };
45
- },
46
- });
47
-
48
- export default Superscript;
49
- export { Superscript };
50
- //# 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 defaultOptions: {\n HTMLAttributes: {},\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,cAAc,EAAE;QACd,cAAc,EAAE,EAAE;KACnB;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,58 +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
- defaultOptions: {
10
- HTMLAttributes: {},
11
- },
12
- parseHTML() {
13
- return [
14
- {
15
- tag: 'sup',
16
- },
17
- {
18
- style: 'vertical-align',
19
- getAttrs(value) {
20
- // Don’t match this rule if the vertical align isn’t super.
21
- if (value !== 'super') {
22
- return false;
23
- }
24
- // If it falls through we’ll match, and this mark will be applied.
25
- },
26
- },
27
- ];
28
- },
29
- renderHTML({ HTMLAttributes }) {
30
- return ['sup', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
31
- },
32
- addCommands() {
33
- return {
34
- setSuperscript: () => ({ commands }) => {
35
- return commands.setMark('superscript');
36
- },
37
- toggleSuperscript: () => ({ commands }) => {
38
- return commands.toggleMark('superscript');
39
- },
40
- unsetSuperscript: () => ({ commands }) => {
41
- return commands.unsetMark('superscript');
42
- },
43
- };
44
- },
45
- addKeyboardShortcuts() {
46
- return {
47
- 'Mod-.': () => this.editor.commands.toggleSuperscript(),
48
- };
49
- },
50
- });
51
-
52
- exports.Superscript = Superscript;
53
- exports.default = Superscript;
54
-
55
- Object.defineProperty(exports, '__esModule', { value: true });
56
-
57
- })));
58
- //# 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 defaultOptions: {\n HTMLAttributes: {},\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,cAAc,EAAE;UACd,cAAc,EAAE,EAAE;OACnB;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;;;;;;;;;;;"}