@atlaskit/editor-plugin-show-diff 18.0.0 → 19.0.0

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/editor-plugin-show-diff
2
2
 
3
+ ## 19.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`9ea47a518fc7c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9ea47a518fc7c) -
8
+ Cleanup `feature_gate` `platform_editor_diff_inline_mark_changes`. Non-smart diffs permanently use
9
+ the mark-aware token encoder, so formatting-only edits produce a change, and deleted-side widgets
10
+ are permanently rendered with an empty mark set so they do not inherit the marks of the
11
+ surrounding new document.
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 18.0.0
4
18
 
5
19
  ### Patch Changes
@@ -4,14 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.selectTokenEncoder = void 0;
7
- var _fg = require("@atlaskit/platform-feature-flags/fg");
8
7
  var _attrAwareTokenEncoder = require("./attrAwareTokenEncoder");
9
8
  var _markAwareTokenEncoder = require("./markAwareTokenEncoder");
10
9
  /**
11
- * Single place `platform_editor_diff_inline_mark_changes` is read, shared by
12
- * `calculateDiffDecorations` and `computeDiffChanges` so the two cannot drift.
13
- *
14
- * With the gate off this returns what both callers computed before it existed.
10
+ * Single place the token encoder is chosen, shared by `calculateDiffDecorations` and
11
+ * `computeDiffChanges` so the two cannot drift.
15
12
  *
16
13
  * @param useAttrAwareEncoder Caller is running the smart classifier, which needs node attrs folded
17
14
  * into the token.
@@ -23,14 +20,8 @@ var selectTokenEncoder = exports.selectTokenEncoder = function selectTokenEncode
23
20
  shouldHideMarkOnlyDeletions: false
24
21
  };
25
22
  }
26
- if ((0, _fg.fg)('platform_editor_diff_inline_mark_changes')) {
27
- return {
28
- tokenEncoder: _markAwareTokenEncoder.markAwareTokenEncoder,
29
- shouldHideMarkOnlyDeletions: true
30
- };
31
- }
32
23
  return {
33
- tokenEncoder: undefined,
34
- shouldHideMarkOnlyDeletions: false
24
+ tokenEncoder: _markAwareTokenEncoder.markAwareTokenEncoder,
25
+ shouldHideMarkOnlyDeletions: true
35
26
  };
36
27
  };
@@ -555,7 +555,7 @@ var createNodeChangedDecorationWidget = exports.createNodeChangedDecorationWidge
555
555
  decorations.push(leftAnchor);
556
556
  }
557
557
  }
558
- decorations.push(_view.Decoration.widget(safeInsertPos, dom, _objectSpread(_objectSpread(_objectSpread({}, (0, _decorationKeys.buildDiffDecorationSpec)(_objectSpread({
558
+ decorations.push(_view.Decoration.widget(safeInsertPos, dom, _objectSpread(_objectSpread({}, (0, _decorationKeys.buildDiffDecorationSpec)(_objectSpread({
559
559
  attributionKey: canTagWidget ? attributionKey : undefined,
560
560
  colorScheme: colorScheme,
561
561
  decorationType: 'widget',
@@ -568,9 +568,12 @@ var createNodeChangedDecorationWidget = exports.createNodeChangedDecorationWidge
568
568
  // placeBelow anchors at the end of the new content, so render on the
569
569
  // trailing side (1); otherwise render before the new content (-1).
570
570
  side: placeBelow ? 1 : -1
571
- }))), (0, _fg.fg)('platform_editor_diff_inline_mark_changes') && {
572
- marks: []
573
- }), {}, {
571
+ }))), {}, {
572
+ // Without an explicit mark set, prosemirror-view wraps the widget in the marks of the
573
+ // adjacent text in the NEW document. `dom` already carries the original marks, so a
574
+ // formatting change would render the deleted side wrapped in the very mark the edit
575
+ // introduced — unbolded text shown struck through but still bold.
576
+ marks: [],
574
577
  destroy: function destroy() {
575
578
  var _constrainMediaObserv2;
576
579
  (_constrainMediaObserv2 = constrainMediaObserver) === null || _constrainMediaObserv2 === void 0 || _constrainMediaObserv2.disconnect();
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.createDeletedLineBreakWidget = exports.createDeletedLineBreakDecoration = exports.RETURN_GLYPH = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _view = require("@atlaskit/editor-prosemirror/view");
10
- var _fg = require("@atlaskit/platform-feature-flags/fg");
11
10
  var _isExtendedEnabled = require("../../isExtendedEnabled");
12
11
  var _decorationKeys = require("../decorationKeys");
13
12
  var _wrapBlockNodeView = require("./wrapBlockNodeView");
@@ -100,7 +99,9 @@ var createDeletedLineBreakDecoration = exports.createDeletedLineBreakDecoration
100
99
  diffType: diffType
101
100
  }, (0, _isExtendedEnabled.isExtendedEnabled)(diffType) && side !== undefined && {
102
101
  side: side
103
- }))), (0, _fg.fg)('platform_editor_diff_inline_mark_changes') && {
102
+ }))), {}, {
103
+ // Without an explicit mark set, prosemirror-view wraps the widget in the marks of the
104
+ // adjacent text. The glyph carries its own deleted styling and must not inherit them.
104
105
  marks: []
105
106
  }));
106
107
  };
@@ -1,11 +1,8 @@
1
- import { fg } from '@atlaskit/platform-feature-flags/fg';
2
1
  import { attrAwareTokenEncoder } from './attrAwareTokenEncoder';
3
2
  import { markAwareTokenEncoder } from './markAwareTokenEncoder';
4
3
  /**
5
- * Single place `platform_editor_diff_inline_mark_changes` is read, shared by
6
- * `calculateDiffDecorations` and `computeDiffChanges` so the two cannot drift.
7
- *
8
- * With the gate off this returns what both callers computed before it existed.
4
+ * Single place the token encoder is chosen, shared by `calculateDiffDecorations` and
5
+ * `computeDiffChanges` so the two cannot drift.
9
6
  *
10
7
  * @param useAttrAwareEncoder Caller is running the smart classifier, which needs node attrs folded
11
8
  * into the token.
@@ -17,14 +14,8 @@ export const selectTokenEncoder = useAttrAwareEncoder => {
17
14
  shouldHideMarkOnlyDeletions: false
18
15
  };
19
16
  }
20
- if (fg('platform_editor_diff_inline_mark_changes')) {
21
- return {
22
- tokenEncoder: markAwareTokenEncoder,
23
- shouldHideMarkOnlyDeletions: true
24
- };
25
- }
26
17
  return {
27
- tokenEncoder: undefined,
28
- shouldHideMarkOnlyDeletions: false
18
+ tokenEncoder: markAwareTokenEncoder,
19
+ shouldHideMarkOnlyDeletions: true
29
20
  };
30
21
  };
@@ -560,9 +560,7 @@ export const createNodeChangedDecorationWidget = ({
560
560
  // adjacent text in the NEW document. `dom` already carries the original marks, so a
561
561
  // formatting change would render the deleted side wrapped in the very mark the edit
562
562
  // introduced — unbolded text shown struck through but still bold.
563
- ...(fg('platform_editor_diff_inline_mark_changes') && {
564
- marks: []
565
- }),
563
+ marks: [],
566
564
  destroy: () => {
567
565
  var _constrainMediaObserv2;
568
566
  (_constrainMediaObserv2 = constrainMediaObserver) === null || _constrainMediaObserv2 === void 0 ? void 0 : _constrainMediaObserv2.disconnect();
@@ -1,5 +1,4 @@
1
1
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
2
- import { fg } from '@atlaskit/platform-feature-flags/fg';
3
2
  import { isExtendedEnabled } from '../../isExtendedEnabled';
4
3
  import { buildDiffDecorationSpec, scrollMarginTopValue } from '../decorationKeys';
5
4
  import { createContentWrapper } from './wrapBlockNodeView';
@@ -94,7 +93,5 @@ export const createDeletedLineBreakDecoration = ({
94
93
  }),
95
94
  // Without an explicit mark set, prosemirror-view wraps the widget in the marks of the
96
95
  // adjacent text. The glyph carries its own deleted styling and must not inherit them.
97
- ...(fg('platform_editor_diff_inline_mark_changes') && {
98
- marks: []
99
- })
96
+ marks: []
100
97
  });
@@ -1,11 +1,8 @@
1
- import { fg } from '@atlaskit/platform-feature-flags/fg';
2
1
  import { attrAwareTokenEncoder } from './attrAwareTokenEncoder';
3
2
  import { markAwareTokenEncoder } from './markAwareTokenEncoder';
4
3
  /**
5
- * Single place `platform_editor_diff_inline_mark_changes` is read, shared by
6
- * `calculateDiffDecorations` and `computeDiffChanges` so the two cannot drift.
7
- *
8
- * With the gate off this returns what both callers computed before it existed.
4
+ * Single place the token encoder is chosen, shared by `calculateDiffDecorations` and
5
+ * `computeDiffChanges` so the two cannot drift.
9
6
  *
10
7
  * @param useAttrAwareEncoder Caller is running the smart classifier, which needs node attrs folded
11
8
  * into the token.
@@ -17,14 +14,8 @@ export var selectTokenEncoder = function selectTokenEncoder(useAttrAwareEncoder)
17
14
  shouldHideMarkOnlyDeletions: false
18
15
  };
19
16
  }
20
- if (fg('platform_editor_diff_inline_mark_changes')) {
21
- return {
22
- tokenEncoder: markAwareTokenEncoder,
23
- shouldHideMarkOnlyDeletions: true
24
- };
25
- }
26
17
  return {
27
- tokenEncoder: undefined,
28
- shouldHideMarkOnlyDeletions: false
18
+ tokenEncoder: markAwareTokenEncoder,
19
+ shouldHideMarkOnlyDeletions: true
29
20
  };
30
21
  };
@@ -548,7 +548,7 @@ export var createNodeChangedDecorationWidget = function createNodeChangedDecorat
548
548
  decorations.push(leftAnchor);
549
549
  }
550
550
  }
551
- decorations.push(Decoration.widget(safeInsertPos, dom, _objectSpread(_objectSpread(_objectSpread({}, buildDiffDecorationSpec(_objectSpread({
551
+ decorations.push(Decoration.widget(safeInsertPos, dom, _objectSpread(_objectSpread({}, buildDiffDecorationSpec(_objectSpread({
552
552
  attributionKey: canTagWidget ? attributionKey : undefined,
553
553
  colorScheme: colorScheme,
554
554
  decorationType: 'widget',
@@ -561,9 +561,12 @@ export var createNodeChangedDecorationWidget = function createNodeChangedDecorat
561
561
  // placeBelow anchors at the end of the new content, so render on the
562
562
  // trailing side (1); otherwise render before the new content (-1).
563
563
  side: placeBelow ? 1 : -1
564
- }))), fg('platform_editor_diff_inline_mark_changes') && {
565
- marks: []
566
- }), {}, {
564
+ }))), {}, {
565
+ // Without an explicit mark set, prosemirror-view wraps the widget in the marks of the
566
+ // adjacent text in the NEW document. `dom` already carries the original marks, so a
567
+ // formatting change would render the deleted side wrapped in the very mark the edit
568
+ // introduced — unbolded text shown struck through but still bold.
569
+ marks: [],
567
570
  destroy: function destroy() {
568
571
  var _constrainMediaObserv2;
569
572
  (_constrainMediaObserv2 = constrainMediaObserver) === null || _constrainMediaObserv2 === void 0 || _constrainMediaObserv2.disconnect();
@@ -2,7 +2,6 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
5
- import { fg } from '@atlaskit/platform-feature-flags/fg';
6
5
  import { isExtendedEnabled } from '../../isExtendedEnabled';
7
6
  import { buildDiffDecorationSpec, scrollMarginTopValue } from '../decorationKeys';
8
7
  import { createContentWrapper } from './wrapBlockNodeView';
@@ -94,7 +93,9 @@ export var createDeletedLineBreakDecoration = function createDeletedLineBreakDec
94
93
  diffType: diffType
95
94
  }, isExtendedEnabled(diffType) && side !== undefined && {
96
95
  side: side
97
- }))), fg('platform_editor_diff_inline_mark_changes') && {
96
+ }))), {}, {
97
+ // Without an explicit mark set, prosemirror-view wraps the widget in the marks of the
98
+ // adjacent text. The glyph carries its own deleted styling and must not inherit them.
98
99
  marks: []
99
100
  }));
100
101
  };
@@ -2,14 +2,12 @@ import type { TokenEncoder } from 'prosemirror-changeset';
2
2
  export type TokenEncoderSelection = {
3
3
  /** Non-smart mark-aware path only; lets callers suppress a duplicate deleted side. */
4
4
  shouldHideMarkOnlyDeletions: boolean;
5
- /** Encoder to hand to `ChangeSet.create`. `undefined` means the library default. */
6
- tokenEncoder: TokenEncoder<string | number> | undefined;
5
+ /** Encoder to hand to `ChangeSet.create`. */
6
+ tokenEncoder: TokenEncoder<string | number>;
7
7
  };
8
8
  /**
9
- * Single place `platform_editor_diff_inline_mark_changes` is read, shared by
10
- * `calculateDiffDecorations` and `computeDiffChanges` so the two cannot drift.
11
- *
12
- * With the gate off this returns what both callers computed before it existed.
9
+ * Single place the token encoder is chosen, shared by `calculateDiffDecorations` and
10
+ * `computeDiffChanges` so the two cannot drift.
13
11
  *
14
12
  * @param useAttrAwareEncoder Caller is running the smart classifier, which needs node attrs folded
15
13
  * into the token.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-show-diff",
3
- "version": "18.0.0",
3
+ "version": "19.0.0",
4
4
  "description": "ShowDiff plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -27,12 +27,12 @@
27
27
  "dependencies": {
28
28
  "@atlaskit/adf-schema": "^57.6.0",
29
29
  "@atlaskit/agent-color": "^1.0.0",
30
- "@atlaskit/avatar": "^28.0.0",
30
+ "@atlaskit/avatar": "^29.0.0",
31
31
  "@atlaskit/custom-steps": "^1.1.0",
32
- "@atlaskit/editor-plugin-accessibility-utils": "^20.0.0",
33
- "@atlaskit/editor-plugin-analytics": "^20.0.0",
34
- "@atlaskit/editor-plugin-limited-mode": "^17.0.0",
35
- "@atlaskit/editor-plugin-user-intent": "^18.0.0",
32
+ "@atlaskit/editor-plugin-accessibility-utils": "^21.0.0",
33
+ "@atlaskit/editor-plugin-analytics": "^21.0.0",
34
+ "@atlaskit/editor-plugin-limited-mode": "^18.0.0",
35
+ "@atlaskit/editor-plugin-user-intent": "^19.0.0",
36
36
  "@atlaskit/editor-prosemirror": "^9.0.0",
37
37
  "@atlaskit/editor-shared-styles": "^4.3.0",
38
38
  "@atlaskit/editor-tables": "^3.2.0",
@@ -40,7 +40,7 @@
40
40
  "@atlaskit/platform-feature-flags": "^2.2.0",
41
41
  "@atlaskit/primitives": "^22.5.0",
42
42
  "@atlaskit/tmp-editor-statsig": "^205.0.0",
43
- "@atlaskit/tokens": "^19.0.0",
43
+ "@atlaskit/tokens": "^20.0.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@compiled/react": "^1.0.2",
46
46
  "bind-event-listener": "^3.0.0",
@@ -53,25 +53,25 @@
53
53
  "@atlaskit/button": "^25.4.0",
54
54
  "@atlaskit/css": "^1.1.0",
55
55
  "@atlaskit/dropdown-menu": "^18.3.0",
56
- "@atlaskit/editor-core": "^230.0.0",
57
- "@atlaskit/editor-json-transformer": "^9.8.0",
56
+ "@atlaskit/editor-core": "^231.0.0",
57
+ "@atlaskit/editor-json-transformer": "^10.0.0",
58
58
  "@atlaskit/editor-plugins": "^16.1.0",
59
- "@atlaskit/form": "^17.2.0",
59
+ "@atlaskit/form": "^18.0.0",
60
60
  "@atlaskit/section-message": "^10.2.0",
61
61
  "@atlaskit/textarea": "^10.2.0",
62
62
  "@atlaskit/textfield": "^10.2.0",
63
63
  "@atlaskit/util-data-test": "^19.1.0",
64
64
  "@atlassian/confluence-presets": "workspace:^",
65
65
  "@atlassian/content-reconciliation": "^0.1.3506",
66
- "@atlassian/editor-ai-injected-editors": "^34.0.0",
67
- "@atlassian/editor-plugin-ai": "^74.0.0",
66
+ "@atlassian/editor-ai-injected-editors": "^35.0.0",
67
+ "@atlassian/editor-plugin-ai": "^75.0.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": "^124.0.0",
74
+ "@atlaskit/editor-common": "^125.0.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"
@@ -101,9 +101,6 @@
101
101
  },
102
102
  "platform_editor_reduce_diff_attr_sensitivity": {
103
103
  "type": "boolean"
104
- },
105
- "platform_editor_diff_inline_mark_changes": {
106
- "type": "boolean"
107
104
  }
108
105
  }
109
106
  }