@tiptap/extension-subscript 2.11.0 → 2.11.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/subscript.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: Object,\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: () => ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleSubscript: () => ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetSubscript: () => ({ 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"],"names":["Mark","mergeAttributes"],"mappings":";;;;;;AAkCA;;;AAGG;AACU,MAAA,SAAS,GAAGA,SAAI,CAAC,MAAM,CAA4B;AAC9D,IAAA,IAAI,EAAE,WAAW;IAEjB,UAAU,GAAA;QACR,OAAO;AACL,YAAA,cAAc,EAAE,EAAE;SACnB;KACF;IAED,SAAS,GAAA;QACP,OAAO;AACL,YAAA;AACE,gBAAA,GAAG,EAAE,KAAK;AACX,aAAA;AACD,YAAA;AACE,gBAAA,KAAK,EAAE,gBAAgB;AACvB,gBAAA,QAAQ,CAAC,KAAK,EAAA;;AAEZ,oBAAA,IAAI,KAAK,KAAK,KAAK,EAAE;AACnB,wBAAA,OAAO,KAAK;;;AAId,oBAAA,OAAO,IAAI;iBACZ;AACgB,aAAA;SACpB;KACF;IAED,UAAU,CAAC,EAAE,cAAc,EAAE,EAAA;AAC3B,QAAA,OAAO,CAAC,KAAK,EAAEC,oBAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC;KAChF;IAED,WAAW,GAAA;QACT,OAAO;YACL,YAAY,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;gBACnC,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;aACnC;YACD,eAAe,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;gBACtC,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;aACtC;YACD,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;gBACrC,OAAO,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;aACrC;SACF;KACF;IAED,oBAAoB,GAAA;QAClB,OAAO;YACL,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE;SACtD;KACF;AACF,CAAA;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/subscript.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: () => ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleSubscript: () => ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetSubscript: () => ({ 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"],"names":["Mark","mergeAttributes"],"mappings":";;;;;;AAkCA;;;AAGG;AACU,MAAA,SAAS,GAAGA,SAAI,CAAC,MAAM,CAA4B;AAC9D,IAAA,IAAI,EAAE,WAAW;IAEjB,UAAU,GAAA;QACR,OAAO;AACL,YAAA,cAAc,EAAE,EAAE;SACnB;KACF;IAED,SAAS,GAAA;QACP,OAAO;AACL,YAAA;AACE,gBAAA,GAAG,EAAE,KAAK;AACX,aAAA;AACD,YAAA;AACE,gBAAA,KAAK,EAAE,gBAAgB;AACvB,gBAAA,QAAQ,CAAC,KAAK,EAAA;;AAEZ,oBAAA,IAAI,KAAK,KAAK,KAAK,EAAE;AACnB,wBAAA,OAAO,KAAK;;;AAId,oBAAA,OAAO,IAAI;iBACZ;AACgB,aAAA;SACpB;KACF;IAED,UAAU,CAAC,EAAE,cAAc,EAAE,EAAA;AAC3B,QAAA,OAAO,CAAC,KAAK,EAAEC,oBAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC;KAChF;IAED,WAAW,GAAA;QACT,OAAO;YACL,YAAY,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;gBACnC,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;aACnC;YACD,eAAe,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;gBACtC,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;aACtC;YACD,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;gBACrC,OAAO,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;aACrC;SACF;KACF;IAED,oBAAoB,GAAA;QAClB,OAAO;YACL,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE;SACtD;KACF;AACF,CAAA;;;;;"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/subscript.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: Object,\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: () => ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleSubscript: () => ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetSubscript: () => ({ 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"],"names":[],"mappings":";;AAkCA;;;AAGG;AACU,MAAA,SAAS,GAAG,IAAI,CAAC,MAAM,CAA4B;AAC9D,IAAA,IAAI,EAAE,WAAW;IAEjB,UAAU,GAAA;QACR,OAAO;AACL,YAAA,cAAc,EAAE,EAAE;SACnB;KACF;IAED,SAAS,GAAA;QACP,OAAO;AACL,YAAA;AACE,gBAAA,GAAG,EAAE,KAAK;AACX,aAAA;AACD,YAAA;AACE,gBAAA,KAAK,EAAE,gBAAgB;AACvB,gBAAA,QAAQ,CAAC,KAAK,EAAA;;AAEZ,oBAAA,IAAI,KAAK,KAAK,KAAK,EAAE;AACnB,wBAAA,OAAO,KAAK;;;AAId,oBAAA,OAAO,IAAI;iBACZ;AACgB,aAAA;SACpB;KACF;IAED,UAAU,CAAC,EAAE,cAAc,EAAE,EAAA;AAC3B,QAAA,OAAO,CAAC,KAAK,EAAE,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC;KAChF;IAED,WAAW,GAAA;QACT,OAAO;YACL,YAAY,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;gBACnC,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;aACnC;YACD,eAAe,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;gBACtC,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;aACtC;YACD,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;gBACrC,OAAO,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;aACrC;SACF;KACF;IAED,oBAAoB,GAAA;QAClB,OAAO;YACL,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE;SACtD;KACF;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/subscript.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: () => ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleSubscript: () => ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetSubscript: () => ({ 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"],"names":[],"mappings":";;AAkCA;;;AAGG;AACU,MAAA,SAAS,GAAG,IAAI,CAAC,MAAM,CAA4B;AAC9D,IAAA,IAAI,EAAE,WAAW;IAEjB,UAAU,GAAA;QACR,OAAO;AACL,YAAA,cAAc,EAAE,EAAE;SACnB;KACF;IAED,SAAS,GAAA;QACP,OAAO;AACL,YAAA;AACE,gBAAA,GAAG,EAAE,KAAK;AACX,aAAA;AACD,YAAA;AACE,gBAAA,KAAK,EAAE,gBAAgB;AACvB,gBAAA,QAAQ,CAAC,KAAK,EAAA;;AAEZ,oBAAA,IAAI,KAAK,KAAK,KAAK,EAAE;AACnB,wBAAA,OAAO,KAAK;;;AAId,oBAAA,OAAO,IAAI;iBACZ;AACgB,aAAA;SACpB;KACF;IAED,UAAU,CAAC,EAAE,cAAc,EAAE,EAAA;AAC3B,QAAA,OAAO,CAAC,KAAK,EAAE,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC;KAChF;IAED,WAAW,GAAA;QACT,OAAO;YACL,YAAY,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;gBACnC,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;aACnC;YACD,eAAe,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;gBACtC,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;aACtC;YACD,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;gBACrC,OAAO,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;aACrC;SACF;KACF;IAED,oBAAoB,GAAA;QAClB,OAAO;YACL,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE;SACtD;KACF;AACF,CAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","sources":["../src/subscript.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: Object,\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: () => ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleSubscript: () => ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetSubscript: () => ({ 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"],"names":["Mark","mergeAttributes"],"mappings":";;;;;;EAkCA;;;EAGG;AACU,QAAA,SAAS,GAAGA,SAAI,CAAC,MAAM,CAA4B;EAC9D,IAAA,IAAI,EAAE,WAAW;MAEjB,UAAU,GAAA;UACR,OAAO;EACL,YAAA,cAAc,EAAE,EAAE;WACnB;OACF;MAED,SAAS,GAAA;UACP,OAAO;EACL,YAAA;EACE,gBAAA,GAAG,EAAE,KAAK;EACX,aAAA;EACD,YAAA;EACE,gBAAA,KAAK,EAAE,gBAAgB;EACvB,gBAAA,QAAQ,CAAC,KAAK,EAAA;;EAEZ,oBAAA,IAAI,KAAK,KAAK,KAAK,EAAE;EACnB,wBAAA,OAAO,KAAK;;;EAId,oBAAA,OAAO,IAAI;mBACZ;EACgB,aAAA;WACpB;OACF;MAED,UAAU,CAAC,EAAE,cAAc,EAAE,EAAA;EAC3B,QAAA,OAAO,CAAC,KAAK,EAAEC,oBAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC;OAChF;MAED,WAAW,GAAA;UACT,OAAO;cACL,YAAY,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;kBACnC,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;eACnC;cACD,eAAe,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;kBACtC,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;eACtC;cACD,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;kBACrC,OAAO,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;eACrC;WACF;OACF;MAED,oBAAoB,GAAA;UAClB,OAAO;cACL,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE;WACtD;OACF;EACF,CAAA;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.umd.js","sources":["../src/subscript.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: () => ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleSubscript: () => ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetSubscript: () => ({ 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"],"names":["Mark","mergeAttributes"],"mappings":";;;;;;EAkCA;;;EAGG;AACU,QAAA,SAAS,GAAGA,SAAI,CAAC,MAAM,CAA4B;EAC9D,IAAA,IAAI,EAAE,WAAW;MAEjB,UAAU,GAAA;UACR,OAAO;EACL,YAAA,cAAc,EAAE,EAAE;WACnB;OACF;MAED,SAAS,GAAA;UACP,OAAO;EACL,YAAA;EACE,gBAAA,GAAG,EAAE,KAAK;EACX,aAAA;EACD,YAAA;EACE,gBAAA,KAAK,EAAE,gBAAgB;EACvB,gBAAA,QAAQ,CAAC,KAAK,EAAA;;EAEZ,oBAAA,IAAI,KAAK,KAAK,KAAK,EAAE;EACnB,wBAAA,OAAO,KAAK;;;EAId,oBAAA,OAAO,IAAI;mBACZ;EACgB,aAAA;WACpB;OACF;MAED,UAAU,CAAC,EAAE,cAAc,EAAE,EAAA;EAC3B,QAAA,OAAO,CAAC,KAAK,EAAEC,oBAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC;OAChF;MAED,WAAW,GAAA;UACT,OAAO;cACL,YAAY,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;kBACnC,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;eACnC;cACD,eAAe,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;kBACtC,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;eACtC;cACD,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;kBACrC,OAAO,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;eACrC;WACF;OACF;MAED,oBAAoB,GAAA;UAClB,OAAO;cACL,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE;WACtD;OACF;EACF,CAAA;;;;;;;;;;;"}
@@ -5,7 +5,7 @@ export interface SubscriptExtensionOptions {
5
5
  * @default {}
6
6
  * @example { class: 'foo' }
7
7
  */
8
- HTMLAttributes: Object;
8
+ HTMLAttributes: Record<string, any>;
9
9
  }
10
10
  declare module '@tiptap/core' {
11
11
  interface Commands<ReturnType> {
@@ -1 +1 @@
1
- {"version":3,"file":"subscript.d.ts","sourceRoot":"","sources":["../src/subscript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAA;AAGpD,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,SAAS,EAAE;YACT;;;eAGG;YACH,YAAY,EAAE,MAAM,UAAU,CAAC;YAC/B;;;eAGG;YACH,eAAe,EAAE,MAAM,UAAU,CAAC;YAClC;;;eAGG;YACH,cAAc,EAAE,MAAM,UAAU,CAAC;SAClC,CAAA;KACF;CACF;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,sCAoDpB,CAAA"}
1
+ {"version":3,"file":"subscript.d.ts","sourceRoot":"","sources":["../src/subscript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAA;AAGpD,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACrC;AAED,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,SAAS,EAAE;YACT;;;eAGG;YACH,YAAY,EAAE,MAAM,UAAU,CAAC;YAC/B;;;eAGG;YACH,eAAe,EAAE,MAAM,UAAU,CAAC;YAClC;;;eAGG;YACH,cAAc,EAAE,MAAM,UAAU,CAAC;SAClC,CAAA;KACF;CACF;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,sCAoDpB,CAAA"}
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.11.0",
4
+ "version": "2.11.1",
5
5
  "homepage": "https://tiptap.dev",
6
6
  "keywords": [
7
7
  "tiptap",
@@ -29,7 +29,7 @@
29
29
  "dist"
30
30
  ],
31
31
  "devDependencies": {
32
- "@tiptap/core": "^2.11.0"
32
+ "@tiptap/core": "^2.11.1"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "@tiptap/core": "^2.7.0"
package/src/subscript.ts CHANGED
@@ -7,7 +7,7 @@ export interface SubscriptExtensionOptions {
7
7
  * @default {}
8
8
  * @example { class: 'foo' }
9
9
  */
10
- HTMLAttributes: Object,
10
+ HTMLAttributes: Record<string, any>,
11
11
  }
12
12
 
13
13
  declare module '@tiptap/core' {