@atlaskit/editor-plugin-show-diff 29.0.2 → 30.0.1

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 (58) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/cjs/pm-plugins/calculateDiff/calculateDiffDecorations.js +7 -30
  3. package/dist/cjs/pm-plugins/decorations/colorSchemes/factory.js +0 -39
  4. package/dist/cjs/pm-plugins/decorations/createInlineChangedDecoration.js +3 -16
  5. package/dist/cjs/pm-plugins/decorations/createNodeChangedDecorationWidget.js +3 -6
  6. package/dist/cjs/pm-plugins/decorations/createReplacedCellDecorations.js +0 -2
  7. package/dist/cjs/pm-plugins/decorations/utils/createDeletedLineBreakWidget.js +4 -7
  8. package/dist/cjs/pm-plugins/decorations/utils/wrapBlockNodeView.js +5 -24
  9. package/dist/cjs/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.js +2 -4
  10. package/dist/cjs/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.js +1 -5
  11. package/dist/cjs/pm-plugins/main.js +7 -26
  12. package/dist/cjs/showDiffPlugin.js +0 -43
  13. package/dist/cjs/showDiffPluginType.js +0 -12
  14. package/dist/es2019/pm-plugins/calculateDiff/calculateDiffDecorations.js +7 -30
  15. package/dist/es2019/pm-plugins/decorations/colorSchemes/factory.js +0 -37
  16. package/dist/es2019/pm-plugins/decorations/createInlineChangedDecoration.js +1 -17
  17. package/dist/es2019/pm-plugins/decorations/createNodeChangedDecorationWidget.js +3 -6
  18. package/dist/es2019/pm-plugins/decorations/createReplacedCellDecorations.js +0 -2
  19. package/dist/es2019/pm-plugins/decorations/utils/createDeletedLineBreakWidget.js +4 -7
  20. package/dist/es2019/pm-plugins/decorations/utils/wrapBlockNodeView.js +6 -24
  21. package/dist/es2019/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.js +3 -6
  22. package/dist/es2019/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.js +2 -8
  23. package/dist/es2019/pm-plugins/main.js +7 -27
  24. package/dist/es2019/showDiffPlugin.js +0 -38
  25. package/dist/es2019/showDiffPluginType.js +0 -12
  26. package/dist/esm/pm-plugins/calculateDiff/calculateDiffDecorations.js +7 -30
  27. package/dist/esm/pm-plugins/decorations/colorSchemes/factory.js +0 -37
  28. package/dist/esm/pm-plugins/decorations/createInlineChangedDecoration.js +3 -16
  29. package/dist/esm/pm-plugins/decorations/createNodeChangedDecorationWidget.js +3 -6
  30. package/dist/esm/pm-plugins/decorations/createReplacedCellDecorations.js +0 -2
  31. package/dist/esm/pm-plugins/decorations/utils/createDeletedLineBreakWidget.js +4 -7
  32. package/dist/esm/pm-plugins/decorations/utils/wrapBlockNodeView.js +5 -24
  33. package/dist/esm/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.js +2 -4
  34. package/dist/esm/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.js +1 -5
  35. package/dist/esm/pm-plugins/main.js +7 -26
  36. package/dist/esm/showDiffPlugin.js +0 -43
  37. package/dist/esm/showDiffPluginType.js +0 -12
  38. package/dist/types/entry-points/show-diff-plugin-type.d.ts +1 -1
  39. package/dist/types/pm-plugins/calculateDiff/calculateDiffDecorations.d.ts +1 -2
  40. package/dist/types/pm-plugins/decorations/colorSchemes/factory.d.ts +0 -24
  41. package/dist/types/pm-plugins/decorations/createInlineChangedDecoration.d.ts +1 -3
  42. package/dist/types/pm-plugins/decorations/createNodeChangedDecorationWidget.d.ts +1 -3
  43. package/dist/types/pm-plugins/decorations/createReplacedCellDecorations.d.ts +1 -3
  44. package/dist/types/pm-plugins/decorations/utils/createDeletedLineBreakWidget.d.ts +3 -6
  45. package/dist/types/pm-plugins/decorations/utils/wrapBlockNodeView.d.ts +2 -4
  46. package/dist/types/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.d.ts +1 -1
  47. package/dist/types/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.d.ts +1 -1
  48. package/dist/types/pm-plugins/main.d.ts +1 -6
  49. package/dist/types/showDiffPluginType.d.ts +0 -27
  50. package/package.json +8 -14
  51. package/dist/cjs/pm-plugins/decorations/revealStyles.js +0 -160
  52. package/dist/cjs/pm-plugins/revealAnimation.js +0 -524
  53. package/dist/es2019/pm-plugins/decorations/revealStyles.js +0 -143
  54. package/dist/es2019/pm-plugins/revealAnimation.js +0 -495
  55. package/dist/esm/pm-plugins/decorations/revealStyles.js +0 -153
  56. package/dist/esm/pm-plugins/revealAnimation.js +0 -518
  57. package/dist/types/pm-plugins/decorations/revealStyles.d.ts +0 -49
  58. package/dist/types/pm-plugins/revealAnimation.d.ts +0 -33
@@ -136,30 +136,6 @@ export declare function buildDeletedCellOverlayRoundedStyle(colors: DiffColorSch
136
136
  * `text-decoration` vs a `border-bottom` rule; only the latter honours `hideAddedDiffsUnderline`.
137
137
  */
138
138
  export declare function buildInsertedInlineStyle(colors: DiffColorScheme, isActive: boolean, hideAddedDiffsUnderline: boolean): string;
139
- /**
140
- * The colours `buildInsertedInlineStyle()` above would paint, for the reveal to animate towards.
141
- *
142
- * MUST mirror that function: the reveal replaces the flat highlight with a sized gradient, so a
143
- * divergence here means the animation settles on a different colour than a static render produces.
144
- * `revealStyles.ts` in the test package asserts the two agree across the isActive /
145
- * hideAddedDiffsUnderline matrix.
146
- *
147
- * A transparent border is how "no underline" is expressed: the box still reserves the 2px so the
148
- * text does not shift when the underline arrives.
149
- */
150
- export declare function getInsertedInlineRevealColors(colors: DiffColorScheme, isActive: boolean, hideAddedDiffsUnderline: boolean): {
151
- background: string;
152
- border: string;
153
- };
154
- /**
155
- * The colours `buildDeletedInlineContentStyleExtended()` paints, for the reveal to animate towards.
156
- * Deleted content's highlight does not vary with the active state — only its text does, which the
157
- * reveal keeps as-is.
158
- */
159
- export declare function getDeletedInlineRevealColors(colors: DiffColorScheme): {
160
- background: string;
161
- border: string;
162
- };
163
139
  /**
164
140
  * Value for `DELETED_HIGHLIGHT_BG_VAR` while a change is hovered — the same tint an 'always' scheme
165
141
  * paints at rest, so hovering restores the appearance rather than introducing a third one.
@@ -1,6 +1,5 @@
1
1
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
2
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
3
- import type { RevealOptions } from '../../showDiffPluginType';
4
3
  import type { ColorScheme } from './colorSchemes/types';
5
4
  import { type ContributorTagMountContext } from './createContributorTagWidget';
6
5
  import type { InlineAttrChangeNodeName } from './utils/getAttrChangeRanges';
@@ -14,7 +13,7 @@ export declare const getAtomicInlineChangedAttrs: (inlineNodeName: InlineAttrCha
14
13
  * @param change Changeset "change" containing information about the change content + range
15
14
  * @returns Prosemirror inline decoration
16
15
  */
17
- export declare const createInlineChangedDecoration: ({ attributionKey, change, colorScheme, isActive, isInserted, leftAnchorId, isAtomicInlineNode, shouldHideDeleted, showContributorTags, showIndicators, doc, hideAddedDiffsUnderline, inlineNodeName, hasDeletedWidget, isDeletedWidgetBelow, reveal, tagMountContext, }: {
16
+ export declare const createInlineChangedDecoration: ({ attributionKey, change, colorScheme, isActive, isInserted, leftAnchorId, isAtomicInlineNode, shouldHideDeleted, showContributorTags, showIndicators, doc, hideAddedDiffsUnderline, inlineNodeName, hasDeletedWidget, isDeletedWidgetBelow, tagMountContext, }: {
18
17
  attributionKey?: string;
19
18
  change: {
20
19
  fromB: number;
@@ -30,7 +29,6 @@ export declare const createInlineChangedDecoration: ({ attributionKey, change, c
30
29
  isDeletedWidgetBelow?: boolean;
31
30
  isInserted?: boolean;
32
31
  leftAnchorId?: string;
33
- reveal?: RevealOptions;
34
32
  shouldHideDeleted?: boolean;
35
33
  showContributorTags?: boolean;
36
34
  showIndicators?: boolean;
@@ -2,7 +2,6 @@ import type { Change } from 'prosemirror-changeset';
2
2
  import type { IntlShape } from 'react-intl';
3
3
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
4
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
5
- import type { RevealOptions } from '../../showDiffPluginType';
6
5
  import type { NodeViewSerializer } from '../NodeViewSerializer';
7
6
  import type { ColorScheme } from './colorSchemes/types';
8
7
  import { type ContributorTagMountContext } from './createContributorTagWidget';
@@ -10,7 +9,7 @@ import { type ContributorTagMountContext } from './createContributorTagWidget';
10
9
  * This function is used to create a decoration widget to show content
11
10
  * that is not in the current document.
12
11
  */
13
- export declare const createNodeChangedDecorationWidget: ({ attributionKey, change, doc, nodeViewSerializer, colorScheme, newDoc, intl, activeIndexPos, isInserted, leftAnchorId, showContributorTags, showIndicators, placeBelow, hideAddedDiffsUnderline, reveal, tagMountContext, deletedColumns, }: {
12
+ export declare const createNodeChangedDecorationWidget: ({ attributionKey, change, doc, nodeViewSerializer, colorScheme, newDoc, intl, activeIndexPos, isInserted, leftAnchorId, showContributorTags, showIndicators, placeBelow, hideAddedDiffsUnderline, tagMountContext, deletedColumns, }: {
14
13
  activeIndexPos?: {
15
14
  attributionKey?: string;
16
15
  from: number;
@@ -28,7 +27,6 @@ export declare const createNodeChangedDecorationWidget: ({ attributionKey, chang
28
27
  newDoc: PMNode;
29
28
  nodeViewSerializer: NodeViewSerializer;
30
29
  placeBelow?: boolean;
31
- reveal?: RevealOptions;
32
30
  showContributorTags?: boolean;
33
31
  showIndicators?: boolean;
34
32
  tagMountContext?: ContributorTagMountContext;
@@ -2,7 +2,6 @@ import type { Change } from 'prosemirror-changeset';
2
2
  import type { IntlShape } from 'react-intl';
3
3
  import type { Node as PMNode, Slice } from '@atlaskit/editor-prosemirror/model';
4
4
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
5
- import type { RevealOptions } from '../../showDiffPluginType';
6
5
  import type { NodeViewSerializer } from '../NodeViewSerializer';
7
6
  import type { ColorScheme } from './colorSchemes/types';
8
7
  import type { ContributorTagMountContext } from './createContributorTagWidget';
@@ -48,7 +47,7 @@ export declare const createReplacedCellWidgets: ({ slice, newDoc, change, nodeVi
48
47
  * hidden in the clean view, only when that changed. A cell whose content stayed the same keeps
49
48
  * showing it.
50
49
  */
51
- export declare const createReplacedCellDecorations: ({ replacedCells, change, doc, attributionKey, colorScheme, hasDeletedWidget, hideAddedDiffsUnderline, isActive, isDeletedWidgetBelow, isInserted, leftAnchorId, reveal, shouldHideDeleted, showContributorTags, showIndicators, tagMountContext, }: {
50
+ export declare const createReplacedCellDecorations: ({ replacedCells, change, doc, attributionKey, colorScheme, hasDeletedWidget, hideAddedDiffsUnderline, isActive, isDeletedWidgetBelow, isInserted, leftAnchorId, shouldHideDeleted, showContributorTags, showIndicators, tagMountContext, }: {
52
51
  attributionKey?: string;
53
52
  change: Pick<Change, 'fromA' | 'toA' | 'fromB' | 'toB'>;
54
53
  colorScheme?: ColorScheme;
@@ -60,7 +59,6 @@ export declare const createReplacedCellDecorations: ({ replacedCells, change, do
60
59
  isInserted: boolean;
61
60
  leftAnchorId?: string;
62
61
  replacedCells: ReplacedCell[];
63
- reveal?: RevealOptions;
64
62
  shouldHideDeleted?: boolean;
65
63
  showContributorTags?: boolean;
66
64
  showIndicators?: boolean;
@@ -1,5 +1,4 @@
1
1
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
2
- import type { RevealOptions } from '../../../showDiffPluginType';
3
2
  import type { ColorScheme } from '../colorSchemes/types';
4
3
  import { type ContributorTagMountContext } from '../createContributorTagWidget';
5
4
  /**
@@ -17,17 +16,16 @@ export declare const RETURN_GLYPH = "\u2936";
17
16
  * in for the absent content keeps the deletion visible without inventing content that was not there.
18
17
  *
19
18
  * `createContentWrapper` supplies the highlight and the strikethrough line, so the glyph is styled
20
- * exactly like any other run of deleted inline content, including the active and reveal states.
19
+ * exactly like any other run of deleted inline content, including the active state.
21
20
  *
22
21
  * Hidden from assistive technology: the glyph is a picture of a key, and read out it is announced as
23
22
  * its Unicode name rather than as a removed line.
24
23
  */
25
- export declare const createDeletedLineBreakWidget: ({ colorScheme, count, isActive, reveal, }: {
24
+ export declare const createDeletedLineBreakWidget: ({ colorScheme, count, isActive, }: {
26
25
  colorScheme?: ColorScheme;
27
26
  /** One glyph per removed blank line, for a run of adjacent ones. */
28
27
  count?: number;
29
28
  isActive?: boolean;
30
- reveal?: RevealOptions;
31
29
  }) => HTMLElement;
32
30
  /**
33
31
  * The glyph as a widget decoration anchored at `pos`.
@@ -38,14 +36,13 @@ export declare const createDeletedLineBreakWidget: ({ colorScheme, count, isActi
38
36
  * the displayed document and the change lands on the *inserted* side, so the glyph is anchored
39
37
  * inside the surviving block, on the blank line itself.
40
38
  */
41
- export declare const createDeletedLineBreakDecoration: ({ attributionKey, colorScheme, count, diffId, isActive, pos, reveal, side, tagMountContext, }: {
39
+ export declare const createDeletedLineBreakDecoration: ({ attributionKey, colorScheme, count, diffId, isActive, pos, side, tagMountContext, }: {
42
40
  attributionKey?: string;
43
41
  colorScheme?: ColorScheme;
44
42
  count?: number;
45
43
  diffId?: string;
46
44
  isActive?: boolean;
47
45
  pos: number;
48
- reveal?: RevealOptions;
49
46
  side?: number;
50
47
  tagMountContext?: ContributorTagMountContext;
51
48
  }) => Decoration;
@@ -1,6 +1,5 @@
1
1
  import type { IntlShape } from 'react-intl';
2
2
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
- import type { RevealOptions } from '../../../showDiffPluginType';
4
3
  import type { ColorScheme } from '../colorSchemes/types';
5
4
  /**
6
5
  * Creates a "Removed" lozenge to be displayed at the top right corner of deleted block nodes
@@ -27,14 +26,13 @@ export declare const wrapBlockNodeView: ({ dom, nodeView, targetNode, colorSchem
27
26
  * CSS backgrounds don't work when applied to a wrapper around a paragraph, so
28
27
  * the wrapper needs to be injected inside the node around the child content.
29
28
  */
30
- export declare const injectInnerWrapper: ({ node, colorScheme, isActive, isInserted, reveal, }: {
29
+ export declare const injectInnerWrapper: ({ node, colorScheme, isActive, isInserted, }: {
31
30
  colorScheme?: ColorScheme;
32
31
  isActive?: boolean;
33
32
  isInserted?: boolean;
34
33
  node: HTMLElement;
35
- reveal?: RevealOptions;
36
34
  }) => HTMLElement;
37
35
  /**
38
36
  * Creates a styled span wrapper for inline content within a change decoration.
39
37
  */
40
- export declare const createContentWrapper: (colorScheme?: ColorScheme, isActive?: boolean, isInserted?: boolean, reveal?: RevealOptions) => HTMLElement;
38
+ export declare const createContentWrapper: (colorScheme?: ColorScheme, isActive?: boolean, isInserted?: boolean) => HTMLElement;
@@ -14,7 +14,7 @@ export declare const getDeletedContentStyleUnbounded: (colorScheme?: ColorScheme
14
14
  /** Inline style for inserted content. */
15
15
  export declare const getInsertedContentStyle: (colorScheme?: ColorScheme, isActive?: boolean, hideAddedDiffsUnderline?: boolean) => string;
16
16
  /** Inline style for deleted content. */
17
- export declare const getDeletedContentStyle: (colorScheme?: ColorScheme, isActive?: boolean, omitHighlight?: boolean) => string;
17
+ export declare const getDeletedContentStyle: (colorScheme?: ColorScheme, isActive?: boolean) => string;
18
18
  /**
19
19
  * Overlay style for one added or deleted table cell. Invariant across the cells of a table, so the
20
20
  * `querySelectorAll('td, th')` loop in `wrapBlockNodeView.ts` resolves it once.
@@ -8,7 +8,7 @@ export declare const getDeletedContentStyleUnboundedLegacy: (colorScheme?: Color
8
8
  /** Pre-refactor inline style for inserted content. */
9
9
  export declare const getInsertedContentStyleLegacy: (colorScheme?: ColorScheme, isActive?: boolean, hideAddedDiffsUnderline?: boolean) => string;
10
10
  /** Pre-refactor inline style for deleted content. */
11
- export declare const getDeletedContentStyleLegacy: (colorScheme?: ColorScheme, isActive?: boolean, omitHighlight?: boolean) => string;
11
+ export declare const getDeletedContentStyleLegacy: (colorScheme?: ColorScheme, isActive?: boolean) => string;
12
12
  /**
13
13
  * Pre-refactor table-cell overlay style, as chosen inside the `querySelectorAll('td, th')` loop of
14
14
  * `applyCellOverlayStyles`. The choice does not vary per cell, so hoisting it out of the loop is
@@ -6,7 +6,7 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
6
6
  import { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform-override';
7
7
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
8
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
9
- import type { ColorScheme, ContributorTagModel, DeletedDiffPlacement, DiffDescriptor, DiffParams, DiffStepAttribution, DiffType, InlineDeletedDiffPlacement, RevealOptions, ShowDiffPlugin, SmartDiffThresholds } from '../showDiffPluginType';
9
+ import type { ColorScheme, ContributorTagModel, DeletedDiffPlacement, DiffDescriptor, DiffParams, DiffStepAttribution, DiffType, InlineDeletedDiffPlacement, ShowDiffPlugin, SmartDiffThresholds } from '../showDiffPluginType';
10
10
  import type { ResolvedDiffContributors } from './decorations/colorSchemes/attributions';
11
11
  export declare const showDiffPluginKey: PluginKey<ShowDiffPluginState>;
12
12
  export type ShowDiffPluginState = {
@@ -48,11 +48,6 @@ export type ShowDiffPluginState = {
48
48
  isDisplayingChanges: boolean;
49
49
  isInverted?: boolean;
50
50
  originalDoc: PMNode | undefined;
51
- /**
52
- * Reveal choreography for the CURRENT paint only. Set from SHOW_DIFF meta and deliberately not
53
- * inherited: a scroll-to-next or an unrelated repaint must not replay the animation.
54
- */
55
- reveal?: RevealOptions;
56
51
  /**
57
52
  * When true, the view update handler should scroll to the first decoration
58
53
  * and then reset this flag.
@@ -134,26 +134,6 @@ export type DiffDescriptor = {
134
134
  leftAnchorId?: string;
135
135
  type: 'inline' | 'block' | 'widget';
136
136
  };
137
- /**
138
- * How the diff is revealed when it is painted.
139
- *
140
- * - `phased` — the two-phase choreography used when opening the diff from a clean "new state":
141
- * the outgoing state cross-fades to the incoming one while the agent highlight wipes out to the
142
- * right, then every highlight wipes back in from the left.
143
- *
144
- * Deliberately separate from {@link DiffType}: that describes how changes are computed and grouped,
145
- * this describes how the result is presented over time. Folding one into the other would make every
146
- * `DiffType` consumer — version history, track-changes, publish diff — care about presentation.
147
- */
148
- export type RevealMode = 'phased';
149
- export type RevealOptions = {
150
- /**
151
- * Total length of the choreography. Defaults to `REVEAL_DEFAULT_DURATION_MS`. Exposed because
152
- * this is a design-tunable value; it should not be buried in a stylesheet.
153
- */
154
- durationMs?: number;
155
- mode: RevealMode;
156
- };
157
137
  export type DiffParams = {
158
138
  /**
159
139
  * Color scheme to use for displaying diffs.
@@ -198,13 +178,6 @@ export type PMDiffParams = {
198
178
  inlineDeletedDiffPlacement?: InlineDeletedDiffPlacement;
199
179
  isInverted?: boolean;
200
180
  originalDoc: Node;
201
- /**
202
- * How this diff is revealed when painted. Omitted means paint immediately.
203
- *
204
- * Applies to THIS paint only — it is not inherited by later recalculations, so stepping
205
- * through changes or a repaint cannot replay the choreography.
206
- */
207
- reveal?: RevealOptions;
208
181
  /**
209
182
  * When true, the editor will scroll to bring the first diff decoration into view
210
183
  * after the diff is shown.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-show-diff",
3
- "version": "29.0.2",
3
+ "version": "30.0.1",
4
4
  "description": "ShowDiff plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,13 +34,13 @@
34
34
  "@atlaskit/editor-plugin-limited-mode": "^27.0.0",
35
35
  "@atlaskit/editor-plugin-user-intent": "^28.0.0",
36
36
  "@atlaskit/editor-prosemirror": "^9.0.0",
37
- "@atlaskit/editor-shared-styles": "^4.6.0",
37
+ "@atlaskit/editor-shared-styles": "^5.0.0",
38
38
  "@atlaskit/editor-tables": "^3.2.0",
39
39
  "@atlaskit/platform-feature-experiments": "^0.3.0",
40
40
  "@atlaskit/platform-feature-flags": "^2.2.0",
41
41
  "@atlaskit/primitives": "^22.6.0",
42
- "@atlaskit/tmp-editor-statsig": "^249.0.0",
43
- "@atlaskit/tokens": "^20.8.0",
42
+ "@atlaskit/tmp-editor-statsig": "^250.0.0",
43
+ "@atlaskit/tokens": "^20.9.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@compiled/react": "^1.0.2",
46
46
  "bind-event-listener": "^3.0.0",
@@ -50,12 +50,12 @@
50
50
  },
51
51
  "devDependencies": {
52
52
  "@atlaskit/adf-utils": "^20.9.0",
53
- "@atlaskit/button": "^25.6.0",
53
+ "@atlaskit/button": "^25.7.0",
54
54
  "@atlaskit/css": "^1.1.0",
55
55
  "@atlaskit/dropdown-menu": "^21.0.0",
56
56
  "@atlaskit/editor-core": "^242.0.0",
57
57
  "@atlaskit/editor-json-transformer": "^10.0.0",
58
- "@atlaskit/editor-plugins": "^16.2.0",
58
+ "@atlaskit/editor-plugins": "^17.0.0",
59
59
  "@atlaskit/form": "^18.3.0",
60
60
  "@atlaskit/section-message": "^10.2.0",
61
61
  "@atlaskit/textarea": "^10.3.0",
@@ -64,14 +64,14 @@
64
64
  "@atlassian/confluence-presets": "workspace:^",
65
65
  "@atlassian/content-reconciliation": "^0.1.3506",
66
66
  "@atlassian/editor-ai-injected-editors": "^46.0.0",
67
- "@atlassian/editor-plugin-ai": "^84.0.0",
67
+ "@atlassian/editor-plugin-ai": "^84.1.0",
68
68
  "@atlassian/structured-docs-types": "workspace:^",
69
69
  "react": "^19.2.0",
70
70
  "react-dom": "^19.2.0",
71
71
  "react-intl": "^7.0.0"
72
72
  },
73
73
  "peerDependencies": {
74
- "@atlaskit/editor-common": "^134.2.0",
74
+ "@atlaskit/editor-common": "^134.4.0",
75
75
  "react": "^18.2.0 || ^19.2.0",
76
76
  "react-dom": "^18.2.0 || ^19.2.0",
77
77
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
@@ -81,12 +81,6 @@
81
81
  "type": "boolean",
82
82
  "referenceOnly": true
83
83
  },
84
- "platform_editor_diff_reveal_animation": {
85
- "type": "boolean"
86
- },
87
- "platform_editor_diff_hide_pure_deletions": {
88
- "type": "boolean"
89
- },
90
84
  "platform_editor_ai_show_diff_patch_1": {
91
85
  "type": "boolean"
92
86
  },
@@ -1,160 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.resolveRevealStyle = exports.buildWipeableBackground = exports.applyRevealToElement = exports.REVEAL_BORDER_VAR = exports.REVEAL_BG_VAR = exports.REVEAL_ATTR = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _agentBrandColorSchemes = require("@atlaskit/agent-color/agent-brand-color-schemes");
10
- var _cssHelper = require("@atlaskit/editor-common/css-helper");
11
- var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
12
- var _factory = require("./colorSchemes/factory");
13
- var _schemes = require("./colorSchemes/schemes");
14
- var _standard = require("./colorSchemes/standard");
15
- /**
16
- * Painting strategy for reveal highlights. Highlights are `linear-gradient`s with animated
17
- * `background-size` for the wipe effect. Colours live on elements as custom properties so the
18
- * attribution palette works per-contributor.
19
- */
20
-
21
- /** Marks an element as taking part in the reveal, and says which side it represents. */
22
- var REVEAL_ATTR = exports.REVEAL_ATTR = 'data-show-diff-reveal';
23
- /** Wipe colour, read by the animation as the gradient's colour stop. */
24
- var REVEAL_BG_VAR = exports.REVEAL_BG_VAR = '--show-diff-reveal-bg';
25
-
26
- /** Underline colour, brought in on the same schedule as the highlight. */
27
- var REVEAL_BORDER_VAR = exports.REVEAL_BORDER_VAR = '--show-diff-reveal-border';
28
-
29
- /** Only schemes with background highlights can be revealed; 'traditional' uses underline only. */
30
- var schemeSupportsReveal = function schemeSupportsReveal(colorScheme) {
31
- return colorScheme !== 'traditional';
32
- };
33
-
34
- /** Convert a flat background colour into a wipeable gradient (zero width initially). */
35
- var buildWipeableBackground = exports.buildWipeableBackground = function buildWipeableBackground(color) {
36
- return (0, _cssHelper.convertToInlineCss)({
37
- backgroundColor: 'transparent',
38
- backgroundImage: "linear-gradient(".concat(color, ", ").concat(color, ")"),
39
- backgroundRepeat: 'no-repeat',
40
- backgroundSize: '0% 100%',
41
- backgroundPosition: '0 0',
42
- // Each line fragment of a wrapped highlight gets its own background box, so they wipe
43
- // together rather than the gradient stretching across the whole wrapped run.
44
- WebkitBoxDecorationBreak: 'clone',
45
- boxDecorationBreak: 'clone'
46
- });
47
- };
48
-
49
- /** Base padding and transparent underline placeholder (no layout shift on reveal). */
50
- var revealBaseStyle = (0, _cssHelper.convertToInlineCss)({
51
- padding: "1px 0 2px",
52
- borderBottom: "2px solid transparent"
53
- });
54
- var buildRevealVariables = function buildRevealVariables(_ref) {
55
- var background = _ref.background,
56
- border = _ref.border;
57
- return (0, _cssHelper.convertToInlineCss)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, REVEAL_BG_VAR, background), REVEAL_BORDER_VAR, border));
58
- };
59
-
60
- /** Configuration that affects both resting state and reveal endpoint. */
61
-
62
- /** Reveal colours from the refactored scheme registry (attribution palette ready). */
63
- var revealColorsRefactored = function revealColorsRefactored(colors, _ref2) {
64
- var hideAddedDiffsUnderline = _ref2.hideAddedDiffsUnderline,
65
- isActive = _ref2.isActive,
66
- isInserted = _ref2.isInserted;
67
- return isInserted ? (0, _factory.getInsertedInlineRevealColors)(colors, isActive, hideAddedDiffsUnderline) : (0, _factory.getDeletedInlineRevealColors)(colors);
68
- };
69
-
70
- /**
71
- * Legacy cohort reveal colours. Values MUST match `revealColorsRefactored()` output for
72
- * `standard` scheme (test: `revealStyles.ts` in test package).
73
- */
74
- var revealColorsLegacy = function revealColorsLegacy(_ref3) {
75
- var hideAddedDiffsUnderline = _ref3.hideAddedDiffsUnderline,
76
- isActive = _ref3.isActive,
77
- isInserted = _ref3.isInserted;
78
- return isInserted ? {
79
- // Mirrors `editingStyleExtended` / `editingStyleActiveExtended` and their
80
- // `*NoUnderline` variants in `colorSchemes/standard.ts`.
81
- background: isActive ? "var(--ds-background-accent-purple-subtler-pressed, #D8A0F7)" : "var(--ds-background-accent-purple-subtlest, #F8EEFE)",
82
- border: hideAddedDiffsUnderline ? 'transparent' : "var(--ds-border-accent-purple, #AF59E1)"
83
- } : {
84
- // Mirrors `deletedInlineContentStyleExtended` in `colorSchemes/standard.ts`.
85
- background: "var(--ds-background-accent-gray-subtlest, #F0F1F2)",
86
- border: "var(--ds-border-accent-gray, #7D818A)"
87
- };
88
- };
89
- var resolveRevealColors = function resolveRevealColors(colors, variant) {
90
- return (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_show_diff_color_scheme_refactor') ? revealColorsRefactored(colors, variant) : revealColorsLegacy(variant);
91
- };
92
- var getColorScheme = function getColorScheme(colorScheme) {
93
- return _schemes.colorSchemeRegistry[colorScheme !== null && colorScheme !== void 0 ? colorScheme : 'standard'];
94
- };
95
-
96
- /** Deleted text appearance (grey and strikethrough) without the highlight. */
97
- var deletedTextOnlyStyle = function deletedTextOnlyStyle(colors, isActive) {
98
- return (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_show_diff_color_scheme_refactor') ? (0, _factory.buildDeletedInlineStyleStandard)(colors, isActive ? 'active' : 'default') : isActive ? (0, _standard.getStandardDeletedContentStyleActive)() : (0, _standard.getStandardDeletedContentStyle)();
99
- };
100
-
101
- /**
102
- * Resolve reveal attribute and style for a decoration. Returned style REPLACES the decoration's
103
- * highlight (not an addition) so the animation has something to wipe. Gate resolved in showDiff
104
- * command for single shared answer between decorations and animation.
105
- */
106
- var resolveRevealStyle = exports.resolveRevealStyle = function resolveRevealStyle(_ref4) {
107
- var colorScheme = _ref4.colorScheme,
108
- _ref4$hideAddedDiffsU = _ref4.hideAddedDiffsUnderline,
109
- hideAddedDiffsUnderline = _ref4$hideAddedDiffsU === void 0 ? false : _ref4$hideAddedDiffsU,
110
- _ref4$includeDeletedT = _ref4.includeDeletedTextStyle,
111
- includeDeletedTextStyle = _ref4$includeDeletedT === void 0 ? true : _ref4$includeDeletedT,
112
- isActive = _ref4.isActive,
113
- isInserted = _ref4.isInserted,
114
- reveal = _ref4.reveal;
115
- if ((reveal === null || reveal === void 0 ? void 0 : reveal.mode) !== 'phased' || !schemeSupportsReveal(colorScheme)) {
116
- return undefined;
117
- }
118
- var colors = getColorScheme(colorScheme);
119
- var brand = isInserted && Object.prototype.hasOwnProperty.call(_agentBrandColorSchemes.agentBrandColorSchemes, colors.insertColor) ? _agentBrandColorSchemes.agentBrandColorSchemes[colors.insertColor] : undefined;
120
- var _resolveRevealColors = resolveRevealColors(colors, {
121
- hideAddedDiffsUnderline: hideAddedDiffsUnderline,
122
- isActive: isActive,
123
- isInserted: isInserted
124
- }),
125
- background = _resolveRevealColors.background,
126
- border = _resolveRevealColors.border;
127
- return {
128
- role: isInserted ? 'added' : 'deleted',
129
- style: (brand ? (0, _cssHelper.convertToInlineCss)({
130
- color: brand.text
131
- }) : '') + (isInserted || !includeDeletedTextStyle ? '' : deletedTextOnlyStyle(colors, isActive)) + revealBaseStyle + buildWipeableBackground(background) + buildRevealVariables({
132
- background: background,
133
- border: border
134
- })
135
- };
136
- };
137
-
138
- /** Reveal style for imperatively-built elements (deleted-content widget wrappers). */
139
- var applyRevealToElement = exports.applyRevealToElement = function applyRevealToElement(_ref5) {
140
- var colorScheme = _ref5.colorScheme,
141
- element = _ref5.element,
142
- hideAddedDiffsUnderline = _ref5.hideAddedDiffsUnderline,
143
- isActive = _ref5.isActive,
144
- isInserted = _ref5.isInserted,
145
- reveal = _ref5.reveal;
146
- var resolved = resolveRevealStyle({
147
- colorScheme: colorScheme,
148
- hideAddedDiffsUnderline: hideAddedDiffsUnderline,
149
- isActive: isActive,
150
- isInserted: isInserted,
151
- reveal: reveal,
152
- // The widget supplies the deleted text's own grey/strikethrough styling already.
153
- includeDeletedTextStyle: false
154
- });
155
- if (!resolved) {
156
- return '';
157
- }
158
- element.setAttribute(REVEAL_ATTR, resolved.role);
159
- return resolved.style;
160
- };