@atlaskit/editor-plugin-annotation 10.2.4 → 10.3.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
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-annotation
|
|
2
2
|
|
|
3
|
+
## 10.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`6fc4feadf6433`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6fc4feadf6433) -
|
|
8
|
+
Add optional onCreateError() to InlineCommentCreateComponentProps type
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
3
14
|
## 10.2.4
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -134,6 +134,15 @@ function InlineCommentView(_ref) {
|
|
|
134
134
|
}
|
|
135
135
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
136
136
|
,
|
|
137
|
+
onCreateError: function onCreateError(id) {
|
|
138
|
+
return (
|
|
139
|
+
// This is called when optimistic create inline comment encounters an error,
|
|
140
|
+
// in which case the optimistically added annotation must be removed.
|
|
141
|
+
(0, _editorCommands.removeInlineCommentNearSelection)(id, inlineCommentProvider.supportedBlockNodes)(editorView.state, editorView.dispatch)
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
145
|
+
,
|
|
137
146
|
onClose: function onClose() {
|
|
138
147
|
if (!isAnnotationManagerEnabled) {
|
|
139
148
|
(0, _editorCommands.setInlineCommentDraftState)(editorAnalyticsAPI, undefined, editorAPI)(false)(editorView.state, editorView.dispatch);
|
|
@@ -134,6 +134,12 @@ export function InlineCommentView({
|
|
|
134
134
|
}
|
|
135
135
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
136
136
|
,
|
|
137
|
+
onCreateError: id =>
|
|
138
|
+
// This is called when optimistic create inline comment encounters an error,
|
|
139
|
+
// in which case the optimistically added annotation must be removed.
|
|
140
|
+
removeInlineCommentNearSelection(id, inlineCommentProvider.supportedBlockNodes)(editorView.state, editorView.dispatch)
|
|
141
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
142
|
+
,
|
|
137
143
|
onClose: () => {
|
|
138
144
|
if (!isAnnotationManagerEnabled) {
|
|
139
145
|
setInlineCommentDraftState(editorAnalyticsAPI, undefined, editorAPI)(false)(editorView.state, editorView.dispatch);
|
|
@@ -127,6 +127,15 @@ export function InlineCommentView(_ref) {
|
|
|
127
127
|
}
|
|
128
128
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
129
129
|
,
|
|
130
|
+
onCreateError: function onCreateError(id) {
|
|
131
|
+
return (
|
|
132
|
+
// This is called when optimistic create inline comment encounters an error,
|
|
133
|
+
// in which case the optimistically added annotation must be removed.
|
|
134
|
+
removeInlineCommentNearSelection(id, inlineCommentProvider.supportedBlockNodes)(editorView.state, editorView.dispatch)
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
138
|
+
,
|
|
130
139
|
onClose: function onClose() {
|
|
131
140
|
if (!isAnnotationManagerEnabled) {
|
|
132
141
|
setInlineCommentDraftState(editorAnalyticsAPI, undefined, editorAPI)(false)(editorView.state, editorView.dispatch);
|
|
@@ -44,6 +44,10 @@ export type InlineCommentCreateComponentProps = AnnotationComponentProps & {
|
|
|
44
44
|
* Creates an annotation mark in the document with the given id.
|
|
45
45
|
*/
|
|
46
46
|
onCreate: (id: string) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Deletes an annotation mark in the document with the given id.
|
|
49
|
+
*/
|
|
50
|
+
onCreateError?: (id: string) => void;
|
|
47
51
|
};
|
|
48
52
|
export type InlineCommentViewComponentProps = AnnotationComponentProps & {
|
|
49
53
|
/**
|
|
@@ -44,6 +44,10 @@ export type InlineCommentCreateComponentProps = AnnotationComponentProps & {
|
|
|
44
44
|
* Creates an annotation mark in the document with the given id.
|
|
45
45
|
*/
|
|
46
46
|
onCreate: (id: string) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Deletes an annotation mark in the document with the given id.
|
|
49
|
+
*/
|
|
50
|
+
onCreateError?: (id: string) => void;
|
|
47
51
|
};
|
|
48
52
|
export type InlineCommentViewComponentProps = AnnotationComponentProps & {
|
|
49
53
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-annotation",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.3.0",
|
|
4
4
|
"description": "Annotation plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@babel/runtime": "^7.0.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@atlaskit/editor-common": "^114.
|
|
46
|
+
"@atlaskit/editor-common": "^114.27.0",
|
|
47
47
|
"react": "^18.2.0",
|
|
48
48
|
"react-dom": "^18.2.0",
|
|
49
49
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|