@atlaskit/editor-plugin-show-diff 6.2.10 → 6.2.11
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 +6 -0
- package/dist/cjs/pm-plugins/decorations/colorSchemes/standard.js +6 -12
- package/dist/cjs/pm-plugins/decorations/colorSchemes/traditional.js +87 -20
- package/dist/cjs/pm-plugins/decorations/createBlockChangedDecoration.js +14 -14
- package/dist/cjs/pm-plugins/decorations/createInlineChangedDecoration.js +1 -1
- package/dist/cjs/pm-plugins/decorations/createNodeChangedDecorationWidget.js +2 -2
- package/dist/cjs/pm-plugins/decorations/utils/wrapBlockNodeView.js +96 -58
- package/dist/es2019/pm-plugins/decorations/colorSchemes/standard.js +5 -11
- package/dist/es2019/pm-plugins/decorations/colorSchemes/traditional.js +85 -20
- package/dist/es2019/pm-plugins/decorations/createBlockChangedDecoration.js +15 -15
- package/dist/es2019/pm-plugins/decorations/createInlineChangedDecoration.js +2 -2
- package/dist/es2019/pm-plugins/decorations/createNodeChangedDecorationWidget.js +4 -4
- package/dist/es2019/pm-plugins/decorations/utils/wrapBlockNodeView.js +46 -8
- package/dist/esm/pm-plugins/decorations/colorSchemes/standard.js +5 -11
- package/dist/esm/pm-plugins/decorations/colorSchemes/traditional.js +83 -19
- package/dist/esm/pm-plugins/decorations/createBlockChangedDecoration.js +15 -15
- package/dist/esm/pm-plugins/decorations/createInlineChangedDecoration.js +2 -2
- package/dist/esm/pm-plugins/decorations/createNodeChangedDecorationWidget.js +4 -4
- package/dist/esm/pm-plugins/decorations/utils/wrapBlockNodeView.js +98 -60
- package/dist/types/pm-plugins/decorations/colorSchemes/standard.d.ts +0 -1
- package/dist/types/pm-plugins/decorations/colorSchemes/traditional.d.ts +16 -4
- package/dist/types-ts4.5/pm-plugins/decorations/colorSchemes/standard.d.ts +0 -1
- package/dist/types-ts4.5/pm-plugins/decorations/colorSchemes/traditional.d.ts +16 -4
- package/package.json +3 -3
|
@@ -32,13 +32,6 @@ export const deletedContentStyleNew = convertToInlineCss({
|
|
|
32
32
|
position: 'relative',
|
|
33
33
|
opacity: 0.8
|
|
34
34
|
});
|
|
35
|
-
export const deletedContentStyleNewActive = convertToInlineCss({
|
|
36
|
-
color: "var(--ds-text, #292A2E)",
|
|
37
|
-
textDecoration: 'line-through',
|
|
38
|
-
textDecorationColor: "var(--ds-text-accent-gray, #505258)",
|
|
39
|
-
position: 'relative',
|
|
40
|
-
opacity: 1
|
|
41
|
-
});
|
|
42
35
|
export const deletedContentStyleUnbounded = convertToInlineCss({
|
|
43
36
|
position: 'absolute',
|
|
44
37
|
top: '50%',
|
|
@@ -66,7 +59,7 @@ export const deletedStyleQuoteNodeWithLozengeActive = convertToInlineCss({
|
|
|
66
59
|
paddingTop: "var(--ds-space-025, 2px)",
|
|
67
60
|
paddingBottom: "var(--ds-space-025, 2px)",
|
|
68
61
|
paddingLeft: "var(--ds-space-025, 2px)",
|
|
69
|
-
boxShadow: `0 0 0
|
|
62
|
+
boxShadow: `0 0 0 4px ${"var(--ds-border-accent-red, #E2483D)"}`,
|
|
70
63
|
borderRadius: "var(--ds-radius-small, 4px)"
|
|
71
64
|
});
|
|
72
65
|
export const deletedBlockOutline = convertToInlineCss({
|
|
@@ -74,7 +67,7 @@ export const deletedBlockOutline = convertToInlineCss({
|
|
|
74
67
|
borderRadius: "var(--ds-radius-small, 4px)"
|
|
75
68
|
});
|
|
76
69
|
export const deletedBlockOutlineActive = convertToInlineCss({
|
|
77
|
-
boxShadow: `0 0 0
|
|
70
|
+
boxShadow: `0 0 0 4px ${"var(--ds-border-accent-red, #E2483D)"}`,
|
|
78
71
|
borderRadius: "var(--ds-radius-small, 4px)"
|
|
79
72
|
});
|
|
80
73
|
export const deletedBlockOutlineRounded = convertToInlineCss({
|
|
@@ -82,7 +75,7 @@ export const deletedBlockOutlineRounded = convertToInlineCss({
|
|
|
82
75
|
borderRadius: `calc(${"var(--ds-radius-xsmall, 2px)"} + 1px)`
|
|
83
76
|
});
|
|
84
77
|
export const deletedBlockOutlineRoundedActive = convertToInlineCss({
|
|
85
|
-
boxShadow: `0 0 0
|
|
78
|
+
boxShadow: `0 0 0 4px ${"var(--ds-border-accent-red, #E2483D)"}`,
|
|
86
79
|
borderRadius: `calc(${"var(--ds-radius-xsmall, 2px)"} + 1px)`
|
|
87
80
|
});
|
|
88
81
|
export const deletedRowStyle = convertToInlineCss({
|
|
@@ -106,7 +99,8 @@ export const editingStyleCardBlockNode = convertToInlineCss({
|
|
|
106
99
|
borderRadius: "var(--ds-radius-medium, 6px)"
|
|
107
100
|
});
|
|
108
101
|
export const standardDecorationMarkerVariable = convertToInlineCss({
|
|
109
|
-
'--diff-decoration-marker-color': "var(--ds-border-accent-purple, #AF59E1)"
|
|
102
|
+
'--diff-decoration-marker-color': "var(--ds-border-accent-purple, #AF59E1)",
|
|
103
|
+
'--diff-decoration-marker-ring-width': '1px'
|
|
110
104
|
});
|
|
111
105
|
export const addedCellOverlayStyle = convertToInlineCss({
|
|
112
106
|
position: 'absolute',
|
|
@@ -13,21 +13,22 @@ export const traditionalInsertStyleActive = convertToInlineCss({
|
|
|
13
13
|
textDecorationThickness: "var(--ds-space-025, 2px)",
|
|
14
14
|
textDecorationColor: "var(--ds-text-accent-green, #216E4E)"
|
|
15
15
|
});
|
|
16
|
-
|
|
16
|
+
const deletedTraditionalInlineStyleBase = {
|
|
17
17
|
textDecorationColor: "var(--ds-border-accent-red, #E2483D)",
|
|
18
18
|
textDecoration: 'line-through',
|
|
19
19
|
position: 'relative',
|
|
20
20
|
opacity: 1
|
|
21
|
-
}
|
|
21
|
+
};
|
|
22
|
+
const deletedTraditionalInlineStyleActiveBase = {
|
|
23
|
+
...deletedTraditionalInlineStyleBase,
|
|
24
|
+
textDecorationThickness: '2px',
|
|
25
|
+
backgroundColor: "var(--ds-background-accent-red-subtlest-pressed, #FFB8B2)"
|
|
26
|
+
};
|
|
22
27
|
|
|
23
|
-
/**
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
backgroundColor: "var(--ds-background-accent-red-subtlest-pressed, #FFB8B2)",
|
|
28
|
-
position: 'relative',
|
|
29
|
-
opacity: 1
|
|
30
|
-
});
|
|
28
|
+
/** Strikethrough for traditional removed inline / widget content (non-marker decorations). */
|
|
29
|
+
export function getDeletedTraditionalInlineStyle(isActive) {
|
|
30
|
+
return isActive ? convertToInlineCss(deletedTraditionalInlineStyleActiveBase) : convertToInlineCss(deletedTraditionalInlineStyleBase);
|
|
31
|
+
}
|
|
31
32
|
export const deletedTraditionalContentStyleUnbounded = convertToInlineCss({
|
|
32
33
|
position: 'absolute',
|
|
33
34
|
top: '50%',
|
|
@@ -38,7 +39,7 @@ export const deletedTraditionalContentStyleUnbounded = convertToInlineCss({
|
|
|
38
39
|
zIndex: 1
|
|
39
40
|
});
|
|
40
41
|
|
|
41
|
-
/**
|
|
42
|
+
/** Strikethrough line for traditional when active (background highlight on text wrapper) */
|
|
42
43
|
export const deletedTraditionalContentStyleUnboundedActive = convertToInlineCss({
|
|
43
44
|
position: 'absolute',
|
|
44
45
|
top: '50%',
|
|
@@ -61,7 +62,7 @@ export const deletedTraditionalStyleQuoteNodeActive = convertToInlineCss({
|
|
|
61
62
|
paddingTop: "var(--ds-space-025, 2px)",
|
|
62
63
|
paddingBottom: "var(--ds-space-025, 2px)",
|
|
63
64
|
paddingLeft: "var(--ds-space-025, 2px)",
|
|
64
|
-
boxShadow: `0 0 0
|
|
65
|
+
boxShadow: `0 0 0 4px ${"var(--ds-background-accent-red-subtler-pressed, #FD9891)"}`,
|
|
65
66
|
borderRadius: "var(--ds-radius-small, 4px)"
|
|
66
67
|
});
|
|
67
68
|
export const deletedTraditionalBlockOutline = convertToInlineCss({
|
|
@@ -69,7 +70,7 @@ export const deletedTraditionalBlockOutline = convertToInlineCss({
|
|
|
69
70
|
borderRadius: "var(--ds-radius-small, 4px)"
|
|
70
71
|
});
|
|
71
72
|
export const deletedTraditionalBlockOutlineActive = convertToInlineCss({
|
|
72
|
-
boxShadow: `0 0 0
|
|
73
|
+
boxShadow: `0 0 0 4px ${"var(--ds-background-accent-red-subtler-pressed, #FD9891)"}`,
|
|
73
74
|
borderRadius: "var(--ds-radius-small, 4px)"
|
|
74
75
|
});
|
|
75
76
|
export const deletedTraditionalBlockOutlineRounded = convertToInlineCss({
|
|
@@ -77,7 +78,17 @@ export const deletedTraditionalBlockOutlineRounded = convertToInlineCss({
|
|
|
77
78
|
borderRadius: `calc(${"var(--ds-radius-xsmall, 2px)"} + 1px)`
|
|
78
79
|
});
|
|
79
80
|
export const deletedTraditionalBlockOutlineRoundedActive = convertToInlineCss({
|
|
80
|
-
boxShadow: `0 0 0
|
|
81
|
+
boxShadow: `0 0 0 4px ${"var(--ds-background-accent-red-subtler-pressed, #FD9891)"}`,
|
|
82
|
+
borderRadius: `calc(${"var(--ds-radius-xsmall, 2px)"} + 1px)`
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
/** Scroll-navigation “new” emphasis: 4px ring (see {@link traditionalStyleNodeNew}). */
|
|
86
|
+
export const deletedTraditionalBlockOutlineNew = convertToInlineCss({
|
|
87
|
+
boxShadow: `0 0 0 4px ${"var(--ds-background-accent-red-subtlest, #FFECEB)"}`,
|
|
88
|
+
borderRadius: "var(--ds-radius-small, 4px)"
|
|
89
|
+
});
|
|
90
|
+
export const deletedTraditionalBlockOutlineRoundedNew = convertToInlineCss({
|
|
91
|
+
boxShadow: `0 0 0 4px ${"var(--ds-background-accent-red-subtlest, #FFECEB)"}`,
|
|
81
92
|
borderRadius: `calc(${"var(--ds-radius-xsmall, 2px)"} + 1px)`
|
|
82
93
|
});
|
|
83
94
|
export const deletedTraditionalRowStyle = convertToInlineCss({
|
|
@@ -89,36 +100,79 @@ export const deletedTraditionalRowStyle = convertToInlineCss({
|
|
|
89
100
|
export const traditionalStyleQuoteNode = convertToInlineCss({
|
|
90
101
|
borderLeft: `2px solid ${"var(--ds-border-accent-green, #22A06B)"}`
|
|
91
102
|
});
|
|
103
|
+
export const traditionalStyleQuoteNodeNew = convertToInlineCss({
|
|
104
|
+
borderLeft: `4px solid ${"var(--ds-background-accent-green-subtlest, #DCFFF1)"}`
|
|
105
|
+
});
|
|
92
106
|
export const traditionalStyleQuoteNodeActive = convertToInlineCss({
|
|
93
|
-
borderLeft: `
|
|
107
|
+
borderLeft: `4px solid ${"var(--ds-background-accent-green-subtler-pressed, #7EE2B8)"}`
|
|
94
108
|
});
|
|
95
109
|
export const traditionalStyleRuleNode = convertToInlineCss({
|
|
96
110
|
backgroundColor: "var(--ds-border-accent-green, #22A06B)"
|
|
97
111
|
});
|
|
112
|
+
export const traditionalStyleRuleNodeNew = convertToInlineCss({
|
|
113
|
+
backgroundColor: "var(--ds-background-accent-green-subtlest, #DCFFF1)",
|
|
114
|
+
border: 'none',
|
|
115
|
+
height: '4px',
|
|
116
|
+
borderRadius: "var(--ds-radius-small, 4px)"
|
|
117
|
+
});
|
|
98
118
|
export const traditionalStyleRuleNodeActive = convertToInlineCss({
|
|
99
|
-
backgroundColor: "var(--ds-background-accent-green-subtler-pressed, #7EE2B8)"
|
|
119
|
+
backgroundColor: "var(--ds-background-accent-green-subtler-pressed, #7EE2B8)",
|
|
120
|
+
border: 'none',
|
|
121
|
+
height: '4px',
|
|
122
|
+
borderRadius: "var(--ds-radius-small, 4px)"
|
|
100
123
|
});
|
|
101
124
|
export const traditionalStyleNode = convertToInlineCss({
|
|
102
125
|
boxShadow: `0 0 0 1px ${"var(--ds-border-accent-green, #22A06B)"}`,
|
|
103
126
|
borderRadius: "var(--ds-radius-small, 4px)"
|
|
104
127
|
});
|
|
128
|
+
export const traditionalStyleNodeNew = convertToInlineCss({
|
|
129
|
+
boxShadow: `0 0 0 4px ${"var(--ds-background-accent-green-subtlest, #DCFFF1)"}`,
|
|
130
|
+
borderRadius: "var(--ds-radius-small, 4px)"
|
|
131
|
+
});
|
|
105
132
|
export const traditionalStyleNodeActive = convertToInlineCss({
|
|
106
|
-
boxShadow: `0 0 0
|
|
133
|
+
boxShadow: `0 0 0 4px ${"var(--ds-background-accent-green-subtler-pressed, #7EE2B8)"}`,
|
|
107
134
|
borderRadius: "var(--ds-radius-small, 4px)"
|
|
108
135
|
});
|
|
109
136
|
export const traditionalStyleCardBlockNode = convertToInlineCss({
|
|
110
137
|
boxShadow: `0 0 0 1px ${"var(--ds-border-accent-green, #22A06B)"}`,
|
|
111
138
|
borderRadius: "var(--ds-radius-medium, 6px)"
|
|
112
139
|
});
|
|
140
|
+
export const traditionalStyleCardBlockNodeNew = convertToInlineCss({
|
|
141
|
+
boxShadow: `0 0 0 4px ${"var(--ds-background-accent-green-subtlest, #DCFFF1)"}`,
|
|
142
|
+
borderRadius: "var(--ds-radius-medium, 6px)"
|
|
143
|
+
});
|
|
113
144
|
export const traditionalStyleCardBlockNodeActive = convertToInlineCss({
|
|
114
|
-
boxShadow: `0 0 0
|
|
145
|
+
boxShadow: `0 0 0 4px ${"var(--ds-background-accent-green-subtler-pressed, #7EE2B8)"}`,
|
|
115
146
|
borderRadius: "var(--ds-radius-medium, 6px)"
|
|
116
147
|
});
|
|
117
148
|
export const traditionalDecorationMarkerVariable = convertToInlineCss({
|
|
118
|
-
'--diff-decoration-marker-color': "var(--ds-border-accent-green, #22A06B)"
|
|
149
|
+
'--diff-decoration-marker-color': "var(--ds-border-accent-green, #22A06B)",
|
|
150
|
+
'--diff-decoration-marker-ring-width': '1px'
|
|
151
|
+
});
|
|
152
|
+
export const traditionalDecorationMarkerVariableNew = convertToInlineCss({
|
|
153
|
+
'--diff-decoration-marker-color': "var(--ds-background-accent-green-subtlest, #DCFFF1)",
|
|
154
|
+
'--diff-decoration-marker-ring-width': '4px'
|
|
119
155
|
});
|
|
120
156
|
export const traditionalDecorationMarkerVariableActive = convertToInlineCss({
|
|
121
|
-
'--diff-decoration-marker-color': "var(--ds-
|
|
157
|
+
'--diff-decoration-marker-color': "var(--ds-background-accent-green-subtler-pressed, #7EE2B8)",
|
|
158
|
+
'--diff-decoration-marker-ring-width': '4px'
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
/** Inline deleted traditional styling plus diff marker CSS variables (extension / embedCard / listItem). */
|
|
162
|
+
export const traditionalDeletedDecorationMarkerVariable = convertToInlineCss({
|
|
163
|
+
...deletedTraditionalInlineStyleBase,
|
|
164
|
+
'--diff-decoration-marker-color': "var(--ds-border-accent-red, #E2483D)",
|
|
165
|
+
'--diff-decoration-marker-ring-width': '1px'
|
|
166
|
+
});
|
|
167
|
+
export const traditionalDeletedDecorationMarkerVariableNew = convertToInlineCss({
|
|
168
|
+
...deletedTraditionalInlineStyleBase,
|
|
169
|
+
'--diff-decoration-marker-color': "var(--ds-background-accent-red-subtlest, #FFECEB)",
|
|
170
|
+
'--diff-decoration-marker-ring-width': '4px'
|
|
171
|
+
});
|
|
172
|
+
export const traditionalDeletedDecorationMarkerVariableActive = convertToInlineCss({
|
|
173
|
+
...deletedTraditionalInlineStyleActiveBase,
|
|
174
|
+
'--diff-decoration-marker-color': "var(--ds-background-accent-red-subtler-pressed, #FD9891)",
|
|
175
|
+
'--diff-decoration-marker-ring-width': '4px'
|
|
122
176
|
});
|
|
123
177
|
export const traditionalAddedCellOverlayStyle = convertToInlineCss({
|
|
124
178
|
position: 'absolute',
|
|
@@ -131,6 +185,17 @@ export const traditionalAddedCellOverlayStyle = convertToInlineCss({
|
|
|
131
185
|
outline: `1px solid ${"var(--ds-border-accent-green, #22A06B)"}`,
|
|
132
186
|
pointerEvents: 'none'
|
|
133
187
|
});
|
|
188
|
+
export const traditionalAddedCellOverlayStyleNew = convertToInlineCss({
|
|
189
|
+
position: 'absolute',
|
|
190
|
+
top: 0,
|
|
191
|
+
left: 0,
|
|
192
|
+
width: '100%',
|
|
193
|
+
height: '100%',
|
|
194
|
+
backgroundColor: `rgba(from ${"var(--ds-background-accent-green-subtlest, #DCFFF1)"} r g b / 0.5)`,
|
|
195
|
+
zIndex: 1,
|
|
196
|
+
outline: `1px solid ${"var(--ds-background-accent-green-subtler-pressed, #7EE2B8)"}`,
|
|
197
|
+
pointerEvents: 'none'
|
|
198
|
+
});
|
|
134
199
|
export const deletedTraditionalCellOverlayStyle = convertToInlineCss({
|
|
135
200
|
position: 'absolute',
|
|
136
201
|
top: 0,
|
|
@@ -2,7 +2,7 @@ import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
3
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
4
|
import { standardDecorationMarkerVariable, editingStyleQuoteNode, editingStyleRuleNode, editingStyleCardBlockNode, editingStyleNode, deletedContentStyleNew, deletedStyleQuoteNode } from './colorSchemes/standard';
|
|
5
|
-
import { traditionalDecorationMarkerVariable, traditionalDecorationMarkerVariableActive, traditionalStyleQuoteNode, traditionalStyleQuoteNodeActive, traditionalStyleRuleNode, traditionalStyleRuleNodeActive, traditionalStyleCardBlockNode, traditionalStyleCardBlockNodeActive, traditionalStyleNode, traditionalStyleNodeActive,
|
|
5
|
+
import { traditionalDecorationMarkerVariable, traditionalDecorationMarkerVariableActive, traditionalDecorationMarkerVariableNew, traditionalDeletedDecorationMarkerVariable, traditionalDeletedDecorationMarkerVariableActive, traditionalDeletedDecorationMarkerVariableNew, traditionalStyleQuoteNode, traditionalStyleQuoteNodeActive, traditionalStyleQuoteNodeNew, traditionalStyleRuleNode, traditionalStyleRuleNodeActive, traditionalStyleRuleNodeNew, traditionalStyleCardBlockNode, traditionalStyleCardBlockNodeActive, traditionalStyleCardBlockNodeNew, traditionalStyleNode, traditionalStyleNodeActive, traditionalStyleNodeNew, getDeletedTraditionalInlineStyle, deletedTraditionalStyleQuoteNode } from './colorSchemes/traditional';
|
|
6
6
|
const getNodeClass = name => {
|
|
7
7
|
switch (name) {
|
|
8
8
|
case 'extension':
|
|
@@ -29,51 +29,51 @@ const getBlockNodeStyle = ({
|
|
|
29
29
|
if (['extension', 'embedCard', 'listItem'].includes(nodeName)) {
|
|
30
30
|
if (expValEquals('platform_editor_diff_plugin_extended', 'isEnabled', true)) {
|
|
31
31
|
if (isInserted) {
|
|
32
|
-
return isTraditional && isActive ? traditionalDecorationMarkerVariableActive : isTraditional ? traditionalDecorationMarkerVariable : standardDecorationMarkerVariable;
|
|
32
|
+
return isTraditional && isActive ? traditionalDecorationMarkerVariableActive : isTraditional ? fg('platform_editor_show_diff_scroll_navigation') ? traditionalDecorationMarkerVariableNew : traditionalDecorationMarkerVariable : standardDecorationMarkerVariable;
|
|
33
33
|
} else {
|
|
34
|
-
return isTraditional ?
|
|
34
|
+
return isTraditional && isActive ? traditionalDeletedDecorationMarkerVariableActive : isTraditional ? fg('platform_editor_show_diff_scroll_navigation') ? traditionalDeletedDecorationMarkerVariableNew : traditionalDeletedDecorationMarkerVariable : deletedContentStyleNew;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
return isTraditional && isActive ? traditionalDecorationMarkerVariableActive : isTraditional ? traditionalDecorationMarkerVariable : standardDecorationMarkerVariable;
|
|
37
|
+
return isTraditional && isActive ? traditionalDecorationMarkerVariableActive : isTraditional ? fg('platform_editor_show_diff_scroll_navigation') ? traditionalDecorationMarkerVariableNew : traditionalDecorationMarkerVariable : standardDecorationMarkerVariable;
|
|
38
38
|
}
|
|
39
39
|
if (nodeName === 'blockquote') {
|
|
40
40
|
if (expValEquals('platform_editor_diff_plugin_extended', 'isEnabled', true)) {
|
|
41
41
|
if (isInserted) {
|
|
42
|
-
return isTraditional ? isActive ? traditionalStyleQuoteNodeActive : traditionalStyleQuoteNode : editingStyleQuoteNode;
|
|
42
|
+
return isTraditional ? isActive ? traditionalStyleQuoteNodeActive : fg('platform_editor_show_diff_scroll_navigation') ? traditionalStyleQuoteNodeNew : traditionalStyleQuoteNode : editingStyleQuoteNode;
|
|
43
43
|
} else {
|
|
44
44
|
return isTraditional ? deletedTraditionalStyleQuoteNode : deletedStyleQuoteNode;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
return isTraditional ? isActive ? traditionalStyleQuoteNodeActive : traditionalStyleQuoteNode : editingStyleQuoteNode;
|
|
47
|
+
return isTraditional ? isActive ? traditionalStyleQuoteNodeActive : fg('platform_editor_show_diff_scroll_navigation') ? traditionalStyleQuoteNodeNew : traditionalStyleQuoteNode : editingStyleQuoteNode;
|
|
48
48
|
}
|
|
49
49
|
if (nodeName === 'rule') {
|
|
50
50
|
if (expValEquals('platform_editor_diff_plugin_extended', 'isEnabled', true)) {
|
|
51
51
|
if (isInserted) {
|
|
52
|
-
return isTraditional ? isActive ? traditionalStyleRuleNodeActive : traditionalStyleRuleNode : editingStyleRuleNode;
|
|
52
|
+
return isTraditional ? isActive ? traditionalStyleRuleNodeActive : fg('platform_editor_show_diff_scroll_navigation') ? traditionalStyleRuleNodeNew : traditionalStyleRuleNode : editingStyleRuleNode;
|
|
53
53
|
} else {
|
|
54
|
-
return isTraditional ?
|
|
54
|
+
return isTraditional ? getDeletedTraditionalInlineStyle(false) : deletedContentStyleNew;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
return isTraditional ? isActive ? traditionalStyleRuleNodeActive : traditionalStyleRuleNode : editingStyleRuleNode;
|
|
57
|
+
return isTraditional ? isActive ? traditionalStyleRuleNodeActive : fg('platform_editor_show_diff_scroll_navigation') ? traditionalStyleRuleNodeNew : traditionalStyleRuleNode : editingStyleRuleNode;
|
|
58
58
|
}
|
|
59
59
|
if (nodeName === 'blockCard') {
|
|
60
60
|
if (expValEquals('platform_editor_diff_plugin_extended', 'isEnabled', true)) {
|
|
61
61
|
if (isInserted) {
|
|
62
|
-
return isTraditional ? isActive ? traditionalStyleCardBlockNodeActive : traditionalStyleCardBlockNode : editingStyleCardBlockNode;
|
|
62
|
+
return isTraditional ? isActive ? traditionalStyleCardBlockNodeActive : fg('platform_editor_show_diff_scroll_navigation') ? traditionalStyleCardBlockNodeNew : traditionalStyleCardBlockNode : editingStyleCardBlockNode;
|
|
63
63
|
} else {
|
|
64
|
-
return isTraditional ?
|
|
64
|
+
return isTraditional ? getDeletedTraditionalInlineStyle(false) : deletedContentStyleNew;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
return isTraditional ? isActive ? traditionalStyleCardBlockNodeActive : traditionalStyleCardBlockNode : editingStyleCardBlockNode;
|
|
67
|
+
return isTraditional ? isActive ? traditionalStyleCardBlockNodeActive : fg('platform_editor_show_diff_scroll_navigation') ? traditionalStyleCardBlockNodeNew : traditionalStyleCardBlockNode : editingStyleCardBlockNode;
|
|
68
68
|
}
|
|
69
69
|
if (expValEquals('platform_editor_diff_plugin_extended', 'isEnabled', true)) {
|
|
70
70
|
if (isInserted) {
|
|
71
|
-
return isTraditional ? isActive ? traditionalStyleNodeActive : traditionalStyleNode : editingStyleNode;
|
|
71
|
+
return isTraditional ? isActive ? traditionalStyleNodeActive : fg('platform_editor_show_diff_scroll_navigation') ? traditionalStyleNodeNew : traditionalStyleNode : editingStyleNode;
|
|
72
72
|
} else {
|
|
73
|
-
return isTraditional ?
|
|
73
|
+
return isTraditional ? getDeletedTraditionalInlineStyle(false) : deletedContentStyleNew;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
return isTraditional ? isActive ? traditionalStyleNodeActive : traditionalStyleNode : editingStyleNode;
|
|
76
|
+
return isTraditional ? isActive ? traditionalStyleNodeActive : fg('platform_editor_show_diff_scroll_navigation') ? traditionalStyleNodeNew : traditionalStyleNode : editingStyleNode;
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
2
2
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
3
|
import { editingStyle, editingStyleActive, deletedContentStyle, deletedContentStyleActive } from './colorSchemes/standard';
|
|
4
|
-
import { traditionalInsertStyle, traditionalInsertStyleActive,
|
|
4
|
+
import { traditionalInsertStyle, traditionalInsertStyleActive, getDeletedTraditionalInlineStyle } from './colorSchemes/traditional';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Inline decoration used for insertions as the content already exists in the document
|
|
@@ -26,7 +26,7 @@ export const createInlineChangedDecoration = ({
|
|
|
26
26
|
}
|
|
27
27
|
} else {
|
|
28
28
|
if (colorScheme === 'traditional') {
|
|
29
|
-
style =
|
|
29
|
+
style = getDeletedTraditionalInlineStyle(false);
|
|
30
30
|
} else {
|
|
31
31
|
style = isActive ? deletedContentStyleActive : deletedContentStyle;
|
|
32
32
|
}
|
|
@@ -2,8 +2,8 @@ import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
|
2
2
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
4
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
|
-
import { editingStyle, editingStyleActive, deletedContentStyle, deletedContentStyleActive, deletedContentStyleNew,
|
|
6
|
-
import { traditionalInsertStyle, traditionalInsertStyleActive,
|
|
5
|
+
import { editingStyle, editingStyleActive, deletedContentStyle, deletedContentStyleActive, deletedContentStyleNew, deletedContentStyleUnbounded } from './colorSchemes/standard';
|
|
6
|
+
import { traditionalInsertStyle, traditionalInsertStyleActive, getDeletedTraditionalInlineStyle, deletedTraditionalContentStyleUnbounded, deletedTraditionalContentStyleUnboundedActive } from './colorSchemes/traditional';
|
|
7
7
|
import { createChangedRowDecorationWidgets } from './createChangedRowDecorationWidgets';
|
|
8
8
|
import { findSafeInsertPos } from './utils/findSafeInsertPos';
|
|
9
9
|
import { wrapBlockNodeView } from './utils/wrapBlockNodeView';
|
|
@@ -27,10 +27,10 @@ const getInsertedContentStyle = (colorScheme, isActive = false) => {
|
|
|
27
27
|
};
|
|
28
28
|
const getDeletedContentStyle = (colorScheme, isActive = false) => {
|
|
29
29
|
if (colorScheme === 'traditional') {
|
|
30
|
-
return isActive
|
|
30
|
+
return getDeletedTraditionalInlineStyle(isActive);
|
|
31
31
|
}
|
|
32
32
|
if (isActive) {
|
|
33
|
-
return
|
|
33
|
+
return deletedContentStyleActive;
|
|
34
34
|
}
|
|
35
35
|
return expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? deletedContentStyleNew : deletedContentStyle;
|
|
36
36
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
2
|
import { trackChangesMessages } from '@atlaskit/editor-common/messages';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
|
-
import { deletedBlockOutline, deletedBlockOutlineActive, deletedBlockOutlineRounded, deletedBlockOutlineRoundedActive, deletedContentStyle, deletedContentStyleActive, deletedContentStyleNew,
|
|
5
|
-
import { deletedTraditionalBlockOutline, deletedTraditionalBlockOutlineActive, deletedTraditionalBlockOutlineRounded, deletedTraditionalBlockOutlineRoundedActive,
|
|
5
|
+
import { deletedBlockOutline, deletedBlockOutlineActive, deletedBlockOutlineRounded, deletedBlockOutlineRoundedActive, deletedContentStyle, deletedContentStyleActive, deletedContentStyleNew, deletedStyleQuoteNodeWithLozenge, deletedStyleQuoteNodeWithLozengeActive, editingStyle, editingStyleActive, editingStyleNode, addedCellOverlayStyle, deletedCellOverlayStyle } from '../colorSchemes/standard';
|
|
6
|
+
import { deletedTraditionalBlockOutline, deletedTraditionalBlockOutlineActive, deletedTraditionalBlockOutlineNew, deletedTraditionalBlockOutlineRounded, deletedTraditionalBlockOutlineRoundedActive, deletedTraditionalBlockOutlineRoundedNew, getDeletedTraditionalInlineStyle, deletedTraditionalStyleQuoteNode, deletedTraditionalStyleQuoteNodeActive, traditionalInsertStyle, traditionalInsertStyleActive, traditionalStyleNode, traditionalStyleNodeActive, traditionalStyleNodeNew, traditionalAddedCellOverlayStyle, traditionalAddedCellOverlayStyleNew, deletedTraditionalCellOverlayStyle } from '../colorSchemes/traditional';
|
|
6
7
|
const lozengeStyle = convertToInlineCss({
|
|
7
8
|
display: 'inline-flex',
|
|
8
9
|
boxSizing: 'border-box',
|
|
@@ -59,10 +60,10 @@ const getChangedContentStyle = (colorScheme, isActive = false, isInserted = fals
|
|
|
59
60
|
return isActive ? editingStyleActive : editingStyle;
|
|
60
61
|
}
|
|
61
62
|
if (colorScheme === 'traditional') {
|
|
62
|
-
return isActive
|
|
63
|
+
return getDeletedTraditionalInlineStyle(isActive);
|
|
63
64
|
}
|
|
64
65
|
if (isActive) {
|
|
65
|
-
return
|
|
66
|
+
return deletedContentStyleActive;
|
|
66
67
|
}
|
|
67
68
|
return expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? deletedContentStyleNew : deletedContentStyle;
|
|
68
69
|
};
|
|
@@ -73,7 +74,10 @@ const getChangedNodeStyle = (nodeName, colorScheme, isInserted = false, isActive
|
|
|
73
74
|
return undefined;
|
|
74
75
|
}
|
|
75
76
|
if (isTraditional) {
|
|
76
|
-
|
|
77
|
+
if (fg('platform_editor_show_diff_scroll_navigation')) {
|
|
78
|
+
return isActive ? traditionalStyleNodeActive : traditionalStyleNodeNew;
|
|
79
|
+
}
|
|
80
|
+
return isActive ? traditionalStyleNodeActive : traditionalStyleNode;
|
|
77
81
|
}
|
|
78
82
|
return editingStyleNode;
|
|
79
83
|
}
|
|
@@ -86,13 +90,13 @@ const getChangedNodeStyle = (nodeName, colorScheme, isInserted = false, isActive
|
|
|
86
90
|
case 'expand':
|
|
87
91
|
case 'decisionList':
|
|
88
92
|
if (isTraditional) {
|
|
89
|
-
return isActive ? deletedTraditionalBlockOutlineActive : deletedTraditionalBlockOutline;
|
|
93
|
+
return isActive ? deletedTraditionalBlockOutlineActive : fg('platform_editor_show_diff_scroll_navigation') ? deletedTraditionalBlockOutlineNew : deletedTraditionalBlockOutline;
|
|
90
94
|
}
|
|
91
95
|
return isActive ? deletedBlockOutlineActive : deletedBlockOutline;
|
|
92
96
|
case 'panel':
|
|
93
97
|
case 'codeBlock':
|
|
94
98
|
if (isTraditional) {
|
|
95
|
-
return isActive ? deletedTraditionalBlockOutlineRoundedActive : deletedTraditionalBlockOutlineRounded;
|
|
99
|
+
return isActive ? deletedTraditionalBlockOutlineRoundedActive : fg('platform_editor_show_diff_scroll_navigation') ? deletedTraditionalBlockOutlineRoundedNew : deletedTraditionalBlockOutlineRounded;
|
|
96
100
|
}
|
|
97
101
|
return isActive ? deletedBlockOutlineRoundedActive : deletedBlockOutlineRounded;
|
|
98
102
|
default:
|
|
@@ -124,6 +128,22 @@ const shouldAddShowDiffDeletedNodeClass = nodeName => {
|
|
|
124
128
|
}
|
|
125
129
|
};
|
|
126
130
|
|
|
131
|
+
/** Scroll-nav “new” ring (4px red subtlest) for media/embed; styled in editor-core smartCardStyles. */
|
|
132
|
+
const maybeAddDeletedOutlineNewClass = ({
|
|
133
|
+
nodeView,
|
|
134
|
+
targetNode,
|
|
135
|
+
colorScheme,
|
|
136
|
+
isActive = false
|
|
137
|
+
}) => {
|
|
138
|
+
const name = targetNode.type.name;
|
|
139
|
+
if (name !== 'mediaSingle' && name !== 'embedCard') {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (colorScheme === 'traditional' && !isActive && fg('platform_editor_show_diff_scroll_navigation')) {
|
|
143
|
+
nodeView.classList.add('show-diff-deleted-outline-new');
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
|
|
127
147
|
/**
|
|
128
148
|
* Checks if a node should apply deleted styles directly without wrapper
|
|
129
149
|
* to preserve natural block-level margins
|
|
@@ -138,7 +158,7 @@ const applyCellOverlayStyles = ({
|
|
|
138
158
|
}) => {
|
|
139
159
|
element.querySelectorAll('td, th').forEach(cell => {
|
|
140
160
|
const overlay = document.createElement('span');
|
|
141
|
-
const overlayStyle = colorScheme === 'traditional' ? isInserted ? traditionalAddedCellOverlayStyle : deletedTraditionalCellOverlayStyle : isInserted ? addedCellOverlayStyle : deletedCellOverlayStyle;
|
|
161
|
+
const overlayStyle = colorScheme === 'traditional' ? isInserted ? fg('platform_editor_show_diff_scroll_navigation') ? traditionalAddedCellOverlayStyleNew : traditionalAddedCellOverlayStyle : deletedTraditionalCellOverlayStyle : isInserted ? addedCellOverlayStyle : deletedCellOverlayStyle;
|
|
142
162
|
overlay.setAttribute('style', overlayStyle);
|
|
143
163
|
cell.appendChild(overlay);
|
|
144
164
|
});
|
|
@@ -255,6 +275,12 @@ const handleEmbedCardWithLozenge = ({
|
|
|
255
275
|
if (isActive) {
|
|
256
276
|
nodeView.classList.add('show-diff-deleted-active');
|
|
257
277
|
}
|
|
278
|
+
maybeAddDeletedOutlineNewClass({
|
|
279
|
+
nodeView,
|
|
280
|
+
targetNode,
|
|
281
|
+
colorScheme,
|
|
282
|
+
isActive
|
|
283
|
+
});
|
|
258
284
|
}
|
|
259
285
|
dom.append(nodeView);
|
|
260
286
|
return true;
|
|
@@ -295,6 +321,12 @@ const handleMediaSingleWithLozenge = ({
|
|
|
295
321
|
if (isActive) {
|
|
296
322
|
nodeView.classList.add('show-diff-deleted-active');
|
|
297
323
|
}
|
|
324
|
+
maybeAddDeletedOutlineNewClass({
|
|
325
|
+
nodeView,
|
|
326
|
+
targetNode,
|
|
327
|
+
colorScheme,
|
|
328
|
+
isActive
|
|
329
|
+
});
|
|
298
330
|
}
|
|
299
331
|
dom.append(nodeView);
|
|
300
332
|
return true;
|
|
@@ -351,6 +383,12 @@ const wrapBlockNode = ({
|
|
|
351
383
|
if (isActive) {
|
|
352
384
|
nodeView.classList.add('show-diff-deleted-active');
|
|
353
385
|
}
|
|
386
|
+
maybeAddDeletedOutlineNewClass({
|
|
387
|
+
nodeView,
|
|
388
|
+
targetNode,
|
|
389
|
+
colorScheme,
|
|
390
|
+
isActive
|
|
391
|
+
});
|
|
354
392
|
}
|
|
355
393
|
dom.append(blockWrapper);
|
|
356
394
|
};
|
|
@@ -32,13 +32,6 @@ export var deletedContentStyleNew = convertToInlineCss({
|
|
|
32
32
|
position: 'relative',
|
|
33
33
|
opacity: 0.8
|
|
34
34
|
});
|
|
35
|
-
export var deletedContentStyleNewActive = convertToInlineCss({
|
|
36
|
-
color: "var(--ds-text, #292A2E)",
|
|
37
|
-
textDecoration: 'line-through',
|
|
38
|
-
textDecorationColor: "var(--ds-text-accent-gray, #505258)",
|
|
39
|
-
position: 'relative',
|
|
40
|
-
opacity: 1
|
|
41
|
-
});
|
|
42
35
|
export var deletedContentStyleUnbounded = convertToInlineCss({
|
|
43
36
|
position: 'absolute',
|
|
44
37
|
top: '50%',
|
|
@@ -66,7 +59,7 @@ export var deletedStyleQuoteNodeWithLozengeActive = convertToInlineCss({
|
|
|
66
59
|
paddingTop: "var(--ds-space-025, 2px)",
|
|
67
60
|
paddingBottom: "var(--ds-space-025, 2px)",
|
|
68
61
|
paddingLeft: "var(--ds-space-025, 2px)",
|
|
69
|
-
boxShadow: "0 0 0
|
|
62
|
+
boxShadow: "0 0 0 4px ".concat("var(--ds-border-accent-red, #E2483D)"),
|
|
70
63
|
borderRadius: "var(--ds-radius-small, 4px)"
|
|
71
64
|
});
|
|
72
65
|
export var deletedBlockOutline = convertToInlineCss({
|
|
@@ -74,7 +67,7 @@ export var deletedBlockOutline = convertToInlineCss({
|
|
|
74
67
|
borderRadius: "var(--ds-radius-small, 4px)"
|
|
75
68
|
});
|
|
76
69
|
export var deletedBlockOutlineActive = convertToInlineCss({
|
|
77
|
-
boxShadow: "0 0 0
|
|
70
|
+
boxShadow: "0 0 0 4px ".concat("var(--ds-border-accent-red, #E2483D)"),
|
|
78
71
|
borderRadius: "var(--ds-radius-small, 4px)"
|
|
79
72
|
});
|
|
80
73
|
export var deletedBlockOutlineRounded = convertToInlineCss({
|
|
@@ -82,7 +75,7 @@ export var deletedBlockOutlineRounded = convertToInlineCss({
|
|
|
82
75
|
borderRadius: "calc(".concat("var(--ds-radius-xsmall, 2px)", " + 1px)")
|
|
83
76
|
});
|
|
84
77
|
export var deletedBlockOutlineRoundedActive = convertToInlineCss({
|
|
85
|
-
boxShadow: "0 0 0
|
|
78
|
+
boxShadow: "0 0 0 4px ".concat("var(--ds-border-accent-red, #E2483D)"),
|
|
86
79
|
borderRadius: "calc(".concat("var(--ds-radius-xsmall, 2px)", " + 1px)")
|
|
87
80
|
});
|
|
88
81
|
export var deletedRowStyle = convertToInlineCss({
|
|
@@ -106,7 +99,8 @@ export var editingStyleCardBlockNode = convertToInlineCss({
|
|
|
106
99
|
borderRadius: "var(--ds-radius-medium, 6px)"
|
|
107
100
|
});
|
|
108
101
|
export var standardDecorationMarkerVariable = convertToInlineCss({
|
|
109
|
-
'--diff-decoration-marker-color': "var(--ds-border-accent-purple, #AF59E1)"
|
|
102
|
+
'--diff-decoration-marker-color': "var(--ds-border-accent-purple, #AF59E1)",
|
|
103
|
+
'--diff-decoration-marker-ring-width': '1px'
|
|
110
104
|
});
|
|
111
105
|
export var addedCellOverlayStyle = convertToInlineCss({
|
|
112
106
|
position: 'absolute',
|