@atlaskit/editor-plugin-show-diff 6.2.17 → 6.2.19
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 +13 -0
- package/README.md +43 -1
- package/docs/0-intro.tsx +56 -1
- package/package.json +15 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-show-diff
|
|
2
2
|
|
|
3
|
+
## 6.2.19
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 6.2.18
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`fa146e17e08d6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fa146e17e08d6) -
|
|
14
|
+
Update README.md and 0-intro.tsx
|
|
15
|
+
|
|
3
16
|
## 6.2.17
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1 +1,43 @@
|
|
|
1
|
-
# Editor
|
|
1
|
+
# Editor Plugin Show Diff
|
|
2
|
+
|
|
3
|
+
Show Diff plugin for @atlaskit/editor-core
|
|
4
|
+
|
|
5
|
+
**Note:** This component is designed for internal Atlassian development.
|
|
6
|
+
External contributors will be able to use this component but will not be able to submit issues.
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
The Show Diff plugin provides visual diff visualization capabilities for the Atlassian Editor. It highlights changes made to document content by displaying additions, deletions, and modifications with configurable color schemes. The plugin integrates with ProseMirror to calculate and render diff decorations based on document steps.
|
|
11
|
+
|
|
12
|
+
## Key features
|
|
13
|
+
|
|
14
|
+
- **Visual diff highlighting** - Display changes as inline, block, and widget decorations
|
|
15
|
+
- **Multiple color schemes** - Support for 'standard' (purple) and 'traditional' (green/red) highlighting
|
|
16
|
+
- **Change navigation** - Scroll through and navigate between different changes in the document
|
|
17
|
+
- **Flexible configuration** - Configurable color schemes and diff parameters
|
|
18
|
+
- **ProseMirror integration** - Works seamlessly with ProseMirror steps and transactions
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
---
|
|
22
|
+
- **Install** - *yarn add @atlaskit/editor-plugin-show-diff*
|
|
23
|
+
- **npm** - [@atlaskit/editor-plugin-show-diff](https://www.npmjs.com/package/@atlaskit/editor-plugin-show-diff)
|
|
24
|
+
- **Source** - [Bitbucket](https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/editor/editor-plugin-show-diff)
|
|
25
|
+
- **Bundle** - [unpkg.com](https://unpkg.com/@atlaskit/editor-plugin-show-diff/dist/)
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
---
|
|
29
|
+
**Internal use only**
|
|
30
|
+
|
|
31
|
+
@atlaskit/editor-plugin-show-diff is intended for internal use by the @atlaskit/editor-core and as a plugin dependency of the Editor within your product.
|
|
32
|
+
|
|
33
|
+
Direct use of this component is not supported.
|
|
34
|
+
|
|
35
|
+
Please see [Atlaskit - Editor plugin show diff](https://atlaskit.atlassian.com/packages/editor/editor-plugin-show-diff) for documentation and examples for this package.
|
|
36
|
+
|
|
37
|
+
## Support
|
|
38
|
+
---
|
|
39
|
+
For internal Atlassian, visit the slack channel [#help-editor](https://atlassian.slack.com/archives/CFG3PSQ9E) for support or visit [go/editor-help](https://go/editor-help) to submit a bug.
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
---
|
|
43
|
+
Please see [Atlassian Frontend - License](https://hello.atlassian.net/wiki/spaces/AF/pages/2589099144/Documentation#License) for more licensing information.
|
package/docs/0-intro.tsx
CHANGED
|
@@ -31,7 +31,62 @@ The \`dependencies\`, \`configuration\`, \`state\`, \`actions\`, and \`commands\
|
|
|
31
31
|
below:
|
|
32
32
|
|
|
33
33
|
${code`
|
|
34
|
-
type
|
|
34
|
+
export type ColorScheme = 'standard' | 'traditional';
|
|
35
|
+
export type DiffType = 'inline' | 'block';
|
|
36
|
+
export type DiffParams = {
|
|
37
|
+
/**
|
|
38
|
+
* Color scheme to use for displaying diffs.
|
|
39
|
+
* 'standard' (default) uses purple for highlighting changes
|
|
40
|
+
* 'traditional' uses green for additions and red for deletions
|
|
41
|
+
*/
|
|
42
|
+
colorScheme?: ColorScheme;
|
|
43
|
+
originalDoc: JSONDocNode;
|
|
44
|
+
/**
|
|
45
|
+
* Prosemirror steps. This is used to calculate and show the diff in the editor
|
|
46
|
+
*/
|
|
47
|
+
steps: StepJson[];
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export type PMDiffParams = {
|
|
51
|
+
diffType?: DiffType;
|
|
52
|
+
isInverted?: boolean;
|
|
53
|
+
originalDoc: Node;
|
|
54
|
+
/**
|
|
55
|
+
* Prosemirror steps. This is used to calculate and show the diff in the editor
|
|
56
|
+
*/
|
|
57
|
+
steps: Step[];
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
type ACTION = 'SHOW_DIFF' | 'HIDE_DIFF' | 'SCROLL_TO_NEXT' | 'SCROLL_TO_PREVIOUS';
|
|
61
|
+
|
|
62
|
+
type ShowDiffPlugin = NextEditorPlugin<
|
|
63
|
+
'showDiff',
|
|
64
|
+
{
|
|
65
|
+
commands: {
|
|
66
|
+
hideDiff: EditorCommand;
|
|
67
|
+
scrollToNext: EditorCommand;
|
|
68
|
+
scrollToPrevious: EditorCommand;
|
|
69
|
+
showDiff: (config: PMDiffParams) => EditorCommand;
|
|
70
|
+
};
|
|
71
|
+
dependencies: [OptionalPlugin<AnalyticsPlugin>];
|
|
72
|
+
pluginConfiguration: DiffParams | undefined;
|
|
73
|
+
sharedState: {
|
|
74
|
+
/**
|
|
75
|
+
* The index of the current diff being viewed.
|
|
76
|
+
*/
|
|
77
|
+
activeIndex?: number;
|
|
78
|
+
/**
|
|
79
|
+
* Whether the show diff feature is currently displaying changes.
|
|
80
|
+
* Defaults to false.
|
|
81
|
+
*/
|
|
82
|
+
isDisplayingChanges: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* The number of changes being displayed
|
|
85
|
+
*/
|
|
86
|
+
numberOfChanges?: number;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
>;
|
|
35
90
|
`}
|
|
36
91
|
|
|
37
92
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-show-diff",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.19",
|
|
4
4
|
"description": "ShowDiff plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
35
35
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
36
36
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
37
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
38
|
-
"@atlaskit/tokens": "^
|
|
37
|
+
"@atlaskit/tmp-editor-statsig": "^59.1.0",
|
|
38
|
+
"@atlaskit/tokens": "^13.0.0",
|
|
39
39
|
"@babel/runtime": "^7.0.0",
|
|
40
40
|
"lodash": "^4.17.21",
|
|
41
41
|
"memoize-one": "^6.0.0",
|
|
@@ -43,10 +43,20 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@atlaskit/adf-utils": "^19.27.0",
|
|
46
|
-
"@
|
|
46
|
+
"@atlaskit/button": "^23.11.0",
|
|
47
|
+
"@atlaskit/css": "^0.19.0",
|
|
48
|
+
"@atlaskit/editor-core": "^217.12.0",
|
|
49
|
+
"@atlaskit/editor-json-transformer": "^8.31.0",
|
|
50
|
+
"@atlaskit/form": "^15.5.0",
|
|
51
|
+
"@atlaskit/primitives": "^19.0.0",
|
|
52
|
+
"@atlaskit/section-message": "^8.12.0",
|
|
53
|
+
"@atlaskit/textarea": "^8.2.0",
|
|
54
|
+
"@atlassian/confluence-presets": "workspace:^",
|
|
55
|
+
"@atlassian/content-reconciliation": "^0.1.3506",
|
|
56
|
+
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
47
57
|
},
|
|
48
58
|
"peerDependencies": {
|
|
49
|
-
"@atlaskit/editor-common": "^112.
|
|
59
|
+
"@atlaskit/editor-common": "^112.20.0",
|
|
50
60
|
"react": "^18.2.0"
|
|
51
61
|
},
|
|
52
62
|
"techstack": {
|