track-change-extension

A track change extension for tiptap editor. Just like the Office Word Revision.
46,787 168
Install
npm install track-change-extension
Latest Version:1.0.3
License:MIT
Last Updated:Aug 30, 2023
Links: GitHub  ·  npm
Maintainer: raychen

TrackChangeExtension

A Track Change Extension for Tiptap. Like the revision in Microsoft Office Word.

Demo

Visit Demo

The demo is deployed on render.com. You maybe need a VPN if you are in china

Installation

just copy the ts file to your project or install from npm. it depends on the @tiptap/pm package to use ProseMirror api.

Usage in Vue3


import TrackChangeExtension from 'index.ts'
or
import TrackChangeExtension from 'track-change-extension'

const myTrackChangeEnabled = ref(false)

extensions: [
  ...OtherTiptapExtensions,
  TrackChangeExtension.configure({
    enabled: true,
    dataOpUserId: '', // set the op userId
    dataOpUserNickname: '', // set the op user nickname
    onStatusChange (status: boolean) {
      myTrackChangeEnabled = status
    }
  }),
]

// commands

// accept one change near by the cursor or an active selection range
editor.commands.acceptChange()
editor.commands.acceptAllChange()
editor.commands.rejectChange()
editor.commands.rejectAllChange()
editor.commands.updateOpUserOption('id', 'nickname')

style

insertion {
  color: green;
  text-decoration: underline;
}
deletion {
  color: red;
  text-decoration: line-through;
}
Enjoy it...

publish

npm run build

npm publish --registry=https://registry.npmjs.org

Related Packages

@tiptap/vue-3

Vue components for tiptap

50,457,369 38,881
@tiptap/extension-drag-handle-vue-3

drag handle extension for tiptap with vue 3

13,972,625 38,881
@tiptap/vue-2

Vue components for tiptap

4,280,234 38,877
@tiptap/extension-drag-handle-vue-2

drag handle extension for tiptap with vue 2

32,701 38,818
vue-tiptap-editor

A Vue Editor Component based on Tiptap

591

Version History

Version Released License
1.0.3 MIT
1.0.2 MIT
1.0.1 MIT
1.0.0