@atlaskit/editor-plugin-show-diff 12.1.2 → 12.1.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/compass.yml +3 -3
  3. package/dist/cjs/pm-plugins/calculateDiff/attrAwareTokenEncoder.js +76 -0
  4. package/dist/cjs/pm-plugins/calculateDiff/calculateDiffDecorations.js +47 -124
  5. package/dist/cjs/pm-plugins/calculateDiff/computeDiffChanges.js +8 -1
  6. package/dist/cjs/pm-plugins/calculateDiff/diffBySteps.js +3 -125
  7. package/dist/cjs/pm-plugins/calculateDiff/smart/classifySmartChanges.js +9 -0
  8. package/dist/cjs/pm-plugins/decorations/colorSchemes/factory.js +678 -0
  9. package/dist/cjs/pm-plugins/decorations/colorSchemes/schemes.js +39 -0
  10. package/dist/cjs/pm-plugins/decorations/colorSchemes/types.js +1 -0
  11. package/dist/es2019/pm-plugins/calculateDiff/attrAwareTokenEncoder.js +64 -0
  12. package/dist/es2019/pm-plugins/calculateDiff/calculateDiffDecorations.js +15 -89
  13. package/dist/es2019/pm-plugins/calculateDiff/computeDiffChanges.js +8 -1
  14. package/dist/es2019/pm-plugins/calculateDiff/diffBySteps.js +2 -105
  15. package/dist/es2019/pm-plugins/calculateDiff/smart/classifySmartChanges.js +9 -0
  16. package/dist/es2019/pm-plugins/decorations/colorSchemes/factory.js +625 -0
  17. package/dist/es2019/pm-plugins/decorations/colorSchemes/schemes.js +33 -0
  18. package/dist/es2019/pm-plugins/decorations/colorSchemes/types.js +0 -0
  19. package/dist/esm/pm-plugins/calculateDiff/attrAwareTokenEncoder.js +70 -0
  20. package/dist/esm/pm-plugins/calculateDiff/calculateDiffDecorations.js +48 -125
  21. package/dist/esm/pm-plugins/calculateDiff/computeDiffChanges.js +8 -1
  22. package/dist/esm/pm-plugins/calculateDiff/diffBySteps.js +2 -124
  23. package/dist/esm/pm-plugins/calculateDiff/smart/classifySmartChanges.js +9 -0
  24. package/dist/esm/pm-plugins/decorations/colorSchemes/factory.js +622 -0
  25. package/dist/esm/pm-plugins/decorations/colorSchemes/schemes.js +33 -0
  26. package/dist/esm/pm-plugins/decorations/colorSchemes/types.js +0 -0
  27. package/dist/types/pm-plugins/calculateDiff/attrAwareTokenEncoder.d.ts +7 -0
  28. package/dist/types/pm-plugins/calculateDiff/diffBySteps.d.ts +0 -20
  29. package/dist/types/pm-plugins/decorations/colorSchemes/factory.d.ts +101 -0
  30. package/dist/types/pm-plugins/decorations/colorSchemes/schemes.d.ts +5 -0
  31. package/dist/types/pm-plugins/decorations/colorSchemes/types.d.ts +38 -0
  32. package/package.json +6 -6
  33. package/dist/cjs/pm-plugins/decorations/createGranularBlockReferenceWidget.js +0 -125
  34. package/dist/es2019/pm-plugins/decorations/createGranularBlockReferenceWidget.js +0 -120
  35. package/dist/esm/pm-plugins/decorations/createGranularBlockReferenceWidget.js +0 -120
  36. package/dist/types/pm-plugins/decorations/createGranularBlockReferenceWidget.d.ts +0 -36
@@ -0,0 +1,678 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.buildAddedCellOverlayRoundedStyle = buildAddedCellOverlayRoundedStyle;
8
+ exports.buildAddedCellOverlayStyle = buildAddedCellOverlayStyle;
9
+ exports.buildAddedCellOverlayStyleNew = buildAddedCellOverlayStyleNew;
10
+ exports.buildDecorationMarkerVariable = buildDecorationMarkerVariable;
11
+ exports.buildDecorationMarkerVariableActive = buildDecorationMarkerVariableActive;
12
+ exports.buildDecorationMarkerVariableNew = buildDecorationMarkerVariableNew;
13
+ exports.buildDeletedBlockOutline = buildDeletedBlockOutline;
14
+ exports.buildDeletedBlockOutlineActive = buildDeletedBlockOutlineActive;
15
+ exports.buildDeletedBlockOutlineNew = buildDeletedBlockOutlineNew;
16
+ exports.buildDeletedBlockOutlineRounded = buildDeletedBlockOutlineRounded;
17
+ exports.buildDeletedBlockOutlineRoundedActive = buildDeletedBlockOutlineRoundedActive;
18
+ exports.buildDeletedBlockOutlineRoundedNew = buildDeletedBlockOutlineRoundedNew;
19
+ exports.buildDeletedCellOverlayRoundedStyle = buildDeletedCellOverlayRoundedStyle;
20
+ exports.buildDeletedCellOverlayStyle = buildDeletedCellOverlayStyle;
21
+ exports.buildDeletedContentStyleUnbounded = buildDeletedContentStyleUnbounded;
22
+ exports.buildDeletedContentStyleUnboundedActive = buildDeletedContentStyleUnboundedActive;
23
+ exports.buildDeletedDecorationMarkerVariable = buildDeletedDecorationMarkerVariable;
24
+ exports.buildDeletedDecorationMarkerVariableActive = buildDeletedDecorationMarkerVariableActive;
25
+ exports.buildDeletedDecorationMarkerVariableNew = buildDeletedDecorationMarkerVariableNew;
26
+ exports.buildDeletedDecorationMarkerVariableSimple = buildDeletedDecorationMarkerVariableSimple;
27
+ exports.buildDeletedInlineContentStyleExtended = buildDeletedInlineContentStyleExtended;
28
+ exports.buildDeletedInlineStyle = buildDeletedInlineStyle;
29
+ exports.buildDeletedInlineStyleStandard = buildDeletedInlineStyleStandard;
30
+ exports.buildDeletedInlineStyleUnbounded = buildDeletedInlineStyleUnbounded;
31
+ exports.buildDeletedRowStyle = buildDeletedRowStyle;
32
+ exports.buildDeletedStyleQuoteNode = buildDeletedStyleQuoteNode;
33
+ exports.buildDeletedStyleQuoteNodeActive = buildDeletedStyleQuoteNodeActive;
34
+ exports.buildDeletedStyleQuoteNodeWithLozenge = buildDeletedStyleQuoteNodeWithLozenge;
35
+ exports.buildDeletedStyleQuoteNodeWithLozengeActive = buildDeletedStyleQuoteNodeWithLozengeActive;
36
+ exports.buildInsertStyle = buildInsertStyle;
37
+ exports.buildInsertStyleActive = buildInsertStyleActive;
38
+ exports.buildInsertStyleCardBlockNode = buildInsertStyleCardBlockNode;
39
+ exports.buildInsertStyleCardBlockNodeActive = buildInsertStyleCardBlockNodeActive;
40
+ exports.buildInsertStyleCardBlockNodeNew = buildInsertStyleCardBlockNodeNew;
41
+ exports.buildInsertStyleExtended = buildInsertStyleExtended;
42
+ exports.buildInsertStyleExtendedActive = buildInsertStyleExtendedActive;
43
+ exports.buildInsertStyleExtendedNoUnderline = buildInsertStyleExtendedNoUnderline;
44
+ exports.buildInsertStyleExtendedNoUnderlineActive = buildInsertStyleExtendedNoUnderlineActive;
45
+ exports.buildInsertStyleInBlock = buildInsertStyleInBlock;
46
+ exports.buildInsertStyleInBlockExtended = buildInsertStyleInBlockExtended;
47
+ exports.buildInsertStyleInBlockExtendedNoUnderline = buildInsertStyleInBlockExtendedNoUnderline;
48
+ exports.buildInsertStyleNode = buildInsertStyleNode;
49
+ exports.buildInsertStyleNodeActive = buildInsertStyleNodeActive;
50
+ exports.buildInsertStyleNodeNew = buildInsertStyleNodeNew;
51
+ exports.buildInsertStyleQuoteNode = buildInsertStyleQuoteNode;
52
+ exports.buildInsertStyleQuoteNodeActive = buildInsertStyleQuoteNodeActive;
53
+ exports.buildInsertStyleQuoteNodeNew = buildInsertStyleQuoteNodeNew;
54
+ exports.buildInsertStyleRuleNode = buildInsertStyleRuleNode;
55
+ exports.buildInsertStyleRuleNodeActive = buildInsertStyleRuleNodeActive;
56
+ exports.buildInsertStyleRuleNodeNew = buildInsertStyleRuleNodeNew;
57
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
58
+ var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
59
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
60
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
61
+ // token() is a build-time transform needing static literals, so pre-compute every colour's
62
+ // tokens here and index by name at runtime.
63
+
64
+ var bgSubtlestMap = {
65
+ green: "var(--ds-background-accent-green-subtlest, #DCFFF1)",
66
+ teal: "var(--ds-background-accent-teal-subtlest, #E7F9FF)",
67
+ blue: "var(--ds-background-accent-blue-subtlest, #E9F2FE)",
68
+ purple: "var(--ds-background-accent-purple-subtlest, #F8EEFE)",
69
+ red: "var(--ds-background-accent-red-subtlest, #FFECEB)",
70
+ orange: "var(--ds-background-accent-orange-subtlest, #FFF5DB)",
71
+ yellow: "var(--ds-background-accent-yellow-subtlest, #FEF7C8)",
72
+ magenta: "var(--ds-background-accent-magenta-subtlest, #FFECF8)",
73
+ gray: "var(--ds-background-accent-gray-subtlest, #F0F1F2)"
74
+ };
75
+ var bgSubtlestPressedMap = {
76
+ green: "var(--ds-background-accent-green-subtlest-pressed, #97EDC9)",
77
+ teal: "var(--ds-background-accent-teal-subtlest-pressed, #B1E4F7)",
78
+ blue: "var(--ds-background-accent-blue-subtlest-pressed, #ADCBFB)",
79
+ purple: "var(--ds-background-accent-purple-subtlest-pressed, #E3BDFA)",
80
+ red: "var(--ds-background-accent-red-subtlest-pressed, #FFB8B2)",
81
+ orange: "var(--ds-background-accent-orange-subtlest-pressed, #FBD779)",
82
+ yellow: "var(--ds-background-accent-yellow-subtlest-pressed, #EFDD4E)",
83
+ magenta: "var(--ds-background-accent-magenta-subtlest-pressed, #FCB6E1)",
84
+ gray: "var(--ds-background-accent-gray-subtlest-pressed, #B7B9BE)"
85
+ };
86
+ var bgSubtlerPressedMap = {
87
+ green: "var(--ds-background-accent-green-subtler-pressed, #7EE2B8)",
88
+ teal: "var(--ds-background-accent-teal-subtler-pressed, #9DD9EE)",
89
+ blue: "var(--ds-background-accent-blue-subtler-pressed, #8FB8F6)",
90
+ purple: "var(--ds-background-accent-purple-subtler-pressed, #D8A0F7)",
91
+ red: "var(--ds-background-accent-red-subtler-pressed, #FD9891)",
92
+ orange: "var(--ds-background-accent-orange-subtler-pressed, #FBC828)",
93
+ yellow: "var(--ds-background-accent-yellow-subtler-pressed, #EED12B)",
94
+ magenta: "var(--ds-background-accent-magenta-subtler-pressed, #F797D2)",
95
+ gray: "var(--ds-background-accent-gray-subtler-pressed, #8C8F97)"
96
+ };
97
+ var borderAccentMap = {
98
+ green: "var(--ds-border-accent-green, #22A06B)",
99
+ teal: "var(--ds-border-accent-teal, #2898BD)",
100
+ blue: "var(--ds-border-accent-blue, #357DE8)",
101
+ purple: "var(--ds-border-accent-purple, #AF59E1)",
102
+ red: "var(--ds-border-accent-red, #E2483D)",
103
+ orange: "var(--ds-border-accent-orange, #E06C00)",
104
+ yellow: "var(--ds-border-accent-yellow, #B38600)",
105
+ magenta: "var(--ds-border-accent-magenta, #CD519D)",
106
+ gray: "var(--ds-border-accent-gray, #7D818A)"
107
+ };
108
+ var textAccentMap = {
109
+ green: "var(--ds-text-accent-green, #216E4E)",
110
+ teal: "var(--ds-text-accent-teal, #206A83)",
111
+ blue: "var(--ds-text-accent-blue, #1558BC)",
112
+ purple: "var(--ds-text-accent-purple, #803FA5)",
113
+ red: "var(--ds-text-accent-red, #AE2E24)",
114
+ orange: "var(--ds-text-accent-orange, #9E4C00)",
115
+ yellow: "var(--ds-text-accent-yellow, #7F5F01)",
116
+ magenta: "var(--ds-text-accent-magenta, #943D73)",
117
+ gray: "var(--ds-text-accent-gray, #505258)"
118
+ };
119
+ function bgSubtlest(color) {
120
+ return bgSubtlestMap[color];
121
+ }
122
+ function bgSubtlestPressed(color) {
123
+ return bgSubtlestPressedMap[color];
124
+ }
125
+ function bgSubtlerPressed(color) {
126
+ return bgSubtlerPressedMap[color];
127
+ }
128
+ function borderAccent(color) {
129
+ return borderAccentMap[color];
130
+ }
131
+ function textAccent(color) {
132
+ return textAccentMap[color];
133
+ }
134
+
135
+ /** Outline colour for deleted table-cell overlays. */
136
+ function deletedCellOutline(colors) {
137
+ return colors.deletedCellBorderProminence === 'subtle' ? "var(--ds-border-disabled, #0515240F)" : borderAccent(colors.deletedCellColor);
138
+ }
139
+
140
+ /** Ring colour for an active (scroll-target) deleted block outline. */
141
+ function deletedBlockOutlineActiveRing(colors) {
142
+ return colors.deletedBlockOutlineActiveEmphasis === 'border' ? borderAccent(colors.deleteActiveColor) : bgSubtlerPressed(colors.deleteActiveColor);
143
+ }
144
+
145
+ // --- Inserted content styles ---
146
+
147
+ /** Inline inserted content — default state. */
148
+ function buildInsertStyle(colors) {
149
+ return (0, _lazyNodeView.convertToInlineCss)({
150
+ background: bgSubtlest(colors.insertColor),
151
+ textDecoration: 'underline',
152
+ textDecorationStyle: colors.insertUnderlineStyle,
153
+ textDecorationThickness: "var(--ds-space-025, 2px)",
154
+ textDecorationColor: borderAccent(colors.insertColor)
155
+ });
156
+ }
157
+
158
+ /** Inline insert style for content within a block node (no background, underline only). */
159
+ function buildInsertStyleInBlock(colors) {
160
+ return (0, _lazyNodeView.convertToInlineCss)({
161
+ textDecoration: 'underline',
162
+ textDecorationStyle: colors.insertUnderlineStyle,
163
+ textDecorationThickness: "var(--ds-space-025, 2px)",
164
+ textDecorationColor: borderAccent(colors.insertColor)
165
+ });
166
+ }
167
+
168
+ /** Extended insert style — background + border-bottom underline. */
169
+ function buildInsertStyleExtended(colors) {
170
+ return (0, _lazyNodeView.convertToInlineCss)({
171
+ background: bgSubtlest(colors.insertColor),
172
+ borderBottom: "2px solid ".concat(borderAccent(colors.insertColor)),
173
+ padding: "1px 0 2px"
174
+ });
175
+ }
176
+
177
+ /** Extended insert style for content within a block node (border-bottom only, no background). */
178
+ function buildInsertStyleInBlockExtended(colors) {
179
+ return (0, _lazyNodeView.convertToInlineCss)({
180
+ borderBottom: "2px solid ".concat(borderAccent(colors.insertColor)),
181
+ padding: "1px 0 2px"
182
+ });
183
+ }
184
+
185
+ /** Active state of the extended insert style. */
186
+ function buildInsertStyleExtendedActive(colors) {
187
+ return (0, _lazyNodeView.convertToInlineCss)({
188
+ background: bgSubtlerPressed(colors.insertActiveColor),
189
+ borderBottom: "2px solid ".concat(borderAccent(colors.insertColor)),
190
+ padding: "1px 0 2px"
191
+ });
192
+ }
193
+
194
+ /** Extended insert style without underline — background + padding only. */
195
+ function buildInsertStyleExtendedNoUnderline(colors) {
196
+ return (0, _lazyNodeView.convertToInlineCss)({
197
+ background: bgSubtlest(colors.insertColor),
198
+ padding: "1px 0 2px"
199
+ });
200
+ }
201
+
202
+ /** Active state of the no-underline extended insert style. */
203
+ function buildInsertStyleExtendedNoUnderlineActive(colors) {
204
+ return (0, _lazyNodeView.convertToInlineCss)({
205
+ background: bgSubtlerPressed(colors.insertActiveColor),
206
+ padding: "1px 0 2px"
207
+ });
208
+ }
209
+
210
+ /** No-underline extended insert style for block content (padding only). */
211
+ function buildInsertStyleInBlockExtendedNoUnderline(_colors) {
212
+ return (0, _lazyNodeView.convertToInlineCss)({
213
+ padding: "1px 0 2px"
214
+ });
215
+ }
216
+
217
+ /** Inline inserted content — active/focused state. */
218
+ function buildInsertStyleActive(colors) {
219
+ return (0, _lazyNodeView.convertToInlineCss)({
220
+ background: bgSubtlerPressed(colors.insertActiveColor),
221
+ textDecoration: 'underline',
222
+ textDecorationStyle: colors.insertUnderlineStyle,
223
+ textDecorationThickness: "var(--ds-space-025, 2px)",
224
+ textDecorationColor: textAccent(colors.insertActiveColor)
225
+ });
226
+ }
227
+
228
+ // --- Deleted inline content styles ---
229
+
230
+ function deletedInlineStyleBase(colors) {
231
+ return {
232
+ textDecorationColor: borderAccent(colors.deleteColor),
233
+ textDecoration: 'line-through',
234
+ position: 'relative',
235
+ opacity: 1
236
+ };
237
+ }
238
+ function deletedInlineStyleActiveBase(colors) {
239
+ return _objectSpread(_objectSpread({}, deletedInlineStyleBase(colors)), {}, {
240
+ textDecorationThickness: '2px',
241
+ backgroundColor: bgSubtlestPressed(colors.deleteActiveColor)
242
+ });
243
+ }
244
+
245
+ /** Strikethrough for removed inline / widget content (non-marker decorations). */
246
+ function buildDeletedInlineStyle(colors, isActive) {
247
+ return isActive ? (0, _lazyNodeView.convertToInlineCss)(deletedInlineStyleActiveBase(colors)) : (0, _lazyNodeView.convertToInlineCss)(deletedInlineStyleBase(colors));
248
+ }
249
+
250
+ /** Strikethrough line (unbounded span) for deleted content — default state. */
251
+ function buildDeletedContentStyleUnbounded(colors) {
252
+ return (0, _lazyNodeView.convertToInlineCss)({
253
+ position: 'absolute',
254
+ top: '50%',
255
+ width: '100%',
256
+ display: 'inline-block',
257
+ borderTop: "1px solid ".concat(borderAccent(colors.deleteColor)),
258
+ pointerEvents: 'none',
259
+ zIndex: 1
260
+ });
261
+ }
262
+
263
+ /** Strikethrough line (unbounded span) for deleted content — active state. */
264
+ function buildDeletedContentStyleUnboundedActive(colors) {
265
+ return (0, _lazyNodeView.convertToInlineCss)({
266
+ position: 'absolute',
267
+ top: '50%',
268
+ width: '100%',
269
+ display: 'inline-block',
270
+ borderTop: "2px solid ".concat(borderAccent(colors.deleteColor)),
271
+ pointerEvents: 'none',
272
+ zIndex: 1
273
+ });
274
+ }
275
+
276
+ // --- Deleted block node styles — quote node ---
277
+
278
+ /** Unbounded strikethrough overlay for deleted inline content (absolute positioned line). */
279
+ function buildDeletedInlineStyleUnbounded(colors) {
280
+ return (0, _lazyNodeView.convertToInlineCss)({
281
+ position: 'absolute',
282
+ top: '50%',
283
+ width: '100%',
284
+ display: 'inline-block',
285
+ borderTop: "1px solid ".concat(textAccent(colors.deleteColor)),
286
+ pointerEvents: 'none',
287
+ zIndex: 1
288
+ });
289
+ }
290
+
291
+ /** Deleted lozenge-style quote node with box-shadow ring. */
292
+ function buildDeletedStyleQuoteNodeWithLozenge(colors) {
293
+ return (0, _lazyNodeView.convertToInlineCss)({
294
+ marginTop: "var(--ds-space-150, 12px)",
295
+ paddingTop: "var(--ds-space-025, 2px)",
296
+ paddingBottom: "var(--ds-space-025, 2px)",
297
+ paddingLeft: "var(--ds-space-025, 2px)",
298
+ boxShadow: "0 0 0 1px ".concat(borderAccent(colors.deleteColor)),
299
+ borderRadius: "var(--ds-radius-small, 4px)"
300
+ });
301
+ }
302
+
303
+ /** Active state of the deleted lozenge-style quote node — stronger ring. */
304
+ function buildDeletedStyleQuoteNodeWithLozengeActive(colors) {
305
+ return (0, _lazyNodeView.convertToInlineCss)({
306
+ marginTop: "var(--ds-space-150, 12px)",
307
+ paddingTop: "var(--ds-space-025, 2px)",
308
+ paddingBottom: "var(--ds-space-025, 2px)",
309
+ paddingLeft: "var(--ds-space-025, 2px)",
310
+ boxShadow: "0 0 0 4px ".concat(borderAccent(colors.deleteActiveColor)),
311
+ borderRadius: "var(--ds-radius-small, 4px)"
312
+ });
313
+ }
314
+
315
+ /** Deleted quote node — a 2px left border, or a 1px ring with padding, per `deletedQuoteNodeShape`. */
316
+ function buildDeletedStyleQuoteNode(colors) {
317
+ if (colors.deletedQuoteNodeShape === 'borderLeft') {
318
+ return (0, _lazyNodeView.convertToInlineCss)({
319
+ borderLeft: "2px solid ".concat(borderAccent(colors.deleteColor))
320
+ });
321
+ }
322
+ return (0, _lazyNodeView.convertToInlineCss)({
323
+ marginTop: "var(--ds-space-150, 12px)",
324
+ paddingTop: "var(--ds-space-025, 2px)",
325
+ paddingBottom: "var(--ds-space-025, 2px)",
326
+ paddingLeft: "var(--ds-space-025, 2px)",
327
+ boxShadow: "0 0 0 1px ".concat(borderAccent(colors.deleteColor)),
328
+ borderRadius: "var(--ds-radius-small, 4px)"
329
+ });
330
+ }
331
+
332
+ /** Quote node outline for deleted content — active state. */
333
+ function buildDeletedStyleQuoteNodeActive(colors) {
334
+ return (0, _lazyNodeView.convertToInlineCss)({
335
+ marginTop: "var(--ds-space-150, 12px)",
336
+ paddingTop: "var(--ds-space-025, 2px)",
337
+ paddingBottom: "var(--ds-space-025, 2px)",
338
+ paddingLeft: "var(--ds-space-025, 2px)",
339
+ boxShadow: "0 0 0 4px ".concat(bgSubtlerPressed(colors.deleteActiveColor)),
340
+ borderRadius: "var(--ds-radius-small, 4px)"
341
+ });
342
+ }
343
+
344
+ // --- Deleted block node styles — generic block outline ---
345
+
346
+ /** Generic block node outline for deleted content — default state (small radius). */
347
+ function buildDeletedBlockOutline(colors) {
348
+ return (0, _lazyNodeView.convertToInlineCss)({
349
+ boxShadow: "0 0 0 1px ".concat(borderAccent(colors.deleteColor)),
350
+ borderRadius: "var(--ds-radius-small, 4px)"
351
+ });
352
+ }
353
+
354
+ /** Generic block node outline for deleted content — active state (small radius). */
355
+ function buildDeletedBlockOutlineActive(colors) {
356
+ return (0, _lazyNodeView.convertToInlineCss)({
357
+ boxShadow: "0 0 0 4px ".concat(deletedBlockOutlineActiveRing(colors)),
358
+ borderRadius: "var(--ds-radius-small, 4px)"
359
+ });
360
+ }
361
+
362
+ /** Generic block node outline for deleted content — default state (rounded/xsmall+1px radius). */
363
+ function buildDeletedBlockOutlineRounded(colors) {
364
+ return (0, _lazyNodeView.convertToInlineCss)({
365
+ boxShadow: "0 0 0 1px ".concat(borderAccent(colors.deleteColor)),
366
+ borderRadius: "calc(".concat("var(--ds-radius-xsmall, 2px)", " + 1px)")
367
+ });
368
+ }
369
+
370
+ /** Generic block node outline for deleted content — active state (rounded/xsmall+1px radius). */
371
+ function buildDeletedBlockOutlineRoundedActive(colors) {
372
+ return (0, _lazyNodeView.convertToInlineCss)({
373
+ boxShadow: "0 0 0 4px ".concat(deletedBlockOutlineActiveRing(colors)),
374
+ borderRadius: "calc(".concat("var(--ds-radius-xsmall, 2px)", " + 1px)")
375
+ });
376
+ }
377
+
378
+ /** Scroll-navigation "new" emphasis: 4px ring — default state (small radius). */
379
+ function buildDeletedBlockOutlineNew(colors) {
380
+ return (0, _lazyNodeView.convertToInlineCss)({
381
+ boxShadow: "0 0 0 4px ".concat(bgSubtlest(colors.deleteColor)),
382
+ borderRadius: "var(--ds-radius-small, 4px)"
383
+ });
384
+ }
385
+
386
+ /** Scroll-navigation "new" emphasis: 4px ring — default state (rounded radius). */
387
+ function buildDeletedBlockOutlineRoundedNew(colors) {
388
+ return (0, _lazyNodeView.convertToInlineCss)({
389
+ boxShadow: "0 0 0 4px ".concat(bgSubtlest(colors.deleteColor)),
390
+ borderRadius: "calc(".concat("var(--ds-radius-xsmall, 2px)", " + 1px)")
391
+ });
392
+ }
393
+
394
+ // --- Deleted table row style ---
395
+
396
+ /** Table row style for deleted rows. See `deletedRowTreatment`. */
397
+ function buildDeletedRowStyle(colors) {
398
+ var base = {
399
+ textDecoration: 'line-through',
400
+ opacity: 0.6,
401
+ display: 'table-row'
402
+ };
403
+ return colors.deletedRowTreatment === 'textTint' ? (0, _lazyNodeView.convertToInlineCss)(_objectSpread(_objectSpread({}, base), {}, {
404
+ color: textAccent(colors.deleteColor)
405
+ })) : (0, _lazyNodeView.convertToInlineCss)(_objectSpread(_objectSpread({}, base), {}, {
406
+ textDecorationColor: borderAccent(colors.deleteColor)
407
+ }));
408
+ }
409
+
410
+ // --- Inserted block node styles — quote, rule, generic node, card ---
411
+
412
+ /** Quote node (blockquote) left-border style for inserted content — default state. */
413
+ function buildInsertStyleQuoteNode(colors) {
414
+ return (0, _lazyNodeView.convertToInlineCss)({
415
+ borderLeft: "2px solid ".concat(borderAccent(colors.insertColor))
416
+ });
417
+ }
418
+
419
+ /** Quote node left-border style for inserted content — "new" scroll-nav state. */
420
+ function buildInsertStyleQuoteNodeNew(colors) {
421
+ return (0, _lazyNodeView.convertToInlineCss)({
422
+ borderLeft: "4px solid ".concat(bgSubtlest(colors.insertColor))
423
+ });
424
+ }
425
+
426
+ /** Quote node left-border style for inserted content — active state. */
427
+ function buildInsertStyleQuoteNodeActive(colors) {
428
+ return (0, _lazyNodeView.convertToInlineCss)({
429
+ borderLeft: "4px solid ".concat(bgSubtlerPressed(colors.insertActiveColor))
430
+ });
431
+ }
432
+
433
+ /** Horizontal rule style for inserted content — default state. */
434
+ function buildInsertStyleRuleNode(colors) {
435
+ return (0, _lazyNodeView.convertToInlineCss)({
436
+ backgroundColor: borderAccent(colors.insertColor)
437
+ });
438
+ }
439
+
440
+ /** Horizontal rule style for inserted content — "new" scroll-nav state. */
441
+ function buildInsertStyleRuleNodeNew(colors) {
442
+ return (0, _lazyNodeView.convertToInlineCss)({
443
+ backgroundColor: bgSubtlest(colors.insertColor),
444
+ border: 'none',
445
+ height: '4px',
446
+ borderRadius: "var(--ds-radius-small, 4px)"
447
+ });
448
+ }
449
+
450
+ /** Horizontal rule style for inserted content — active state. */
451
+ function buildInsertStyleRuleNodeActive(colors) {
452
+ return (0, _lazyNodeView.convertToInlineCss)({
453
+ backgroundColor: bgSubtlerPressed(colors.insertActiveColor),
454
+ border: 'none',
455
+ height: '4px',
456
+ borderRadius: "var(--ds-radius-small, 4px)"
457
+ });
458
+ }
459
+
460
+ /** Generic node outline for inserted content — default state (small radius). */
461
+ function buildInsertStyleNode(colors) {
462
+ return (0, _lazyNodeView.convertToInlineCss)({
463
+ boxShadow: "0 0 0 1px ".concat(borderAccent(colors.insertColor)),
464
+ borderRadius: "var(--ds-radius-small, 4px)"
465
+ });
466
+ }
467
+
468
+ /** Generic node outline for inserted content — "new" scroll-nav state (small radius). */
469
+ function buildInsertStyleNodeNew(colors) {
470
+ return (0, _lazyNodeView.convertToInlineCss)({
471
+ boxShadow: "0 0 0 4px ".concat(bgSubtlest(colors.insertColor)),
472
+ borderRadius: "var(--ds-radius-small, 4px)"
473
+ });
474
+ }
475
+
476
+ /** Generic node outline for inserted content — active state (small radius). */
477
+ function buildInsertStyleNodeActive(colors) {
478
+ return (0, _lazyNodeView.convertToInlineCss)({
479
+ boxShadow: "0 0 0 4px ".concat(bgSubtlerPressed(colors.insertActiveColor)),
480
+ borderRadius: "var(--ds-radius-small, 4px)"
481
+ });
482
+ }
483
+
484
+ /** Card block node outline for inserted content — default state (medium radius). */
485
+ function buildInsertStyleCardBlockNode(colors) {
486
+ return (0, _lazyNodeView.convertToInlineCss)({
487
+ boxShadow: "0 0 0 1px ".concat(borderAccent(colors.insertColor)),
488
+ borderRadius: "var(--ds-radius-medium, 6px)"
489
+ });
490
+ }
491
+
492
+ /** Card block node outline for inserted content — "new" scroll-nav state (medium radius). */
493
+ function buildInsertStyleCardBlockNodeNew(colors) {
494
+ return (0, _lazyNodeView.convertToInlineCss)({
495
+ boxShadow: "0 0 0 4px ".concat(bgSubtlest(colors.insertColor)),
496
+ borderRadius: "var(--ds-radius-medium, 6px)"
497
+ });
498
+ }
499
+
500
+ /** Card block node outline for inserted content — active state (medium radius). */
501
+ function buildInsertStyleCardBlockNodeActive(colors) {
502
+ return (0, _lazyNodeView.convertToInlineCss)({
503
+ boxShadow: "0 0 0 4px ".concat(bgSubtlerPressed(colors.insertActiveColor)),
504
+ borderRadius: "var(--ds-radius-medium, 6px)"
505
+ });
506
+ }
507
+
508
+ // --- CSS custom properties ---
509
+ // Applied inline on the decoration wrapper; cascade down to child/pseudo-element selectors in the
510
+ // global stylesheet.
511
+
512
+ /** CSS variables for an inserted node decoration marker — default state. */
513
+ function buildDecorationMarkerVariable(colors) {
514
+ return (0, _lazyNodeView.convertToInlineCss)({
515
+ '--diff-decoration-marker-color': borderAccent(colors.insertColor),
516
+ '--diff-decoration-marker-ring-width': '1px'
517
+ });
518
+ }
519
+
520
+ /** CSS variables for an inserted node decoration marker — "new" scroll-nav state. */
521
+ function buildDecorationMarkerVariableNew(colors) {
522
+ return (0, _lazyNodeView.convertToInlineCss)({
523
+ '--diff-decoration-marker-color': bgSubtlest(colors.insertColor),
524
+ '--diff-decoration-marker-ring-width': '4px'
525
+ });
526
+ }
527
+
528
+ /** CSS variables for an inserted node decoration marker — active state. */
529
+ function buildDecorationMarkerVariableActive(colors) {
530
+ return (0, _lazyNodeView.convertToInlineCss)({
531
+ '--diff-decoration-marker-color': bgSubtlerPressed(colors.insertActiveColor),
532
+ '--diff-decoration-marker-ring-width': '4px'
533
+ });
534
+ }
535
+
536
+ /** Deleted node decoration marker (extension / embedCard / listItem) — default state. */
537
+ function buildDeletedDecorationMarkerVariable(colors) {
538
+ return (0, _lazyNodeView.convertToInlineCss)(_objectSpread(_objectSpread({}, deletedInlineStyleBase(colors)), {}, {
539
+ '--diff-decoration-marker-color': borderAccent(colors.deleteColor),
540
+ '--diff-decoration-marker-ring-width': '1px'
541
+ }));
542
+ }
543
+
544
+ /** Opacity only, no position or strikethrough. Used by the standard scheme. */
545
+ function buildDeletedDecorationMarkerVariableSimple(colors) {
546
+ return (0, _lazyNodeView.convertToInlineCss)({
547
+ opacity: 0.8,
548
+ '--diff-decoration-marker-color': borderAccent(colors.deleteColor),
549
+ '--diff-decoration-marker-ring-width': '1px'
550
+ });
551
+ }
552
+
553
+ /** Extended deleted inline style — background highlight + border-bottom underline (standard scheme). */
554
+ function buildDeletedInlineContentStyleExtended(colors) {
555
+ return (0, _lazyNodeView.convertToInlineCss)({
556
+ backgroundColor: bgSubtlest(colors.deleteColor),
557
+ borderBottom: "2px solid ".concat(borderAccent(colors.deleteColor)),
558
+ padding: "1px 0 2px"
559
+ });
560
+ }
561
+
562
+ /** Standard deleted inline style — colours the glyph itself, not just the strikethrough. */
563
+ function buildDeletedInlineStyleStandard(colors, state) {
564
+ if (state === 'active') {
565
+ return (0, _lazyNodeView.convertToInlineCss)({
566
+ color: "var(--ds-text, #292A2E)",
567
+ textDecoration: 'line-through',
568
+ textDecorationColor: textAccent(colors.deleteColor),
569
+ position: 'relative',
570
+ opacity: 1
571
+ });
572
+ }
573
+ return (0, _lazyNodeView.convertToInlineCss)({
574
+ color: textAccent(colors.deleteColor),
575
+ textDecoration: 'line-through',
576
+ position: 'relative',
577
+ opacity: state === 'new' ? 0.83 : 0.6
578
+ });
579
+ }
580
+
581
+ /** Deleted node decoration marker — "new" state. */
582
+ function buildDeletedDecorationMarkerVariableNew(colors) {
583
+ return (0, _lazyNodeView.convertToInlineCss)(_objectSpread(_objectSpread({}, deletedInlineStyleBase(colors)), {}, {
584
+ '--diff-decoration-marker-color': bgSubtlest(colors.deleteColor),
585
+ '--diff-decoration-marker-ring-width': '4px'
586
+ }));
587
+ }
588
+
589
+ /** Deleted node decoration marker — active state. */
590
+ function buildDeletedDecorationMarkerVariableActive(colors) {
591
+ return (0, _lazyNodeView.convertToInlineCss)(_objectSpread(_objectSpread({}, deletedInlineStyleActiveBase(colors)), {}, {
592
+ '--diff-decoration-marker-color': bgSubtlerPressed(colors.deleteActiveColor),
593
+ '--diff-decoration-marker-ring-width': '4px'
594
+ }));
595
+ }
596
+
597
+ // --- Table cell overlay styles ---
598
+
599
+ /** Cell overlay for added table cells — default state. Stacking order varies by scheme. */
600
+ function buildAddedCellOverlayStyle(colors) {
601
+ return (0, _lazyNodeView.convertToInlineCss)({
602
+ position: 'absolute',
603
+ top: 0,
604
+ left: 0,
605
+ width: '100%',
606
+ height: '100%',
607
+ backgroundColor: "rgba(from ".concat(bgSubtlest(colors.insertColor), " r g b / ").concat(colors.insertedCellOpacity, ")"),
608
+ zIndex: colors.addedCellOverlayZIndex,
609
+ outline: "1px solid ".concat(borderAccent(colors.insertColor)),
610
+ pointerEvents: 'none'
611
+ });
612
+ }
613
+
614
+ /** Added cell overlay — rounded variant. See `roundedAddedCellOverlayInheritsBorder`. */
615
+ function buildAddedCellOverlayRoundedStyle(colors) {
616
+ return (0, _lazyNodeView.convertToInlineCss)(_objectSpread(_objectSpread({
617
+ position: 'absolute',
618
+ top: 0,
619
+ left: 0,
620
+ width: '100%',
621
+ height: '100%',
622
+ backgroundColor: "rgba(from ".concat(bgSubtlest(colors.insertColor), " r g b / ").concat(colors.insertedCellOpacity, ")"),
623
+ zIndex: 2,
624
+ outline: "1px solid ".concat(borderAccent(colors.insertColor)),
625
+ pointerEvents: 'none'
626
+ }, colors.roundedAddedCellOverlayInheritsBorder ? {
627
+ border: 'inherit'
628
+ } : {}), {}, {
629
+ borderRadius: 'inherit'
630
+ }));
631
+ }
632
+
633
+ /** Cell overlay for added table cells — "new" scroll-nav state. */
634
+ function buildAddedCellOverlayStyleNew(colors) {
635
+ return (0, _lazyNodeView.convertToInlineCss)({
636
+ position: 'absolute',
637
+ top: 0,
638
+ left: 0,
639
+ width: '100%',
640
+ height: '100%',
641
+ backgroundColor: "rgba(from ".concat(bgSubtlest(colors.insertColor), " r g b / ").concat(colors.insertedCellOpacity, ")"),
642
+ zIndex: 1,
643
+ outline: "1px solid ".concat(bgSubtlerPressed(colors.insertActiveColor)),
644
+ pointerEvents: 'none'
645
+ });
646
+ }
647
+
648
+ /** Cell overlay for deleted table cells — default state (zIndex 1). Uses deletedCellColor. */
649
+ function buildDeletedCellOverlayStyle(colors) {
650
+ return (0, _lazyNodeView.convertToInlineCss)({
651
+ position: 'absolute',
652
+ top: 0,
653
+ left: 0,
654
+ width: '100%',
655
+ height: '100%',
656
+ backgroundColor: "rgba(from ".concat(bgSubtlest(colors.deletedCellColor), " r g b / 0.5)"),
657
+ zIndex: 1,
658
+ outline: "1px solid ".concat(deletedCellOutline(colors)),
659
+ pointerEvents: 'none'
660
+ });
661
+ }
662
+
663
+ /** Cell overlay for deleted table cells — rounded variant (zIndex 2, inherits border/radius). */
664
+ function buildDeletedCellOverlayRoundedStyle(colors) {
665
+ return (0, _lazyNodeView.convertToInlineCss)({
666
+ position: 'absolute',
667
+ top: 0,
668
+ left: 0,
669
+ width: '100%',
670
+ height: '100%',
671
+ backgroundColor: "rgba(from ".concat(bgSubtlest(colors.deletedCellColor), " r g b / 0.5)"),
672
+ zIndex: 2,
673
+ outline: "1px solid ".concat(deletedCellOutline(colors)),
674
+ pointerEvents: 'none',
675
+ border: 'inherit',
676
+ borderRadius: 'inherit'
677
+ });
678
+ }