json-joy
Version:
Collection of libraries for building collaborative editing apps.
20 lines (19 loc) • 512 B
JavaScript
import { MNEMONIC } from './constants';
import { ExtNode } from '../../json-crdt/extensions/ExtNode';
import { ExtensionId } from '../constants';
export class PeritextNode extends ExtNode {
text() {
return this.data.get(0);
}
slices() {
return this.data.get(1);
}
// ------------------------------------------------------------------ ExtNode
extId = ExtensionId.peritext;
name() {
return MNEMONIC;
}
view() {
return this.text().view();
}
}