@atlaskit/editor-plugin-track-changes 7.0.29 → 7.0.31
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 +16 -0
- package/README.md +31 -1
- package/dist/cjs/pm-plugins/main.js +1 -1
- package/dist/es2019/pm-plugins/main.js +1 -1
- package/dist/esm/pm-plugins/main.js +1 -1
- package/dist/types/pm-plugins/invertableStep.d.ts +1 -1
- package/dist/types/pm-plugins/main.d.ts +1 -1
- package/dist/types/trackChangesPluginType.d.ts +1 -1
- package/dist/types/ui/TrackChangesToolbarButton.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/invertableStep.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/trackChangesPluginType.d.ts +1 -1
- package/dist/types-ts4.5/ui/TrackChangesToolbarButton.d.ts +2 -2
- package/docs/0-intro.tsx +24 -6
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-track-changes
|
|
2
2
|
|
|
3
|
+
## 7.0.31
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`7b7c52dff5d7d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7b7c52dff5d7d) -
|
|
8
|
+
Fix eslint violations for type import syntax
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 7.0.30
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`9ff7d1c1aa288`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9ff7d1c1aa288) -
|
|
16
|
+
Update README.md and 0-intro.tsx
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 7.0.29
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
|
-
# Editor
|
|
1
|
+
# Editor Plugin Track Changes
|
|
2
2
|
|
|
3
3
|
Track changes plugin for @atlaskit/editor-core
|
|
4
4
|
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The Track Changes plugin enables tracking and display of document changes in the Atlassian Editor. It integrates with the Show Diff plugin to visualize content modifications and provides commands to toggle the display of changes and reset the baseline for comparison.
|
|
8
|
+
|
|
9
|
+
## Key features
|
|
10
|
+
|
|
11
|
+
- **Toggle change display** - Show or hide tracked changes in the editor using the `toggleChanges` command
|
|
12
|
+
- **Baseline reset** - Reset the baseline used for tracking changes with the `resetBaseline` command
|
|
13
|
+
- **Toolbar integration** - Optionally display a track changes button in the editor toolbar
|
|
14
|
+
- **Shared state** - Access the state of change display and diff availability through shared plugin state
|
|
15
|
+
- **Show Diff integration** - Works seamlessly with the Show Diff plugin for visual change representation
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
- **Install** - `yarn add @atlaskit/editor-plugin-track-changes`
|
|
20
|
+
- **npm** - [@atlaskit/editor-plugin-track-changes](https://www.npmjs.com/package/@atlaskit/editor-plugin-track-changes)
|
|
21
|
+
- **Source** - [Bitbucket](https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/editor/editor-plugin-track-changes)
|
|
22
|
+
- **Bundle** - [unpkg.com](https://unpkg.com/@atlaskit/editor-plugin-track-changes/dist/)
|
|
23
|
+
|
|
5
24
|
## Usage
|
|
6
25
|
|
|
26
|
+
### Import
|
|
27
|
+
|
|
7
28
|
`import { trackChangesPlugin } from '@atlaskit/editor-plugin-track-changes';`
|
|
8
29
|
|
|
9
30
|
### Dependencies
|
|
@@ -13,6 +34,7 @@ Track changes plugin for @atlaskit/editor-core
|
|
|
13
34
|
|
|
14
35
|
**Optional:**
|
|
15
36
|
- `PrimaryToolbarPlugin` - Required if using `showOnToolbar: true`
|
|
37
|
+
- `ToolbarPlugin` - Alternative toolbar plugin for registering the track changes button
|
|
16
38
|
|
|
17
39
|
### Configuration
|
|
18
40
|
|
|
@@ -87,3 +109,11 @@ export default Editor;
|
|
|
87
109
|
```
|
|
88
110
|
|
|
89
111
|
Detailed docs and example usage can be found [here](https://atlaskit.atlassian.com/packages/editor/editor-plugin-track-changes).
|
|
112
|
+
|
|
113
|
+
## Support
|
|
114
|
+
|
|
115
|
+
For support, visit the [#help-editor](https://atlassian.slack.com/archives/CFG3PSQ9E) Slack channel or submit an issue via [go/editor-help](https://go/editor-help).
|
|
116
|
+
|
|
117
|
+
## License
|
|
118
|
+
|
|
119
|
+
Please see [Atlassian Frontend - License](https://hello.atlassian.net/wiki/spaces/AF/pages/2589099144/Documentation#License) for more licensing information.
|
|
@@ -42,7 +42,7 @@ var getBaselineFromSteps = exports.getBaselineFromSteps = function getBaselineFr
|
|
|
42
42
|
_iterator.f();
|
|
43
43
|
}
|
|
44
44
|
return doc;
|
|
45
|
-
} catch (
|
|
45
|
+
} catch (_unused) {
|
|
46
46
|
// Temporary - we need to understand how this happens - but we want to unblock issues where this crashes the editor
|
|
47
47
|
return undefined;
|
|
48
48
|
}
|
|
@@ -35,7 +35,7 @@ export var getBaselineFromSteps = function getBaselineFromSteps(doc, steps) {
|
|
|
35
35
|
_iterator.f();
|
|
36
36
|
}
|
|
37
37
|
return doc;
|
|
38
|
-
} catch (
|
|
38
|
+
} catch (_unused) {
|
|
39
39
|
// Temporary - we need to understand how this happens - but we want to unblock issues where this crashes the editor
|
|
40
40
|
return undefined;
|
|
41
41
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import {
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import type { TrackChangesPlugin } from '../trackChangesPluginType';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { HistoryPlugin } from '@atlaskit/editor-plugin-history';
|
|
3
|
-
import {
|
|
3
|
+
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
|
4
4
|
import type { ShowDiffPlugin } from '@atlaskit/editor-plugin-show-diff';
|
|
5
5
|
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
6
6
|
export interface TrackChangesPluginOptions {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { TrackChangesPlugin } from '../trackChangesPluginType';
|
|
4
4
|
type TrackChangesToolbarButtonProps = {
|
|
5
5
|
api: ExtractInjectionAPI<TrackChangesPlugin> | undefined;
|
|
6
6
|
wrapper?: React.ComponentType<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import {
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import type { TrackChangesPlugin } from '../trackChangesPluginType';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { HistoryPlugin } from '@atlaskit/editor-plugin-history';
|
|
3
|
-
import {
|
|
3
|
+
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
|
4
4
|
import type { ShowDiffPlugin } from '@atlaskit/editor-plugin-show-diff';
|
|
5
5
|
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
6
6
|
export interface TrackChangesPluginOptions {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { TrackChangesPlugin } from '../trackChangesPluginType';
|
|
4
4
|
type TrackChangesToolbarButtonProps = {
|
|
5
5
|
api: ExtractInjectionAPI<TrackChangesPlugin> | undefined;
|
|
6
6
|
wrapper?: React.ComponentType<{
|
package/docs/0-intro.tsx
CHANGED
|
@@ -31,10 +31,26 @@ The \`dependencies\`, \`configuration\`, \`state\`, \`actions\`, and \`commands\
|
|
|
31
31
|
below:
|
|
32
32
|
|
|
33
33
|
${code`
|
|
34
|
+
interface TrackChangesPluginOptions {
|
|
35
|
+
/**
|
|
36
|
+
* Custom wrapper component for the track changes button.
|
|
37
|
+
*/
|
|
38
|
+
ButtonWrapper?: React.ComponentType<{ children: React.ReactNode }>;
|
|
39
|
+
/**
|
|
40
|
+
* Whether the track changes button should be shown on the toolbar.
|
|
41
|
+
* Defaults to false.
|
|
42
|
+
*/
|
|
43
|
+
showOnToolbar?: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
34
46
|
type TrackChangesPlugin = NextEditorPlugin<
|
|
35
47
|
'trackChanges',
|
|
36
48
|
{
|
|
37
49
|
commands: {
|
|
50
|
+
/**
|
|
51
|
+
* Resets the baseline used for tracking changes in the editor.
|
|
52
|
+
*/
|
|
53
|
+
resetBaseline: EditorCommand;
|
|
38
54
|
/**
|
|
39
55
|
* Toggles the displaying of changes in the editor.
|
|
40
56
|
*/
|
|
@@ -45,18 +61,20 @@ type TrackChangesPlugin = NextEditorPlugin<
|
|
|
45
61
|
* Primary toolbar plugin for registering the track changes button.
|
|
46
62
|
*/
|
|
47
63
|
OptionalPlugin<PrimaryToolbarPlugin>,
|
|
64
|
+
/**
|
|
65
|
+
* For ensuring the tracked changes align with the history
|
|
66
|
+
*/
|
|
67
|
+
OptionalPlugin<HistoryPlugin>,
|
|
48
68
|
/**
|
|
49
69
|
* Show diff plugin for showing the changes in a diff view.
|
|
50
70
|
*/
|
|
51
71
|
ShowDiffPlugin,
|
|
52
|
-
];
|
|
53
|
-
pluginConfiguration?: {
|
|
54
72
|
/**
|
|
55
|
-
*
|
|
56
|
-
* Defaults to false.
|
|
73
|
+
* Toolbar plugin for registering the track changes button. Will be replacing the Primary Toolbar Plugin
|
|
57
74
|
*/
|
|
58
|
-
|
|
59
|
-
|
|
75
|
+
OptionalPlugin<ToolbarPlugin>,
|
|
76
|
+
];
|
|
77
|
+
pluginConfiguration?: TrackChangesPluginOptions;
|
|
60
78
|
sharedState: {
|
|
61
79
|
/**
|
|
62
80
|
* Whether the track changes feature is currently displaying changes.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-track-changes",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.31",
|
|
4
4
|
"description": "ShowDiff plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/button": "^23.11.0",
|
|
32
32
|
"@atlaskit/editor-plugin-history": "8.0.1",
|
|
33
33
|
"@atlaskit/editor-plugin-primary-toolbar": "^9.0.0",
|
|
34
|
-
"@atlaskit/editor-plugin-show-diff": "6.2.
|
|
34
|
+
"@atlaskit/editor-plugin-show-diff": "6.2.16",
|
|
35
35
|
"@atlaskit/editor-plugin-toolbar": "^5.1.0",
|
|
36
36
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
37
37
|
"@atlaskit/editor-toolbar": "^0.20.0",
|