UNPKG

@dialpad/dialtone

Version:

Dialpad's Dialtone design system monorepo

46 lines (45 loc) 1.1 kB
"use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); const Mention = require("@tiptap/extension-mention"); const core = require("@tiptap/core"); const vue3 = require("@tiptap/vue-3"); const state = require("@tiptap/pm/state"); const MentionComponent = require("./MentionComponent.vue.cjs"); const MentionPlugin = Mention.extend({ addNodeView() { return vue3.VueNodeViewRenderer(MentionComponent.default); }, parseHTML() { return [ { tag: "mention-component" } ]; }, addAttributes() { return { name: { default: "" }, avatarSrc: { default: "" }, id: { default: "" } }; }, renderText({ node }) { return `@${node.attrs.id}`; }, renderHTML({ HTMLAttributes }) { return ["mention-component", core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)]; } }).configure({ suggestion: { char: "@", pluginKey: new state.PluginKey("mentionSuggestion") } }); exports.MentionPlugin = MentionPlugin; //# sourceMappingURL=mention.cjs.map