@singapore-editor/file-animation
v0.2.16
Published
Text reveal animations for documents opened in the Singapore editor.
Maintainers
Readme
@singapore-editor/file-animation
File transition and file edit animations for the Singapore editor.
Part of Singapore. A code editor for the browser that keeps every version.
Install
Not on npm yet. Build it from source with the development guide.
Usage
import { Editor } from '@singapore-editor/core/editor'
import {
createFileEditAnimationPlugin,
createFileTransitionPlugin,
} from '@singapore-editor/file-animation'
const editor = new Editor(document.querySelector<HTMLElement>('#editor')!, {
plugins: [createFileTransitionPlugin(), createFileEditAnimationPlugin()],
})
editor.openDocument({
documentId: 'example.ts',
text: 'const value = 1;\n',
languageId: 'typescript',
})API highlights
createFileTransitionPlugin()animates a file as it opens. Themodeoption picksautoregressive(the default),parallel,token,diffusion, ormagicMove, which slides the text two files share from the previous file to the new one.createFileEditAnimationPlugin()animates every edit except typing.
In the Singapore family
@singapore-editor/core owns the editor view. Add these plugins to animate opened files and edits.
Singapore README · Documentation
License
MIT. License
