@knotx/plugins-history 0.4.16 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -3
- package/dist/index.js +2 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
const core = require('@knotx/core');
|
|
4
4
|
const decorators = require('@knotx/decorators');
|
|
5
5
|
const rxjs = require('rxjs');
|
|
6
|
+
const operators = require('rxjs/operators');
|
|
6
7
|
|
|
7
8
|
var __create = Object.create;
|
|
8
9
|
var __defProp = Object.defineProperty;
|
|
@@ -112,13 +113,13 @@ class History extends (_a = core.BasePlugin, _canUndo_dec = [decorators.register
|
|
|
112
113
|
});
|
|
113
114
|
this.subscriptions.push(
|
|
114
115
|
this.operations$.pipe(
|
|
115
|
-
|
|
116
|
+
operators.tap(([tag, operation]) => {
|
|
116
117
|
if (!this.operationBuffer[tag]) {
|
|
117
118
|
this.operationBuffer[tag] = [];
|
|
118
119
|
}
|
|
119
120
|
this.operationBuffer[tag].push(operation);
|
|
120
121
|
}),
|
|
121
|
-
|
|
122
|
+
operators.debounceTime(debounceTimeConfig)
|
|
122
123
|
).subscribe(() => {
|
|
123
124
|
this.flushOperationBuffer();
|
|
124
125
|
})
|
|
@@ -131,7 +132,7 @@ class History extends (_a = core.BasePlugin, _canUndo_dec = [decorators.register
|
|
|
131
132
|
addOperationPipe(dataManager) {
|
|
132
133
|
this.subscriptions.push(dataManager.addDataOperationPipe({
|
|
133
134
|
preOperation: () => rxjs.pipe(
|
|
134
|
-
|
|
135
|
+
operators.tap((operation) => {
|
|
135
136
|
if (core.isDraftOperation(operation) || core.isInitOperation(operation)) {
|
|
136
137
|
return;
|
|
137
138
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isDraftOperation, isInitOperation, isEmptyBatchOperation, flattenOperations, BasePlugin } from '@knotx/core';
|
|
2
2
|
import { register, inject, OnInit, OnDestroy } from '@knotx/decorators';
|
|
3
|
-
import { Subject,
|
|
3
|
+
import { Subject, pipe } from 'rxjs';
|
|
4
|
+
import { tap, debounceTime } from 'rxjs/operators';
|
|
4
5
|
|
|
5
6
|
var __create = Object.create;
|
|
6
7
|
var __defProp = Object.defineProperty;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knotx/plugins-history",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "History Plugin for Knotx",
|
|
5
5
|
"author": "boenfu",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"rxjs": "^7.8.1",
|
|
32
|
-
"@knotx/core": "0.
|
|
33
|
-
"@knotx/decorators": "0.
|
|
32
|
+
"@knotx/core": "0.5.1",
|
|
33
|
+
"@knotx/decorators": "0.5.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@knotx/build-config": "0.
|
|
37
|
-
"@knotx/eslint-config": "0.
|
|
38
|
-
"@knotx/typescript-config": "0.
|
|
36
|
+
"@knotx/build-config": "0.5.1",
|
|
37
|
+
"@knotx/eslint-config": "0.5.1",
|
|
38
|
+
"@knotx/typescript-config": "0.5.1"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "unbuild",
|