@atlaskit/editor-plugin-show-diff 12.1.3 → 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 (31) hide show
  1. package/CHANGELOG.md +34 -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 +6 -1
  5. package/dist/cjs/pm-plugins/calculateDiff/computeDiffChanges.js +8 -1
  6. package/dist/cjs/pm-plugins/calculateDiff/diffBySteps.js +2 -1
  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 +6 -1
  13. package/dist/es2019/pm-plugins/calculateDiff/computeDiffChanges.js +8 -1
  14. package/dist/es2019/pm-plugins/calculateDiff/diffBySteps.js +2 -1
  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 +6 -1
  21. package/dist/esm/pm-plugins/calculateDiff/computeDiffChanges.js +8 -1
  22. package/dist/esm/pm-plugins/calculateDiff/diffBySteps.js +2 -1
  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/decorations/colorSchemes/factory.d.ts +101 -0
  29. package/dist/types/pm-plugins/decorations/colorSchemes/schemes.d.ts +5 -0
  30. package/dist/types/pm-plugins/decorations/colorSchemes/types.d.ts +38 -0
  31. package/package.json +4 -4
@@ -0,0 +1,101 @@
1
+ import type { DiffColorScheme } from './types';
2
+ /** Inline inserted content — default state. */
3
+ export declare function buildInsertStyle(colors: DiffColorScheme): string;
4
+ /** Inline insert style for content within a block node (no background, underline only). */
5
+ export declare function buildInsertStyleInBlock(colors: DiffColorScheme): string;
6
+ /** Extended insert style — background + border-bottom underline. */
7
+ export declare function buildInsertStyleExtended(colors: DiffColorScheme): string;
8
+ /** Extended insert style for content within a block node (border-bottom only, no background). */
9
+ export declare function buildInsertStyleInBlockExtended(colors: DiffColorScheme): string;
10
+ /** Active state of the extended insert style. */
11
+ export declare function buildInsertStyleExtendedActive(colors: DiffColorScheme): string;
12
+ /** Extended insert style without underline — background + padding only. */
13
+ export declare function buildInsertStyleExtendedNoUnderline(colors: DiffColorScheme): string;
14
+ /** Active state of the no-underline extended insert style. */
15
+ export declare function buildInsertStyleExtendedNoUnderlineActive(colors: DiffColorScheme): string;
16
+ /** No-underline extended insert style for block content (padding only). */
17
+ export declare function buildInsertStyleInBlockExtendedNoUnderline(_colors: DiffColorScheme): string;
18
+ /** Inline inserted content — active/focused state. */
19
+ export declare function buildInsertStyleActive(colors: DiffColorScheme): string;
20
+ /** Strikethrough for removed inline / widget content (non-marker decorations). */
21
+ export declare function buildDeletedInlineStyle(colors: DiffColorScheme, isActive: boolean): string;
22
+ /** Strikethrough line (unbounded span) for deleted content — default state. */
23
+ export declare function buildDeletedContentStyleUnbounded(colors: DiffColorScheme): string;
24
+ /** Strikethrough line (unbounded span) for deleted content — active state. */
25
+ export declare function buildDeletedContentStyleUnboundedActive(colors: DiffColorScheme): string;
26
+ /** Unbounded strikethrough overlay for deleted inline content (absolute positioned line). */
27
+ export declare function buildDeletedInlineStyleUnbounded(colors: DiffColorScheme): string;
28
+ /** Deleted lozenge-style quote node with box-shadow ring. */
29
+ export declare function buildDeletedStyleQuoteNodeWithLozenge(colors: DiffColorScheme): string;
30
+ /** Active state of the deleted lozenge-style quote node — stronger ring. */
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
+ export declare function buildDeletedStyleQuoteNode(colors: DiffColorScheme): string;
34
+ /** Quote node outline for deleted content — active state. */
35
+ export declare function buildDeletedStyleQuoteNodeActive(colors: DiffColorScheme): string;
36
+ /** Generic block node outline for deleted content — default state (small radius). */
37
+ export declare function buildDeletedBlockOutline(colors: DiffColorScheme): string;
38
+ /** Generic block node outline for deleted content — active state (small radius). */
39
+ export declare function buildDeletedBlockOutlineActive(colors: DiffColorScheme): string;
40
+ /** Generic block node outline for deleted content — default state (rounded/xsmall+1px radius). */
41
+ export declare function buildDeletedBlockOutlineRounded(colors: DiffColorScheme): string;
42
+ /** Generic block node outline for deleted content — active state (rounded/xsmall+1px radius). */
43
+ export declare function buildDeletedBlockOutlineRoundedActive(colors: DiffColorScheme): string;
44
+ /** Scroll-navigation "new" emphasis: 4px ring — default state (small radius). */
45
+ export declare function buildDeletedBlockOutlineNew(colors: DiffColorScheme): string;
46
+ /** Scroll-navigation "new" emphasis: 4px ring — default state (rounded radius). */
47
+ export declare function buildDeletedBlockOutlineRoundedNew(colors: DiffColorScheme): string;
48
+ /** Table row style for deleted rows. See `deletedRowTreatment`. */
49
+ export declare function buildDeletedRowStyle(colors: DiffColorScheme): string;
50
+ /** Quote node (blockquote) left-border style for inserted content — default state. */
51
+ export declare function buildInsertStyleQuoteNode(colors: DiffColorScheme): string;
52
+ /** Quote node left-border style for inserted content — "new" scroll-nav state. */
53
+ export declare function buildInsertStyleQuoteNodeNew(colors: DiffColorScheme): string;
54
+ /** Quote node left-border style for inserted content — active state. */
55
+ export declare function buildInsertStyleQuoteNodeActive(colors: DiffColorScheme): string;
56
+ /** Horizontal rule style for inserted content — default state. */
57
+ export declare function buildInsertStyleRuleNode(colors: DiffColorScheme): string;
58
+ /** Horizontal rule style for inserted content — "new" scroll-nav state. */
59
+ export declare function buildInsertStyleRuleNodeNew(colors: DiffColorScheme): string;
60
+ /** Horizontal rule style for inserted content — active state. */
61
+ export declare function buildInsertStyleRuleNodeActive(colors: DiffColorScheme): string;
62
+ /** Generic node outline for inserted content — default state (small radius). */
63
+ export declare function buildInsertStyleNode(colors: DiffColorScheme): string;
64
+ /** Generic node outline for inserted content — "new" scroll-nav state (small radius). */
65
+ export declare function buildInsertStyleNodeNew(colors: DiffColorScheme): string;
66
+ /** Generic node outline for inserted content — active state (small radius). */
67
+ export declare function buildInsertStyleNodeActive(colors: DiffColorScheme): string;
68
+ /** Card block node outline for inserted content — default state (medium radius). */
69
+ export declare function buildInsertStyleCardBlockNode(colors: DiffColorScheme): string;
70
+ /** Card block node outline for inserted content — "new" scroll-nav state (medium radius). */
71
+ export declare function buildInsertStyleCardBlockNodeNew(colors: DiffColorScheme): string;
72
+ /** Card block node outline for inserted content — active state (medium radius). */
73
+ export declare function buildInsertStyleCardBlockNodeActive(colors: DiffColorScheme): string;
74
+ /** CSS variables for an inserted node decoration marker — default state. */
75
+ export declare function buildDecorationMarkerVariable(colors: DiffColorScheme): string;
76
+ /** CSS variables for an inserted node decoration marker — "new" scroll-nav state. */
77
+ export declare function buildDecorationMarkerVariableNew(colors: DiffColorScheme): string;
78
+ /** CSS variables for an inserted node decoration marker — active state. */
79
+ export declare function buildDecorationMarkerVariableActive(colors: DiffColorScheme): string;
80
+ /** Deleted node decoration marker (extension / embedCard / listItem) — default state. */
81
+ export declare function buildDeletedDecorationMarkerVariable(colors: DiffColorScheme): string;
82
+ /** Opacity only, no position or strikethrough. Used by the standard scheme. */
83
+ export declare function buildDeletedDecorationMarkerVariableSimple(colors: DiffColorScheme): string;
84
+ /** Extended deleted inline style — background highlight + border-bottom underline (standard scheme). */
85
+ export declare function buildDeletedInlineContentStyleExtended(colors: DiffColorScheme): string;
86
+ /** Standard deleted inline style — colours the glyph itself, not just the strikethrough. */
87
+ export declare function buildDeletedInlineStyleStandard(colors: DiffColorScheme, state: 'default' | 'new' | 'active'): string;
88
+ /** Deleted node decoration marker — "new" state. */
89
+ export declare function buildDeletedDecorationMarkerVariableNew(colors: DiffColorScheme): string;
90
+ /** Deleted node decoration marker — active state. */
91
+ export declare function buildDeletedDecorationMarkerVariableActive(colors: DiffColorScheme): string;
92
+ /** Cell overlay for added table cells — default state. Stacking order varies by scheme. */
93
+ export declare function buildAddedCellOverlayStyle(colors: DiffColorScheme): string;
94
+ /** Added cell overlay — rounded variant. See `roundedAddedCellOverlayInheritsBorder`. */
95
+ export declare function buildAddedCellOverlayRoundedStyle(colors: DiffColorScheme): string;
96
+ /** Cell overlay for added table cells — "new" scroll-nav state. */
97
+ export declare function buildAddedCellOverlayStyleNew(colors: DiffColorScheme): string;
98
+ /** Cell overlay for deleted table cells — default state (zIndex 1). Uses deletedCellColor. */
99
+ export declare function buildDeletedCellOverlayStyle(colors: DiffColorScheme): string;
100
+ /** Cell overlay for deleted table cells — rounded variant (zIndex 2, inherits border/radius). */
101
+ export declare function buildDeletedCellOverlayRoundedStyle(colors: DiffColorScheme): string;
@@ -0,0 +1,5 @@
1
+ import type { DiffColorScheme } from './types';
2
+ /** Green insertions, red deletions. */
3
+ export declare const traditionalScheme: DiffColorScheme;
4
+ /** Purple insertions, gray deletions (red on active). */
5
+ export declare const standardScheme: DiffColorScheme;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * ADS accent colours for which every token path used by `factory.ts` exists. Closed set, so
3
+ * interpolating a colour name into a token path is compile-time safe.
4
+ */
5
+ export type AdsAccentColor = 'green' | 'teal' | 'blue' | 'purple' | 'red' | 'orange' | 'yellow' | 'magenta' | 'gray';
6
+ /**
7
+ * A show-diff colour scheme. Colour fields are accent names that `factory.ts` expands into token
8
+ * paths; the rest encode structural differences between schemes that no colour can express. Ring
9
+ * widths, padding, radius and pointer-events are fixed in the factory, not per scheme.
10
+ */
11
+ export type DiffColorScheme = {
12
+ /** Stacking order of the square added-cell overlay. The rounded variant is always 2. */
13
+ addedCellOverlayZIndex: 1 | 2;
14
+ /** Deleted inline content, active/focused state. */
15
+ deleteActiveColor: AdsAccentColor;
16
+ /** Deleted inline content. */
17
+ deleteColor: AdsAccentColor;
18
+ /** Active deleted-block ring: pale `background.accent.*.subtler.pressed` vs saturated `border.accent.*`. */
19
+ deletedBlockOutlineActiveEmphasis: 'background' | 'border';
20
+ /** Deleted cell outline: `color.border.disabled` hairline vs opaque accent border. */
21
+ deletedCellBorderProminence: 'subtle' | 'accent';
22
+ /** Deleted cell overlays. Gray in both current schemes. */
23
+ deletedCellColor: AdsAccentColor;
24
+ /** Deleted blockquote default state: 1px ring with padding, or a 2px left border. Active is always a ring. */
25
+ deletedQuoteNodeShape: 'ring' | 'borderLeft';
26
+ /** Deleted row de-emphasis: colour the strikethrough, or tint the text. Both read `deleteColor`. */
27
+ deletedRowTreatment: 'strikeColor' | 'textTint';
28
+ /** Inserted content, active/focused state. */
29
+ insertActiveColor: AdsAccentColor;
30
+ /** Inserted content, default state. */
31
+ insertColor: AdsAccentColor;
32
+ /** Opacity of the inserted cell overlay background. */
33
+ insertedCellOpacity: number;
34
+ /** `text-decoration-style` for the inserted-text underline. */
35
+ insertUnderlineStyle: 'solid' | 'dotted';
36
+ /** Whether the rounded added-cell overlay inherits the cell's `border`. Deleted always does. */
37
+ roundedAddedCellOverlayInheritsBorder: boolean;
38
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-show-diff",
3
- "version": "12.1.3",
3
+ "version": "12.1.4",
4
4
  "description": "ShowDiff plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -27,7 +27,7 @@
27
27
  "@atlaskit/editor-prosemirror": "^8.0.0",
28
28
  "@atlaskit/editor-tables": "^3.0.0",
29
29
  "@atlaskit/platform-feature-flags": "^2.1.0",
30
- "@atlaskit/tmp-editor-statsig": "^147.0.0",
30
+ "@atlaskit/tmp-editor-statsig": "^147.1.0",
31
31
  "@atlaskit/tokens": "^16.7.0",
32
32
  "@babel/runtime": "^7.0.0",
33
33
  "@compiled/react": "^1.0.2",
@@ -40,7 +40,7 @@
40
40
  "@atlaskit/button": "^25.0.0",
41
41
  "@atlaskit/css": "^1.0.0",
42
42
  "@atlaskit/dropdown-menu": "^18.0.0",
43
- "@atlaskit/editor-core": "^223.1.0",
43
+ "@atlaskit/editor-core": "^223.2.0",
44
44
  "@atlaskit/editor-json-transformer": "^9.2.0",
45
45
  "@atlaskit/form": "^17.0.0",
46
46
  "@atlaskit/primitives": "^22.2.0",
@@ -53,7 +53,7 @@
53
53
  "react-intl": "^7.0.0"
54
54
  },
55
55
  "peerDependencies": {
56
- "@atlaskit/editor-common": "^118.10.0",
56
+ "@atlaskit/editor-common": "^118.12.0",
57
57
  "react": "^18.2.0 || ^19.2.0"
58
58
  },
59
59
  "techstack": {