@atlaskit/editor-plugin-show-diff 27.1.1 → 27.1.3
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 +14 -0
- package/dist/cjs/pm-plugins/calculateDiff/attrAwareTokenEncoder.js +1 -2
- package/dist/cjs/pm-plugins/decorations/utils/getAttrChangeRanges.js +1 -1
- package/dist/es2019/pm-plugins/calculateDiff/attrAwareTokenEncoder.js +1 -2
- package/dist/es2019/pm-plugins/decorations/utils/getAttrChangeRanges.js +1 -1
- package/dist/esm/pm-plugins/calculateDiff/attrAwareTokenEncoder.js +1 -2
- package/dist/esm/pm-plugins/decorations/utils/getAttrChangeRanges.js +1 -1
- package/package.json +6 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-show-diff
|
|
2
2
|
|
|
3
|
+
## 27.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`9c5e91484b1a4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9c5e91484b1a4) -
|
|
8
|
+
Clean up feature gate `platform_editor_normalize_excerpt_diff`
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 27.1.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 27.1.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.attrAwareTokenEncoder = void 0;
|
|
7
7
|
var _nodeTypeUtils = require("@atlaskit/editor-common/utils/node-type-utils");
|
|
8
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
9
8
|
var _diffableAttrs = require("../decorations/utils/diffableAttrs");
|
|
10
9
|
var _excerptIncludeAttrs = require("../decorations/utils/excerptIncludeAttrs");
|
|
11
10
|
var _encodeCharacterWithMarks = require("./encodeCharacterWithMarks");
|
|
@@ -36,7 +35,7 @@ var attrAwareTokenEncoder = exports.attrAwareTokenEncoder = {
|
|
|
36
35
|
encodeNodeStart: function encodeNodeStart(node) {
|
|
37
36
|
// A one-sided reference is not comparable from an isolated token. Attribute-step comparison
|
|
38
37
|
// checks the reference when both versions have one.
|
|
39
|
-
var attrs =
|
|
38
|
+
var attrs = node.type.name === 'extension' && (0, _excerptIncludeAttrs.isExcerptInclude)(node.attrs) ? (0, _excerptIncludeAttrs.getComparableExcerptIncludeAttrs)(node.attrs) : node.attrs;
|
|
40
39
|
// Normalise variants (e.g. `panel_c1` → `panel`) so `diffableAttrs` needs one entry.
|
|
41
40
|
var attrNames = (0, _diffableAttrs.getDiffableAttrNames)((0, _nodeTypeUtils.getBaseNodeTypeName)(node.type), attrs !== null && attrs !== void 0 ? attrs : {});
|
|
42
41
|
if (attrNames && attrNames.length > 0) {
|
|
@@ -53,7 +53,7 @@ var getComparableExtensionAttrs = function getComparableExtensionAttrs(node) {
|
|
|
53
53
|
return (0, _omit.default)(node.attrs, transientExtensionAttrPaths);
|
|
54
54
|
};
|
|
55
55
|
var haveSameRelevantExtensionAttrs = function haveSameRelevantExtensionAttrs(beforeNode, afterNode) {
|
|
56
|
-
if ((0,
|
|
56
|
+
if ((0, _excerptIncludeAttrs.isExcerptInclude)(beforeNode.attrs) && (0, _excerptIncludeAttrs.isExcerptInclude)(afterNode.attrs)) {
|
|
57
57
|
var beforeReference = (0, _excerptIncludeAttrs.getReferencedContentId)(beforeNode.attrs);
|
|
58
58
|
var afterReference = (0, _excerptIncludeAttrs.getReferencedContentId)(afterNode.attrs);
|
|
59
59
|
return (0, _isEqual.default)((0, _excerptIncludeAttrs.getComparableExcerptIncludeAttrs)(beforeNode.attrs), (0, _excerptIncludeAttrs.getComparableExcerptIncludeAttrs)(afterNode.attrs)) && (beforeReference === undefined || afterReference === undefined || beforeReference === afterReference);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getBaseNodeTypeName } from '@atlaskit/editor-common/utils/node-type-utils';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
3
2
|
import { getDiffableAttrNames } from '../decorations/utils/diffableAttrs';
|
|
4
3
|
import { getComparableExcerptIncludeAttrs, isExcerptInclude } from '../decorations/utils/excerptIncludeAttrs';
|
|
5
4
|
import { encodeCharacterWithMarks } from './encodeCharacterWithMarks';
|
|
@@ -29,7 +28,7 @@ export const attrAwareTokenEncoder = {
|
|
|
29
28
|
encodeNodeStart: node => {
|
|
30
29
|
// A one-sided reference is not comparable from an isolated token. Attribute-step comparison
|
|
31
30
|
// checks the reference when both versions have one.
|
|
32
|
-
const attrs =
|
|
31
|
+
const attrs = node.type.name === 'extension' && isExcerptInclude(node.attrs) ? getComparableExcerptIncludeAttrs(node.attrs) : node.attrs;
|
|
33
32
|
// Normalise variants (e.g. `panel_c1` → `panel`) so `diffableAttrs` needs one entry.
|
|
34
33
|
const attrNames = getDiffableAttrNames(getBaseNodeTypeName(node.type), attrs !== null && attrs !== void 0 ? attrs : {});
|
|
35
34
|
if (attrNames && attrNames.length > 0) {
|
|
@@ -37,7 +37,7 @@ const transientExtensionAttrPaths = ['localId', 'parameters.macroParams._parentI
|
|
|
37
37
|
*/
|
|
38
38
|
const getComparableExtensionAttrs = node => omit(node.attrs, transientExtensionAttrPaths);
|
|
39
39
|
const haveSameRelevantExtensionAttrs = (beforeNode, afterNode) => {
|
|
40
|
-
if (
|
|
40
|
+
if (isExcerptInclude(beforeNode.attrs) && isExcerptInclude(afterNode.attrs)) {
|
|
41
41
|
const beforeReference = getReferencedContentId(beforeNode.attrs);
|
|
42
42
|
const afterReference = getReferencedContentId(afterNode.attrs);
|
|
43
43
|
return isEqual(getComparableExcerptIncludeAttrs(beforeNode.attrs), getComparableExcerptIncludeAttrs(afterNode.attrs)) && (beforeReference === undefined || afterReference === undefined || beforeReference === afterReference);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getBaseNodeTypeName } from '@atlaskit/editor-common/utils/node-type-utils';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
3
2
|
import { getDiffableAttrNames } from '../decorations/utils/diffableAttrs';
|
|
4
3
|
import { getComparableExcerptIncludeAttrs, isExcerptInclude } from '../decorations/utils/excerptIncludeAttrs';
|
|
5
4
|
import { encodeCharacterWithMarks } from './encodeCharacterWithMarks';
|
|
@@ -31,7 +30,7 @@ export var attrAwareTokenEncoder = {
|
|
|
31
30
|
encodeNodeStart: function encodeNodeStart(node) {
|
|
32
31
|
// A one-sided reference is not comparable from an isolated token. Attribute-step comparison
|
|
33
32
|
// checks the reference when both versions have one.
|
|
34
|
-
var attrs =
|
|
33
|
+
var attrs = node.type.name === 'extension' && isExcerptInclude(node.attrs) ? getComparableExcerptIncludeAttrs(node.attrs) : node.attrs;
|
|
35
34
|
// Normalise variants (e.g. `panel_c1` → `panel`) so `diffableAttrs` needs one entry.
|
|
36
35
|
var attrNames = getDiffableAttrNames(getBaseNodeTypeName(node.type), attrs !== null && attrs !== void 0 ? attrs : {});
|
|
37
36
|
if (attrNames && attrNames.length > 0) {
|
|
@@ -46,7 +46,7 @@ var getComparableExtensionAttrs = function getComparableExtensionAttrs(node) {
|
|
|
46
46
|
return omit(node.attrs, transientExtensionAttrPaths);
|
|
47
47
|
};
|
|
48
48
|
var haveSameRelevantExtensionAttrs = function haveSameRelevantExtensionAttrs(beforeNode, afterNode) {
|
|
49
|
-
if (
|
|
49
|
+
if (isExcerptInclude(beforeNode.attrs) && isExcerptInclude(afterNode.attrs)) {
|
|
50
50
|
var beforeReference = getReferencedContentId(beforeNode.attrs);
|
|
51
51
|
var afterReference = getReferencedContentId(afterNode.attrs);
|
|
52
52
|
return isEqual(getComparableExcerptIncludeAttrs(beforeNode.attrs), getComparableExcerptIncludeAttrs(afterNode.attrs)) && (beforeReference === undefined || afterReference === undefined || beforeReference === afterReference);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-show-diff",
|
|
3
|
-
"version": "27.1.
|
|
3
|
+
"version": "27.1.3",
|
|
4
4
|
"description": "ShowDiff plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
40
40
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
41
41
|
"@atlaskit/primitives": "^22.6.0",
|
|
42
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
43
|
-
"@atlaskit/tokens": "^20.
|
|
42
|
+
"@atlaskit/tmp-editor-statsig": "^246.1.0",
|
|
43
|
+
"@atlaskit/tokens": "^20.8.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"@compiled/react": "^1.0.2",
|
|
46
46
|
"bind-event-listener": "^3.0.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@atlaskit/button": "^25.6.0",
|
|
54
54
|
"@atlaskit/css": "^1.1.0",
|
|
55
55
|
"@atlaskit/dropdown-menu": "^21.0.0",
|
|
56
|
-
"@atlaskit/editor-core": "^240.
|
|
56
|
+
"@atlaskit/editor-core": "^240.1.0",
|
|
57
57
|
"@atlaskit/editor-json-transformer": "^10.0.0",
|
|
58
58
|
"@atlaskit/editor-plugins": "^16.2.0",
|
|
59
59
|
"@atlaskit/form": "^18.2.0",
|
|
@@ -64,14 +64,14 @@
|
|
|
64
64
|
"@atlassian/confluence-presets": "workspace:^",
|
|
65
65
|
"@atlassian/content-reconciliation": "^0.1.3506",
|
|
66
66
|
"@atlassian/editor-ai-injected-editors": "^44.0.0",
|
|
67
|
-
"@atlassian/editor-plugin-ai": "^83.
|
|
67
|
+
"@atlassian/editor-plugin-ai": "^83.7.0",
|
|
68
68
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
69
69
|
"react": "^19.2.0",
|
|
70
70
|
"react-dom": "^19.2.0",
|
|
71
71
|
"react-intl": "^7.0.0"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@atlaskit/editor-common": "^133.
|
|
74
|
+
"@atlaskit/editor-common": "^133.7.0",
|
|
75
75
|
"react": "^18.2.0 || ^19.2.0",
|
|
76
76
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
77
77
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -102,9 +102,6 @@
|
|
|
102
102
|
},
|
|
103
103
|
"confluence_ncs_step_diffing_version_history": {
|
|
104
104
|
"type": "boolean"
|
|
105
|
-
},
|
|
106
|
-
"platform_editor_normalize_excerpt_diff": {
|
|
107
|
-
"type": "boolean"
|
|
108
105
|
}
|
|
109
106
|
}
|
|
110
107
|
}
|