@atlaskit/editor-plugin-show-diff 3.2.3 → 3.2.4

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.
@@ -1,15 +1,15 @@
1
1
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
2
- import { trackChangesMessages } from '@atlaskit/editor-common/messages';
3
2
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
4
3
  import { fg } from '@atlaskit/platform-feature-flags';
4
+ import { createDeletedStyleWrapperWithoutOpacity, handleBlockNodeView } from './deletedBlocksHandler';
5
5
  import { handleDeletedRows } from './deletedRowsHandler';
6
6
  import { findSafeInsertPos } from './findSafeInsertPos';
7
7
  var editingStyle = convertToInlineCss({
8
- background: "var(--ds-background-accent-purple-subtlest, #F3F0FF)",
8
+ background: "var(--ds-background-accent-purple-subtlest, #F8EEFE)",
9
9
  textDecoration: 'underline',
10
10
  textDecorationStyle: 'dotted',
11
11
  textDecorationThickness: "var(--ds-space-025, 2px)",
12
- textDecorationColor: "var(--ds-border-accent-purple, #8270DB)"
12
+ textDecorationColor: "var(--ds-border-accent-purple, #AF59E1)"
13
13
  });
14
14
  var traditionalInsertStyle = convertToInlineCss({
15
15
  background: "var(--ds-background-accent-green-subtlest, #DCFFF1)",
@@ -45,7 +45,7 @@ var getEditorStyleNode = function getEditorStyleNode(nodeName, colourScheme) {
45
45
  // Handle table separately to avoid border issues
46
46
  case 'embedCard':
47
47
  return convertToInlineCss({
48
- '--diff-decoration-marker-color': colourScheme === 'traditional' ? "var(--ds-border-accent-green, #22A06B)" : "var(--ds-border-accent-purple, #8270DB)"
48
+ '--diff-decoration-marker-color': colourScheme === 'traditional' ? "var(--ds-border-accent-green, #22A06B)" : "var(--ds-border-accent-purple, #AF59E1)"
49
49
  });
50
50
  case 'paragraph':
51
51
  case 'heading':
@@ -60,7 +60,7 @@ var getEditorStyleNode = function getEditorStyleNode(nodeName, colourScheme) {
60
60
  return undefined;
61
61
  case 'listItem':
62
62
  return convertToInlineCss({
63
- '--diff-decoration-marker-color': colourScheme === 'traditional' ? "var(--ds-border-accent-green, #22A06B)" : "var(--ds-border-accent-purple, #8270DB)"
63
+ '--diff-decoration-marker-color': colourScheme === 'traditional' ? "var(--ds-border-accent-green, #22A06B)" : "var(--ds-border-accent-purple, #AF59E1)"
64
64
  });
65
65
  case 'layoutSection':
66
66
  return undefined;
@@ -73,73 +73,20 @@ var getEditorStyleNode = function getEditorStyleNode(nodeName, colourScheme) {
73
73
  return colourScheme === 'traditional' ? traditionalStyleNode : editingStyleNode;
74
74
  }
75
75
  };
76
- var getDeletedStyleNode = function getDeletedStyleNode(nodeName) {
77
- switch (nodeName) {
78
- case 'blockquote':
79
- return deletedStyleQuoteNode;
80
- case 'expand':
81
- case 'decisionList':
82
- return deletedBlockOutline;
83
- case 'panel':
84
- case 'codeBlock':
85
- return deletedBlockOutlineRounded;
86
- default:
87
- return undefined;
88
- }
89
- };
90
- var shouldShowRemovedLozenge = function shouldShowRemovedLozenge(nodeName) {
91
- switch (nodeName) {
92
- case 'expand':
93
- case 'codeBlock':
94
- case 'mediaSingle':
95
- case 'panel':
96
- case 'decisionList':
97
- return true;
98
- default:
99
- return false;
100
- }
101
- };
102
- var shouldFitContentWidth = function shouldFitContentWidth(nodeName) {
103
- switch (nodeName) {
104
- case 'mediaSingle':
105
- case 'embedCard':
106
- case 'blockCard':
107
- return true;
108
- default:
109
- return false;
110
- }
111
- };
112
- var shouldAddShowDiffDeletedNodeClass = function shouldAddShowDiffDeletedNodeClass(nodeName) {
113
- switch (nodeName) {
114
- case 'mediaSingle':
115
- case 'embedCard':
116
- return true;
117
- default:
118
- return false;
119
- }
120
- };
121
-
122
- /**
123
- * Checks if a node should apply deleted styles directly without wrapper
124
- * to preserve natural block-level margins
125
- */
126
- var shouldApplyDeletedStylesDirectly = function shouldApplyDeletedStylesDirectly(nodeName) {
127
- return nodeName === 'blockquote' || nodeName === 'heading';
128
- };
129
76
  var editingStyleQuoteNode = convertToInlineCss({
130
- borderLeft: "2px solid ".concat("var(--ds-border-accent-purple, #8270DB)")
77
+ borderLeft: "2px solid ".concat("var(--ds-border-accent-purple, #AF59E1)")
131
78
  });
132
79
  var traditionalStyleQuoteNode = convertToInlineCss({
133
80
  borderLeft: "2px solid ".concat("var(--ds-border-accent-green, #22A06B)")
134
81
  });
135
82
  var editingStyleRuleNode = convertToInlineCss({
136
- backgroundColor: "var(--ds-border-accent-purple, #8270DB)"
83
+ backgroundColor: "var(--ds-border-accent-purple, #AF59E1)"
137
84
  });
138
85
  var traditionalStyleRuleNode = convertToInlineCss({
139
86
  backgroundColor: "var(--ds-border-accent-green, #22A06B)"
140
87
  });
141
88
  var editingStyleNode = convertToInlineCss({
142
- boxShadow: "0 0 0 1px ".concat("var(--ds-border-accent-purple, #8270DB)"),
89
+ boxShadow: "0 0 0 1px ".concat("var(--ds-border-accent-purple, #AF59E1)"),
143
90
  borderRadius: "var(--ds-radius-small, 4px)"
144
91
  });
145
92
  var traditionalStyleNode = convertToInlineCss({
@@ -147,39 +94,15 @@ var traditionalStyleNode = convertToInlineCss({
147
94
  borderRadius: "var(--ds-radius-small, 4px)"
148
95
  });
149
96
  var editingStyleCardBlockNode = convertToInlineCss({
150
- boxShadow: "0 0 0 1px ".concat("var(--ds-border-accent-purple, #8270DB)"),
97
+ boxShadow: "0 0 0 1px ".concat("var(--ds-border-accent-purple, #AF59E1)"),
151
98
  borderRadius: "var(--ds-radius-medium, 6px)"
152
99
  });
153
100
  var traditionalStyleCardBlockNode = convertToInlineCss({
154
101
  boxShadow: "0 0 0 1px ".concat("var(--ds-border-accent-green, #22A06B)"),
155
102
  borderRadius: "var(--ds-radius-medium, 6px)"
156
103
  });
157
- var deletedStyleQuoteNode = convertToInlineCss({
158
- borderLeft: "2px solid ".concat("var(--ds-border-accent-gray, #758195)")
159
- });
160
- var deletedBlockOutline = convertToInlineCss({
161
- boxShadow: "0 0 0 1px ".concat("var(--ds-border-accent-gray, #758195)"),
162
- borderRadius: "var(--ds-radius-small, 4px)"
163
- });
164
- var deletedBlockOutlineRounded = convertToInlineCss({
165
- boxShadow: "0 0 0 1px ".concat("var(--ds-border-accent-gray, #758195)"),
166
- borderRadius: "calc(".concat("var(--ds-radius-xsmall, 2px)", " + 1px)")
167
- });
168
-
169
- /**
170
- * Inline decoration used for insertions as the content already exists in the document
171
- *
172
- * @param change Changeset "change" containing information about the change content + range
173
- * @returns Prosemirror inline decoration
174
- */
175
- export var createBlockChangedDecoration = function createBlockChangedDecoration(change, colourScheme) {
176
- return Decoration.node(change.from, change.to, {
177
- style: getEditorStyleNode(change.name, colourScheme),
178
- 'data-testid': 'show-diff-changed-decoration-node'
179
- }, {});
180
- };
181
104
  var deletedContentStyle = convertToInlineCss({
182
- color: "var(--ds-text-accent-gray, #44546F)",
105
+ color: "var(--ds-text-accent-gray, #505258)",
183
106
  textDecoration: 'line-through',
184
107
  position: 'relative',
185
108
  opacity: 0.6
@@ -189,7 +112,7 @@ var deletedContentStyleUnbounded = convertToInlineCss({
189
112
  top: '50%',
190
113
  width: '100%',
191
114
  display: 'inline-block',
192
- borderTop: "1px solid ".concat("var(--ds-text-accent-gray, #44546F)"),
115
+ borderTop: "1px solid ".concat("var(--ds-text-accent-gray, #505258)"),
193
116
  pointerEvents: 'none',
194
117
  zIndex: 1
195
118
  });
@@ -208,141 +131,24 @@ var deletedTraditionalContentStyleUnbounded = convertToInlineCss({
208
131
  pointerEvents: 'none',
209
132
  zIndex: 1
210
133
  });
211
- var lozengeStyle = convertToInlineCss({
212
- display: 'inline-flex',
213
- boxSizing: 'border-box',
214
- position: 'static',
215
- blockSize: 'min-content',
216
- borderRadius: "var(--ds-radius-small, 4px)",
217
- overflow: 'hidden',
218
- paddingInlineStart: "var(--ds-space-050, 4px)",
219
- paddingInlineEnd: "var(--ds-space-050, 4px)",
220
- backgroundColor: "var(--ds-background-accent-gray-subtler, #DCDFE4)",
221
- font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
222
- fontWeight: "var(--ds-font-weight-bold, 700)",
223
- textOverflow: 'ellipsis',
224
- whiteSpace: 'nowrap',
225
- color: "var(--ds-text-warning-inverse, #172B4D)"
226
- });
227
- var getDeletedContentStyleUnbounded = function getDeletedContentStyleUnbounded(colourScheme) {
134
+ export var getDeletedContentStyleUnbounded = function getDeletedContentStyleUnbounded(colourScheme) {
228
135
  return colourScheme === 'traditional' ? deletedTraditionalContentStyleUnbounded : deletedContentStyleUnbounded;
229
136
  };
230
- var getDeletedContentStyle = function getDeletedContentStyle(colourScheme) {
137
+ export var getDeletedContentStyle = function getDeletedContentStyle(colourScheme) {
231
138
  return colourScheme === 'traditional' ? deletedTraditionalContentStyle : deletedContentStyle;
232
139
  };
233
140
 
234
141
  /**
235
- * Creates a "Removed" lozenge to be displayed at the top right corner of deleted block nodes
236
- */
237
- var createRemovedLozenge = function createRemovedLozenge(intl, nodeName) {
238
- var container = document.createElement('span');
239
- var borderTopRightRadius;
240
- var borderTopLeftRadius;
241
- if (['expand', 'decisionList'].includes(nodeName || '')) {
242
- borderTopRightRadius = "var(--ds-radius-small, 4px)";
243
- } else if (['panel', 'codeBlock'].includes(nodeName || '')) {
244
- borderTopRightRadius = "calc(".concat("var(--ds-radius-xsmall, 2px)", " + 1px)");
245
- } else if (nodeName === 'mediaSingle') {
246
- borderTopLeftRadius = "var(--ds-radius-small, 4px)";
247
- }
248
- var containerStyle = convertToInlineCss({
249
- position: 'absolute',
250
- top: nodeName === 'mediaSingle' ? "var(--ds-space-300, 24px)" : "var(--ds-space-0, 0px)",
251
- right: nodeName === 'mediaSingle' ? undefined : "var(--ds-space-0, 0px)",
252
- left: nodeName === 'mediaSingle' ? "var(--ds-space-0, 0px)" : undefined,
253
- zIndex: 2,
254
- pointerEvents: 'none',
255
- display: 'flex',
256
- overflow: 'hidden',
257
- borderTopRightRadius: borderTopRightRadius,
258
- borderTopLeftRadius: borderTopLeftRadius
259
- });
260
- container.setAttribute('style', containerStyle);
261
- container.setAttribute('data-testid', 'show-diff-removed-lozenge');
262
-
263
- // Create vanilla HTML lozenge element with Atlaskit Lozenge styling (visual refresh)
264
- var lozengeElement = document.createElement('span');
265
- lozengeElement.setAttribute('style', lozengeStyle);
266
- lozengeElement.textContent = intl.formatMessage(trackChangesMessages.removed).toUpperCase();
267
- container.appendChild(lozengeElement);
268
- return container;
269
- };
270
-
271
- /**
272
- * Wraps a block node in a container with relative positioning to support absolute positioned lozenge
273
- */
274
- var createBlockNodeWrapper = function createBlockNodeWrapper(nodeName) {
275
- var wrapper = document.createElement('div');
276
- var fitContent = shouldFitContentWidth(nodeName);
277
- var baseStyle = convertToInlineCss({
278
- position: 'relative',
279
- display: fitContent ? 'inline-block' : 'block',
280
- width: fitContent ? 'fit-content' : undefined,
281
- height: fitContent ? 'fit-content' : undefined,
282
- opacity: 1
283
- });
284
- wrapper.setAttribute('style', baseStyle);
285
- return wrapper;
286
- };
287
-
288
- /**
289
- * Wraps content with deleted styling without opacity (for use when content is a direct child of dom)
290
- */
291
- var createDeletedStyleWrapperWithoutOpacity = function createDeletedStyleWrapperWithoutOpacity(colourScheme) {
292
- var wrapper = document.createElement('span');
293
- wrapper.setAttribute('style', getDeletedContentStyle(colourScheme));
294
- return wrapper;
295
- };
296
-
297
- /**
298
- * Applies deleted styles directly to an HTML element by merging with existing styles
299
- */
300
- var applyDeletedStylesToElement = function applyDeletedStylesToElement(element, targetNode, colourScheme) {
301
- var currentStyle = element.getAttribute('style') || '';
302
- var deletedContentStyle = getDeletedContentStyle(colourScheme);
303
- var nodeSpecificStyle = getDeletedStyleNode(targetNode.type.name) || '';
304
- element.setAttribute('style', "".concat(currentStyle).concat(deletedContentStyle).concat(nodeSpecificStyle));
305
- };
306
-
307
- /**
308
- * Appends a block node with wrapper, lozenge, and appropriate styling
309
- */
310
- var appendBlockNodeWithWrapper = function appendBlockNodeWithWrapper(dom, nodeView, targetNode, colourScheme, intl) {
311
- var blockWrapper = createBlockNodeWrapper(targetNode.type.name);
312
- if (shouldShowRemovedLozenge(targetNode.type.name)) {
313
- var lozenge = createRemovedLozenge(intl, targetNode.type.name);
314
- blockWrapper.append(lozenge);
315
- }
316
-
317
- // Wrap the nodeView in a content wrapper that has the opacity style AND the box-shadow
318
- // This keeps the lozenge at full opacity while the content AND border are faded
319
- var contentWrapper = document.createElement('div');
320
- var nodeStyle = getDeletedStyleNode(targetNode.type.name);
321
- contentWrapper.setAttribute('style', "".concat(getDeletedContentStyle(colourScheme)).concat(nodeStyle || ''));
322
- contentWrapper.append(nodeView);
323
- blockWrapper.append(contentWrapper);
324
- if (nodeView instanceof HTMLElement) {
325
- if (shouldAddShowDiffDeletedNodeClass(targetNode.type.name)) {
326
- nodeView.classList.add('show-diff-deleted-node');
327
- }
328
- }
329
- dom.append(blockWrapper);
330
- };
331
-
332
- /**
333
- * Handles all block node rendering with appropriate deleted styling.
334
- * For blockquote and heading nodes, applies styles directly to preserve natural margins.
335
- * For other block nodes, uses wrapper approach with optional lozenge.
142
+ * Inline decoration used for insertions as the content already exists in the document
143
+ *
144
+ * @param change Changeset "change" containing information about the change content + range
145
+ * @returns Prosemirror inline decoration
336
146
  */
337
- var handleBlockNodeView = function handleBlockNodeView(dom, nodeView, targetNode, colourScheme, intl) {
338
- if (shouldApplyDeletedStylesDirectly(targetNode.type.name) && nodeView instanceof HTMLElement) {
339
- // Apply deleted styles directly to preserve natural block-level margins
340
- applyDeletedStylesToElement(nodeView, targetNode, colourScheme);
341
- dom.append(nodeView);
342
- } else {
343
- // Use wrapper approach for other block nodes
344
- appendBlockNodeWithWrapper(dom, nodeView, targetNode, colourScheme, intl);
345
- }
147
+ export var createBlockChangedDecoration = function createBlockChangedDecoration(change, colourScheme) {
148
+ return Decoration.node(change.from, change.to, {
149
+ style: getEditorStyleNode(change.name, colourScheme),
150
+ 'data-testid': 'show-diff-changed-decoration-node'
151
+ }, {});
346
152
  };
347
153
  export var createDeletedContentDecoration = function createDeletedContentDecoration(_ref) {
348
154
  var change = _ref.change,
@@ -0,0 +1,214 @@
1
+ import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
2
+ import { trackChangesMessages } from '@atlaskit/editor-common/messages';
3
+ import { getDeletedContentStyle } from './decorations';
4
+ export var deletedStyleQuoteNode = convertToInlineCss({
5
+ borderLeft: "2px solid ".concat("var(--ds-border-accent-gray, #7D818A)")
6
+ });
7
+ export var deletedBlockOutline = convertToInlineCss({
8
+ boxShadow: "0 0 0 1px ".concat("var(--ds-border-accent-gray, #7D818A)"),
9
+ borderRadius: "var(--ds-radius-small, 4px)"
10
+ });
11
+ export var deletedBlockOutlineRounded = convertToInlineCss({
12
+ boxShadow: "0 0 0 1px ".concat("var(--ds-border-accent-gray, #7D818A)"),
13
+ borderRadius: "calc(".concat("var(--ds-radius-xsmall, 2px)", " + 1px)")
14
+ });
15
+ var lozengeStyle = convertToInlineCss({
16
+ display: 'inline-flex',
17
+ boxSizing: 'border-box',
18
+ position: 'static',
19
+ blockSize: 'min-content',
20
+ borderRadius: "var(--ds-radius-small, 4px)",
21
+ overflow: 'hidden',
22
+ paddingInlineStart: "var(--ds-space-050, 4px)",
23
+ paddingInlineEnd: "var(--ds-space-050, 4px)",
24
+ backgroundColor: "var(--ds-background-accent-gray-subtler, #DDDEE1)",
25
+ font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
26
+ fontWeight: "var(--ds-font-weight-bold, 700)",
27
+ textOverflow: 'ellipsis',
28
+ whiteSpace: 'nowrap',
29
+ color: "var(--ds-text-warning-inverse, #292A2E)"
30
+ });
31
+ export var getDeletedStyleNode = function getDeletedStyleNode(nodeName) {
32
+ switch (nodeName) {
33
+ case 'blockquote':
34
+ return deletedStyleQuoteNode;
35
+ case 'expand':
36
+ case 'decisionList':
37
+ return deletedBlockOutline;
38
+ case 'panel':
39
+ case 'codeBlock':
40
+ return deletedBlockOutlineRounded;
41
+ default:
42
+ return undefined;
43
+ }
44
+ };
45
+ export var shouldShowRemovedLozenge = function shouldShowRemovedLozenge(nodeName) {
46
+ switch (nodeName) {
47
+ case 'expand':
48
+ case 'codeBlock':
49
+ case 'mediaSingle':
50
+ case 'panel':
51
+ case 'decisionList':
52
+ return true;
53
+ default:
54
+ return false;
55
+ }
56
+ };
57
+ export var shouldAddShowDiffDeletedNodeClass = function shouldAddShowDiffDeletedNodeClass(nodeName) {
58
+ switch (nodeName) {
59
+ case 'mediaSingle':
60
+ case 'embedCard':
61
+ return true;
62
+ default:
63
+ return false;
64
+ }
65
+ };
66
+
67
+ /**
68
+ * Checks if a node should apply deleted styles directly without wrapper
69
+ * to preserve natural block-level margins
70
+ */
71
+ export var shouldApplyDeletedStylesDirectly = function shouldApplyDeletedStylesDirectly(nodeName) {
72
+ return nodeName === 'blockquote' || nodeName === 'heading';
73
+ };
74
+
75
+ /**
76
+ * Creates a "Removed" lozenge to be displayed at the top right corner of deleted block nodes
77
+ */
78
+ export var createRemovedLozenge = function createRemovedLozenge(intl, nodeName) {
79
+ var container = document.createElement('span');
80
+ var borderTopRightRadius;
81
+ if (['expand', 'decisionList'].includes(nodeName || '')) {
82
+ borderTopRightRadius = "var(--ds-radius-small, 4px)";
83
+ } else if (['panel', 'codeBlock', 'mediaSingle'].includes(nodeName || '')) {
84
+ borderTopRightRadius = "calc(".concat("var(--ds-radius-xsmall, 2px)", " + 1px)");
85
+ }
86
+ var containerStyle = convertToInlineCss({
87
+ position: 'absolute',
88
+ top: "var(--ds-space-0, 0px)",
89
+ right: "var(--ds-space-0, 0px)",
90
+ zIndex: 2,
91
+ pointerEvents: 'none',
92
+ display: 'flex',
93
+ overflow: 'hidden',
94
+ borderTopRightRadius: borderTopRightRadius
95
+ });
96
+ container.setAttribute('style', containerStyle);
97
+ container.setAttribute('data-testid', 'show-diff-removed-lozenge');
98
+
99
+ // Create vanilla HTML lozenge element with Atlaskit Lozenge styling (visual refresh)
100
+ var lozengeElement = document.createElement('span');
101
+ lozengeElement.setAttribute('style', lozengeStyle);
102
+ lozengeElement.textContent = intl.formatMessage(trackChangesMessages.removed).toUpperCase();
103
+ container.appendChild(lozengeElement);
104
+ return container;
105
+ };
106
+
107
+ /**
108
+ * Wraps a block node in a container with relative positioning to support absolute positioned lozenge
109
+ */
110
+ export var createBlockNodeWrapper = function createBlockNodeWrapper(nodeName) {
111
+ var wrapper = document.createElement('div');
112
+ var baseStyle = convertToInlineCss({
113
+ position: 'relative',
114
+ display: 'block',
115
+ opacity: 1
116
+ });
117
+ wrapper.setAttribute('style', baseStyle);
118
+ return wrapper;
119
+ };
120
+
121
+ /**
122
+ * Wraps content with deleted styling without opacity (for use when content is a direct child of dom)
123
+ */
124
+ export var createDeletedStyleWrapperWithoutOpacity = function createDeletedStyleWrapperWithoutOpacity(colourScheme) {
125
+ var wrapper = document.createElement('span');
126
+ wrapper.setAttribute('style', getDeletedContentStyle(colourScheme));
127
+ return wrapper;
128
+ };
129
+
130
+ /**
131
+ * Applies deleted styles directly to an HTML element by merging with existing styles
132
+ */
133
+ export var applyDeletedStylesToElement = function applyDeletedStylesToElement(element, targetNode, colourScheme) {
134
+ var currentStyle = element.getAttribute('style') || '';
135
+ var deletedContentStyle = getDeletedContentStyle(colourScheme);
136
+ var nodeSpecificStyle = getDeletedStyleNode(targetNode.type.name) || '';
137
+ element.setAttribute('style', "".concat(currentStyle).concat(deletedContentStyle).concat(nodeSpecificStyle));
138
+ };
139
+
140
+ /**
141
+ * Creates a content wrapper with deleted styles for a block node
142
+ */
143
+ export var createBlockNodeContentWrapper = function createBlockNodeContentWrapper(nodeView, targetNode, colourScheme) {
144
+ var contentWrapper = document.createElement('div');
145
+ var nodeStyle = getDeletedStyleNode(targetNode.type.name);
146
+ contentWrapper.setAttribute('style', "".concat(getDeletedContentStyle(colourScheme)).concat(nodeStyle || ''));
147
+ contentWrapper.append(nodeView);
148
+ return contentWrapper;
149
+ };
150
+
151
+ /**
152
+ * Handles special mediaSingle node rendering with lozenge on child media element
153
+ * @returns true if mediaSingle was handled, false otherwise
154
+ */
155
+ export var handleMediaSingleWithLozenge = function handleMediaSingleWithLozenge(dom, nodeView, targetNode, lozenge) {
156
+ if (targetNode.type.name !== 'mediaSingle' || !(nodeView instanceof HTMLElement)) {
157
+ return false;
158
+ }
159
+ var mediaNode = nodeView.querySelector('[data-prosemirror-node-name="media"]');
160
+ if (!mediaNode || !(mediaNode instanceof HTMLElement)) {
161
+ return false;
162
+ }
163
+
164
+ // Add relative positioning to media node to anchor lozenge
165
+ var currentStyle = mediaNode.getAttribute('style') || '';
166
+ var relativePositionStyle = convertToInlineCss({
167
+ position: 'relative'
168
+ });
169
+ mediaNode.setAttribute('style', "".concat(currentStyle).concat(relativePositionStyle));
170
+ mediaNode.append(lozenge);
171
+
172
+ // Add deleted node class if needed
173
+ if (shouldAddShowDiffDeletedNodeClass(targetNode.type.name)) {
174
+ nodeView.classList.add('show-diff-deleted-node');
175
+ }
176
+ dom.append(nodeView);
177
+ return true;
178
+ };
179
+
180
+ /**
181
+ * Appends a block node with wrapper, lozenge, and appropriate styling
182
+ */
183
+ export var appendBlockNodeWithWrapper = function appendBlockNodeWithWrapper(dom, nodeView, targetNode, colourScheme, intl) {
184
+ var blockWrapper = createBlockNodeWrapper(targetNode.type.name);
185
+ if (shouldShowRemovedLozenge(targetNode.type.name)) {
186
+ var lozenge = createRemovedLozenge(intl, targetNode.type.name);
187
+ if (handleMediaSingleWithLozenge(dom, nodeView, targetNode, lozenge)) {
188
+ return;
189
+ }
190
+ blockWrapper.append(lozenge);
191
+ }
192
+ var contentWrapper = createBlockNodeContentWrapper(nodeView, targetNode, colourScheme);
193
+ blockWrapper.append(contentWrapper);
194
+ if (nodeView instanceof HTMLElement && shouldAddShowDiffDeletedNodeClass(targetNode.type.name)) {
195
+ nodeView.classList.add('show-diff-deleted-node');
196
+ }
197
+ dom.append(blockWrapper);
198
+ };
199
+
200
+ /**
201
+ * Handles all block node rendering with appropriate deleted styling.
202
+ * For blockquote and heading nodes, applies styles directly to preserve natural margins.
203
+ * For other block nodes, uses wrapper approach with optional lozenge.
204
+ */
205
+ export var handleBlockNodeView = function handleBlockNodeView(dom, nodeView, targetNode, colourScheme, intl) {
206
+ if (shouldApplyDeletedStylesDirectly(targetNode.type.name) && nodeView instanceof HTMLElement) {
207
+ // Apply deleted styles directly to preserve natural block-level margins
208
+ applyDeletedStylesToElement(nodeView, targetNode, colourScheme);
209
+ dom.append(nodeView);
210
+ } else {
211
+ // Use wrapper approach for other block nodes
212
+ appendBlockNodeWithWrapper(dom, nodeView, targetNode, colourScheme, intl);
213
+ }
214
+ };
@@ -9,7 +9,7 @@ import { Decoration } from '@atlaskit/editor-prosemirror/view';
9
9
  import { TableMap } from '@atlaskit/editor-tables/table-map';
10
10
  import { findSafeInsertPos } from './findSafeInsertPos';
11
11
  var deletedRowStyle = convertToInlineCss({
12
- color: "var(--ds-text-accent-gray, #44546F)",
12
+ color: "var(--ds-text-accent-gray, #505258)",
13
13
  textDecoration: 'line-through',
14
14
  opacity: 0.6,
15
15
  display: 'table-row'
@@ -67,7 +67,7 @@ export declare class NodeViewSerializer {
67
67
  /**
68
68
  * Serializes a fragment to a `DocumentFragment` using the schema's `DOMSerializer`.
69
69
  */
70
- serializeFragment(fragment: Fragment): DocumentFragment | HTMLElement | null;
70
+ serializeFragment(fragment: Fragment): HTMLElement | DocumentFragment | null;
71
71
  /**
72
72
  * Returns a copy of the current node view blocklist.
73
73
  */
@@ -13,6 +13,8 @@ export declare const createInlineChangedDecoration: (change: {
13
13
  fromB: number;
14
14
  toB: number;
15
15
  }, colourScheme?: "standard" | "traditional") => Decoration;
16
+ export declare const getDeletedContentStyleUnbounded: (colourScheme?: "standard" | "traditional") => string;
17
+ export declare const getDeletedContentStyle: (colourScheme?: "standard" | "traditional") => string;
16
18
  /**
17
19
  * Inline decoration used for insertions as the content already exists in the document
18
20
  *
@@ -0,0 +1,48 @@
1
+ import type { IntlShape } from 'react-intl-next';
2
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
+ export declare const deletedStyleQuoteNode: string;
4
+ export declare const deletedBlockOutline: string;
5
+ export declare const deletedBlockOutlineRounded: string;
6
+ export declare const getDeletedStyleNode: (nodeName: string) => string | undefined;
7
+ export declare const shouldShowRemovedLozenge: (nodeName: string) => boolean;
8
+ export declare const shouldAddShowDiffDeletedNodeClass: (nodeName: string) => boolean;
9
+ /**
10
+ * Checks if a node should apply deleted styles directly without wrapper
11
+ * to preserve natural block-level margins
12
+ */
13
+ export declare const shouldApplyDeletedStylesDirectly: (nodeName: string) => boolean;
14
+ /**
15
+ * Creates a "Removed" lozenge to be displayed at the top right corner of deleted block nodes
16
+ */
17
+ export declare const createRemovedLozenge: (intl: IntlShape, nodeName?: string) => HTMLElement;
18
+ /**
19
+ * Wraps a block node in a container with relative positioning to support absolute positioned lozenge
20
+ */
21
+ export declare const createBlockNodeWrapper: (nodeName: string) => HTMLDivElement;
22
+ /**
23
+ * Wraps content with deleted styling without opacity (for use when content is a direct child of dom)
24
+ */
25
+ export declare const createDeletedStyleWrapperWithoutOpacity: (colourScheme?: "standard" | "traditional") => HTMLSpanElement;
26
+ /**
27
+ * Applies deleted styles directly to an HTML element by merging with existing styles
28
+ */
29
+ export declare const applyDeletedStylesToElement: (element: HTMLElement, targetNode: PMNode, colourScheme: "standard" | "traditional" | undefined) => void;
30
+ /**
31
+ * Creates a content wrapper with deleted styles for a block node
32
+ */
33
+ export declare const createBlockNodeContentWrapper: (nodeView: Node, targetNode: PMNode, colourScheme: "standard" | "traditional" | undefined) => HTMLElement;
34
+ /**
35
+ * Handles special mediaSingle node rendering with lozenge on child media element
36
+ * @returns true if mediaSingle was handled, false otherwise
37
+ */
38
+ export declare const handleMediaSingleWithLozenge: (dom: HTMLElement, nodeView: Node, targetNode: PMNode, lozenge: HTMLElement) => boolean;
39
+ /**
40
+ * Appends a block node with wrapper, lozenge, and appropriate styling
41
+ */
42
+ export declare const appendBlockNodeWithWrapper: (dom: HTMLElement, nodeView: Node, targetNode: PMNode, colourScheme: "standard" | "traditional" | undefined, intl: IntlShape) => void;
43
+ /**
44
+ * Handles all block node rendering with appropriate deleted styling.
45
+ * For blockquote and heading nodes, applies styles directly to preserve natural margins.
46
+ * For other block nodes, uses wrapper approach with optional lozenge.
47
+ */
48
+ export declare const handleBlockNodeView: (dom: HTMLElement, nodeView: Node, targetNode: PMNode, colourScheme: "standard" | "traditional" | undefined, intl: IntlShape) => void;
@@ -67,7 +67,7 @@ export declare class NodeViewSerializer {
67
67
  /**
68
68
  * Serializes a fragment to a `DocumentFragment` using the schema's `DOMSerializer`.
69
69
  */
70
- serializeFragment(fragment: Fragment): DocumentFragment | HTMLElement | null;
70
+ serializeFragment(fragment: Fragment): HTMLElement | DocumentFragment | null;
71
71
  /**
72
72
  * Returns a copy of the current node view blocklist.
73
73
  */
@@ -13,6 +13,8 @@ export declare const createInlineChangedDecoration: (change: {
13
13
  fromB: number;
14
14
  toB: number;
15
15
  }, colourScheme?: "standard" | "traditional") => Decoration;
16
+ export declare const getDeletedContentStyleUnbounded: (colourScheme?: "standard" | "traditional") => string;
17
+ export declare const getDeletedContentStyle: (colourScheme?: "standard" | "traditional") => string;
16
18
  /**
17
19
  * Inline decoration used for insertions as the content already exists in the document
18
20
  *