fix: resolve TypeScript errors in frontend build
This commit is contained in:
21
node_modules/@tiptap/extension-underline/LICENSE.md
generated
vendored
Normal file
21
node_modules/@tiptap/extension-underline/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2025, Tiptap GmbH
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
18
node_modules/@tiptap/extension-underline/README.md
generated
vendored
Normal file
18
node_modules/@tiptap/extension-underline/README.md
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
# @tiptap/extension-underline
|
||||
|
||||
[](https://www.npmjs.com/package/@tiptap/extension-underline)
|
||||
[](https://npmcharts.com/compare/tiptap?minimal=true)
|
||||
[](https://www.npmjs.com/package/@tiptap/extension-underline)
|
||||
[](https://github.com/sponsors/ueberdosis)
|
||||
|
||||
## Introduction
|
||||
|
||||
Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as _New York Times_, _The Guardian_ or _Atlassian_.
|
||||
|
||||
## Official Documentation
|
||||
|
||||
Documentation can be found on the [Tiptap website](https://tiptap.dev).
|
||||
|
||||
## License
|
||||
|
||||
Tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md).
|
||||
106
node_modules/@tiptap/extension-underline/dist/index.cjs
generated
vendored
Normal file
106
node_modules/@tiptap/extension-underline/dist/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/index.ts
|
||||
var index_exports = {};
|
||||
__export(index_exports, {
|
||||
Underline: () => Underline,
|
||||
default: () => index_default
|
||||
});
|
||||
module.exports = __toCommonJS(index_exports);
|
||||
|
||||
// src/underline.ts
|
||||
var import_core = require("@tiptap/core");
|
||||
var Underline = import_core.Mark.create({
|
||||
name: "underline",
|
||||
addOptions() {
|
||||
return {
|
||||
HTMLAttributes: {}
|
||||
};
|
||||
},
|
||||
parseHTML() {
|
||||
return [
|
||||
{
|
||||
tag: "u"
|
||||
},
|
||||
{
|
||||
style: "text-decoration",
|
||||
consuming: false,
|
||||
getAttrs: (style) => style.includes("underline") ? {} : false
|
||||
}
|
||||
];
|
||||
},
|
||||
renderHTML({ HTMLAttributes }) {
|
||||
return ["u", (0, import_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes), 0];
|
||||
},
|
||||
parseMarkdown(token, helpers) {
|
||||
return helpers.applyMark(this.name || "underline", helpers.parseInline(token.tokens || []));
|
||||
},
|
||||
renderMarkdown(node, helpers) {
|
||||
return `++${helpers.renderChildren(node)}++`;
|
||||
},
|
||||
markdownTokenizer: {
|
||||
name: "underline",
|
||||
level: "inline",
|
||||
start(src) {
|
||||
return src.indexOf("++");
|
||||
},
|
||||
tokenize(src, _tokens, lexer) {
|
||||
const rule = /^(\+\+)([\s\S]+?)(\+\+)/;
|
||||
const match = rule.exec(src);
|
||||
if (!match) {
|
||||
return void 0;
|
||||
}
|
||||
const innerContent = match[2].trim();
|
||||
return {
|
||||
type: "underline",
|
||||
raw: match[0],
|
||||
text: innerContent,
|
||||
tokens: lexer.inlineTokens(innerContent)
|
||||
};
|
||||
}
|
||||
},
|
||||
addCommands() {
|
||||
return {
|
||||
setUnderline: () => ({ commands }) => {
|
||||
return commands.setMark(this.name);
|
||||
},
|
||||
toggleUnderline: () => ({ commands }) => {
|
||||
return commands.toggleMark(this.name);
|
||||
},
|
||||
unsetUnderline: () => ({ commands }) => {
|
||||
return commands.unsetMark(this.name);
|
||||
}
|
||||
};
|
||||
},
|
||||
addKeyboardShortcuts() {
|
||||
return {
|
||||
"Mod-u": () => this.editor.commands.toggleUnderline(),
|
||||
"Mod-U": () => this.editor.commands.toggleUnderline()
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// src/index.ts
|
||||
var index_default = Underline;
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
Underline
|
||||
});
|
||||
//# sourceMappingURL=index.cjs.map
|
||||
1
node_modules/@tiptap/extension-underline/dist/index.cjs.map
generated
vendored
Normal file
1
node_modules/@tiptap/extension-underline/dist/index.cjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../src/index.ts","../src/underline.ts"],"sourcesContent":["import { Underline } from './underline.js'\n\nexport * from './underline.js'\n\nexport default Underline\n","import { Mark, mergeAttributes } from '@tiptap/core'\n\nexport interface UnderlineOptions {\n /**\n * HTML attributes to add to the underline element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n underline: {\n /**\n * Set an underline mark\n * @example editor.commands.setUnderline()\n */\n setUnderline: () => ReturnType\n /**\n * Toggle an underline mark\n * @example editor.commands.toggleUnderline()\n */\n toggleUnderline: () => ReturnType\n /**\n * Unset an underline mark\n * @example editor.commands.unsetUnderline()\n */\n unsetUnderline: () => ReturnType\n }\n }\n}\n\n/**\n * This extension allows you to create underline text.\n * @see https://www.tiptap.dev/api/marks/underline\n */\nexport const Underline = Mark.create<UnderlineOptions>({\n name: 'underline',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'u',\n },\n {\n style: 'text-decoration',\n consuming: false,\n getAttrs: style => ((style as string).includes('underline') ? {} : false),\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['u', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n parseMarkdown(token, helpers) {\n return helpers.applyMark(this.name || 'underline', helpers.parseInline(token.tokens || []))\n },\n\n renderMarkdown(node, helpers) {\n return `++${helpers.renderChildren(node)}++`\n },\n\n markdownTokenizer: {\n name: 'underline',\n level: 'inline',\n start(src) {\n return src.indexOf('++')\n },\n tokenize(src, _tokens, lexer) {\n const rule = /^(\\+\\+)([\\s\\S]+?)(\\+\\+)/\n const match = rule.exec(src)\n\n if (!match) {\n return undefined\n }\n\n const innerContent = match[2].trim()\n\n return {\n type: 'underline',\n raw: match[0],\n text: innerContent,\n tokens: lexer.inlineTokens(innerContent),\n }\n },\n },\n\n addCommands() {\n return {\n setUnderline:\n () =>\n ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleUnderline:\n () =>\n ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetUnderline:\n () =>\n ({ commands }) => {\n return commands.unsetMark(this.name)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-u': () => this.editor.commands.toggleUnderline(),\n 'Mod-U': () => this.editor.commands.toggleUnderline(),\n }\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAsC;AAqC/B,IAAM,YAAY,iBAAK,OAAyB;AAAA,EACrD,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,WAAW;AAAA,QACX,UAAU,WAAW,MAAiB,SAAS,WAAW,IAAI,CAAC,IAAI;AAAA,MACrE;AAAA,IACF;AAAA,EACF;AAAA,EAEA,WAAW,EAAE,eAAe,GAAG;AAC7B,WAAO,CAAC,SAAK,6BAAgB,KAAK,QAAQ,gBAAgB,cAAc,GAAG,CAAC;AAAA,EAC9E;AAAA,EAEA,cAAc,OAAO,SAAS;AAC5B,WAAO,QAAQ,UAAU,KAAK,QAAQ,aAAa,QAAQ,YAAY,MAAM,UAAU,CAAC,CAAC,CAAC;AAAA,EAC5F;AAAA,EAEA,eAAe,MAAM,SAAS;AAC5B,WAAO,KAAK,QAAQ,eAAe,IAAI,CAAC;AAAA,EAC1C;AAAA,EAEA,mBAAmB;AAAA,IACjB,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM,KAAK;AACT,aAAO,IAAI,QAAQ,IAAI;AAAA,IACzB;AAAA,IACA,SAAS,KAAK,SAAS,OAAO;AAC5B,YAAM,OAAO;AACb,YAAM,QAAQ,KAAK,KAAK,GAAG;AAE3B,UAAI,CAAC,OAAO;AACV,eAAO;AAAA,MACT;AAEA,YAAM,eAAe,MAAM,CAAC,EAAE,KAAK;AAEnC,aAAO;AAAA,QACL,MAAM;AAAA,QACN,KAAK,MAAM,CAAC;AAAA,QACZ,MAAM;AAAA,QACN,QAAQ,MAAM,aAAa,YAAY;AAAA,MACzC;AAAA,IACF;AAAA,EACF;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,MACpD,SAAS,MAAM,KAAK,OAAO,SAAS,gBAAgB;AAAA,IACtD;AAAA,EACF;AACF,CAAC;;;ADtHD,IAAO,gBAAQ;","names":[]}
|
||||
38
node_modules/@tiptap/extension-underline/dist/index.d.cts
generated
vendored
Normal file
38
node_modules/@tiptap/extension-underline/dist/index.d.cts
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
import { Mark } from '@tiptap/core';
|
||||
|
||||
interface UnderlineOptions {
|
||||
/**
|
||||
* HTML attributes to add to the underline element.
|
||||
* @default {}
|
||||
* @example { class: 'foo' }
|
||||
*/
|
||||
HTMLAttributes: Record<string, any>;
|
||||
}
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
underline: {
|
||||
/**
|
||||
* Set an underline mark
|
||||
* @example editor.commands.setUnderline()
|
||||
*/
|
||||
setUnderline: () => ReturnType;
|
||||
/**
|
||||
* Toggle an underline mark
|
||||
* @example editor.commands.toggleUnderline()
|
||||
*/
|
||||
toggleUnderline: () => ReturnType;
|
||||
/**
|
||||
* Unset an underline mark
|
||||
* @example editor.commands.unsetUnderline()
|
||||
*/
|
||||
unsetUnderline: () => ReturnType;
|
||||
};
|
||||
}
|
||||
}
|
||||
/**
|
||||
* This extension allows you to create underline text.
|
||||
* @see https://www.tiptap.dev/api/marks/underline
|
||||
*/
|
||||
declare const Underline: Mark<UnderlineOptions, any>;
|
||||
|
||||
export { Underline, type UnderlineOptions, Underline as default };
|
||||
38
node_modules/@tiptap/extension-underline/dist/index.d.ts
generated
vendored
Normal file
38
node_modules/@tiptap/extension-underline/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
import { Mark } from '@tiptap/core';
|
||||
|
||||
interface UnderlineOptions {
|
||||
/**
|
||||
* HTML attributes to add to the underline element.
|
||||
* @default {}
|
||||
* @example { class: 'foo' }
|
||||
*/
|
||||
HTMLAttributes: Record<string, any>;
|
||||
}
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
underline: {
|
||||
/**
|
||||
* Set an underline mark
|
||||
* @example editor.commands.setUnderline()
|
||||
*/
|
||||
setUnderline: () => ReturnType;
|
||||
/**
|
||||
* Toggle an underline mark
|
||||
* @example editor.commands.toggleUnderline()
|
||||
*/
|
||||
toggleUnderline: () => ReturnType;
|
||||
/**
|
||||
* Unset an underline mark
|
||||
* @example editor.commands.unsetUnderline()
|
||||
*/
|
||||
unsetUnderline: () => ReturnType;
|
||||
};
|
||||
}
|
||||
}
|
||||
/**
|
||||
* This extension allows you to create underline text.
|
||||
* @see https://www.tiptap.dev/api/marks/underline
|
||||
*/
|
||||
declare const Underline: Mark<UnderlineOptions, any>;
|
||||
|
||||
export { Underline, type UnderlineOptions, Underline as default };
|
||||
79
node_modules/@tiptap/extension-underline/dist/index.js
generated
vendored
Normal file
79
node_modules/@tiptap/extension-underline/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
// src/underline.ts
|
||||
import { Mark, mergeAttributes } from "@tiptap/core";
|
||||
var Underline = Mark.create({
|
||||
name: "underline",
|
||||
addOptions() {
|
||||
return {
|
||||
HTMLAttributes: {}
|
||||
};
|
||||
},
|
||||
parseHTML() {
|
||||
return [
|
||||
{
|
||||
tag: "u"
|
||||
},
|
||||
{
|
||||
style: "text-decoration",
|
||||
consuming: false,
|
||||
getAttrs: (style) => style.includes("underline") ? {} : false
|
||||
}
|
||||
];
|
||||
},
|
||||
renderHTML({ HTMLAttributes }) {
|
||||
return ["u", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
|
||||
},
|
||||
parseMarkdown(token, helpers) {
|
||||
return helpers.applyMark(this.name || "underline", helpers.parseInline(token.tokens || []));
|
||||
},
|
||||
renderMarkdown(node, helpers) {
|
||||
return `++${helpers.renderChildren(node)}++`;
|
||||
},
|
||||
markdownTokenizer: {
|
||||
name: "underline",
|
||||
level: "inline",
|
||||
start(src) {
|
||||
return src.indexOf("++");
|
||||
},
|
||||
tokenize(src, _tokens, lexer) {
|
||||
const rule = /^(\+\+)([\s\S]+?)(\+\+)/;
|
||||
const match = rule.exec(src);
|
||||
if (!match) {
|
||||
return void 0;
|
||||
}
|
||||
const innerContent = match[2].trim();
|
||||
return {
|
||||
type: "underline",
|
||||
raw: match[0],
|
||||
text: innerContent,
|
||||
tokens: lexer.inlineTokens(innerContent)
|
||||
};
|
||||
}
|
||||
},
|
||||
addCommands() {
|
||||
return {
|
||||
setUnderline: () => ({ commands }) => {
|
||||
return commands.setMark(this.name);
|
||||
},
|
||||
toggleUnderline: () => ({ commands }) => {
|
||||
return commands.toggleMark(this.name);
|
||||
},
|
||||
unsetUnderline: () => ({ commands }) => {
|
||||
return commands.unsetMark(this.name);
|
||||
}
|
||||
};
|
||||
},
|
||||
addKeyboardShortcuts() {
|
||||
return {
|
||||
"Mod-u": () => this.editor.commands.toggleUnderline(),
|
||||
"Mod-U": () => this.editor.commands.toggleUnderline()
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// src/index.ts
|
||||
var index_default = Underline;
|
||||
export {
|
||||
Underline,
|
||||
index_default as default
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/@tiptap/extension-underline/dist/index.js.map
generated
vendored
Normal file
1
node_modules/@tiptap/extension-underline/dist/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../src/underline.ts","../src/index.ts"],"sourcesContent":["import { Mark, mergeAttributes } from '@tiptap/core'\n\nexport interface UnderlineOptions {\n /**\n * HTML attributes to add to the underline element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n underline: {\n /**\n * Set an underline mark\n * @example editor.commands.setUnderline()\n */\n setUnderline: () => ReturnType\n /**\n * Toggle an underline mark\n * @example editor.commands.toggleUnderline()\n */\n toggleUnderline: () => ReturnType\n /**\n * Unset an underline mark\n * @example editor.commands.unsetUnderline()\n */\n unsetUnderline: () => ReturnType\n }\n }\n}\n\n/**\n * This extension allows you to create underline text.\n * @see https://www.tiptap.dev/api/marks/underline\n */\nexport const Underline = Mark.create<UnderlineOptions>({\n name: 'underline',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'u',\n },\n {\n style: 'text-decoration',\n consuming: false,\n getAttrs: style => ((style as string).includes('underline') ? {} : false),\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['u', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n parseMarkdown(token, helpers) {\n return helpers.applyMark(this.name || 'underline', helpers.parseInline(token.tokens || []))\n },\n\n renderMarkdown(node, helpers) {\n return `++${helpers.renderChildren(node)}++`\n },\n\n markdownTokenizer: {\n name: 'underline',\n level: 'inline',\n start(src) {\n return src.indexOf('++')\n },\n tokenize(src, _tokens, lexer) {\n const rule = /^(\\+\\+)([\\s\\S]+?)(\\+\\+)/\n const match = rule.exec(src)\n\n if (!match) {\n return undefined\n }\n\n const innerContent = match[2].trim()\n\n return {\n type: 'underline',\n raw: match[0],\n text: innerContent,\n tokens: lexer.inlineTokens(innerContent),\n }\n },\n },\n\n addCommands() {\n return {\n setUnderline:\n () =>\n ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleUnderline:\n () =>\n ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetUnderline:\n () =>\n ({ commands }) => {\n return commands.unsetMark(this.name)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-u': () => this.editor.commands.toggleUnderline(),\n 'Mod-U': () => this.editor.commands.toggleUnderline(),\n }\n },\n})\n","import { Underline } from './underline.js'\n\nexport * from './underline.js'\n\nexport default Underline\n"],"mappings":";AAAA,SAAS,MAAM,uBAAuB;AAqC/B,IAAM,YAAY,KAAK,OAAyB;AAAA,EACrD,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,WAAW;AAAA,QACX,UAAU,WAAW,MAAiB,SAAS,WAAW,IAAI,CAAC,IAAI;AAAA,MACrE;AAAA,IACF;AAAA,EACF;AAAA,EAEA,WAAW,EAAE,eAAe,GAAG;AAC7B,WAAO,CAAC,KAAK,gBAAgB,KAAK,QAAQ,gBAAgB,cAAc,GAAG,CAAC;AAAA,EAC9E;AAAA,EAEA,cAAc,OAAO,SAAS;AAC5B,WAAO,QAAQ,UAAU,KAAK,QAAQ,aAAa,QAAQ,YAAY,MAAM,UAAU,CAAC,CAAC,CAAC;AAAA,EAC5F;AAAA,EAEA,eAAe,MAAM,SAAS;AAC5B,WAAO,KAAK,QAAQ,eAAe,IAAI,CAAC;AAAA,EAC1C;AAAA,EAEA,mBAAmB;AAAA,IACjB,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM,KAAK;AACT,aAAO,IAAI,QAAQ,IAAI;AAAA,IACzB;AAAA,IACA,SAAS,KAAK,SAAS,OAAO;AAC5B,YAAM,OAAO;AACb,YAAM,QAAQ,KAAK,KAAK,GAAG;AAE3B,UAAI,CAAC,OAAO;AACV,eAAO;AAAA,MACT;AAEA,YAAM,eAAe,MAAM,CAAC,EAAE,KAAK;AAEnC,aAAO;AAAA,QACL,MAAM;AAAA,QACN,KAAK,MAAM,CAAC;AAAA,QACZ,MAAM;AAAA,QACN,QAAQ,MAAM,aAAa,YAAY;AAAA,MACzC;AAAA,IACF;AAAA,EACF;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,MACpD,SAAS,MAAM,KAAK,OAAO,SAAS,gBAAgB;AAAA,IACtD;AAAA,EACF;AACF,CAAC;;;ACtHD,IAAO,gBAAQ;","names":[]}
|
||||
48
node_modules/@tiptap/extension-underline/package.json
generated
vendored
Normal file
48
node_modules/@tiptap/extension-underline/package.json
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "@tiptap/extension-underline",
|
||||
"description": "underline extension for tiptap",
|
||||
"version": "3.21.0",
|
||||
"homepage": "https://tiptap.dev",
|
||||
"keywords": [
|
||||
"tiptap",
|
||||
"tiptap extension"
|
||||
],
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ueberdosis"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": {
|
||||
"import": "./dist/index.d.ts",
|
||||
"require": "./dist/index.d.cts"
|
||||
},
|
||||
"import": "./dist/index.js",
|
||||
"require": "./dist/index.cjs"
|
||||
}
|
||||
},
|
||||
"main": "dist/index.cjs",
|
||||
"module": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"files": [
|
||||
"src",
|
||||
"dist"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@tiptap/core": "^3.21.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@tiptap/core": "^3.21.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ueberdosis/tiptap",
|
||||
"directory": "packages/extension-underline"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsup",
|
||||
"lint": "prettier ./src/ --check && eslint --cache --quiet --no-error-on-unmatched-pattern ./src/"
|
||||
}
|
||||
}
|
||||
5
node_modules/@tiptap/extension-underline/src/index.ts
generated
vendored
Normal file
5
node_modules/@tiptap/extension-underline/src/index.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Underline } from './underline.js'
|
||||
|
||||
export * from './underline.js'
|
||||
|
||||
export default Underline
|
||||
123
node_modules/@tiptap/extension-underline/src/underline.ts
generated
vendored
Normal file
123
node_modules/@tiptap/extension-underline/src/underline.ts
generated
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
import { Mark, mergeAttributes } from '@tiptap/core'
|
||||
|
||||
export interface UnderlineOptions {
|
||||
/**
|
||||
* HTML attributes to add to the underline element.
|
||||
* @default {}
|
||||
* @example { class: 'foo' }
|
||||
*/
|
||||
HTMLAttributes: Record<string, any>
|
||||
}
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
underline: {
|
||||
/**
|
||||
* Set an underline mark
|
||||
* @example editor.commands.setUnderline()
|
||||
*/
|
||||
setUnderline: () => ReturnType
|
||||
/**
|
||||
* Toggle an underline mark
|
||||
* @example editor.commands.toggleUnderline()
|
||||
*/
|
||||
toggleUnderline: () => ReturnType
|
||||
/**
|
||||
* Unset an underline mark
|
||||
* @example editor.commands.unsetUnderline()
|
||||
*/
|
||||
unsetUnderline: () => ReturnType
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This extension allows you to create underline text.
|
||||
* @see https://www.tiptap.dev/api/marks/underline
|
||||
*/
|
||||
export const Underline = Mark.create<UnderlineOptions>({
|
||||
name: 'underline',
|
||||
|
||||
addOptions() {
|
||||
return {
|
||||
HTMLAttributes: {},
|
||||
}
|
||||
},
|
||||
|
||||
parseHTML() {
|
||||
return [
|
||||
{
|
||||
tag: 'u',
|
||||
},
|
||||
{
|
||||
style: 'text-decoration',
|
||||
consuming: false,
|
||||
getAttrs: style => ((style as string).includes('underline') ? {} : false),
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
renderHTML({ HTMLAttributes }) {
|
||||
return ['u', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]
|
||||
},
|
||||
|
||||
parseMarkdown(token, helpers) {
|
||||
return helpers.applyMark(this.name || 'underline', helpers.parseInline(token.tokens || []))
|
||||
},
|
||||
|
||||
renderMarkdown(node, helpers) {
|
||||
return `++${helpers.renderChildren(node)}++`
|
||||
},
|
||||
|
||||
markdownTokenizer: {
|
||||
name: 'underline',
|
||||
level: 'inline',
|
||||
start(src) {
|
||||
return src.indexOf('++')
|
||||
},
|
||||
tokenize(src, _tokens, lexer) {
|
||||
const rule = /^(\+\+)([\s\S]+?)(\+\+)/
|
||||
const match = rule.exec(src)
|
||||
|
||||
if (!match) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
const innerContent = match[2].trim()
|
||||
|
||||
return {
|
||||
type: 'underline',
|
||||
raw: match[0],
|
||||
text: innerContent,
|
||||
tokens: lexer.inlineTokens(innerContent),
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
addCommands() {
|
||||
return {
|
||||
setUnderline:
|
||||
() =>
|
||||
({ commands }) => {
|
||||
return commands.setMark(this.name)
|
||||
},
|
||||
toggleUnderline:
|
||||
() =>
|
||||
({ commands }) => {
|
||||
return commands.toggleMark(this.name)
|
||||
},
|
||||
unsetUnderline:
|
||||
() =>
|
||||
({ commands }) => {
|
||||
return commands.unsetMark(this.name)
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
addKeyboardShortcuts() {
|
||||
return {
|
||||
'Mod-u': () => this.editor.commands.toggleUnderline(),
|
||||
'Mod-U': () => this.editor.commands.toggleUnderline(),
|
||||
}
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user