@tiptap/extension-superscript 2.11.0 → 2.11.2
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/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/superscript.d.ts +1 -1
- package/dist/superscript.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/superscript.ts +1 -1
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/superscript.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:
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/superscript.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: () => ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleSuperscript: () => ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetSuperscript: () => ({ 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"],"names":["Mark","mergeAttributes"],"mappings":";;;;;;AAkCA;;;AAGG;AACU,MAAA,WAAW,GAAGA,SAAI,CAAC,MAAM,CAA8B;AAClE,IAAA,IAAI,EAAE,aAAa;IAEnB,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,OAAO,EAAE;AACrB,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,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;gBACrC,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;aACnC;YACD,iBAAiB,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;gBACxC,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;aACtC;YACD,gBAAgB,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;gBACvC,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,iBAAiB,EAAE;SACxD;KACF;AACF,CAAA;;;;;"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/superscript.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:
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/superscript.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: () => ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleSuperscript: () => ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetSuperscript: () => ({ 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"],"names":[],"mappings":";;AAkCA;;;AAGG;AACU,MAAA,WAAW,GAAG,IAAI,CAAC,MAAM,CAA8B;AAClE,IAAA,IAAI,EAAE,aAAa;IAEnB,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,OAAO,EAAE;AACrB,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,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;gBACrC,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;aACnC;YACD,iBAAiB,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;gBACxC,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;aACtC;YACD,gBAAgB,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;gBACvC,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,iBAAiB,EAAE;SACxD;KACF;AACF,CAAA;;;;"}
|
package/dist/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../src/superscript.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:
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../src/superscript.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: () => ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleSuperscript: () => ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetSuperscript: () => ({ 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"],"names":["Mark","mergeAttributes"],"mappings":";;;;;;EAkCA;;;EAGG;AACU,QAAA,WAAW,GAAGA,SAAI,CAAC,MAAM,CAA8B;EAClE,IAAA,IAAI,EAAE,aAAa;MAEnB,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,OAAO,EAAE;EACrB,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,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;kBACrC,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;eACnC;cACD,iBAAiB,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;kBACxC,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;eACtC;cACD,gBAAgB,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;kBACvC,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,iBAAiB,EAAE;WACxD;OACF;EACF,CAAA;;;;;;;;;;;"}
|
package/dist/superscript.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"superscript.d.ts","sourceRoot":"","sources":["../src/superscript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAA;AAGpD,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"superscript.d.ts","sourceRoot":"","sources":["../src/superscript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAA;AAGpD,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACrC;AAED,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,WAAW,EAAE;YACX;;;eAGG;YACH,cAAc,EAAE,MAAM,UAAU,CAAC;YACjC;;;eAGG;YACH,iBAAiB,EAAE,MAAM,UAAU,CAAC;YACpC;;;eAGG;YACH,gBAAgB,EAAE,MAAM,UAAU,CAAC;SACpC,CAAA;KACF;CACF;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,wCAoDtB,CAAA"}
|
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.11.
|
|
4
|
+
"version": "2.11.2",
|
|
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.
|
|
32
|
+
"@tiptap/core": "^2.11.2"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@tiptap/core": "^2.7.0"
|