REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.36 KB
Close
/home/byroehnu/easepaybiz.easetack.com/node_modules/@tiptap/core/src/pasteRules/nodePasteRule.ts
Text
Base64
import { NodeType } from '@tiptap/pm/model' import { PasteRule, PasteRuleFinder } from '../PasteRule.js' import { ExtendedRegExpMatchArray, JSONContent } from '../types.js' import { callOrReturn } from '../utilities/index.js' /** * Build an paste rule that adds a node when the * matched text is pasted into it. * @see https://tiptap.dev/docs/editor/extensions/custom-extensions/extend-existing#paste-rules */ export function nodePasteRule(config: { find: PasteRuleFinder type: NodeType getAttributes?: | Record<string, any> | ((match: ExtendedRegExpMatchArray, event: ClipboardEvent) => Record<string, any>) | false | null getContent?: | JSONContent[] | ((attrs: Record<string, any>) => JSONContent[]) | false | null }) { return new PasteRule({ find: config.find, handler({ match, chain, range, pasteEvent, }) { const attributes = callOrReturn(config.getAttributes, undefined, match, pasteEvent) const content = callOrReturn(config.getContent, undefined, attributes) if (attributes === false || attributes === null) { return null } const node = { type: config.type.name, attrs: attributes } as JSONContent if (content) { node.content = content } if (match.input) { chain().deleteRange(range).insertContentAt(range.from, node) } }, }) }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 5
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
.htaccess
127 B
lr--r--r--
2026-03-14 01:49:07
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.ts
105 B
lrw-r--r--
2026-03-05 00:20:23
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
markPasteRule.ts
2.13 KB
lrw-r--r--
2026-03-05 00:20:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
nodePasteRule.ts
1.36 KB
lrw-r--r--
2026-03-05 00:20:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
textPasteRule.ts
916 B
lrw-r--r--
2026-03-05 00:20:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).