@atlaskit/editor-plugin-show-diff 13.0.10 → 13.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/afm-cc/tsconfig.json +3 -0
- package/dist/cjs/pm-plugins/decorations/colorSchemes/factory.js +259 -23
- package/dist/cjs/pm-plugins/decorations/colorSchemes/schemes.js +21 -5
- package/dist/cjs/pm-plugins/decorations/createBlockChangedDecoration.js +87 -105
- package/dist/cjs/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.js +124 -0
- package/dist/cjs/pm-plugins/decorations/createChangedRowDecorationWidgets.js +15 -12
- package/dist/cjs/pm-plugins/decorations/createChangedRowDecorationWidgets.styles.legacy.js +37 -0
- package/dist/cjs/pm-plugins/decorations/createInlineChangedDecoration.js +109 -59
- package/dist/cjs/pm-plugins/decorations/createInlineChangedDecoration.styles.legacy.js +67 -0
- package/dist/cjs/pm-plugins/decorations/utils/wrapBlockNodeView.js +30 -168
- package/dist/cjs/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.js +205 -0
- package/dist/cjs/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.js +225 -0
- package/dist/es2019/pm-plugins/decorations/colorSchemes/factory.js +247 -23
- package/dist/es2019/pm-plugins/decorations/colorSchemes/schemes.js +20 -4
- package/dist/es2019/pm-plugins/decorations/createBlockChangedDecoration.js +85 -105
- package/dist/es2019/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.js +118 -0
- package/dist/es2019/pm-plugins/decorations/createChangedRowDecorationWidgets.js +15 -12
- package/dist/es2019/pm-plugins/decorations/createChangedRowDecorationWidgets.styles.legacy.js +33 -0
- package/dist/es2019/pm-plugins/decorations/createInlineChangedDecoration.js +82 -37
- package/dist/es2019/pm-plugins/decorations/createInlineChangedDecoration.styles.legacy.js +62 -0
- package/dist/es2019/pm-plugins/decorations/utils/wrapBlockNodeView.js +15 -140
- package/dist/es2019/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.js +143 -0
- package/dist/es2019/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.js +200 -0
- package/dist/esm/pm-plugins/decorations/colorSchemes/factory.js +248 -23
- package/dist/esm/pm-plugins/decorations/colorSchemes/schemes.js +20 -4
- package/dist/esm/pm-plugins/decorations/createBlockChangedDecoration.js +87 -105
- package/dist/esm/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.js +118 -0
- package/dist/esm/pm-plugins/decorations/createChangedRowDecorationWidgets.js +15 -12
- package/dist/esm/pm-plugins/decorations/createChangedRowDecorationWidgets.styles.legacy.js +32 -0
- package/dist/esm/pm-plugins/decorations/createInlineChangedDecoration.js +109 -59
- package/dist/esm/pm-plugins/decorations/createInlineChangedDecoration.styles.legacy.js +61 -0
- package/dist/esm/pm-plugins/decorations/utils/wrapBlockNodeView.js +15 -153
- package/dist/esm/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.js +198 -0
- package/dist/esm/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.js +218 -0
- package/dist/types/pm-plugins/decorations/colorSchemes/factory.d.ts +78 -6
- package/dist/types/pm-plugins/decorations/colorSchemes/schemes.d.ts +3 -0
- package/dist/types/pm-plugins/decorations/colorSchemes/types.d.ts +13 -3
- package/dist/types/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.d.ts +14 -0
- package/dist/types/pm-plugins/decorations/createChangedRowDecorationWidgets.styles.legacy.d.ts +22 -0
- package/dist/types/pm-plugins/decorations/createInlineChangedDecoration.styles.legacy.d.ts +26 -0
- package/dist/types/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.d.ts +39 -0
- package/dist/types/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.d.ts +40 -0
- package/package.json +3 -2
|
@@ -29,7 +29,6 @@ export declare function buildDeletedInlineStyleUnbounded(colors: DiffColorScheme
|
|
|
29
29
|
export declare function buildDeletedStyleQuoteNodeWithLozenge(colors: DiffColorScheme): string;
|
|
30
30
|
/** Active state of the deleted lozenge-style quote node — stronger ring. */
|
|
31
31
|
export declare function buildDeletedStyleQuoteNodeWithLozengeActive(colors: DiffColorScheme): string;
|
|
32
|
-
/** Deleted quote node — a 2px left border, or a 1px ring with padding, per `deletedQuoteNodeShape`. */
|
|
33
32
|
export declare function buildDeletedStyleQuoteNode(colors: DiffColorScheme): string;
|
|
34
33
|
/** Quote node outline for deleted content — active state. */
|
|
35
34
|
export declare function buildDeletedStyleQuoteNodeActive(colors: DiffColorScheme): string;
|
|
@@ -45,7 +44,7 @@ export declare function buildDeletedBlockOutlineRoundedActive(colors: DiffColorS
|
|
|
45
44
|
export declare function buildDeletedBlockOutlineNew(colors: DiffColorScheme): string;
|
|
46
45
|
/** Scroll-navigation "new" emphasis: 4px ring — default state (rounded radius). */
|
|
47
46
|
export declare function buildDeletedBlockOutlineRoundedNew(colors: DiffColorScheme): string;
|
|
48
|
-
/** Table row style for deleted rows.
|
|
47
|
+
/** Table row style for deleted rows. */
|
|
49
48
|
export declare function buildDeletedRowStyle(colors: DiffColorScheme): string;
|
|
50
49
|
/** Quote node (blockquote) left-border style for inserted content — default state. */
|
|
51
50
|
export declare function buildInsertStyleQuoteNode(colors: DiffColorScheme): string;
|
|
@@ -79,19 +78,22 @@ export declare function buildDecorationMarkerVariableNew(colors: DiffColorScheme
|
|
|
79
78
|
export declare function buildDecorationMarkerVariableActive(colors: DiffColorScheme): string;
|
|
80
79
|
/** Deleted node decoration marker (extension / embedCard / listItem) — default state. */
|
|
81
80
|
export declare function buildDeletedDecorationMarkerVariable(colors: DiffColorScheme): string;
|
|
82
|
-
/** Opacity only, no position or strikethrough. Used by
|
|
81
|
+
/** Opacity only, no position or strikethrough. Used by 'static' schemes. */
|
|
83
82
|
export declare function buildDeletedDecorationMarkerVariableSimple(colors: DiffColorScheme): string;
|
|
83
|
+
/**
|
|
84
|
+
* 'glyphTint' deleted inline style — tints the glyph itself via `color:`. Opacity ramps 0.6
|
|
85
|
+
* default, 0.83 "new", 1 active.
|
|
86
|
+
*/
|
|
84
87
|
/** Extended deleted inline style — background highlight + border-bottom underline (standard scheme). */
|
|
85
88
|
export declare function buildDeletedInlineContentStyleExtended(colors: DiffColorScheme): string;
|
|
86
|
-
/** Standard deleted inline style — colours the glyph itself, not just the strikethrough. */
|
|
87
89
|
export declare function buildDeletedInlineStyleStandard(colors: DiffColorScheme, state: 'default' | 'new' | 'active'): string;
|
|
88
90
|
/** Deleted node decoration marker — "new" state. */
|
|
89
91
|
export declare function buildDeletedDecorationMarkerVariableNew(colors: DiffColorScheme): string;
|
|
90
92
|
/** Deleted node decoration marker — active state. */
|
|
91
93
|
export declare function buildDeletedDecorationMarkerVariableActive(colors: DiffColorScheme): string;
|
|
92
|
-
/** Cell overlay for added table cells — default state
|
|
94
|
+
/** Cell overlay for added table cells — default state (zIndex 1). */
|
|
93
95
|
export declare function buildAddedCellOverlayStyle(colors: DiffColorScheme): string;
|
|
94
|
-
/**
|
|
96
|
+
/** Cell overlay for added table cells — rounded variant (zIndex 2, inherits border/radius). */
|
|
95
97
|
export declare function buildAddedCellOverlayRoundedStyle(colors: DiffColorScheme): string;
|
|
96
98
|
/** Cell overlay for added table cells — "new" scroll-nav state. */
|
|
97
99
|
export declare function buildAddedCellOverlayStyleNew(colors: DiffColorScheme): string;
|
|
@@ -99,3 +101,73 @@ export declare function buildAddedCellOverlayStyleNew(colors: DiffColorScheme):
|
|
|
99
101
|
export declare function buildDeletedCellOverlayStyle(colors: DiffColorScheme): string;
|
|
100
102
|
/** Cell overlay for deleted table cells — rounded variant (zIndex 2, inherits border/radius). */
|
|
101
103
|
export declare function buildDeletedCellOverlayRoundedStyle(colors: DiffColorScheme): string;
|
|
104
|
+
/**
|
|
105
|
+
* Inserted inline content under the extended diff experience. `insertedInlineTreatment` picks
|
|
106
|
+
* `text-decoration` vs a `border-bottom` rule; only the latter honours `hideAddedDiffsUnderline`.
|
|
107
|
+
*/
|
|
108
|
+
export declare function buildInsertedInlineStyle(colors: DiffColorScheme, isActive: boolean, hideAddedDiffsUnderline: boolean): string;
|
|
109
|
+
/** The three visual states deleted inline content can be in. */
|
|
110
|
+
export type DeletedInlineState = 'active' | 'default' | 'new';
|
|
111
|
+
/**
|
|
112
|
+
* Deleted inline content in a given state. 'strikethrough' renders 'default' and 'new'
|
|
113
|
+
* identically; the 'new' step exists only for the 'glyphTint' opacity ramp.
|
|
114
|
+
*/
|
|
115
|
+
export declare function buildDeletedInlineContentStyle(colors: DiffColorScheme, state: DeletedInlineState): string;
|
|
116
|
+
/**
|
|
117
|
+
* The positioned line across deleted content spanning an unbounded range. 'stateful' thickens
|
|
118
|
+
* 1px to 2px when active and tints with the border accent; 'static' uses the text accent always.
|
|
119
|
+
*/
|
|
120
|
+
export declare function buildDeletedStrikethroughLine(colors: DiffColorScheme, isActive: boolean): string;
|
|
121
|
+
/**
|
|
122
|
+
* The "REMOVED" lozenge on a deleted block node — resting state. Neutral gray in every scheme,
|
|
123
|
+
* so it takes no DiffColorScheme; only the active state is tinted.
|
|
124
|
+
*/
|
|
125
|
+
export declare function buildDeletedLozengeStyle(): string;
|
|
126
|
+
/** The "REMOVED" lozenge — active state, tinted with the scheme's deleteActiveColor. */
|
|
127
|
+
export declare function buildDeletedLozengeActiveStyle(colors: DiffColorScheme): string;
|
|
128
|
+
/** The decoration shape an inserted block node takes. Determined by node type, not by scheme. */
|
|
129
|
+
export type InsertedBlockNodeShape = 'cardBlock' | 'marker' | 'node' | 'quote' | 'rule';
|
|
130
|
+
/**
|
|
131
|
+
* Outline for an inserted block node. `insertedNodeEmphasis`: 'stateful' draws a 4px ring
|
|
132
|
+
* (`subtlest` at rest, `subtler.pressed` when focused), 'static' one 1px accent ring.
|
|
133
|
+
*/
|
|
134
|
+
export declare function buildInsertedBlockNodeStyle(colors: DiffColorScheme, shape: InsertedBlockNodeShape, isActive: boolean): string;
|
|
135
|
+
/**
|
|
136
|
+
* The category a deleted block node falls into — by node type, not by scheme.
|
|
137
|
+
*
|
|
138
|
+
* 'container' — media, panel: content is a child element, so the node is only dimmed.
|
|
139
|
+
* 'listItem' — listItem: reads the marker variables via editor-core's list styles.
|
|
140
|
+
* 'marker' — extension, embedCard: same, via extension and smart-card styles.
|
|
141
|
+
* 'quote' — blockquote.
|
|
142
|
+
* 'generic' — rule, blockCard, everything else.
|
|
143
|
+
*/
|
|
144
|
+
export type DeletedBlockNodeCategory = 'container' | 'generic' | 'listItem' | 'marker' | 'quote';
|
|
145
|
+
/**
|
|
146
|
+
* Outline for a deleted block node, driven by `deletedInlineTreatment` (strike vs tint) and
|
|
147
|
+
* `deletedNodeEmphasis` (whether the outline tracks scroll state and emits marker variables).
|
|
148
|
+
*/
|
|
149
|
+
export declare function buildDeletedBlockNodeStyle(colors: DiffColorScheme, category: DeletedBlockNodeCategory, isActive: boolean): string;
|
|
150
|
+
/**
|
|
151
|
+
* Deleted blockquote inside a lozenge wrapper (the nodeview path). Always a ring, since the
|
|
152
|
+
* lozenge needs an enclosed shape, so `deletedQuoteNodeShape` does not apply — only
|
|
153
|
+
* `deletedQuoteNodeActiveTone`, which picks the active ring's tone.
|
|
154
|
+
*/
|
|
155
|
+
export declare function buildDeletedQuoteNodeWithLozengeStyle(colors: DiffColorScheme, isActive: boolean): string;
|
|
156
|
+
/**
|
|
157
|
+
* Outline for a deleted block node via the nodeview wrapper (expand, decisionList, panel,
|
|
158
|
+
* codeBlock). Every scheme shares the active state; `deletedNodeEmphasis` changes only the
|
|
159
|
+
* resting one — 'stateful' a 4px subtlest ring, 'static' a 1px accent ring.
|
|
160
|
+
*/
|
|
161
|
+
export declare function buildDeletedWrappedBlockOutline(colors: DiffColorScheme, { isActive, isRounded }: {
|
|
162
|
+
isActive: boolean;
|
|
163
|
+
isRounded: boolean;
|
|
164
|
+
}): string;
|
|
165
|
+
/**
|
|
166
|
+
* Accent colour for atomic inline changed nodes (date, emoji, mention, status). Set inline on the
|
|
167
|
+
* decoration span and read by the `.show-diff-atomic-inline-changed-*` selectors in
|
|
168
|
+
* EditorContentContainer, on the decorated element or a descendant, so it must inherit. Being
|
|
169
|
+
* inline it beats the stylesheet's fallback, making the plugin the only source of the colour.
|
|
170
|
+
*/
|
|
171
|
+
export declare function buildAtomicInlineChangedCSSVariables(colors: DiffColorScheme): string;
|
|
172
|
+
/** Deleted node wrapper variables, all three states. Read by the smartCardStyles selectors. */
|
|
173
|
+
export declare function buildDeletedNodeCSSVariables(colors: DiffColorScheme): string;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import type { ColorScheme } from '../../../showDiffPluginType';
|
|
1
2
|
import type { DiffColorScheme } from './types';
|
|
2
3
|
/** Green insertions, red deletions. */
|
|
3
4
|
export declare const traditionalScheme: DiffColorScheme;
|
|
4
5
|
/** Purple insertions, gray deletions (red on active). */
|
|
5
6
|
export declare const standardScheme: DiffColorScheme;
|
|
7
|
+
/** Maps the public ColorScheme string to its data object. Adding a scheme = one entry here. */
|
|
8
|
+
export declare const colorSchemeRegistry: Record<ColorScheme, DiffColorScheme>;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
export type AdsAccentColor = 'green' | 'teal' | 'blue' | 'purple' | 'red' | 'orange' | 'yellow' | 'magenta' | 'gray';
|
|
6
6
|
/**
|
|
7
7
|
* A show-diff colour scheme. Colour fields are accent names that `factory.ts` expands into token
|
|
8
|
-
* paths; the rest encode structural differences
|
|
9
|
-
*
|
|
8
|
+
* paths; the rest encode structural differences no colour can express. Ring widths, padding,
|
|
9
|
+
* radius and pointer-events are fixed in the factory, not per scheme.
|
|
10
10
|
*/
|
|
11
11
|
export type DiffColorScheme = {
|
|
12
12
|
/** Stacking order of the square added-cell overlay. The rounded variant is always 2. */
|
|
@@ -21,9 +21,15 @@ export type DiffColorScheme = {
|
|
|
21
21
|
deletedCellBorderProminence: 'subtle' | 'accent';
|
|
22
22
|
/** Deleted cell overlays. Gray in both current schemes. */
|
|
23
23
|
deletedCellColor: AdsAccentColor;
|
|
24
|
+
/** Deleted inline content: tint the strikethrough, or tint and dim the glyph itself. */
|
|
25
|
+
deletedInlineTreatment: 'strikethrough' | 'glyphTint';
|
|
26
|
+
/** Deleted block ring: 4px stateful ring plus marker variables, or one resting treatment. */
|
|
27
|
+
deletedNodeEmphasis: 'stateful' | 'static';
|
|
28
|
+
/** Active deleted-blockquote ring tone, for the nodeview-wrapped case only. */
|
|
29
|
+
deletedQuoteNodeActiveTone: 'backgroundPressed' | 'borderAccent';
|
|
24
30
|
/** Deleted blockquote default state: 1px ring with padding, or a 2px left border. Active is always a ring. */
|
|
25
31
|
deletedQuoteNodeShape: 'ring' | 'borderLeft';
|
|
26
|
-
/** Deleted row de-emphasis:
|
|
32
|
+
/** Deleted row de-emphasis: tint the line-through, or tint the row text. Both read `deleteColor`. */
|
|
27
33
|
deletedRowTreatment: 'strikeColor' | 'textTint';
|
|
28
34
|
/** Inserted content, active/focused state. */
|
|
29
35
|
insertActiveColor: AdsAccentColor;
|
|
@@ -31,6 +37,10 @@ export type DiffColorScheme = {
|
|
|
31
37
|
insertColor: AdsAccentColor;
|
|
32
38
|
/** Opacity of the inserted cell overlay background. */
|
|
33
39
|
insertedCellOpacity: number;
|
|
40
|
+
/** Inserted content under the extended experience: underline, or a border-bottom rule with padding. */
|
|
41
|
+
insertedInlineTreatment: 'underline' | 'borderBottom';
|
|
42
|
+
/** Inserted block ring: 4px stateful ring, or one static 1px accent ring. */
|
|
43
|
+
insertedNodeEmphasis: 'stateful' | 'static';
|
|
34
44
|
/** `text-decoration-style` for the inserted-text underline. */
|
|
35
45
|
insertUnderlineStyle: 'solid' | 'dotted';
|
|
36
46
|
/** Whether the rounded added-cell overlay inherits the cell's `border`. Deleted always does. */
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ColorScheme, DiffType } from '../../showDiffPluginType';
|
|
2
|
+
/** Verbatim copy of the pre-refactor cell-overlay style selection. */
|
|
3
|
+
export declare const resolveCellOverlayStyleLegacy: ({ colorScheme, isRoundedTable, useAddedStyle, }: {
|
|
4
|
+
colorScheme?: ColorScheme;
|
|
5
|
+
isRoundedTable: boolean;
|
|
6
|
+
useAddedStyle: boolean;
|
|
7
|
+
}) => string;
|
|
8
|
+
export declare const getBlockNodeStyleLegacy: ({ nodeName, colorScheme, isInserted, isActive, diffType, }: {
|
|
9
|
+
colorScheme?: ColorScheme;
|
|
10
|
+
diffType?: DiffType;
|
|
11
|
+
isActive?: boolean;
|
|
12
|
+
isInserted?: boolean;
|
|
13
|
+
nodeName: string;
|
|
14
|
+
}) => string | undefined;
|
package/dist/types/pm-plugins/decorations/createChangedRowDecorationWidgets.styles.legacy.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pre-refactor code preserved for the OFF cohort of
|
|
3
|
+
* `platform_editor_show_diff_color_scheme_refactor`.
|
|
4
|
+
*
|
|
5
|
+
* These resolvers reproduce the per-scheme string-constant style decisions that
|
|
6
|
+
* `createChangedRowDOM` made before the `colorSchemeRegistry` + `factory.ts` migration, verbatim.
|
|
7
|
+
*
|
|
8
|
+
* Do not modify. Delete this file at experiment cleanup (EDITOR-8281).
|
|
9
|
+
*/
|
|
10
|
+
import type { ColorScheme } from '../../showDiffPluginType';
|
|
11
|
+
/**
|
|
12
|
+
* Pre-refactor deleted-row style for the `<tr>` element.
|
|
13
|
+
*/
|
|
14
|
+
export declare const resolveDeletedRowStyleLegacy: (colorScheme?: ColorScheme) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Pre-refactor cell overlay style.
|
|
17
|
+
*/
|
|
18
|
+
export declare const resolveCellOverlayStyleLegacy: ({ colorScheme, isInserted, isRoundedTable, }: {
|
|
19
|
+
colorScheme?: ColorScheme;
|
|
20
|
+
isInserted?: boolean;
|
|
21
|
+
isRoundedTable: boolean;
|
|
22
|
+
}) => string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pre-refactor `createInlineChangedDecoration` styling code, preserved verbatim for the OFF cohort
|
|
3
|
+
* of `platform_editor_show_diff_color_scheme_refactor`.
|
|
4
|
+
*
|
|
5
|
+
* Do not modify — this module exists purely so the OFF cohort keeps running the exact code that
|
|
6
|
+
* shipped before the `colorSchemeRegistry` + `factory.ts` migration. Delete the whole file at
|
|
7
|
+
* experiment cleanup (EDITOR-8281).
|
|
8
|
+
*/
|
|
9
|
+
import type { ColorScheme, DiffType } from '../../showDiffPluginType';
|
|
10
|
+
import type { InlineAttrChangeNodeName } from './utils/getAttrChangeRanges';
|
|
11
|
+
/**
|
|
12
|
+
* Pre-refactor inline `style` computation for `createInlineChangedDecoration`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const resolveInlineChangedStyleLegacy: ({ colorScheme, diffType, hideAddedDiffsUnderline, isActive, isInserted, }: {
|
|
15
|
+
colorScheme: ColorScheme | undefined;
|
|
16
|
+
diffType: DiffType | undefined;
|
|
17
|
+
hideAddedDiffsUnderline: boolean;
|
|
18
|
+
isActive: boolean;
|
|
19
|
+
isInserted: boolean;
|
|
20
|
+
}) => string;
|
|
21
|
+
/**
|
|
22
|
+
* Pre-refactor class names for an atomic inline node decoration (date, emoji, mention, status).
|
|
23
|
+
* The colour was carried by the per-scheme `-traditional` class rather than by an inline CSS
|
|
24
|
+
* variable on the same element.
|
|
25
|
+
*/
|
|
26
|
+
export declare const getAtomicInlineNodeClassNameLegacy: (inlineNodeName: InlineAttrChangeNodeName | undefined, colorScheme: ColorScheme | undefined) => string;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ColorScheme, DiffType } from '../../../showDiffPluginType';
|
|
2
|
+
/**
|
|
3
|
+
* Node-name classification shared by the style resolvers below and by the routing in
|
|
4
|
+
* `wrapBlockNodeView.ts`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const isMultiContainerBlockNode: (nodeName: string) => boolean;
|
|
7
|
+
export declare const isTextLikeBlockNode: (nodeName: string) => boolean;
|
|
8
|
+
/** Inline content style for a changed (inserted or deleted) block node. */
|
|
9
|
+
export declare const getChangedContentStyle: (colorScheme?: ColorScheme, isActive?: boolean, isInserted?: boolean, diffType?: DiffType, hideAddedDiffsUnderline?: boolean) => string;
|
|
10
|
+
/** Node-specific style for a changed block node, or `undefined` when the node type has none. */
|
|
11
|
+
export declare const getChangedNodeStyle: (nodeName: string, colorScheme?: ColorScheme, isInserted?: boolean, isActive?: boolean, diffType?: DiffType, hideAddedDiffsUnderline?: boolean) => string | undefined;
|
|
12
|
+
/** The positioned line drawn across deleted content spanning an unbounded range. */
|
|
13
|
+
export declare const getDeletedContentStyleUnbounded: (colorScheme?: ColorScheme, isActive?: boolean) => string;
|
|
14
|
+
/** Inline style for inserted content. */
|
|
15
|
+
export declare const getInsertedContentStyle: (colorScheme?: ColorScheme, isActive?: boolean, hideAddedDiffsUnderline?: boolean) => string;
|
|
16
|
+
/** Inline style for deleted content. */
|
|
17
|
+
export declare const getDeletedContentStyle: (colorScheme?: ColorScheme, isActive?: boolean, diffType?: DiffType) => string;
|
|
18
|
+
/**
|
|
19
|
+
* Overlay style for one added or deleted table cell. Invariant across the cells of a table, so the
|
|
20
|
+
* `querySelectorAll('td, th')` loop in `wrapBlockNodeView.ts` resolves it once.
|
|
21
|
+
*/
|
|
22
|
+
export declare const resolveCellOverlayStyle: (args: {
|
|
23
|
+
colorScheme?: ColorScheme;
|
|
24
|
+
isInserted: boolean;
|
|
25
|
+
isRoundedTable: boolean;
|
|
26
|
+
}) => string;
|
|
27
|
+
/** Inner style for the "Removed" lozenge on a deleted block node. */
|
|
28
|
+
export declare const resolveRemovedLozengeStyle: (colorScheme: ColorScheme | undefined, isActive: boolean) => string;
|
|
29
|
+
/**
|
|
30
|
+
* Style for inserted content nested inside a multi-container or list node — the `decisionList` and
|
|
31
|
+
* `taskList` `li`s and the `layoutSection` columns. Scheme-independent: see
|
|
32
|
+
* `nestedContentScheme` above.
|
|
33
|
+
*/
|
|
34
|
+
export declare const resolveNestedInsertedNodeStyle: () => string;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the colour scheme draws a resting (non-active) ring on a deleted media/embed node, which
|
|
37
|
+
* is what the `show-diff-deleted-outline-new` class styles in editor-core's smartCardStyles.
|
|
38
|
+
*/
|
|
39
|
+
export declare const hasRestingDeletedRing: (colorScheme?: ColorScheme) => boolean;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ColorScheme, DiffType } from '../../../showDiffPluginType';
|
|
2
|
+
/** Pre-refactor inline content style for a changed (inserted or deleted) block node. */
|
|
3
|
+
export declare const getChangedContentStyleLegacy: (colorScheme?: ColorScheme, isActive?: boolean, isInserted?: boolean, diffType?: DiffType, hideAddedDiffsUnderline?: boolean) => string;
|
|
4
|
+
/** Pre-refactor node-specific style for a changed block node. */
|
|
5
|
+
export declare const getChangedNodeStyleLegacy: (nodeName: string, colorScheme?: ColorScheme, isInserted?: boolean, isActive?: boolean, diffType?: DiffType, hideAddedDiffsUnderline?: boolean) => string | undefined;
|
|
6
|
+
/** Pre-refactor unbounded strikethrough line for deleted content. */
|
|
7
|
+
export declare const getDeletedContentStyleUnboundedLegacy: (colorScheme?: ColorScheme, isActive?: boolean) => string;
|
|
8
|
+
/** Pre-refactor inline style for inserted content. */
|
|
9
|
+
export declare const getInsertedContentStyleLegacy: (colorScheme?: ColorScheme, isActive?: boolean, hideAddedDiffsUnderline?: boolean) => string;
|
|
10
|
+
/** Pre-refactor inline style for deleted content. */
|
|
11
|
+
export declare const getDeletedContentStyleLegacy: (colorScheme?: ColorScheme, isActive?: boolean, diffType?: DiffType) => string;
|
|
12
|
+
/**
|
|
13
|
+
* Pre-refactor table-cell overlay style, as chosen inside the `querySelectorAll('td, th')` loop of
|
|
14
|
+
* `applyCellOverlayStyles`. The choice does not vary per cell, so hoisting it out of the loop is
|
|
15
|
+
* behaviour-preserving.
|
|
16
|
+
*
|
|
17
|
+
* NOTE: not interchangeable with the same-named resolver in
|
|
18
|
+
* `createChangedRowDecorationWidgets.styles.legacy.ts`. The two pre-refactor call sites disagreed
|
|
19
|
+
* for the traditional non-rounded added cell — the nodeview path (here) used
|
|
20
|
+
* `traditionalAddedCellOverlayStyleNew`, the row-widget path used `traditionalAddedCellOverlayStyle`.
|
|
21
|
+
* Preserved as-is.
|
|
22
|
+
*/
|
|
23
|
+
export declare const resolveCellOverlayStyleLegacy: ({ colorScheme, isInserted, isRoundedTable, }: {
|
|
24
|
+
colorScheme?: ColorScheme;
|
|
25
|
+
isInserted: boolean;
|
|
26
|
+
isRoundedTable: boolean;
|
|
27
|
+
}) => string;
|
|
28
|
+
/** Pre-refactor inner style for the "Removed" lozenge on a deleted block node. */
|
|
29
|
+
export declare const resolveRemovedLozengeStyleLegacy: (colorScheme: ColorScheme | undefined, isActive: boolean) => string;
|
|
30
|
+
/**
|
|
31
|
+
* Pre-refactor style for inserted content nested inside a multi-container or list node (the
|
|
32
|
+
* `decisionList` / `layoutSection` / `taskList` children). Always the standard scheme's node
|
|
33
|
+
* outline, in every colour scheme.
|
|
34
|
+
*/
|
|
35
|
+
export declare const resolveNestedInsertedNodeStyleLegacy: () => string;
|
|
36
|
+
/**
|
|
37
|
+
* Pre-refactor scheme predicate behind `maybeAddDeletedOutlineNewClass`. The `!isActive` half of
|
|
38
|
+
* the original condition stays at the call site in `wrapBlockNodeView.ts`.
|
|
39
|
+
*/
|
|
40
|
+
export declare const hasRestingDeletedRingLegacy: (colorScheme?: ColorScheme) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-show-diff",
|
|
3
|
-
"version": "13.0
|
|
3
|
+
"version": "13.1.0",
|
|
4
4
|
"description": "ShowDiff plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -26,8 +26,9 @@
|
|
|
26
26
|
"@atlaskit/editor-plugin-user-intent": "^13.0.0",
|
|
27
27
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
28
28
|
"@atlaskit/editor-tables": "^3.0.0",
|
|
29
|
+
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
29
30
|
"@atlaskit/platform-feature-flags": "^2.1.0",
|
|
30
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
31
|
+
"@atlaskit/tmp-editor-statsig": "^152.0.0",
|
|
31
32
|
"@atlaskit/tokens": "^16.7.0",
|
|
32
33
|
"@babel/runtime": "^7.0.0",
|
|
33
34
|
"@compiled/react": "^1.0.2",
|