fix: resolve TypeScript errors in frontend build

This commit is contained in:
Hiro
2026-03-30 23:16:07 +00:00
parent b733306773
commit 24925e1acb
2941 changed files with 418042 additions and 49 deletions

163
node_modules/@tiptap/extension-bold/src/bold.tsx generated vendored Normal file
View File

@@ -0,0 +1,163 @@
/** @jsxImportSource @tiptap/core */
import { Mark, markInputRule, markPasteRule, mergeAttributes } from '@tiptap/core'
export interface BoldOptions {
/**
* HTML attributes to add to the bold element.
* @default {}
* @example { class: 'foo' }
*/
HTMLAttributes: Record<string, any>
}
declare module '@tiptap/core' {
interface Commands<ReturnType> {
bold: {
/**
* Set a bold mark
*/
setBold: () => ReturnType
/**
* Toggle a bold mark
*/
toggleBold: () => ReturnType
/**
* Unset a bold mark
*/
unsetBold: () => ReturnType
}
}
}
/**
* Matches bold text via `**` as input.
*/
export const starInputRegex = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/
/**
* Matches bold text via `**` while pasting.
*/
export const starPasteRegex = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g
/**
* Matches bold text via `__` as input.
*/
export const underscoreInputRegex = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/
/**
* Matches bold text via `__` while pasting.
*/
export const underscorePasteRegex = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g
/**
* This extension allows you to mark text as bold.
* @see https://tiptap.dev/api/marks/bold
*/
export const Bold = Mark.create<BoldOptions>({
name: 'bold',
addOptions() {
return {
HTMLAttributes: {},
}
},
parseHTML() {
return [
{
tag: 'strong',
},
{
tag: 'b',
getAttrs: node => (node as HTMLElement).style.fontWeight !== 'normal' && null,
},
{
style: 'font-weight=400',
clearMark: mark => mark.type.name === this.name,
},
{
style: 'font-weight',
getAttrs: value => /^(bold(er)?|[5-9]\d{2,})$/.test(value as string) && null,
},
]
},
renderHTML({ HTMLAttributes }) {
return (
<strong {...mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)}>
<slot />
</strong>
)
},
markdownTokenName: 'strong',
parseMarkdown: (token, helpers) => {
// Convert 'strong' token to bold mark
return helpers.applyMark('bold', helpers.parseInline(token.tokens || []))
},
markdownOptions: {
htmlReopen: {
open: '<strong>',
close: '</strong>',
},
},
renderMarkdown: (node, h) => {
return `**${h.renderChildren(node)}**`
},
addCommands() {
return {
setBold:
() =>
({ commands }) => {
return commands.setMark(this.name)
},
toggleBold:
() =>
({ commands }) => {
return commands.toggleMark(this.name)
},
unsetBold:
() =>
({ commands }) => {
return commands.unsetMark(this.name)
},
}
},
addKeyboardShortcuts() {
return {
'Mod-b': () => this.editor.commands.toggleBold(),
'Mod-B': () => this.editor.commands.toggleBold(),
}
},
addInputRules() {
return [
markInputRule({
find: starInputRegex,
type: this.type,
}),
markInputRule({
find: underscoreInputRegex,
type: this.type,
}),
]
},
addPasteRules() {
return [
markPasteRule({
find: starPasteRegex,
type: this.type,
}),
markPasteRule({
find: underscorePasteRegex,
type: this.type,
}),
]
},
})

5
node_modules/@tiptap/extension-bold/src/index.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import { Bold } from './bold.jsx'
export * from './bold.jsx'
export default Bold