@atlaskit/editor-plugin-show-diff 8.3.4 → 8.3.6
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 +13 -0
- package/afm-cc/tsconfig.json +0 -1
- package/afm-products/tsconfig.json +0 -1
- package/dist/cjs/pm-plugins/calculateDiff/diffBySteps.js +7 -1
- package/dist/es2019/pm-plugins/calculateDiff/diffBySteps.js +7 -1
- package/dist/esm/pm-plugins/calculateDiff/diffBySteps.js +7 -1
- package/package.json +5 -5
- package/afm-jira/tsconfig.json +0 -49
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-show-diff
|
|
2
2
|
|
|
3
|
+
## 8.3.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 8.3.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`d672ff18b0e43`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d672ff18b0e43) -
|
|
14
|
+
Use post-step doc to simplify changes.
|
|
15
|
+
|
|
3
16
|
## 8.3.4
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -133,7 +133,13 @@ var diffBySteps = exports.diffBySteps = function diffBySteps(originalDoc, steps)
|
|
|
133
133
|
var toB = mapPosition(afterStepToFinal, toAfterStep);
|
|
134
134
|
if (isReplaceStepForTextBlockNode(rangedStep.step, rangedStep.before, rangedStep.from, rangedStep.to)) {
|
|
135
135
|
var granularStepChanges = _prosemirrorChangeset.ChangeSet.create(rangedStep.before).addSteps(rangedStep.doc, [rangedStep.stepMap], null);
|
|
136
|
-
|
|
136
|
+
|
|
137
|
+
// `simplifyChanges` reads text using `Change.fromB`/`toB`, which are
|
|
138
|
+
// positions in the post-step doc (the "B" doc). Passing the pre-step
|
|
139
|
+
// doc (`startDoc`) misreads characters and produces mid-word cuts
|
|
140
|
+
// (e.g. "deep-s|ea") because word-boundary detection runs against the
|
|
141
|
+
// wrong text/positions. Use the post-step doc here.
|
|
142
|
+
var optimizedGranularStepChanges = (0, _optimizeChanges.optimizeChanges)((0, _prosemirrorChangeset.simplifyChanges)(granularStepChanges.changes, rangedStep.doc));
|
|
137
143
|
var _iterator3 = _createForOfIteratorHelper(optimizedGranularStepChanges),
|
|
138
144
|
_step3;
|
|
139
145
|
try {
|
|
@@ -98,7 +98,13 @@ export const diffBySteps = (originalDoc, steps) => {
|
|
|
98
98
|
const toB = mapPosition(afterStepToFinal, toAfterStep);
|
|
99
99
|
if (isReplaceStepForTextBlockNode(rangedStep.step, rangedStep.before, rangedStep.from, rangedStep.to)) {
|
|
100
100
|
const granularStepChanges = ChangeSet.create(rangedStep.before).addSteps(rangedStep.doc, [rangedStep.stepMap], null);
|
|
101
|
-
|
|
101
|
+
|
|
102
|
+
// `simplifyChanges` reads text using `Change.fromB`/`toB`, which are
|
|
103
|
+
// positions in the post-step doc (the "B" doc). Passing the pre-step
|
|
104
|
+
// doc (`startDoc`) misreads characters and produces mid-word cuts
|
|
105
|
+
// (e.g. "deep-s|ea") because word-boundary detection runs against the
|
|
106
|
+
// wrong text/positions. Use the post-step doc here.
|
|
107
|
+
const optimizedGranularStepChanges = optimizeChanges(simplifyChanges(granularStepChanges.changes, rangedStep.doc));
|
|
102
108
|
for (const granularChange of optimizedGranularStepChanges) {
|
|
103
109
|
const granularFromA = mapPosition(beforeStepToOriginal, granularChange.fromA);
|
|
104
110
|
const granularToA = mapPosition(beforeStepToOriginal, granularChange.toA);
|
|
@@ -126,7 +126,13 @@ export var diffBySteps = function diffBySteps(originalDoc, steps) {
|
|
|
126
126
|
var toB = mapPosition(afterStepToFinal, toAfterStep);
|
|
127
127
|
if (isReplaceStepForTextBlockNode(rangedStep.step, rangedStep.before, rangedStep.from, rangedStep.to)) {
|
|
128
128
|
var granularStepChanges = ChangeSet.create(rangedStep.before).addSteps(rangedStep.doc, [rangedStep.stepMap], null);
|
|
129
|
-
|
|
129
|
+
|
|
130
|
+
// `simplifyChanges` reads text using `Change.fromB`/`toB`, which are
|
|
131
|
+
// positions in the post-step doc (the "B" doc). Passing the pre-step
|
|
132
|
+
// doc (`startDoc`) misreads characters and produces mid-word cuts
|
|
133
|
+
// (e.g. "deep-s|ea") because word-boundary detection runs against the
|
|
134
|
+
// wrong text/positions. Use the post-step doc here.
|
|
135
|
+
var optimizedGranularStepChanges = optimizeChanges(simplifyChanges(granularStepChanges.changes, rangedStep.doc));
|
|
130
136
|
var _iterator3 = _createForOfIteratorHelper(optimizedGranularStepChanges),
|
|
131
137
|
_step3;
|
|
132
138
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-show-diff",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.6",
|
|
4
4
|
"description": "ShowDiff plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"atlaskit:src": "src/index.ts",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@atlaskit/adf-schema": "^52.
|
|
31
|
+
"@atlaskit/adf-schema": "^52.10.0",
|
|
32
32
|
"@atlaskit/custom-steps": "^0.16.0",
|
|
33
33
|
"@atlaskit/editor-plugin-analytics": "^10.0.0",
|
|
34
34
|
"@atlaskit/editor-plugin-expand": "^11.1.0",
|
|
35
35
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
36
36
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
37
37
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
38
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
38
|
+
"@atlaskit/tmp-editor-statsig": "^78.0.0",
|
|
39
39
|
"@atlaskit/tokens": "^13.0.0",
|
|
40
40
|
"@babel/runtime": "^7.0.0",
|
|
41
41
|
"lodash": "^4.17.21",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/adf-utils": "^19.29.0",
|
|
47
47
|
"@atlaskit/button": "^23.11.0",
|
|
48
48
|
"@atlaskit/css": "^0.19.0",
|
|
49
|
-
"@atlaskit/editor-core": "^219.
|
|
49
|
+
"@atlaskit/editor-core": "^219.5.0",
|
|
50
50
|
"@atlaskit/editor-json-transformer": "^8.31.0",
|
|
51
51
|
"@atlaskit/form": "^15.5.0",
|
|
52
52
|
"@atlaskit/primitives": "^19.0.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"react-intl": "^6.6.2"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@atlaskit/editor-common": "^114.
|
|
61
|
+
"@atlaskit/editor-common": "^114.26.0",
|
|
62
62
|
"react": "^18.2.0"
|
|
63
63
|
},
|
|
64
64
|
"techstack": {
|
package/afm-jira/tsconfig.json
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../../tsconfig.local-consumption.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "es5",
|
|
5
|
-
"outDir": "../../../../../jira/tsDist/@atlaskit__editor-plugin-show-diff/app",
|
|
6
|
-
"rootDir": "../",
|
|
7
|
-
"composite": true,
|
|
8
|
-
"noCheck": true
|
|
9
|
-
},
|
|
10
|
-
"include": [
|
|
11
|
-
"../src/**/*.ts",
|
|
12
|
-
"../src/**/*.tsx"
|
|
13
|
-
],
|
|
14
|
-
"exclude": [
|
|
15
|
-
"../src/**/__tests__/*",
|
|
16
|
-
"../src/**/*.test.*",
|
|
17
|
-
"../src/**/test.*",
|
|
18
|
-
"../src/**/examples.*"
|
|
19
|
-
],
|
|
20
|
-
"references": [
|
|
21
|
-
{
|
|
22
|
-
"path": "../../adf-schema/afm-jira/tsconfig.json"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"path": "../../custom-steps/afm-jira/tsconfig.json"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"path": "../../editor-plugin-analytics/afm-jira/tsconfig.json"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"path": "../../editor-prosemirror/afm-jira/tsconfig.json"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"path": "../../editor-tables/afm-jira/tsconfig.json"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"path": "../../../platform/feature-flags/afm-jira/tsconfig.json"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"path": "../../tmp-editor-statsig/afm-jira/tsconfig.json"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"path": "../../../design-system/tokens/afm-jira/tsconfig.json"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"path": "../../editor-common/afm-jira/tsconfig.json"
|
|
47
|
-
}
|
|
48
|
-
]
|
|
49
|
-
}
|