@atlaskit/editor-plugin-show-diff 25.0.6 → 26.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 +33 -0
- package/dist/cjs/pm-plugins/calculateDiff/calculateDiffDecorations.js +3 -3
- package/dist/cjs/pm-plugins/decorations/colorSchemes/factory.js +10 -1
- package/dist/cjs/pm-plugins/decorations/colorSchemes/standard.js +5 -1
- package/dist/cjs/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.js +2 -1
- package/dist/cjs/pm-plugins/decorations/utils/createNodeShapedMarginSpacer.js +13 -4
- package/dist/cjs/pm-plugins/getScrollableDecorations.js +23 -1
- package/dist/cjs/pm-plugins/resolveDiffContributors.js +5 -5
- package/dist/cjs/showDiffPluginType.js +1 -1
- package/dist/cjs/ui/ContributorTag/buildContributorTagDom.js +2 -2
- package/dist/es2019/pm-plugins/calculateDiff/calculateDiffDecorations.js +3 -3
- package/dist/es2019/pm-plugins/decorations/colorSchemes/factory.js +9 -1
- package/dist/es2019/pm-plugins/decorations/colorSchemes/standard.js +4 -0
- package/dist/es2019/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.js +3 -2
- package/dist/es2019/pm-plugins/decorations/utils/createNodeShapedMarginSpacer.js +13 -4
- package/dist/es2019/pm-plugins/getScrollableDecorations.js +16 -1
- package/dist/es2019/pm-plugins/resolveDiffContributors.js +5 -5
- package/dist/es2019/showDiffPluginType.js +1 -1
- package/dist/es2019/ui/ContributorTag/buildContributorTagDom.js +2 -2
- package/dist/esm/pm-plugins/calculateDiff/calculateDiffDecorations.js +3 -3
- package/dist/esm/pm-plugins/decorations/colorSchemes/factory.js +9 -1
- package/dist/esm/pm-plugins/decorations/colorSchemes/standard.js +4 -0
- package/dist/esm/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.js +3 -2
- package/dist/esm/pm-plugins/decorations/utils/createNodeShapedMarginSpacer.js +13 -4
- package/dist/esm/pm-plugins/getScrollableDecorations.js +23 -1
- package/dist/esm/pm-plugins/resolveDiffContributors.js +5 -5
- package/dist/esm/showDiffPluginType.js +1 -1
- package/dist/esm/ui/ContributorTag/buildContributorTagDom.js +2 -2
- package/dist/types/pm-plugins/decorations/colorSchemes/factory.d.ts +2 -0
- package/dist/types/pm-plugins/decorations/colorSchemes/standard.d.ts +1 -0
- package/dist/types/showDiffPluginType.d.ts +1 -1
- package/dist/types/ui/ContributorTag/buildContributorTagDom.d.ts +2 -2
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-show-diff
|
|
2
2
|
|
|
3
|
+
## 26.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b5f8a82f07fc6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b5f8a82f07fc6) -
|
|
8
|
+
Preserve spacing between panel replacement diffs at the start of a table cell or other container
|
|
9
|
+
behind platform_editor_ai_show_diff_patch_2.
|
|
10
|
+
- [`0f0ca74ca517a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0f0ca74ca517a) -
|
|
11
|
+
Add the `@atlaskit/editor-common/ai-xstate-migration` (`isAiXstateMigrationEnabled`) and
|
|
12
|
+
`@atlaskit/editor-common/ai-xstate-migration-no-exposure` (`isAiXstateMigrationEnabledNoExposure`)
|
|
13
|
+
entrypoints, which enable the AI xstate migration when either the Confluence
|
|
14
|
+
(`platform_editor_ai_xstate_migration`) or Jira (`platform_editor_ai_xstate_migration_jira`, a
|
|
15
|
+
platform feature experiment) experiment is on. Use the helper wherever the xstate migration is
|
|
16
|
+
checked.
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
19
|
+
## 25.1.0
|
|
20
|
+
|
|
21
|
+
### Minor Changes
|
|
22
|
+
|
|
23
|
+
- [`4704b3ac83f88`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4704b3ac83f88) -
|
|
24
|
+
Treat Antigravity and Copilot as third-party agent brands in show-diff contributor tags, sharing
|
|
25
|
+
the fixed third-party participant colour slot, and render their profile avatar when one is
|
|
26
|
+
available (falling back to the generic agent icon). Shorten the contributor tag fade in and out
|
|
27
|
+
from 600ms to 500ms.
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- [`ef028efae290d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ef028efae290d) -
|
|
32
|
+
Prevent nested deleted list content from accumulating opacity while preserving its 0.8 treatment
|
|
33
|
+
behind the `platform_editor_ai_show_diff_patch_2` feature gate.
|
|
34
|
+
- Updated dependencies
|
|
35
|
+
|
|
3
36
|
## 25.0.6
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
|
@@ -11,6 +11,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
11
11
|
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
12
12
|
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
13
13
|
var _prosemirrorChangeset = require("prosemirror-changeset");
|
|
14
|
+
var _aiXstateMigrationNoExposure = require("@atlaskit/editor-common/ai-xstate-migration-no-exposure");
|
|
14
15
|
var _areDocsEqualByBlockStructureAndText = require("@atlaskit/editor-common/utils/areDocsEqualByBlockStructureAndText");
|
|
15
16
|
var _document = require("@atlaskit/editor-common/utils/document");
|
|
16
17
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
@@ -18,7 +19,6 @@ var _view = require("@atlaskit/editor-prosemirror/view");
|
|
|
18
19
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
19
20
|
var _unsafeExpValNoExposure = require("@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure");
|
|
20
21
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
21
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
22
22
|
var _attributions = require("../decorations/colorSchemes/attributions");
|
|
23
23
|
var _createAnchorDecorationWidgets = require("../decorations/createAnchorDecorationWidgets");
|
|
24
24
|
var _createBlockChangedDecoration = require("../decorations/createBlockChangedDecoration");
|
|
@@ -679,7 +679,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
679
679
|
// For a large inserted table, skip the per-cell inline decorations that
|
|
680
680
|
// freeze the browser on re-render. Only active when Review moment is
|
|
681
681
|
// eligible (xstate + M1).
|
|
682
|
-
var useCoarseTableDecoration = isSmartNodeLevel && (0,
|
|
682
|
+
var useCoarseTableDecoration = isSmartNodeLevel && (0, _aiXstateMigrationNoExposure.isAiXstateMigrationEnabledNoExposure)() && (0, _unsafeExpValNoExposure.UNSAFE_expValNoExposure)('platform_editor_ai_streaming_ux_experience_m1', 'isEnabled', false) === true && isLargeInsertedTableRange(tr.doc, change.fromB, change.toB);
|
|
683
683
|
// Whether the deleted-content widget will actually be rendered for this
|
|
684
684
|
// change. Used to decide if indicator anchor positions should be adjusted
|
|
685
685
|
// inward — when the widget is present the anchor must stay at the block
|
|
@@ -939,7 +939,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
939
939
|
})));
|
|
940
940
|
// If the original node position is known (e.g. a panel type change), also render
|
|
941
941
|
// the old block node as a "deleted" widget so the reviewer sees the before/after.
|
|
942
|
-
var isSmartNodeLevelAttrChange = diffType === 'smart' && (0, _fg.fg)('platform_editor_ai_smart_diff') && (0,
|
|
942
|
+
var isSmartNodeLevelAttrChange = diffType === 'smart' && (0, _fg.fg)('platform_editor_ai_smart_diff') && (0, _aiXstateMigrationNoExposure.isAiXstateMigrationEnabledNoExposure)() && (0, _unsafeExpValNoExposure.UNSAFE_expValNoExposure)('platform_editor_ai_streaming_ux_experience_m1', 'isEnabled', false) === true;
|
|
943
943
|
if (isSmartNodeLevelAttrChange && change.fromA !== undefined && change.toA !== undefined) {
|
|
944
944
|
var placeBelow = deletedDiffPlacement === 'bottom';
|
|
945
945
|
decorations.push.apply(decorations, (0, _toConsumableArray2.default)((0, _createNodeChangedDecorationWidget.createNodeChangedDecorationWidget)({
|
|
@@ -33,6 +33,7 @@ exports.buildDeletedInlineNodeCSSVariables = buildDeletedInlineNodeCSSVariables;
|
|
|
33
33
|
exports.buildDeletedInlineStyle = buildDeletedInlineStyle;
|
|
34
34
|
exports.buildDeletedInlineStyleStandard = buildDeletedInlineStyleStandard;
|
|
35
35
|
exports.buildDeletedInlineStyleUnbounded = buildDeletedInlineStyleUnbounded;
|
|
36
|
+
exports.buildDeletedListItemMarkerVariable = buildDeletedListItemMarkerVariable;
|
|
36
37
|
exports.buildDeletedLozengeActiveStyle = buildDeletedLozengeActiveStyle;
|
|
37
38
|
exports.buildDeletedLozengeStyle = buildDeletedLozengeStyle;
|
|
38
39
|
exports.buildDeletedNodeCSSVariables = buildDeletedNodeCSSVariables;
|
|
@@ -732,6 +733,14 @@ function buildDeletedDecorationMarkerVariableSimple(colors) {
|
|
|
732
733
|
});
|
|
733
734
|
}
|
|
734
735
|
|
|
736
|
+
/** Marker and direct-content variables for deleted list items. */
|
|
737
|
+
function buildDeletedListItemMarkerVariable(colors) {
|
|
738
|
+
return (0, _cssHelper.convertToInlineCss)({
|
|
739
|
+
'--diff-decoration-content-opacity': '0.8',
|
|
740
|
+
'--diff-decoration-marker-color': borderAccent(colors.deleteColor)
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
|
|
735
744
|
/** Whether the emphasised state is stated in the bottom border rather than a deeper highlight. */
|
|
736
745
|
function usesUnderlineEmphasis(colors) {
|
|
737
746
|
return colors.deletedInlineActiveEmphasis === 'underline';
|
|
@@ -1121,7 +1130,7 @@ function buildDeletedBlockNodeStyle(colors, category, isActive) {
|
|
|
1121
1130
|
case 'container':
|
|
1122
1131
|
return isStrikethrough ? buildDeletedInlineStyle(colors, false) : buildDeletedDecorationMarkerVariableSimple(colors);
|
|
1123
1132
|
case 'listItem':
|
|
1124
|
-
return colors.deletedNodeEmphasis === 'stateful' ? statefulMarker() : buildDeletedDecorationMarkerVariableSimple(colors);
|
|
1133
|
+
return colors.deletedNodeEmphasis === 'stateful' ? statefulMarker() : (0, _fg.fg)('platform_editor_ai_show_diff_patch_2') ? buildDeletedListItemMarkerVariable(colors) : buildDeletedDecorationMarkerVariableSimple(colors);
|
|
1125
1134
|
case 'marker':
|
|
1126
1135
|
return colors.deletedNodeEmphasis === 'stateful' ? statefulMarker() : buildDeletedInlineStyleStandard(colors, 'new');
|
|
1127
1136
|
case 'generic':
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.standardDecorationMarkerVariable = exports.getStandardDeletedRowStyle = exports.getStandardDeletedContentStyleNew = exports.getStandardDeletedContentStyleActive = exports.getStandardDeletedContentStyle = exports.editingStyleRuleNode = exports.editingStyleQuoteNode = exports.editingStyleNode = exports.editingStyleExtendedNoUnderline = exports.editingStyleExtended = exports.editingStyleCardBlockNode = exports.editingStyleActiveExtendedNoUnderline = exports.editingStyleActiveExtended = exports.editingContentStyleInBlockExtendedNoUnderline = exports.editingContentStyleInBlockExtended = exports.deletedStyleQuoteNodeWithLozengeActive = exports.deletedStyleQuoteNodeWithLozenge = exports.deletedStyleQuoteNode = exports.deletedInlineContentStyleExtended = exports.deletedDecorationMarkerVariable = exports.deletedContentStyleUnbounded = exports.deletedCellOverlayStyle = exports.deletedCellOverlayRoundedStyle = exports.deletedBlockOutlineRoundedActive = exports.deletedBlockOutlineRounded = exports.deletedBlockOutlineActive = exports.deletedBlockOutline = exports.addedCellOverlayStyle = exports.addedCellOverlayRoundedStyle = void 0;
|
|
7
|
+
exports.standardDecorationMarkerVariable = exports.getStandardDeletedRowStyle = exports.getStandardDeletedContentStyleNew = exports.getStandardDeletedContentStyleActive = exports.getStandardDeletedContentStyle = exports.editingStyleRuleNode = exports.editingStyleQuoteNode = exports.editingStyleNode = exports.editingStyleExtendedNoUnderline = exports.editingStyleExtended = exports.editingStyleCardBlockNode = exports.editingStyleActiveExtendedNoUnderline = exports.editingStyleActiveExtended = exports.editingContentStyleInBlockExtendedNoUnderline = exports.editingContentStyleInBlockExtended = exports.deletedStyleQuoteNodeWithLozengeActive = exports.deletedStyleQuoteNodeWithLozenge = exports.deletedStyleQuoteNode = exports.deletedListItemMarkerVariable = exports.deletedInlineContentStyleExtended = exports.deletedDecorationMarkerVariable = exports.deletedContentStyleUnbounded = exports.deletedCellOverlayStyle = exports.deletedCellOverlayRoundedStyle = exports.deletedBlockOutlineRoundedActive = exports.deletedBlockOutlineRounded = exports.deletedBlockOutlineActive = exports.deletedBlockOutline = exports.addedCellOverlayStyle = exports.addedCellOverlayRoundedStyle = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _cssHelper = require("@atlaskit/editor-common/css-helper");
|
|
10
10
|
var _getStandardDeletedTextDecorationStyle = require("./getStandardDeletedTextDecorationStyle");
|
|
@@ -153,6 +153,10 @@ var deletedDecorationMarkerVariable = exports.deletedDecorationMarkerVariable =
|
|
|
153
153
|
'--diff-decoration-marker-ring-width': '1px',
|
|
154
154
|
opacity: 0.8
|
|
155
155
|
});
|
|
156
|
+
var deletedListItemMarkerVariable = exports.deletedListItemMarkerVariable = (0, _cssHelper.convertToInlineCss)({
|
|
157
|
+
'--diff-decoration-content-opacity': '0.8',
|
|
158
|
+
'--diff-decoration-marker-color': "var(--ds-border-accent-gray, #7D818A)"
|
|
159
|
+
});
|
|
156
160
|
var addedCellOverlayStyle = exports.addedCellOverlayStyle = (0, _cssHelper.convertToInlineCss)({
|
|
157
161
|
position: 'absolute',
|
|
158
162
|
top: 0,
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.resolveCellOverlayStyleLegacy = exports.getBlockNodeStyleLegacy = void 0;
|
|
7
7
|
var _cssHelper = require("@atlaskit/editor-common/css-helper");
|
|
8
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
8
9
|
var _standard = require("./colorSchemes/standard");
|
|
9
10
|
var _traditional = require("./colorSchemes/traditional");
|
|
10
11
|
/**
|
|
@@ -63,7 +64,7 @@ var getBlockNodeStyleLegacy = exports.getBlockNodeStyleLegacy = function getBloc
|
|
|
63
64
|
return isTraditional && isActive ? _traditional.traditionalDecorationMarkerVariableActive : isTraditional ? _traditional.traditionalDecorationMarkerVariableNew : _standard.standardDecorationMarkerVariable;
|
|
64
65
|
}
|
|
65
66
|
if (nodeName === 'listItem') {
|
|
66
|
-
return isTraditional && isActive ? _traditional.traditionalDeletedDecorationMarkerVariableActive : isTraditional ? _traditional.traditionalDeletedDecorationMarkerVariableNew : _standard.deletedDecorationMarkerVariable;
|
|
67
|
+
return isTraditional && isActive ? _traditional.traditionalDeletedDecorationMarkerVariableActive : isTraditional ? _traditional.traditionalDeletedDecorationMarkerVariableNew : (0, _fg.fg)('platform_editor_ai_show_diff_patch_2') ? _standard.deletedListItemMarkerVariable : _standard.deletedDecorationMarkerVariable;
|
|
67
68
|
}
|
|
68
69
|
return isTraditional && isActive ? _traditional.traditionalDeletedDecorationMarkerVariableActive : isTraditional ? _traditional.traditionalDeletedDecorationMarkerVariableNew : (0, _standard.getStandardDeletedContentStyleNew)();
|
|
69
70
|
}
|
|
@@ -4,16 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createNodeShapedMarginSpacer = void 0;
|
|
7
|
+
var _panel = require("@atlaskit/editor-common/styles/panel");
|
|
8
|
+
var _nodeTypeUtils = require("@atlaskit/editor-common/utils/node-type-utils");
|
|
7
9
|
/**
|
|
8
10
|
* Node types that can safely be reduced to an empty shell.
|
|
9
11
|
*
|
|
10
12
|
* A shell only replicates a margin if it collapses to nothing itself, which needs zero height and
|
|
11
|
-
* no vertical border or padding. Textblocks and lists qualify;
|
|
12
|
-
*
|
|
13
|
-
*
|
|
13
|
+
* no vertical border or padding. Textblocks and lists qualify; panels need their painted box
|
|
14
|
+
* hidden and their flex layout removed. Nodes with intrinsic sizing (tables are `display: table`,
|
|
15
|
+
* media has a measured height) are left alone.
|
|
14
16
|
*/
|
|
15
17
|
var isShapeableNode = function isShapeableNode(node) {
|
|
16
|
-
return node.isTextblock || ['bulletList', 'orderedList'].includes(node.type.name);
|
|
18
|
+
return node.isTextblock || ['bulletList', 'orderedList'].includes(node.type.name) || (0, _nodeTypeUtils.getBaseNodeTypeName)(node.type) === 'panel';
|
|
17
19
|
};
|
|
18
20
|
|
|
19
21
|
/**
|
|
@@ -57,6 +59,13 @@ var createNodeShapedMarginSpacer = exports.createNodeShapedMarginSpacer = functi
|
|
|
57
59
|
serialized.dataset.testid = testId;
|
|
58
60
|
serialized.setAttribute('aria-hidden', 'true');
|
|
59
61
|
serialized.contentEditable = 'false';
|
|
62
|
+
if ((0, _nodeTypeUtils.getBaseNodeTypeName)(node.type) === 'panel') {
|
|
63
|
+
// Schema serialization lacks the node view's class, which carries the panel's margin.
|
|
64
|
+
// Hide the painted shell and allow its margins to collapse through a zero-height block.
|
|
65
|
+
serialized.classList.add(_panel.PanelSharedCssClassName.prefix);
|
|
66
|
+
serialized.style.display = 'block';
|
|
67
|
+
serialized.style.visibility = 'hidden';
|
|
68
|
+
}
|
|
60
69
|
|
|
61
70
|
// Zero height with no vertical border or padding keeps the spacer self-collapsing: its margins
|
|
62
71
|
// stay adjoining, so they collapse with the neighbours into a single margin equal to the largest
|
|
@@ -115,7 +115,29 @@ function groupTouchingDecorations(decorations, isInlineDecoration) {
|
|
|
115
115
|
// A zero-width decoration must not extend the run and bridge a gap.
|
|
116
116
|
clusterTo = Math.max(clusterTo, decoration.to);
|
|
117
117
|
});
|
|
118
|
-
|
|
118
|
+
|
|
119
|
+
// A deleted-content widget is left unattributed so it carries no tag of its own, and spans no
|
|
120
|
+
// range, so it is never a change in its own right. On its own it becomes a stop that reveals
|
|
121
|
+
// nothing, ahead of the stop for the change it belongs to — so it joins the attributed group
|
|
122
|
+
// that contains it. Only the stop list changes: the widget keeps its own decoration and, having
|
|
123
|
+
// no tag, stays no hover target.
|
|
124
|
+
var attributedGroups = groups.filter(function (group) {
|
|
125
|
+
return group.contributor !== '';
|
|
126
|
+
});
|
|
127
|
+
var stops = groups.filter(function (group) {
|
|
128
|
+
var _host$decorations;
|
|
129
|
+
if (group.contributor !== '' || group.decorations.some(function (dec) {
|
|
130
|
+
return dec.from !== dec.to;
|
|
131
|
+
})) {
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
var host = attributedGroups.find(function (attributed) {
|
|
135
|
+
return attributed.from <= group.from && group.to <= attributed.to;
|
|
136
|
+
});
|
|
137
|
+
host === null || host === void 0 || (_host$decorations = host.decorations).push.apply(_host$decorations, (0, _toConsumableArray2.default)(group.decorations));
|
|
138
|
+
return host === undefined;
|
|
139
|
+
});
|
|
140
|
+
return stops.map(function (_ref) {
|
|
119
141
|
var _ref2, _group$find;
|
|
120
142
|
var group = _ref.decorations,
|
|
121
143
|
from = _ref.from,
|
|
@@ -31,16 +31,17 @@ var SHOW_DIFF_AGENT_BRANDS = {
|
|
|
31
31
|
'agent-brand-databricks': 'databricks',
|
|
32
32
|
'agent-brand-gemini': 'gemini',
|
|
33
33
|
'agent-brand-manus': 'manus',
|
|
34
|
-
'agent-brand-slack': 'slack'
|
|
34
|
+
'agent-brand-slack': 'slack',
|
|
35
|
+
'agent-brand-antigravity': 'antigravity',
|
|
36
|
+
'agent-brand-copilot': 'copilot'
|
|
35
37
|
};
|
|
36
38
|
|
|
37
39
|
/**
|
|
38
40
|
* Brands that prefer the account's real avatar over their fixed glyph when the invoking profile
|
|
39
41
|
* has one. Brands with a fixed glyph (Claude, ChatGPT, Amplitude, Cortex, Databricks, Gemini, Manus,
|
|
40
|
-
* Slack) intentionally keep it always (see `AGENT_KIND_ICONS` in
|
|
41
|
-
* `contributorAvatarRenderer.ts`).
|
|
42
|
+
* Slack) intentionally keep it always (see `AGENT_KIND_ICONS` in `contributorAvatarRenderer.ts`).
|
|
42
43
|
*/
|
|
43
|
-
var AVATAR_ELIGIBLE_BRANDS = new Set(['figma', 'lovable', 'replit', 'rovo']);
|
|
44
|
+
var AVATAR_ELIGIBLE_BRANDS = new Set(['antigravity', 'copilot', 'figma', 'lovable', 'replit', 'rovo']);
|
|
44
45
|
|
|
45
46
|
/** Known external agent types emitted by Confluence's agent identification service that carry
|
|
46
47
|
* no `@atlaskit/agent-color` brand — a generic labelled fallback. */
|
|
@@ -50,7 +51,6 @@ var EXTERNAL_AGENT_NAMES = {
|
|
|
50
51
|
runlayer: 'Runlayer',
|
|
51
52
|
zed: 'Zed',
|
|
52
53
|
ampcode: 'Ampcode',
|
|
53
|
-
antigravity: 'Antigravity',
|
|
54
54
|
devin_cli: 'Devin CLI',
|
|
55
55
|
pi_agent: 'Pi Agent'
|
|
56
56
|
};
|
|
@@ -25,7 +25,7 @@ exports.DIFF_AGENT_BRANDS = exports.ASSERT_DIFF_AGENT_BRANDS_ARE_REGISTERED = vo
|
|
|
25
25
|
|
|
26
26
|
/** Branded agent presentations supported by contributor tags. */
|
|
27
27
|
|
|
28
|
-
var DIFF_AGENT_BRANDS = exports.DIFF_AGENT_BRANDS = new Set(['rovo', 'claude', 'chatgpt', 'figma', 'lovable', 'replit', 'amplitude', 'cortex', 'databricks', 'gemini', 'manus', 'slack']);
|
|
28
|
+
var DIFF_AGENT_BRANDS = exports.DIFF_AGENT_BRANDS = new Set(['rovo', 'claude', 'chatgpt', 'figma', 'lovable', 'replit', 'amplitude', 'cortex', 'databricks', 'gemini', 'manus', 'slack', 'antigravity', 'copilot']);
|
|
29
29
|
|
|
30
30
|
/** The brand id `@atlaskit/agent-color` registers each `AgentBrandColorScheme` under. */
|
|
31
31
|
|
|
@@ -45,10 +45,10 @@ var CONTRIBUTOR_TAG_REVEALED_ATTRIBUTE = exports.CONTRIBUTOR_TAG_REVEALED_ATTRIB
|
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* Backstop for removing a fading-out tag: a cancelled transition fires no `transitionend`. Must stay
|
|
48
|
-
* above the fade's
|
|
48
|
+
* above the fade's 500ms, which lives in another package's stylesheet and cannot be read back as a
|
|
49
49
|
* number — hence the wide margin. Raise in step with that duration.
|
|
50
50
|
*/
|
|
51
|
-
var TAG_EXIT_FALLBACK_MS = exports.TAG_EXIT_FALLBACK_MS =
|
|
51
|
+
var TAG_EXIT_FALLBACK_MS = exports.TAG_EXIT_FALLBACK_MS = 800;
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* The tooltip's look, inline rather than through `VANILLA_TOOLTIP_DEFAULT_CLASS`: this tooltip is
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import isEqual from 'lodash/isEqual';
|
|
2
2
|
import memoizeOne from 'memoize-one';
|
|
3
3
|
import { ChangeSet, simplifyChanges } from 'prosemirror-changeset';
|
|
4
|
+
import { isAiXstateMigrationEnabledNoExposure } from '@atlaskit/editor-common/ai-xstate-migration-no-exposure';
|
|
4
5
|
import { areDocsEqualByBlockStructureAndText } from '@atlaskit/editor-common/utils/areDocsEqualByBlockStructureAndText';
|
|
5
6
|
import { areNodesEqualIgnoreAttrs } from '@atlaskit/editor-common/utils/document';
|
|
6
7
|
import { Mapping } from '@atlaskit/editor-prosemirror/transform';
|
|
@@ -8,7 +9,6 @@ import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
|
8
9
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
9
10
|
import { UNSAFE_expValNoExposure } from '@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure';
|
|
10
11
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
11
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
12
12
|
import { createAttributionColorMap, getAttributionKey, getAttributionKeyForChange, getColorSchemeForChange, isAttributionColoringEnabled, isContributorTagsEnabled } from '../decorations/colorSchemes/attributions';
|
|
13
13
|
import { createDocMarginAnchorWidget } from '../decorations/createAnchorDecorationWidgets';
|
|
14
14
|
import { createBlockChangedDecoration } from '../decorations/createBlockChangedDecoration';
|
|
@@ -615,7 +615,7 @@ const calculateDiffDecorationsInner = ({
|
|
|
615
615
|
// For a large inserted table, skip the per-cell inline decorations that
|
|
616
616
|
// freeze the browser on re-render. Only active when Review moment is
|
|
617
617
|
// eligible (xstate + M1).
|
|
618
|
-
const useCoarseTableDecoration = isSmartNodeLevel &&
|
|
618
|
+
const useCoarseTableDecoration = isSmartNodeLevel && isAiXstateMigrationEnabledNoExposure() && UNSAFE_expValNoExposure('platform_editor_ai_streaming_ux_experience_m1', 'isEnabled', false) === true && isLargeInsertedTableRange(tr.doc, change.fromB, change.toB);
|
|
619
619
|
// Whether the deleted-content widget will actually be rendered for this
|
|
620
620
|
// change. Used to decide if indicator anchor positions should be adjusted
|
|
621
621
|
// inward — when the widget is present the anchor must stay at the block
|
|
@@ -845,7 +845,7 @@ const calculateDiffDecorationsInner = ({
|
|
|
845
845
|
}));
|
|
846
846
|
// If the original node position is known (e.g. a panel type change), also render
|
|
847
847
|
// the old block node as a "deleted" widget so the reviewer sees the before/after.
|
|
848
|
-
const isSmartNodeLevelAttrChange = diffType === 'smart' && fg('platform_editor_ai_smart_diff') &&
|
|
848
|
+
const isSmartNodeLevelAttrChange = diffType === 'smart' && fg('platform_editor_ai_smart_diff') && isAiXstateMigrationEnabledNoExposure() && UNSAFE_expValNoExposure('platform_editor_ai_streaming_ux_experience_m1', 'isEnabled', false) === true;
|
|
849
849
|
if (isSmartNodeLevelAttrChange && change.fromA !== undefined && change.toA !== undefined) {
|
|
850
850
|
const placeBelow = deletedDiffPlacement === 'bottom';
|
|
851
851
|
decorations.push(...createNodeChangedDecorationWidget({
|
|
@@ -651,6 +651,14 @@ export function buildDeletedDecorationMarkerVariableSimple(colors) {
|
|
|
651
651
|
});
|
|
652
652
|
}
|
|
653
653
|
|
|
654
|
+
/** Marker and direct-content variables for deleted list items. */
|
|
655
|
+
export function buildDeletedListItemMarkerVariable(colors) {
|
|
656
|
+
return convertToInlineCss({
|
|
657
|
+
'--diff-decoration-content-opacity': '0.8',
|
|
658
|
+
'--diff-decoration-marker-color': borderAccent(colors.deleteColor)
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
|
|
654
662
|
/** Whether the emphasised state is stated in the bottom border rather than a deeper highlight. */
|
|
655
663
|
function usesUnderlineEmphasis(colors) {
|
|
656
664
|
return colors.deletedInlineActiveEmphasis === 'underline';
|
|
@@ -1041,7 +1049,7 @@ export function buildDeletedBlockNodeStyle(colors, category, isActive) {
|
|
|
1041
1049
|
case 'container':
|
|
1042
1050
|
return isStrikethrough ? buildDeletedInlineStyle(colors, false) : buildDeletedDecorationMarkerVariableSimple(colors);
|
|
1043
1051
|
case 'listItem':
|
|
1044
|
-
return colors.deletedNodeEmphasis === 'stateful' ? statefulMarker() : buildDeletedDecorationMarkerVariableSimple(colors);
|
|
1052
|
+
return colors.deletedNodeEmphasis === 'stateful' ? statefulMarker() : fg('platform_editor_ai_show_diff_patch_2') ? buildDeletedListItemMarkerVariable(colors) : buildDeletedDecorationMarkerVariableSimple(colors);
|
|
1045
1053
|
case 'marker':
|
|
1046
1054
|
return colors.deletedNodeEmphasis === 'stateful' ? statefulMarker() : buildDeletedInlineStyleStandard(colors, 'new');
|
|
1047
1055
|
case 'generic':
|
|
@@ -135,6 +135,10 @@ export const deletedDecorationMarkerVariable = convertToInlineCss({
|
|
|
135
135
|
'--diff-decoration-marker-ring-width': '1px',
|
|
136
136
|
opacity: 0.8
|
|
137
137
|
});
|
|
138
|
+
export const deletedListItemMarkerVariable = convertToInlineCss({
|
|
139
|
+
'--diff-decoration-content-opacity': '0.8',
|
|
140
|
+
'--diff-decoration-marker-color': "var(--ds-border-accent-gray, #7D818A)"
|
|
141
|
+
});
|
|
138
142
|
export const addedCellOverlayStyle = convertToInlineCss({
|
|
139
143
|
position: 'absolute',
|
|
140
144
|
top: 0,
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
* cleanup, together with `colorSchemes/standard.ts`, `colorSchemes/traditional.ts` (EDITOR-8281).
|
|
10
10
|
*/
|
|
11
11
|
import { convertToInlineCss } from '@atlaskit/editor-common/css-helper';
|
|
12
|
-
import {
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
13
|
+
import { standardDecorationMarkerVariable, deletedDecorationMarkerVariable, deletedListItemMarkerVariable, editingStyleQuoteNode, editingStyleRuleNode, editingStyleCardBlockNode, editingStyleNode, getStandardDeletedContentStyleNew, deletedStyleQuoteNode, addedCellOverlayStyle, addedCellOverlayRoundedStyle, deletedCellOverlayStyle, deletedCellOverlayRoundedStyle } from './colorSchemes/standard';
|
|
13
14
|
import { traditionalDecorationMarkerVariableActive, traditionalDecorationMarkerVariableNew, traditionalDeletedDecorationMarkerVariableActive, traditionalDeletedDecorationMarkerVariableNew, traditionalStyleQuoteNodeActive, traditionalStyleQuoteNodeNew, traditionalStyleRuleNodeActive, traditionalStyleRuleNodeNew, traditionalStyleCardBlockNodeActive, traditionalStyleCardBlockNodeNew, traditionalStyleNodeActive, traditionalStyleNodeNew, getDeletedTraditionalInlineStyle, deletedTraditionalStyleQuoteNode, traditionalAddedCellOverlayStyle, traditionalAddedCellOverlayRoundedStyle, deletedTraditionalCellOverlayStyle, deletedTraditionalCellOverlayRoundedStyle } from './colorSchemes/traditional';
|
|
14
15
|
|
|
15
16
|
/** Verbatim copy of the pre-refactor cell-overlay style selection. */
|
|
@@ -57,7 +58,7 @@ export const getBlockNodeStyleLegacy = ({
|
|
|
57
58
|
return isTraditional && isActive ? traditionalDecorationMarkerVariableActive : isTraditional ? traditionalDecorationMarkerVariableNew : standardDecorationMarkerVariable;
|
|
58
59
|
}
|
|
59
60
|
if (nodeName === 'listItem') {
|
|
60
|
-
return isTraditional && isActive ? traditionalDeletedDecorationMarkerVariableActive : isTraditional ? traditionalDeletedDecorationMarkerVariableNew : deletedDecorationMarkerVariable;
|
|
61
|
+
return isTraditional && isActive ? traditionalDeletedDecorationMarkerVariableActive : isTraditional ? traditionalDeletedDecorationMarkerVariableNew : fg('platform_editor_ai_show_diff_patch_2') ? deletedListItemMarkerVariable : deletedDecorationMarkerVariable;
|
|
61
62
|
}
|
|
62
63
|
return isTraditional && isActive ? traditionalDeletedDecorationMarkerVariableActive : isTraditional ? traditionalDeletedDecorationMarkerVariableNew : getStandardDeletedContentStyleNew();
|
|
63
64
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { PanelSharedCssClassName } from '@atlaskit/editor-common/styles/panel';
|
|
2
|
+
import { getBaseNodeTypeName } from '@atlaskit/editor-common/utils/node-type-utils';
|
|
1
3
|
/**
|
|
2
4
|
* Node types that can safely be reduced to an empty shell.
|
|
3
5
|
*
|
|
4
6
|
* A shell only replicates a margin if it collapses to nothing itself, which needs zero height and
|
|
5
|
-
* no vertical border or padding. Textblocks and lists qualify;
|
|
6
|
-
*
|
|
7
|
-
*
|
|
7
|
+
* no vertical border or padding. Textblocks and lists qualify; panels need their painted box
|
|
8
|
+
* hidden and their flex layout removed. Nodes with intrinsic sizing (tables are `display: table`,
|
|
9
|
+
* media has a measured height) are left alone.
|
|
8
10
|
*/
|
|
9
|
-
const isShapeableNode = node => node.isTextblock || ['bulletList', 'orderedList'].includes(node.type.name);
|
|
11
|
+
const isShapeableNode = node => node.isTextblock || ['bulletList', 'orderedList'].includes(node.type.name) || getBaseNodeTypeName(node.type) === 'panel';
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
* An invisible element shaped like `node`, used to supply the top margin `node` no longer gets.
|
|
@@ -50,6 +52,13 @@ export const createNodeShapedMarginSpacer = ({
|
|
|
50
52
|
serialized.dataset.testid = testId;
|
|
51
53
|
serialized.setAttribute('aria-hidden', 'true');
|
|
52
54
|
serialized.contentEditable = 'false';
|
|
55
|
+
if (getBaseNodeTypeName(node.type) === 'panel') {
|
|
56
|
+
// Schema serialization lacks the node view's class, which carries the panel's margin.
|
|
57
|
+
// Hide the painted shell and allow its margins to collapse through a zero-height block.
|
|
58
|
+
serialized.classList.add(PanelSharedCssClassName.prefix);
|
|
59
|
+
serialized.style.display = 'block';
|
|
60
|
+
serialized.style.visibility = 'hidden';
|
|
61
|
+
}
|
|
53
62
|
|
|
54
63
|
// Zero height with no vertical border or padding keeps the spacer self-collapsing: its margins
|
|
55
64
|
// stay adjoining, so they collapse with the neighbours into a single margin equal to the largest
|
|
@@ -100,7 +100,22 @@ function groupTouchingDecorations(decorations, isInlineDecoration) {
|
|
|
100
100
|
// A zero-width decoration must not extend the run and bridge a gap.
|
|
101
101
|
clusterTo = Math.max(clusterTo, decoration.to);
|
|
102
102
|
});
|
|
103
|
-
|
|
103
|
+
|
|
104
|
+
// A deleted-content widget is left unattributed so it carries no tag of its own, and spans no
|
|
105
|
+
// range, so it is never a change in its own right. On its own it becomes a stop that reveals
|
|
106
|
+
// nothing, ahead of the stop for the change it belongs to — so it joins the attributed group
|
|
107
|
+
// that contains it. Only the stop list changes: the widget keeps its own decoration and, having
|
|
108
|
+
// no tag, stays no hover target.
|
|
109
|
+
const attributedGroups = groups.filter(group => group.contributor !== '');
|
|
110
|
+
const stops = groups.filter(group => {
|
|
111
|
+
if (group.contributor !== '' || group.decorations.some(dec => dec.from !== dec.to)) {
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
const host = attributedGroups.find(attributed => attributed.from <= group.from && group.to <= attributed.to);
|
|
115
|
+
host === null || host === void 0 ? void 0 : host.decorations.push(...group.decorations);
|
|
116
|
+
return host === undefined;
|
|
117
|
+
});
|
|
118
|
+
return stops.map(({
|
|
104
119
|
decorations: group,
|
|
105
120
|
from,
|
|
106
121
|
to
|
|
@@ -19,16 +19,17 @@ const SHOW_DIFF_AGENT_BRANDS = {
|
|
|
19
19
|
'agent-brand-databricks': 'databricks',
|
|
20
20
|
'agent-brand-gemini': 'gemini',
|
|
21
21
|
'agent-brand-manus': 'manus',
|
|
22
|
-
'agent-brand-slack': 'slack'
|
|
22
|
+
'agent-brand-slack': 'slack',
|
|
23
|
+
'agent-brand-antigravity': 'antigravity',
|
|
24
|
+
'agent-brand-copilot': 'copilot'
|
|
23
25
|
};
|
|
24
26
|
|
|
25
27
|
/**
|
|
26
28
|
* Brands that prefer the account's real avatar over their fixed glyph when the invoking profile
|
|
27
29
|
* has one. Brands with a fixed glyph (Claude, ChatGPT, Amplitude, Cortex, Databricks, Gemini, Manus,
|
|
28
|
-
* Slack) intentionally keep it always (see `AGENT_KIND_ICONS` in
|
|
29
|
-
* `contributorAvatarRenderer.ts`).
|
|
30
|
+
* Slack) intentionally keep it always (see `AGENT_KIND_ICONS` in `contributorAvatarRenderer.ts`).
|
|
30
31
|
*/
|
|
31
|
-
const AVATAR_ELIGIBLE_BRANDS = new Set(['figma', 'lovable', 'replit', 'rovo']);
|
|
32
|
+
const AVATAR_ELIGIBLE_BRANDS = new Set(['antigravity', 'copilot', 'figma', 'lovable', 'replit', 'rovo']);
|
|
32
33
|
|
|
33
34
|
/** Known external agent types emitted by Confluence's agent identification service that carry
|
|
34
35
|
* no `@atlaskit/agent-color` brand — a generic labelled fallback. */
|
|
@@ -38,7 +39,6 @@ const EXTERNAL_AGENT_NAMES = {
|
|
|
38
39
|
runlayer: 'Runlayer',
|
|
39
40
|
zed: 'Zed',
|
|
40
41
|
ampcode: 'Ampcode',
|
|
41
|
-
antigravity: 'Antigravity',
|
|
42
42
|
devin_cli: 'Devin CLI',
|
|
43
43
|
pi_agent: 'Pi Agent'
|
|
44
44
|
};
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
/** Branded agent presentations supported by contributor tags. */
|
|
21
21
|
|
|
22
|
-
export const DIFF_AGENT_BRANDS = new Set(['rovo', 'claude', 'chatgpt', 'figma', 'lovable', 'replit', 'amplitude', 'cortex', 'databricks', 'gemini', 'manus', 'slack']);
|
|
22
|
+
export const DIFF_AGENT_BRANDS = new Set(['rovo', 'claude', 'chatgpt', 'figma', 'lovable', 'replit', 'amplitude', 'cortex', 'databricks', 'gemini', 'manus', 'slack', 'antigravity', 'copilot']);
|
|
23
23
|
|
|
24
24
|
/** The brand id `@atlaskit/agent-color` registers each `AgentBrandColorScheme` under. */
|
|
25
25
|
|
|
@@ -37,10 +37,10 @@ export const CONTRIBUTOR_TAG_REVEALED_ATTRIBUTE = 'data-revealed';
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* Backstop for removing a fading-out tag: a cancelled transition fires no `transitionend`. Must stay
|
|
40
|
-
* above the fade's
|
|
40
|
+
* above the fade's 500ms, which lives in another package's stylesheet and cannot be read back as a
|
|
41
41
|
* number — hence the wide margin. Raise in step with that duration.
|
|
42
42
|
*/
|
|
43
|
-
export const TAG_EXIT_FALLBACK_MS =
|
|
43
|
+
export const TAG_EXIT_FALLBACK_MS = 800;
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* The tooltip's look, inline rather than through `VANILLA_TOOLTIP_DEFAULT_CLASS`: this tooltip is
|
|
@@ -9,6 +9,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
9
9
|
import isEqual from 'lodash/isEqual';
|
|
10
10
|
import memoizeOne from 'memoize-one';
|
|
11
11
|
import { ChangeSet, simplifyChanges } from 'prosemirror-changeset';
|
|
12
|
+
import { isAiXstateMigrationEnabledNoExposure } from '@atlaskit/editor-common/ai-xstate-migration-no-exposure';
|
|
12
13
|
import { areDocsEqualByBlockStructureAndText } from '@atlaskit/editor-common/utils/areDocsEqualByBlockStructureAndText';
|
|
13
14
|
import { areNodesEqualIgnoreAttrs } from '@atlaskit/editor-common/utils/document';
|
|
14
15
|
import { Mapping } from '@atlaskit/editor-prosemirror/transform';
|
|
@@ -16,7 +17,6 @@ import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
|
16
17
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
17
18
|
import { UNSAFE_expValNoExposure } from '@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure';
|
|
18
19
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
19
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
20
20
|
import { createAttributionColorMap, getAttributionKey, getAttributionKeyForChange, getColorSchemeForChange, isAttributionColoringEnabled, isContributorTagsEnabled } from '../decorations/colorSchemes/attributions';
|
|
21
21
|
import { createDocMarginAnchorWidget } from '../decorations/createAnchorDecorationWidgets';
|
|
22
22
|
import { createBlockChangedDecoration } from '../decorations/createBlockChangedDecoration';
|
|
@@ -672,7 +672,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
672
672
|
// For a large inserted table, skip the per-cell inline decorations that
|
|
673
673
|
// freeze the browser on re-render. Only active when Review moment is
|
|
674
674
|
// eligible (xstate + M1).
|
|
675
|
-
var useCoarseTableDecoration = isSmartNodeLevel &&
|
|
675
|
+
var useCoarseTableDecoration = isSmartNodeLevel && isAiXstateMigrationEnabledNoExposure() && UNSAFE_expValNoExposure('platform_editor_ai_streaming_ux_experience_m1', 'isEnabled', false) === true && isLargeInsertedTableRange(tr.doc, change.fromB, change.toB);
|
|
676
676
|
// Whether the deleted-content widget will actually be rendered for this
|
|
677
677
|
// change. Used to decide if indicator anchor positions should be adjusted
|
|
678
678
|
// inward — when the widget is present the anchor must stay at the block
|
|
@@ -932,7 +932,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
932
932
|
})));
|
|
933
933
|
// If the original node position is known (e.g. a panel type change), also render
|
|
934
934
|
// the old block node as a "deleted" widget so the reviewer sees the before/after.
|
|
935
|
-
var isSmartNodeLevelAttrChange = diffType === 'smart' && fg('platform_editor_ai_smart_diff') &&
|
|
935
|
+
var isSmartNodeLevelAttrChange = diffType === 'smart' && fg('platform_editor_ai_smart_diff') && isAiXstateMigrationEnabledNoExposure() && UNSAFE_expValNoExposure('platform_editor_ai_streaming_ux_experience_m1', 'isEnabled', false) === true;
|
|
936
936
|
if (isSmartNodeLevelAttrChange && change.fromA !== undefined && change.toA !== undefined) {
|
|
937
937
|
var placeBelow = deletedDiffPlacement === 'bottom';
|
|
938
938
|
decorations.push.apply(decorations, _toConsumableArray(createNodeChangedDecorationWidget({
|
|
@@ -656,6 +656,14 @@ export function buildDeletedDecorationMarkerVariableSimple(colors) {
|
|
|
656
656
|
});
|
|
657
657
|
}
|
|
658
658
|
|
|
659
|
+
/** Marker and direct-content variables for deleted list items. */
|
|
660
|
+
export function buildDeletedListItemMarkerVariable(colors) {
|
|
661
|
+
return convertToInlineCss({
|
|
662
|
+
'--diff-decoration-content-opacity': '0.8',
|
|
663
|
+
'--diff-decoration-marker-color': borderAccent(colors.deleteColor)
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
|
|
659
667
|
/** Whether the emphasised state is stated in the bottom border rather than a deeper highlight. */
|
|
660
668
|
function usesUnderlineEmphasis(colors) {
|
|
661
669
|
return colors.deletedInlineActiveEmphasis === 'underline';
|
|
@@ -1045,7 +1053,7 @@ export function buildDeletedBlockNodeStyle(colors, category, isActive) {
|
|
|
1045
1053
|
case 'container':
|
|
1046
1054
|
return isStrikethrough ? buildDeletedInlineStyle(colors, false) : buildDeletedDecorationMarkerVariableSimple(colors);
|
|
1047
1055
|
case 'listItem':
|
|
1048
|
-
return colors.deletedNodeEmphasis === 'stateful' ? statefulMarker() : buildDeletedDecorationMarkerVariableSimple(colors);
|
|
1056
|
+
return colors.deletedNodeEmphasis === 'stateful' ? statefulMarker() : fg('platform_editor_ai_show_diff_patch_2') ? buildDeletedListItemMarkerVariable(colors) : buildDeletedDecorationMarkerVariableSimple(colors);
|
|
1049
1057
|
case 'marker':
|
|
1050
1058
|
return colors.deletedNodeEmphasis === 'stateful' ? statefulMarker() : buildDeletedInlineStyleStandard(colors, 'new');
|
|
1051
1059
|
case 'generic':
|
|
@@ -146,6 +146,10 @@ export var deletedDecorationMarkerVariable = convertToInlineCss({
|
|
|
146
146
|
'--diff-decoration-marker-ring-width': '1px',
|
|
147
147
|
opacity: 0.8
|
|
148
148
|
});
|
|
149
|
+
export var deletedListItemMarkerVariable = convertToInlineCss({
|
|
150
|
+
'--diff-decoration-content-opacity': '0.8',
|
|
151
|
+
'--diff-decoration-marker-color': "var(--ds-border-accent-gray, #7D818A)"
|
|
152
|
+
});
|
|
149
153
|
export var addedCellOverlayStyle = convertToInlineCss({
|
|
150
154
|
position: 'absolute',
|
|
151
155
|
top: 0,
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
* cleanup, together with `colorSchemes/standard.ts`, `colorSchemes/traditional.ts` (EDITOR-8281).
|
|
10
10
|
*/
|
|
11
11
|
import { convertToInlineCss } from '@atlaskit/editor-common/css-helper';
|
|
12
|
-
import {
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
13
|
+
import { standardDecorationMarkerVariable, deletedDecorationMarkerVariable, deletedListItemMarkerVariable, editingStyleQuoteNode, editingStyleRuleNode, editingStyleCardBlockNode, editingStyleNode, getStandardDeletedContentStyleNew, deletedStyleQuoteNode, addedCellOverlayStyle, addedCellOverlayRoundedStyle, deletedCellOverlayStyle, deletedCellOverlayRoundedStyle } from './colorSchemes/standard';
|
|
13
14
|
import { traditionalDecorationMarkerVariableActive, traditionalDecorationMarkerVariableNew, traditionalDeletedDecorationMarkerVariableActive, traditionalDeletedDecorationMarkerVariableNew, traditionalStyleQuoteNodeActive, traditionalStyleQuoteNodeNew, traditionalStyleRuleNodeActive, traditionalStyleRuleNodeNew, traditionalStyleCardBlockNodeActive, traditionalStyleCardBlockNodeNew, traditionalStyleNodeActive, traditionalStyleNodeNew, getDeletedTraditionalInlineStyle, deletedTraditionalStyleQuoteNode, traditionalAddedCellOverlayStyle, traditionalAddedCellOverlayRoundedStyle, deletedTraditionalCellOverlayStyle, deletedTraditionalCellOverlayRoundedStyle } from './colorSchemes/traditional';
|
|
14
15
|
|
|
15
16
|
/** Verbatim copy of the pre-refactor cell-overlay style selection. */
|
|
@@ -57,7 +58,7 @@ export var getBlockNodeStyleLegacy = function getBlockNodeStyleLegacy(_ref2) {
|
|
|
57
58
|
return isTraditional && isActive ? traditionalDecorationMarkerVariableActive : isTraditional ? traditionalDecorationMarkerVariableNew : standardDecorationMarkerVariable;
|
|
58
59
|
}
|
|
59
60
|
if (nodeName === 'listItem') {
|
|
60
|
-
return isTraditional && isActive ? traditionalDeletedDecorationMarkerVariableActive : isTraditional ? traditionalDeletedDecorationMarkerVariableNew : deletedDecorationMarkerVariable;
|
|
61
|
+
return isTraditional && isActive ? traditionalDeletedDecorationMarkerVariableActive : isTraditional ? traditionalDeletedDecorationMarkerVariableNew : fg('platform_editor_ai_show_diff_patch_2') ? deletedListItemMarkerVariable : deletedDecorationMarkerVariable;
|
|
61
62
|
}
|
|
62
63
|
return isTraditional && isActive ? traditionalDeletedDecorationMarkerVariableActive : isTraditional ? traditionalDeletedDecorationMarkerVariableNew : getStandardDeletedContentStyleNew();
|
|
63
64
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { PanelSharedCssClassName } from '@atlaskit/editor-common/styles/panel';
|
|
2
|
+
import { getBaseNodeTypeName } from '@atlaskit/editor-common/utils/node-type-utils';
|
|
1
3
|
/**
|
|
2
4
|
* Node types that can safely be reduced to an empty shell.
|
|
3
5
|
*
|
|
4
6
|
* A shell only replicates a margin if it collapses to nothing itself, which needs zero height and
|
|
5
|
-
* no vertical border or padding. Textblocks and lists qualify;
|
|
6
|
-
*
|
|
7
|
-
*
|
|
7
|
+
* no vertical border or padding. Textblocks and lists qualify; panels need their painted box
|
|
8
|
+
* hidden and their flex layout removed. Nodes with intrinsic sizing (tables are `display: table`,
|
|
9
|
+
* media has a measured height) are left alone.
|
|
8
10
|
*/
|
|
9
11
|
var isShapeableNode = function isShapeableNode(node) {
|
|
10
|
-
return node.isTextblock || ['bulletList', 'orderedList'].includes(node.type.name);
|
|
12
|
+
return node.isTextblock || ['bulletList', 'orderedList'].includes(node.type.name) || getBaseNodeTypeName(node.type) === 'panel';
|
|
11
13
|
};
|
|
12
14
|
|
|
13
15
|
/**
|
|
@@ -51,6 +53,13 @@ export var createNodeShapedMarginSpacer = function createNodeShapedMarginSpacer(
|
|
|
51
53
|
serialized.dataset.testid = testId;
|
|
52
54
|
serialized.setAttribute('aria-hidden', 'true');
|
|
53
55
|
serialized.contentEditable = 'false';
|
|
56
|
+
if (getBaseNodeTypeName(node.type) === 'panel') {
|
|
57
|
+
// Schema serialization lacks the node view's class, which carries the panel's margin.
|
|
58
|
+
// Hide the painted shell and allow its margins to collapse through a zero-height block.
|
|
59
|
+
serialized.classList.add(PanelSharedCssClassName.prefix);
|
|
60
|
+
serialized.style.display = 'block';
|
|
61
|
+
serialized.style.visibility = 'hidden';
|
|
62
|
+
}
|
|
54
63
|
|
|
55
64
|
// Zero height with no vertical border or padding keeps the spacer self-collapsing: its margins
|
|
56
65
|
// stay adjoining, so they collapse with the neighbours into a single margin equal to the largest
|
|
@@ -108,7 +108,29 @@ function groupTouchingDecorations(decorations, isInlineDecoration) {
|
|
|
108
108
|
// A zero-width decoration must not extend the run and bridge a gap.
|
|
109
109
|
clusterTo = Math.max(clusterTo, decoration.to);
|
|
110
110
|
});
|
|
111
|
-
|
|
111
|
+
|
|
112
|
+
// A deleted-content widget is left unattributed so it carries no tag of its own, and spans no
|
|
113
|
+
// range, so it is never a change in its own right. On its own it becomes a stop that reveals
|
|
114
|
+
// nothing, ahead of the stop for the change it belongs to — so it joins the attributed group
|
|
115
|
+
// that contains it. Only the stop list changes: the widget keeps its own decoration and, having
|
|
116
|
+
// no tag, stays no hover target.
|
|
117
|
+
var attributedGroups = groups.filter(function (group) {
|
|
118
|
+
return group.contributor !== '';
|
|
119
|
+
});
|
|
120
|
+
var stops = groups.filter(function (group) {
|
|
121
|
+
var _host$decorations;
|
|
122
|
+
if (group.contributor !== '' || group.decorations.some(function (dec) {
|
|
123
|
+
return dec.from !== dec.to;
|
|
124
|
+
})) {
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
var host = attributedGroups.find(function (attributed) {
|
|
128
|
+
return attributed.from <= group.from && group.to <= attributed.to;
|
|
129
|
+
});
|
|
130
|
+
host === null || host === void 0 || (_host$decorations = host.decorations).push.apply(_host$decorations, _toConsumableArray(group.decorations));
|
|
131
|
+
return host === undefined;
|
|
132
|
+
});
|
|
133
|
+
return stops.map(function (_ref) {
|
|
112
134
|
var _ref2, _group$find;
|
|
113
135
|
var group = _ref.decorations,
|
|
114
136
|
from = _ref.from,
|
|
@@ -25,16 +25,17 @@ var SHOW_DIFF_AGENT_BRANDS = {
|
|
|
25
25
|
'agent-brand-databricks': 'databricks',
|
|
26
26
|
'agent-brand-gemini': 'gemini',
|
|
27
27
|
'agent-brand-manus': 'manus',
|
|
28
|
-
'agent-brand-slack': 'slack'
|
|
28
|
+
'agent-brand-slack': 'slack',
|
|
29
|
+
'agent-brand-antigravity': 'antigravity',
|
|
30
|
+
'agent-brand-copilot': 'copilot'
|
|
29
31
|
};
|
|
30
32
|
|
|
31
33
|
/**
|
|
32
34
|
* Brands that prefer the account's real avatar over their fixed glyph when the invoking profile
|
|
33
35
|
* has one. Brands with a fixed glyph (Claude, ChatGPT, Amplitude, Cortex, Databricks, Gemini, Manus,
|
|
34
|
-
* Slack) intentionally keep it always (see `AGENT_KIND_ICONS` in
|
|
35
|
-
* `contributorAvatarRenderer.ts`).
|
|
36
|
+
* Slack) intentionally keep it always (see `AGENT_KIND_ICONS` in `contributorAvatarRenderer.ts`).
|
|
36
37
|
*/
|
|
37
|
-
var AVATAR_ELIGIBLE_BRANDS = new Set(['figma', 'lovable', 'replit', 'rovo']);
|
|
38
|
+
var AVATAR_ELIGIBLE_BRANDS = new Set(['antigravity', 'copilot', 'figma', 'lovable', 'replit', 'rovo']);
|
|
38
39
|
|
|
39
40
|
/** Known external agent types emitted by Confluence's agent identification service that carry
|
|
40
41
|
* no `@atlaskit/agent-color` brand — a generic labelled fallback. */
|
|
@@ -44,7 +45,6 @@ var EXTERNAL_AGENT_NAMES = {
|
|
|
44
45
|
runlayer: 'Runlayer',
|
|
45
46
|
zed: 'Zed',
|
|
46
47
|
ampcode: 'Ampcode',
|
|
47
|
-
antigravity: 'Antigravity',
|
|
48
48
|
devin_cli: 'Devin CLI',
|
|
49
49
|
pi_agent: 'Pi Agent'
|
|
50
50
|
};
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
/** Branded agent presentations supported by contributor tags. */
|
|
21
21
|
|
|
22
|
-
export var DIFF_AGENT_BRANDS = new Set(['rovo', 'claude', 'chatgpt', 'figma', 'lovable', 'replit', 'amplitude', 'cortex', 'databricks', 'gemini', 'manus', 'slack']);
|
|
22
|
+
export var DIFF_AGENT_BRANDS = new Set(['rovo', 'claude', 'chatgpt', 'figma', 'lovable', 'replit', 'amplitude', 'cortex', 'databricks', 'gemini', 'manus', 'slack', 'antigravity', 'copilot']);
|
|
23
23
|
|
|
24
24
|
/** The brand id `@atlaskit/agent-color` registers each `AgentBrandColorScheme` under. */
|
|
25
25
|
|
|
@@ -38,10 +38,10 @@ export var CONTRIBUTOR_TAG_REVEALED_ATTRIBUTE = 'data-revealed';
|
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* Backstop for removing a fading-out tag: a cancelled transition fires no `transitionend`. Must stay
|
|
41
|
-
* above the fade's
|
|
41
|
+
* above the fade's 500ms, which lives in another package's stylesheet and cannot be read back as a
|
|
42
42
|
* number — hence the wide margin. Raise in step with that duration.
|
|
43
43
|
*/
|
|
44
|
-
export var TAG_EXIT_FALLBACK_MS =
|
|
44
|
+
export var TAG_EXIT_FALLBACK_MS = 800;
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* The tooltip's look, inline rather than through `VANILLA_TOOLTIP_DEFAULT_CLASS`: this tooltip is
|
|
@@ -111,6 +111,8 @@ export declare function buildDecorationMarkerVariableActive(colors: DiffColorSch
|
|
|
111
111
|
export declare function buildDeletedDecorationMarkerVariable(colors: DiffColorScheme): string;
|
|
112
112
|
/** Opacity only, no position or strikethrough. Used by 'static' schemes. */
|
|
113
113
|
export declare function buildDeletedDecorationMarkerVariableSimple(colors: DiffColorScheme): string;
|
|
114
|
+
/** Marker and direct-content variables for deleted list items. */
|
|
115
|
+
export declare function buildDeletedListItemMarkerVariable(colors: DiffColorScheme): string;
|
|
114
116
|
/** Extended deleted inline style — background highlight with an accent or background-matched bottom border. */
|
|
115
117
|
export declare function buildDeletedInlineContentStyleExtended(colors: DiffColorScheme, isActive?: boolean): string;
|
|
116
118
|
/** 'glyphTint' deleted inline style — tints the glyph itself via `color:`. */
|
|
@@ -33,6 +33,7 @@ export declare const editingStyleNode: string;
|
|
|
33
33
|
export declare const editingStyleCardBlockNode: string;
|
|
34
34
|
export declare const standardDecorationMarkerVariable: string;
|
|
35
35
|
export declare const deletedDecorationMarkerVariable: string;
|
|
36
|
+
export declare const deletedListItemMarkerVariable: string;
|
|
36
37
|
export declare const addedCellOverlayStyle: string;
|
|
37
38
|
export declare const addedCellOverlayRoundedStyle: string;
|
|
38
39
|
export declare const deletedCellOverlayStyle: string;
|
|
@@ -40,7 +40,7 @@ export type StepWithAttribution<TStep> = {
|
|
|
40
40
|
stepAttribution?: DiffStepAttribution;
|
|
41
41
|
};
|
|
42
42
|
/** Branded agent presentations supported by contributor tags. */
|
|
43
|
-
export type DiffAgentBrand = 'rovo' | 'claude' | 'chatgpt' | 'figma' | 'lovable' | 'replit' | 'amplitude' | 'cortex' | 'databricks' | 'gemini' | 'manus' | 'slack';
|
|
43
|
+
export type DiffAgentBrand = 'rovo' | 'claude' | 'chatgpt' | 'figma' | 'lovable' | 'replit' | 'amplitude' | 'cortex' | 'databricks' | 'gemini' | 'manus' | 'slack' | 'antigravity' | 'copilot';
|
|
44
44
|
export declare const DIFF_AGENT_BRANDS: ReadonlySet<DiffAgentBrand>;
|
|
45
45
|
/** The brand id `@atlaskit/agent-color` registers each `AgentBrandColorScheme` under. */
|
|
46
46
|
type AgentColorBrandId = AgentBrandColorScheme extends `agent-brand-${infer BrandId}` ? BrandId : never;
|
|
@@ -30,10 +30,10 @@ export declare const CONTRIBUTOR_TAG_CLASS = "ak-editor-diff-contributor-tag";
|
|
|
30
30
|
export declare const CONTRIBUTOR_TAG_REVEALED_ATTRIBUTE = "data-revealed";
|
|
31
31
|
/**
|
|
32
32
|
* Backstop for removing a fading-out tag: a cancelled transition fires no `transitionend`. Must stay
|
|
33
|
-
* above the fade's
|
|
33
|
+
* above the fade's 500ms, which lives in another package's stylesheet and cannot be read back as a
|
|
34
34
|
* number — hence the wide margin. Raise in step with that duration.
|
|
35
35
|
*/
|
|
36
|
-
export declare const TAG_EXIT_FALLBACK_MS =
|
|
36
|
+
export declare const TAG_EXIT_FALLBACK_MS = 800;
|
|
37
37
|
/**
|
|
38
38
|
* The tooltip's look, inline rather than through `VANILLA_TOOLTIP_DEFAULT_CLASS`: this tooltip is
|
|
39
39
|
* hoisted out of the tag, and that class's rule is scoped under `.ProseMirror` — see
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-show-diff",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "26.0.0",
|
|
4
4
|
"description": "ShowDiff plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"@atlaskit/agent-color": "^1.0.0",
|
|
30
30
|
"@atlaskit/avatar": "^30.0.0",
|
|
31
31
|
"@atlaskit/custom-steps": "^1.1.0",
|
|
32
|
-
"@atlaskit/editor-plugin-accessibility-utils": "^
|
|
33
|
-
"@atlaskit/editor-plugin-analytics": "^
|
|
34
|
-
"@atlaskit/editor-plugin-limited-mode": "^
|
|
35
|
-
"@atlaskit/editor-plugin-user-intent": "^
|
|
32
|
+
"@atlaskit/editor-plugin-accessibility-utils": "^28.0.0",
|
|
33
|
+
"@atlaskit/editor-plugin-analytics": "^28.0.0",
|
|
34
|
+
"@atlaskit/editor-plugin-limited-mode": "^25.0.0",
|
|
35
|
+
"@atlaskit/editor-plugin-user-intent": "^26.0.0",
|
|
36
36
|
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
37
|
-
"@atlaskit/editor-shared-styles": "^4.
|
|
37
|
+
"@atlaskit/editor-shared-styles": "^4.5.0",
|
|
38
38
|
"@atlaskit/editor-tables": "^3.2.0",
|
|
39
39
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
40
40
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
41
|
-
"@atlaskit/primitives": "^22.
|
|
41
|
+
"@atlaskit/primitives": "^22.6.0",
|
|
42
42
|
"@atlaskit/tmp-editor-statsig": "^240.0.0",
|
|
43
43
|
"@atlaskit/tokens": "^20.6.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@atlaskit/button": "^25.4.0",
|
|
54
54
|
"@atlaskit/css": "^1.1.0",
|
|
55
55
|
"@atlaskit/dropdown-menu": "^21.0.0",
|
|
56
|
-
"@atlaskit/editor-core": "^
|
|
56
|
+
"@atlaskit/editor-core": "^238.0.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",
|
|
@@ -63,15 +63,15 @@
|
|
|
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": "^
|
|
67
|
-
"@atlassian/editor-plugin-ai": "^
|
|
66
|
+
"@atlassian/editor-ai-injected-editors": "^42.0.0",
|
|
67
|
+
"@atlassian/editor-plugin-ai": "^82.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": "^
|
|
74
|
+
"@atlaskit/editor-common": "^132.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"
|