Sha256: 5148b271097d767e9c6eb32b02523d96d9897a7e6f292f05760a6eeb200320a8
Contents?: true
Size: 674 Bytes
Versions: 15
Compression:
Stored size: 674 Bytes
Contents
import { Extension } from "@tiptap/core"; import { Plugin, PluginKey } from "prosemirror-state"; export default Extension.create({ name: "dialog", addStorage() { return { open: false }; }, addCommands() { return { isDialogOpen: () => () => this.storage.open, toggleDialog: (open) => () => (this.storage.open = open) }; }, addProseMirrorPlugins() { return [ new Plugin({ key: new PluginKey("editable"), props: { attributes: () => { if (this.storage.open) { return { class: "dialog-open" }; } return {}; } } }) ] } });
Version data entries
15 entries across 15 versions & 1 rubygems