@atlaskit/editor-plugin-show-diff 5.0.6 → 5.0.7
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/CHANGELOG.md +8 -0
- package/dist/cjs/pm-plugins/decorations/createNodeChangedDecorationWidget.js +0 -4
- package/dist/cjs/pm-plugins/simplifyChanges.js +3 -4
- package/dist/es2019/pm-plugins/decorations/createNodeChangedDecorationWidget.js +0 -4
- package/dist/es2019/pm-plugins/simplifyChanges.js +3 -4
- package/dist/esm/pm-plugins/decorations/createNodeChangedDecorationWidget.js +0 -4
- package/dist/esm/pm-plugins/simplifyChanges.js +3 -4
- package/package.json +4 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-show-diff
|
|
2
2
|
|
|
3
|
+
## 5.0.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1fd2b267eb592`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1fd2b267eb592) -
|
|
8
|
+
Cleanup `platform_editor_ai_aifc_patch_ga` flag
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 5.0.6
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.createNodeChangedDecorationWidget = void 0;
|
|
7
7
|
var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
|
|
8
8
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
9
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
9
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
11
10
|
var _standard = require("./colorSchemes/standard");
|
|
12
11
|
var _traditional = require("./colorSchemes/traditional");
|
|
@@ -75,9 +74,6 @@ var createNodeChangedDecorationWidget = exports.createNodeChangedDecorationWidge
|
|
|
75
74
|
return;
|
|
76
75
|
}
|
|
77
76
|
if (isTableRowContent) {
|
|
78
|
-
if (!(0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_ga')) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
77
|
return (0, _createChangedRowDecorationWidgets.createChangedRowDecorationWidgets)({
|
|
82
78
|
changes: [change],
|
|
83
79
|
originalDoc: doc,
|
|
@@ -7,7 +7,6 @@ exports.simplifySteps = simplifySteps;
|
|
|
7
7
|
var _steps = require("@atlaskit/adf-schema/steps");
|
|
8
8
|
var _document = require("@atlaskit/editor-common/utils/document");
|
|
9
9
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
10
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
10
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
12
11
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
13
12
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -33,7 +32,7 @@ function mergeReplaceSteps(step1, step2) {
|
|
|
33
32
|
|
|
34
33
|
// Simplifies the steps to improve performance and reduce fragmentation in diffs
|
|
35
34
|
function simplifySteps(steps, originalDoc) {
|
|
36
|
-
var stepsToFilter =
|
|
35
|
+
var stepsToFilter = removeUnusedSteps(steps, originalDoc);
|
|
37
36
|
return stepsToFilter
|
|
38
37
|
// Remove steps that don't affect document structure or content
|
|
39
38
|
.filter(function (step) {
|
|
@@ -41,9 +40,9 @@ function simplifySteps(steps, originalDoc) {
|
|
|
41
40
|
})
|
|
42
41
|
// Merge consecutive steps where possible
|
|
43
42
|
.reduce(function (acc, step) {
|
|
44
|
-
var _lastStep$merge, _lastStep$merge2
|
|
43
|
+
var _lastStep$merge, _lastStep$merge2;
|
|
45
44
|
var lastStep = acc[acc.length - 1];
|
|
46
|
-
var merged = (
|
|
45
|
+
var merged = (_lastStep$merge = lastStep === null || lastStep === void 0 || (_lastStep$merge2 = lastStep.merge) === null || _lastStep$merge2 === void 0 ? void 0 : _lastStep$merge2.call(lastStep, step)) !== null && _lastStep$merge !== void 0 ? _lastStep$merge : mergeReplaceSteps(lastStep, step);
|
|
47
46
|
if (merged) {
|
|
48
47
|
acc[acc.length - 1] = merged;
|
|
49
48
|
} else {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
2
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
4
|
import { deletedContentStyle, deletedContentStyleActive, deletedContentStyleNew, deletedContentStyleNewActive, deletedContentStyleUnbounded } from './colorSchemes/standard';
|
|
6
5
|
import { deletedTraditionalContentStyle, deletedTraditionalContentStyleUnbounded } from './colorSchemes/traditional';
|
|
@@ -57,9 +56,6 @@ export const createNodeChangedDecorationWidget = ({
|
|
|
57
56
|
return;
|
|
58
57
|
}
|
|
59
58
|
if (isTableRowContent) {
|
|
60
|
-
if (!fg('platform_editor_ai_aifc_patch_ga')) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
59
|
return createChangedRowDecorationWidgets({
|
|
64
60
|
changes: [change],
|
|
65
61
|
originalDoc: doc,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
|
|
2
2
|
import { areNodesEqualIgnoreAttrs } from '@atlaskit/editor-common/utils/document';
|
|
3
3
|
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* Attempts to merge two consecutive ReplaceStep operations.
|
|
@@ -25,15 +24,15 @@ function mergeReplaceSteps(step1, step2) {
|
|
|
25
24
|
|
|
26
25
|
// Simplifies the steps to improve performance and reduce fragmentation in diffs
|
|
27
26
|
export function simplifySteps(steps, originalDoc) {
|
|
28
|
-
const stepsToFilter =
|
|
27
|
+
const stepsToFilter = removeUnusedSteps(steps, originalDoc);
|
|
29
28
|
return stepsToFilter
|
|
30
29
|
// Remove steps that don't affect document structure or content
|
|
31
30
|
.filter(step => !(step instanceof AnalyticsStep))
|
|
32
31
|
// Merge consecutive steps where possible
|
|
33
32
|
.reduce((acc, step) => {
|
|
34
|
-
var _lastStep$merge, _lastStep$merge2
|
|
33
|
+
var _lastStep$merge, _lastStep$merge2;
|
|
35
34
|
const lastStep = acc[acc.length - 1];
|
|
36
|
-
const merged =
|
|
35
|
+
const merged = (_lastStep$merge = lastStep === null || lastStep === void 0 ? void 0 : (_lastStep$merge2 = lastStep.merge) === null || _lastStep$merge2 === void 0 ? void 0 : _lastStep$merge2.call(lastStep, step)) !== null && _lastStep$merge !== void 0 ? _lastStep$merge : mergeReplaceSteps(lastStep, step);
|
|
37
36
|
if (merged) {
|
|
38
37
|
acc[acc.length - 1] = merged;
|
|
39
38
|
} else {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
2
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
4
|
import { deletedContentStyle, deletedContentStyleActive, deletedContentStyleNew, deletedContentStyleNewActive, deletedContentStyleUnbounded } from './colorSchemes/standard';
|
|
6
5
|
import { deletedTraditionalContentStyle, deletedTraditionalContentStyleUnbounded } from './colorSchemes/traditional';
|
|
@@ -69,9 +68,6 @@ export var createNodeChangedDecorationWidget = function createNodeChangedDecorat
|
|
|
69
68
|
return;
|
|
70
69
|
}
|
|
71
70
|
if (isTableRowContent) {
|
|
72
|
-
if (!fg('platform_editor_ai_aifc_patch_ga')) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
71
|
return createChangedRowDecorationWidgets({
|
|
76
72
|
changes: [change],
|
|
77
73
|
originalDoc: doc,
|
|
@@ -4,7 +4,6 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
4
4
|
import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
|
|
5
5
|
import { areNodesEqualIgnoreAttrs } from '@atlaskit/editor-common/utils/document';
|
|
6
6
|
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Attempts to merge two consecutive ReplaceStep operations.
|
|
@@ -28,7 +27,7 @@ function mergeReplaceSteps(step1, step2) {
|
|
|
28
27
|
|
|
29
28
|
// Simplifies the steps to improve performance and reduce fragmentation in diffs
|
|
30
29
|
export function simplifySteps(steps, originalDoc) {
|
|
31
|
-
var stepsToFilter =
|
|
30
|
+
var stepsToFilter = removeUnusedSteps(steps, originalDoc);
|
|
32
31
|
return stepsToFilter
|
|
33
32
|
// Remove steps that don't affect document structure or content
|
|
34
33
|
.filter(function (step) {
|
|
@@ -36,9 +35,9 @@ export function simplifySteps(steps, originalDoc) {
|
|
|
36
35
|
})
|
|
37
36
|
// Merge consecutive steps where possible
|
|
38
37
|
.reduce(function (acc, step) {
|
|
39
|
-
var _lastStep$merge, _lastStep$merge2
|
|
38
|
+
var _lastStep$merge, _lastStep$merge2;
|
|
40
39
|
var lastStep = acc[acc.length - 1];
|
|
41
|
-
var merged =
|
|
40
|
+
var merged = (_lastStep$merge = lastStep === null || lastStep === void 0 || (_lastStep$merge2 = lastStep.merge) === null || _lastStep$merge2 === void 0 ? void 0 : _lastStep$merge2.call(lastStep, step)) !== null && _lastStep$merge !== void 0 ? _lastStep$merge : mergeReplaceSteps(lastStep, step);
|
|
42
41
|
if (merged) {
|
|
43
42
|
acc[acc.length - 1] = merged;
|
|
44
43
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-show-diff",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.7",
|
|
4
4
|
"description": "ShowDiff plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,15 +32,15 @@
|
|
|
32
32
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
33
33
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
34
34
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
35
|
-
"@atlaskit/tmp-editor-statsig": "^35.
|
|
36
|
-
"@atlaskit/tokens": "^11.
|
|
35
|
+
"@atlaskit/tmp-editor-statsig": "^35.5.0",
|
|
36
|
+
"@atlaskit/tokens": "^11.1.0",
|
|
37
37
|
"@babel/runtime": "^7.0.0",
|
|
38
38
|
"lodash": "^4.17.21",
|
|
39
39
|
"memoize-one": "^6.0.0",
|
|
40
40
|
"prosemirror-changeset": "^2.3.1"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@atlaskit/editor-common": "^111.
|
|
43
|
+
"@atlaskit/editor-common": "^111.32.0",
|
|
44
44
|
"react": "^18.2.0"
|
|
45
45
|
},
|
|
46
46
|
"techstack": {
|
|
@@ -80,9 +80,6 @@
|
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
"platform-feature-flags": {
|
|
83
|
-
"platform_editor_ai_aifc_patch_ga": {
|
|
84
|
-
"type": "boolean"
|
|
85
|
-
},
|
|
86
83
|
"platform_editor_show_diff_scroll_navigation": {
|
|
87
84
|
"type": "boolean"
|
|
88
85
|
},
|