@tiptap/extension-subscript 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tiptap/extension-subscript",
3
3
  "description": "subscript extension for tiptap",
4
- "version": "3.20.2",
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.2",
35
- "@tiptap/pm": "^3.20.2"
34
+ "@tiptap/core": "^3.20.3",
35
+ "@tiptap/pm": "^3.20.3"
36
36
  },
37
37
  "peerDependencies": {
38
- "@tiptap/pm": "^3.20.2",
39
- "@tiptap/core": "^3.20.2"
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
- Subscript: () => Subscript,
24
- default: () => index_default
25
- });
26
- module.exports = __toCommonJS(index_exports);
27
-
28
- // src/subscript.ts
29
- var import_core = require("@tiptap/core");
30
- var Subscript = import_core.Mark.create({
31
- name: "subscript",
32
- addOptions() {
33
- return {
34
- HTMLAttributes: {}
35
- };
36
- },
37
- parseHTML() {
38
- return [
39
- {
40
- tag: "sub"
41
- },
42
- {
43
- style: "vertical-align",
44
- getAttrs(value) {
45
- if (value !== "sub") {
46
- return false;
47
- }
48
- return null;
49
- }
50
- }
51
- ];
52
- },
53
- renderHTML({ HTMLAttributes }) {
54
- return ["sub", (0, import_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes), 0];
55
- },
56
- addCommands() {
57
- return {
58
- setSubscript: () => ({ commands }) => {
59
- return commands.setMark(this.name);
60
- },
61
- toggleSubscript: () => ({ commands }) => {
62
- return commands.toggleMark(this.name);
63
- },
64
- unsetSubscript: () => ({ commands }) => {
65
- return commands.unsetMark(this.name);
66
- }
67
- };
68
- },
69
- addKeyboardShortcuts() {
70
- return {
71
- "Mod-,": () => this.editor.commands.toggleSubscript()
72
- };
73
- }
74
- });
75
-
76
- // src/index.ts
77
- var index_default = Subscript;
78
- // Annotate the CommonJS export names for ESM import in node:
79
- 0 && (module.exports = {
80
- Subscript
81
- });
82
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts","../src/subscript.ts"],"sourcesContent":["import { Subscript } from './subscript.js'\n\nexport * from './subscript.js'\n\nexport default Subscript\n","import { Mark, mergeAttributes } from '@tiptap/core'\nimport type { StyleParseRule } from '@tiptap/pm/model'\n\nexport interface SubscriptExtensionOptions {\n /**\n * HTML attributes to add to the subscript element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n subscript: {\n /**\n * Set a subscript mark\n * @example editor.commands.setSubscript()\n */\n setSubscript: () => ReturnType\n /**\n * Toggle a subscript mark\n * @example editor.commands.toggleSubscript()\n */\n toggleSubscript: () => ReturnType\n /**\n * Unset a subscript mark\n * @example editor.commands.unsetSubscript()\n */\n unsetSubscript: () => ReturnType\n }\n }\n}\n\n/**\n * This extension allows you to create subscript text.\n * @see https://www.tiptap.dev/api/marks/subscript\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 return null\n },\n } as StyleParseRule,\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['sub', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setSubscript:\n () =>\n ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleSubscript:\n () =>\n ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetSubscript:\n () =>\n ({ commands }) => {\n return commands.unsetMark(this.name)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-,': () => this.editor.commands.toggleSubscript(),\n }\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAsC;AAsC/B,IAAM,YAAY,iBAAK,OAAkC;AAAA,EAC9D,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,OAAO;AACnB,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,cACE,MACA,CAAC,EAAE,SAAS,MAAM;AAChB,eAAO,SAAS,QAAQ,KAAK,IAAI;AAAA,MACnC;AAAA,MACF,iBACE,MACA,CAAC,EAAE,SAAS,MAAM;AAChB,eAAO,SAAS,WAAW,KAAK,IAAI;AAAA,MACtC;AAAA,MACF,gBACE,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,gBAAgB;AAAA,IACtD;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 SubscriptExtensionOptions {
4
- /**
5
- * HTML attributes to add to the subscript element.
6
- * @default {}
7
- * @example { class: 'foo' }
8
- */
9
- HTMLAttributes: Record<string, any>;
10
- }
11
- declare module '@tiptap/core' {
12
- interface Commands<ReturnType> {
13
- subscript: {
14
- /**
15
- * Set a subscript mark
16
- * @example editor.commands.setSubscript()
17
- */
18
- setSubscript: () => ReturnType;
19
- /**
20
- * Toggle a subscript mark
21
- * @example editor.commands.toggleSubscript()
22
- */
23
- toggleSubscript: () => ReturnType;
24
- /**
25
- * Unset a subscript mark
26
- * @example editor.commands.unsetSubscript()
27
- */
28
- unsetSubscript: () => ReturnType;
29
- };
30
- }
31
- }
32
- /**
33
- * This extension allows you to create subscript text.
34
- * @see https://www.tiptap.dev/api/marks/subscript
35
- */
36
- declare const Subscript: Mark<SubscriptExtensionOptions, any>;
37
-
38
- export { Subscript, type SubscriptExtensionOptions, Subscript as default };
package/dist/index.d.ts DELETED
@@ -1,38 +0,0 @@
1
- import { Mark } from '@tiptap/core';
2
-
3
- interface SubscriptExtensionOptions {
4
- /**
5
- * HTML attributes to add to the subscript element.
6
- * @default {}
7
- * @example { class: 'foo' }
8
- */
9
- HTMLAttributes: Record<string, any>;
10
- }
11
- declare module '@tiptap/core' {
12
- interface Commands<ReturnType> {
13
- subscript: {
14
- /**
15
- * Set a subscript mark
16
- * @example editor.commands.setSubscript()
17
- */
18
- setSubscript: () => ReturnType;
19
- /**
20
- * Toggle a subscript mark
21
- * @example editor.commands.toggleSubscript()
22
- */
23
- toggleSubscript: () => ReturnType;
24
- /**
25
- * Unset a subscript mark
26
- * @example editor.commands.unsetSubscript()
27
- */
28
- unsetSubscript: () => ReturnType;
29
- };
30
- }
31
- }
32
- /**
33
- * This extension allows you to create subscript text.
34
- * @see https://www.tiptap.dev/api/marks/subscript
35
- */
36
- declare const Subscript: Mark<SubscriptExtensionOptions, any>;
37
-
38
- export { Subscript, type SubscriptExtensionOptions, Subscript as default };
package/dist/index.js DELETED
@@ -1,55 +0,0 @@
1
- // src/subscript.ts
2
- import { Mark, mergeAttributes } from "@tiptap/core";
3
- var 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
- if (value !== "sub") {
19
- return false;
20
- }
21
- return null;
22
- }
23
- }
24
- ];
25
- },
26
- renderHTML({ HTMLAttributes }) {
27
- return ["sub", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
28
- },
29
- addCommands() {
30
- return {
31
- setSubscript: () => ({ commands }) => {
32
- return commands.setMark(this.name);
33
- },
34
- toggleSubscript: () => ({ commands }) => {
35
- return commands.toggleMark(this.name);
36
- },
37
- unsetSubscript: () => ({ commands }) => {
38
- return commands.unsetMark(this.name);
39
- }
40
- };
41
- },
42
- addKeyboardShortcuts() {
43
- return {
44
- "Mod-,": () => this.editor.commands.toggleSubscript()
45
- };
46
- }
47
- });
48
-
49
- // src/index.ts
50
- var index_default = Subscript;
51
- export {
52
- Subscript,
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/subscript.ts","../src/index.ts"],"sourcesContent":["import { Mark, mergeAttributes } from '@tiptap/core'\nimport type { StyleParseRule } from '@tiptap/pm/model'\n\nexport interface SubscriptExtensionOptions {\n /**\n * HTML attributes to add to the subscript element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n subscript: {\n /**\n * Set a subscript mark\n * @example editor.commands.setSubscript()\n */\n setSubscript: () => ReturnType\n /**\n * Toggle a subscript mark\n * @example editor.commands.toggleSubscript()\n */\n toggleSubscript: () => ReturnType\n /**\n * Unset a subscript mark\n * @example editor.commands.unsetSubscript()\n */\n unsetSubscript: () => ReturnType\n }\n }\n}\n\n/**\n * This extension allows you to create subscript text.\n * @see https://www.tiptap.dev/api/marks/subscript\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 return null\n },\n } as StyleParseRule,\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['sub', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setSubscript:\n () =>\n ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleSubscript:\n () =>\n ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetSubscript:\n () =>\n ({ commands }) => {\n return commands.unsetMark(this.name)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-,': () => this.editor.commands.toggleSubscript(),\n }\n },\n})\n","import { Subscript } from './subscript.js'\n\nexport * from './subscript.js'\n\nexport default Subscript\n"],"mappings":";AAAA,SAAS,MAAM,uBAAuB;AAsC/B,IAAM,YAAY,KAAK,OAAkC;AAAA,EAC9D,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,OAAO;AACnB,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,cACE,MACA,CAAC,EAAE,SAAS,MAAM;AAChB,eAAO,SAAS,QAAQ,KAAK,IAAI;AAAA,MACnC;AAAA,MACF,iBACE,MACA,CAAC,EAAE,SAAS,MAAM;AAChB,eAAO,SAAS,WAAW,KAAK,IAAI;AAAA,MACtC;AAAA,MACF,gBACE,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,gBAAgB;AAAA,IACtD;AAAA,EACF;AACF,CAAC;;;AC5FD,IAAO,gBAAQ;","names":[]}