@textbus/collaborate 3.0.0-alpha.62 → 3.0.0-alpha.63

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,7 +19,8 @@ interface UpdateItem {
19
19
  action(): void;
20
20
  }
21
21
  export declare abstract class CustomUndoManagerConfig {
22
- abstract deleteFilter(item: Item): boolean;
22
+ abstract captureTransaction?(arg0: Transaction): boolean;
23
+ abstract deleteFilter?(arg0: Item): boolean;
23
24
  }
24
25
  export declare class Collaborate implements History {
25
26
  protected stackSize: number;
@@ -120,11 +120,18 @@ let Collaborate = class Collaborate {
120
120
  listen() {
121
121
  const root = this.yDoc.getMap('RootComponent');
122
122
  const rootComponent = this.rootComponentRef.component;
123
+ const undoManagerConfig = this.undoManagerConfig || {};
123
124
  const manager = new UndoManager(root, {
124
125
  trackedOrigins: new Set([this.yDoc]),
125
- deleteFilter: (item) => {
126
- if (this.undoManagerConfig) {
127
- return this.undoManagerConfig.deleteFilter(item);
126
+ captureTransaction(arg) {
127
+ if (undoManagerConfig.captureTransaction) {
128
+ return undoManagerConfig.captureTransaction(arg);
129
+ }
130
+ return true;
131
+ },
132
+ deleteFilter(item) {
133
+ if (undoManagerConfig.deleteFilter) {
134
+ return undoManagerConfig.deleteFilter(item);
128
135
  }
129
136
  return true;
130
137
  }
package/bundles/index.js CHANGED
@@ -122,11 +122,18 @@ exports.Collaborate = class Collaborate {
122
122
  listen() {
123
123
  const root = this.yDoc.getMap('RootComponent');
124
124
  const rootComponent = this.rootComponentRef.component;
125
+ const undoManagerConfig = this.undoManagerConfig || {};
125
126
  const manager = new yjs.UndoManager(root, {
126
127
  trackedOrigins: new Set([this.yDoc]),
127
- deleteFilter: (item) => {
128
- if (this.undoManagerConfig) {
129
- return this.undoManagerConfig.deleteFilter(item);
128
+ captureTransaction(arg) {
129
+ if (undoManagerConfig.captureTransaction) {
130
+ return undoManagerConfig.captureTransaction(arg);
131
+ }
132
+ return true;
133
+ },
134
+ deleteFilter(item) {
135
+ if (undoManagerConfig.deleteFilter) {
136
+ return undoManagerConfig.deleteFilter(item);
130
137
  }
131
138
  return true;
132
139
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/collaborate",
3
- "version": "3.0.0-alpha.62",
3
+ "version": "3.0.0-alpha.63",
4
4
  "description": "Textbus is a rich text editor and framework that is highly customizable and extensible to achieve rich wysiwyg effects.",
5
5
  "main": "./bundles/index.js",
6
6
  "module": "./bundles/index.esm.js",
@@ -27,7 +27,7 @@
27
27
  "dependencies": {
28
28
  "@tanbo/di": "^1.1.4",
29
29
  "@tanbo/stream": "^1.1.9",
30
- "@textbus/core": "^3.0.0-alpha.61",
30
+ "@textbus/core": "^3.0.0-alpha.63",
31
31
  "reflect-metadata": "^0.1.13",
32
32
  "y-protocols": "^1.0.5",
33
33
  "yjs": "^13.5.39"
@@ -50,5 +50,5 @@
50
50
  "bugs": {
51
51
  "url": "https://github.com/textbus/textbus.git/issues"
52
52
  },
53
- "gitHead": "19e52671c05d0701d3c748452bcb7bbede65ac81"
53
+ "gitHead": "9c0f1a319c7bd73094c8b670af401f3da06533f1"
54
54
  }