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

View File

@@ -0,0 +1,83 @@
// src/blockquote.tsx
import { mergeAttributes, Node, wrappingInputRule } from "@tiptap/core";
import { jsx } from "@tiptap/core/jsx-runtime";
var inputRegex = /^\s*>\s$/;
var Blockquote = Node.create({
name: "blockquote",
addOptions() {
return {
HTMLAttributes: {}
};
},
content: "block+",
group: "block",
defining: true,
parseHTML() {
return [{ tag: "blockquote" }];
},
renderHTML({ HTMLAttributes }) {
return /* @__PURE__ */ jsx("blockquote", { ...mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), children: /* @__PURE__ */ jsx("slot", {}) });
},
parseMarkdown: (token, helpers) => {
var _a;
const parseBlockChildren = (_a = helpers.parseBlockChildren) != null ? _a : helpers.parseChildren;
return helpers.createNode("blockquote", void 0, parseBlockChildren(token.tokens || []));
},
renderMarkdown: (node, h) => {
if (!node.content) {
return "";
}
const prefix = ">";
const result = [];
node.content.forEach((child, index) => {
var _a, _b;
const childContent = (_b = (_a = h.renderChild) == null ? void 0 : _a.call(h, child, index)) != null ? _b : h.renderChildren([child]);
const lines = childContent.split("\n");
const linesWithPrefix = lines.map((line) => {
if (line.trim() === "") {
return prefix;
}
return `${prefix} ${line}`;
});
result.push(linesWithPrefix.join("\n"));
});
return result.join(`
${prefix}
`);
},
addCommands() {
return {
setBlockquote: () => ({ commands }) => {
return commands.wrapIn(this.name);
},
toggleBlockquote: () => ({ commands }) => {
return commands.toggleWrap(this.name);
},
unsetBlockquote: () => ({ commands }) => {
return commands.lift(this.name);
}
};
},
addKeyboardShortcuts() {
return {
"Mod-Shift-b": () => this.editor.commands.toggleBlockquote()
};
},
addInputRules() {
return [
wrappingInputRule({
find: inputRegex,
type: this.type
})
];
}
});
// src/index.ts
var index_default = Blockquote;
export {
Blockquote,
index_default as default,
inputRegex
};
//# sourceMappingURL=index.js.map