@tiptap/extension-subscript 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tiptap/extension-subscript",
3
3
  "description": "subscript extension for tiptap",
4
- "version": "2.0.0-beta.7",
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-subscript"
30
30
  },
31
- "gitHead": "d59c6958331c456931cec240aca27384d44fb67e"
31
+ "gitHead": "fce16e805824972834d5a8ce8d60e3ff41d63c7e"
32
32
  }
@@ -1,3 +0,0 @@
1
- import { Subscript } from './subscript';
2
- export * from './subscript';
3
- export default Subscript;
@@ -1,23 +0,0 @@
1
- import { Mark } from '@tiptap/core';
2
- export interface SubscriptExtensionOptions {
3
- HTMLAttributes: Object;
4
- }
5
- declare module '@tiptap/core' {
6
- interface Commands<ReturnType> {
7
- subscript: {
8
- /**
9
- * Set a subscript mark
10
- */
11
- setSubscript: () => ReturnType;
12
- /**
13
- * Toggle a subscript mark
14
- */
15
- toggleSubscript: () => ReturnType;
16
- /**
17
- * Unset a subscript mark
18
- */
19
- unsetSubscript: () => ReturnType;
20
- };
21
- }
22
- }
23
- export declare const Subscript: Mark<SubscriptExtensionOptions, 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 Subscript = core.Mark.create({
8
- name: 'subscript',
9
- addOptions() {
10
- return {
11
- HTMLAttributes: {},
12
- };
13
- },
14
- parseHTML() {
15
- return [
16
- {
17
- tag: 'sub',
18
- },
19
- {
20
- style: 'vertical-align',
21
- getAttrs(value) {
22
- // Don’t match this rule if the vertical align isn’t sub.
23
- if (value !== 'sub') {
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 ['sub', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
33
- },
34
- addCommands() {
35
- return {
36
- setSubscript: () => ({ commands }) => {
37
- return commands.setMark('subscript');
38
- },
39
- toggleSubscript: () => ({ commands }) => {
40
- return commands.toggleMark('subscript');
41
- },
42
- unsetSubscript: () => ({ commands }) => {
43
- return commands.unsetMark('subscript');
44
- },
45
- };
46
- },
47
- addKeyboardShortcuts() {
48
- return {
49
- 'Mod-,': () => this.editor.commands.toggleSubscript(),
50
- };
51
- },
52
- });
53
-
54
- exports.Subscript = Subscript;
55
- exports["default"] = Subscript;
56
- //# sourceMappingURL=tiptap-extension-subscript.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tiptap-extension-subscript.cjs.js","sources":["../src/subscript.ts"],"sourcesContent":["import { Mark, mergeAttributes } from '@tiptap/core'\n\nexport interface SubscriptExtensionOptions {\n HTMLAttributes: Object,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n subscript: {\n /**\n * Set a subscript mark\n */\n setSubscript: () => ReturnType,\n /**\n * Toggle a subscript mark\n */\n toggleSubscript: () => ReturnType,\n /**\n * Unset a subscript mark\n */\n unsetSubscript: () => ReturnType,\n }\n }\n}\n\nexport const Subscript = Mark.create<SubscriptExtensionOptions>({\n name: 'subscript',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'sub',\n },\n {\n style: 'vertical-align',\n getAttrs(value) {\n // Don’t match this rule if the vertical align isn’t sub.\n if (value !== 'sub') {\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 ['sub', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setSubscript: () => ({ commands }) => {\n return commands.setMark('subscript')\n },\n toggleSubscript: () => ({ commands }) => {\n return commands.toggleMark('subscript')\n },\n unsetSubscript: () => ({ commands }) => {\n return commands.unsetMark('subscript')\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-,': () => this.editor.commands.toggleSubscript(),\n }\n },\n})\n"],"names":["Mark","mergeAttributes"],"mappings":";;;;;;MAyBa,SAAS,GAAGA,SAAI,CAAC,MAAM,CAA4B;IAC9D,IAAI,EAAE,WAAW;IAEjB,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,KAAK,EAAE;wBACnB,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,YAAY,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;gBAC/B,OAAO,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;aACrC;YACD,eAAe,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;gBAClC,OAAO,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,CAAA;aACxC;YACD,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;gBACjC,OAAO,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;aACvC;SACF,CAAA;KACF;IAED,oBAAoB;QAClB,OAAO;YACL,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE;SACtD,CAAA;KACF;CACF;;;;;"}
@@ -1,51 +0,0 @@
1
- import { Mark, mergeAttributes } from '@tiptap/core';
2
-
3
- const Subscript = Mark.create({
4
- name: 'subscript',
5
- addOptions() {
6
- return {
7
- HTMLAttributes: {},
8
- };
9
- },
10
- parseHTML() {
11
- return [
12
- {
13
- tag: 'sub',
14
- },
15
- {
16
- style: 'vertical-align',
17
- getAttrs(value) {
18
- // Don’t match this rule if the vertical align isn’t sub.
19
- if (value !== 'sub') {
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 ['sub', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
29
- },
30
- addCommands() {
31
- return {
32
- setSubscript: () => ({ commands }) => {
33
- return commands.setMark('subscript');
34
- },
35
- toggleSubscript: () => ({ commands }) => {
36
- return commands.toggleMark('subscript');
37
- },
38
- unsetSubscript: () => ({ commands }) => {
39
- return commands.unsetMark('subscript');
40
- },
41
- };
42
- },
43
- addKeyboardShortcuts() {
44
- return {
45
- 'Mod-,': () => this.editor.commands.toggleSubscript(),
46
- };
47
- },
48
- });
49
-
50
- export { Subscript, Subscript as default };
51
- //# sourceMappingURL=tiptap-extension-subscript.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tiptap-extension-subscript.esm.js","sources":["../src/subscript.ts"],"sourcesContent":["import { Mark, mergeAttributes } from '@tiptap/core'\n\nexport interface SubscriptExtensionOptions {\n HTMLAttributes: Object,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n subscript: {\n /**\n * Set a subscript mark\n */\n setSubscript: () => ReturnType,\n /**\n * Toggle a subscript mark\n */\n toggleSubscript: () => ReturnType,\n /**\n * Unset a subscript mark\n */\n unsetSubscript: () => ReturnType,\n }\n }\n}\n\nexport const Subscript = Mark.create<SubscriptExtensionOptions>({\n name: 'subscript',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'sub',\n },\n {\n style: 'vertical-align',\n getAttrs(value) {\n // Don’t match this rule if the vertical align isn’t sub.\n if (value !== 'sub') {\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 ['sub', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setSubscript: () => ({ commands }) => {\n return commands.setMark('subscript')\n },\n toggleSubscript: () => ({ commands }) => {\n return commands.toggleMark('subscript')\n },\n unsetSubscript: () => ({ commands }) => {\n return commands.unsetMark('subscript')\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-,': () => this.editor.commands.toggleSubscript(),\n }\n },\n})\n"],"names":[],"mappings":";;MAyBa,SAAS,GAAG,IAAI,CAAC,MAAM,CAA4B;IAC9D,IAAI,EAAE,WAAW;IAEjB,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,KAAK,EAAE;wBACnB,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,YAAY,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;gBAC/B,OAAO,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;aACrC;YACD,eAAe,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;gBAClC,OAAO,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,CAAA;aACxC;YACD,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;gBACjC,OAAO,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;aACvC;SACF,CAAA;KACF;IAED,oBAAoB;QAClB,OAAO;YACL,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE;SACtD,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-subscript"] = {}, global.core));
5
- })(this, (function (exports, core) { 'use strict';
6
-
7
- const Subscript = core.Mark.create({
8
- name: 'subscript',
9
- addOptions() {
10
- return {
11
- HTMLAttributes: {},
12
- };
13
- },
14
- parseHTML() {
15
- return [
16
- {
17
- tag: 'sub',
18
- },
19
- {
20
- style: 'vertical-align',
21
- getAttrs(value) {
22
- // Don’t match this rule if the vertical align isn’t sub.
23
- if (value !== 'sub') {
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 ['sub', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
33
- },
34
- addCommands() {
35
- return {
36
- setSubscript: () => ({ commands }) => {
37
- return commands.setMark('subscript');
38
- },
39
- toggleSubscript: () => ({ commands }) => {
40
- return commands.toggleMark('subscript');
41
- },
42
- unsetSubscript: () => ({ commands }) => {
43
- return commands.unsetMark('subscript');
44
- },
45
- };
46
- },
47
- addKeyboardShortcuts() {
48
- return {
49
- 'Mod-,': () => this.editor.commands.toggleSubscript(),
50
- };
51
- },
52
- });
53
-
54
- exports.Subscript = Subscript;
55
- exports["default"] = Subscript;
56
-
57
- Object.defineProperty(exports, '__esModule', { value: true });
58
-
59
- }));
60
- //# sourceMappingURL=tiptap-extension-subscript.umd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tiptap-extension-subscript.umd.js","sources":["../src/subscript.ts"],"sourcesContent":["import { Mark, mergeAttributes } from '@tiptap/core'\n\nexport interface SubscriptExtensionOptions {\n HTMLAttributes: Object,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n subscript: {\n /**\n * Set a subscript mark\n */\n setSubscript: () => ReturnType,\n /**\n * Toggle a subscript mark\n */\n toggleSubscript: () => ReturnType,\n /**\n * Unset a subscript mark\n */\n unsetSubscript: () => ReturnType,\n }\n }\n}\n\nexport const Subscript = Mark.create<SubscriptExtensionOptions>({\n name: 'subscript',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'sub',\n },\n {\n style: 'vertical-align',\n getAttrs(value) {\n // Don’t match this rule if the vertical align isn’t sub.\n if (value !== 'sub') {\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 ['sub', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setSubscript: () => ({ commands }) => {\n return commands.setMark('subscript')\n },\n toggleSubscript: () => ({ commands }) => {\n return commands.toggleMark('subscript')\n },\n unsetSubscript: () => ({ commands }) => {\n return commands.unsetMark('subscript')\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-,': () => this.editor.commands.toggleSubscript(),\n }\n },\n})\n"],"names":["Mark","mergeAttributes"],"mappings":";;;;;;QAyBa,SAAS,GAAGA,SAAI,CAAC,MAAM,CAA4B;MAC9D,IAAI,EAAE,WAAW;MAEjB,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,KAAK,EAAE;0BACnB,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,YAAY,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;kBAC/B,OAAO,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;eACrC;cACD,eAAe,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;kBAClC,OAAO,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,CAAA;eACxC;cACD,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;kBACjC,OAAO,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;eACvC;WACF,CAAA;OACF;MAED,oBAAoB;UAClB,OAAO;cACL,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE;WACtD,CAAA;OACF;GACF;;;;;;;;;;;"}